integarting admin dashboard

This commit is contained in:
UronShrestha
2024-07-12 12:51:02 +05:45
parent 2510de390a
commit 1550ab5d30
1758 changed files with 313760 additions and 10 deletions

View File

@ -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');

View File

@ -0,0 +1,129 @@
/**
* 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.7.0 (2021-02-10)
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils');
var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager');
var global$3 = tinymce.util.Tools.resolve('tinymce.Env');
var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay');
var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var global$6 = 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$1.DOM;
var tabCancel = function (e) {
if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) {
e.preventDefault();
}
};
var setup = function (editor) {
var tabHandler = function (e) {
var x, i;
if (e.keyCode !== global$6.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) {
return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode);
};
var canSelect = function (el) {
return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el);
};
global$5.each(el, function (e, i) {
if (e.id === editor.id) {
x = i;
return false;
}
});
if (direction > 0) {
for (i = x + 1; i < el.length; i++) {
if (canSelect(el[i])) {
return el[i];
}
}
} else {
for (i = x - 1; i >= 0; i--) {
if (canSelect(el[i])) {
return el[i];
}
}
}
return null;
};
var v = global$5.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$2.get(el.id || el.name);
if (el.id && focusEditor) {
focusEditor.focus();
} else {
global$4.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.add('tabfocus', function (editor) {
setup(editor);
});
}
Plugin();
}());

View 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.7.0 (2021-02-10)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(s){var e=function(o){var l,r,e,t,n,i,u;o.keyCode!==f.TAB||o.ctrlKey||o.altKey||o.metaKey||o.isDefaultPrevented()||(e=function(e){var t=m.select(":input:enabled,*[tabindex]:not(iframe)"),n=function(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&n(e.parentNode)},i=function(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(o.id)&&-1!==e.tabIndex&&n(e)};if(d.each(t,function(e,t){if(e.id===s.id)return l=t,!1}),0<e){for(r=l+1;r<t.length;r++)if(i(t[r]))return t[r]}else for(r=l-1;0<=r;r--)if(i(t[r]))return t[r];return null},1===(t=d.explode((n=s).getParam("tab_focus",n.getParam("tabfocus_elements",":prev,:next")))).length&&(t[1]=t[0],t[0]=":prev"),(i=o.shiftKey?":prev"===t[0]?e(-1):m.get(t[0]):":next"===t[1]?e(1):m.get(t[1]))&&(u=c.get(i.id||i.name),i.id&&u?u.focus():y.setTimeout(function(){a.webkit||window.focus(),i.focus()},10),o.preventDefault()))};s.on("init",function(){s.inline&&m.setAttrib(s.getBody(),"tabIndex",null),s.on("keyup",n),a.gecko?s.on("keypress keydown",e):s.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();