summaryrefslogtreecommitdiff
path: root/lib/scripts/toolbar.js
diff options
context:
space:
mode:
authorAdrian Lang <lang@cosmocode.de>2010-03-08 13:04:31 +0100
committerAdrian Lang <lang@cosmocode.de>2010-03-09 09:51:16 +0100
commitc4ba149a58e742fab4739e2432ee00e41f1f7184 (patch)
tree76243a77575e0c765aca10a1d8dfe4ef891dc16c /lib/scripts/toolbar.js
parent90a0f2e151531db5b76c3d1c340f70da35922456 (diff)
downloadrpg-c4ba149a58e742fab4739e2432ee00e41f1f7184.tar.gz
rpg-c4ba149a58e742fab4739e2432ee00e41f1f7184.tar.bz2
Allow filtering of block buttons in initToolbar
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r--lib/scripts/toolbar.js12
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