mirror of
https://github.com/pinry/pinry.git
synced 2025-11-13 16:45:41 +01:00
Greatly improved bookmarklet pinning functionality, much better pin form
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user