|
@@ -24,6 +24,10 @@ if (!window.jQuery) { |
|
|
function main() { |
|
|
function main() { |
|
|
var $ = jQuery; |
|
|
var $ = jQuery; |
|
|
|
|
|
|
|
|
|
|
|
function closePinry() { |
|
|
|
|
|
$('#pinry-images').add('#pinry-bookmarklet').remove(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// Start Helper Functions |
|
|
// Start Helper Functions |
|
|
function getFormUrl() { |
|
|
function getFormUrl() { |
|
|
var hostUrl = $('#pinry-bookmarklet').attr('src').split('/')[2]; |
|
|
var hostUrl = $('#pinry-bookmarklet').attr('src').split('/')[2]; |
|
@@ -65,7 +69,11 @@ function main() { |
|
|
}); |
|
|
}); |
|
|
$('body').append(pinryImages); |
|
|
$('body').append(pinryImages); |
|
|
$('#pinry-images').append(pinryBar); |
|
|
$('#pinry-images').append(pinryBar); |
|
|
$('#pinry-bar').html('Pinry Bookmarklet'); |
|
|
|
|
|
|
|
|
$('#pinry-bar').html('Pinry Bookmarklet').click(closePinry); |
|
|
|
|
|
$(document).keyup(function (e) { |
|
|
|
|
|
if (e.keyCode == 27) // ESC key |
|
|
|
|
|
closePinry(); |
|
|
|
|
|
}); |
|
|
$(window).scrollTop(0); |
|
|
$(window).scrollTop(0); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@@ -86,7 +94,7 @@ function main() { |
|
|
$(image).click(function() { |
|
|
$(image).click(function() { |
|
|
var popUrl = getFormUrl()+encodeURIComponent(imageUrl); |
|
|
var popUrl = getFormUrl()+encodeURIComponent(imageUrl); |
|
|
window.open(popUrl); |
|
|
window.open(popUrl); |
|
|
$('#pinry-images').remove(); |
|
|
|
|
|
|
|
|
closePinry(); |
|
|
}); |
|
|
}); |
|
|
return $('#pinry-images').append(image); |
|
|
return $('#pinry-images').append(image); |
|
|
} |
|
|
} |
|
|