classify admin
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
// Exports the "tabfocus" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('tinymce/plugins/tabfocus')
|
||||
// ES2015:
|
||||
// import 'tinymce/plugins/tabfocus'
|
||||
require('./plugin.js');
|
||||
130
public/assets/extensions/tinymce/plugins/tabfocus/plugin.js
Normal file
130
public/assets/extensions/tinymce/plugins/tabfocus/plugin.js
Normal file
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
||||
* Licensed under the LGPL or a commercial license.
|
||||
* For LGPL see License.txt in the project root for license information.
|
||||
* For commercial licenses see https://www.tiny.cloud/
|
||||
*
|
||||
* Version: 5.10.5 (2022-05-25)
|
||||
*/
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var global$6 = tinymce.util.Tools.resolve('tinymce.PluginManager');
|
||||
|
||||
var global$5 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
|
||||
|
||||
var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager');
|
||||
|
||||
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
|
||||
|
||||
var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay');
|
||||
|
||||
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
|
||||
|
||||
var global = tinymce.util.Tools.resolve('tinymce.util.VK');
|
||||
|
||||
var getTabFocusElements = function (editor) {
|
||||
return editor.getParam('tabfocus_elements', ':prev,:next');
|
||||
};
|
||||
var getTabFocus = function (editor) {
|
||||
return editor.getParam('tab_focus', getTabFocusElements(editor));
|
||||
};
|
||||
|
||||
var DOM = global$5.DOM;
|
||||
var tabCancel = function (e) {
|
||||
if (e.keyCode === global.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
var setup = function (editor) {
|
||||
var tabHandler = function (e) {
|
||||
var x;
|
||||
if (e.keyCode !== global.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) {
|
||||
return;
|
||||
}
|
||||
var find = function (direction) {
|
||||
var el = DOM.select(':input:enabled,*[tabindex]:not(iframe)');
|
||||
var canSelectRecursive = function (e) {
|
||||
var castElem = e;
|
||||
return e.nodeName === 'BODY' || castElem.type !== 'hidden' && castElem.style.display !== 'none' && castElem.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
|
||||
};
|
||||
var canSelect = function (el) {
|
||||
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$4.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
|
||||
};
|
||||
global$1.each(el, function (e, i) {
|
||||
if (e.id === editor.id) {
|
||||
x = i;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if (direction > 0) {
|
||||
for (var i = x + 1; i < el.length; i++) {
|
||||
if (canSelect(el[i])) {
|
||||
return el[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (var i = x - 1; i >= 0; i--) {
|
||||
if (canSelect(el[i])) {
|
||||
return el[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
var v = global$1.explode(getTabFocus(editor));
|
||||
if (v.length === 1) {
|
||||
v[1] = v[0];
|
||||
v[0] = ':prev';
|
||||
}
|
||||
var el;
|
||||
if (e.shiftKey) {
|
||||
if (v[0] === ':prev') {
|
||||
el = find(-1);
|
||||
} else {
|
||||
el = DOM.get(v[0]);
|
||||
}
|
||||
} else {
|
||||
if (v[1] === ':next') {
|
||||
el = find(1);
|
||||
} else {
|
||||
el = DOM.get(v[1]);
|
||||
}
|
||||
}
|
||||
if (el) {
|
||||
var focusEditor = global$4.get(el.id || el.name);
|
||||
if (el.id && focusEditor) {
|
||||
focusEditor.focus();
|
||||
} else {
|
||||
global$2.setTimeout(function () {
|
||||
if (!global$3.webkit) {
|
||||
window.focus();
|
||||
}
|
||||
el.focus();
|
||||
}, 10);
|
||||
}
|
||||
e.preventDefault();
|
||||
}
|
||||
};
|
||||
editor.on('init', function () {
|
||||
if (editor.inline) {
|
||||
DOM.setAttrib(editor.getBody(), 'tabIndex', null);
|
||||
}
|
||||
editor.on('keyup', tabCancel);
|
||||
if (global$3.gecko) {
|
||||
editor.on('keypress keydown', tabHandler);
|
||||
} else {
|
||||
editor.on('keydown', tabHandler);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function Plugin () {
|
||||
global$6.add('tabfocus', function (editor) {
|
||||
setup(editor);
|
||||
});
|
||||
}
|
||||
|
||||
Plugin();
|
||||
|
||||
}());
|
||||
9
public/assets/extensions/tinymce/plugins/tabfocus/plugin.min.js
vendored
Normal file
9
public/assets/extensions/tinymce/plugins/tabfocus/plugin.min.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) Tiny Technologies, Inc. All rights reserved.
|
||||
* Licensed under the LGPL or a commercial license.
|
||||
* For LGPL see License.txt in the project root for license information.
|
||||
* For commercial licenses see https://www.tiny.cloud/
|
||||
*
|
||||
* Version: 5.10.5 (2022-05-25)
|
||||
*/
|
||||
!function(){"use strict";function n(e){e.keyCode!==y.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),a=tinymce.util.Tools.resolve("tinymce.util.Delay"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),y=tinymce.util.Tools.resolve("tinymce.util.VK"),d=t.DOM;e.add("tabfocus",function(e){function t(l){var r,e,t,n,i;l.keyCode!==y.TAB||l.ctrlKey||l.altKey||l.metaKey||l.isDefaultPrevented()||(e=function(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(l.id)&&-1!==e.tabIndex&&i(e)}var n=d.select(":input:enabled,*[tabindex]:not(iframe)"),i=function(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&i(e.parentNode)};if(c.each(n,function(e,t){if(e.id===u.id)return r=t,!1}),0<e){for(var o=r+1;o<n.length;o++)if(t(n[o]))return n[o]}else for(o=r-1;0<=o;o--)if(t(n[o]))return n[o];return null},1===(t=c.explode(u.getParam("tab_focus",u.getParam("tabfocus_elements",":prev,:next")))).length&&(t[1]=t[0],t[0]=":prev"),(n=l.shiftKey?":prev"===t[0]?e(-1):d.get(t[0]):":next"===t[1]?e(1):d.get(t[1]))&&(i=s.get(n.id||n.name),n.id&&i?i.focus():a.setTimeout(function(){o.webkit||window.focus(),n.focus()},10),l.preventDefault()))}var u;(u=e).on("init",function(){u.inline&&d.setAttrib(u.getBody(),"tabIndex",null),u.on("keyup",n),o.gecko?u.on("keypress keydown",t):u.on("keydown",t)})})}();
|
||||
Reference in New Issue
Block a user