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 "legacyoutput" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/legacyoutput')
// ES2015:
// import 'tinymce/plugins/legacyoutput'
require('./plugin.js');

View File

@ -0,0 +1,199 @@
/**
* 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.util.Tools');
var getFontSizeFormats = function (editor) {
return editor.getParam('fontsize_formats');
};
var setFontSizeFormats = function (editor, fontsize_formats) {
editor.settings.fontsize_formats = fontsize_formats;
};
var getFontFormats = function (editor) {
return editor.getParam('font_formats');
};
var setFontFormats = function (editor, font_formats) {
editor.settings.font_formats = font_formats;
};
var getFontSizeStyleValues = function (editor) {
return editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large');
};
var setInlineStyles = function (editor, inline_styles) {
editor.settings.inline_styles = inline_styles;
};
var overrideFormats = function (editor) {
var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global$1.explode(getFontSizeStyleValues(editor)), schema = editor.schema;
editor.formatter.register({
alignleft: {
selector: alignElements,
attributes: { align: 'left' }
},
aligncenter: {
selector: alignElements,
attributes: { align: 'center' }
},
alignright: {
selector: alignElements,
attributes: { align: 'right' }
},
alignjustify: {
selector: alignElements,
attributes: { align: 'justify' }
},
bold: [
{
inline: 'b',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'strong',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'span',
styles: { fontWeight: 'bold' }
}
],
italic: [
{
inline: 'i',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'em',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'span',
styles: { fontStyle: 'italic' }
}
],
underline: [
{
inline: 'u',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'span',
styles: { textDecoration: 'underline' },
exact: true
}
],
strikethrough: [
{
inline: 'strike',
remove: 'all',
preserve_attributes: [
'class',
'style'
]
},
{
inline: 'span',
styles: { textDecoration: 'line-through' },
exact: true
}
],
fontname: {
inline: 'font',
toggle: false,
attributes: { face: '%value' }
},
fontsize: {
inline: 'font',
toggle: false,
attributes: {
size: function (vars) {
return String(global$1.inArray(fontSizes, vars.value) + 1);
}
}
},
forecolor: {
inline: 'font',
attributes: { color: '%value' },
links: true,
remove_similar: true,
clear_child_styles: true
},
hilitecolor: {
inline: 'font',
styles: { backgroundColor: '%value' },
links: true,
remove_similar: true,
clear_child_styles: true
}
});
global$1.each('b,i,u,strike'.split(','), function (name) {
schema.addValidElements(name + '[*]');
});
if (!schema.getElementRule('font')) {
schema.addValidElements('font[face|size|color|style]');
}
global$1.each(alignElements.split(','), function (name) {
var rule = schema.getElementRule(name);
if (rule) {
if (!rule.attributes.align) {
rule.attributes.align = {};
rule.attributesOrder.push('align');
}
}
});
};
var overrideSettings = function (editor) {
var defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7';
var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats';
setInlineStyles(editor, false);
if (!getFontSizeFormats(editor)) {
setFontSizeFormats(editor, defaultFontsizeFormats);
}
if (!getFontFormats(editor)) {
setFontFormats(editor, defaultFontsFormats);
}
};
var setup = function (editor) {
overrideSettings(editor);
editor.on('PreInit', function () {
return overrideFormats(editor);
});
};
function Plugin () {
global.add('legacyoutput', 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"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(s){var e,t,i,a;t=!1,(e=s).settings.inline_styles=t,e.getParam("fontsize_formats")||(i="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7",e.settings.fontsize_formats=i),e.getParam("font_formats")||(a="Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats",e.settings.font_formats=a),s.on("PreInit",function(){return e=s,t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=l.explode(e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")),a=e.schema,e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all",preserve_attributes:["class","style"]},{inline:"strong",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all",preserve_attributes:["class","style"]},{inline:"em",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all",preserve_attributes:["class","style"]},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return String(l.inArray(i,e.value)+1)}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),l.each("b,i,u,strike".split(","),function(e){a.addValidElements(e+"[*]")}),a.getElementRule("font")||a.addValidElements("font[face|size|color|style]"),void l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))});var e,t,i,a})};e.add("legacyoutput",function(e){t(e)})}();