diff --git a/manager/package.json b/manager/package.json index e7cc6f19..0289587f 100644 --- a/manager/package.json +++ b/manager/package.json @@ -12,7 +12,6 @@ "dependencies": { "@amap/amap-jsapi-loader": "0.0.7", "@antv/g2": "^4.1.12", - "@tinymce/tinymce-vue": "^3.2.0", "axios": "^0.21.1", "core-js": "^3.6.5", "dplayer": "^1.26.0", diff --git a/manager/public/index.html b/manager/public/index.html index f88bd079..8841b671 100644 --- a/manager/public/index.html +++ b/manager/public/index.html @@ -13,6 +13,9 @@ <% } %> '; + } + const bodyId = getBodyId(editor); + const bodyClass = getBodyClass(editor); + const isMetaKeyPressed = global$1.os.isMacOS() || global$1.os.isiOS() ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + const preventClicksOnLinksScript = ' '; + const directionality = editor.getBody().dir; + const dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + const previewHtml = '' + '' + '
' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + ''; + return previewHtml; + }; + + const open = editor => { + const content = getPreviewHtml(editor); + const dataApi = editor.windowManager.open({ + title: 'Preview', + size: 'large', + body: { + type: 'panel', + items: [{ + name: 'preview', + type: 'iframe', + sandboxed: true, + transparent: false + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: { preview: content } + }); + dataApi.focus('close'); + }; + + const register$1 = editor => { + editor.addCommand('mcePreview', () => { + open(editor); + }); + }; + + const register = editor => { + const onAction = () => editor.execCommand('mcePreview'); + editor.ui.registry.addButton('preview', { + icon: 'preview', + tooltip: 'Preview', + onAction + }); + editor.ui.registry.addMenuItem('preview', { + icon: 'preview', + text: 'Preview', + onAction + }); + }; + + var Plugin = () => { + global$2.add('preview', editor => { + register$1(editor); + register(editor); + }); + }; + + Plugin(); + +})(); diff --git a/manager/public/tinymce/plugins/preview/plugin.min.js b/manager/public/tinymce/plugins/preview/plugin.min.js new file mode 100644 index 00000000..0a99cf37 --- /dev/null +++ b/manager/public/tinymce/plugins/preview/plugin.min.js @@ -0,0 +1,4 @@ +/** + * TinyMCE version 6.4.2 (2023-04-26) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.Env"),o=tinymce.util.Tools.resolve("tinymce.util.Tools");const n=e=>t=>t.options.get(e),i=n("content_style"),s=n("content_css_cors"),c=n("body_class"),r=n("body_id");e.add("preview",(e=>{(e=>{e.addCommand("mcePreview",(()=>{(e=>{const n=(e=>{var n;let l="";const a=e.dom.encode,d=null!==(n=i(e))&&void 0!==n?n:"";l+='${ htmlEscape(template.value.description) }
` + }, + { + label: 'Preview', + type: 'iframe', + name: 'preview', + sandboxed: false, + transparent: false + } + ]; + const initialData = { + template: template.text, + preview: content + }; + dialogApi.unblock(); + dialogApi.redial(buildDialogSpec(bodyItems, initialData)); + dialogApi.focus('template'); + }; + const dialogApi = editor.windowManager.open(buildDialogSpec([], { + template: '', + preview: '' + })); + dialogApi.block('Loading...'); + getTemplateContent(templates[0]).then(previewHtml => { + updateDialog(dialogApi, templates[0], previewHtml); + }).catch(() => { + updateDialog(dialogApi, templates[0], ''); + dialogApi.setEnabled('save', false); + loadFailedAlert(dialogApi); + }); + }; + const optTemplates = createTemplates(); + optTemplates.each(openDialog); + }; + + const showDialog = editor => templates => { + open(editor, templates); + }; + const register$1 = editor => { + editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor)); + editor.addCommand('mceTemplate', createTemplateList(editor, showDialog(editor))); + }; + + const setup = editor => { + editor.on('PreProcess', o => { + const dom = editor.dom, dateFormat = getMdateFormat(editor); + global$2.each(dom.select('div', o.node), e => { + if (dom.hasClass(e, 'mceTmpl')) { + global$2.each(dom.select('*', e), e => { + if (hasAnyClasses(dom, e, getModificationDateClasses(editor))) { + e.innerHTML = getDateTime(editor, dateFormat); + } + }); + replaceVals(editor, e); + } + }); + }); + }; + + const register = editor => { + const onAction = () => editor.execCommand('mceTemplate'); + editor.ui.registry.addButton('template', { + icon: 'template', + tooltip: 'Insert template', + onAction + }); + editor.ui.registry.addMenuItem('template', { + icon: 'template', + text: 'Insert template...', + onAction + }); + }; + + var Plugin = () => { + global$3.add('template', editor => { + register$2(editor); + register(editor); + register$1(editor); + setup(editor); + }); + }; + + Plugin(); + +})(); diff --git a/manager/public/tinymce/plugins/template/plugin.min.js b/manager/public/tinymce/plugins/template/plugin.min.js new file mode 100644 index 00000000..343aa7f7 --- /dev/null +++ b/manager/public/tinymce/plugins/template/plugin.min.js @@ -0,0 +1,4 @@ +/** + * TinyMCE version 6.4.2 (2023-04-26) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager");const t=e=>t=>(e=>{const t=typeof e;return null===e?"null":"object"===t&&Array.isArray(e)?"array":"object"===t&&(a=n=e,(r=String).prototype.isPrototypeOf(a)||(null===(s=n.constructor)||void 0===s?void 0:s.name)===r.name)?"string":t;var a,n,r,s})(t)===e,a=t("string"),n=t("object"),r=t("array"),s=("function",e=>"function"==typeof e);const l=(!1,()=>false);var o=tinymce.util.Tools.resolve("tinymce.util.Tools");const c=e=>t=>t.options.get(e),i=c("template_cdate_classes"),u=c("template_mdate_classes"),m=c("template_selected_content_classes"),p=c("template_preview_replace_values"),d=c("template_replace_values"),h=c("templates"),g=c("template_cdate_format"),v=c("template_mdate_format"),y=c("content_style"),f=c("content_css_cors"),_=c("body_class"),b=(e,t)=>{if((e=""+e).length