diff options
author | Adrian Lang <lang@cosmocode.de> | 2010-03-08 13:04:31 +0100 |
---|---|---|
committer | Adrian Lang <lang@cosmocode.de> | 2010-03-09 09:51:16 +0100 |
commit | c4ba149a58e742fab4739e2432ee00e41f1f7184 (patch) | |
tree | 76243a77575e0c765aca10a1d8dfe4ef891dc16c /lib/scripts/toolbar.js | |
parent | 90a0f2e151531db5b76c3d1c340f70da35922456 (diff) | |
download | dokuwiki-c4ba149a58e742fab4739e2432ee00e41f1f7184.tar.gz dokuwiki-c4ba149a58e742fab4739e2432ee00e41f1f7184.zip |
Allow filtering of block buttons in initToolbar
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r-- | lib/scripts/toolbar.js | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 99ad1bb9c..37987c21a 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -5,12 +5,13 @@ var pickercounter=0; /** * Create a toolbar * - * @param string tbid ID of the element where to insert the toolbar - * @param string edid ID of the editor textarea - * @param array tb Associative array defining the buttons + * @param string tbid ID of the element where to insert the toolbar + * @param string edid ID of the editor textarea + * @param array tb Associative array defining the buttons + * @param bool allowblock Allow buttons creating multiline content * @author Andreas Gohr <andi@splitbrain.org> */ -function initToolbar(tbid,edid,tb){ +function initToolbar(tbid,edid,tb, allowblock){ var toolbar = $(tbid); if(!toolbar) return; var edit = $(edid); @@ -22,6 +23,9 @@ function initToolbar(tbid,edid,tb){ var cnt = tb.length; for(var i=0; i<cnt; i++){ + if (!allowblock && tb[i].block === true) { + continue; + } var actionFunc; // create new button |