|
|
|
@ -14,15 +14,12 @@ function shareArticle(id) {
|
|
|
|
|
|
|
|
|
|
notify_progress("Trying to change URL...", true);
|
|
|
|
|
|
|
|
|
|
var query = "op=pluginhandler&plugin=share&method=newkey&id=" + param_escape(id);
|
|
|
|
|
const query = { op: "pluginhandler", plugin: "share", method: "newkey", id: id };
|
|
|
|
|
|
|
|
|
|
new Ajax.Request("backend.php", {
|
|
|
|
|
parameters: query,
|
|
|
|
|
onComplete: function(transport) {
|
|
|
|
|
var reply = JSON.parse(transport.responseText);
|
|
|
|
|
var new_link = reply.link;
|
|
|
|
|
|
|
|
|
|
var e = $('gen_article_url');
|
|
|
|
|
xhrJson("backend.php", query, (reply) => {
|
|
|
|
|
if (reply) {
|
|
|
|
|
const new_link = reply.link;
|
|
|
|
|
const e = $('gen_article_url');
|
|
|
|
|
|
|
|
|
|
if (new_link) {
|
|
|
|
|
|
|
|
|
@ -34,7 +31,7 @@ function shareArticle(id) {
|
|
|
|
|
|
|
|
|
|
new Effect.Highlight(e);
|
|
|
|
|
|
|
|
|
|
var img = $("SHARE-IMG-" + id);
|
|
|
|
|
const img = $("SHARE-IMG-" + id);
|
|
|
|
|
if (img) img.src = img.src.replace("notshared.png", "share.png");
|
|
|
|
|
|
|
|
|
|
notify('');
|
|
|
|
@ -42,8 +39,8 @@ function shareArticle(id) {
|
|
|
|
|
} else {
|
|
|
|
|
notify_error("Could not change URL.");
|
|
|
|
|
}
|
|
|
|
|
} });
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -52,18 +49,16 @@ function shareArticle(id) {
|
|
|
|
|
|
|
|
|
|
notify_progress("Trying to unshare...", true);
|
|
|
|
|
|
|
|
|
|
var query = "op=pluginhandler&plugin=share&method=unshare&id=" + param_escape(id);
|
|
|
|
|
const query = { op: "pluginhandler", plugin: "share", method: "unshare", id: id };
|
|
|
|
|
|
|
|
|
|
new Ajax.Request("backend.php", {
|
|
|
|
|
parameters: query,
|
|
|
|
|
onComplete: function(transport) {
|
|
|
|
|
xhrPost("backend.php", query, () => {
|
|
|
|
|
notify("Article unshared.");
|
|
|
|
|
|
|
|
|
|
var img = $("SHARE-IMG-" + id);
|
|
|
|
|
if (img) img.src = img.src.replace("share.png", "notshared.png");
|
|
|
|
|
|
|
|
|
|
dialog.hide();
|
|
|
|
|
} });
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
@ -71,7 +66,7 @@ function shareArticle(id) {
|
|
|
|
|
|
|
|
|
|
dialog.show();
|
|
|
|
|
|
|
|
|
|
var img = $("SHARE-IMG-" + id);
|
|
|
|
|
const img = $("SHARE-IMG-" + id);
|
|
|
|
|
if (img) img.src = img.src.replace("notshared.png", "share.png");
|
|
|
|
|
|
|
|
|
|
} catch (e) {
|
|
|
|
|