2021-11-23 11:09:05 +08:00
|
|
|
|
(function(e){function t(t){for(var n,a,c=t[0],s=t[1],l=t[2],d=0,f=[];d<c.length;d++)a=c[d],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&f.push(i[a][0]),i[a]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);u&&u(t);while(f.length)f.shift()();return r.push.apply(r,l||[]),o()}function o(){for(var e,t=0;t<r.length;t++){for(var o=r[t],n=!0,c=1;c<o.length;c++){var s=o[c];0!==i[s]&&(n=!1)}n&&(r.splice(t--,1),e=a(a.s=o[0]))}return e}var n={},i={app:0},r=[];function a(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,a),o.l=!0,o.exports}a.m=e,a.c=n,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},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 o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)a.d(o,n,function(t){return e[t]}.bind(null,n));return o},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 c=window["webpackJsonp"]=window["webpackJsonp"]||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var l=0;l<c.length;l++)t(c[l]);var u=s;r.push([0,"chunk-vendors"]),o()})({0:function(e,t,o){e.exports=o("56d7")},"0518":function(e,t,o){"use strict";o("9a2f")},1:function(e,t){},10:function(e,t){},11:function(e,t){},"11ef":function(e,t,o){"use strict";o("695a")},12:function(e,t){},13:function(e,t){},14:function(e,t){},2:function(e,t){},3:function(e,t){},"3a5e":function(e,t,o){"use strict";var n=o("aae9"),i=o("cb57"),r=(o("11ef"),o("2877")),a=Object(r["a"])(i["default"],n["a"],n["b"],!1,null,"a205efe8",null);t["default"]=a.exports},"3c8e":function(e,t,o){},"3cb7":function(e,t,o){},4:function(e,t){},5:function(e,t){},"536a":function(e,t,o){},"537d":function(e,t,o){"use strict";o("6396")},"56d7":function(e,t,o){"use strict";o.r(t);var n=o("5530"),i=(o("e260"),o("e6cf"),o("cca6"),o("a79d"),o("2b0e")),r=function(){var e=this,t=e.$createElement,o=e._self._c||t;return o("div",{attrs:{id:"app"}},[o("router-view")],1)},a=[],c=(o("7c55"),o("94fb"),o("2877")),s={},l=Object(c["a"])(s,r,a,!1,null,null,null),u=l.exports,d=(o("ac1f"),o("5319"),o("2f62")),f={builtinFonts:[{label:"无衬线",value:"-apple-system-font,BlinkMacSystemFont, Helvetica Neue, PingFang SC, Hiragino Sans GB , Microsoft YaHei UI , Microsoft YaHei ,Arial,sans-serif"},{label:"衬线",value:"Optima-Regular, Optima, PingFangSC-light, PingFangTC-light, 'PingFang SC', Cambria, Cochin, Georgia, Times, 'Times New Roman', serif"}],sizeOption:[{label:"12px",value:"12px",desc:"更小"},{label:"13px",value:"13px",desc:"稍小"},{label:"14px",value:"14px",desc:"推荐"},{label:"15px",value:"15px",desc:"稍大"},{label:"16px",value:"16px",desc:"更大"}],colorOption:[{label:"经典蓝",value:"rgba(15, 76, 129, 1)",desc:"最新流行"},{label:"翡翠绿",value:"rgba(0, 152, 116, 1)",desc:"优雅清新"},{label:"活力橘",value:"rgba(250, 81, 81, 1)",desc:"热情活泼"}],codeThemeOption:[{label:"微信",value:"wechat",desc:"默认样式"},{label:"GitHub",value:"github",desc:"精简风格"}],form:{rows:1,cols:1}},m=o("d4ec"),p=(o("a15b"),o("d81d"),o("99af"),o("c975"),o("1276"),o("2ca0"),o("0e54")),g=o.n(p),h=function e(t){var o=this;Object(m["a"])(this,e),this.opts=t;var n=!0,i=[],r=0,a=null,c="Menlo, Operator Mono, Consolas, Monaco, monospace",s=function(e,t){return Object.assign({},e,t)};this.buildTheme=function(e){var t={},n=s(e.BASE,{"font-family":o.opts.fonts,"font-size":o.opts.size});for(var i in e.inline)if(e.inline.hasOwnProperty(i)){var r=e.inline[i];t[i]=s(e.BASE,r)}var a=s(n,{});for(var l in e.block)if(e.block.hasOwnProperty(l)){var u=e.block[l];"code"===l&&(u["font-family"]=c),t[l]=s(a,u)}return t};var l=function(e,t){var o=[],n=a[e
|
|
|
|
|
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(),q(e.cssEditor,"__css_content")}))},cssChanged:function(){var e=N(this.cssEditor.getValue(0)),t=H(this.currentSize.replace("px",""));t=z(e,this.currentColor,t),this.setWxRendererOptions({theme:t}),this.onEditorRefresh()},beforeUpload:function(e){var t=Q(e);if(!t.ok)return this.$message.error(t.msg),!1;var o=localStorage.getItem("imgHost");o=o||"default",localStorage.setItem("imgHost",o);var n=localStorage.getItem("".concat(o,"Config")),i="default"==o||n;return!!i||(this.$message.error("请先配置 ".concat(o," 图床参数")),!1)},uploadImage:function(e){var t=this;this.isImgLoading=!0,P(e).then((function(o){Et.fileUpload(o,e).then((function(e){t.uploaded(e)})).catch((function(e){t.$message.error(e.message)}))})).catch((function(e){t.$message.error(e.message)})),this.isImgLoading=!1},uploaded:function(e){if(e){this.dialogUploadImgVisible=!1;var t=this.editor.getCursor(),o=e,n="![](".concat(o,")");this.editor.replaceSelection("\n".concat(n,"\n"),t),this.$message.success("图片上传成功"),this.onEditorRefresh()}else this.$message.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",o),e.timeout=setTimeout((function(){e.editor.on("scroll",o)}),300)):"editor"===t&&(i=document.getElementsByClassName("CodeMirror-scroll")[0],r=e.$refs.preview.$el,r.removeEventListener("scroll",n,!1),e.timeout=setTimeout((function(){r.addEventListener("scroll",n,!1)}),300));var a=i.scrollTop/(i.scrollHeight-i.offsetHeight),c=a*(r.scrollHeight-r.offsetHeight);r.scrollTo(0,c)},o=function(){t("editor")},n=function(){t("preview")};this.$refs.preview.$el.addEventListener("scroll",n,!1),this.editor.on("scroll",o)},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(){K(this.editor.getValue(0))},exportEditorContent:function(){this.$nextTick((function(){L()}))},formatContent:function(){var e=D(this.editor.getValue(0));localStorage.setItem("__editor_content",e),this.editor.setValue(e)},openMenu:function(e){var t=105,o=this.$el.getBoundingClientRect().left,n=this.$el.offsetWidth,i=n-t,r=e.clientX-o;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"export":this.exportEditorContent();break;case"insertTable":this.dialogFormVisible=!0;break;case"formatMarkdown":this.formatContent();break;default:break}}},Object(d["b"])(["initEditorState","initEditorEntity","setWxRendererOptions","editorRefresh","initCssEditorEntity"])),mounted:function(){var e=this;setTimeout((function(){e.leftAndRightScroll(),PR.prettyPrint()}),300)}},$t=It,jt=(o("90fc"),o("8078"),o("64cd"),Object(c["a"])($t,ie,re,!1,null,"0152319a",null)),Mt=jt.exports,Rt={name:"App",components:{Loading:ne["default"],CodemirrorEditor:Mt},data:function(){return{loading:!0}},mounted:function(){var e=this;setTimeout((function(){e.loading=!1}),100)}},At=Rt,Gt=(o("537d"),Object(c["a"])(At,te,oe,!1,null,"8e90ad4c",null)),Ht=Gt.exports;i["default"].use(ee["a"]);var zt=[{path:"/",name:"index",component:Ht}],Nt=new ee["a"]({mode:"history",base:"/md/",routes:zt}),qt=Nt;i["default"].use(X.a),i["default"].config.productionTip=!1,u.mpType="app";var Dt=new i["default"](Objec
|