diff --git a/public/tinymce/plugins/axupimgs/loading.gif b/public/tinymce/plugins/axupimgs/loading.gif new file mode 100644 index 0000000..3fcefe7 Binary files /dev/null and b/public/tinymce/plugins/axupimgs/loading.gif differ diff --git a/public/tinymce/plugins/axupimgs/plugin.js b/public/tinymce/plugins/axupimgs/plugin.js new file mode 100644 index 0000000..2585775 --- /dev/null +++ b/public/tinymce/plugins/axupimgs/plugin.js @@ -0,0 +1,75 @@ +tinymce.PluginManager.add('axupimgs', function(editor, url) { + var pluginName='图片上传'; + window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置 + var baseURL = `${process.env.VUE_APP_BASE_API}` + // var baseURL = 'http://localhost:8012/' + var iframe1 =baseURL+'tinymce/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'; + } + } + editor.insertContent(html); + axupimgs.res=[]; + api.close(); + break; + default: + break; + } + + } + }); + }; + + editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs',''); + + 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", + }; + } + }; +}); diff --git a/public/tinymce/plugins/axupimgs/plugin.min.js b/public/tinymce/plugins/axupimgs/plugin.min.js new file mode 100644 index 0000000..db7a3cc --- /dev/null +++ b/public/tinymce/plugins/axupimgs/plugin.min.js @@ -0,0 +1,75 @@ +tinymce.PluginManager.add('axupimgs', function(editor, url) { + var pluginName='Ax多图片上传'; + 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'; + } + } + editor.insertContent(html); + axupimgs.res=[]; + api.close(); + break; + default: + break; + } + + } + }); + }; + + editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs',''); + + 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", + }; + } + }; +}); diff --git a/public/tinymce/plugins/axupimgs/upfiles.html b/public/tinymce/plugins/axupimgs/upfiles.html new file mode 100644 index 0000000..7f8f62c --- /dev/null +++ b/public/tinymce/plugins/axupimgs/upfiles.html @@ -0,0 +1,203 @@ + + + + +axupimgs + + + + + + + + + +
+
+
    +
    + + + + diff --git a/src/components/XyTinymce/axupimgs/loading.gif b/src/components/XyTinymce/axupimgs/loading.gif new file mode 100644 index 0000000..3fcefe7 Binary files /dev/null and b/src/components/XyTinymce/axupimgs/loading.gif differ diff --git a/src/components/XyTinymce/axupimgs/plugin.js b/src/components/XyTinymce/axupimgs/plugin.js new file mode 100644 index 0000000..929966a --- /dev/null +++ b/src/components/XyTinymce/axupimgs/plugin.js @@ -0,0 +1,75 @@ +tinymce.PluginManager.add('axupimgs', function(editor, url) { + var pluginName='图片上传'; + window.axupimgs={}; //扔外部公共变量,也可以扔一个自定义的位置 + // var baseURL = `${process.env.VUE_APP_BASE_API}` + var baseURL = 'http://localhost:8012/' + var iframe1 =baseURL+'tinymce/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'; + } + } + editor.insertContent(html); + axupimgs.res=[]; + api.close(); + break; + default: + break; + } + + } + }); + }; + + editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs',''); + + 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", + }; + } + }; +}); diff --git a/src/components/XyTinymce/axupimgs/plugin.min.js b/src/components/XyTinymce/axupimgs/plugin.min.js new file mode 100644 index 0000000..db7a3cc --- /dev/null +++ b/src/components/XyTinymce/axupimgs/plugin.min.js @@ -0,0 +1,75 @@ +tinymce.PluginManager.add('axupimgs', function(editor, url) { + var pluginName='Ax多图片上传'; + 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'; + } + } + editor.insertContent(html); + axupimgs.res=[]; + api.close(); + break; + default: + break; + } + + } + }); + }; + + editor.ui.registry.getAll().icons.axupimgs || editor.ui.registry.addIcon('axupimgs',''); + + 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", + }; + } + }; +}); diff --git a/src/components/XyTinymce/axupimgs/upfiles.html b/src/components/XyTinymce/axupimgs/upfiles.html new file mode 100644 index 0000000..7f8f62c --- /dev/null +++ b/src/components/XyTinymce/axupimgs/upfiles.html @@ -0,0 +1,203 @@ + + + + +axupimgs + + + + + + + + + +
    +
    +
      +
      + + + + diff --git a/src/components/XyTinymce/index.vue b/src/components/XyTinymce/index.vue index 7362655..d9b929a 100644 --- a/src/components/XyTinymce/index.vue +++ b/src/components/XyTinymce/index.vue @@ -29,7 +29,8 @@ import "tinymce/icons/default" import 'tinymce/plugins/code' import "tinymce/plugins/image" - import "tinymce/plugins/imagetools" + import "tinymce/plugins/imagetools" + import "/public/tinymce/plugins/axupimgs/plugin.js" export default { components: { Editor @@ -49,13 +50,13 @@ }, plugins: { type: [String, Array], - default: "code image paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ", + default: "code image axupimgs paste preview searchreplace autolink directionality visualblocks visualchars fullscreen template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave ", }, toolbar: { type: [String, Array], - default: ` undo redo restoredraft | code | image | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent | + default: ` undo redo restoredraft | code | image | axupimgs | imagetools | assignment | cut copy paste pastetext | forecolor backcolor bold italic underline strikethrough anchor | alignleft aligncenter alignright alignjustify outdent indent | styleselect formatselect fontselect fontsizeselect | table charmap emoticons hr pagebreak | bullist numlist | blockquote subscript superscript removeformat | - insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter axupimgs`, + insertdatetime print preview | fullscreen | bdmap indent2em lineheight formatpainter`, }, menubar: { type: String,