Edit File by line
/home/barbar84/www/wp-inclu.../js/tinymce/plugins/tabfocus
File: plugin.js
(function () {
[0] Fix | Delete
var tabfocus = (function (domGlobals) {
[1] Fix | Delete
'use strict';
[2] Fix | Delete
[3] Fix | Delete
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
[4] Fix | Delete
[5] Fix | Delete
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
[6] Fix | Delete
[7] Fix | Delete
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
[8] Fix | Delete
[9] Fix | Delete
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
[10] Fix | Delete
[11] Fix | Delete
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
[12] Fix | Delete
[13] Fix | Delete
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
[14] Fix | Delete
[15] Fix | Delete
var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK');
[16] Fix | Delete
[17] Fix | Delete
var getTabFocusElements = function (editor) {
[18] Fix | Delete
return editor.getParam('tabfocus_elements', ':prev,:next');
[19] Fix | Delete
};
[20] Fix | Delete
var getTabFocus = function (editor) {
[21] Fix | Delete
return editor.getParam('tab_focus', getTabFocusElements(editor));
[22] Fix | Delete
};
[23] Fix | Delete
var Settings = { getTabFocus: getTabFocus };
[24] Fix | Delete
[25] Fix | Delete
var DOM = global$1.DOM;
[26] Fix | Delete
var tabCancel = function (e) {
[27] Fix | Delete
if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
[28] Fix | Delete
e.preventDefault();
[29] Fix | Delete
}
[30] Fix | Delete
};
[31] Fix | Delete
var setup = function (editor) {
[32] Fix | Delete
function tabHandler(e) {
[33] Fix | Delete
var x, el, v, i;
[34] Fix | Delete
if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
[35] Fix | Delete
return;
[36] Fix | Delete
}
[37] Fix | Delete
function find(direction) {
[38] Fix | Delete
el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
[39] Fix | Delete
function canSelectRecursive(e) {
[40] Fix | Delete
return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
[41] Fix | Delete
}
[42] Fix | Delete
function canSelect(el) {
[43] Fix | Delete
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
[44] Fix | Delete
}
[45] Fix | Delete
global$5.each(el, function (e, i) {
[46] Fix | Delete
if (e.id === editor.id) {
[47] Fix | Delete
x = i;
[48] Fix | Delete
return false;
[49] Fix | Delete
}
[50] Fix | Delete
});
[51] Fix | Delete
if (direction > 0) {
[52] Fix | Delete
for (i = x + 1; i < el.length; i++) {
[53] Fix | Delete
if (canSelect(el[i])) {
[54] Fix | Delete
return el[i];
[55] Fix | Delete
}
[56] Fix | Delete
}
[57] Fix | Delete
} else {
[58] Fix | Delete
for (i = x - 1; i >= 0; i--) {
[59] Fix | Delete
if (canSelect(el[i])) {
[60] Fix | Delete
return el[i];
[61] Fix | Delete
}
[62] Fix | Delete
}
[63] Fix | Delete
}
[64] Fix | Delete
return null;
[65] Fix | Delete
}
[66] Fix | Delete
v = global$5.explode(Settings.getTabFocus(editor));
[67] Fix | Delete
if (v.length === 1) {
[68] Fix | Delete
v[1] = v[0];
[69] Fix | Delete
v[0] = ':prev';
[70] Fix | Delete
}
[71] Fix | Delete
if (e.shiftKey) {
[72] Fix | Delete
if (v[0] === ':prev') {
[73] Fix | Delete
el = find(-1);
[74] Fix | Delete
} else {
[75] Fix | Delete
el = DOM.get(v[0]);
[76] Fix | Delete
}
[77] Fix | Delete
} else {
[78] Fix | Delete
if (v[1] === ':next') {
[79] Fix | Delete
el = find(1);
[80] Fix | Delete
} else {
[81] Fix | Delete
el = DOM.get(v[1]);
[82] Fix | Delete
}
[83] Fix | Delete
}
[84] Fix | Delete
if (el) {
[85] Fix | Delete
var focusEditor = global$2.get(el.id || el.name);
[86] Fix | Delete
if (el.id && focusEditor) {
[87] Fix | Delete
focusEditor.focus();
[88] Fix | Delete
} else {
[89] Fix | Delete
global$4.setTimeout(function () {
[90] Fix | Delete
if (!global$3.webkit) {
[91] Fix | Delete
domGlobals.window.focus();
[92] Fix | Delete
}
[93] Fix | Delete
el.focus();
[94] Fix | Delete
}, 10);
[95] Fix | Delete
}
[96] Fix | Delete
e.preventDefault();
[97] Fix | Delete
}
[98] Fix | Delete
}
[99] Fix | Delete
editor.on('init', function () {
[100] Fix | Delete
if (editor.inline) {
[101] Fix | Delete
DOM.setAttrib(editor.getBody(), 'tabIndex', null);
[102] Fix | Delete
}
[103] Fix | Delete
editor.on('keyup', tabCancel);
[104] Fix | Delete
if (global$3.gecko) {
[105] Fix | Delete
editor.on('keypress keydown', tabHandler);
[106] Fix | Delete
} else {
[107] Fix | Delete
editor.on('keydown', tabHandler);
[108] Fix | Delete
}
[109] Fix | Delete
});
[110] Fix | Delete
};
[111] Fix | Delete
var Keyboard = { setup: setup };
[112] Fix | Delete
[113] Fix | Delete
global.add('tabfocus', function (editor) {
[114] Fix | Delete
Keyboard.setup(editor);
[115] Fix | Delete
});
[116] Fix | Delete
function Plugin () {
[117] Fix | Delete
}
[118] Fix | Delete
[119] Fix | Delete
return Plugin;
[120] Fix | Delete
[121] Fix | Delete
}(window));
[122] Fix | Delete
})();
[123] Fix | Delete
[124] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function