summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-07-11 16:20:24 +0400
committerAndrew Dolgov <[email protected]>2013-07-11 16:20:24 +0400
commitabb04b76a51eb871a45011da55efb222924d50ee (patch)
treee62eff2885f6ca14be3a0c90d6ed441f6a593b5f /plugins/share
parentab25a8064461a194d97dceaa014c68bfc395702b (diff)
share: indicate whether article is shared or not using the icon
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/init.php4
-rw-r--r--plugins/share/notshared.pngbin0 -> 657 bytes
-rw-r--r--plugins/share/share.js10
3 files changed, 13 insertions, 1 deletions
diff --git a/plugins/share/init.php b/plugins/share/init.php
index 552aa0a31..a000b8ebe 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -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
index 000000000..523575306
--- /dev/null
+++ b/plugins/share/notshared.png
Binary files differ
diff --git a/plugins/share/share.js b/plugins/share/share.js
index bbfb553d5..09c973ed8 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -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);
}