first commit

This commit is contained in:
Mr.Qin
2022-08-19 19:48:37 +08:00
commit afdd648b65
3275 changed files with 631084 additions and 0 deletions

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.10.2 (2021-11-17)
*/
!function(){"use strict";function f(t,e,n){t.execCommand("UL"===e?"InsertUnorderedList":"InsertOrderedList",!1,!1===n?null:{"list-style-type":n})}function i(t){return function(){return t}}function t(t){return t}function e(){return s}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),g=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=i(!1),l=i(!0),s={fold:function(t,e){return t()},isSome:u,isNone:l,getOr:t,getOrThunk:r,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(void 0),or:t,orThunk:r,map:e,each:function(){},bind:e,exists:u,forall:l,filter:function(){return s},toArray:function(){return[]},toString:i("none()")};function r(t){return t()}function d(t){return t&&/^(TH|TD)$/.test(t.nodeName)}function m(c,a){return function(s){function t(t){var e,n,r,o,i,u,l;s.setActive((e=c,r=a,i=-1!==(o=function(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return n;return-1}((n=t).parents,d))?n.parents.slice(0,o):n.parents,0<(u=g.grep(i,(l=e,function(t){return t&&/^(OL|UL|DL)$/.test(t.nodeName)&&(e=t,l.$.contains(l.getBody(),e));var e}))).length&&u[0].nodeName===r))}return c.on("NodeChange",t),function(){return c.off("NodeChange",t)}}}function c(t,e,n,r,o,i){var u,l,s,c,a,d;1<i.length?(c=r,a=o,d=i,(s=t).ui.registry.addSplitButton(e,{tooltip:n,icon:"OL"===a?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(t){t(g.map(d,function(t){return{type:"choiceitem",value:"default"===t?"":t,icon:"list-"+("OL"===a?"num":"bull")+"-"+("disc"===t||"decimal"===t?"default":t),text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()})}}))},onAction:function(){return s.execCommand(c)},onItemAction:function(t,e){f(s,a,e)},select:function(e){var t,n=(t=s).dom.getParent(t.selection.getNode(),"ol,ul"),r=t.dom.getStyle(n,"listStyleType");return p(r).map(function(t){return e===t}).getOr(!1)},onSetup:m(s,a)})):(l=r,(u=t).ui.registry.addToggleButton(e,{active:!1,tooltip:n,icon:"OL"===o?"ordered-list":"unordered-list",onSetup:m(u,o),onAction:function(){return u.execCommand(l)}}))}var a=function(n){function t(){return o}function e(t){return t(n)}var r=i(n),o={fold:function(t,e){return e(n)},isSome:l,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:t,orThunk:t,map:function(t){return a(t(n))},each:function(t){t(n)},bind:e,exists:e,forall:e,filter:function(t){return t(n)?o:s},toArray:function(){return[n]},toString:function(){return"some("+n+")"}};return o},p=function(t){return null==t?s:a(t)};n.add("advlist",function(t){var n,e,r,o;t.hasPlugin("lists")?(c(e=t,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),c(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(n=t).addCommand("ApplyUnorderedListStyle",function(t,e){f(n,"UL",e["list-style-type"])}),n.addCommand("ApplyOrderedListStyle",function(t,e){f(n,"OL",e["list-style-type"])})):console.error("Please use the Lists plugin together with the Advanced List plugin.")})}();

View File

@@ -0,0 +1,240 @@
/**
* Copyright meystack
* Licensed Apache2.0
* Version: 0.0.1 付费内容插入
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var pluginNama = '插入付费内容';
var setContent = function (editor, html) {
editor.focus();
editor.undoManager.transact(function () {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
var getContent = function (editor) {
return editor.getContent({ source_view: true });
};
var open = function (editor) {
var editorContent = getContent(editor);
editor.windowManager.open({
title: pluginNama,
size: 'small',
body: {
type: 'panel',
items: [{
type: 'textarea',
name: 'code'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Insert',
primary: true
}
],
initialData: { code: editorContent },
onSubmit: function (api) {
setContent(editor, api.getData().code);
api.close();
}
});
};
// 付费内容图标
global.ui.registry.getAll().icons.ajaximages || global.ui.registry.addIcon('ajaximages','<?xml version="1.0" encoding="UTF-8"?><svg width="18" height="18" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M4 14C4 12.8954 4.89543 12 6 12H42C43.1046 12 44 12.8954 44 14V40C44 41.1046 43.1046 42 42 42H6C4.89543 42 4 41.1046 4 40V14Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M19 19L24 24L29 19" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 25H30" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M18 31H30" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 25V35" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M8 6H40" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>');
var register$1 = function (editor) {
editor.addCommand('mceCodeEditor', function () {
open(editor);
});
};
var register = function (editor) {
var onAction = function () {
return editor.execCommand('mceCodeEditor');
};
editor.ui.registry.addButton('ajaximages', {
icon: 'sourcecode',
tooltip: pluginName,
onAction: onAction
});
editor.ui.registry.addMenuItem('ajaximages', {
icon: 'sourcecode',
text: pluginName,
onAction: onAction
});
};
function Plugin () {
global.add('code', function (editor) {
register$1(editor);
register(editor);
return {};
});
}
Plugin();
}());
// tinymce.PluginManager.add('ajaximages', function(editor, url) {
// var pluginName='插入付费内容';
// var baseURL=tinymce.baseURL;
// var iframe1 = baseURL+'/plugins/ajaximages/map.html';
// var ajaximages_width = function (editor) {
// return editor.getParam('ajaximages_width', 560);
// };
// var ajaximages_height = function (editor) {
// return editor.getParam('ajaximages_height', 362);
// };
//
// window.tinymceLng='';
// window.tinymceLat='';
//
// var openDialog = function() {
// console.log(editor.windowManager)
// return editor.windowManager.open({
// title: pluginName,
// size: 'small',
// body: {
// type: 'panel',
// items: [{
// type: 'textarea',
// name: 'code'
// }]
// },
// buttons: [
// {
// type: 'cancel',
// text: 'Close'
// },
// {
// type: 'custom',
// text: 'Insert',
// name: 'save',
// primary: true
// },
// ],
// onAction: function (api, details) {
// switch (details.name) {
// case 'save':
// // html='<iframe src="'+baseURL+'/plugins/ajaximages/bd.html?center='+tinymceLng+'%2C'+tinymceLat+'&zoom=14&width='+(ajaximages_width(editor)-2)+'&height='+(ajaximages_height(editor)-2)+'" frameborder="0" style="width:'+ajaximages_width(editor)+'px;height:'+ajaximages_height(editor)+'px;">';
//
// var html = '123';
// editor.insertContent(html);
// api.close();
// break;
// default:
// break;
// }
//
// }
// });
// };
//
// // 付费内容
//
//
// // 图片本地化
// // editor.ui.registry.getAll().icons.ajaximages || editor.ui.registry.addIcon('ajaximages','<?xml version="1.0" encoding="UTF-8"?><svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><rect x="6" y="6" width="36" height="36" rx="3" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M32 28L24 36L16 28" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 20V35.5" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M16 14H32" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/></svg>');
//
// editor.ui.registry.addButton('ajaximages', {
// icon: 'ajaximages',
// tooltip: pluginName,
// onAction: function() {
// openDialog();
// }
// });
//
//
// editor.ui.registry.addMenuItem('ajaximages', {
// text: pluginName,
// onAction: function() {
// openDialog();
// }
// });
// return {
// getMetadata: function() {
// return {
// name: pluginName,
// url: "http://tinymce.ax-z.cn/more-plugins/ajaximages.php",
// };
// }
// };
// });
// ;(function() {
// 'use strict'
//
// // 通过 tinymce.util.Tools.resolve 加载 tinymce 的模块
// var global = tinymce.util.Tools.resolve('tinymce.PluginManager'),
// pluginName = 'ajaximages';
//
//
// var register = function(editor) {
// // 相关的业务逻辑
// editor.addCommand('InsertHorizontalRule', function() {})
// }
// var Commands = { register: register }
//
// // 主窗体
// var openDialog = function () {
// console.log(123)
// }
//
// global.ui.registry.getAll().icons.imgicon || global.ui.registry.addIcon('imgicon','<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M670.8,733c21.1-46.1,45.6-73.7,64.5-90.5,10.3-9.2,21.1-16.8,32.5-21.7-6-8.1-10.6-15.3-15.2-22.2-8.4-12.6-17.3-27.1-21.7-34.1-28.7,15.7-55.9,48.2-77.5,77-12.5,16.7-23.8,34.7-34.7,53.7l52,37.9zM450.2,803.5c6,14.6,9.2,29.3,13.5,40.6,1.6,7.1,3.2,13.5,5.4,19.5,19.5-6,39-12,58-20.1,32.5-13.6,71-33,95.4-58.5l-45-48.2c-8.1,8.1-17.9,14.7-30.4,22.8-21.1,13.6-51.5,30.4-97,43.9zM373.8,204.1c0-52,43.4-95.4,95.4-95.4,53.7,0,94.8,43.4,94.8,95.4,0,53.6-41.2,95.4-94.8,95.4-52,0-95.4-41.7-95.4-95.4zm-105.7,0c0,20.1,2.7,39.6,8.7,58.5h-2.2c16.8,39,35.8,79.9,52,111.1l27.1,52c47.5,91.2,105.7,191.3,114.3,204.3,1.1,0,0.547,0,1.1,1.1,32.5-54.7,60.6-104.1,81.8-143.6l34.1-63.4,26.6-52c15.8-30.9,34.7-71,51.5-110.6h-1.6c6-19,8.7-38.5,8.7-58.5,0-110.6-90.5-200.5-201.1-200.5-111.1,0-201.1,90-201.1,200.5zM229.6,800.2c15.2,11.4,31.3,21.3,48.2,30.4,30.2,16,68.8,34.1,112.7,40.7,1.6-13.1,2.5-29.9,4.3-42.3l3.3-21.7c-11.9-2.2-25.6-5.6-40.1-10.8-24.5-8.8-55.8-23.8-90.5-48.2-9.2,13.5-18.6,25.7-26,35.8l-11.9,16.3zM17.2,949.8c0,41.2,33.6,74.2,74.2,74.2H932.5a74,74,0,0,0,74.2-74.2V336.9A74,74,0,0,0,932.5,262.6H728.2L692.4,362.9H894.6c9.2,0,15.7,6,15.7,15.2V511.4c-28.7-0.531-73.2,2.2-116.5,23.3l5.4,14.6,17.3,45c25.5-8.1,47.7-14.2,65-16.8l28.7-4.3V911.9c0,9.2-6.5,15.1-15.7,15.1H133.2c-9.2,0-15.7-5.9-15.7-15.1V704.8a261.1,261.1,0,0,0,15.2,14.1c9.3,8,23.3,21.1,41.2,36.3,10.3-9.2,20-21.2,28.2-29.8,4.8-5,9.2-9.8,13-14.6-42.8-35.8-86.2-86.2-97.5-100.3V378c0-8.7,6.5-15.2,15.7-15.2h53L209.5,262.5H91.4c-40.7,0-74.2,33.1-74.2,74.3V949.7z"/></svg>');
//
// var register$1 = function(editor) {
//
// // 按钮相关的业务逻辑
// editor.ui.registry.addButton('ajaximages', {
// icon: 'imgicon',
// tooltip: pluginName,
// onAction: function() {
// openDialog();
// }
// })
//
// // 菜单相关逻辑
// editor.ui.registry.addMenuItem('ajaximages', {
// text: pluginName,
// onAction: function() {
// openDialog();
// }
// })
// }
//
// var Buttons = { register: register$1 }
//
// function Plugin() {
// console.log(global)
// // global 其实是 PluginManager
// // 通过 add 把当前 hr 插件注册到 tinymce 插件中
// global.add('ajaximages', function(editor) {
// // 注册公共方法
// Commands.register(editor)
// // 注册 toolbar 的按钮
// Buttons.register(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.10.2 (2021-11-17)
*/
!function(){"use strict";function a(e){return e.getAttribute("id")||e.getAttribute("name")||""}function c(e){return e&&"a"===e.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==a(e)}function d(e){return e.dom.getParent(e.selection.getStart(),l)}function r(e,t){var o,a,n,r,i,l=d(e);l?(n=e,r=t,(i=l).removeAttribute("name"),i.id=r,n.addVisual(),n.undoManager.add()):(a=t,(o=e).undoManager.transact(function(){var e,n;o.getParam("allow_html_in_named_anchor",!1,"boolean")||o.selection.collapse(!0),o.selection.isCollapsed()?o.insertContent(o.dom.createHTML("a",{id:a})):(n=(e=o).dom,u(n).walk(e.selection.getRng(),function(e){s.each(e,function(e){var t;c(t=e)&&!t.firstChild&&n.remove(e,!1)})}),o.formatter.remove("namedAnchor",null,null,!0),o.formatter.apply("namedAnchor",{value:a}),o.addVisual())})),e.focus()}function i(r){return function(e){for(var t,n=0;n<e.length;n++){var o=e[n],a=void 0;!(a=t=o)||a.attr("href")||!a.attr("id")&&!a.attr("name")||t.firstChild||o.attr("contenteditable",r)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),s=tinymce.util.Tools.resolve("tinymce.util.Tools"),l="a:not([href])";e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",i("false")),t.serializer.addNodeFilter("a",i(null))}),(n=e).addCommand("mceAnchor",function(){var o,e,t;t=(e=d(o=n))?a(e):"",o.windowManager.open({title:"Anchor",size:"normal",body:{type:"panel",items:[{name:"id",type:"input",label:"ID",placeholder:"example"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{id:t},onSubmit:function(e){var t=o,n=e.getData().id;(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(r(t,n),0):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),1))||e.close()}})}),(o=e).ui.registry.addToggleButton("anchor",{icon:"bookmark",tooltip:"Anchor",onAction:function(){return o.execCommand("mceAnchor")},onSetup:function(e){return o.selection.selectorChangedWithUnbind("a:not([href])",e.setActive).unbind}}),o.ui.registry.addMenuItem("anchor",{icon:"bookmark",text:"Anchor...",onAction:function(){return o.execCommand("mceAnchor")}}),e.on("PreInit",function(){e.formatter.register("namedAnchor",{inline:"a",selector:l,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:c})})})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function k(e){return/^[(\[{ \u00a0]$/.test(e)}function w(e){return 3===e.nodeType}function i(e){return 1===e.nodeType}function o(e,t){var n;return t<0&&(t=0),!w(e)||(n=e.data.length)<t&&(t=n),t}function y(e,t,n){!i(t)||t.hasChildNodes()?e.setStart(t,o(t,n)):e.setStartBefore(t)}function v(e,t,n){!i(t)||t.hasChildNodes()?e.setEnd(t,o(t,n)):e.setEndAfter(t)}function r(e,t){var n,i,o,r,a,f=e.getParam("autolink_pattern",A),s=e.getParam("default_link_target",!1);if(null===e.dom.getParent(e.selection.getNode(),"a[href]")){var d=e.selection.getRng().cloneRange();if(d.startOffset<5){if(!(r=d.endContainer.previousSibling)){if(!d.endContainer.firstChild||!d.endContainer.firstChild.nextSibling)return;r=d.endContainer.firstChild.nextSibling}if(y(d,r,a=r.length),v(d,r,a),d.endOffset<5)return;n=d.endOffset,i=r}else{if(!w(i=d.endContainer)&&i.firstChild){for(;!w(i)&&i.firstChild;)i=i.firstChild;w(i)&&(y(d,i,0),v(d,i,i.nodeValue.length))}n=1===d.endOffset?2:d.endOffset-1-t}for(var l=n;y(d,i,2<=n?n-2:0),v(d,i,1<=n?n-1:0),--n,!k(d.toString())&&0<=n-2;);k(d.toString())?(y(d,i,n),v(d,i,l),n+=1):(0===d.startOffset?y(d,i,0):y(d,i,n),v(d,i,l)),u=d.toString(),/[?!,.;:]/.test(u.charAt(u.length-1))&&v(d,i,l-1);var u,c,g,h,C=(u=d.toString().trim()).match(f),m=e.getParam("link_default_protocol","http","string");C&&((g=c=C[0]).length>=(h="www.").length&&g.substr(0,0+h.length)===h?c=m+"://"+c:-1===c.indexOf("@")||/^([A-Za-z][A-Za-z\d.+-]*:\/\/)|mailto:/.test(c)||(c="mailto:"+c),o=e.selection.getBookmark(),e.selection.setRng(d),e.execCommand("createlink",!1,c),!1!==s&&e.dom.setAttrib(e.selection.getNode(),"target",s),e.selection.moveToBookmark(o),e.nodeChanged())}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),A=new RegExp("^"+/(?:[A-Za-z][A-Za-z\d.+-]{0,14}:\/\/(?:[-.~*+=!&;:'%@?^${}(),\w]+@)?|www\.|[-;:&=+$,.\w]+@)[A-Za-z\d-]+(?:\.[A-Za-z\d-]+)*(?::\d+)?(?:\/(?:[-+~=.,%()\/\w]*[-+~=%()\/\w])?)?(?:\?(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?(?:#(?:[-.~*+=!&;:'%@?^${}(),\/\w]+))?/g.source+"$","i");e.add("autolink",function(e){var t,n;(t=e).on("keydown",function(e){if(13===e.keyCode)return r(t,-1)}),a.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){if(41===e.keyCode||93===e.keyCode||125===e.keyCode)return r(t,-1)}),t.on("keyup",function(e){if(32===e.keyCode)return r(t,0)}))})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function y(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")}function p(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function v(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var l=Object.hasOwnProperty,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),b=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t,n){var i,o,r,s,a,l,u,g,c,m,f,d=e.dom,h=e.getDoc();h&&(e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()?p(e,!0):(i=h.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(d,i,"margin-top",!0),a=v(d,i,"margin-bottom",!0),(l=(l=i.offsetHeight+s+a+o)<0?0:l)+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=l+u),(g=e.getParam("max_height",0,"number"))&&g<r?(r=g,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),d.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),b.browser.isSafari()&&b.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),!e.hasFocus()||"setcontent"!==(null==(f=n)?void 0:f.type.toLowerCase())||!0!==f.selection&&!0!==f.paste||e.selection.scrollIntoView(),b.webkit&&c<0&&C(e,t,n))))};e.add("autoresize",function(e){var t,n,i,o,r,s,a=e.settings;l.call(a,"resize")||(e.settings.resize=!1),e.inline||(s=0,r=t={get:function(){return s},set:function(e){s=e}},(o=e).addCommand("mceAutoResize",function(){C(o,r)}),i=t,(n=e).on("init",function(){var e=n.getParam("autoresize_overflow_padding",1,"number"),t=n.dom;t.setStyles(n.getDoc().documentElement,{height:"auto"}),t.setStyles(n.getBody(),{paddingLeft:e,paddingRight:e,"min-height":0})}),n.on("NodeChange SetContent keyup FullscreenStateChanged ResizeContent",function(e){C(n,i,e)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){u(n,i,20,100,function(){u(n,i,5,1e3)})}))})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function o(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)}function n(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)}function i(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=d.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)}function u(t){var e=parseInt(v.getItem(n(t)+"time"),10)||0;return!((new Date).getTime()-e>o(t.getParam("autosave_retention"),"20m")&&(g(t,!1),1))}function s(t){var e=n(t);!i(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))}function f(t){var e=n(t);u(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))}function c(t){t.undoManager.transact(function(){f(t),g(t)}),t.focus()}function m(r){return function(t){function e(){return t.setDisabled(!u(r))}return t.setDisabled(!u(r)),r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(t){return void 0===t},l=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var r=n(t);v.removeItem(r+"draft"),v.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},y=tinymce.util.Tools.resolve("tinymce.EditorManager");t.add("autosave",function(t){var e,r,n,a;return t.editorManager.on("BeforeUnload",function(t){var e;d.each(y.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),n=e=t,a=o(n.getParam("autosave_interval"),"30s"),l.setEditorInterval(n,function(){s(n)},a),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){c(e)},onSetup:m(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&f(t)}),r=t,{hasDraft:function(){return u(r)},storeDraft:function(){return s(r)},restoreDraft:function(){return f(r)},removeDraft:function(t){return g(r,t)},isEmpty:function(t){return i(r,t)}}})}();

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@@ -0,0 +1,76 @@
tinymce.PluginManager.add('axupimgs', function(editor, url) {
var pluginName='多图片上传';
window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置
var baseURL=tinymce.baseURL;
var iframe1 = baseURL+'/plugins/axupimgs/upfiles.html';
axupimgs.images_upload_handler = editor.getParam('images_upload_handler', undefined, 'function');
axupimgs.images_upload_base_path = editor.getParam('images_upload_base_path', '', 'string');
axupimgs.axupimgs_filetype = editor.getParam('axupimgs_filetype', '.png,.gif,.jpg,.jpeg', 'string');
axupimgs.res=[];
var openDialog = function() {
return editor.windowManager.openUrl({
title: pluginName,
size: 'large',
url:iframe1,
buttons: [
{
type: 'cancel',
text: 'Close'
},
{
type: 'custom',
text: 'Save',
name: 'save',
primary: true
},
],
onAction: function (api, details) {
switch (details.name) {
case 'save':
var html = '';
var imgs = axupimgs.res;
var len = imgs.length;
for(let i=0;i<len;i++){
if( imgs[i].url ){
html += '<img src="'+imgs[i].url+'" />';
}
}
editor.insertContent(html);
axupimgs.res=[];
api.close();
break;
default:
break;
}
}
});
};
editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs','<svg viewBox="0 0 1280 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M1126.2,779.8V87.6c0-24-22.6-86.9-83.5-86.9H83.5C14.7,0.7,0,63.7,0,87.7v692c0,36.2,29.2,89.7,83.5,89.7l959.3-1.3c51.7,0,83.5-42.5,83.5-88.3zm-1044,4V86.3h961.6V783.7H82.2v0.1z" fill="#53565A"/><path d="M603,461.6L521.1,366.3,313,629.8,227.2,546.8,102.4,716.8H972.8v-170L768.2,235.2,603.1,461.6zM284.6,358.4a105.4,105.4,0,0,0,73.5-30c19.5-19.1,30.3-45,30.2-71.8,0-56.8-45.9-103-102.4-103-56.6,0-102.4,46.1-102.4,103C183.4,313.5,228,358.4,284.6,358.4z" fill="#9598A0"/><path d="M1197.7,153.6l-0.3,669.3s13.5,113.9-67.4,113.9H153.6c0,24.1,23.9,87.2,83.5,87.2h959.3c58.3,0,83.6-49.5,83.6-89.9V240.8c-0.1-41.8-44.9-87.2-82.3-87.2z" fill="#53565A"/></svg>');
editor.ui.registry.addButton('axupimgs', {
icon: 'axupimgs',
tooltip: pluginName,
onAction: function() {
openDialog();
}
});
editor.ui.registry.addMenuItem('axupimgs', {
icon: 'axupimgs',
text: '图片批量上传...',
onAction: function() {
openDialog();
}
});
return {
getMetadata: function() {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/axupimgs.php",
};
}
};
});

View File

@@ -0,0 +1,75 @@
tinymce.PluginManager.add('axupimgs', function(editor, url) {
var pluginName='图片上传';
window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置
var baseURL=tinymce.baseURL;
var iframe1 = baseURL+'/plugins/axupimgs/upfiles.html';
axupimgs.images_upload_handler = editor.getParam('images_upload_handler', undefined, 'function');
axupimgs.images_upload_base_path = editor.getParam('images_upload_base_path', '', 'string');
axupimgs.axupimgs_filetype = editor.getParam('axupimgs_filetype', '.png,.gif,.jpg,.jpeg', 'string');
axupimgs.res=[];
var openDialog = function() {
return editor.windowManager.openUrl({
title: pluginName,
size: 'large',
url:iframe1,
buttons: [
{
type: 'cancel',
text: 'Close'
},
{
type: 'custom',
text: 'Save',
name: 'save',
primary: true
},
],
onAction: function (api, details) {
switch (details.name) {
case 'save':
var html = '';
var imgs = axupimgs.res;
var len = imgs.length;
for(let i=0;i<len;i++){
if( imgs[i].url ){
html += '<img src="'+imgs[i].url+'" />';
}
}
editor.insertContent(html);
axupimgs.res=[];
api.close();
break;
default:
break;
}
}
});
};
editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs','<svg viewBox="0 0 1280 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M1126.2,779.8V87.6c0-24-22.6-86.9-83.5-86.9H83.5C14.7,0.7,0,63.7,0,87.7v692c0,36.2,29.2,89.7,83.5,89.7l959.3-1.3c51.7,0,83.5-42.5,83.5-88.3zm-1044,4V86.3h961.6V783.7H82.2v0.1z" fill="#53565A"/><path d="M603,461.6L521.1,366.3,313,629.8,227.2,546.8,102.4,716.8H972.8v-170L768.2,235.2,603.1,461.6zM284.6,358.4a105.4,105.4,0,0,0,73.5-30c19.5-19.1,30.3-45,30.2-71.8,0-56.8-45.9-103-102.4-103-56.6,0-102.4,46.1-102.4,103C183.4,313.5,228,358.4,284.6,358.4z" fill="#9598A0"/><path d="M1197.7,153.6l-0.3,669.3s13.5,113.9-67.4,113.9H153.6c0,24.1,23.9,87.2,83.5,87.2h959.3c58.3,0,83.6-49.5,83.6-89.9V240.8c-0.1-41.8-44.9-87.2-82.3-87.2z" fill="#53565A"/></svg>');
editor.ui.registry.addButton('axupimgs', {
icon: 'axupimgs',
tooltip: pluginName,
onAction: function() {
openDialog();
}
});
editor.ui.registry.addMenuItem('axupimgs', {
icon: 'axupimgs',
text: '图片批量上传...',
onAction: function() {
openDialog();
}
});
return {
getMetadata: function() {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/axupimgs.php",
};
}
};
});

View File

@@ -0,0 +1,203 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>axupimgs</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<style>
html,body{height:100%;margin:0;padding:0;background:#fff;}
ul{margin:0;padding:0;list-style:none;}
#wrap{padding:10px;}
#topbar{padding:10px 0;border-bottom:1px solid #ccc;text-align:right;}
#topbar button {margin:0;margin-left:5px;outline:none;padding: 4px 16px;box-sizing: border-box;
display:inline-block;border:none;border-radius:3px;text-align:center;cursor:pointer;
font-size:14px;line-height:1.5;background-color:#f0f0f0;color:#223;
}
#topbar button.primary{background-color:#3d97d4;color:#fff;}
#topbar button:hover{background-color:#207ab7;color:#fff;}
#topbar button.removeall{float:left}
#file_list {display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));padding-top:10px;}
#file_list:empty:after{content:'可以直接拖拽文件到这里';color:#777;font-size:0.8em;}
#file_list li{position:relative;display:block;vertical-align:top;padding:5px 5px;border-radius:5px;}
#file_list li.up-over {}
#file_list li.up-now {}
#file_list li.up-now:after{content:'';position:absolute;top:0;left:0;display:block;width:100%;height:100%;background:rgba(255,255,255,0.8) url(loading.gif) center center no-repeat;border-radius:5px;z-index:999;}
#file_list li:hover{background-color:#ddd;}
#file_list li .picbox {display:flex;flex:0 0 auto;justify-content:center;overflow:hidden;position:relative;width:100%;padding-top:100%;align-items:center;}
#file_list li .picbox img {display:block;max-width:100%;max-height:100%;position:absolute;
top:50%;left:50%;transform:translateX(-50%) translateY(-50%);}
#file_list li.up-over .picbox:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20viewBox%3D%220%200%201024%201024%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M512%200C229.376%200%200%20229.376%200%20512s229.376%20512%20512%20512%20512-229.376%20512-512S794.624%200%20512%200z%22%20fill%3D%22%234AC711%22%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M855.552%20394.752l-358.4%20358.4a50.9952%2050.9952%200%200%201-72.192%200l-204.8-204.8c-18.944-19.968-18.944-51.2%200-71.168a50.5344%2050.5344%200%200%201%2072.192-1.024L460.8%20644.608l322.048-322.048c19.968-18.944%2051.2-18.944%2071.168%200%2020.48%2019.456%2020.992%2051.712%201.536%2072.192z%22%20fill%3D%22%23FFFFFF%22%3E%3C%2Fpath%3E%3C%2Fsvg%3E');position:absolute;bottom:2px;right:2px;z-index:9;}
#file_list li .tools {display:none;position:absolute;bottom:5px;right:5px;z-index:99;}
#file_list li:hover .tools {display:block;}
#file_list li .tools .remove{cursor:pointer;}
#file_list li .tools .remove:after{content:url('data:image/svg+xml;%20charset=utf8,%3Csvg%20width=%2224%22%20height=%2224%22%20viewBox=%220%200%2024%2024%22%20xmlns=%22http://www.w3.org/2000/svg%22%3E%3Cpath%20d=%22M17%206h3a1%201%200%200%201%200%202h-1v11a3%203%200%200%201-3%203H8a3%203%200%200%201-3-3V8H4a1%201%200%201%201%200-2h3V5a3%203%200%200%201%203-3h4a3%203%200%200%201%203%203v1zm-2%200V5a1%201%200%200%200-1-1h-4a1%201%200%200%200-1%201v1h6zm2%202H7v11a1%201%200%200%200%201%201h8a1%201%200%200%200%201-1V8zm-8%203a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6zm4%200a1%201%200%200%201%202%200v6a1%201%200%200%201-2%200v-6z%22%3E%3C/path%3E%3C/svg%3E');}
#file_list li .namebox {font-size:14px;line-height:20px;max-height:40px;overflow:hidden;padding:5px 10px;text-align:center;display:flex;justify-content:center;align-items:flex-start;}
#file_list li .namebox span{word-break:break-all;vertical-align:top;}
</style>
</head>
<body>
<div id="wrap">
<div id="topbar"><button class="addfile primary">+ 添加文件</button><button class="upall primary">全部上传</button><button class="removeall">清空列表</button></div>
<ul id="file_list"></ul>
</div>
<script>
var editor=parent.tinymce.activeEditor;
var axupimgs=parent.axupimgs;
axupimgs.res = []; //存放本地文件的数组
var blobInfo = {file:null}
blobInfo.blob = function(){return this.file;}
var upload_handler = axupimgs.images_upload_handler;
var upload_base_path = axupimgs.images_upload_base_path;
//为列表添加排序
function reSort(){
document.querySelectorAll('#file_list li').forEach((el,i)=>{
el.setAttribute('data-num',i);
});
}
function addList(files){
var files_sum = files.length;
var vDom = document.createDocumentFragment();
for(let i=0;i<files_sum;i++){
let file = files[i];
let blobUrl = window.URL.createObjectURL(file)
axupimgs.res.push({file:file,blobUrl:blobUrl,url:''});
let li = document.createElement('li');
li.setAttribute('class','up-no');
li.setAttribute('data-time',file.lastModified);
li.innerHTML='<div class="picbox"><img src="'+blobUrl+'"></div><div class="namebox"><span>'+file.name+'</span></div><div class="tools"><a class="remove"></a></div>';
vDom.appendChild(li);
}
document.querySelector('#file_list').appendChild(vDom);
//reSort();
}
//清空列表
document.querySelector('#topbar .removeall').addEventListener('click',()=>{
axupimgs.res=[]
document.querySelectorAll('#file_list li').forEach((el,i)=>{
el.parentNode.removeChild(el)
});
});
//拖拽添加
document.addEventListener('dragover', (e)=>{
e.stopPropagation();
e.preventDefault();
e.dataTransfer.dropEffect = 'copy';
});
document.addEventListener('drop', (e)=>{
e.stopPropagation();
e.preventDefault();
if(!e.dataTransfer.files){return false;}
var dropfiles = e.dataTransfer.files;
if(!(dropfiles.length>0)){return false;}
var exts=axupimgs.axupimgs_filetype.replace(/(\s)+/g,'').toLowerCase().split(',');
var files=[];
for( let file of dropfiles ){
ext = file.name.split('.');
ext = '.'+ext[ext.length-1];
for(let s of exts){
if(s==ext){
files.push(file);
break;
}
}
}
if(files.length>0){ addList(files) }
});
//添加文件
document.querySelector('#topbar .addfile').addEventListener('click',()=>{
var input = document.createElement('input');
input.setAttribute('type', 'file');
input.setAttribute('multiple', 'multiple');
input.setAttribute('accept', axupimgs.axupimgs_filetype);
input.click();
input.onchange = function() {
var files = this.files;
addList(files);
}
});
var file_i = 0;
function upAllFiles(n){
var len = axupimgs.res.length;
file_i = n;
if(len == n){
file_i=0;
document.querySelector('#topbar .upall').innerText='全部上传';
return true;
}
if( axupimgs.res[n].url!='' ){
n++;
upAllFiles(n)
}else{
blobInfo.file=axupimgs.res[n].file;
upload_handler(blobInfo,function(url){
if(upload_base_path){
if(upload_base_path.slice(-1)=='/' && url.substr(0,1)=='/' ){
url = upload_base_path + url.slice(1);
}else if(upload_base_path.slice(-1)!='/' && url.substr(0,1)!='/' ){
url = upload_base_path + '/' + url;
}else{
url = upload_base_path + url;
}
}
axupimgs.res[file_i].url = url;
filename = url.split('/').pop();
var li = document.querySelectorAll('#file_list li')[file_i];
li.setAttribute('class','up-over');
li.querySelector('.namebox span').innerText = filename;
n++
upAllFiles(n);
},function(err){
document.querySelector('#topbar .upall').innerText='全部上传';
document.querySelectorAll('#file_list li.up-now').forEach((el,i)=>{
el.setAttribute('class','up-no');
});
alert(err);
});
}
}
document.querySelector('#topbar .upall').addEventListener('click',(e)=>{
if(e.target.innerText!='全部上传'){return false;}
if(axupimgs.res.length>0){
document.querySelectorAll('#file_list li.up-no').forEach((el,i)=>{
el.classList ? el.classList.add('up-now') : el.className+=' up-now';
});
e.target.innerText='上传中...';
upAllFiles(0);
}
});
var observ_flist = new MutationObserver( (muList,observe)=>{
if(muList[0].addedNodes.length>0){
muList[0].addedNodes.forEach((el)=>{
el.querySelector('.remove').addEventListener('click',(e)=>{
var li = e.target.parentNode.parentNode;
var n = li.getAttribute('data-num');
var el = document.querySelectorAll('#file_list li')[n];
el.parentNode.removeChild(el);
axupimgs.res.splice(n,1);
});
});
}
reSort();
});
observ_flist.observe(document.querySelector('#file_list'),{childList:true});
</script>
</body>
</html>

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.10.2 (2021-11-17)
*/
!function(){"use strict";function i(t){function o(o,e){t=t.replace(o,e)}return t=n.trim(t),o(/\n/gi,"<br />"),o(/\[b\]/gi,"<strong>"),o(/\[\/b\]/gi,"</strong>"),o(/\[i\]/gi,"<em>"),o(/\[\/i\]/gi,"</em>"),o(/\[u\]/gi,"<u>"),o(/\[\/u\]/gi,"</u>"),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'<a href="$1">$2</a>'),o(/\[url\](.*?)\[\/url\]/gi,'<a href="$1">$1</a>'),o(/\[img\](.*?)\[\/img\]/gi,'<img src="$1" />'),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'<font color="$1">$2</font>'),o(/\[code\](.*?)\[\/code\]/gi,'<span class="codeStyle">$1</span>&nbsp;'),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'<span class="quoteStyle">$1</span>&nbsp;'),t}var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.util.Tools");o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){function e(o,e){t=t.replace(o,e)}var t;o.set&&(o.content=i(o.content)),o.get&&(o.content=(t=o.content,t=n.trim(t),e(/<a.*?href=\"(.*?)\".*?>(.*?)<\/a>/gi,"[url=$1]$2[/url]"),e(/<font.*?color=\"(.*?)\".*?class=\"codeStyle\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?color=\"(.*?)\".*?class=\"quoteStyle\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<font.*?class=\"codeStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),e(/<font.*?class=\"quoteStyle\".*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),e(/<span style=\"color: ?(.*?);\">(.*?)<\/span>/gi,"[color=$1]$2[/color]"),e(/<font.*?color=\"(.*?)\".*?>(.*?)<\/font>/gi,"[color=$1]$2[/color]"),e(/<span style=\"font-size:(.*?);\">(.*?)<\/span>/gi,"[size=$1]$2[/size]"),e(/<font>(.*?)<\/font>/gi,"$1"),e(/<img.*?src=\"(.*?)\".*?\/>/gi,"[img]$1[/img]"),e(/<span class=\"codeStyle\">(.*?)<\/span>/gi,"[code]$1[/code]"),e(/<span class=\"quoteStyle\">(.*?)<\/span>/gi,"[quote]$1[/quote]"),e(/<strong class=\"codeStyle\">(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),e(/<strong class=\"quoteStyle\">(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),e(/<em class=\"codeStyle\">(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),e(/<em class=\"quoteStyle\">(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),e(/<u class=\"codeStyle\">(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),e(/<u class=\"quoteStyle\">(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),e(/<\/(strong|b)>/gi,"[/b]"),e(/<(strong|b)>/gi,"[b]"),e(/<\/(em|i)>/gi,"[/i]"),e(/<(em|i)>/gi,"[i]"),e(/<\/u>/gi,"[/u]"),e(/<span style=\"text-decoration: ?underline;\">(.*?)<\/span>/gi,"[u]$1[/u]"),e(/<u>/gi,"[u]"),e(/<blockquote[^>]*>/gi,"[quote]"),e(/<\/blockquote>/gi,"[/quote]"),e(/<br \/>/gi,"\n"),e(/<br\/>/gi,"\n"),e(/<br>/gi,"\n"),e(/<p>/gi,""),e(/<\/p>/gi,"\n"),e(/&nbsp;|\u00a0/gi," "),e(/&quot;/gi,'"'),e(/&lt;/gi,"<"),e(/&gt;/gi,">"),e(/&amp;/gi,"&"),t))})})}();

View File

@@ -0,0 +1,79 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>百度地图API自定义地图</title>
<style>
html,body{margin:0;padding:0;}
.iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap}
.iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word}
</style>
<script src="//api.map.baidu.com/api?key=&v=1.1&services=true"></script>
</head>
<body onload="initMap();">
<!--百度地图容器-->
<div style="width:697px;height:550px;border:#ccc solid 1px;" id="dituContent"></div>
</body>
<script>
function getParam(name) {
return location.href.match(new RegExp('[?&]' + name + '=([^?&]+)', 'i')) ? decodeURIComponent(RegExp.$1) : '';
}
var centerParam = getParam('center');
var zoomParam = getParam('zoom');
var widthParam = getParam('width');
var heightParam = getParam('height');
var markersParam = getParam('center');
//创建和初始化地图函数:
function initMap(){
// [FF]切换模式后报错
if (!window.BMap) {
return;
}
var dituContent = document.getElementById('dituContent');
dituContent.style.width = widthParam + 'px';
dituContent.style.height = heightParam + 'px';
createMap();//创建地图
setMapEvent();//设置地图事件
addMapControl();//向地图添加控件
// 创建标注
var markersArr = markersParam.split(',');
var point = new BMap.Point(markersArr[0], markersArr[1]);
var marker = new BMap.Marker(point);
map.addOverlay(marker); // 将标注添加到地图中
}
//创建地图函数:
function createMap(){
var map = new BMap.Map("dituContent");//在百度地图容器中创建一个地图
var centerArr = centerParam.split(',');
var point = new BMap.Point(centerArr[0], centerArr[1]);//定义一个中心点坐标
map.centerAndZoom(point, zoomParam);//设定地图的中心点和坐标并将地图显示在地图容器中
window.map = map;//将map变量存储在全局
}
//地图事件设置函数:
function setMapEvent(){
map.enableDragging();//启用地图拖拽事件,默认启用(可不写)
//map.enableScrollWheelZoom();//启用地图滚轮放大缩小
map.enableDoubleClickZoom();//启用鼠标双击放大,默认启用(可不写)
map.enableKeyboard();//启用键盘上下左右键移动地图
}
//地图控件添加函数:
function addMapControl(){
//向地图中添加缩放控件
var ctrl_nav = new BMap.NavigationControl({anchor:BMAP_ANCHOR_TOP_LEFT,type:BMAP_NAVIGATION_CONTROL_LARGE});
map.addControl(ctrl_nav);
//向地图中添加缩略图控件
//var ctrl_ove = new BMap.OverviewMapControl({anchor:BMAP_ANCHOR_BOTTOM_RIGHT,isOpen:1});
//map.addControl(ctrl_ove);
//向地图中添加比例尺控件
var ctrl_sca = new BMap.ScaleControl({anchor:BMAP_ANCHOR_BOTTOM_LEFT});
map.addControl(ctrl_sca);
}
</script>
</html>

View File

@@ -0,0 +1,124 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Baidu Maps</title>
<style>
html { height:100%; }
body { height:100%;margin:0;padding:0;background-color:#fff; }
#search_box{position:fixed;top:5px;right:5px;z-index:9999;}
#search_box input{
-webkit-appearance: none;
border-radius:3px;
box-sizing:border-box;
outline:0;
box-shadow:0 0 3px rgba(0,0,0,0.4);
}
#search_box input[type="text"]{
background-color:#fff;
border:1px solid #ccc;
color:#000;
width:180px;
padding:5px;
font-size:16px;
opacity:0.7;
box-shadow:0 0 3px rgba(0,0,0,0.4);
}
#search_box input[type="button"]{
margin-left:5px;
background-color:#207ab7;
border:1px solid #207ab7;
color:#fff;
padding:4px 6px;
font-size:14px;
}
</style>
<script charset="utf-8" src="//api.map.baidu.com/api?v=3.0&ak=ONwdanPtvCDLHBSm184T2ynP"></script>
<script>
var editor=parent.tinymce.activeEditor;
function insCnt(txt){
editor.insertContent(txt);
parent.tinymce.activeEditor.windowManager.close();
}
var map, geocoder;
var lng,lat;
function initialize() {
map = new BMap.Map('map_canvas');
var point = new BMap.Point(116.331398,39.897445);
map.centerAndZoom(point, 14);
map.addControl(new BMap.NavigationControl());
//map.enableScrollWheelZoom();
//根据IP定位
var myCity = new BMap.LocalCity();
myCity.get(function(result){map.setCenter(result.name);});
//浏览器定位,位置更准确,但需要弹出确认,扰民弃用
/*var gl = new BMap.Geolocation();
gl.getCurrentPosition(function(r){
if(this.getStatus() == BMAP_STATUS_SUCCESS){
var mk = new BMap.Marker(r.point);
map.addOverlay(mk);
map.panTo(r.point);
}else {
//alert('failed'+this.getStatus());
}
},{enableHighAccuracy: true})*/
var gc = new BMap.Geocoder();
gc.getLocation(point, function(rs){
var addComp = rs.addressComponents;
var address = [addComp.city].join('');
//console.log(address);
});
map.addEventListener('click',function(e){
//alert(e.point.lng + "," + e.point.lat);
lng=e.point.lng;
lat=e.point.lat;
var marker = new BMap.Marker(new BMap.Point(e.point.lng, e.point.lat));
map.clearOverlays();
map.addOverlay(marker);
//insCnt(lng+','+lat);
parent.tinymceLng=lng;
parent.tinymceLat=lat;
});
document.getElementById('kw').addEventListener('keypress',function(e){
if(e.keyCode=='13'){
e.preventDefault();
searchByStationName();
}
});
}
function searchByStationName() {
var localSearch = new BMap.LocalSearch(map);
//localSearch.enableAutoViewport(); //允许自动调节窗体大小
map.clearOverlays();//清空原来的标注
var keyword = document.getElementById("kw").value;
localSearch.setSearchCompleteCallback(function (searchResult) {
console.log(searchResult);
if(searchResult.Br.length==0){
alert('搜索不到该地区');
return false;
}
var poi = searchResult.Br[0];
map.centerAndZoom(poi.point, 14);
var marker = new BMap.Marker(new BMap.Point(poi.point.lng, poi.point.lat));
parent.tinymceLng=poi.point.lng;
parent.tinymceLat=poi.point.lat;
map.addOverlay(marker);
});
localSearch.search(keyword);
return false;
}
</script>
</head>
<body onload="initialize();">
<div id="search_box"><input id="kw" type="text" value="" autocomplete="off" placeholder="输入要搜索的地点" /><input type="button" value="搜索" onclick="searchByStationName()"></div>
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>

View File

@@ -0,0 +1,70 @@
tinymce.PluginManager.add('bdmap', function(editor, url) {
var pluginName='插入百度地图';
var baseURL=tinymce.baseURL;
var iframe1 = baseURL+'/plugins/bdmap/map.html';
var bdmap_width = function (editor) {
return editor.getParam('bdmap_width', 560);
};
var bdmap_height = function (editor) {
return editor.getParam('bdmap_height', 362);
};
window.tinymceLng='';
window.tinymceLat='';
var openDialog = function() {
return editor.windowManager.openUrl({
title: pluginName,
size: 'large',
url:iframe1,
buttons: [
{
type: 'cancel',
text: 'Close'
},
{
type: 'custom',
text: 'Save',
name: 'save',
primary: true
},
],
onAction: function (api, details) {
switch (details.name) {
case 'save':
html='<iframe src="'+baseURL+'/plugins/bdmap/bd.html?center='+tinymceLng+'%2C'+tinymceLat+'&zoom=14&width='+(bdmap_width(editor)-2)+'&height='+(bdmap_height(editor)-2)+'" frameborder="0" style="width:'+bdmap_width(editor)+'px;height:'+bdmap_height(editor)+'px;">';
editor.insertContent(html);
api.close();
break;
default:
break;
}
}
});
};
editor.ui.registry.getAll().icons.bdmap || editor.ui.registry.addIcon('bdmap','<?xml version="1.0" encoding="UTF-8"?><svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M9.85786 32.7574C6.23858 33.8432 4 35.3432 4 37C4 40.3137 12.9543 43 24 43V43C35.0457 43 44 40.3137 44 37C44 35.3432 41.7614 33.8432 38.1421 32.7574" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 35C24 35 37 26.504 37 16.6818C37 9.67784 31.1797 4 24 4C16.8203 4 11 9.67784 11 16.6818C11 26.504 24 35 24 35Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 22C26.7614 22 29 19.7614 29 17C29 14.2386 26.7614 12 24 12C21.2386 12 19 14.2386 19 17C19 19.7614 21.2386 22 24 22Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>');
editor.ui.registry.addButton('bdmap', {
icon: 'bdmap',
tooltip: pluginName,
onAction: function() {
openDialog();
}
});
editor.ui.registry.addMenuItem('bdmap', {
text: pluginName,
onAction: function() {
openDialog();
}
});
return {
getMetadata: function() {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/bdmap.php",
};
}
};
});

View File

@@ -0,0 +1,70 @@
tinymce.PluginManager.add('bdmap', function(editor, url) {
var pluginName='插入百度地图';
var baseURL=tinymce.baseURL;
var iframe1 = baseURL+'/plugins/bdmap/map.html';
var bdmap_width = function (editor) {
return editor.getParam('bdmap_width', 560);
};
var bdmap_height = function (editor) {
return editor.getParam('bdmap_height', 362);
};
window.tinymceLng='';
window.tinymceLat='';
var openDialog = function() {
return editor.windowManager.openUrl({
title: pluginName,
size: 'large',
//width: 800,
//height: 500,
url:iframe1,
buttons: [
{
type: 'cancel',
text: 'Close'
},
{
type: 'custom',
text: 'Save',
name: 'save',
primary: true
},
],
onAction: function (api, details) {
switch (details.name) {
case 'save':
html='<iframe src="'+baseURL+'/plugins/bdmap/bd.html?center='+tinymceLng+'%2C'+tinymceLat+'&zoom=14&width='+(bdmap_width(editor)-2)+'&height='+(bdmap_height(editor)-2)+'" frameborder="0" style="width:'+bdmap_width(editor)+'px;height:'+bdmap_height(editor)+'px;">';
editor.insertContent(html);
api.close();
break;
default:
break;
}
}
});
};
editor.ui.registry.getAll().icons.bdmap || editor.ui.registry.addIcon('bdmap','<?xml version="1.0" encoding="UTF-8"?><svg width="20" height="20" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"><rect width="48" height="48" fill="white" fill-opacity="0.01"/><path d="M9.85786 32.7574C6.23858 33.8432 4 35.3432 4 37C4 40.3137 12.9543 43 24 43V43C35.0457 43 44 40.3137 44 37C44 35.3432 41.7614 33.8432 38.1421 32.7574" stroke="#333" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/><path d="M24 35C24 35 37 26.504 37 16.6818C37 9.67784 31.1797 4 24 4C16.8203 4 11 9.67784 11 16.6818C11 26.504 24 35 24 35Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/><path d="M24 22C26.7614 22 29 19.7614 29 17C29 14.2386 26.7614 12 24 12C21.2386 12 19 14.2386 19 17C19 19.7614 21.2386 22 24 22Z" fill="none" stroke="#333" stroke-width="4" stroke-linejoin="round"/></svg>');
editor.ui.registry.addButton('bdmap', {
icon: 'bdmap',
tooltip: pluginName,
onAction: function() {
openDialog();
}
});
editor.ui.registry.addMenuItem('bdmap', {
text: pluginName,
onAction: function() {
openDialog();
}
});
return {
getMetadata: function() {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/bdmap.php",
};
}
};
});

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("code",function(e){var t,o;function n(){return o.execCommand("mceCodeEditor")}return(t=e).addCommand("mceCodeEditor",function(){var n,e;e=(n=t).getContent({source_view:!0}),n.windowManager.open({title:"Source Code",size:"large",body:{type:"panel",items:[{type:"textarea",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{code:e},onSubmit:function(e){var t=n,o=e.getData().code;t.focus(),t.undoManager.transact(function(){t.setContent(o)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})}),(o=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:n}),o.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:n}),{}})}();

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){})}();

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,971 @@
/* Tiny FormatPainter plugin
*
* Copyright 2010-2018 Tiny Technologies LLC. All rights reserved.
*
* Version: 1.1.0-23
*/
!function(l) {
"use strict";
var e, r, n, t, o, i, m, a, d, u, c, s, v, f, p = function(e) {
var r = e
, n = function() {
return r
};
return {
get: n,
set: function(e) {
r = e
},
clone: function() {
return p(n())
}
}
}, g = function(e) {
return parseInt(e, 10)
}, h = function(e, r, n) {
return {
major: e,
minor: r,
patch: n
}
}, b = function(e) {
var r = /([0-9]+)\.([0-9]+)\.([0-9]+)(?:(\-.+)?)/.exec(e);
return r ? h(g(r[1]), g(r[2]), g(r[3])) : h(0, 0, 0)
}, y = function(e, r) {
var n = e - r;
return 0 === n ? 0 : 0 < n ? 1 : -1
}, S = function(e, r) {
return !!e && -1 === function(e, r) {
var n = y(e.major, r.major);
if (0 !== n)
return n;
var t = y(e.minor, r.minor);
if (0 !== t)
return t;
var o = y(e.patch, r.patch);
return 0 !== o ? o : 0
}(b([(n = e).majorVersion, n.minorVersion].join(".").split(".").slice(0, 3).join(".")), b(r));
var n
}, O = function(e) {
return function() {
return e
}
}, w = O(!1), N = O(!0), T = w, x = N, E = function() {
return k
}, k = (t = {
fold: function(e, r) {
return e()
},
is: T,
isSome: T,
isNone: x,
getOr: n = function(e) {
return e
}
,
getOrThunk: r = function(e) {
return e()
}
,
getOrDie: function(e) {
throw new Error(e || "error: getOrDie called on none.")
},
getOrNull: function() {
return null
},
getOrUndefined: function() {},
or: n,
orThunk: r,
map: E,
ap: E,
each: function() {},
bind: E,
flatten: E,
exists: T,
forall: x,
filter: E,
equals: e = function(e) {
return e.isNone()
}
,
equals_: e,
toArray: function() {
return []
},
toString: O("none()")
},
Object.freeze && Object.freeze(t),
t), A = function(n) {
var e = function() {
return n
}
, r = function() {
return o
}
, t = function(e) {
return e(n)
}
, o = {
fold: function(e, r) {
return r(n)
},
is: function(e) {
return n === e
},
isSome: x,
isNone: T,
getOr: e,
getOrThunk: e,
getOrDie: e,
getOrNull: e,
getOrUndefined: e,
or: r,
orThunk: r,
map: function(e) {
return A(e(n))
},
ap: function(e) {
return e.fold(E, function(e) {
return A(e(n))
})
},
each: function(e) {
e(n)
},
bind: t,
flatten: e,
exists: t,
forall: t,
filter: function(e) {
return e(n) ? o : k
},
equals: function(e) {
return e.is(n)
},
equals_: function(e, r) {
return e.fold(T, function(e) {
return r(n, e)
})
},
toArray: function() {
return [n]
},
toString: function() {
return "some(" + n + ")"
}
};
return o
}, _ = {
some: A,
none: E,
from: function(e) {
return null == e ? k : A(e)
}
}, D = function(r) {
return function(e) {
return function(e) {
if (null === e)
return "null";
var r = typeof e;
return "object" === r && Array.prototype.isPrototypeOf(e) ? "array" : "object" === r && String.prototype.isPrototypeOf(e) ? "string" : r
}(e) === r
}
}, C = D("string"), L = D("boolean"), R = D("function"), P = D("number"), F = void 0 === (o = Array.prototype.indexOf) ? function(e, r) {
return q(e, r)
}
: function(e, r) {
return o.call(e, r)
}
, I = function(e, r) {
return -1 < F(e, r)
}, j = function(e, r) {
return V(e, r).isSome()
}, M = function(e, r) {
for (var n = e.length, t = new Array(n), o = 0; o < n; o++) {
var i = e[o];
t[o] = r(i, o, e)
}
return t
}, B = function(e, r) {
for (var n = [], t = 0, o = e.length; t < o; t++) {
var i = e[t];
r(i, t, e) && n.push(i)
}
return n
}, U = function(e, r) {
for (var n = 0, t = e.length; n < t; n++) {
var o = e[n];
if (r(o, n, e))
return _.some(o)
}
return _.none()
}, V = function(e, r) {
for (var n = 0, t = e.length; n < t; n++)
if (r(e[n], n, e))
return _.some(n);
return _.none()
}, q = function(e, r) {
for (var n = 0, t = e.length; n < t; ++n)
if (e[n] === r)
return n;
return -1
}, X = Array.prototype.push, z = function(e, r) {
return function(e) {
for (var r = [], n = 0, t = e.length; n < t; ++n) {
if (!Array.prototype.isPrototypeOf(e[n]))
throw new Error("Arr.flatten item " + n + " was not an array, input: " + e);
X.apply(r, e[n])
}
return r
}(M(e, r))
}, H = (Array.prototype.slice,
R(Array.from) && Array.from,
Object.keys), W = Object.hasOwnProperty, Y = function(e, r) {
for (var n = H(e), t = 0, o = n.length; t < o; t++) {
var i = n[t];
r(e[i], i, e)
}
}, G = function(t, o) {
var i = {};
return Y(t, function(e, r) {
var n = o(e, r, t);
i[n.k] = n.v
}),
i
}, $ = function(e) {
return n = function(e) {
return e
}
,
t = [],
Y(e, function(e, r) {
t.push(n(e, r))
}),
t;
var n, t
}, K = function(e, r) {
return Z(e, r) ? _.from(e[r]) : _.none()
}, Z = function(e, r) {
return W.call(e, r)
}, J = (l.Node.ATTRIBUTE_NODE,
l.Node.CDATA_SECTION_NODE,
l.Node.COMMENT_NODE,
l.Node.DOCUMENT_NODE,
l.Node.DOCUMENT_TYPE_NODE,
l.Node.DOCUMENT_FRAGMENT_NODE,
l.Node.ELEMENT_NODE), Q = l.Node.TEXT_NODE, ee = (l.Node.PROCESSING_INSTRUCTION_NODE,
l.Node.ENTITY_REFERENCE_NODE,
l.Node.ENTITY_NODE,
l.Node.NOTATION_NODE,
i = Q,
function(e) {
return e.dom().nodeType === i
}
), re = function(e, r, n) {
!function(e, r, n) {
if (!(C(n) || L(n) || P(n)))
throw l.console.error("Invalid call to Attr.set. Key ", r, ":: Value ", n, ":: Element ", e),
new Error("Attribute value was not simple");
e.setAttribute(r, n + "")
}(e.dom(), r, n)
}, ne = function(e, r) {
var n = e.dom().getAttribute(r);
return null === n ? void 0 : n
}, te = function(e, r) {
e.dom().removeAttribute(r)
}, oe = function(e, r) {
var n = ne(e, r);
return void 0 === n || "" === n ? [] : n.split(" ")
}, ie = function(e) {
return void 0 !== e.dom().classList
}, ae = function(e) {
return oe(e, "class")
}, ue = function(e, r) {
return o = r,
i = oe(n = e, t = "class").concat([o]),
re(n, t, i.join(" ")),
!0;
var n, t, o, i
}, ce = function(e, r) {
return o = r,
0 < (i = B(oe(n = e, t = "class"), function(e) {
return e !== o
})).length ? re(n, t, i.join(" ")) : te(n, t),
!1;
var n, t, o, i
}, se = function(e, r) {
var n;
ie(e) ? e.dom().classList.remove(r) : ce(e, r),
0 === (ie(n = e) ? n.dom().classList : ae(n)).length && te(n, "class")
}, fe = function(e) {
if (null == e)
throw new Error("Node cannot be null or undefined");
return {
dom: O(e)
}
}, le = {
fromHtml: function(e, r) {
var n = (r || l.document).createElement("div");
if (n.innerHTML = e,
!n.hasChildNodes() || 1 < n.childNodes.length)
throw l.console.error("HTML does not have a single root node", e),
new Error("HTML must have a single root node");
return fe(n.childNodes[0])
},
fromTag: function(e, r) {
var n = (r || l.document).createElement(e);
return fe(n)
},
fromText: function(e, r) {
var n = (r || l.document).createTextNode(e);
return fe(n)
},
fromDom: fe,
fromPoint: function(e, r, n) {
var t = e.dom();
return _.from(t.elementFromPoint(r, n)).map(fe)
}
}, me = function(e, r) {
e.fire("FormatPainterToggle", {
state: r
})
};
(a = m || (m = {})).Retrival = "Retrieval",
a.Application = "Application",
(u = d || (d = {})).ListSchema = "ListSchema",
u.SubstitutionSchema = "SubstitionSchema",
(s = c || (c = {})).InsertUnorderedList = "InsertUnorderedList",
s.InsertOrderedList = "InsertOrderedList",
s.InsertDefinitionList = "InsertDefinitionList",
(f = v || (v = {})).Table = "Table",
f.Unspecified = "Unspecified";
var de, ve, pe, ge = function(e) {
var r, n;
r = le.fromDom(e.getBody()),
n = "tox-cursor-format-painter",
ie(r) ? r.dom().classList.add(n) : ue(r, n)
}, he = function(e, r) {
var n;
n = e,
se(le.fromDom(n.getBody()), "tox-cursor-format-painter"),
r.set(m.Retrival),
me(e, !1)
}, be = function(e, r) {
r.get() === m.Application ? he(e, r) : function(r, n) {
ge(r),
n.set(m.Application),
me(r, !0),
r.execCommand("mceRetrieveFormats");
var e = function() {
n.get() === m.Application && (r.execCommand("mcePaintFormats"),
he(r, n)),
o()
}
, t = function(e) {
27 === e.keyCode && (he(r, n),
o())
};
r.on("click", e),
r.on("keydown", t);
var o = function() {
r.off("click", e),
r.off("keydown", t)
}
}(e, r)
}, ye = (void 0 !== l.window ? l.window : Function("return this;")(),
function() {
return Se(0, 0)
}
), Se = function(e, r) {
return {
major: e,
minor: r
}
}, Oe = {
nu: Se,
detect: function(e, r) {
var n = String(r).toLowerCase();
return 0 === e.length ? ye() : function(e, r) {
var n = function(e, r) {
for (var n = 0; n < e.length; n++) {
var t = e[n];
if (t.test(r))
return t
}
}(e, r);
if (!n)
return {
major: 0,
minor: 0
};
var t = function(e) {
return Number(r.replace(n, "$" + e))
};
return Se(t(1), t(2))
}(e, n)
},
unknown: ye
}, we = "Firefox", Ne = function(e, r) {
return function() {
return r === e
}
}, Te = function(e) {
var r = e.current;
return {
current: r,
version: e.version,
isEdge: Ne("Edge", r),
isChrome: Ne("Chrome", r),
isIE: Ne("IE", r),
isOpera: Ne("Opera", r),
isFirefox: Ne(we, r),
isSafari: Ne("Safari", r)
}
}, xe = {
unknown: function() {
return Te({
current: void 0,
version: Oe.unknown()
})
},
nu: Te,
edge: O("Edge"),
chrome: O("Chrome"),
ie: O("IE"),
opera: O("Opera"),
firefox: O(we),
safari: O("Safari")
}, Ee = "Windows", ke = "Android", Ae = "Solaris", _e = "FreeBSD", De = function(e, r) {
return function() {
return r === e
}
}, Ce = function(e) {
var r = e.current;
return {
current: r,
version: e.version,
isWindows: De(Ee, r),
isiOS: De("iOS", r),
isAndroid: De(ke, r),
isOSX: De("OSX", r),
isLinux: De("Linux", r),
isSolaris: De(Ae, r),
isFreeBSD: De(_e, r)
}
}, Le = {
unknown: function() {
return Ce({
current: void 0,
version: Oe.unknown()
})
},
nu: Ce,
windows: O(Ee),
ios: O("iOS"),
android: O(ke),
linux: O("Linux"),
osx: O("OSX"),
solaris: O(Ae),
freebsd: O(_e)
}, Re = function(e, r) {
var n = String(r).toLowerCase();
return U(e, function(e) {
return e.search(n)
})
}, Pe = function(e, n) {
return Re(e, n).map(function(e) {
var r = Oe.detect(e.versionRegexes, n);
return {
current: e.name,
version: r
}
})
}, Fe = function(e, n) {
return Re(e, n).map(function(e) {
var r = Oe.detect(e.versionRegexes, n);
return {
current: e.name,
version: r
}
})
}, Ie = function(e, r) {
return -1 !== e.indexOf(r)
}, je = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, Me = function(r) {
return function(e) {
return Ie(e, r)
}
}, Be = [{
name: "Edge",
versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],
search: function(e) {
return Ie(e, "edge/") && Ie(e, "chrome") && Ie(e, "safari") && Ie(e, "applewebkit")
}
}, {
name: "Chrome",
versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/, je],
search: function(e) {
return Ie(e, "chrome") && !Ie(e, "chromeframe")
}
}, {
name: "IE",
versionRegexes: [/.*?msie\ ?([0-9]+)\.([0-9]+).*/, /.*?rv:([0-9]+)\.([0-9]+).*/],
search: function(e) {
return Ie(e, "msie") || Ie(e, "trident")
}
}, {
name: "Opera",
versionRegexes: [je, /.*?opera\/([0-9]+)\.([0-9]+).*/],
search: Me("opera")
}, {
name: "Firefox",
versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],
search: Me("firefox")
}, {
name: "Safari",
versionRegexes: [je, /.*?cpu os ([0-9]+)_([0-9]+).*/],
search: function(e) {
return (Ie(e, "safari") || Ie(e, "mobile/")) && Ie(e, "applewebkit")
}
}], Ue = [{
name: "Windows",
search: Me("win"),
versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]
}, {
name: "iOS",
search: function(e) {
return Ie(e, "iphone") || Ie(e, "ipad")
},
versionRegexes: [/.*?version\/\ ?([0-9]+)\.([0-9]+).*/, /.*cpu os ([0-9]+)_([0-9]+).*/, /.*cpu iphone os ([0-9]+)_([0-9]+).*/]
}, {
name: "Android",
search: Me("android"),
versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/]
}, {
name: "OSX",
search: Me("os x"),
versionRegexes: [/.*?os\ x\ ?([0-9]+)_([0-9]+).*/]
}, {
name: "Linux",
search: Me("linux"),
versionRegexes: []
}, {
name: "Solaris",
search: Me("sunos"),
versionRegexes: []
}, {
name: "FreeBSD",
search: Me("freebsd"),
versionRegexes: []
}], Ve = {
browsers: O(Be),
oses: O(Ue)
}, qe = function(e) {
var r, n, t, o, i, a, u, c, s, f, l, m = Ve.browsers(), d = Ve.oses(), v = Pe(m, e).fold(xe.unknown, xe.nu), p = Fe(d, e).fold(Le.unknown, Le.nu);
return {
browser: v,
os: p,
deviceType: (n = v,
t = e,
o = (r = p).isiOS() && !0 === /ipad/i.test(t),
i = r.isiOS() && !o,
a = r.isAndroid() && 3 === r.version.major,
u = r.isAndroid() && 4 === r.version.major,
c = o || a || u && !0 === /mobile/i.test(t),
s = r.isiOS() || r.isAndroid(),
f = s && !c,
l = n.isSafari() && r.isiOS() && !1 === /safari/i.test(t),
{
isiPad: O(o),
isiPhone: O(i),
isTablet: O(c),
isPhone: O(f),
isTouch: O(s),
isAndroid: r.isAndroid,
isiOS: r.isiOS,
isWebView: O(l)
})
}
}, Xe = (pe = !(de = function() {
var e = l.navigator.userAgent;
return qe(e)
}
),
function() {
for (var e = [], r = 0; r < arguments.length; r++)
e[r] = arguments[r];
return pe || (pe = !0,
ve = de.apply(null, e)),
ve
}
), ze = J, He = (Xe().browser.isIE(),
function(e, r) {
var n = e.dom();
if (n.nodeType !== ze)
return !1;
if (void 0 !== n.matches)
return n.matches(r);
if (void 0 !== n.msMatchesSelector)
return n.msMatchesSelector(r);
if (void 0 !== n.webkitMatchesSelector)
return n.webkitMatchesSelector(r);
if (void 0 !== n.mozMatchesSelector)
return n.mozMatchesSelector(r);
throw new Error("Browser lacks native selectors")
}
), We = function(e, r, n) {
for (var t = e.dom(), o = R(n) ? n : O(!1); t.parentNode; ) {
t = t.parentNode;
var i = le.fromDom(t);
if (r(i))
return _.some(i);
if (o(i))
break
}
return _.none()
}, Ye = function(e, r, n) {
var t, o, i, a, u;
return t = We,
a = n,
u = o = e,
(i = r)(u) ? _.some(o) : R(a) && a(o) ? _.none() : t(o, i, a)
}, Ge = {
formatpainter_checklist: {
selector: "ul",
classes: "tox-checklist"
},
formatpainter_liststyletype: {
selector: "ul,ol",
styles: {
listStyleType: "%value"
}
},
formatpainter_borderstyle: {
selector: "td,th",
styles: {
borderTopStyle: "%valueTop",
borderRightStyle: "%valueRight",
borderBottomStyle: "%valueBottom",
borderLeftStyle: "%valueLeft"
},
remove_similar: !0
},
formatpainter_bordercolor: {
selector: "td,th",
styles: {
borderTopColor: "%valueTop",
borderRightColor: "%valueRight",
borderBottomColor: "%valueBottom",
borderLeftColor: "%valueLeft"
},
remove_similar: !0
},
formatpainter_backgroundcolor: {
selector: "td,th",
styles: {
backgroundColor: "%value"
},
remove_similar: !0
},
formatpainter_removeformat: [{
selector: "b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins",
remove: "all",
split: !0,
expand: !1,
block_expand: !0,
deep: !0
}, {
selector: "span",
attributes: ["style", "class"],
remove: "empty",
split: !0,
expand: !1,
deep: !0
}, {
selector: "*:not(tr,td,th,table)",
attributes: ["style", "class"],
split: !1,
expand: !1,
deep: !0
}]
}, $e = function(i, e) {
return K(e, "selector").exists(function(e) {
var r = i.getBody()
, n = i.selection.getStart()
, t = i.dom.getParents(n, O(!0), r)
, o = i.selection.getSelectedBlocks();
return i.dom.is(t.concat(o), e)
})
}, Ke = function(t, e) {
return j(t.formatter.get(e), function(e) {
return r = t,
Z(n = e, "inline") && !$e(r, n);
var r, n
})
}, Ze = function(t, e, r) {
return j(e.get(r), function(e) {
return r = t,
Z(n = e, "block") || $e(r, n);
var r, n
})
}, Je = function(e) {
return 1 < e.length && "%" === e.charAt(0)
}, Qe = function(e, r) {
return j(e.formatter.get(r), function(e) {
return n = K(r = e, "styles").exists(function(e) {
return j($(e), Je)
}),
t = K(r, "attributes").exists(function(e) {
return j($(e), Je)
}),
n || t;
var r, n, t
})
}, er = function(e) {
return He(e, "OL,UL,DL")
}, rr = function(e) {
return He(e, "LI,DT,DD")
}, nr = function(e, r, n) {
var t, o = e.formatter, i = Ke(e, n.formatName), a = Ze(e, o, n.formatName), u = (t = n.formatName,
I(["formatpainter_borderstyle", "formatpainter_bordercolor", "formatpainter_backgroundcolor"], t));
(r.table && u || r.inline && i || r.block && a && !u) && o.apply(n.formatName, n.substitutedVariables)
}, tr = function(e, r) {
return function(e, r) {
for (var n = [], t = 0; t < e.length; t++) {
var o = e[t];
if (!o.isSome())
return _.none();
n.push(o.getOrDie())
}
return _.some(r.apply(null, n))
}([Ye(le.fromDom(e.getStart()), er, r), Ye(le.fromDom(e.getEnd()), er, r)], function(e, r) {
return n = r,
e.dom() === n.dom();
var n
}).getOr(!1)
}, or = function(e) {
var r = e.selection
, n = r.getRng()
, t = le.fromDom(e.getBody())
, o = B(e.selection.getSelectedBlocks().map(le.fromDom), rr)
, i = n.collapsed && o.length
, a = o.length && !tr(r, t);
return 1 < o.length || i || a
}, ir = function(t, e) {
var r, n;
r = t,
n = e.context,
r.formatter.remove("formatpainter_removeformat"),
n === v.Table && function(e, r) {
for (var n = 0, t = e.length; n < t; n++)
r(e[n], n, e)
}(["formatpainter_borderstyle", "formatpainter_bordercolor", "formatpainter_backgroundcolor"], function(e) {
r.formatter.remove(e)
}),
or(r) && r.execCommand("RemoveList");
var o, i, a, u, c, s, f = (a = (o = t).selection.getStart(),
u = o.selection.getRng().collapsed,
c = 0 < o.dom.select("td[data-mce-selected]").length,
s = !!o.dom.getParent(a, "TABLE"),
{
inline: !0,
table: u && s || c,
block: u || (i = o.selection,
1 < i.getSelectedBlocks().length) || c
});
e.schemas.forEach(function(e) {
switch (e.kind) {
case d.ListSchema:
r = t,
n = e,
f.block && r.execCommand(n.command);
break;
case d.SubstitutionSchema:
nr(t, f, e)
}
var r, n
})
}, ar = function(e) {
return ie(e) ? function(e) {
for (var r = e.dom().classList, n = new Array(r.length), t = 0; t < r.length; t++)
n[t] = r.item(t);
return n
}(e) : ae(e)
}, ur = function(e, r) {
var n, t, o = e.dom(), i = l.window.getComputedStyle(o).getPropertyValue(r), a = "" !== i || null != (t = ee(n = e) ? n.dom().parentNode : n.dom()) && t.ownerDocument.body.contains(t) ? i : cr(o, r);
return null === a ? void 0 : a
}, cr = function(e, r) {
return void 0 !== e.style ? e.style.getPropertyValue(r) : ""
}, sr = function() {
return (sr = Object.assign || function(e) {
for (var r, n = 1, t = arguments.length; n < t; n++)
for (var o in r = arguments[n])
Object.prototype.hasOwnProperty.call(r, o) && (e[o] = r[o]);
return e
}
).apply(this, arguments)
}, fr = function(o, e) {
return G(e, function(e, r) {
return {
k: e.slice(1, e.length),
v: (n = o,
t = r,
"class" === t ? ar(n).filter(function(e) {
return !/^(mce-.*)/.test(e)
}).join(" ") : ne(n, t))
};
var n, t
})
}, lr = function(e) {
return (r = e,
n = function(e) {
return 1 < (r = e).length && "%" === r.charAt(0);
var r
}
,
t = {},
o = {},
Y(r, function(e, r) {
(n(e, r) ? t : o)[r] = e
}),
{
t: t,
f: o
}).t;
var r, n, t, o
}, mr = function(e, n) {
var r = K(e, "styles").map(function(e) {
return t = n,
r = lr(e),
G(r, function(e, r) {
return {
k: e.slice(1, e.length),
v: ur(t, (n = r,
n.replace(/([A-Z])/g, function(e) {
return "-" + e[0].toLowerCase()
})))
};
var n
});
var t, r
})
, t = K(e, "attributes").map(function(e) {
return fr(n, lr(e))
})
, o = sr({}, r.getOr({}), t.getOr({}));
return $(o).every(function(e) {
return "" !== e
}) ? _.some(o) : _.none()
}, dr = function(e, r, n) {
return (t = e.get(r),
0 === t.length ? _.none() : _.some(t[0])).bind(function(e) {
return mr(e, n)
}).map(function(e) {
return {
kind: d.SubstitutionSchema,
formatName: r,
substitutedVariables: e
}
});
var t
}, vr = function(n, t) {
return (e = n,
r = e.getParam("formatpainter_blacklisted_formats", "link,address,removeformat,formatpainter_removeformat", "string").split(/[ ,]/),
H(e.formatter.get()).filter(function(e) {
return !I(r, e)
})).filter(function(e) {
var r = Qe(n, e);
return n.formatter.matchNode(t.dom(), e, {}, r)
});
var e, r
}, pr = function(e) {
return (r = e,
U($(c), function(e) {
return r.queryCommandState(e)
})).map(function(e) {
return {
kind: d.ListSchema,
command: e
}
});
var r
}, gr = function(e) {
var r, n, t, o, i, a = e.dom, u = e.selection.getStart();
return {
schemas: pr(e).toArray().concat((t = e,
o = u,
i = t.dom.getParents(o, O(!0)),
z(M(i, le.fromDom), function(r) {
return z(vr(t, r), function(e) {
return dr(t.formatter, e, r).toArray()
})
}))),
context: (r = a,
n = u,
r.getParent(n, "TABLE") ? v.Table : v.Unspecified)
}
}, hr = function(e) {
if (S(tinymce, "4.9.0"))
return l.window.console.error("The format painter plugin requires at least version 4.9.0 of TinyMCE."),
{};
var n, r, t, o, i, a, u, c, s = p(m.Retrival), f = p({
schemas: [],
context: v.Unspecified
});
return (n = e).on("PreInit", function() {
Y(Ge, function(e, r) {
n.formatter.get(r) || n.formatter.register(r, e)
})
}),
t = s,
o = f,
(r = e).addCommand("mceToggleFormatPainter", function() {
be(r, t)
}),
r.addCommand("mcePaintFormats", function() {
r.undoManager.transact(function() {
ir(r, o.get())
})
}),
r.addCommand("mceRetrieveFormats", function() {
o.set(gr(r))
}),
(i = e).ui ? (u = i).ui.registry.addToggleButton("formatpainter", {
active: !1,
icon: "format-painter",
tooltip: "Format Painter",
onAction: function() {
return u.execCommand("mceToggleFormatPainter")
},
onSetup: function(r) {
var e = function(e) {
r.setActive(e.state)
};
return u.on("FormatPainterToggle", e),
function() {
return u.off("FormatPainterToggle", e)
}
}
}) : (a = i).addButton("formatpainter", {
active: !1,
icon: "format-painter",
tooltip: "Format Painter",
cmd: "mceToggleFormatPainter",
onPostRender: function(r) {
a.on("FormatPainterToggle", function(e) {
r.control.active(e.state)
})
}
}),
(c = e).addShortcut("Meta+alt+C", "", function() {
c.execCommand("mceRetrieveFormats")
}),
c.addShortcut("Meta+alt+V", "", function() {
c.execCommand("mcePaintFormats")
}),
{}
};
return function() {
tinymce.PluginManager.add("formatpainter", hr)
}
}(window)();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("hr",function(n){var o,t;function e(){return t.execCommand("InsertHorizontalRule")}(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"<hr />")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:e}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:e})})}();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,22 @@
/**
* Copyright meystack
* Licensed Apache2.0
* Version: 0.0.1 图片本地化
*/
!function () {
"use strict";
var i = tinymce.util.Tools.resolve("tinymce.PluginManager"), o = "图片本地化";
i.add("imagelocal", (function (i) {
return function (i) {
var t = function () {
const o = i.getDoc().getElementsByTagName("img");
o.length >= 1 ? layui.upload.local(o, _global_.app + "/Ajax/getImage", i) : layui.layer.info("暂无图片需要同步")
};
i.ui.registry.addButton("imagelocal", {
icon: "imglocal",
tooltip: o,
onAction: t
}), i.ui.registry.addMenuItem("imagelocal", {icon: "imglocal", text: o, onAction: t})
}(i), {}
}))
}();

View File

@@ -0,0 +1 @@
!function(){"use strict";var a=tinymce.util.Tools.resolve("tinymce.PluginManager"),t="图片本地化",e=function(a){var e=function(){const t=a.getDoc().getElementsByTagName("img");t.length>=1?void 0!==a.settings.download?function(a,t,e){var i=[],l=location.origin;if(a.length>=1){for(var n in a){var o=a[n].src;o&&-1!==(o=o.replace(l,"")).indexOf("://")&&i.push(a[n])}if(i.length>=1){var r=0,c=layui.layer.load(),s=function(a){var e=new FormData;e.append("url",a),layui.$.ajax({url:t,type:"post",data:e,contentType:!1,processData:!1,dataType:"json",success:function(a){200===a.code?(layui.$(i[r]).attr("src",a.url),layui.$(i[r]).attr("data-mce-src",a.url),layui.$(i[r]).each((function(){try{layui.$.each(this.attributes,(function(){-1===["src","alt","width","height","data-mce-src"].lastIndexOf(this.name)&&$(i[r]).removeAttr(this.name)}))}catch(a){}})),(r+=1)>=i.length?(layui.layer.close(c),layui.layer.msg("远程同步已完成")):s(i[r].src)):(layui.layer.close(c),layui.layer.msg(a.msg,"error"))},error:function(){layui.layer.close(c),layui.layer.msg("请求上传接口出现异常","info")}})};s(i[r].src)}else layui.layer.msg("无需同步或已完成");e.focus()}}(t,a.settings.download,a):layui.layer.msg("请配置前端同步地址","info"):layui.layer.info("暂无图片需要同步")};a.ui.registry.addButton("imagelocal",{icon:"imglocal",tooltip:t,onAction:e}),a.ui.registry.addMenuItem("imagelocal",{icon:"imglocal",text:t,onAction:e})};a.add("imagelocal",(function(a){return e(a),{}}))}();

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";function t(n){return function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}}function y(t){return t.getParam("importcss_selector_converter")}function u(e){return l(e)?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e}function h(t,e){var r,n=/^(?:([a-z0-9\-_]+))?(\.[a-z0-9_\-\.]+)$/i.exec(e);if(n){var o=n[1],i=n[2].substr(1).split(".").join(" "),c=x.makeMap("a,img");return n[1]?(r={title:e},t.schema.getTextBlockElements()[o]?r.block=o:t.schema.getBlockElements()[o]||c[o.toLowerCase()]?r.selector=o:r.inline=o):n[2]&&(r={inline:"span",title:e.substr(1),classes:i}),!1!==t.getParam("importcss_merge_classes")?r.classes=i:r.attributes={class:i},r}}function d(t,e){return null===e||!1!==t.getParam("importcss_exclusive")}function r(v){v.on("init",function(){function o(t,e){if(f=t,p=g,!(d(v,m=e)?f in p:f in m.selectors)){a=t,l=g,d(v,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=v).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:y(o)?y(o):function(){return h(o,c)}).call(i,c,s));if(r){var n=r.name||_.DOM.uniqueId();return v.formatter.register(n,r),{title:r.title,format:n}}}var o,i,c,s,a,u,l,f,m,p;return null}var e,r,n,t,i=(e=[],r=[],n={},{addItemToGroup:function(t,e){n[t]?n[t].push(e):(r.push(t),n[t]=[e])},addItem:function(t){e.push(t)},toFormats:function(){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!f(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);P.apply(e,t[r])}return e}(function(t,e){for(var r=t.length,n=new Array(r),o=0;o<r;o++){var i=t[o];n[o]=e(i,o)}return n}(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]})).concat(e)}}),g={},c=u(v.getParam("importcss_selector_filter")),s=(t=v.getParam("importcss_groups"),x.map(t,function(t){return x.extend({},t,{original:t,selectors:{},filter:u(t.filter)})}));x.each(function(c,t,s){var a=[],r={},u=function(t,e){var r,n,o=n=t.href,i=p.cacheSuffix;if((n=o=l(o)?o.replace("?"+i,"").replace("&"+i,""):o)&&s(n,e)&&!function(t,e){var r,n=!1!==(r=t.getParam("skin"))&&(r||"oxide");if(n){var o=t.getParam("skin_url"),i=o?t.documentBaseURI.toAbsolute(o):m.baseURL+"/skins/ui/"+n,c=m.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}}(c,n)){x.each(t.imports,function(t){u(t,!0)});try{r=t.cssRules||t.rules}catch(t){}x.each(r,function(t){t.styleSheet?u(t.styleSheet,!0):t.selectorText&&x.each(t.selectorText.split(","),function(t){a.push(x.trim(t))})})}};x.each(c.contentCSS,function(t){r[t]=!0}),s=s||function(t,e){return e||r[t]};try{x.each(t.styleSheets,function(t){u(t)})}catch(t){}return a}(v,v.getDoc(),u(v.getParam("importcss_file_filter"))),function(r){var t,e,n;T.test(r)||c&&!c(r)||(n=r,0<(t=x.grep(s,function(t){return!t.filter||t.filter(n)})).length?x.each(t,function(t){var e=o(r,t);e&&i.addItemToGroup(t.title,e)}):(e=o(r,null))&&i.addItem(e))});var a=i.toFormats();v.fire("addStyleModifications",{items:a,replace:!v.getParam("importcss_append")})})}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=t("string"),f=t("array"),_=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),m=tinymce.util.Tools.resolve("tinymce.EditorManager"),p=tinymce.util.Tools.resolve("tinymce.Env"),x=tinymce.util.Tools.resolve("tinymce.util.Tools"),P=Array.prototype.push,T=/^\.(?:ephox|tiny-pageembed|mce)(?:[.-]+\w+)+$/;e.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return h(e,t)}};var e})}();

View File

@@ -0,0 +1,62 @@
tinymce.PluginManager.add('indent2em', function(editor, url) {
var pluginName='首行缩进';
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var indent2em_val = editor.getParam('indent2em_val', '2em');
var doAct = function () {
var dom = editor.dom;
var blocks = editor.selection.getSelectedBlocks();
var act = '';
global$1.each(blocks, function (block) {
if(act==''){
act = dom.getStyle(block,'text-indent')==indent2em_val ? 'remove' : 'add';
}
if( act=='add' ){
dom.setStyle(block, 'text-indent', indent2em_val);
}else{
var style=dom.getAttrib(block,'style');
var reg = new RegExp('text-indent:[\\s]*' + indent2em_val + ';', 'ig');
style = style.replace(reg, '');
dom.setAttrib(block,'style',style);
}
});
};
editor.ui.registry.getAll().icons.indent2em || editor.ui.registry.addIcon('indent2em','<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M170.666667 563.2v-102.4H887.466667v102.4zM170.666667 836.266667v-102.4H887.466667v102.4zM512 290.133333v-102.4H887.466667v102.4zM238.933333 341.333333V136.533333l204.8 102.4z" fill="#2c2c2c" p-id="5210"></path></svg>');
var stateSelectorAdapter = function (editor, selector) {
return function (buttonApi) {
return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind;
};
};
editor.ui.registry.addToggleButton('indent2em', {
icon: 'indent2em',
tooltip: pluginName,
onAction: function () {
doAct();
},
onSetup: stateSelectorAdapter(editor, [
'*[style*="text-indent"]',
'*[data-mce-style*="text-indent"]',
])
});
editor.ui.registry.addMenuItem('indent2em', {
text: pluginName,
onAction: function() {
doAct();
}
});
editor.addCommand('indent2em', doAct );
return {
getMetadata: function () {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/indent2em.php",
};
}
};
});

View File

@@ -0,0 +1,62 @@
tinymce.PluginManager.add('indent2em', function(editor, url) {
var pluginName='首行缩进';
var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools');
var indent2em_val = editor.getParam('indent2em_val', '2em');
var doAct = function () {
var dom = editor.dom;
var blocks = editor.selection.getSelectedBlocks();
var act = '';
global$1.each(blocks, function (block) {
if(act==''){
act = dom.getStyle(block,'text-indent')==indent2em_val ? 'remove' : 'add';
}
if( act=='add' ){
dom.setStyle(block, 'text-indent', indent2em_val);
}else{
var style=dom.getAttrib(block,'style');
var reg = new RegExp('text-indent:[\\s]*' + indent2em_val + ';', 'ig');
style = style.replace(reg, '');
dom.setAttrib(block,'style',style);
}
});
};
editor.ui.registry.getAll().icons.indent2em || editor.ui.registry.addIcon('indent2em','<svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><path d="M170.666667 563.2v-102.4H887.466667v102.4zM170.666667 836.266667v-102.4H887.466667v102.4zM512 290.133333v-102.4H887.466667v102.4zM238.933333 341.333333V136.533333l204.8 102.4z" fill="#2c2c2c" p-id="5210"></path></svg>');
var stateSelectorAdapter = function (editor, selector) {
return function (buttonApi) {
return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind;
};
};
editor.ui.registry.addToggleButton('indent2em', {
icon: 'indent2em',
tooltip: pluginName,
onAction: function () {
doAct();
},
onSetup: stateSelectorAdapter(editor, [
'*[style*="text-indent"]',
'*[data-mce-style*="text-indent"]',
])
});
editor.ui.registry.addMenuItem('indent2em', {
text: pluginName,
onAction: function() {
doAct();
}
});
editor.addCommand('indent2em', doAct );
return {
getMetadata: function () {
return {
name: pluginName,
url: "http://tinymce.ax-z.cn/more-plugins/indent2em.php",
};
}
};
});

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.10.2 (2021-11-17)
*/
!function(){"use strict";function l(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function s(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function r(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}function d(e,t,n){return void 0===n&&(n=new Date),(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%Y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+n.getFullYear())).replace("%y",""+n.getYear())).replace("%m",r(n.getMonth()+1,2))).replace("%d",r(n.getDate(),2))).replace("%H",""+r(n.getHours(),2))).replace("%M",""+r(n.getMinutes(),2))).replace("%S",""+r(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(u[n.getMonth()]))).replace("%b",""+e.translate(o[n.getMonth()]))).replace("%A",""+e.translate(i[n.getDay()]))).replace("%a",""+e.translate(a[n.getDay()]))).replace("%%","%")}function p(e,t){var n,r,a,i,o,u;e.getParam("insertdatetime_element",!1)?(n=d(e,t),r=/%[HMSIp]/.test(t)?d(e,"%Y-%m-%dT%H:%M"):d(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=(i=e).dom.create("time",{datetime:r},n),o.parentNode.insertBefore(u,o),i.dom.remove(o),i.selection.select(u,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(d(e,t))}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),i="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),u="January February March April May June July August September October November December".split(" "),g=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("insertdatetime",function(e){var n,r,t,a,i,o,u,c;function m(e){return r.execCommand("mceInsertDate",!1,e)}(n=e).addCommand("mceInsertDate",function(e,t){p(n,null!=t?t:n.getParam("insertdatetime_dateformat",n.translate("%Y-%m-%d")))}),n.addCommand("mceInsertTime",function(e,t){p(n,null!=t?t:l(n))}),u=s(r=e),t=0<(o=s(i=r)).length?o[0]:l(i),a=t,c={get:function(){return a},set:function(e){a=e}},r.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===c.get()},fetch:function(e){e(g.map(u,function(e){return{type:"choiceitem",text:d(r,e),value:e}}))},onAction:function(e){m(c.get())},onItemAction:function(e,t){c.set(t),m(t)}}),r.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return g.map(u,function(e){return{type:"menuitem",text:d(r,e),onAction:(t=e,function(){c.set(t),m(t)})};var t})}})})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("legacyoutput",function(e){var s,t;(t=s=e).settings.inline_styles=!1,t.getParam("fontsize_formats")||(t.settings.fontsize_formats="8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t.getParam("font_formats")||(t.settings.font_formats="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"),s.on("PreInit",function(){var 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]"),l.each(t.split(","),function(e){var t=a.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";function o(n,e){for(var a="",o=0;o<e;o++)a+=n;return a}function s(n,e){var a=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+(n.plugins.visualchars&&n.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+o("&nbsp;",e)+"</span>":o("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(a)})}var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,t,i;function r(){return a.execCommand("mceNonBreaking")}(e=n).addCommand("mceNonBreaking",function(){s(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:r}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:r}),0<(i="boolean"==typeof(t=(o=n).getParam("nonbreaking_force_tab",0))?!0===t?3:0:t)&&o.on("keydown",function(n){n.keyCode!==c.TAB||n.isDefaultPrevented()||n.shiftKey||(n.preventDefault(),n.stopImmediatePropagation(),s(o,i))})})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function l(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")}function u(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}}function e(e){var t,r="contenteditable",n=" "+f.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+f.trim(l(e))+" ",i=u(n),o=u(a),c=(t=e.getParam("noneditable_regexp",[]))&&t.constructor===RegExp?[t]:t;e.on("PreInit",function(){0<c.length&&e.on("BeforeSetContent",function(t){!function(t,e,n){var r=e.length,a=n.content;if("raw"!==n.format){for(;r--;)a=a.replace(e[r],function(i,o,c){return function(t){var e=arguments,n=e[e.length-2],r=0<n?o.charAt(n-1):"";if('"'===r)return t;if(">"===r){var a=o.lastIndexOf("<",n);if(-1!==a&&-1!==o.substring(a,n).indexOf('contenteditable="false"'))return t}return'<span class="'+c+'" data-mce-content="'+i.dom.encode(e[0])+'">'+i.dom.encode("string"==typeof e[1]?e[1]:e[0])+"</span>"}}(t,a,l(t)));n.content=a}}(e,c,t)}),e.parser.addAttributeFilter("class",function(t){for(var e,n=t.length;n--;)e=t[n],i(e)?e.attr(r,"true"):o(e)&&e.attr(r,"false")}),e.serializer.addAttributeFilter(r,function(t){for(var e,n=t.length;n--;)e=t[n],(i(e)||o(e))&&(0<c.length&&e.attr("data-mce-content")?(e.name="#text",e.type=3,e.raw=!0,e.value=e.attr("data-mce-content")):e.attr(r,null))})})}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.util.Tools");t.add("noneditable",function(t){e(t)})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function u(e){return e.getParam("pagebreak_split_block",!1)}function l(e){var a='<img src="'+n.transparentSrc+'" class="'+m+'" data-mce-resize="false" data-mce-placeholder />';return e?"<p>"+a+"</p>":a}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.Env"),m="mce-pagebreak";e.add("pagebreak",function(e){var a,n,o,i,t,r;function c(){return n.execCommand("mcePageBreak")}function g(){return u(o)}(a=e).addCommand("mcePageBreak",function(){a.insertContent(l(u(a)))}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:c}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:c}),i=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(i.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,l(g()))}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t,r=e.length;r--;)(t=(n=e[r]).attr("class"))&&-1!==t.indexOf(m)&&(a=n.parent,o.schema.getBlockElements()[a.name]&&g()?(a.type=3,a.value=i,a.raw=!0,n.remove()):(n.type=3,n.value=i,n.raw=!0))})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,m)&&(e.name="pagebreak")})})}();

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,91 @@
/**
* Copyright meystack
* Licensed Apache2.0
* Version: 0.0.1 付费内容插入
*/
(function () {
'use strict';
var global = tinymce.util.Tools.resolve('tinymce.PluginManager');
var pluginName = '插入付费内容';
var setContent = function (editor, html) {
editor.focus();
editor.undoManager.transact(function () {
editor.setContent(html);
});
editor.selection.setCursorLocation();
editor.nodeChanged();
};
var getContent = function (editor) {
return editor.getContent({ source_view: true });
};
var open = function (editor) {
var editorContent = getContent(editor);
editor.windowManager.open({
title: pluginName,
size: 'small',
body: {
type: 'panel',
items: [{
type: 'textarea',
placeholder: '请输入付费内容',
name: 'code'
}]
},
buttons: [
{
type: 'cancel',
name: 'cancel',
text: 'Cancel'
},
{
type: 'submit',
name: 'save',
text: 'Save',
primary: true
}
],
onSubmit: function (api) {
if (api.getData().code) {
setContent(editor, editorContent + '[paybegin]'+ api.getData().code +'[payend]');
}
api.close();
}
});
};
var register$1 = function (editor) {
editor.addCommand('payEditor', function () {
open(editor);
});
};
var register = function (editor) {
var onAction = function () {
return editor.execCommand('payEditor');
};
editor.ui.registry.addButton('paycontent', {
icon: 'payicon',
tooltip: pluginName,
onAction: onAction
});
editor.ui.registry.addMenuItem('paycontent', {
icon: 'payicon',
text: pluginName,
onAction: onAction
});
};
function Plugin () {
global.add('paycontent', function (editor) {
register$1(editor);
register(editor);
return {};
});
}
Plugin();
}());

View File

@@ -0,0 +1,6 @@
/**
* Copyright meystack
* Licensed Apache2.0
* Version: 0.0.1 付费内容插入
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t="插入付费内容",e=function(n){n.addCommand("payEditor",(function(){!function(n){var e=function(n){return n.getContent({source_view:!0})}(n);n.windowManager.open({title:t,size:"small",body:{type:"panel",items:[{type:"textarea",placeholder:"请输入付费内容",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){t.getData().code&&function(n,t){n.focus(),n.undoManager.transact((function(){n.setContent(t)})),n.selection.setCursorLocation(),n.nodeChanged()}(n,e+"[paybegin]"+t.getData().code+"[payend]"),t.close()}})}(n)}))};n.add("paylabel",(function(n){return e(n),function(n){var e=function(){return n.execCommand("payEditor")};n.ui.registry.addButton("paylabel",{icon:"payicon",tooltip:t,onAction:e}),n.ui.registry.addMenuItem("paylabel",{icon:"payicon",text:t,onAction:e})}(n),{}}))}();

View File

@@ -0,0 +1,6 @@
/**
* Copyright meystack
* Licensed Apache2.0
* Version: 0.0.1 付费内容插入
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),t="插入付费内容",e=function(n){n.addCommand("payEditor",(function(){!function(n){var e=function(n){return n.getContent({source_view:!0})}(n);n.windowManager.open({title:t,size:"small",body:{type:"panel",items:[{type:"textarea",placeholder:"请输入付费内容",name:"code"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],onSubmit:function(t){t.getData().code&&function(n,t){n.focus(),n.undoManager.transact((function(){n.setContent(t)})),n.selection.setCursorLocation(),n.nodeChanged()}(n,e+"[paybegin]"+t.getData().code+"[payend]"),t.close()}})}(n)}))};n.add("paylabel",(function(n){return e(n),function(n){var e=function(){return n.execCommand("payEditor")};n.ui.registry.addButton("paylabel",{icon:"payicon",tooltip:t,onAction:e}),n.ui.registry.addMenuItem("paylabel",{icon:"payicon",text:t,onAction:e})}(n),{}}))}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("preview",function(e){var n,t;function i(){return t.execCommand("mcePreview")}(n=e).addCommand("mcePreview",function(){var e,t;t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">';var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='<link type="text/css" rel="stylesheet" href="'+i(t.documentBaseURI.toAbsolute(e))+'"'+o+">"}),e&&(n+='<style type="text/css">'+e+"</style>");var a,r,s,c,d,l,m,y=-1===(c=(a=t).getParam("body_id","tinymce","string")).indexOf("=")?c:(s=(r=a).getParam("body_id","","hash"))[r.id]||s,u=-1===(m=(d=t).getParam("body_class","","string")).indexOf("=")?m:(l=d).getParam("body_class","","hash")[l.id]||"",v='<script>document.addEventListener && document.addEventListener("click", function(e) {for (var elm = e.target; elm; elm = elm.parentNode) {if (elm.nodeName === "A" && !('+(f.mac?"e.metaKey":"e.ctrlKey && !e.altKey")+")) {e.preventDefault();}}}, false);<\/script> ",g=t.getBody().dir,p=g?' dir="'+i(g)+'"':"";return"<!DOCTYPE html><html><head>"+n+'</head><body id="'+i(y)+'" class="mce-content-body '+i(u)+'"'+p+">"+t.getContent()+v+"</body></html>"}(e=n),e.windowManager.open({title:"Preview",size:"large",body:{type:"panel",items:[{name:"preview",type:"iframe",sandboxed:!0}]},buttons:[{type:"cancel",name:"close",text:"Close",primary:!0}],initialData:{preview:t}}).focus("close")}),(t=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:i}),t.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:i})})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.Env");n.add("print",function(n){var t,i;function e(){return i.execCommand("mcePrint")}(t=n).addCommand("mcePrint",function(){r.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:e}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:e}),n.addShortcut("Meta+P","","mcePrint")})}();

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";function o(e){return e.getParam("save_enablewhendirty",!0)}function a(e,n){e.notificationManager.open({text:n,type:"error"})}function t(t){t.addCommand("mceSave",function(){!function(e){var n=c.DOM.getParent(e.id,"form");if(!o(e)||e.isDirty()){if(e.save(),e.getParam("save_onsavecallback"))return e.execCallback("save_onsavecallback",e),e.nodeChanged();n?(e.setDirty(!1),n.onsubmit&&!n.onsubmit()||("function"==typeof n.submit?n.submit():a(e,"Error: Form submit field collision.")),e.nodeChanged()):a(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e=t,n=r.trim(e.startContent);e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})}function i(t){return function(e){function n(){e.setDisabled(o(t)&&!t.isDirty())}return n(),t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),r=tinymce.util.Tools.resolve("tinymce.util.Tools");e.add("save",function(e){var n;(n=e).ui.registry.addButton("save",{icon:"save",tooltip:"Save",disabled:!0,onAction:function(){return n.execCommand("mceSave")},onSetup:i(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:i(n)}),n.addShortcut("Meta+S","","mceSave"),t(e)})}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!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)})})}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){})}();

File diff suppressed because one or more lines are too long

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.10.2 (2021-11-17)
*/
!function(){"use strict";function a(t){return t.getParam("toc_class","mce-toc")}function s(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"}function u(n){return function(t){function e(){return t.setDisabled(n.mode.isReadOnly()||!(0<g(n).length))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}function d(t){var e,n,o,i="",r=g(t),c=function(t){for(var e=9,n=0;n<t.length;n++)if(1===(e=t[n].level<e?t[n].level:e))return e;return e}(r)-1;if(!r.length)return"";i+=(e=s(t),n=v.translate("Table of Contents"),o="</"+e+">","<"+e+' contenteditable="true">'+m.DOM.encode(n)+o);for(var l=0;l<r.length;l++){var a=r[l];a.element.id=a.id;var u=r[l+1]&&r[l+1].level;if(c===a.level)i+="<li>";else for(var d=c;d<a.level;d++)i+="<ul><li>";if(i+='<a href="#'+a.id+'">'+a.title+"</a>",u!==a.level&&u)for(d=a.level;u<d;d--)i+=d===u+1?"</li></ul><li>":"</li></ul>";else i+="</li>",u||(i+="</ul>");c=a.level}return i}function f(t){var e=a(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(d(t))})}var t,e=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),v=tinymce.util.Tools.resolve("tinymce.util.I18n"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=(t=0,function(){return"mcetoc_"+(new Date).getTime().toString(32)+(t++).toString(32)}),g=function(n){var t,o=a(n),e=s(n),i=function(t){for(var e=[],n=1;n<=t;n++)e.push("h"+n);return e.join(",")}(1<=(t=parseInt(n.getParam("toc_depth","3"),10))&&t<=9?t:3),r=n.$(i);return r.length&&/^h[1-9]$/i.test(e)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),c.map(r,function(t){return{id:t.id||l(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})};e.add("toc",function(t){var c,e,n,o,i,r;function l(){return i.execCommand("mceInsertToc")}(c=t).addCommand("mceInsertToc",function(){var t,e,n,o,i,r;o=a(t=c),i=t.$("."+o),r=t,!i.length||0<r.dom.getParents(i[0],".mce-offscreen-selection").length?t.insertContent((n=d(e=t),'<div class="'+e.dom.encode(a(e))+'" contenteditable="false">'+n+"</div>")):f(t)}),c.addCommand("mceUpdateToc",function(){f(c)}),(i=t).ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:l,onSetup:u(i)}),i.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return i.execCommand("mceUpdateToc")}}),i.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:l,onSetup:u(i)}),i.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:(r=i,function(t){return t&&r.dom.is(t,"."+a(r))&&r.getBody().contains(t)}),scope:"node",position:"node"}),n=(e=t).$,o=a(e),e.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),e.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})})}();

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.10.2 (2021-11-17)
*/
!function(){"use strict";function f(t,o,e){var n,i;t.dom.toggleClass(t.getBody(),"mce-visualblocks"),e.set(!e.get()),n=t,i=e.get(),n.fire("VisualBlocks",{state:i})}function g(e,n){return function(o){function t(t){return o.setActive(t.state)}return o.setActive(n.get()),e.on("VisualBlocks",t),function(){return e.off("VisualBlocks",t)}}}tinymce.util.Tools.resolve("tinymce.PluginManager").add("visualblocks",function(t,o){var e,n,i,s,c,u,l,a=(e=!1,{get:function(){return e},set:function(t){e=t}});function r(){return s.execCommand("mceVisualBlocks")}i=a,(n=t).addCommand("mceVisualBlocks",function(){f(n,0,i)}),(s=t).ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:r,onSetup:g(s,c=a)}),s.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",icon:"visualblocks",onAction:r,onSetup:g(s,c)}),l=a,(u=t).on("PreviewFormats AfterPreviewFormats",function(t){l.get()&&u.dom.toggleClass(u.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),u.on("init",function(){u.getParam("visualblocks_default_state",!1,"boolean")&&f(u,0,l)})})}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long