diff options
author | Andreas Gohr <andi@splitbrain.org> | 2010-08-29 14:22:01 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2010-08-29 14:22:01 +0200 |
commit | 2c053ed58376c6709596ab48fc40dceb90d4e89d (patch) | |
tree | c8d0f78c2f47f373473419396d3c0855ec671eca /lib/scripts/toolbar.js | |
parent | cb4a07568e84d853fbcd9d5eca37f572fa10786f (diff) | |
parent | 5479a8c3341247ca228026819f20f3ab5c34a80f (diff) | |
download | rpg-2c053ed58376c6709596ab48fc40dceb90d4e89d.tar.gz rpg-2c053ed58376c6709596ab48fc40dceb90d4e89d.tar.bz2 |
Merge branch 'master' into stable
Conflicts:
conf/msg
lib/plugins/acl/ajax.php
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r-- | lib/scripts/toolbar.js | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index eacfc7cad..3f967448c 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -5,29 +5,39 @@ 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); if(!edit) return; if(edit.readOnly) return; + if (typeof allowblock === 'undefined') { + allowblock = true; + } + //empty the toolbar area: toolbar.innerHTML=''; var cnt = tb.length; for(var i=0; i<cnt; i++){ + if (!allowblock && tb[i].block === true) { + continue; + } var actionFunc; // create new button var btn = createToolButton(tb[i]['icon'], tb[i]['title'], - tb[i]['key']); + tb[i]['key'], + tb[i]['id'], + tb[i]['class']); // type is a tb function -> assign it as onclick @@ -225,8 +235,10 @@ function pickerToggle(pickerid,btn){ picker.style.left = (x+3)+'px'; picker.style.top = (y+btn.offsetHeight+3)+'px'; picker.style.marginLeft = '0px'; + picker.style.marginTop = '0px'; }else{ picker.style.marginLeft = '-10000px'; + picker.style.marginTop = '-10000px'; } } @@ -239,6 +251,7 @@ function pickerClose(){ var pobjs = getElementsByClass('picker'); for(var i=0; i<pobjs.length; i++){ pobjs[i].style.marginLeft = '-10000px'; + pobjs[i].style.marginTop = '-10000px'; } } |