Greatly improved bookmarklet pinning functionality, much better pin form

This commit is contained in:
Isaac Bythewood
2013-02-27 07:38:38 +00:00
parent 96af25f5fb
commit 7ee8fd6d98
6 changed files with 102 additions and 74 deletions

View File

@@ -18,7 +18,7 @@ function cleanTags(tags) {
tags = tags.split(',');
for (var i in tags) tags[i] = tags[i].trim();
}
return tags
return tags;
}
@@ -26,3 +26,21 @@ function getPinData(pinId) {
var apiUrl = '/api/v1/pin/'+pinId+'/?format=json';
return $.get(apiUrl);
}
function postPinData(data) {
return $.ajax({
type: "post",
url: "/api/v1/pin/",
contentType: 'application/json',
data: JSON.stringify(data)
});
}
function getUrlParameter(name) {
var decode = decodeURI(
(RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
);
if (decode == 'null') return null;
else return decode;
}