mirror of
https://github.com/pinry/pinry.git
synced 2025-11-18 02:40:40 +01:00
Get basic working bookmarklet and refactor API into core
This commit is contained in:
@@ -51,6 +51,17 @@ $(window).load(function() {
|
||||
$('#pin-form-tags').bind('propertychange keyup input paste', function() {
|
||||
createPreview();
|
||||
});
|
||||
|
||||
function getURLParameter(name) {
|
||||
return decodeURI(
|
||||
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
|
||||
);
|
||||
}
|
||||
if (getURLParameter('pin-image-url') != 'null') {
|
||||
$('#pin-form-image-url').val(getURLParameter('pin-image-url'));
|
||||
createPreview();
|
||||
}
|
||||
|
||||
$('#pin-form-submit').click(function(e) {
|
||||
var tags = cleanTags();
|
||||
$.ajax({
|
||||
@@ -85,6 +96,8 @@ $(window).load(function() {
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#display-pin-form').length >= 1) createPinForm();
|
||||
|
||||
$('#call-pin-form').click(function() {
|
||||
createPinForm();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user