]> git.wh0rd.org Git - tt-rss.git/commitdiff
share: indicate whether article is shared or not using the icon
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Jul 2013 12:20:24 +0000 (16:20 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Thu, 11 Jul 2013 12:20:24 +0000 (16:20 +0400)
include/functions.php
plugins/share/init.php
plugins/share/notshared.png [new file with mode: 0644]
plugins/share/share.js

index 35edd8d1a116313c4813e381331349f469c3b137..145f09804579b4951b299c7cbf477197ebbe2ba2 100644 (file)
                                                num_comments,
                                                comments,
                                                int_id,
+                                               uuid,
                                                hide_images,
                                                unread,feed_id,marked,published,link,last_read,orig_feed_id,
                                                last_marked, last_published,
                                                                "tag_cache," .
                                                                "label_cache," .
                                                                "link," .
+                                                               "uuid," .
                                                                "last_read," .
                                                                "(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) AS hide_images," .
                                                                "last_marked, last_published, " .
index 552aa0a3138787c1466ff7c00b568027ba4d2d6a..a000b8ebea2789500f615ead6097f9cb4a65fb2c 100644 (file)
@@ -69,7 +69,9 @@ class Share extends Plugin {
        }
 
        function hook_article_button($line) {
-               return "<img src=\"plugins/share/share.png\"
+               $img = $line['uuid'] ? "share.png" : "notshared.png";
+
+               return "<img id='SHARE-IMG-".$line['int_id']."' src=\"plugins/share/$img\"
                        class='tagsPic' style=\"cursor : pointer\"
                        onclick=\"shareArticle(".$line['int_id'].")\"
                        title='".__('Share by URL')."'>";
diff --git a/plugins/share/notshared.png b/plugins/share/notshared.png
new file mode 100644 (file)
index 0000000..5235753
Binary files /dev/null and b/plugins/share/notshared.png differ
index bbfb553d5c3cccea18cc46b11ed8e20d51123059..09c973ed843f8cc838e5a546f8baa4cf386dc7f6 100644 (file)
@@ -37,6 +37,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 {
@@ -61,6 +64,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 +77,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);
        }