初始化项目

This commit is contained in:
18500206848
2024-02-02 15:04:47 +08:00
parent 12664d0204
commit 7aec486f06
718 changed files with 152280 additions and 1 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.6.2 (2020-12-08)
*/
!function(){"use strict";var n,e,t,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n,e,t){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===t?null:{"list-style-type":t})},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n){return function(){return n}},c=i(!1),s=i(!0),o=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:c,isSome:c,isNone:s,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:t,orThunk:e,map:o,each:function(){},bind:o,exists:c,forall:s,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")}),f=function(t){var n=i(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return f(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},m=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(t=n,(e=r).$.contains(e.getBody(),t));var e,t}},p=function(n,e,t){var r=function(n,e){for(var t=0;t<n.length;t++){if(e(n[t]))return t}return-1}(e.parents,g),o=-1!==r?e.parents.slice(0,r):e.parents,i=l.grep(o,m(n));return 0<i.length&&i[0].nodeName===t},y=function(o,n,e,t,r,i){o.ui.registry.addSplitButton(n,{tooltip:e,icon:"OL"===r?"ordered-list":"unordered-list",presets:"listpreview",columns:3,fetch:function(n){n(l.map(i,function(n){return{type:"choiceitem",value:"default"===n?"":n,icon:"list-"+("OL"===r?"num":"bull")+"-"+("disc"===n||"decimal"===n?"default":n),text:n.replace(/\-/g," ").replace(/\b\w/g,function(n){return n.toUpperCase()})}}))},onAction:function(){return o.execCommand(t)},onItemAction:function(n,e){u(o,r,e)},select:function(e){var n,t,r;return(t=(n=o).dom.getParent(n.selection.getNode(),"ol,ul"),r=n.dom.getStyle(t,"listStyleType"),d(r)).map(function(n){return e===n}).getOr(!1)},onSetup:function(e){var n=function(n){e.setActive(p(o,n,r))};return o.on("NodeChange",n),function(){return o.off("NodeChange",n)}}})},v=function(n,e,t,r,o,i){var u,l,c,s,a;1<i.length?y(n,e,t,r,o,i):(l=e,c=t,s=r,a=o,(u=n).ui.registry.addToggleButton(l,{active:!1,tooltip:c,icon:"OL"===a?"ordered-list":"unordered-list",onSetup:function(e){var n=function(n){e.setActive(p(u,n,a))};return u.on("NodeChange",n),function(){return u.off("NodeChange",n)}},onAction:function(){return u.execCommand(s)}}))};r.add("advlist",function(n){var t,e,r,o;n.hasPlugin("lists")&&(v(e=n,"numlist","Numbered list","InsertOrderedList","OL",(r=e.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman"))?r.split(/[ ,]/):[]),v(e,"bullist","Bullet list","InsertUnorderedList","UL",(o=e.getParam("advlist_bullet_styles","default,circle,square"))?o.split(/[ ,]/):[]),(t=n).addCommand("ApplyUnorderedListStyle",function(n,e){u(t,"UL",e["list-style-type"])}),t.addCommand("ApplyOrderedListStyle",function(n,e){u(t,"OL",e["list-style-type"])}))})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),a="a:not([href])",n=function(e){return e.getAttribute("id")||e.getAttribute("name")||""},r=function(e){return(t=e)&&"a"===t.nodeName.toLowerCase()&&!e.getAttribute("href")&&""!==n(e);var t},c=function(e){var n=e.dom;t(n).walk(e.selection.getRng(),function(e){o.each(e,function(e){var t;r(t=e)&&!t.firstChild&&n.remove(e,!1)})})},u=function(e){return e.dom.getParent(e.selection.getStart(),a)},i=function(e,t){var n,o,a,r,i,l=u(e);l?(a=e,r=t,(i=l).removeAttribute("name"),i.id=r,a.addVisual(),a.undoManager.add()):(o=t,(n=e).undoManager.transact(function(){n.getParam("allow_html_in_named_anchor",!1,"boolean")||n.selection.collapse(!0),n.selection.isCollapsed()?n.insertContent(n.dom.createHTML("a",{id:o})):(c(n),n.formatter.remove("namedAnchor",null,null,!0),n.formatter.apply("namedAnchor",{value:o}),n.addVisual())})),e.focus()},l=function(o){var e,t=(e=u(o))?n(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,n;t=o,n=e.getData().id,(/^[A-Za-z][A-Za-z0-9\-:._]*$/.test(n)?(i(t,n),1):(t.windowManager.alert("Id should start with a letter, followed only by letters, numbers, dashes, dots, colons or underscores."),0))&&e.close()}})},d=function(r){return function(e){for(var t,n,o=0;o<e.length;o++){var a=e[o];n=void 0,!(n=t=a)||n.attr("href")||!n.attr("id")&&!n.attr("name")||t.firstChild||a.attr("contenteditable",r)}}};e.add("anchor",function(e){var t,n,o;(t=e).on("PreInit",function(){t.parser.addNodeFilter("a",d("false")),t.serializer.addNodeFilter("a",d(null))}),(n=e).addCommand("mceAnchor",function(){l(n)}),(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:a,remove:"all",split:!0,deep:!0,attributes:{id:"%value"},onmatch:function(e,t,n){return r(e)}})})})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e,t){var n;return t<0&&(t=0),3!==e.nodeType||(n=e.data.length)<t&&(t=n),t},y=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setStart(t,i(t,n)):e.setStartBefore(t)},k=function(e,t,n){1!==t.nodeType||t.hasChildNodes()?e.setEnd(t,i(t,n)):e.setEndAfter(t)},r=function(e,t,n){var o,i,r,a,s,d,f,l=e.getParam("autolink_pattern",/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i),c=e.getParam("default_link_target",!1);if("A"!==e.selection.getNode().tagName){var g=e.selection.getRng().cloneRange();if(g.startOffset<5){if(!(s=g.endContainer.previousSibling)){if(!g.endContainer.firstChild||!g.endContainer.firstChild.nextSibling)return;s=g.endContainer.firstChild.nextSibling}if(d=s.length,y(g,s,d),k(g,s,d),g.endOffset<5)return;o=g.endOffset,i=s}else{if(3!==(i=g.endContainer).nodeType&&i.firstChild){for(;3!==i.nodeType&&i.firstChild;)i=i.firstChild;3===i.nodeType&&(y(g,i,0),k(g,i,i.nodeValue.length))}o=1===g.endOffset?2:g.endOffset-1-t}for(var u,h=o;y(g,i,2<=o?o-2:0),k(g,i,1<=o?o-1:0),--o," "!==(f=g.toString())&&""!==f&&160!==f.charCodeAt(0)&&0<=o-2&&f!==n;);(u=g.toString())===n||" "===u||160===u.charCodeAt(0)?(y(g,i,o),k(g,i,h),o+=1):(0===g.startOffset?y(g,i,0):y(g,i,o),k(g,i,h)),"."===(a=g.toString()).charAt(a.length-1)&&k(g,i,h-1);var m=(a=g.toString().trim()).match(l),C=e.getParam("link_default_protocol","http","string");m&&("www."===m[1]?m[1]=C+"://www.":/@$/.test(m[1])&&!/^mailto:/.test(m[1])&&(m[1]="mailto:"+m[1]),r=e.selection.getBookmark(),e.selection.setRng(g),e.execCommand("createlink",!1,m[1]+m[2]),!1!==c&&e.dom.setAttrib(e.selection.getNode(),"target",c),e.selection.moveToBookmark(r),e.nodeChanged())}},t=function(t){var n;t.on("keydown",function(e){13!==e.keyCode||r(t,-1,"")}),o.browser.isIE()?t.on("focus",function(){if(!n){n=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(e){}}}):(t.on("keypress",function(e){41!==e.keyCode||r(t,-1,"(")}),t.on("keyup",function(e){32!==e.keyCode||r(t,0,"")}))};e.add("autolink",function(e){t(e)})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},p=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},v=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r,s,a,g,u,l,c,m,f=e.dom,d=e.getDoc();d&&((n=e).plugins.fullscreen&&n.plugins.fullscreen.isFullscreen()?p(e,!0):(i=d.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(f,i,"margin-top",!0),a=v(f,i,"margin-bottom",!0),(g=i.offsetHeight+s+a+o)<0&&(g=0),g+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=g+u),(l=e.getParam("max_height",0,"number"))&&l<r?(r=l,p(e,!0)):p(e,!1),r!==t.get()&&(c=r-t.get(),f.setStyle(e.getContainer(),"height",r+"px"),t.set(r),e.fire("ResizeEditor"),h.browser.isSafari()&&h.mac&&(m=e.getWin()).scrollTo(m.pageXOffset,m.pageYOffset),e.hasFocus()&&e.selection.scrollIntoView(e.selection.getNode()),h.webkit&&c<0&&b(e,t))))};e.add("autoresize",function(e){var t,n,i,o,r,s;e.settings.hasOwnProperty("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(){b(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(){b(n,i)}),n.getParam("autoresize_on_init",!0,"boolean")&&n.on("init",function(){a(n,i,20,100,function(){a(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.6.2 (2020-12-08)
*/
!function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=(e=undefined,function(t){return e===t}),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),n=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(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)},s=function(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=o.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)},f=function(t){var e=parseInt(n.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.getParam("autosave_retention"),"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);n.removeItem(r+"draft"),n.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(n.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),n.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(n.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.getParam("autosave_interval"),"30s");r.setEditorInterval(t,function(){m(t)},e)},d=function(t){t.undoManager.transact(function(){l(t),c(t)}),t.focus()},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),y=function(r){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;o.each(g.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)}),v(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&l(t)}),r=t,{hasDraft:function(){return f(r)},storeDraft:function(){return m(r)},restoreDraft:function(){return l(r)},removeDraft:function(t){return c(r,t)},isEmpty:function(t){return s(r,t)}}})}();

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

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

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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(o){var e=o.getContent({source_view:!0});o.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;t=o,n=e.getData().code,t.focus(),t.undoManager.transact(function(){t.setContent(n)}),t.selection.setCursorLocation(),t.nodeChanged(),e.close()}})};e.add("code",function(e){var t,n;return(t=e).addCommand("mceCodeEditor",function(){o(t)}),(n=e).ui.registry.addButton("code",{icon:"sourcecode",tooltip:"Source code",onAction:function(){return o(n)}}),n.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Source code",onAction:function(){return o(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.6.2 (2020-12-08)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("contextmenu",function(){console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var n,t,e,o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n,t){var e,o=n.dom,r=n.selection.getSelectedBlocks();r.length&&(e=o.getAttrib(r[0],"dir"),u.each(r,function(n){o.getParent(n.parentNode,'*[dir="'+t+'"]',o.getRoot())||o.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},c=function(n){return function(){return n}},f=c(!1),d=c(!0),l=function(){return m},m=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:f,isSome:f,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:l,each:function(){},bind:l,exists:f,forall:d,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),a=function(e){var n=c(e),t=function(){return r},o=function(n){return n(e)},r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return a(n(e))},each:function(n){n(e)},bind:o,exists:o,forall:o,filter:function(n){return n(e)?r:m},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return r},s={some:a,none:l,from:function(n){return null===n||n===undefined?m:a(n)}},g=(o="function",function(n){return typeof n===o}),h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},y={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1<e.childNodes.length)throw console.error("HTML does not have a single root node",n),new Error("HTML must have a single root node");return h(e.childNodes[0])},fromTag:function(n,t){var e=(t||document).createElement(n);return h(e)},fromText:function(n,t){var e=(t||document).createTextNode(n);return h(e)},fromDom:h,fromPoint:function(n,t,e){return s.from(n.dom.elementFromPoint(t,e)).map(h)}},v=("undefined"!=typeof window||Function("return this;")(),function(t){return function(n){return n.dom.nodeType===t}}),p=v(3),T=v(9),N=v(11),D=g(Element.prototype.attachShadow)&&g(Node.prototype.getRootNode)?function(n){return y.fromDom(n.dom.getRootNode())}:function(n){return T(n)?n:(t=n,y.fromDom(t.dom.ownerDocument));var t},w=function(n){var t=D(n);return N(t)?s.some(t):s.none()},O=function(n){return y.fromDom(n.dom.host)},C=function(n){var t=p(n)?n.dom.parentNode:n.dom;if(t===undefined||null===t||null===t.ownerDocument)return!1;var e,o,r=t.ownerDocument;return w(y.fromDom(t)).fold(function(){return r.body.contains(t)},(e=C,o=O,function(n){return e(o(n))}))},S=function(n,t){return(e=n).style!==undefined&&g(e.style.getPropertyValue)?n.style.getPropertyValue(t):"";var e},L=function(n){return"rtl"===(e="direction",o=(t=n).dom,""!==(r=window.getComputedStyle(o).getPropertyValue(e))||C(t)?r:S(o,e))?"rtl":"ltr";var t,e,o,r},R=function(t,o){return function(e){var n=function(n){var t=y.fromDom(n.element);e.setActive(L(t)===o)};return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}};r.add("directionality",function(n){var t,e;(t=n).addCommand("mceDirectionLTR",function(){i(t,"ltr")}),t.addCommand("mceDirectionRTL",function(){i(t,"rtl")}),(e=n).ui.registry.addToggleButton("ltr",{tooltip:"Left to right",icon:"ltr",onAction:function(){return e.execCommand("mceDirectionLTR")},onSetup:R(e,"ltr")}),e.ui.registry.addToggleButton("rtl",{tooltip:"Right to left",icon:"rtl",onAction:function(){return e.execCommand("mceDirectionRTL")},onSetup:R(e,"rtl")})})}();

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

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

View File

@@ -0,0 +1,711 @@
/**
* 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.6.2 (2020-12-08)
*/
!function () {
"use strict";
var t, e, n, r, o, a = tinymce.util.Tools.resolve("tinymce.PluginManager"), c = function () {
return (c = Object.assign || function (e) {
for (var t, n = 1, r = arguments.length; n < r; n++) for (var a in t = arguments[n]) Object.prototype.hasOwnProperty.call(t, a) && (e[a] = t[a]);
return e
}).apply(this, arguments)
}, i = function (r) {
return function (e) {
return n = typeof (t = e), (null === t ? "null" : "object" == n && (Array.prototype.isPrototypeOf(t) || t.constructor && "Array" === t.constructor.name) ? "array" : "object" == n && (String.prototype.isPrototypeOf(t) || t.constructor && "String" === t.constructor.name) ? "string" : n) === r;
var t, n
}
}, l = function (t) {
return function (e) {
return typeof e === t
}
}, A = i("string"), s = i("object"), u = i("array"), m = function (e) {
return t === e
}, d = l("boolean"), g = l("number"), f = function () {
}, p = function (e) {
return function () {
return e
}
}, h = p(!1), b = p(!(t = null)), v = function () {
return y
}, y = (e = function (e) {
return e.isNone()
}, {
fold: function (e, t) {
return e()
},
is: h,
isSome: h,
isNone: b,
getOr: r = function (e) {
return e
},
getOrThunk: n = function (e) {
return e()
},
getOrDie: function (e) {
throw new Error(e || "error: getOrDie called on none.")
},
getOrNull: p(null),
getOrUndefined: p(undefined),
or: r,
orThunk: n,
map: v,
each: f,
bind: v,
exists: h,
forall: b,
filter: v,
equals: e,
equals_: e,
toArray: function () {
return []
},
toString: p("none()")
}), D = function (n) {
var e = p(n), t = function () {
return a
}, r = function (e) {
return e(n)
}, a = {
fold: function (e, t) {
return t(n)
},
is: function (e) {
return n === e
},
isSome: b,
isNone: h,
getOr: e,
getOrThunk: e,
getOrDie: e,
getOrNull: e,
getOrUndefined: e,
or: t,
orThunk: t,
map: function (e) {
return D(e(n))
},
each: function (e) {
e(n)
},
bind: r,
exists: r,
forall: r,
filter: function (e) {
return e(n) ? a : y
},
toArray: function () {
return [n]
},
toString: function () {
return "some(" + n + ")"
},
equals: function (e) {
return e.is(n)
},
equals_: function (e, t) {
return e.fold(h, function (e) {
return t(n, e)
})
}
};
return a
}, S = {
some: D, none: v, from: function (e) {
return null === e || e === undefined ? y : D(e)
}
}, w = Array.prototype.push, x = function (e) {
for (var t = [], n = 0, r = e.length; n < r; ++n) {
if (!u(e[n])) throw new Error("Arr.flatten item " + n + " was not an array, input: " + e);
w.apply(t, e[n])
}
return t
}, T = function (e) {
return t = e, (n = 0) <= n && n < t.length ? S.some(t[n]) : S.none();
var t, n
}, C = ("undefined" != typeof window || Function("return this;")(), function (e, t, n) {
!function (e, t, n) {
if (!(A(n) || d(n) || g(n))) throw console.error("Invalid call to Attribute.set. Key ", t, ":: Value ", n, ":: Element ", e), new Error("Attribute value was not simple");
e.setAttribute(t, n + "")
}(e.dom, t, n)
}), U = function (e) {
if (null === e || e === undefined) throw new Error("Node cannot be null or undefined");
return {dom: e}
}, O = {
fromHtml: function (e, t) {
var n = (t || document).createElement("div");
if (n.innerHTML = e, !n.hasChildNodes() || 1 < n.childNodes.length) throw console.error("HTML does not have a single root node", e), new Error("HTML must have a single root node");
return U(n.childNodes[0])
}, fromTag: function (e, t) {
var n = (t || document).createElement(e);
return U(n)
}, fromText: function (e, t) {
var n = (t || document).createTextNode(e);
return U(n)
}, fromDom: U, fromPoint: function (e, t, n) {
return S.from(e.dom.elementFromPoint(t, n)).map(U)
}
}, I = tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"), N = tinymce.util.Tools.resolve("tinymce.util.Promise"),
P = tinymce.util.Tools.resolve("tinymce.util.XHR"), _ = function (e) {
return e.getParam("image_dimensions", !0, "boolean")
}, L = function (e) {
return e.getParam("images_upload_url", "", "string")
}, E = function (e) {
return e.getParam("images_upload_handler", undefined, "function")
}, M = function (e, t) {
return Math.max(parseInt(e, 10), parseInt(t, 10))
}, R = function (e) {
return e = e && e.replace(/px$/, "")
}, z = function (e) {
return 0 < e.length && /^[0-9]+$/.test(e) && (e += "px"), e
}, H = function (e) {
if (e.margin) {
var t = String(e.margin).split(" ");
switch (t.length) {
case 1:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[0], e["margin-bottom"] = e["margin-bottom"] || t[0], e["margin-left"] = e["margin-left"] || t[0];
break;
case 2:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[0], e["margin-left"] = e["margin-left"] || t[1];
break;
case 3:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[2], e["margin-left"] = e["margin-left"] || t[1];
break;
case 4:
e["margin-top"] = e["margin-top"] || t[0], e["margin-right"] = e["margin-right"] || t[1], e["margin-bottom"] = e["margin-bottom"] || t[2], e["margin-left"] = e["margin-left"] || t[3]
}
delete e.margin
}
return e
}, k = function (e) {
return "IMG" === e.nodeName && (e.hasAttribute("data-mce-object") || e.hasAttribute("data-mce-placeholder"))
}, j = I.DOM, B = function (e) {
return e.style.marginLeft && e.style.marginRight && e.style.marginLeft === e.style.marginRight ? R(e.style.marginLeft) : ""
}, F = function (e) {
return e.style.marginTop && e.style.marginBottom && e.style.marginTop === e.style.marginBottom ? R(e.style.marginTop) : ""
}, G = function (e) {
return e.style.borderWidth ? R(e.style.borderWidth) : ""
}, W = function (e, t) {
return e.hasAttribute(t) ? e.getAttribute(t) : ""
}, q = function (e, t) {
return e.style[t] ? e.style[t] : ""
}, $ = function (e) {
return null !== e.parentNode && "FIGURE" === e.parentNode.nodeName
}, J = function (e, t, n) {
"" === n ? e.removeAttribute(t) : e.setAttribute(t, n)
}, X = function (e) {
var t, n, r, a;
$(e) ? (a = (r = e).parentNode, j.insertAfter(r, a), j.remove(a)) : (t = e, n = j.create("figure", {"class": "image"}), j.insertAfter(n, t), n.appendChild(t), n.appendChild(j.create("figcaption", {contentEditable: "true"}, "Caption")), n.contentEditable = "false")
}, V = function (e, t) {
var n = e.getAttribute("style"), r = t(null !== n ? n : "");
0 < r.length ? (e.setAttribute("style", r), e.setAttribute("data-mce-style", r)) : e.removeAttribute("style")
}, K = function (e, r) {
return function (e, t, n) {
e.style[t] ? (e.style[t] = z(n), V(e, r)) : J(e, t, n)
}
}, Z = function (e, t) {
return e.style[t] ? R(e.style[t]) : W(e, t)
}, Q = function (e, t) {
var n = z(t);
e.style.marginLeft = n, e.style.marginRight = n
}, Y = function (e, t) {
var n = z(t);
e.style.marginTop = n, e.style.marginBottom = n
}, ee = function (e, t) {
var n = z(t);
e.style.borderWidth = n
}, te = function (e, t) {
e.style.borderStyle = t
}, ne = function (e) {
return "FIGURE" === e.nodeName
}, re = function (e) {
return 0 === j.getAttrib(e, "alt").length && "presentation" === j.getAttrib(e, "role")
}, ae = function () {
return {
src: "",
alt: "",
title: "",
width: "",
height: "",
"class": "",
style: "",
caption: !1,
hspace: "",
vspace: "",
border: "",
borderStyle: "",
isDecorative: !1
}
}, ie = function (e, t) {
var n = document.createElement("img");
return J(n, "style", t.style), !B(n) && "" === t.hspace || Q(n, t.hspace), !F(n) && "" === t.vspace || Y(n, t.vspace), !G(n) && "" === t.border || ee(n, t.border), !q(n, "borderStyle") && "" === t.borderStyle || te(n, t.borderStyle), e(n.getAttribute("style"))
}, oe = function (e, t) {
return {
src: W(t, "src"),
alt: re(n = t) ? "" : W(n, "alt"),
title: W(t, "title"),
width: Z(t, "width"),
height: Z(t, "height"),
"class": W(t, "class"),
style: e(W(t, "style")),
caption: $(t),
hspace: B(t),
vspace: F(t),
border: G(t),
borderStyle: q(t, "borderStyle"),
isDecorative: re(t)
};
var n
}, le = function (e, t, n, r, a) {
n[r] !== t[r] && a(e, r, n[r])
}, se = function (e, t, n) {
var r, a;
n ? (j.setAttrib(e, "role", "presentation"), r = O.fromDom(e), C(r, "alt", "")) : (m(t) ? (r = O.fromDom(e), a = "alt", r.dom.removeAttribute(a)) : (r = O.fromDom(e), C(r, "alt", t)), "presentation" === j.getAttrib(e, "role") && j.setAttrib(e, "role", ""))
}, ue = function (r, a) {
return function (e, t, n) {
r(e, n), V(e, a)
}
}, ce = function (e, t, n) {
var r, a, i, o = oe(e, n);
le(n, o, t, "caption", function (e, t, n) {
return X(e), 0
}), le(n, o, t, "src", J), le(n, o, t, "title", J), le(n, o, t, "width", K(0, e)), le(n, o, t, "height", K(0, e)), le(n, o, t, "class", J), le(n, o, t, "style", ue(function (e, t) {
return J(e, "style", t), 0
}, e)), le(n, o, t, "hspace", ue(Q, e)), le(n, o, t, "vspace", ue(Y, e)), le(n, o, t, "border", ue(ee, e)), le(n, o, t, "borderStyle", ue(te, e)), r = n, a = o, (i = t).alt === a.alt && i.isDecorative === a.isDecorative || se(r, i.alt, i.isDecorative)
}, me = function (e, t) {
var n = e.dom.styles.parse(t), r = H(n), a = e.dom.styles.parse(e.dom.styles.serialize(r));
return e.dom.styles.serialize(a)
}, de = function (e) {
var t = e.selection.getNode(), n = e.dom.getParent(t, "figure.image");
return n ? e.dom.select("img", n)[0] : t && ("IMG" !== t.nodeName || k(t)) ? null : t
}, ge = function (t, e) {
var n = t.dom, r = n.getParent(e.parentNode, function (e) {
return !!t.schema.getTextBlockElements()[e.nodeName]
}, t.getBody());
return r ? n.split(r, e) : e
}, fe = function (t, e) {
var n = function (e, t) {
var n = document.createElement("img");
if (ce(e, c(c({}, t), {caption: !1}), n), se(n, t.alt, t.isDecorative), t.caption) {
var r = j.create("figure", {"class": "image"});
return r.appendChild(n), r.appendChild(j.create("figcaption", {contentEditable: "true"}, "Caption")), r.contentEditable = "false", r
}
return n
}(function (e) {
return me(t, e)
}, e);
t.dom.setAttrib(n, "data-mce-id", "__mcenew"), t.focus(), t.selection.setContent(n.outerHTML);
var r, a = t.dom.select('*[data-mce-id="__mcenew"]')[0];
t.dom.setAttrib(a, "data-mce-id", null), ne(a) ? (r = ge(t, a), t.selection.select(r)) : t.selection.select(a)
}, pe = function (t, e) {
var n, r, a, i, o, l, s = de(t);
ce(function (e) {
return me(t, e)
}, e, s), n = s, t.dom.setAttrib(n, "src", n.getAttribute("src")), ne(s.parentNode) ? (r = s.parentNode, ge(t, r), t.selection.select(s.parentNode)) : (t.selection.select(s), a = t, i = e, l = function () {
o.onload = o.onerror = null, a.selection && (a.selection.select(o), a.nodeChanged())
}, (o = s).onload = function () {
i.width || i.height || !_(a) || a.dom.setAttribs(o, {
width: String(o.clientWidth),
height: String(o.clientHeight)
}), l()
}, o.onerror = l)
}, he = Object.prototype.hasOwnProperty, be = (o = function (e, t) {
return s(e) && s(t) ? be(e, t) : t
}, function () {
for (var e = new Array(arguments.length), t = 0; t < e.length; t++) e[t] = arguments[t];
if (0 === e.length) throw new Error("Can't merge zero objects");
for (var n = {}, r = 0; r < e.length; r++) {
var a = e[r];
for (var i in a) he.call(a, i) && (n[i] = o(n[i], a[i]))
}
return n
}), ve = tinymce.util.Tools.resolve("tinymce.util.Tools"), ye = function (e) {
return A(e.value) ? e.value : ""
}, De = function (e, i) {
var o = [];
return ve.each(e, function (e) {
var t, n, r, a = A((t = e).text) ? t.text : A(t.title) ? t.title : "";
e.menu !== undefined ? (n = De(e.menu, i), o.push({text: a, items: n})) : (r = i(e), o.push({text: a, value: r}))
}), o
}, we = function (t) {
return void 0 === t && (t = ye), function (e) {
return e ? S.from(e).map(function (e) {
return De(e, t)
}) : S.none()
}
}, Ae = function (e, n) {
return function (e, t) {
for (var n = 0; n < e.length; n++) {
var r = t(e[n], n);
if (r.isSome()) return r
}
return S.none()
}(e, function (e) {
return t = e, Object.prototype.hasOwnProperty.call(t, "items") ? Ae(e.items, n) : e.value === n ? S.some(e) : S.none();
var t
})
}, Se = we, xe = function (e) {
return we(ye)(e)
}, Te = function (e, t) {
return e.bind(function (e) {
return Ae(e, t)
})
};
function Ce(o) {
var t = function (e, r, a, t) {
var i = new XMLHttpRequest;
i.open("POST", o.url), i.withCredentials = o.credentials, i.upload.onprogress = function (e) {
t(e.loaded / e.total * 100)
}, i.onerror = function () {
a("Image upload failed due to a XHR Transport error. Code: " + i.status)
}, i.onload = function () {
var e, t, n;
i.status < 200 || 300 <= i.status ? a("HTTP Error: " + i.status) : (e = JSON.parse(i.responseText)) && "string" == typeof e.location ? r((t = o.basePath, n = e.location, t ? t.replace(/\/$/, "") + "/" + n.replace(/^\//, "") : n)) : a("Invalid JSON: " + i.responseText)
};
var n = new FormData;
n.append("file", e.blob(), e.filename()), i.send(n)
};
return o = ve.extend({credentials: !1, handler: t}, o), {
upload: function (e) {
return o.url || o.handler !== t ? (r = e, a = o.handler, new N(function (e, t) {
try {
a(r, e, t, f)
} catch (n) {
t(n.message)
}
})) : N.reject("Upload url missing from the settings.");
var r, a
}
}
}
var Ue = function (e) {
return {
title: "Advanced",
name: "advanced",
items: [{type: "input", label: "Style", name: "style"}, {
type: "grid",
columns: 2,
items: [{type: "input", label: "Vertical space", name: "vspace", inputMode: "numeric"}, {
type: "input",
label: "Horizontal space",
name: "hspace",
inputMode: "numeric"
}, {type: "input", label: "Border width", name: "border", inputMode: "numeric"}, {
type: "listbox",
name: "borderstyle",
label: "Border style",
items: [{text: "Select...", value: ""}, {text: "Solid", value: "solid"}, {
text: "Dotted",
value: "dotted"
}, {text: "Dashed", value: "dashed"}, {text: "Double", value: "double"}, {
text: "Groove",
value: "groove"
}, {text: "Ridge", value: "ridge"}, {text: "Inset", value: "inset"}, {
text: "Outset",
value: "outset"
}, {text: "None", value: "none"}, {text: "Hidden", value: "hidden"}]
}]
}]
}
}, Oe = function (r) {
var t, e, a = Se(function (e) {
return r.convertURL(e.value || e.url, "src")
}), n = new N(function (t) {
var n, e;
n = function (e) {
t(a(e).map(function (e) {
return x([[{text: "None", value: ""}], e])
}))
}, "string" == typeof (e = r.getParam("image_list", !1)) ? P.send({
url: e, success: function (e) {
n(JSON.parse(e))
}
}) : "function" == typeof e ? e(n) : n(e)
}), i = xe(r.getParam("image_class_list")), o = r.getParam("image_advtab", !1, "boolean"),
l = r.getParam("image_uploadtab", !0, "boolean"), s = !!L(r), u = !!E(r), c = (e = de(t = r)) ? oe(function (e) {
return me(t, e)
}, e) : ae(), m = r.getParam("image_description", !0, "boolean"), d = r.getParam("image_title", !1, "boolean"),
g = _(r), f = r.getParam("image_caption", !1, "boolean"), p = r.getParam("a11y_advanced_options", !1, "boolean"),
h = L(r), b = r.getParam("images_upload_base_path", undefined, "string"),
v = r.getParam("images_upload_credentials", !1, "boolean"), y = E(r),
D = r.getParam("automatic_uploads", !0, "boolean"),
w = S.some(r.getParam("image_prepend_url", "", "string")).filter(function (e) {
return A(e) && 0 < e.length
});
return n.then(function (e) {
return {
image: c,
imageList: e,
classList: i,
hasAdvTab: o,
hasUploadTab: l,
hasUploadUrl: s,
hasUploadHandler: u,
hasDescription: m,
hasImageTitle: d,
hasDimensions: g,
hasImageCaption: f,
url: h,
basePath: b,
credentials: v,
handler: y,
prependURL: w,
hasAccessibilityOptions: p,
automaticUploads: D
}
})
}, Ie = function (e) {
var t = e.imageList.map(function (e) {
return {name: "images", type: "listbox", label: "Image list", items: e}
}), n = {
name: "alt",
type: "input",
label: "Alternative description",
disabled: e.hasAccessibilityOptions && e.image.isDecorative
}, r = e.classList.map(function (e) {
return {name: "classes", type: "listbox", label: "Class", items: e}
});
return x([[{
name: "src",
type: "urlinput",
filetype: "image",
label: "Source"
}], t.toArray(), e.hasAccessibilityOptions && e.hasDescription ? [{
type: "label",
label: "Accessibility",
items: [{name: "isDecorative", type: "checkbox", label: "Image is decorative"}]
}] : [], e.hasDescription ? [n] : [], e.hasImageTitle ? [{
name: "title",
type: "input",
label: "Image title"
}] : [], e.hasDimensions ? [{name: "dimensions", type: "sizeinput"}] : [], [{
type: "grid",
columns: 2,
items: x([r.toArray(), e.hasImageCaption ? [{
type: "label",
label: "Caption",
items: [{type: "checkbox", name: "caption", label: "Show caption"}]
}] : []])
}]])
}, Ne = function (e) {
return {title: "General", name: "general", items: Ie(e)}
}, Pe = Ie, _e = function (e) {
return {title: "Upload", name: "upload", items: [{type: "dropzone", name: "fileinput"}]}
}, Le = function (e) {
return {
src: {value: e.src, meta: {}},
images: e.src,
alt: e.alt,
title: e.title,
dimensions: {width: e.width, height: e.height},
classes: e["class"],
caption: e.caption,
style: e.style,
vspace: e.vspace,
border: e.border,
hspace: e.hspace,
borderstyle: e.borderStyle,
fileinput: [],
isDecorative: e.isDecorative
}
}, Ee = function (e, t) {
return {
src: e.src.value,
alt: 0 === e.alt.length && t ? null : e.alt,
title: e.title,
width: e.dimensions.width,
height: e.dimensions.height,
"class": e.classes,
style: e.style,
caption: e.caption,
hspace: e.hspace,
vspace: e.vspace,
border: e.border,
borderStyle: e.borderstyle,
isDecorative: e.isDecorative
}
}, Me = function (e, t) {
var n, r, a = t.getData();
n = e, r = a.src.value, (/^(?:[a-zA-Z]+:)?\/\//.test(r) ? S.none() : n.prependURL.bind(function (e) {
return r.substring(0, e.length) !== e ? S.some(e + r) : S.none()
})).each(function (e) {
t.setData({src: {value: e, meta: a.src.meta}})
})
}, Re = function (e, t) {
var n, r, a, i, o = t.getData(), l = o.src.meta;
l !== undefined && (n = be({}, o), a = n, i = l, (r = e).hasDescription && A(i.alt) && (a.alt = i.alt), r.hasAccessibilityOptions && (a.isDecorative = i.isDecorative || a.isDecorative || !1), r.hasImageTitle && A(i.title) && (a.title = i.title), r.hasDimensions && (A(i.width) && (a.dimensions.width = i.width), A(i.height) && (a.dimensions.height = i.height)), A(i["class"]) && Te(r.classList, i["class"]).each(function (e) {
a.classes = e.value
}), r.hasImageCaption && d(i.caption) && (a.caption = i.caption), r.hasAdvTab && (A(i.style) && (a.style = i.style), A(i.vspace) && (a.vspace = i.vspace), A(i.border) && (a.border = i.border), A(i.hspace) && (a.hspace = i.hspace), A(i.borderstyle) && (a.borderstyle = i.borderstyle)), t.setData(n))
}, ze = function (e, t, n, r) {
var a, i, o, l, s, u, c, m, d, g, f, p;
Me(t, r), Re(t, r), a = e, i = t, o = n, s = (l = r).getData(), u = s.src.value, (c = s.src.meta || {}).width || c.height || !i.hasDimensions || a.imageSize(u).then(function (e) {
o.open && l.setData({dimensions: e})
}), m = t, d = n, f = (g = r).getData(), p = Te(m.imageList, f.src.value), d.prevImage = p, g.setData({
images: p.map(function (e) {
return e.value
}).getOr("")
})
}, He = function (e, t, n) {
var r, a, i, o, l, s = H(e(n.style)), u = be({}, n);
return u.vspace = (r = s)["margin-top"] && r["margin-bottom"] && r["margin-top"] === r["margin-bottom"] ? R(String(r["margin-top"])) : "", u.hspace = (a = s)["margin-right"] && a["margin-left"] && a["margin-right"] === a["margin-left"] ? R(String(a["margin-right"])) : "", u.border = (i = s)["border-width"] ? R(String(i["border-width"])) : "", u.borderstyle = (o = s)["border-style"] ? String(o["border-style"]) : "", u.style = (l = t)(e(l(s))), u
}, ke = function (s, u, t, c) {
var e = c.getData();
c.block("Uploading image"), T(e.fileinput).fold(function () {
c.unblock()
}, function (n) {
var r, a = URL.createObjectURL(n),
i = Ce({url: u.url, basePath: u.basePath, credentials: u.credentials, handler: u.handler}), o = function () {
c.unblock(), URL.revokeObjectURL(a)
}, l = function (e) {
c.setData({src: {value: e, meta: {}}}), c.showTab("general"), ze(s, u, t, c)
};
r = n, new N(function (e, t) {
var n = new FileReader;
n.onload = function () {
e(n.result)
}, n.onerror = function () {
t(n.error.message)
}, n.readAsDataURL(r)
}).then(function (e) {
var t = s.createBlobCache(n, a, e);
u.automaticUploads ? i.upload(t).then(function (e) {
l(e), o()
})["catch"](function (e) {
o(), s.alertErr(e)
}) : (s.addToBlobCache(t), l(t.blobUri()), c.unblock())
})
})
}, je = function (h, b, v) {
return function (e, t) {
var n, r, a, i, o, l, s, u, c, m, d, g, f, p;
"src" === t.name ? ze(h, b, v, e) : "images" === t.name ? (c = h, m = b, d = v, f = (g = e).getData(), (p = Te(m.imageList, f.images)).each(function (e) {
"" === f.alt || d.prevImage.map(function (e) {
return e.text === f.alt
}).getOr(!1) ? "" === e.value ? g.setData({src: e, alt: d.prevAlt}) : g.setData({
src: e,
alt: e.text
}) : g.setData({src: e})
}), d.prevImage = p, ze(c, m, d, g)) : "alt" === t.name ? v.prevAlt = e.getData().alt : "style" === t.name ? (o = h, s = (l = e).getData(), u = He(o.parseStyle, o.serializeStyle, s), l.setData(u)) : "vspace" === t.name || "hspace" === t.name || "border" === t.name || "borderstyle" === t.name ? (n = h, r = e, a = be(Le(b.image), r.getData()), i = ie(n.normalizeCss, Ee(a, !1)), r.setData({style: i})) : "fileinput" === t.name ? ke(h, b, v, e) : "isDecorative" === t.name && (e.getData().isDecorative ? e.disable("alt") : e.enable("alt"))
}
}, Be = function (i) {
return function (e) {
var t, n, r, a = {prevImage: Te((t = e).imageList, t.image.src), prevAlt: t.image.alt, open: !0};
return {
title: "Insert/Edit Image",
size: "normal",
body: (r = e).hasAdvTab || r.hasUploadUrl || r.hasUploadHandler ? {
type: "tabpanel",
tabs: x([[Ne(r)], r.hasAdvTab ? [Ue(r)] : [], r.hasUploadTab && (r.hasUploadUrl || r.hasUploadHandler) ? [_e(r)] : []])
} : {type: "panel", items: Pe(r)},
buttons: [{type: "cancel", name: "cancel", text: "Cancel"}, {
type: "submit",
name: "save",
text: "Save",
primary: !0
}],
initialData: Le(e.image),
onSubmit: i.onSubmit(e),
onChange: je(i, e, a),
onClose: (n = a, function () {
n.open = !1
})
}
}
}, Fe = function (t) {
return function (e) {
return a = t.documentBaseURI.toAbsolute(e), new N(function (t) {
var n = document.createElement("img"), r = function (e) {
n.parentNode && n.parentNode.removeChild(n), t(e)
};
n.onload = function () {
var e = {width: M(n.width, n.clientWidth), height: M(n.height, n.clientHeight)};
r(N.resolve(e))
}, n.onerror = function () {
r(N.reject("Failed to get image dimensions for: " + a))
};
var e = n.style;
e.visibility = "hidden", e.position = "fixed", e.bottom = e.left = "0px", e.width = e.height = "auto", document.body.appendChild(n), n.src = a
}).then(function (e) {
return {width: String(e.width), height: String(e.height)}
});
var a
}
}, Ge = function (e) {
var n, t, r, a, i, o, l, s = {
onSubmit: function (n) {
return function (e) {
var t = be(Le(n.image), e.getData());
l.execCommand("mceUpdateImage", !1, Ee(t, n.hasAccessibilityOptions)), l.editorUpload.uploadImagesAuto(), e.close()
}
}, imageSize: Fe(l = e), addToBlobCache: function (e) {
o.editorUpload.blobCache.add(e)
}, createBlobCache: function (e, t, n) {
return i.editorUpload.blobCache.create({
blob: e,
blobUri: t,
name: e.name ? e.name.replace(/\.[^\.]+$/, "") : null,
filename: e.name,
base64: n.split(",")[1]
})
}, alertErr: function (e) {
a.windowManager.alert(e)
}, normalizeCss: function (e) {
return me(r, e)
}, parseStyle: function (e) {
return t.dom.parseStyle(e)
}, serializeStyle: (n = t = r = a = i = o = e, function (e, t) {
return n.dom.serializeStyle(e, t)
})
};
return {
open: function () {
Oe(e).then(Be(s)).then(e.windowManager.open)
}
}
}, We = function (u) {
u.addCommand("mceImage", Ge(u).open), u.addCommand("mceUpdateImage", function (e, s) {
u.undoManager.transact(function () {
return e = s, void ((l = de(t = u)) ? (n = oe(function (e) {
return me(t, e)
}, l), (r = c(c({}, n), e)).src ? pe(t, r) : (a = t, (i = l) && (o = a.dom.is(i.parentNode, "figure.image") ? i.parentNode : i, a.dom.remove(o), a.focus(), a.nodeChanged(), a.dom.isEmpty(a.getBody()) && (a.setContent(""), a.selection.setCursorLocation())))) : e.src && fe(t, c(c({}, ae()), e)));
var t, e, n, r, a, i, o, l
})
})
}, qe = function (i) {
return function (e) {
for (var t, n = e.length, r = function (e) {
e.attr("contenteditable", i ? "true" : null)
}; n--;) {
var a = e[n];
(t = a.attr("class")) && /\bimage\b/.test(t) && (a.attr("contenteditable", i ? "false" : null), ve.each(a.getAll("figcaption"), r))
}
}
};
a.add("image", function (e) {
var t, n;
(t = e).on("PreInit", function () {
t.parser.addNodeFilter("figure", qe(!0)), t.serializer.addNodeFilter("figure", qe(!1))
}), (n = e).ui.registry.addToggleButton("image", {
icon: "image",
tooltip: "Insert/edit image",
onAction: Ge(n).open,
onSetup: function (e) {
return n.selection.selectorChangedWithUnbind("img:not([data-mce-object],[data-mce-placeholder]),figure.image", e.setActive).unbind
}
}), n.ui.registry.addMenuItem("image", {
icon: "image",
text: "Image...",
onAction: Ge(n).open
}), n.ui.registry.addContextMenu("image", {
update: function (e) {
return ne(e) || "IMG" === e.nodeName && !k(e) ? ["image"] : []
}
}), We(e)
})
}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},o=(n="array",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}),i=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r<n;++r){if(!o(t[r]))throw new Error("Arr.flatten item "+r+" was not an array, input: "+t);i.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}(t,e))},p=function(e){return"string"==typeof e?function(t){return-1!==t.indexOf(e)}:e instanceof RegExp?function(t){return e.test(t)}:e},_=function(s,t,a){var u=[],r={};function l(t,e){var r,n,o,i=t.href;if(n=i,o=m.cacheSuffix,"string"==typeof n&&(n=n.replace("?"+o,"").replace("&"+o,"")),(i=n)&&a(i,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):f.baseURL+"/skins/ui/"+n,c=f.baseURL+"/skins/content/";return e===i+"/content"+(t.inline?".inline":"")+".min.css"||-1!==e.indexOf(c)}return!1}(s,i)){h.each(t.imports,function(t){l(t,!0)});try{r=t.cssRules||t.rules}catch(c){}h.each(r,function(t){t.styleSheet?l(t.styleSheet,!0):t.selectorText&&h.each(t.selectorText.split(","),function(t){u.push(h.trim(t))})})}}h.each(s.contentCSS,function(t){r[t]=!0}),a=a||function(t,e){return e||r[t]};try{h.each(t.styleSheets,function(t){l(t)})}catch(e){}return u},x=function(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=h.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}},P=function(t,e){return null===e||!1!==t.getParam("importcss_exclusive")},r=function(y){y.on("init",function(t){var e,r,n,o,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 l(r,function(t){var e=n[t];return 0===e.length?[]:[{title:t,items:e}]}).concat(e)}}),g={},c=p(y.getParam("importcss_selector_filter")),s=(o=y.getParam("importcss_groups"),h.map(o,function(t){return h.extend({},t,{original:t,selectors:{},filter:p(t.filter),item:{text:t.title,menu:[]}})})),a=function(t,e){if(f=t,p=g,!(P(y,m=e)?f in p:f in m.selectors)){a=t,l=g,P(y,u=e)?l[a]=!0:u.selectors[a]=!0;var r=(i=(o=y).plugins.importcss,c=t,((s=e)&&s.selector_converter?s.selector_converter:d(o)?d(o):function(){return x(o,c)}).call(i,c,s));if(r){var n=r.name||v.DOM.uniqueId();return y.formatter.register(n,r),h.extend({},{title:r.title,format:n})}}var o,i,c,s,a,u,l,f,m,p;return null};h.each(_(y,y.getDoc(),p(y.getParam("importcss_file_filter"))),function(r){var t,e,n,o;-1===r.indexOf(".mce-")&&(c&&!c(r)||(n=s,o=r,0<(t=h.grep(n,function(t){return!t.filter||t.filter(o)})).length?h.each(t,function(t){var e=a(r,t);e&&i.addItemToGroup(t.title,e)}):(e=a(r,null))&&i.addItem(e)))});var u=i.toFormats();y.fire("addStyleModifications",{items:u,replace:!y.getParam("importcss_append")})})};t.add("importcss",function(t){return r(t),e=t,{convertSelectorToFormat:function(t){return x(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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},c=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" "),m=function(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e},s=function(e,t,n){return n=n||new Date,t=(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",m(n.getMonth()+1,2))).replace("%d",m(n.getDate(),2))).replace("%H",""+m(n.getHours(),2))).replace("%M",""+m(n.getMinutes(),2))).replace("%S",""+m(n.getSeconds(),2))).replace("%I",""+((n.getHours()+11)%12+1))).replace("%p",n.getHours()<12?"AM":"PM")).replace("%B",""+e.translate(o[n.getMonth()]))).replace("%b",""+e.translate(i[n.getMonth()]))).replace("%A",""+e.translate(a[n.getDay()]))).replace("%a",""+e.translate(r[n.getDay()]))).replace("%%","%")},l=function(e,t){var n,r,a,i,o,u,c,m;e.getParam("insertdatetime_element",!1)?(n=s(e,t),r=void 0,r=/%[HMSIp]/.test(t)?s(e,"%Y-%m-%dT%H:%M"):s(e,"%Y-%m-%d"),(a=e.dom.getParent(e.selection.getStart(),"time"))?(o=a,u=r,c=n,m=(i=e).dom.create("time",{datetime:u},c),o.parentNode.insertBefore(m,o),i.dom.remove(o),i.selection.select(m,!0),i.selection.collapse(!1)):e.insertContent('<time datetime="'+r+'">'+n+"</time>")):e.insertContent(s(e,t))},t=function(t){t.addCommand("mceInsertDate",function(){var e;l(t,(e=t).getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){l(t,u(t))})},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){var e,t,r,a,i=c(n),o=(a=c(r=n),e=0<a.length?a[0]:u(r),t=e,{get:function(){return t},set:function(e){t=e}});n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===o.get()},fetch:function(e){e(d.map(i,function(e){return{type:"choiceitem",text:s(n,e),value:e}}))},onAction:function(e){l(n,o.get())},onItemAction:function(e,t){o.set(t),l(n,t)}});n.ui.registry.addNestedMenuItem("insertdatetime",{icon:"insert-time",text:"Date/time",getSubmenuItems:function(){return d.map(i,function(e){return{type:"menuitem",text:s(n,e),onAction:(t=e,function(){o.set(t),l(n,t)})};var t})}})};e.add("insertdatetime",function(e){t(e),n(e)})}();

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

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.6.2 (2020-12-08)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n,e){for(var a="",o=0;o<e;o++)a+=n;return a},r=function(n,e){var a,o=n.getParam("nonbreaking_wrap",!0,"boolean")||n.plugins.visualchars?'<span class="'+((a=n).plugins.visualchars&&a.plugins.visualchars.isEnabled()?"mce-nbsp-wrap mce-nbsp":"mce-nbsp-wrap")+'" contenteditable="false">'+i("&nbsp;",e)+"</span>":i("&nbsp;",e);n.undoManager.transact(function(){return n.insertContent(o)})},c=tinymce.util.Tools.resolve("tinymce.util.VK");n.add("nonbreaking",function(n){var e,a,o,i,t;(e=n).addCommand("mceNonBreaking",function(){r(e,1)}),(a=n).ui.registry.addButton("nonbreaking",{icon:"non-breaking",tooltip:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),a.ui.registry.addMenuItem("nonbreaking",{icon:"non-breaking",text:"Nonbreaking space",onAction:function(){return a.execCommand("mceNonBreaking")}}),0<(t="boolean"==typeof(i=(o=n).getParam("nonbreaking_force_tab",0))?!0===i?3:0:i)&&o.on("keydown",function(n){if(n.keyCode===c.TAB&&!n.isDefaultPrevented()){if(n.shiftKey)return;n.preventDefault(),n.stopImmediatePropagation(),r(o,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.6.2 (2020-12-08)
*/
!function(){"use strict";var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=function(t){return t.getParam("noneditable_noneditable_class","mceNonEditable")},f=function(e){return function(t){return-1!==(" "+t.attr("class")+" ").indexOf(e)}},e=function(e){var t,r="contenteditable",n=" "+l.trim(e.getParam("noneditable_editable_class","mceEditable"))+" ",a=" "+l.trim(u(e))+" ",i=f(n),o=f(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)if(-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,u(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))})})};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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e){return e.getParam("pagebreak_split_block",!1)},g=function(){return"mce-pagebreak"},m=function(){return'<img src="'+a.transparentSrc+'" class="'+g()+'" data-mce-resize="false" data-mce-placeholder />'};e.add("pagebreak",function(e){var a,n,o,c,t,r;(a=e).addCommand("mcePageBreak",function(){i(a)?a.insertContent("<p>"+m()+"</p>"):a.insertContent(m())}),(n=e).ui.registry.addButton("pagebreak",{icon:"page-break",tooltip:"Page break",onAction:function(){return n.execCommand("mcePageBreak")}}),n.ui.registry.addMenuItem("pagebreak",{text:"Page break",icon:"page-break",onAction:function(){return n.execCommand("mcePageBreak")}}),c=(o=e).getParam("pagebreak_separator","\x3c!-- pagebreak --\x3e"),t=new RegExp(c.replace(/[\?\.\*\[\]\(\)\{\}\+\^\$\:]/g,function(e){return"\\"+e}),"gi"),o.on("BeforeSetContent",function(e){e.content=e.content.replace(t,m())}),o.on("PreInit",function(){o.serializer.addNodeFilter("img",function(e){for(var a,n,t=e.length;t--;)if((n=(a=e[t]).attr("class"))&&-1!==n.indexOf("mce-pagebreak")){var r=a.parent;if(o.schema.getBlockElements()[r.name]&&i(o)){r.type=3,r.value=c,r.raw=!0,a.remove();continue}a.type=3,a.value=c,a.raw=!0}})}),(r=e).on("ResolveName",function(e){"IMG"===e.target.nodeName&&r.dom.hasClass(e.target,g())&&(e.name="pagebreak")})})}();

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.6.2 (2020-12-08)
*/
!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"),i=function(e){var t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='<base href="'+i(t.documentBaseURI.getURI())+'">',e&&(n+='<style type="text/css">'+e+"</style>");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+">"});var r,a,c,s,d,m,l,y=-1===(s=(r=t).getParam("body_id","tinymce","string")).indexOf("=")?s:(c=(a=r).getParam("body_id","","hash"))[a.id]||c,u=-1===(l=(d=t).getParam("body_class","","string")).indexOf("=")?l:(m=d).getParam("body_class","","hash")[m.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);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")};e.add("preview",function(e){var t,n;(t=e).addCommand("mcePreview",function(){i(t)}),(n=e).ui.registry.addButton("preview",{icon:"preview",tooltip:"Preview",onAction:function(){return n.execCommand("mcePreview")}}),n.ui.registry.addMenuItem("preview",{icon:"preview",text:"Preview",onAction:function(){return n.execCommand("mcePreview")}})})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.Env");n.add("print",function(n){var t,i;(t=n).addCommand("mcePrint",function(){e.browser.isIE()?t.getDoc().execCommand("print",!1,null):t.getWin().print()}),(i=n).ui.registry.addButton("print",{icon:"print",tooltip:"Print",onAction:function(){return i.execCommand("mcePrint")}}),i.ui.registry.addMenuItem("print",{text:"Print...",icon:"print",onAction:function(){return i.execCommand("mcePrint")}}),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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){return e.getParam("save_enablewhendirty",!0)},c=function(e,n){e.notificationManager.open({text:n,type:"error"})},t=function(t){t.addCommand("mceSave",function(){!function(e){var n=o.DOM.getParent(e.id,"form");if(!i(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():c(e,"Error: Form submit field collision.")),e.nodeChanged()):c(e,"Error: No form element found.")}}(t)}),t.addCommand("mceCancel",function(){var e,n;e=t,n=a.trim(e.startContent),e.getParam("save_oncancelcallback")?e.execCallback("save_oncancelcallback",e):e.resetContent(n)})},r=function(t){return function(e){var n=function(){e.setDisabled(i(t)&&!t.isDirty())};return t.on("NodeChange dirty",n),function(){return t.off("NodeChange dirty",n)}}};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:r(n)}),n.ui.registry.addButton("cancel",{icon:"cancel",tooltip:"Cancel",disabled:!0,onAction:function(){return n.execCommand("mceCancel")},onSetup:r(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.6.2 (2020-12-08)
*/
!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(s){function e(i){var o,l,e,t,n,u;function r(e){var t=m.select(":input:enabled,*[tabindex]:not(iframe)");function n(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(i.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(d.each(t,function(e,t){if(e.id===s.id)return o=t,!1}),0<e){for(l=o+1;l<t.length;l++)if(n(t[l]))return t[l]}else for(l=o-1;0<=l;l--)if(n(t[l]))return t[l];return null}i.keyCode!==f.TAB||i.ctrlKey||i.altKey||i.metaKey||i.isDefaultPrevented()||(1===(e=d.explode((t=s).getParam("tab_focus",t.getParam("tabfocus_elements",":prev,:next")))).length&&(e[1]=e[0],e[0]=":prev"),(n=i.shiftKey?":prev"===e[0]?r(-1):m.get(e[0]):":next"===e[1]?r(1):m.get(e[1]))&&(u=c.get(n.id||n.name),n.id&&u?u.focus():y.setTimeout(function(){a.webkit||window.focus(),n.focus()},10),i.preventDefault()))}s.on("init",function(){s.inline&&m.setAttrib(s.getBody(),"tabIndex",null),s.on("keyup",n),a.gecko?s.on("keypress keydown",e):s.on("keydown",e)})};e.add("tabfocus",function(e){i(e)})}();

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.6.2 (2020-12-08)
*/
!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("textcolor",function(){console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}();

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