Browse Source

Bug fixes to bookmarklet and pin-form

tags/v1.0.0
Isaac Bythewood 11 years ago
parent
commit
ec27f1cfb8
2 changed files with 26 additions and 5 deletions
  1. +25
    -4
      pinry/static/js/bookmarklet.js
  2. +1
    -1
      pinry/static/js/pin-form.js

+ 25
- 4
pinry/static/js/bookmarklet.js View File

@@ -47,12 +47,31 @@ $(document).ready(function() {
'position': 'absolute', 'position': 'absolute',
'z-index': '9001', 'z-index': '9001',
'background': 'rgba(0, 0, 0, 0.7)', 'background': 'rgba(0, 0, 0, 0.7)',
'padding-top': '70px',
'top': '0', 'top': '0',
'left': '0', 'left': '0',
'right': '0', 'right': '0',
'height': $(document).height()
'height': $(document).height(),
'text-align': 'center',
'width': '100%'
}); });
return $('body').append(pinryImages);
var pinryBar = document.createElement('div');
pinryBar.id = 'pinry-bar';
$(pinryBar).css({
'background': 'black',
'padding': '15px',
'position': 'fixed',
'z-index': '9002',
'width': '100%',
'top': 0,
'border-bottom': '1px solid #555',
'color': 'white',
'text-align': 'center',
'font-size': '22px'
});
$('body').append(pinryImages);
$('#pinry-images').append(pinryBar);
$('#pinry-bar').html('Pinry Bookmarklet');
} }


function imageView(imageUrl) { function imageView(imageUrl) {
@@ -67,7 +86,8 @@ $(document).ready(function() {
'width': '200px', 'width': '200px',
'height': '200px', 'height': '200px',
'margin': '15px', 'margin': '15px',
'cursor': 'pointer'
'cursor': 'pointer',
'border': '1px solid #555'
}); });
$(image).click(function() { $(image).click(function() {
var popUrl = getFormUrl()+imageUrl; var popUrl = getFormUrl()+imageUrl;
@@ -83,7 +103,8 @@ $(document).ready(function() {
function addAllImagesToPageView() { function addAllImagesToPageView() {
var images = $('body').find('img'); var images = $('body').find('img');
images.each(function() { images.each(function() {
imageView($(this).attr('src'));
if ($(this).width() > 200 && $(this).height() > 200)
imageView($(this).attr('src'));
}); });
return images; return images;
} }


+ 1
- 1
pinry/static/js/pin-form.js View File

@@ -87,7 +87,7 @@ $(window).load(function() {
}); });
// If bookmarklet submit // If bookmarklet submit
if (pinFromUrl) { if (pinFromUrl) {
$('#pin-form-image-upload').css('display', 'none');
$('#pin-form-image-upload').parent().parent().css('display', 'none');
$('#pin-form-image-url').val(pinFromUrl); $('#pin-form-image-url').val(pinFromUrl);
$('.navbar').css('display', 'none'); $('.navbar').css('display', 'none');
modal.css({ modal.css({


Loading…
Cancel
Save