-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Features: standard code blocks and Toolbar Buttons
Signed-off-by: Taggic <taggic@t-online.de>
- Loading branch information
Showing
17 changed files
with
203 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2012-01-18 | ||
2012-02-10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?php | ||
/** | ||
* Action Plugin: Inserts a button into the toolbar to add file tags | ||
* | ||
* @author Heiko Barth | ||
*/ | ||
|
||
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_xssnipper extends DokuWiki_Action_Plugin { | ||
|
||
/** | ||
* Return some info | ||
*/ | ||
function getInfo() { | ||
return array ( | ||
'author' => 'Heiko Barth', | ||
'date' => '2010-03-02', | ||
'name' => 'Toolbar Code Button', | ||
'desc' => 'Inserts a code button into the toolbar', | ||
'url' => 'http://www.heiko-barth.de/download.php?id=dw_codebutton', | ||
); | ||
} | ||
|
||
/** | ||
* Register the eventhandlers | ||
*/ | ||
function register(&$controller) { | ||
$controller->register_hook('TOOLBAR_DEFINE', 'AFTER', $this, 'insert_button', array ()); | ||
} | ||
|
||
/** | ||
* Inserts the toolbar button | ||
*/ | ||
function insert_button(&$event, $param) { | ||
$event->data[] = array ( | ||
'type' => 'picker', | ||
'title' => 'Code select', | ||
'icon' => '../../plugins/xssnipper/images/code.png', | ||
'list' => array( | ||
array( | ||
'type' => 'format', | ||
'title' => 'xssnip', | ||
'icon' => '../../plugins/xssnipper/images/code_xssnip.png', | ||
'open' => '{(xssnipper>', | ||
'close' => ')}', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'code', | ||
'icon' => '../../plugins/xssnipper/images/code_code.png', | ||
'open' => '<code>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'php', | ||
'icon' => '../../plugins/xssnipper/images/code_php.png', | ||
'open' => '<code php>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'html', | ||
'icon' => '../../plugins/xssnipper/images/code_html.png', | ||
'open' => '<code html>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'js', | ||
'icon' => '../../plugins/xssnipper/images/code_js.png', | ||
'open' => '<code php>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'code', | ||
'icon' => '../../plugins/xssnipper/images/code_css.png', | ||
'open' => '<code css>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'txt', | ||
'icon' => '../../plugins/xssnipper/images/code_txt.png', | ||
'open' => '<code txt>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'xml', | ||
'icon' => '../../plugins/xssnipper/images/code_xml.png', | ||
'open' => '<code xml>\n', | ||
'close' => '\n</code>', | ||
), | ||
array( | ||
'type' => 'format', | ||
'title' => 'file', | ||
'icon' => '../../plugins/xssnipper/images/code_file.png', | ||
'open' => '<file>\n', | ||
'close' => '\n</file>', | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
code=<code [type] [filename]> insert_code_here </code> | ||
xssnip={(xssnipper>[path],[from line],[to line],[type] [filename])} | ||
php=<code php [filename]> insert_code_here </code> | ||
css=<code css [filename]> insert_code_here </code> | ||
html=<code html [filename]> insert_code_here </code> | ||
js=<code js [filename]> insert_code_here </code> | ||
txt=<code txt [filename]> insert_code_here </code> | ||
xml=<code xml [filename]> insert_code_here </code> | ||
file=<file></file> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
$lang['insertcode'] = '[PATH],[from line],[to line],[code language] [code block file]'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters