diff --git a/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js b/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js index 9dd6b40366..1882d0640d 100644 --- a/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js +++ b/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.js @@ -14,7 +14,7 @@ tinymce.PluginManager.add('tabfocus', function(editor) { var DOM = tinymce.DOM, each = tinymce.each, explode = tinymce.explode; function tabCancel(e) { - if (e.keyCode === 9) { + if (e.keyCode === 9 && !e.ctrlKey && !e.altKey && !e.metaKey) { e.preventDefault(); } } @@ -22,6 +22,10 @@ tinymce.PluginManager.add('tabfocus', function(editor) { function tabHandler(e) { var x, el, v, i; + if (e.keyCode !== 9 || e.ctrlKey || e.altKey || e.metaKey) { + return; + } + function find(direction) { el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); @@ -62,46 +66,44 @@ tinymce.PluginManager.add('tabfocus', function(editor) { return null; } - if (e.keyCode === 9) { - v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); + v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } + if (v.length == 1) { + v[1] = v[0]; + v[0] = ':prev'; + } - // Find element to focus - if (e.shiftKey) { - if (v[0] == ':prev') { - el = find(-1); - } else { - el = DOM.get(v[0]); - } + // Find element to focus + if (e.shiftKey) { + if (v[0] == ':prev') { + el = find(-1); } else { - if (v[1] == ':next') { - el = find(1); - } else { - el = DOM.get(v[1]); - } + el = DOM.get(v[0]); + } + } else { + if (v[1] == ':next') { + el = find(1); + } else { + el = DOM.get(v[1]); + } + } + + if (el) { + var focusEditor = tinymce.get(el.id || el.name); + + if (el.id && focusEditor) { + focusEditor.focus(); + } else { + window.setTimeout(function() { + if (!tinymce.Env.webkit) { + window.focus(); + } + + el.focus(); + }, 10); } - if (el) { - var focusEditor = tinymce.get(el.id || el.name); - - if (el.id && focusEditor) { - focusEditor.focus(); - } else { - window.setTimeout(function() { - if (!tinymce.Env.webkit) { - window.focus(); - } - - el.focus(); - }, 10); - } - - e.preventDefault(); - } + e.preventDefault(); } } diff --git a/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js b/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js index bd71785a45..e73c3914b7 100644 --- a/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js +++ b/src/wp-includes/js/tinymce/plugins/tabfocus/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.add("tabfocus",function(e){function n(e){9===e.keyCode&&e.preventDefault()}function t(n){function t(n){function t(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&t(e.parentNode)}function r(e){return e.tabIndex||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function a(e){return!r(e)&&"-1"!=e.getAttribute("tabindex")&&t(e)}if(d=i.select(":input:enabled,*[tabindex]:not(iframe)"),o(d,function(n,t){return n.id==e.id?(u=t,!1):void 0}),n>0){for(c=u+1;c=0;c--)if(a(d[c]))return d[c];return null}var u,d,a,c;if(9===n.keyCode&&(a=r(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==a.length&&(a[1]=a[0],a[0]=":prev"),d=n.shiftKey?":prev"==a[0]?t(-1):i.get(a[0]):":next"==a[1]?t(1):i.get(a[1]))){var f=tinymce.get(d.id||d.name);d.id&&f?f.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),d.focus()},10),n.preventDefault()}}var i=tinymce.DOM,o=tinymce.each,r=tinymce.explode;e.on("init",function(){e.inline&&tinymce.DOM.setAttrib(e.getBody(),"tabIndex",null)}),e.on("keyup",n),tinymce.Env.gecko?e.on("keypress keydown",t):e.on("keydown",t)}); \ No newline at end of file +tinymce.PluginManager.add("tabfocus",function(a){function b(a){9!==a.keyCode||a.ctrlKey||a.altKey||a.metaKey||a.preventDefault()}function c(b){function c(b){function c(a){return"BODY"===a.nodeName||"hidden"!=a.type&&"none"!=a.style.display&&"hidden"!=a.style.visibility&&c(a.parentNode)}function f(a){return a.tabIndex||"INPUT"==a.nodeName||"TEXTAREA"==a.nodeName}function i(a){return!f(a)&&"-1"!=a.getAttribute("tabindex")&&c(a)}if(h=d.select(":input:enabled,*[tabindex]:not(iframe)"),e(h,function(b,c){return b.id==a.id?(g=c,!1):void 0}),b>0){for(j=g+1;j=0;j--)if(i(h[j]))return h[j];return null}var g,h,i,j;if(!(9!==b.keyCode||b.ctrlKey||b.altKey||b.metaKey)&&(i=f(a.getParam("tab_focus",a.getParam("tabfocus_elements",":prev,:next"))),1==i.length&&(i[1]=i[0],i[0]=":prev"),h=b.shiftKey?":prev"==i[0]?c(-1):d.get(i[0]):":next"==i[1]?c(1):d.get(i[1]))){var k=tinymce.get(h.id||h.name);h.id&&k?k.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),h.focus()},10),b.preventDefault()}}var d=tinymce.DOM,e=tinymce.each,f=tinymce.explode;a.on("init",function(){a.inline&&tinymce.DOM.setAttrib(a.getBody(),"tabIndex",null)}),a.on("keyup",b),tinymce.Env.gecko?a.on("keypress keydown",c):a.on("keydown",c)}); \ No newline at end of file diff --git a/src/wp-includes/version.php b/src/wp-includes/version.php index bdee4baf9d..d6d5013a80 100644 --- a/src/wp-includes/version.php +++ b/src/wp-includes/version.php @@ -18,7 +18,7 @@ $wp_db_version = 26691; * * @global string $tinymce_version */ -$tinymce_version = '4012-20140124'; +$tinymce_version = '4012-20140125'; /** * Holds the required PHP version