diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/note/init.php | 6 | ||||
-rw-r--r-- | plugins/note/note.png | bin | 500 -> 0 bytes | |||
-rw-r--r-- | plugins/share/init.php | 13 | ||||
-rw-r--r-- | plugins/share/notshared.png | bin | 657 -> 0 bytes | |||
-rw-r--r-- | plugins/share/share.css | 3 | ||||
-rw-r--r-- | plugins/share/share.js | 8 |
6 files changed, 17 insertions, 13 deletions
diff --git a/plugins/note/init.php b/plugins/note/init.php index ac908a5ba..d97bf678b 100644 --- a/plugins/note/init.php +++ b/plugins/note/init.php @@ -22,10 +22,8 @@ class Note extends Plugin { function hook_article_button($line) { - return "<img src=\"plugins/note/note.png\" - style=\"cursor : pointer\" style=\"cursor : pointer\" - onclick=\"Plugins.Note.edit(".$line["id"].")\" - class='tagsPic' title='".__('Edit article note')."'>"; + return "<i class='material-icons' onclick=\"Plugins.Note.edit(".$line["id"].")\" + style='cursor : pointer' title='".__('Edit article note')."'>note_add</i>"; } function edit() { diff --git a/plugins/note/note.png b/plugins/note/note.png Binary files differdeleted file mode 100644 index 244e6ca04..000000000 --- a/plugins/note/note.png +++ /dev/null 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 Binary files differdeleted file mode 100644 index 523575306..000000000 --- a/plugins/share/notshared.png +++ /dev/null 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"); } }; |