share: indicate whether article is shared or not using the icon

This commit is contained in:
Andrew Dolgov 2013-07-11 16:20:24 +04:00
parent ab25a80644
commit abb04b76a5
4 changed files with 15 additions and 1 deletions

View File

@ -2645,6 +2645,7 @@
num_comments, num_comments,
comments, comments,
int_id, int_id,
uuid,
hide_images, hide_images,
unread,feed_id,marked,published,link,last_read,orig_feed_id, unread,feed_id,marked,published,link,last_read,orig_feed_id,
last_marked, last_published, last_marked, last_published,
@ -2687,6 +2688,7 @@
"tag_cache," . "tag_cache," .
"label_cache," . "label_cache," .
"link," . "link," .
"uuid," .
"last_read," . "last_read," .
"(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) AS hide_images," . "(SELECT hide_images FROM ttrss_feeds WHERE id = feed_id) AS hide_images," .
"last_marked, last_published, " . "last_marked, last_published, " .

View File

@ -69,7 +69,9 @@ class Share extends Plugin {
} }
function hook_article_button($line) { 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\" class='tagsPic' style=\"cursor : pointer\"
onclick=\"shareArticle(".$line['int_id'].")\" onclick=\"shareArticle(".$line['int_id'].")\"
title='".__('Share by URL')."'>"; title='".__('Share by URL')."'>";

BIN
plugins/share/notshared.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

View File

@ -37,6 +37,9 @@ function shareArticle(id) {
new Effect.Highlight(e); new Effect.Highlight(e);
var img = $("SHARE-IMG-" + id);
if (img) img.src = img.src.replace("notshared.png", "share.png");
notify(''); notify('');
} else { } else {
@ -61,6 +64,10 @@ function shareArticle(id) {
parameters: query, parameters: query,
onComplete: function(transport) { onComplete: function(transport) {
notify("Article unshared."); notify("Article unshared.");
var img = $("SHARE-IMG-" + id);
if (img) img.src = img.src.replace("share.png", "notshared.png");
dialog.hide(); dialog.hide();
} }); } });
} }
@ -70,6 +77,9 @@ function shareArticle(id) {
dialog.show(); dialog.show();
var img = $("SHARE-IMG-" + id);
if (img) img.src = img.src.replace("notshared.png", "share.png");
} catch (e) { } catch (e) {
exception_error("shareArticle", e); exception_error("shareArticle", e);
} }