diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-10-28 20:22:05 +0100 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-10-28 20:22:05 +0100 |
commit | 23a363f01514464eb2238ac09ec7723d03d57ecb (patch) | |
tree | 42c7dcff8c5b0e506a25d08ee5583ed2a24e8602 /lib/scripts/toolbar.js | |
parent | 25e48e54df60b3df6efa365daceb3a8966c8f427 (diff) | |
parent | 75cf672f10a71f7dee6d50eb70b742689838bc36 (diff) | |
download | rpg-23a363f01514464eb2238ac09ec7723d03d57ecb.tar.gz rpg-23a363f01514464eb2238ac09ec7723d03d57ecb.tar.bz2 |
Merge branch 'master' into stable
* master: (413 commits)
release preparation
fixed strict violation in ACL plugin
Fix issues from teams:i18n:translation-check in localizations
ensure locale is set back to the original value
skip FS#2867 test if \s doesn't match \xA0 after attempting to change the locale
unittests for auth_loadACL
translation update
allow charset for SSO to be configured FS#2148
Mailer: avoid overlong headers in content ids FS#2868
translation update
translation update
replace \s, \S with [ \t], [^ \t] in regexs used with acls
translation update
translation update
translation update
translation update
Fix handling of the legacy subscription action name
remove obsolete opera handling and session closing
remove no longer used ajax.php
fix proxy CONNECT where HTTP 1.1 answer is given
...
Diffstat (limited to 'lib/scripts/toolbar.js')
-rw-r--r-- | lib/scripts/toolbar.js | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/lib/scripts/toolbar.js b/lib/scripts/toolbar.js index 6d75215e0..88cae1e8c 100644 --- a/lib/scripts/toolbar.js +++ b/lib/scripts/toolbar.js @@ -52,8 +52,13 @@ function initToolbar(tbid,edid,tb, allowblock){ // type is a init function -> execute it actionFunc = 'addBtnAction'+val.type.charAt(0).toUpperCase()+val.type.substring(1); if( jQuery.isFunction(window[actionFunc]) ){ - if(window[actionFunc]($btn, val, edid)){ + var pickerid = window[actionFunc]($btn, val, edid); + if(pickerid !== ''){ $toolbar.append($btn); + $btn.attr('aria-controls', pickerid); + if (actionFunc === 'addBtnActionPicker') { + $btn.attr('aria-haspopup', 'true'); + } } return; } @@ -190,16 +195,17 @@ function tb_autohead(btn, props, edid){ */ function addBtnActionPicker($btn, props, edid) { var pickerid = 'picker'+(pickercounter++); - createPicker(pickerid, props, edid); + var picker = createPicker(pickerid, props, edid); + jQuery(picker).attr('aria-hidden', 'true'); $btn.click( function() { pickerToggle(pickerid,$btn); - return false; + return ''; } ); - return true; + return pickerid; } /** @@ -211,26 +217,31 @@ function addBtnActionPicker($btn, props, edid) { * @return boolean If button should be appended * @author Andreas Gohr <gohr@cosmocode.de> */ -function addBtnActionLinkwiz(btn, props, edid) { +function addBtnActionLinkwiz($btn, props, edid) { dw_linkwiz.init(jQuery('#'+edid)); - jQuery(btn).click(function(){ + jQuery($btn).click(function(){ + dw_linkwiz.val = props; dw_linkwiz.toggle(); - return false; + return ''; }); - return true; + return 'link__wiz'; } /** - * Show/Hide a previosly created picker window + * Show/Hide a previously created picker window * * @author Andreas Gohr <andi@splitbrain.org> */ function pickerToggle(pickerid,$btn){ var $picker = jQuery('#' + pickerid), pos = $btn.offset(); - $picker.toggleClass('a11y') - .offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3}); + if ($picker.hasClass('a11y')) { + $picker.removeClass('a11y').attr('aria-hidden', 'false'); + } else { + $picker.addClass('a11y').attr('aria-hidden', 'true'); + } + $picker.offset({left: pos.left+3, top: pos.top+$btn[0].offsetHeight+3}); } /** @@ -252,4 +263,5 @@ function fixtxt(str){ jQuery(function () { initToolbar('tool__bar','wiki__text',toolbar); + jQuery('#tool__bar').attr('role', 'toolbar'); }); |