md/js/app.17967f62.js

4 lines
58 KiB
JavaScript
Raw Normal View History

(function(e){function t(t){for(var o,a,s=t[0],c=t[1],l=t[2],d=0,f=[];d<s.length;d++)a=s[d],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&f.push(i[a][0]),i[a]=0;for(o in c)Object.prototype.hasOwnProperty.call(c,o)&&(e[o]=c[o]);u&&u(t);while(f.length)f.shift()();return r.push.apply(r,l||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],o=!0,s=1;s<n.length;s++){var c=n[s];0!==i[c]&&(o=!1)}o&&(r.splice(t--,1),e=a(a.s=n[0]))}return e}var o={},i={app:0},r=[];function a(t){if(o[t])return o[t].exports;var n=o[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,a),n.l=!0,n.exports}a.m=e,a.c=o,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)a.d(n,o,function(t){return e[t]}.bind(null,o));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/md/";var s=window["webpackJsonp"]=window["webpackJsonp"]||[],c=s.push.bind(s);s.push=t,s=s.slice();for(var l=0;l<s.length;l++)t(s[l]);var u=c;r.push([0,"chunk-vendors"]),n()})({0:function(e,t,n){e.exports=n("56d7")},"0a9a":function(e,t,n){"use strict";var o=n("5a6c"),i=n.n(o);i.a},1:function(e,t){},"38c7":function(e,t,n){},"3a5e":function(e,t,n){"use strict";var o=n("7268"),i=n("cb57"),r=(n("f6be"),n("2877")),a=Object(r["a"])(i["default"],o["a"],o["b"],!1,null,"31c61828",null);t["default"]=a.exports},"56d7":function(e,t,n){"use strict";n.r(t);n("e260"),n("e6cf"),n("cca6"),n("a79d");var o=n("2b0e"),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.loading?n("transition",{attrs:{name:"fade"}},[n("loading")],1):n("codemirror-editor")},r=[],a=n("3a5e"),s=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"container",class:{container_night:e.nightMode}},[n("el-container",[n("el-header",{staticClass:"editor__header"},[n("editor-header",{ref:"header",on:{refresh:e.onEditorRefresh,cssChanged:e.cssChanged,downLoad:e.downloadEditorContent,showCssEditor:function(t){e.showCssEditor=!e.showCssEditor},showAboutDialog:function(t){e.aboutDialogVisible=!0},showDialogForm:function(t){e.dialogFormVisible=!0},showDialogUploadImg:function(t){e.dialogUploadImgVisible=!0},startCopy:function(t){e.isCoping=!0,e.backLight=!0},endCopy:e.endCopy}})],1),n("el-main",{staticClass:"main-body"},[n("el-row",{staticClass:"main-section"},[n("el-col",{attrs:{span:12},nativeOn:{contextmenu:function(t){return t.preventDefault(),e.openMenu(t)}}},[n("textarea",{directives:[{name:"model",rawName:"v-model",value:e.source,expression:"source"}],attrs:{id:"editor",type:"textarea",placeholder:"Your markdown text here."},domProps:{value:e.source},on:{input:function(t){t.target.composing||(e.source=t.target.value)}}})]),n("el-col",{ref:"preview",staticClass:"preview-wrapper",class:{"preview-wrapper_night":e.nightMode&&e.isCoping},attrs:{span:12,id:"preview"}},[n("section",{class:{output_night:e.nightMode&&!e.backLight},attrs:{id:"output-wrapper"}},[n("div",{staticClass:"preview"},[n("section",{attrs:{id:"output"},domProps:{innerHTML:e._s(e.output)}}),e.nightMode&&e.isCoping?n("div",{staticClass:"loading-mask"},[n("div",{staticClass:"loading__img"}),n("span",[e._v("正在生成")])]):e._e()])])]),n("transition",{attrs:{name:"custom-classes-transition","enter-active-class":"bounceInRight"}},[n("el-col",{directives:[{name:"show",rawName:"v-show",value:e.showCssEditor,expression:"showCssEditor"}],attrs:{id:"cssBox",span:12}},[n("textarea",{attrs:{id:"cssEditor",type:"textarea",placeholder:"Your custom css here."}})])],1)],1)],1)],1),n("upload-img-dialog",{on:{close:function(t){e.dialogUpl
//!影响到右键菜单的点击事件右键菜单的点击事件在组件内通过mousedown触发
e.$store.commit("setRightClickMenuVisible",!1)})),this.editor.on("scroll",(function(){e.$store.commit("setRightClickMenuVisible",!1)}))},initCssEditor:function(){var e=this;this.initCssEditorEntity(),this.cssEditor.on("keyup",(function(e,t){(t.keyCode>=65&&t.keyCode<=90||189===t.keyCode)&&e.showHint(t)})),this.cssEditor.on("update",(function(t){e.cssChanged(),S(e.cssEditor,"__css_content")}))},cssChanged:function(){var e=_(this.cssEditor.getValue(0)),t=x(this.currentSize.replace("px",""));t=y(e,this.currentColor,t),this.setWxRendererOptions({theme:t}),this.onEditorRefresh()},uploaded:function(e){if(e){this.dialogUploadImgVisible=!1;var t=this.editor.getCursor(),n=e,o="![](".concat(n,")");this.editor.replaceSelection("\n".concat(o,"\n"),t),this.$message({showClose:!0,message:"图片插入成功",type:"success"}),this.onEditorRefresh()}else this.$message({showClose:!0,message:"上传图片未知异常",type:"error"})},leftAndRightScroll:function(){var e=this,t=function(t){var i,r;clearTimeout(e.timeout),"preview"===t?(i=e.$refs.preview.$el,r=document.getElementsByClassName("CodeMirror-scroll")[0],e.editor.off("scroll",n),e.timeout=setTimeout((function(){e.editor.on("scroll",n)}),300)):"editor"===t&&(i=document.getElementsByClassName("CodeMirror-scroll")[0],r=e.$refs.preview.$el,r.removeEventListener("scroll",o,!1),e.timeout=setTimeout((function(){r.addEventListener("scroll",o,!1)}),300));var a=i.scrollTop/(i.scrollHeight-i.offsetHeight),s=a*(r.scrollHeight-r.offsetHeight);r.scrollTo(0,s)},n=function(){t("editor")},o=function(){t("preview")};this.$refs.preview.$el.addEventListener("scroll",o,!1),this.editor.on("scroll",n)},onEditorRefresh:function(){this.editorRefresh(),setTimeout((function(){return PR.prettyPrint()}),0)},endCopy:function(){var e=this;this.backLight=!1,setTimeout((function(){e.isCoping=!1}),800)},downloadEditorContent:function(){T(this.editor.getValue(0))},openMenu:function(e){var t=105,n=this.$el.getBoundingClientRect().left,o=this.$el.offsetWidth,i=o-t,r=e.clientX-n;this.mouseLeft=Math.min(i,r),this.mouseTop=e.clientY+10,this.$store.commit("setRightClickMenuVisible",!0)},closeRightClickMenu:function(){this.$store.commit("setRightClickMenuVisible",!1)},onMenuEvent:function(e){switch(e){case"pageReset":this.$refs.header.showResetConfirm=!0;break;case"insertPic":this.dialogUploadImgVisible=!0;break;case"downLoad":this.downloadEditorContent();break;case"insertTable":this.dialogFormVisible=!0;default:break}}},Object(D["b"])(["initEditorState","initEditorEntity","setWxRendererOptions","editorRefresh","initCssEditorEntity"])),mounted:function(){var e=this;setTimeout((function(){e.leftAndRightScroll(),PR.prettyPrint()}),300)}},qe=Le,Be=(n("db35"),n("85fe"),Object(N["a"])(qe,s,c,!1,null,"26d55444",null)),Ue=Be.exports,Je={name:"App",components:{Loading:a["default"],CodemirrorEditor:Ue},data:function(){return{loading:!0}},mounted:function(){var e=this;setTimeout((function(){e.loading=!1}),100)}},We=Je,Ke=(n("8be7"),Object(N["a"])(We,i,r,!1,null,"5b96f5f8",null)),Ye=Ke.exports,Qe=n("5c96"),Ze=n.n(Qe);n("0fae");o["default"].use(Qe["Container"]),o["default"].use(Qe["Header"]),o["default"].use(Qe["Upload"]),o["default"].use(Qe["Tooltip"]),o["default"].use(Qe["Form"]),o["default"].use(Qe["FormItem"]),o["default"].use(Qe["Select"]),o["default"].use(Qe["Option"]),o["default"].use(Qe["ColorPicker"]),o["default"].use(Qe["Switch"]),o["default"].use(Qe["Button"]),o["default"].use(Qe["Main"]),o["default"].use(Qe["Col"]),o["default"].use(Qe["Row"]),o["default"].use(Qe["Dialog"]),o["default"].use(Qe["Loading"]),o["default"].component(Qe["Message"].name,Qe["Message"]),o["default"].prototype.$loading=Qe["Loading"].service,o["default"].prototype.$message=Qe["Message"];n("a7be"),n("0f7c"),n("8d7e"),n("7b00"),n("959b"),n("8c33"),n("31c5"),n("9b74"),n("111b"),n("90ba"),n("baa5");(function(){be.a.extendMode("css",{commentStart:"/*",commentEnd:"*/",newlineAfterToken:function(e,t){return/^[;{}]$/.test(t)}}),be.a.defineExtension("commentRange",(function(e,t,n){var o=this,i=be.a.innerMode(o.getMode(),o.getTokenAt(t).state).mode;o.operatio
//# sourceMappingURL=app.17967f62.js.map