X-Git-Url: https://git.wh0rd.org/?a=blobdiff_plain;f=plugins%2Fshare%2Fshare.js;h=0fb2f1244e2ea8eb69a4e637b3030d202fa34df2;hb=da1a3c2cc5621bccdb844cfbd03e377ada079fa9;hp=bbfb553d5c3cccea18cc46b11ed8e20d51123059;hpb=940e29a63789111c813d5c2d88c0e30071b113f0;p=tt-rss.git diff --git a/plugins/share/share.js b/plugins/share/share.js index bbfb553d..0fb2f124 100644 --- a/plugins/share/share.js +++ b/plugins/share/share.js @@ -10,10 +10,7 @@ function shareArticle(id) { title: __("Share article by URL"), style: "width: 600px", newurl: function() { - - var ok = confirm(__("Generate new share URL for this article?")); - - if (ok) { + if (confirm(__("Generate new share URL for this article?"))) { notify_progress("Trying to change URL...", true); @@ -37,6 +34,9 @@ function shareArticle(id) { new Effect.Highlight(e); + var img = $("SHARE-IMG-" + id); + if (img) img.src = img.src.replace("notshared.png", "share.png"); + notify(''); } else { @@ -48,10 +48,7 @@ function shareArticle(id) { }, unshare: function() { - - var ok = confirm(__("Remove sharing for this article?")); - - if (ok) { + if (confirm(__("Remove sharing for this article?"))) { notify_progress("Trying to unshare...", true); @@ -61,6 +58,10 @@ function shareArticle(id) { parameters: query, onComplete: function(transport) { notify("Article unshared."); + + var img = $("SHARE-IMG-" + id); + if (img) img.src = img.src.replace("share.png", "notshared.png"); + dialog.hide(); } }); } @@ -70,6 +71,9 @@ function shareArticle(id) { dialog.show(); + var img = $("SHARE-IMG-" + id); + if (img) img.src = img.src.replace("notshared.png", "share.png"); + } catch (e) { exception_error("shareArticle", e); }