diff options
author | Andrew Dolgov <[email protected]> | 2021-03-04 15:04:48 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-03-04 15:04:48 +0300 |
commit | a0fa1594cbed7bd70654f506e2104e724bde4ac4 (patch) | |
tree | 54a9ec7a9ccf9a59efc5cc302788bac5fa3aa9a6 /init.php |
initial
Diffstat (limited to 'init.php')
-rw-r--r-- | init.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/init.php b/init.php new file mode 100644 index 0000000..c1169fc --- /dev/null +++ b/init.php @@ -0,0 +1,33 @@ +<?php +class Close_Button extends Plugin { + private $host; + + function init($host) { + $this->host = $host; + + $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); + } + + function about() { + return array(null, + "Adds a button to close article panel", + "fox"); + } + + function get_css() { + return ".post .header .buttons i.material-icons.icon-close-article { color : red; }"; + } + + function hook_article_button($line) { + if (!get_pref(Prefs::COMBINED_DISPLAY_MODE)) { + return "<i class='material-icons icon-close-article' + style='cursor : pointer' onclick='Article.close()' + title='".__('Close article')."'>close</i>"; + } + } + + function api_version() { + return 2; + } + +} |