summaryrefslogtreecommitdiff
path: root/plugins/share
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-05 22:19:46 +0300
committerAndrew Dolgov <[email protected]>2018-12-05 22:19:46 +0300
commit9703162f57a91a570b61f51522db7446fd7175b6 (patch)
treeb3b21ec9b91e664441ac27af0fd80869c852d1fc /plugins/share
parentcd57fd33ccc2bab88e41e92428926b199fd93978 (diff)
plugins: note,shared - move to iconfont
Diffstat (limited to 'plugins/share')
-rw-r--r--plugins/share/init.php13
-rw-r--r--plugins/share/notshared.pngbin657 -> 0 bytes
-rw-r--r--plugins/share/share.css3
-rw-r--r--plugins/share/share.js8
4 files changed, 15 insertions, 9 deletions
diff --git a/plugins/share/init.php b/plugins/share/init.php
index 752e8ac1e..d71986e83 100644
--- a/plugins/share/init.php
+++ b/plugins/share/init.php
@@ -20,6 +20,10 @@ class Share extends Plugin {
return file_get_contents(dirname(__FILE__) . "/share.js");
}
+ function get_css() {
+ return file_get_contents(dirname(__FILE__) . "/share.css");
+ }
+
function get_prefs_js() {
return file_get_contents(dirname(__FILE__) . "/share_prefs.js");
}
@@ -72,12 +76,11 @@ class Share extends Plugin {
}
function hook_article_button($line) {
- $img = $line['uuid'] ? "share.png" : "notshared.png";
+ $img_class = $line['uuid'] ? "shared" : "";
- return "<img id='SHARE-IMG-".$line['int_id']."' src=\"plugins/share/$img\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"Plugins.Share.shareArticle(".$line['int_id'].")\"
- title='".__('Share by URL')."'>";
+ return "<i id='SHARE-IMG-".$line['int_id']."' class='material-icons icon-share $img_class'
+ style='cursor : pointer' onclick=\"Plugins.Share.shareArticle(".$line['int_id'].")\"
+ title='".__('Share by URL')."'>share</i>";
}
function shareArticle() {
diff --git a/plugins/share/notshared.png b/plugins/share/notshared.png
deleted file mode 100644
index 523575306..000000000
--- a/plugins/share/notshared.png
+++ /dev/null
Binary files differ
diff --git a/plugins/share/share.css b/plugins/share/share.css
new file mode 100644
index 000000000..00bad68dd
--- /dev/null
+++ b/plugins/share/share.css
@@ -0,0 +1,3 @@
+i.icon-share.shared {
+ color : #0a0;
+} \ No newline at end of file
diff --git a/plugins/share/share.js b/plugins/share/share.js
index 7366c2aff..c30dd03e0 100644
--- a/plugins/share/share.js
+++ b/plugins/share/share.js
@@ -32,7 +32,7 @@ Plugins.Share = {
new Effect.Highlight(e);
const img = $("SHARE-IMG-" + id);
- if (img) img.src = img.src.replace("notshared.png", "share.png");
+ img.addClassName("shared");
Notify.close();
@@ -54,8 +54,8 @@ Plugins.Share = {
xhrPost("backend.php", query, () => {
notify("Article unshared.");
- var img = $("SHARE-IMG-" + id);
- if (img) img.src = img.src.replace("share.png", "notshared.png");
+ const img = $("SHARE-IMG-" + id);
+ img.removeClassName("shared");
dialog.hide();
});
@@ -68,7 +68,7 @@ Plugins.Share = {
dialog.show();
const img = $("SHARE-IMG-" + id);
- if (img) img.src = img.src.replace("notshared.png", "share.png");
+ img.addClassName("shared");
}
};