diff --git a/Plugin.txt b/Plugin.txt deleted file mode 100644 index b364d9d..0000000 --- a/Plugin.txt +++ /dev/null @@ -1,56 +0,0 @@ -====== CodeButton Mod 1 Plugin (codebuttonmod1) ====== - ----- plugin ---- -description: Inserts a code button into the toolbar. -author : Georg Schmidt -email : gs-develop@gs-sys.de -type : action -lastupdate : 2021-01-09 -compatible : 2018-04-22b -depends : -similar : codebutton, custombuttons -tags : button, code, toolbar - -downloadurl: https://github.com/user9209/dokuwiki_plugin_codebutton/archive/master.zip -bugtracker: https://github.com/user9209/dokuwiki_plugin_codebutton/issues -sourcerepo: https://github.com/user9209/dokuwiki_plugin_codebutton/ -donationurl: - -screenshot_img : ----- - -===== Installation ===== - -Search and install the plugin **"codebuttonmod1"** using the Extension Manager. - -or - -Install the plugin over the webfrontend by using the url: - -https://github.com/user9209/dokuwiki_plugin_codebutton/archive/master.zip - -===== Syntax and Usage ===== - -After installation you'll find a new button at the end of your regular toolbar. Use them to add "''Insert_Code''" to your DokuWiki markup. - -=== Mod 1 contains === - * Default title is set to "download" - * file has been replaced by code - * Placeholder text can select by a single double click. - * plugin.info.txt for easy setup using a named zip file - -=== Author === - * Georg Schmidt (Mod 1) [[https://github.com/user9209/dokuwiki_plugin_codebutton|Plugin on GitHub]] - * Heiko Barth (Original) [[https://github.com/casperklein/dokuwiki_plugin_codebutton|Plugin on GitHub]] - -=== Change Log === - * **2021-01-09** - * Icon path fixed - * **2019-01-19** - * Update plugin name and id - * **2019-01-16** - * Fork from [codebutton](https://www.dokuwiki.org/plugin:codebutton) - -=== Known Bugs and Issues === - - * not yet known \ No newline at end of file diff --git a/README.MD b/README.MD index d4fdbb9..5995f5e 100644 --- a/README.MD +++ b/README.MD @@ -1,4 +1,4 @@ -# CodeButtonMod 1 Plugin - Toolbar Code Button +# CodeButtonModBash Plugin - Toolbar to add bash Code Button @@ -8,9 +8,9 @@ In the default toolbar there is no code button available. This plugin will add o ### Install -**Mod 1 version:** +**Mod bash version:** -Search and install "codebuttonmod1" +Search and install "codebuttonmodbash" or @@ -31,16 +31,19 @@ https://github.com/AnonTester/dokuwiki_plugin_codebutton/archive/master.zip **Orginal Version:** -Search and install "codebutton" +Search and install "codebuttonmod1" ### Author - -- Georg Schmidt (Mod 1) [Plugin on GitHub](https://github.com/user9209/dokuwiki_plugin_codebutton) +- Simon Jacob (Mod Bash) [Plugin on GitHub](https://github.com/unimetal/dokuwiki_plugin_codebuttonmodbash) +- Georg Schmidt (parts of Mod 1) [Plugin on GitHub](https://github.com/user9209/dokuwiki_plugin_codebutton) - Heiko Barth (Original) [Plugin on GitHub](https://github.com/casperklein/dokuwiki_plugin_codebutton) -### Mod 1 contains +## Mod bash contents +- Default title is set to "$this->getLang('insertcode')" +- code.png icon replaced with codebash.png +- Added codeStr Parameter to modify ... in config. -- Default **title** is set to "download" +### parts from Mod 1 - *file* has been replaced by **code** - *Placeholder text* can select by a **single double click**. - **plugin.info.txt** for easy setup using a named zip file diff --git a/action.php b/action.php index d4c4906..e42787b 100644 --- a/action.php +++ b/action.php @@ -1,33 +1,45 @@ register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); + public function register(EventHandler $controller) { + $controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', []); } /** * Inserts the toolbar button + * + * @param Event $event event object + * @param mixed $param [the parameters passed as fifth argument to + * register_hook() when this handler was registered, + * here just an empty array..] */ - function insert_button(& $event, $param) { - $event->data[] = array ( + public function insert_button(Event $event, $param) { + + $codeStr = $this->getConf('codeStr'); + $insert = $this->getLang('insert'); + + $event->data[] = [ 'type' => 'format', - 'title' => $this->getLang('insertcode'), - 'icon' => '../../plugins/codebuttonmod1/image/code.png', - 'open' => '\n', + 'title' => $insert.': ...', + 'icon' => '../../plugins/codebuttonmodbash/codebash.png', + 'open' => '\n', 'close' => '\n', - ); + ]; } } diff --git a/codebash.png b/codebash.png new file mode 100644 index 0000000..f98276e Binary files /dev/null and b/codebash.png differ diff --git a/conf/default.php b/conf/default.php new file mode 100644 index 0000000..c00b415 --- /dev/null +++ b/conf/default.php @@ -0,0 +1,7 @@ +