]> git.wh0rd.org - tt-rss.git/blobdiff - plugins/share/share.js
remove ok = confirm() thing
[tt-rss.git] / plugins / share / share.js
index bbfb553d5c3cccea18cc46b11ed8e20d51123059..0fb2f1244e2ea8eb69a4e637b3030d202fa34df2 100644 (file)
@@ -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);
        }