diff --git a/public/assets/backend/js/editor/editor.js b/public/assets/backend/js/editor/editor.js
index d1224034ef..724594c83a 100644
--- a/public/assets/backend/js/editor/editor.js
+++ b/public/assets/backend/js/editor/editor.js
@@ -275,7 +275,12 @@ App.editor.markdown = function (editorElement, uploadUrl, options) {
crossDomainUpload: true,
uploadCallbackURL: path + 'plugins/image-dialog/upload_callback.htm',
dialogLockScreen: false,
- onload: function () { }
+ onload: function () {
+ var editor=this;
+ editormd.loadPlugin(path+"plugins/drop-or-paste-upload/drop-or-paste-upload", function(){
+ editor.dropOrPasteUpload();
+ });
+ }
};
if (typeof(window.THEME_COLOR)=='string'&&window.THEME_COLOR=='dark') {
defaults.theme = "dark"; // ambiance
diff --git a/public/assets/backend/js/editor/editor.min.js b/public/assets/backend/js/editor/editor.min.js
index 6ff427358d..173fd897e3 100644
--- a/public/assets/backend/js/editor/editor.min.js
+++ b/public/assets/backend/js/editor/editor.min.js
@@ -1 +1 @@
-App.loader.libs.editormdPreview=["#editor/markdown/lib/marked.min.js","#editor/markdown/lib/prettify.min.js","#editor/markdown/lib/raphael.min.js","#editor/markdown/lib/underscore.min.js","#editor/markdown/css/editormd.preview.min.css","#editor/markdown/editormd.min.js"];App.loader.libs.codemirror=["#editor/markdown/lib/codemirror/codemirror.min.css","#editor/markdown/lib/codemirror/addon/fold/foldgutter.css","#editor/markdown/lib/codemirror/addon/hint/show-hint.css","#editor/markdown/lib/codemirror/theme/ambiance.css","#editor/markdown/lib/codemirror/codemirror.min.js","#editor/markdown/lib/codemirror/modes.min.js","#editor/markdown/lib/codemirror/addons.min.js","#editor/markdown/lib/codemirror/addon/hint/show-hint.js"];App.loader.libs.editormd=["#editor/markdown/css/editormd.min.css","#editor/markdown/css/editormd.preview.min.css","#editor/markdown/editormd.min.js"];App.loader.libs.flowChart=["#editor/markdown/lib/flowchart.min.js"];App.loader.libs.flowChartJQuery=["#editor/markdown/lib/jquery.flowchart.min.js"];App.loader.libs.sequenceDiagram=["#editor/markdown/lib/sequence-diagram.min.js"];App.loader.libs.tinymce=["#editor/tinymce/custom.css","#editor/tinymce/tinymce.min.js","#editor/tinymce/jquery.tinymce.min.js","#editor/tinymce/langs/"+App.langTag("_")+".js"];App.loader.libs.dialog=["#dialog/bootstrap-dialog.min.css","#dialog/bootstrap-dialog.min.js"];App.loader.libs.markdownit=["#markdown/it/markdown-it.min.js","#markdown/it/plugins/emoji/markdown-it-emoji.min.js"];App.loader.libs.codehighlight=["#markdown/it/plugins/highlight/loader/prettify.js","#markdown/it/plugins/highlight/loader/run_prettify.js?skin=sons-of-obsidian"];App.loader.libs.powerFloat=["#float/powerFloat.min.css","#float/powerFloat.min.js"];App.loader.libs.uploadPreviewer=["#jquery.uploadPreviewer/css/jquery.uploadPreviewer.min.css","#jquery.uploadPreviewer/jquery.uploadPreviewer.min.js"];App.loader.libs.fileUpload=["#jquery.upload/js/vendor/jquery.ui.widget.min.js","#jquery.upload/js/jquery.iframe-transport.min.js","#jquery.upload/js/jquery.fileupload.min.js","#jquery.upload/js/jquery.fileupload-process.min.js"];App.loader.libs.jcrop=["#jquery.crop/css/jquery.Jcrop.min.css","#jquery.crop/js/jquery.Jcrop.min.js"];App.loader.libs.cropImage=["#jquery.crop/css/jquery.Jcrop.min.css","#jquery.crop/js/jquery.Jcrop.min.js","#behavior/page/crop-image.min.js"];App.loader.libs.select2=["#jquery.select2/select2.css","#jquery.select2/select2.min.js"];App.loader.libs.select2ex=["#behaviour/page/select2.min.js"];App.loader.libs.selectPage=["#selectpage/selectpage.css","#selectpage/selectpage.min.js"];App.loader.libs.cascadeSelect=["#behaviour/page/cascade-select.min.js"];App.loader.libs.forms=["#behaviour/page/forms.min.js"];App.loader.libs.jqueryui=["#jquery.ui/jquery-ui.custom.min.js","#jquery.ui/jquery-ui.touch-punch.min.js"];App.loader.libs.dropzone=["#jquery.ui/css/dropzone.min.css","#dropzone/dropzone.min.js"];App.loader.libs.loadingOverlay=["#loadingoverlay/loadingoverlay.min.js"];App.loader.libs.dateRangePicker=["#daterangepicker/daterangepicker.min.css","#daterangepicker/moment.min.js","#daterangepicker/jquery.daterangepicker.min.js","#behaviour/page/datetime.min.js"];App.loader.libs.magnificPopup=["#magnific-popup/magnific-popup.min.css","#magnific-popup/jquery.magnific-popup.min.js"];App.loader.libs.inputmask=["#inputmask/inputmask.min.js","#inputmask/jquery.inputmask.min.js"];App.loader.libs.clipboard=["#clipboard/clipboard.min.js","#clipboard/utils.js"];App.editor={browsingFileURL:App.loader.siteURL+(typeof window.IS_BACKEND!=="undefined"&&window.IS_BACKEND?BACKEND_URL:FRONTEND_URL+"/user/file")+"/finder"};App.editor.loadingOverlay=function(e){App.loader.defined(typeof $.fn.LoadingOverlay,"loadingOverlay");return $.LoadingOverlay(e||{})};App.editor.dialog=function(e){App.loader.defined(typeof BootstrapDialog,"dialog");return BootstrapDialog.show(e||{})};App.editor.contypeAttachers={};App.editor.contypeAttachers.markdown=function(e){App.editor.markdownToHTML(e)};App.editor.contypeAttachers.html=function(e){var t=$(e).find("pre[class^=language-]");if(t.length>0)App.editor.codeHighlight(t)};App.editor.attachContype=function(e){var t=e?$(e):$(document);t.find("[data-contype]:not([contype-attached])").each(function(){$(this).attr("contype-attached","1");var e=$(this).data("contype");if(typeof App.editor.contypeAttachers[e]!="undefined"){App.editor.contypeAttachers[e](this)}})};App.editor.markdownReset=function(){var e=ASSETS_URL+"/js/editor/markdown/";editormd.emoji.path=e+"images/emojis/";editormd.katexURL.css=e+"lib/katex/katex.min";editormd.katexURL.js=e+"lib/katex/katex.min"};App.editor.markdownToHTML=function(i,o,e){if(typeof i=="string"){i=document.querySelector(i);if(!i)return}if($(i).data("markdownRendered"))return;$(i).data("markdownRendered",true);var t=function(e,t){var i={markdown:o,htmlDecode:"style,script,iframe|on*",toc:true,tocm:true,emoji:true,taskList:true,tex:true,flowChart:true,sequenceDiagram:true};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){i.theme="dark"}var r=$.extend({},i,e||{});var a=function(){return t(r)};App.loader.defined(typeof marked,"editormdPreview",function(){if(r.flowChart){return App.loader.defined(typeof flowchart,"flowChart",function(){return App.loader.defined(typeof $.fn.flowChart,"flowChartJQuery",function(){if(r.sequenceDiagram)return App.loader.defined(typeof $.fn.sequenceDiagram,"sequenceDiagram",function(){a()});a()})})}if(needSequenceDiagram){return App.loader.defined(typeof $.fn.sequenceDiagram,"sequenceDiagram",function(){a()})}a()},function(){App.editor.markdownReset()});return r};var r="markdown-render-processing-"+App.utils.unixtime();var a='
';if(o==null||typeof o=="boolean"){var n=$(i),d=$(i).hasClass("markdown-code");if(!o&&!d){n=$(i).find(".markdown-code");if(n.length<1)return}if(d){n.prepend(a)}else{n.first().before(a)}t(e,function(t){n.each(function(){if($(this).children("textarea").length>0){t.markdown=$(this).children("textarea").text()}else{t.markdown=$(this).text()}var e=editormd.markdownToHTML(this,t);$(this).data("markdown-viewer",e)});$("#"+r).remove()});return}$(i).before(a);t(e,function(e){var t=editormd.markdownToHTML(i,e);$(i).data("markdown-viewer",t);$("#"+r).remove()})};App.editor.markdowns=function(e,t,i){$(e).each(function(){App.editor.markdown(this,t,i)})};App.editor.markdown=function(e,t,i){var r=false;if(!t)t=$(e).attr("action");App.loader.defined(typeof editormd,"editormd",null,function(){App.editor.markdownReset()});if(t){if(t.substr(0,1)=="!"){t=t.substr(1);r=true}if(t.indexOf("?")>=0){t+="&"}else{t+="?"}if(!r)t+="format=json&";t+="filetype=image&client=markdown"}var a=function(t){App.editor.finderDialog(App.editor.browsingFileURL+"?from=parent&size=12&filetype=image&multiple=0",function(e){if(e.length<=0){return App.message({type:"error",text:App.t("没有选择任何选项!")})}t.dialog.find("[data-url]").val(e[0])},1e5)};var o=$(e).parent(),n=o.attr("id");if(n===undefined){n="webx-md-"+App.utils.unixtime();o.attr("id",n)}var d=ASSETS_URL+"/js/editor/markdown/";var p={width:"100%",height:o.height(),path:d+"lib/",markdown:$(e).val(),placeholder:$(e).attr("placeholder")||"",codeFold:true,saveHTMLToTextarea:true,searchReplace:true,watch:true,htmlDecode:"style,script,iframe|on*",emoji:true,taskList:true,tocm:true,tex:true,flowChart:true,sequenceDiagram:true,imageUpload:true,imageFormats:["jpg","jpeg","gif","png","bmp"],imageUploadURL:t,imageBrowseFn:a,crossDomainUpload:true,uploadCallbackURL:d+"plugins/image-dialog/upload_callback.htm",dialogLockScreen:false,onload:function(){}};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){p.theme="dark"}var l=$.extend({},p,i||{});if(r){l.toolbarIcons=function(){return["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","browsing-image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"]};l.toolbarIconsClass={"browsing-image":"fa-image"};l.toolbarIconTexts={"browsing-image":App.t("选择图片")};l.toolbarHandlers={"browsing-image":function(n,e,t,i){App.editor.finderDialog(App.editor.browsingFileURL+"?from=parent&size=12&filetype=image&multiple=1",function(e,t){if(e.length<=0){return App.message({type:"error",text:App.t("没有选择任何选项!")})}var i=[];for(var r=0;r0){e=$(this).children("textarea").text()}else{e=$(this).text()}$(this).html(r.render($.trim(e)));$(this).find("pre > code").each(function(){$(this).parent("pre").addClass("prettyprint linenums")});if(typeof prettyPrint!=="undefined")prettyPrint()})};App.editor.markdownItInstance=function(){App.loader.defined(typeof window.markdownit,"markdownit");var e=window.markdownit();if(typeof window.markdownitEmoji!="undefined")e.use(window.markdownitEmoji);return e};App.editor.tinymces=function(e,t,i,r){$(e).each(function(){App.editor.tinymce(this,t,i,r)})};App.editor.finderDialog=function(t,r,i){if(!i)i=2e3;App.loader.defined(typeof BootstrapDialog,"dialog");var e=BootstrapDialog.show({title:App.t("选择文件"),message:function(i){var e="finderDialogCallback"+App.utils.unixtime();window[e]=function(e,t){r(e,t);if(e&&e.length>0)i.close()};return $('')},onshown:function(e){e.$modal.css("zIndex",i);e.$modalBody.css("padding",0)}});return e};App.editor.tinymceOnceFix=false;App.editor.tinymce=function(e,o,t,i){if(!App.editor.tinymceOnceFix){App.editor.tinymceOnceFix=true;$(document).on("focusin",function(e){if($(e.target).closest(".tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length){e.stopImmediatePropagation()}})}App.loader.defined(typeof $.fn.tinymce,"tinymce");if(!o)o=$(e).attr("action");var r=App.editor.browsingFileURL;if(o&&o.substr(0,1)=="!"){r=o.substr(1);o=$(e).data("upload-url")}if(o){if(o.indexOf("?")>=0){o+="&"}else{o+="?"}o+="format=json&client=tinymce&filetype="}if(r){r=r.replace(/[\?&]multiple=1/,"");if(r.indexOf("?")>=0){r+="&"}else{r+="?"}r+="from=parent&client=tinymce&filetype="}var a="undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | customDateButton";var n="undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl | customDateButton";var d=function(i,e,t){switch(t.filetype){case"file":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{text:t[0].name})});break;case"image":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{alt:t[0].name})});break;case"media":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{})});break;default:alert("Unsupported file type")}};var p=function(e,t,i){var r=new XMLHttpRequest,a=new FormData;r.withCredentials=false;r.open("POST",o);r.onload=function(){if(r.status!=200){i("HTTP Error: "+r.status);return}var e=JSON.parse(r.responseText);if(!e||typeof e.Code=="undefined"){i("Invalid JSON: "+r.responseText);return}if(e.Code!=1){i(e.Info);return}t(e.Data.Url)};a.append("filedata",e.blob(),e.filename());r.send(a)};var l="link table";var s="bold italic | quicklink h2 h3 blockquote quicktable";var c="print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable charmap quickbars emoticons";if(o){l+=" image imagetools";s+=" quickimage"}var f={height:i?200:500,menubar:true,language:App.langTag("_"),plugins:[c],toolbar:i?a:n,toolbar_sticky:true,autosave_ask_before_unload:false,autosave_interval:"30s",autosave_prefix:"{path}{query}-{id}-",autosave_restore_when_empty:true,autosave_retention:"2m",image_advtab:true,templates:[{title:"New Table",description:"creates a new table",content:'\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t | \t\t\t\t\t | \t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t | \t\t\t\t\t | \t\t\t\t
\t\t\t\t\t\t
\t\t\t
'}],image_caption:true,relative_urls:false,image_title:true,quickbars_selection_toolbar:s,noneditable_noneditable_class:"mceNonEditable",toolbar_drawer:"sliding",contextmenu:l,setup:function(r){var t=function(e){return'"};r.ui.registry.addButton("customDateButton",{icon:"insert-time",tooltip:"Insert Current Date",disabled:true,onAction:function(e){r.insertContent(t(new Date))},onSetup:function(t){var i=function(e){t.setDisabled(e.element.nodeName.toLowerCase()==="time")};r.on("NodeChange",i);return function(e){r.off("NodeChange",i)}}})}};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){f.skin="oxide-dark";f.content_css="dark"}if(r)f.file_picker_callback=d;if(o)f.images_upload_handler=p;var u=App.utils.elemToId(e).replace(/^#/,"");$(e).tinymce($.extend({},f,t||{}));$(e).data("editor-name","tinymce");var m=tinymce.get(u);$(e).data("editor-object",m)};App.editor.switcher=function(e,r,a){if($(e).length<1)return;var t,i=String($(e).get(0).tagName).toLowerCase();switch(i){case"select":t="change";break;default:t="click"}$(e).on(t,function(){var e=$(this).val();var t=$(r);var i=$(this).data("editor-name")||a;t.data("editor-type",e);return App.editor.switch(i,t)});$(r).data("placeholder",$(r).attr("placeholder"));switch(i){case"input":$(e).filter(":checked").first().trigger(t);break;default:$(e).trigger(t)}};App.editor.switch=function(e,r,t,i){var a=r.attr("action")||r.data("upload-url")||"!"+App.editor.browsingFileURL+"?size=12&multiple=1",o=r.data("editor-type"),n=r.data("editor-name"),d=r.data("editor-object"),p=r.data("current-editor-type");if(p==o)return;var l=r.data("class"),s=r.data("style");if(l===undefined){l=r.attr("class");if(!l)l="";r.data("class",l)}if(s===undefined){s=r.attr("style");if(!s)s="";r.data("style",s)}var c=r.data("content-elem"),f=c;if(c)f=App.loader.parseTmpl(c,{type:o});var u=r.get(0);var m=function(){r.attr("class",l).attr("style",s)};var g=function(){switch(n){case"ueditor":d&&d.destroy();break;case"tinymce":default:d&&typeof d.remove=="function"&&d.remove()}};var h=function(e){var t=r.data(e+"-options")||{};switch(e){case"ueditor":App.editor.ueditor(u,a,t);break;case"tinymce":default:App.editor.tinymce(u,a,t);var i=window.setInterval(function(){if(r.next(".tox-tinymce").length>0){r.next(".tox-tinymce").show();window.clearInterval(i)}},100);break}};var w=function(){var e=r.data("markdown-options")||{};App.editor.markdown(u,a,e)};var y=function(){if(f&&$(f).length>0){var e=App.loader.parseTmpl(c,{type:p});if(e&&$(e).length>0){$(e).text(r.val());var t=$('textarea[name="'+r.parent().attr("id")+'-html-code"]');if(t.length>0&&t.val()!=""){$(f).text(t.val());$(f).val(t.val())}}r.val($(f).val());r.text($(f).val())}r.parent().removeAttr("class").css("height","auto");r.siblings().remove();m()};switch(o){case"markdown":if(i){var v=App.loader.parseTmpl(c,{type:p});if(v&&$(v).length>0){if(r.val()!=$(v).val()&&!confirm("确定要切换吗?切换编辑器将会丢失您当前所做的修改。")){if(t!=null)t();return false}}}if(f&&$(f).length>0){r.text($(f).val());r.val($(f).val())}g();w();r.data("current-editor-type",o);break;case"text":g();y();r.show().focus();r.data("current-editor-type",o);break;default:y();h(e);r.data("current-editor-type","html")}return true};if(typeof App.utils=="undefined")App.utils={};App.utils.elemToId=function(e){if(typeof e!="object"){if(String(e).substring(0,1)!="#"){e="#"+e}return e}var t=$(e).attr("id");if(t)return"#"+t;t="generated-id-"+App.utils.unixtime();$(e).attr("id",t);return"#"+t};App.utils.unixtime=function(){return(new Date).getTime()};App.editor.selectPages=function(){App.loader.defined(typeof $.fn.selectPage,"selectPage");for(var e=0;e=0){t+="&"}else{t+="?"}t+="from=parent&client=fileInput&filetype=image";var o=this;App.editor.finderDialog(t,function(e){var t=e[0];var i=$(o).data("input");if(!i){i=$(o).parent(".input-group-btn").siblings("input")[0]}if(i)$(i).val(t);var r=$(o).data("preview-btn");if(!r){r=$(o).parent(".input-group-btn").siblings(".preview-btn")[0]}if(r){if(!$(r).data("attached-float")){App.float(App.utils.elemToId(r)+" a img");$(r).data("attached-float",true)}$(r).removeClass("hidden").children("a").attr("href",t).children("img").attr("src",t)}var a=$(o).data("preview-img");if(a){$(a).attr("src",t)}if(n)n(t)})})});$(e+'input[data-toggle="uploadPreviewer"]').each(function(){$(this).css("width","70px");var e=$(this).data("preview-container");var t=$(this).data("upload-url");var i=$(this).data("preview-btn");var r=$(this).uploadPreviewer($.extend({buttonText:' '+App.t("上传"),previewTableContainer:e,url:t,previewTableShow:false},a||{}));$(this).data("uploadPreviewer",r);if(i&&!$(i).data("attached-float")){App.float(App.utils.elemToId(i)+" a img");$(i).data("attached-float",true)}$(this).on("file-preview:changed",function(o){$(o.target).data("uploadPreviewer").submit(function(e){if(e.Code!=1){if(d)d(e);return App.message({text:e.Info,type:"error"})}var t=e.Data.files[0];var i=$(o.target).data("input");if(!i){i=$(o.target).parents(".input-group-btn").prev("input")[0]}$(i).val(t);var r=$(o.target).data("preview-btn");if(!r){r=$(o.target).parents(".input-group-btn").siblings(".preview-btn")[0]}if(r){if(!$(r).data("attached-float")){App.float(App.utils.elemToId(r)+" a img");$(r).data("attached-float",true)}$(r).removeClass("hidden").children("a").attr("href",t).children("img").attr("src",t)}var a=$(o.target).data("preview-img");if(a){$(a).attr("src",t)}if(n)n(t);App.message({text:App.t("上传成功"),type:"success"})},function(){if(d)d()})})})};App.editor.codemirror=function(l,s,c){if($(l).length<1)return null;var e=function(){if($(l).data("codemirror"))return;var e={lineNumbers:true,lineWrapping:true,lineWrapping:true,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],autoCloseTags:true,autoCloseBrackets:true,showTrailingSpace:true,indentWithTabs:true,matchBrackets:true,styleActiveLine:true,styleSelectedText:true,highlightSelectionMatches:true,smartIndent:true,mode:"text/x-csrc",width:null,height:null,hintOptions:{completeSingle:false}};var t=$.extend(e,s||{});var i=$(l)[0].tagName.toUpperCase()=="TEXTAREA"?CodeMirror.fromTextArea($(l)[0],t):CodeMirror($(l)[0],t);var r=t.mode,a={"text/x-csrc":"clike","text/css":"css","text/x-mysql":"sql","text/x-mssql":"sql","text/x-markdown":"markdown","text/x-yaml":"yaml","text/x-toml":"toml","text/javascript":"javascript","application/javascript":"javascript","text/json":"javascript","text/html":"html","message/http":"http",null:"null"};if(c&&typeof c=="object"){a=$.extend(a,c);c=null}if(!c){if(t.mode in a){c=a[t.mode]}else{if(typeof CodeMirror.modeInfo!=="undefined"){for(var o=0;o=0?"&":"?";e.url+=p+"client=dropzone"}var l=$(r).dropzone($.extend({paramName:"file",maxFilesize:.5,acceptedFiles:"image/*",dictDefaultMessage:'\t\t \t\t'+App.t("点击此处或拖动文件到这里开始上传")+'
\t\t\t\t
',dictResponseError:App.t("上传文件出错!"),dictCancelUpload:App.t("取消"),dictRemoveFile:App.t("删除")},e||{}));var s=l[0].dropzone;s.on("success",function(e,t,i){if(t.error){if(typeof t.error.message!="undefined")t.error=t.error.message;if(o)o.call(this,e,t.error);return App.message({text:t.error,type:"error"})}if(a)a.apply(this,arguments);else $(r).trigger("dropzone.success",arguments)}).on("removedfile",function(e){if(t)t.apply(this,arguments);else $(r).trigger("dropzone.removedfile",arguments)}).on("error",function(e,t,i){if(o)o.apply(this,arguments);else $(r).trigger("dropzone.error",arguments)});if(i){s.on("processing",function(e){s.options.url=e.uploadURL})}$(r).data("dropzone",s);return s};App.editor.dateRangePicker=function(e,t){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.daterangepicker(e,t)};App.editor.dateRangePickerx=function(e,t,i,r){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.daterangepickerx(e,t,i,r)};App.editor.datePicker=function(e,t){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.datepicker(e,t)};App.editor.popup=function(e,t){if(e==null)e=".image-zoom";var i={type:"image",mainClass:"mfp-with-zoom",zoom:{enabled:true,duration:300,easing:"ease-in-out",opener:function(e){var t=$(e);return t}}};App.loader.defined(typeof $.fn.magnificPopup,"magnificPopup",function(){$(e).magnificPopup($.extend(i,t||{}))})};App.editor.inputmask=function(e,t){App.loader.defined(typeof $.fn.inputmask,"inputmask",function(){$(e).inputmask(t)})};App.editor.clipboard=function(e,t){App.loader.defined(typeof ClipboardJS,"clipboard",function(){attachCopy(e,t)})};
\ No newline at end of file
+App.loader.libs.editormdPreview=["#editor/markdown/lib/marked.min.js","#editor/markdown/lib/prettify.min.js","#editor/markdown/lib/raphael.min.js","#editor/markdown/lib/underscore.min.js","#editor/markdown/css/editormd.preview.min.css","#editor/markdown/editormd.min.js"];App.loader.libs.codemirror=["#editor/markdown/lib/codemirror/codemirror.min.css","#editor/markdown/lib/codemirror/addon/fold/foldgutter.css","#editor/markdown/lib/codemirror/addon/hint/show-hint.css","#editor/markdown/lib/codemirror/theme/ambiance.css","#editor/markdown/lib/codemirror/codemirror.min.js","#editor/markdown/lib/codemirror/modes.min.js","#editor/markdown/lib/codemirror/addons.min.js","#editor/markdown/lib/codemirror/addon/hint/show-hint.js"];App.loader.libs.editormd=["#editor/markdown/css/editormd.min.css","#editor/markdown/css/editormd.preview.min.css","#editor/markdown/editormd.min.js"];App.loader.libs.flowChart=["#editor/markdown/lib/flowchart.min.js"];App.loader.libs.flowChartJQuery=["#editor/markdown/lib/jquery.flowchart.min.js"];App.loader.libs.sequenceDiagram=["#editor/markdown/lib/sequence-diagram.min.js"];App.loader.libs.tinymce=["#editor/tinymce/custom.css","#editor/tinymce/tinymce.min.js","#editor/tinymce/jquery.tinymce.min.js","#editor/tinymce/langs/"+App.langTag("_")+".js"];App.loader.libs.dialog=["#dialog/bootstrap-dialog.min.css","#dialog/bootstrap-dialog.min.js"];App.loader.libs.markdownit=["#markdown/it/markdown-it.min.js","#markdown/it/plugins/emoji/markdown-it-emoji.min.js"];App.loader.libs.codehighlight=["#markdown/it/plugins/highlight/loader/prettify.js","#markdown/it/plugins/highlight/loader/run_prettify.js?skin=sons-of-obsidian"];App.loader.libs.powerFloat=["#float/powerFloat.min.css","#float/powerFloat.min.js"];App.loader.libs.uploadPreviewer=["#jquery.uploadPreviewer/css/jquery.uploadPreviewer.min.css","#jquery.uploadPreviewer/jquery.uploadPreviewer.min.js"];App.loader.libs.fileUpload=["#jquery.upload/js/vendor/jquery.ui.widget.min.js","#jquery.upload/js/jquery.iframe-transport.min.js","#jquery.upload/js/jquery.fileupload.min.js","#jquery.upload/js/jquery.fileupload-process.min.js"];App.loader.libs.jcrop=["#jquery.crop/css/jquery.Jcrop.min.css","#jquery.crop/js/jquery.Jcrop.min.js"];App.loader.libs.cropImage=["#jquery.crop/css/jquery.Jcrop.min.css","#jquery.crop/js/jquery.Jcrop.min.js","#behavior/page/crop-image.min.js"];App.loader.libs.select2=["#jquery.select2/select2.css","#jquery.select2/select2.min.js"];App.loader.libs.select2ex=["#behaviour/page/select2.min.js"];App.loader.libs.selectPage=["#selectpage/selectpage.css","#selectpage/selectpage.min.js"];App.loader.libs.cascadeSelect=["#behaviour/page/cascade-select.min.js"];App.loader.libs.forms=["#behaviour/page/forms.min.js"];App.loader.libs.jqueryui=["#jquery.ui/jquery-ui.custom.min.js","#jquery.ui/jquery-ui.touch-punch.min.js"];App.loader.libs.dropzone=["#jquery.ui/css/dropzone.min.css","#dropzone/dropzone.min.js"];App.loader.libs.loadingOverlay=["#loadingoverlay/loadingoverlay.min.js"];App.loader.libs.dateRangePicker=["#daterangepicker/daterangepicker.min.css","#daterangepicker/moment.min.js","#daterangepicker/jquery.daterangepicker.min.js","#behaviour/page/datetime.min.js"];App.loader.libs.magnificPopup=["#magnific-popup/magnific-popup.min.css","#magnific-popup/jquery.magnific-popup.min.js"];App.loader.libs.inputmask=["#inputmask/inputmask.min.js","#inputmask/jquery.inputmask.min.js"];App.loader.libs.clipboard=["#clipboard/clipboard.min.js","#clipboard/utils.js"];App.editor={browsingFileURL:App.loader.siteURL+(typeof window.IS_BACKEND!=="undefined"&&window.IS_BACKEND?BACKEND_URL:FRONTEND_URL+"/user/file")+"/finder"};App.editor.loadingOverlay=function(e){App.loader.defined(typeof $.fn.LoadingOverlay,"loadingOverlay");return $.LoadingOverlay(e||{})};App.editor.dialog=function(e){App.loader.defined(typeof BootstrapDialog,"dialog");return BootstrapDialog.show(e||{})};App.editor.contypeAttachers={};App.editor.contypeAttachers.markdown=function(e){App.editor.markdownToHTML(e)};App.editor.contypeAttachers.html=function(e){var t=$(e).find("pre[class^=language-]");if(t.length>0)App.editor.codeHighlight(t)};App.editor.attachContype=function(e){var t=e?$(e):$(document);t.find("[data-contype]:not([contype-attached])").each(function(){$(this).attr("contype-attached","1");var e=$(this).data("contype");if(typeof App.editor.contypeAttachers[e]!="undefined"){App.editor.contypeAttachers[e](this)}})};App.editor.markdownReset=function(){var e=ASSETS_URL+"/js/editor/markdown/";editormd.emoji.path=e+"images/emojis/";editormd.katexURL.css=e+"lib/katex/katex.min";editormd.katexURL.js=e+"lib/katex/katex.min"};App.editor.markdownToHTML=function(i,o,e){if(typeof i=="string"){i=document.querySelector(i);if(!i)return}if($(i).data("markdownRendered"))return;$(i).data("markdownRendered",true);var t=function(e,t){var i={markdown:o,htmlDecode:"style,script,iframe|on*",toc:true,tocm:true,emoji:true,taskList:true,tex:true,flowChart:true,sequenceDiagram:true};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){i.theme="dark"}var r=$.extend({},i,e||{});var a=function(){return t(r)};App.loader.defined(typeof marked,"editormdPreview",function(){if(r.flowChart){return App.loader.defined(typeof flowchart,"flowChart",function(){return App.loader.defined(typeof $.fn.flowChart,"flowChartJQuery",function(){if(r.sequenceDiagram)return App.loader.defined(typeof $.fn.sequenceDiagram,"sequenceDiagram",function(){a()});a()})})}if(needSequenceDiagram){return App.loader.defined(typeof $.fn.sequenceDiagram,"sequenceDiagram",function(){a()})}a()},function(){App.editor.markdownReset()});return r};var r="markdown-render-processing-"+App.utils.unixtime();var a='
';if(o==null||typeof o=="boolean"){var n=$(i),d=$(i).hasClass("markdown-code");if(!o&&!d){n=$(i).find(".markdown-code");if(n.length<1)return}if(d){n.prepend(a)}else{n.first().before(a)}t(e,function(t){n.each(function(){if($(this).children("textarea").length>0){t.markdown=$(this).children("textarea").text()}else{t.markdown=$(this).text()}var e=editormd.markdownToHTML(this,t);$(this).data("markdown-viewer",e)});$("#"+r).remove()});return}$(i).before(a);t(e,function(e){var t=editormd.markdownToHTML(i,e);$(i).data("markdown-viewer",t);$("#"+r).remove()})};App.editor.markdowns=function(e,t,i){$(e).each(function(){App.editor.markdown(this,t,i)})};App.editor.markdown=function(e,t,i){var r=false;if(!t)t=$(e).attr("action");App.loader.defined(typeof editormd,"editormd",null,function(){App.editor.markdownReset()});if(t){if(t.substr(0,1)=="!"){t=t.substr(1);r=true}if(t.indexOf("?")>=0){t+="&"}else{t+="?"}if(!r)t+="format=json&";t+="filetype=image&client=markdown"}var a=function(t){App.editor.finderDialog(App.editor.browsingFileURL+"?from=parent&size=12&filetype=image&multiple=0",function(e){if(e.length<=0){return App.message({type:"error",text:App.t("没有选择任何选项!")})}t.dialog.find("[data-url]").val(e[0])},1e5)};var o=$(e).parent(),n=o.attr("id");if(n===undefined){n="webx-md-"+App.utils.unixtime();o.attr("id",n)}var d=ASSETS_URL+"/js/editor/markdown/";var p={width:"100%",height:o.height(),path:d+"lib/",markdown:$(e).val(),placeholder:$(e).attr("placeholder")||"",codeFold:true,saveHTMLToTextarea:true,searchReplace:true,watch:true,htmlDecode:"style,script,iframe|on*",emoji:true,taskList:true,tocm:true,tex:true,flowChart:true,sequenceDiagram:true,imageUpload:true,imageFormats:["jpg","jpeg","gif","png","bmp"],imageUploadURL:t,imageBrowseFn:a,crossDomainUpload:true,uploadCallbackURL:d+"plugins/image-dialog/upload_callback.htm",dialogLockScreen:false,onload:function(){var e=this;editormd.loadPlugin(d+"plugins/drop-or-paste-upload/drop-or-paste-upload",function(){e.dropOrPasteUpload()})}};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){p.theme="dark"}var l=$.extend({},p,i||{});if(r){l.toolbarIcons=function(){return["undo","redo","|","bold","del","italic","quote","ucwords","uppercase","lowercase","|","h1","h2","h3","h4","h5","h6","|","list-ul","list-ol","hr","|","link","reference-link","browsing-image","code","preformatted-text","code-block","table","datetime","emoji","html-entities","pagebreak","|","goto-line","watch","preview","fullscreen","clear","search","|","help","info"]};l.toolbarIconsClass={"browsing-image":"fa-image"};l.toolbarIconTexts={"browsing-image":App.t("选择图片")};l.toolbarHandlers={"browsing-image":function(n,e,t,i){App.editor.finderDialog(App.editor.browsingFileURL+"?from=parent&size=12&filetype=image&multiple=1",function(e,t){if(e.length<=0){return App.message({type:"error",text:App.t("没有选择任何选项!")})}var i=[];for(var r=0;r0){e=$(this).children("textarea").text()}else{e=$(this).text()}$(this).html(r.render($.trim(e)));$(this).find("pre > code").each(function(){$(this).parent("pre").addClass("prettyprint linenums")});if(typeof prettyPrint!=="undefined")prettyPrint()})};App.editor.markdownItInstance=function(){App.loader.defined(typeof window.markdownit,"markdownit");var e=window.markdownit();if(typeof window.markdownitEmoji!="undefined")e.use(window.markdownitEmoji);return e};App.editor.tinymces=function(e,t,i,r){$(e).each(function(){App.editor.tinymce(this,t,i,r)})};App.editor.finderDialog=function(t,r,i){if(!i)i=2e3;App.loader.defined(typeof BootstrapDialog,"dialog");var e=BootstrapDialog.show({title:App.t("选择文件"),message:function(i){var e="finderDialogCallback"+App.utils.unixtime();window[e]=function(e,t){r(e,t);if(e&&e.length>0)i.close()};return $('')},onshown:function(e){e.$modal.css("zIndex",i);e.$modalBody.css("padding",0)}});return e};App.editor.tinymceOnceFix=false;App.editor.tinymce=function(e,o,t,i){if(!App.editor.tinymceOnceFix){App.editor.tinymceOnceFix=true;$(document).on("focusin",function(e){if($(e.target).closest(".tox-tinymce-aux, .moxman-window, .tam-assetmanager-root").length){e.stopImmediatePropagation()}})}App.loader.defined(typeof $.fn.tinymce,"tinymce");if(!o)o=$(e).attr("action");var r=App.editor.browsingFileURL;if(o&&o.substr(0,1)=="!"){r=o.substr(1);o=$(e).data("upload-url")}if(o){if(o.indexOf("?")>=0){o+="&"}else{o+="?"}o+="format=json&client=tinymce&filetype="}if(r){r=r.replace(/[\?&]multiple=1/,"");if(r.indexOf("?")>=0){r+="&"}else{r+="?"}r+="from=parent&client=tinymce&filetype="}var a="undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | customDateButton";var n="undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl | customDateButton";var d=function(i,e,t){switch(t.filetype){case"file":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{text:t[0].name})});break;case"image":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{alt:t[0].name})});break;case"media":App.editor.finderDialog(r+t.filetype,function(e,t){if(e&&e.length>0)i(e[0],{})});break;default:alert("Unsupported file type")}};var p=function(e,t,i){var r=new XMLHttpRequest,a=new FormData;r.withCredentials=false;r.open("POST",o);r.onload=function(){if(r.status!=200){i("HTTP Error: "+r.status);return}var e=JSON.parse(r.responseText);if(!e||typeof e.Code=="undefined"){i("Invalid JSON: "+r.responseText);return}if(e.Code!=1){i(e.Info);return}t(e.Data.Url)};a.append("filedata",e.blob(),e.filename());r.send(a)};var l="link table";var s="bold italic | quicklink h2 h3 blockquote quicktable";var c="print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable charmap quickbars emoticons";if(o){l+=" image imagetools";s+=" quickimage"}var f={height:i?200:500,menubar:true,language:App.langTag("_"),plugins:[c],toolbar:i?a:n,toolbar_sticky:true,autosave_ask_before_unload:false,autosave_interval:"30s",autosave_prefix:"{path}{query}-{id}-",autosave_restore_when_empty:true,autosave_retention:"2m",image_advtab:true,templates:[{title:"New Table",description:"creates a new table",content:'\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t | \t\t\t\t\t | \t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t | \t\t\t\t\t | \t\t\t\t
\t\t\t\t\t\t
\t\t\t
'}],image_caption:true,relative_urls:false,image_title:true,quickbars_selection_toolbar:s,noneditable_noneditable_class:"mceNonEditable",toolbar_drawer:"sliding",contextmenu:l,setup:function(r){var t=function(e){return'"};r.ui.registry.addButton("customDateButton",{icon:"insert-time",tooltip:"Insert Current Date",disabled:true,onAction:function(e){r.insertContent(t(new Date))},onSetup:function(t){var i=function(e){t.setDisabled(e.element.nodeName.toLowerCase()==="time")};r.on("NodeChange",i);return function(e){r.off("NodeChange",i)}}})}};if(typeof window.THEME_COLOR=="string"&&window.THEME_COLOR=="dark"){f.skin="oxide-dark";f.content_css="dark"}if(r)f.file_picker_callback=d;if(o)f.images_upload_handler=p;var u=App.utils.elemToId(e).replace(/^#/,"");$(e).tinymce($.extend({},f,t||{}));$(e).data("editor-name","tinymce");var m=tinymce.get(u);$(e).data("editor-object",m)};App.editor.switcher=function(e,r,a){if($(e).length<1)return;var t,i=String($(e).get(0).tagName).toLowerCase();switch(i){case"select":t="change";break;default:t="click"}$(e).on(t,function(){var e=$(this).val();var t=$(r);var i=$(this).data("editor-name")||a;t.data("editor-type",e);return App.editor.switch(i,t)});$(r).data("placeholder",$(r).attr("placeholder"));switch(i){case"input":$(e).filter(":checked").first().trigger(t);break;default:$(e).trigger(t)}};App.editor.switch=function(e,r,t,i){var a=r.attr("action")||r.data("upload-url")||"!"+App.editor.browsingFileURL+"?size=12&multiple=1",o=r.data("editor-type"),n=r.data("editor-name"),d=r.data("editor-object"),p=r.data("current-editor-type");if(p==o)return;var l=r.data("class"),s=r.data("style");if(l===undefined){l=r.attr("class");if(!l)l="";r.data("class",l)}if(s===undefined){s=r.attr("style");if(!s)s="";r.data("style",s)}var c=r.data("content-elem"),f=c;if(c)f=App.loader.parseTmpl(c,{type:o});var u=r.get(0);var m=function(){r.attr("class",l).attr("style",s)};var g=function(){switch(n){case"ueditor":d&&d.destroy();break;case"tinymce":default:d&&typeof d.remove=="function"&&d.remove()}};var h=function(e){var t=r.data(e+"-options")||{};switch(e){case"ueditor":App.editor.ueditor(u,a,t);break;case"tinymce":default:App.editor.tinymce(u,a,t);var i=window.setInterval(function(){if(r.next(".tox-tinymce").length>0){r.next(".tox-tinymce").show();window.clearInterval(i)}},100);break}};var w=function(){var e=r.data("markdown-options")||{};App.editor.markdown(u,a,e)};var y=function(){if(f&&$(f).length>0){var e=App.loader.parseTmpl(c,{type:p});if(e&&$(e).length>0){$(e).text(r.val());var t=$('textarea[name="'+r.parent().attr("id")+'-html-code"]');if(t.length>0&&t.val()!=""){$(f).text(t.val());$(f).val(t.val())}}r.val($(f).val());r.text($(f).val())}r.parent().removeAttr("class").css("height","auto");r.siblings().remove();m()};switch(o){case"markdown":if(i){var v=App.loader.parseTmpl(c,{type:p});if(v&&$(v).length>0){if(r.val()!=$(v).val()&&!confirm("确定要切换吗?切换编辑器将会丢失您当前所做的修改。")){if(t!=null)t();return false}}}if(f&&$(f).length>0){r.text($(f).val());r.val($(f).val())}g();w();r.data("current-editor-type",o);break;case"text":g();y();r.show().focus();r.data("current-editor-type",o);break;default:y();h(e);r.data("current-editor-type","html")}return true};if(typeof App.utils=="undefined")App.utils={};App.utils.elemToId=function(e){if(typeof e!="object"){if(String(e).substring(0,1)!="#"){e="#"+e}return e}var t=$(e).attr("id");if(t)return"#"+t;t="generated-id-"+App.utils.unixtime();$(e).attr("id",t);return"#"+t};App.utils.unixtime=function(){return(new Date).getTime()};App.editor.selectPages=function(){App.loader.defined(typeof $.fn.selectPage,"selectPage");for(var e=0;e=0){t+="&"}else{t+="?"}t+="from=parent&client=fileInput&filetype=image";var o=this;App.editor.finderDialog(t,function(e){var t=e[0];var i=$(o).data("input");if(!i){i=$(o).parent(".input-group-btn").siblings("input")[0]}if(i)$(i).val(t);var r=$(o).data("preview-btn");if(!r){r=$(o).parent(".input-group-btn").siblings(".preview-btn")[0]}if(r){if(!$(r).data("attached-float")){App.float(App.utils.elemToId(r)+" a img");$(r).data("attached-float",true)}$(r).removeClass("hidden").children("a").attr("href",t).children("img").attr("src",t)}var a=$(o).data("preview-img");if(a){$(a).attr("src",t)}if(n)n(t)})})});$(e+'input[data-toggle="uploadPreviewer"]').each(function(){$(this).css("width","70px");var e=$(this).data("preview-container");var t=$(this).data("upload-url");var i=$(this).data("preview-btn");var r=$(this).uploadPreviewer($.extend({buttonText:' '+App.t("上传"),previewTableContainer:e,url:t,previewTableShow:false},a||{}));$(this).data("uploadPreviewer",r);if(i&&!$(i).data("attached-float")){App.float(App.utils.elemToId(i)+" a img");$(i).data("attached-float",true)}$(this).on("file-preview:changed",function(o){$(o.target).data("uploadPreviewer").submit(function(e){if(e.Code!=1){if(d)d(e);return App.message({text:e.Info,type:"error"})}var t=e.Data.files[0];var i=$(o.target).data("input");if(!i){i=$(o.target).parents(".input-group-btn").prev("input")[0]}$(i).val(t);var r=$(o.target).data("preview-btn");if(!r){r=$(o.target).parents(".input-group-btn").siblings(".preview-btn")[0]}if(r){if(!$(r).data("attached-float")){App.float(App.utils.elemToId(r)+" a img");$(r).data("attached-float",true)}$(r).removeClass("hidden").children("a").attr("href",t).children("img").attr("src",t)}var a=$(o.target).data("preview-img");if(a){$(a).attr("src",t)}if(n)n(t);App.message({text:App.t("上传成功"),type:"success"})},function(){if(d)d()})})})};App.editor.codemirror=function(l,s,c){if($(l).length<1)return null;var e=function(){if($(l).data("codemirror"))return;var e={lineNumbers:true,lineWrapping:true,lineWrapping:true,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter"],autoCloseTags:true,autoCloseBrackets:true,showTrailingSpace:true,indentWithTabs:true,matchBrackets:true,styleActiveLine:true,styleSelectedText:true,highlightSelectionMatches:true,smartIndent:true,mode:"text/x-csrc",width:null,height:null,hintOptions:{completeSingle:false}};var t=$.extend(e,s||{});var i=$(l)[0].tagName.toUpperCase()=="TEXTAREA"?CodeMirror.fromTextArea($(l)[0],t):CodeMirror($(l)[0],t);var r=t.mode,a={"text/x-csrc":"clike","text/css":"css","text/x-mysql":"sql","text/x-mssql":"sql","text/x-markdown":"markdown","text/x-yaml":"yaml","text/x-toml":"toml","text/javascript":"javascript","application/javascript":"javascript","text/json":"javascript","text/html":"html","message/http":"http",null:"null"};if(c&&typeof c=="object"){a=$.extend(a,c);c=null}if(!c){if(t.mode in a){c=a[t.mode]}else{if(typeof CodeMirror.modeInfo!=="undefined"){for(var o=0;o=0?"&":"?";e.url+=p+"client=dropzone"}var l=$(r).dropzone($.extend({paramName:"file",maxFilesize:.5,acceptedFiles:"image/*",dictDefaultMessage:'\t\t \t\t'+App.t("点击此处或拖动文件到这里开始上传")+'
\t\t\t\t
',dictResponseError:App.t("上传文件出错!"),dictCancelUpload:App.t("取消"),dictRemoveFile:App.t("删除")},e||{}));var s=l[0].dropzone;s.on("success",function(e,t,i){if(t.error){if(typeof t.error.message!="undefined")t.error=t.error.message;if(o)o.call(this,e,t.error);return App.message({text:t.error,type:"error"})}if(a)a.apply(this,arguments);else $(r).trigger("dropzone.success",arguments)}).on("removedfile",function(e){if(t)t.apply(this,arguments);else $(r).trigger("dropzone.removedfile",arguments)}).on("error",function(e,t,i){if(o)o.apply(this,arguments);else $(r).trigger("dropzone.error",arguments)});if(i){s.on("processing",function(e){s.options.url=e.uploadURL})}$(r).data("dropzone",s);return s};App.editor.dateRangePicker=function(e,t){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.daterangepicker(e,t)};App.editor.dateRangePickerx=function(e,t,i,r){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.daterangepickerx(e,t,i,r)};App.editor.datePicker=function(e,t){App.loader.defined(typeof App.daterangepicker,"dateRangePicker");return App.datepicker(e,t)};App.editor.popup=function(e,t){if(e==null)e=".image-zoom";var i={type:"image",mainClass:"mfp-with-zoom",zoom:{enabled:true,duration:300,easing:"ease-in-out",opener:function(e){var t=$(e);return t}}};App.loader.defined(typeof $.fn.magnificPopup,"magnificPopup",function(){$(e).magnificPopup($.extend(i,t||{}))})};App.editor.inputmask=function(e,t){App.loader.defined(typeof $.fn.inputmask,"inputmask",function(){$(e).inputmask(t)})};App.editor.clipboard=function(e,t){App.loader.defined(typeof ClipboardJS,"clipboard",function(){attachCopy(e,t)})};
\ No newline at end of file
diff --git a/public/assets/backend/js/editor/markdown/plugins/drop-or-paste-upload/drop-or-paste-upload.js b/public/assets/backend/js/editor/markdown/plugins/drop-or-paste-upload/drop-or-paste-upload.js
new file mode 100644
index 0000000000..7ab66c7245
--- /dev/null
+++ b/public/assets/backend/js/editor/markdown/plugins/drop-or-paste-upload/drop-or-paste-upload.js
@@ -0,0 +1,125 @@
+/*!
+ * editormd附件拖拽和图片粘贴上传插件
+ *
+ * @file drop-or-paste-upload.js
+ * @author admpub
+ * @date 2024年10月04日
+ * @link https://github.com/admpub/nging
+ * 引入方式:
+ * settings.onload = function() {
+ * var _this=this;
+ editormd.loadPlugin("../plugins/drop-or-paste-upload/drop-or-paste-upload", function(){
+ _this.dropOrPasteUpload();
+ });
+ }
+ */
+
+(function () {
+
+ var factory = function (exports) {
+ var $ = jQuery; // if using module loader(Require.js/Sea.js).
+ var pluginName = "drop-or-paste-upload"; // 定义插件名称
+ // ajax上传图片 可自行处理
+ function _ajax(url, data, callback) {
+ $.ajax({
+ "type": 'post',
+ "cache": false,
+ "url": url,
+ "data": data,
+ "processData": false,
+ "contentType": false,
+ "dataType": 'json',
+ "mimeType": "multipart/form-data",
+ success: callback,
+ error: function (err) {
+ console.error('请求失败:', err)
+ }
+ })
+ };
+ function _isImage(file) {
+ return file.type.indexOf('image/') === 0;
+ }
+ function upload(file) {
+ // File { name: "mrvx5eugoqb.jpg", lastModified: 1533178146229, webkitRelativePath: "", size: 261784, type: "image/jpeg" }
+ var _this = this, isImage = _isImage(file),
+ forms = new FormData(), fileName = new Date().getTime() + "." + file.name.split(".").pop();
+ forms.append(_this.classPrefix + "image-file", file, fileName);
+ _ajax(_this.settings.imageUploadURL, forms, function (ret) {
+ if (ret.success == 1) {
+ var url = ret.url;
+ if (isImage) {
+ _this.cm.replaceSelection("![](" + url + ")");
+ } else {
+ _this.cm.replaceSelection("[下载附件](" + url + ")");
+ }
+ } else {
+ alert(ret.message);
+ }
+ })
+ }
+ exports.fn.dropOrPasteUpload = function () {
+ var _this = this;
+ var settings = _this.settings;
+ var id = _this.id;
+
+ if (!settings.imageUpload || !settings.imageUploadURL) {
+ console.log('你还未开启图片上传或者没有配置上传地址');
+ return false;
+ }
+
+ //监听粘贴板事件
+ var $textarea = $('#' + id);
+ $textarea.on('paste', function (e) {
+ var items = (e.clipboardData || e.originalEvent.clipboardData || window.clipboardData).items;
+ //判断图片类型
+ if (items && items.length) {
+ var file = null;
+ for (var i = 0; i < items.length; i++) {
+ if (_isImage(items[i])) {
+ file = items[i].getAsFile();
+ break;
+ }
+ }
+
+ if (!file) {
+ console.log("粘贴内容非图片");
+ return;
+ }
+ upload.call(_this, file);
+ }
+ });
+ $textarea.on("dragover dragenter", function (e) {
+ e.preventDefault()
+ e.stopPropagation()
+ });
+ $textarea.on("drop", function (e) {
+ e.preventDefault()
+ e.stopPropagation()
+ var files = this.files || e.originalEvent.dataTransfer.files;
+ upload.call(_this, files[0]);
+ });
+ };
+ };
+
+ // CommonJS/Node.js
+ if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
+ module.exports = factory;
+ }
+ else if (typeof define === "function") // AMD/CMD/Sea.js
+ {
+ if (define.amd) { // for Require.js
+ define(["editormd"], function (editormd) {
+ factory(editormd);
+ });
+
+ } else { // for Sea.js
+ define(function (require) {
+ var editormd = require("../../editormd");
+ factory(editormd);
+ });
+ }
+ } else {
+ factory(window.editormd);
+ }
+
+})();
\ No newline at end of file
diff --git a/public/assets/backend/js/editor/markdown/plugins/image-handle-paste/image-handle-paste.js b/public/assets/backend/js/editor/markdown/plugins/image-handle-paste/image-handle-paste.js
deleted file mode 100644
index 79520093cb..0000000000
--- a/public/assets/backend/js/editor/markdown/plugins/image-handle-paste/image-handle-paste.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*!
- * editormd图片粘贴上传插件
- *
- * @file image-handle-paste.js
- * @author zhangkaixing
- * @modify stray_came
- * @date 2020年5月29日
- * @link https://www.codehui.net, https://boywithacoin.cn/
- * 引入方式:
- * settings.onload = function() {
- // 引入插件 执行监听方法
- editormd.loadPlugin("../plugins/image-handle-paste/image-handle-paste", function(){
- testEditor.imagePaste();
- });
- }
- */
-
-(function () {
-
- var factory = function (exports) {
- var $ = jQuery; // if using module loader(Require.js/Sea.js).
- var pluginName = "image-handle-paste"; // 定义插件名称
-
- //图片粘贴上传方法
- exports.fn.imagePaste = function () {
- var _this = this;
- var cm = _this.cm;
- var settings = _this.settings;
- var editor = _this.editor;
- var classPrefix = _this.classPrefix;
- var id = _this.id;
-
- if (!settings.imageUpload || !settings.imageUploadURL) {
- console.log('你还未开启图片上传或者没有配置上传地址');
- return false;
- }
-
- //监听粘贴板事件
- $('#' + id).on('paste', function (e) {
- var items = (e.clipboardData || e.originalEvent.clipboardData).items;
- console.log(items[0], items[1])
-
- //判断图片类型
- if (items && (items[0].type.indexOf('image') > -1 || items[1].type.indexOf('image') > -1)) {
- var file;
- if (items[0].type.indexOf('image') > -1) {
- file = items[0].getAsFile();
- } else {
- file = items[1].getAsFile();
- }
-
- /*生成blob
- var blobImg = URL.createObjectURL(file);
- */
-
- /*base64
- var reader = new FileReader();
- reader.readAsDataURL(file);
- reader.onload = function (e) {
- var base64Img = e.target.result //图片的base64
- }
- */
-
- // 创建FormData对象进行ajax上传
- var forms = new FormData(document.forms[0]); //Filename
- forms.append(classPrefix + "image-file", file, "file_" + Date.parse(new Date()) + ".png"); // 文件
- console.log(classPrefix + "image-file", file, "file_" + Date.parse(new Date()) + ".png")
- //调用imageDialog插件,弹出对话框
- _this.executePlugin("imageDialog", "image-dialog/image-dialog");
-
- _ajax(settings.imageUploadURL, forms, function (ret) {
- if (ret.success == 1) {
- //数据格式可以自定义,但需要把图片地址写入到该节点里面
- $("." + classPrefix + "image-dialog").find("input[data-url]").val(ret.url);
- // cm.replaceSelection("![](" + ret.url + ")");
- }
- console.log(ret.message);
- })
- }
- })
- };
- // ajax上传图片 可自行处理
- var _ajax = function (url, data, callback) {
- $.ajax({
- "type": 'post',
- "cache": false,
- "url": url,
- "data": data,
- "processData": false,
- "contentType": false,
- "mimeType": "multipart/form-data",
- success: function (ret) {
- callback(JSON.parse(ret));
- },
- error: function (err) {
- console.log('请求失败')
- }
- })
- }
- };
-
- // CommonJS/Node.js
- if (typeof require === "function" && typeof exports === "object" && typeof module === "object") {
- module.exports = factory;
- }
- else if (typeof define === "function") // AMD/CMD/Sea.js
- {
- if (define.amd) { // for Require.js
- define(["editormd"], function (editormd) {
- factory(editormd);
- });
-
- } else { // for Sea.js
- define(function (require) {
- var editormd = require("../../editormd");
- factory(editormd);
- });
- }
- } else {
- factory(window.editormd);
- }
-
-})();
\ No newline at end of file