Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
060422a
Adaptations to Mod bash
unimetal Jan 8, 2025
4c255b7
adaptations to new plugin name
unimetal Jan 8, 2025
7bc0ac2
adaptations to new plugin name
unimetal Jan 8, 2025
e409130
Added Name
unimetal Jan 8, 2025
3ffa6eb
adaptations
unimetal Jan 8, 2025
51556cd
ref https://www.dokuwiki.org/devel:action_plugins#sampleadd_toolbar_b…
unimetal Jan 8, 2025
c7f2541
ref https://www.dokuwiki.org/devel:action_plugins#sampleadd_toolbar_b…
unimetal Jan 8, 2025
b67d2c3
ref https://www.dokuwiki.org/devel:action_plugins#sampleadd_toolbar_b…
unimetal Jan 8, 2025
b92bccc
adapted to new example
unimetal Jan 8, 2025
adc4479
adapted to template
unimetal Jan 8, 2025
1403c4d
forgot adaptations
unimetal Jan 8, 2025
9940594
adapt readme
unimetal Jan 8, 2025
d067400
replacements
unimetal Jan 8, 2025
3f21791
edits
unimetal Jan 8, 2025
2d72780
updates
unimetal Jan 9, 2025
c838daa
Creating files for Settings
unimetal Jan 10, 2025
3a039d0
include settings into action.php
unimetal Jan 10, 2025
96f85aa
added changes in readme etc.
unimetal Jan 10, 2025
de8e0fc
deleted todo
unimetal Jan 10, 2025
5fdd19d
removed bugs info
unimetal Jan 10, 2025
edc581c
show predefined value in editor
unimetal Jan 10, 2025
0e61f69
bugfix
unimetal Jan 10, 2025
4b15482
bugfix
unimetal Jan 10, 2025
f7853ca
bugfix
unimetal Jan 10, 2025
6500a8e
update flag
unimetal Jan 10, 2025
9655c22
updated wiki text
unimetal Jan 10, 2025
64b8ae3
Update README.MD
unimetal Jan 10, 2025
f3aa61e
Update Plugin.txt
unimetal Jan 10, 2025
7f2e915
replaced <code=BASH> by <code bash>
unimetal Jan 10, 2025
8328614
removed wiki text
unimetal Jan 10, 2025
d72df6a
date
unimetal Jan 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 0 additions & 56 deletions Plugin.txt

This file was deleted.

19 changes: 11 additions & 8 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CodeButtonMod 1 Plugin - Toolbar Code Button
# CodeButtonModBash Plugin - Toolbar to add bash Code Button



Expand All @@ -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

Expand All @@ -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 <code=$codeStr>...</code> 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
44 changes: 28 additions & 16 deletions action.php
Original file line number Diff line number Diff line change
@@ -1,33 +1,45 @@
<?php

use dokuwiki\Extension\ActionPlugin;
use dokuwiki\Extension\EventHandler;
use dokuwiki\Extension\Event;

/**
* Action Plugin: Inserts a button into the toolbar to add file tags
*
* @author Georg Schmidt, Heiko Barth
* @author Simon Jacob, Gina Haeussge
*/

if (!defined('DOKU_INC')) die();
if (!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN', DOKU_INC . 'lib/plugins/');
require_once (DOKU_PLUGIN . 'action.php');

class action_plugin_codebuttonmod1 extends DokuWiki_Action_Plugin {

class action_plugin_codebuttonmodbash extends ActionPlugin {

/**
* Register the eventhandlers
* Register the event handlers
*
* @param EventHandler $controller DokuWiki's event controller object
*/
function register(Doku_Event_Handler $controller) {
$controller->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' => '<code | download>\n',
'title' => $insert.': <code '.$codeStr.'>...</code>',
'icon' => '../../plugins/codebuttonmodbash/codebash.png',
'open' => '<code '.$codeStr.'>\n',
'close' => '\n</code>',
);
];
}
}
Binary file added codebash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions conf/default.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/*
* codebuttonmodbash plugin, default configuration settings
*
*/

$conf['codeStr'] = 'bash';
7 changes: 7 additions & 0 deletions conf/metadata.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/*
* codebuttonmodbash plugin, configuration metadata
*
*/

$meta['codeStr'] = array('string');
Binary file removed image/code.png
Binary file not shown.
2 changes: 1 addition & 1 deletion lang/de/lang.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
$lang['insertcode'] = 'Code_einfügen';
$lang['insert'] = 'Einfügen von';
7 changes: 7 additions & 0 deletions lang/de/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/**
* German language file for config of codebuttonmodbash plugin
*
*/

$lang['codeStr'] = 'Definiere Wert für den Parameter codeStr, Standard = bash ';
2 changes: 1 addition & 1 deletion lang/en/lang.php
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?php
$lang['insertcode'] = 'Insert_Code';
$lang['insert'] = 'insert';
7 changes: 7 additions & 0 deletions lang/en/settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php
/**
* German language file for config of codebuttonmodbash plugin
*
*/

$lang['codeStr'] = 'Define value of codeStr =codeStr, default = bash ';
14 changes: 7 additions & 7 deletions plugin.info.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
base codebuttonmod1
author Georg Schmidt
email gs-develop@gs-sys.de
date 2021-01-09
name Toolbar Code Button - Mod 1
desc Inserts a code button into the toolbar.
url https://www.dokuwiki.org/plugin:codebuttonmod1
base codebuttonmodbash
author Simon Jacob
email dev@unimetal.me
date 2025-01-10b
name Toolbar Code Button - Mod bash
desc Inserts a code button into the toolbar with the possibility to modify code type in config.
url https://www.dokuwiki.org/plugin:codebuttonmodbash