]>
git.wh0rd.org - tt-rss.git/blob - plugins/share/share.js
1 function shareArticle(id
) {
3 if (dijit
.byId("shareArticleDlg"))
4 dijit
.byId("shareArticleDlg").destroyRecursive();
6 var query
= "backend.php?op=pluginhandler&plugin=share&method=shareArticle¶m=" + param_escape(id
);
8 dialog
= new dijit
.Dialog({
10 title
: __("Share article by URL"),
11 style
: "width: 600px",
14 var ok
= confirm(__("Generate new share URL for this article?"));
18 notify_progress("Trying to change URL...", true);
20 var query
= "op=pluginhandler&plugin=share&method=newkey&id=" + param_escape(id
);
22 new Ajax
.Request("backend.php", {
24 onComplete: function(transport
) {
25 var reply
= JSON
.parse(transport
.responseText
);
26 var new_link
= reply
.link
;
28 var e
= $('gen_article_url');
32 e
.innerHTML
= e
.innerHTML
.replace(/\&key=.*$/,
33 "&key=" + new_link
);
35 e
.href
= e
.href
.replace(/\&key=.*$/,
38 new Effect
.Highlight(e
);
43 notify_error("Could not change URL.");
52 var ok
= confirm(__("Remove sharing for this article?"));
56 notify_progress("Trying to unshare...", true);
58 var query
= "op=pluginhandler&plugin=share&method=unshare&id=" + param_escape(id
);
60 new Ajax
.Request("backend.php", {
62 onComplete: function(transport
) {
63 notify("Article unshared.");
74 exception_error("shareArticle", e
);