integarting admin dashboard
This commit is contained in:
7
public/Dashboard/vendors/tinymce/plugins/pagebreak/index.js
vendored
Normal file
7
public/Dashboard/vendors/tinymce/plugins/pagebreak/index.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
// Exports the "pagebreak" plugin for usage with module loaders
|
||||
// Usage:
|
||||
// CommonJS:
|
||||
// require('tinymce/plugins/pagebreak')
|
||||
// ES2015:
|
||||
// import 'tinymce/plugins/pagebreak'
|
||||
require('./plugin.js');
|
107
public/Dashboard/vendors/tinymce/plugins/pagebreak/plugin.js
vendored
Normal file
107
public/Dashboard/vendors/tinymce/plugins/pagebreak/plugin.js
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 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.Env');
|
||||
|
||||
var getSeparatorHtml = function (editor) {
|
||||
return editor.getParam('pagebreak_separator', '<!-- pagebreak -->');
|
||||
};
|
||||
var shouldSplitBlock = function (editor) {
|
||||
return editor.getParam('pagebreak_split_block', false);
|
||||
};
|
||||
|
||||
var getPageBreakClass = function () {
|
||||
return 'mce-pagebreak';
|
||||
};
|
||||
var getPlaceholderHtml = function () {
|
||||
return '<img src="' + global$1.transparentSrc + '" class="' + getPageBreakClass() + '" data-mce-resize="false" data-mce-placeholder />';
|
||||
};
|
||||
var setup = function (editor) {
|
||||
var separatorHtml = getSeparatorHtml(editor);
|
||||
var pageBreakSeparatorRegExp = new RegExp(separatorHtml.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g, function (a) {
|
||||
return '\\' + a;
|
||||
}), 'gi');
|
||||
editor.on('BeforeSetContent', function (e) {
|
||||
e.content = e.content.replace(pageBreakSeparatorRegExp, getPlaceholderHtml());
|
||||
});
|
||||
editor.on('PreInit', function () {
|
||||
editor.serializer.addNodeFilter('img', function (nodes) {
|
||||
var i = nodes.length, node, className;
|
||||
while (i--) {
|
||||
node = nodes[i];
|
||||
className = node.attr('class');
|
||||
if (className && className.indexOf('mce-pagebreak') !== -1) {
|
||||
var parentNode = node.parent;
|
||||
if (editor.schema.getBlockElements()[parentNode.name] && shouldSplitBlock(editor)) {
|
||||
parentNode.type = 3;
|
||||
parentNode.value = separatorHtml;
|
||||
parentNode.raw = true;
|
||||
node.remove();
|
||||
continue;
|
||||
}
|
||||
node.type = 3;
|
||||
node.value = separatorHtml;
|
||||
node.raw = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
var register = function (editor) {
|
||||
editor.addCommand('mcePageBreak', function () {
|
||||
if (shouldSplitBlock(editor)) {
|
||||
editor.insertContent('<p>' + getPlaceholderHtml() + '</p>');
|
||||
} else {
|
||||
editor.insertContent(getPlaceholderHtml());
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var setup$1 = function (editor) {
|
||||
editor.on('ResolveName', function (e) {
|
||||
if (e.target.nodeName === 'IMG' && editor.dom.hasClass(e.target, getPageBreakClass())) {
|
||||
e.name = 'pagebreak';
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var register$1 = function (editor) {
|
||||
editor.ui.registry.addButton('pagebreak', {
|
||||
icon: 'page-break',
|
||||
tooltip: 'Page break',
|
||||
onAction: function () {
|
||||
return editor.execCommand('mcePageBreak');
|
||||
}
|
||||
});
|
||||
editor.ui.registry.addMenuItem('pagebreak', {
|
||||
text: 'Page break',
|
||||
icon: 'page-break',
|
||||
onAction: function () {
|
||||
return editor.execCommand('mcePageBreak');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
function Plugin () {
|
||||
global.add('pagebreak', function (editor) {
|
||||
register(editor);
|
||||
register$1(editor);
|
||||
setup(editor);
|
||||
setup$1(editor);
|
||||
});
|
||||
}
|
||||
|
||||
Plugin();
|
||||
|
||||
}());
|
9
public/Dashboard/vendors/tinymce/plugins/pagebreak/plugin.min.js
vendored
Normal file
9
public/Dashboard/vendors/tinymce/plugins/pagebreak/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.7.0 (2021-02-10)
|
||||
*/
|
||||
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){return e.getParam("pagebreak_split_block",!1)},g=function(){return"mce-pagebreak"},m=function(){return'<img src="'+a.transparentSrc+'" class="'+g()+'" data-mce-resize="false" data-mce-placeholder />'};e.add("pagebreak",function(e){var a,n,o,c,t,r;(a=e).addCommand("mcePageBreak",function(){i(a)?a.insertContent("<p>"+m()+"</p>"):a.insertContent(m())}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return n.execCommand("mcePageBreak")}}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return n.execCommand("mcePageBreak")}}),c=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,m())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,a.remove();continue}a.type=3,a.value=c,a.raw=!0}})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,g())&&(e.name="pagebreak")})})}();
|
Reference in New Issue
Block a user