Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen RevisionVorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
dokuwiki:button [2008/05/20 13:31] geralddokuwiki:button [2024/02/29 13:36] (aktuell) – Externe Bearbeitung 127.0.0.1
Zeile 1: Zeile 1:
 +====== Toolbar ======
 +
 +To add a button on the edit-toolbar:
 + --- //[[gp@qqq-gmbh.de|Gerald Nasenbrecher]] 2016/01/19 11:44//
 +(newer versions of DokuWiki)
 +
 +To add a buttom for < code>
 +edit /inc/tooblbar.php
 +Add to the array (eg. after the last one with the signature sig.png)
 +
 +<code>
 +           array(
 +                'type'   => 'format',
 +                'title'  => 'Code',
 +                'icon'   => 'eek.png',
 +                'open'   => '\n<code>\n',
 +                'close'  => '\n<//code>\n'
 +                ),
 +</code>
 +( < slash code> SHOULD BE A SINGE / !!!)
 +
 +
 +Save. Nothing happens. This is because of the caches of the javascript.
 +To clean cache, call: https://gerwiki.de/lib/exe/js.php?purge=true
 +
 +
 +Clean the browser-cache too (by shift-reload to force reload).
 +
 +Done.
 +
 +
 +
 +
 +
 +Alt:
 +
 +
 Um einen Button bei der Editpage oben hinzuzufügen: Um einen Button bei der Editpage oben hinzuzufügen:
  
Zeile 35: Zeile 72:
  
  
-<code>if(window.toolbar!=undefined){+<code javascript>if(window.toolbar!=undefined){
    
   /* format: subscript */   /* format: subscript */
Zeile 77: Zeile 114:
 } }
 </code> </code>
 +
 +----
 +
 + If anyone knows a way to insert a button instead of adding it at the end would be great… 
 +
 + This can be done by editing the inc/toolbar.php file directly. Around line 27, you will find the following code:
 +<code php>    $menu = array(
 +       array(
 +            'type'   => 'format',
 +            'title'  => $lang['qb_bold'],
 +            'icon'   => 'bold.png',
 +            'key'    => 'b',
 +            'open'   => '**',
 +            'close'  => '**',
 +            ),
 +       array(
 +            'type'   => 'format',
 +            'title'  => $lang['qb_italic'],
 +            'icon'   => 'italic.png',
 +       ...</code>
 + To add a button which inserts the text “Hi there”, add a new array element like so:
 +<code php>    $menu = array(
 +       array(
 +            'type'   => 'insert',
 +            'title'  => "Insert 'hello there'",
 +            'icon'   => 'helloThere.png',
 +            'insert' => 'Hello there!\n',
 +            ),
 +       array(
 +            'type'   => 'format',
 +            'title'  => $lang['qb_bold'],
 +            'icon'   => 'bold.png',
 +            'key'    => 'b',
 +            'open'   => '**',
 +            'close'  => '**',
 +            ),
 +       array(
 +            'type'   => 'format',
 +            'title'  => $lang['qb_italic'],
 +            'icon'   => 'italic.png',
 +       ...</code>
 + Note that you can use \n for a new line…
 +
 + Also note that when playing around with it, cacheing was tricky. I had to keep manually deleting the cached version of the file.
 +
 
Nach oben
dokuwiki/button.1211290306.txt.gz · Zuletzt geändert: 2024/02/29 13:36 (Externe Bearbeitung)
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0
DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp   Dogecoin Donations Accepted Here    DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp  DFmW2CEce3htPL1uNQuHUVu4Tk6WXigFQp