/
0.build-12d151df.js
2 lines (2 loc) · 47.9 KB
/
0.build-12d151df.js
1
2
webpackJsonp([0],Array(35).concat([function(t,e,n){var r,i;n(105),r=n(73);var o=n(95);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"topic",i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},,function(t,e,n){"use strict";(function(t){e.default={data:function(){return{user:{loginname:localStorage.loginname||"",avatar:localStorage.avatar||"",id:localStorage.id||"",accesstoken:localStorage.accesstoken||"",score:localStorage.score||"",message:0},curTab:this.$route.name||"index"}},computed:{},created:function(){this.user.loginname&&!this.user.score&&this.fetchUserInfo(),this.user.loginname&&this.fetchMessage()},mounted:function(){},methods:{fetchUserInfo:function(){var e=this,n=this;t.ajax({url:"https://cnodejs.org/api/v1/user/"+n.user.loginname,type:"GET"}).done(function(t){t&&t.success&&(e.user.score=localStorage.score=t.data.score)}).fail(function(t){})},fetchMessage:function(){var e=this,n=this;t.ajax({url:"https://cnodejs.org/api/v1/message/count/",type:"GET",data:{accesstoken:n.user.accesstoken}}).done(function(t){t&&t.success&&(e.user.message=localStorage.message=t.data)}).fail(function(t){})},logout:function(){var t=this;localStorage.clear(),this.$message({showClose:!0,message:"退出成功",type:"success",onClose:function(){t.$route.matched.some(function(t){return t.meta.requiresAuth})?t.$router.push({name:"index",query:{tab:"all"}}):window.location.reload()}})}},components:{}}}).call(e,n(2))},function(t,e,n){e=t.exports=n(3)(),e.push([t.i,"\n#header {\n background-color: #324057;\n}\n#header #logo {\n width: 120px;\n padding: 10px 55px;\n height: 28px;\n display: block;\n float: left;\n}\n#header #logo img {\n max-width: 100%;\n max-height: 100%;\n}\n#header #navbar {\n background-color: transparent;\n}\n#header #navbar .avatar {\n width: 30px;\n height: 30px;\n}\n#header #navbar .mark {\n margin-top: 8px;\n line-height: 1;\n float: right;\n}\n",""])},function(t,e,n){var r,i;n(41),r=n(37);var o=n(40);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"header",i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(module,exports){module.exports={render:function(){with(this)return _h("header",{attrs:{id:"header"}},[_m(0)," ",_h("el-menu",{staticClass:"el-menu-demo",attrs:{id:"navbar",theme:"dark","default-active":curTab,mode:"horizontal",router:""}},[_h("el-menu-item",{attrs:{index:"index",route:{name:"index",query:{tab:"all"}}}},["首页"])," ",_h("el-menu-item",{attrs:{index:"api",route:{name:"api"}}},["API"])," ",_h("el-menu-item",{attrs:{index:"about",route:{name:"about"}}},["关于"])," ",user.loginname?_e():_h("el-menu-item",{attrs:{index:"login",route:{name:"login"}}},["登录"])," ",user.loginname?_h("el-submenu",{attrs:{index:"user"}},[_h("template",{slot:"title"},[_h("img",{staticClass:"avatar",attrs:{src:user.avatar,alt:""}}),_s(user.loginname),user.message?_h("el-badge",{staticClass:"mark",attrs:{max:99},domProps:{value:user.message}}):_e()])," ",_h("el-menu-item",{attrs:{index:"",route:{name:"user",params:{name:user.loginname}}}},["个人主页"])," ",_h("el-menu-item",{attrs:{index:""}},[_m(1),_s(user.score)])," ",_h("el-menu-item",{attrs:{index:"",route:{name:"message"}}},[_m(2),"消息",_h("el-badge",{staticClass:"mark",attrs:{max:99},domProps:{value:user.message}})])," ",_h("el-menu-item",{attrs:{index:""},nativeOn:{click:function(t){logout(t)}}},[_m(3),"退出"])]):_e()," ",user.loginname?_h("el-menu-item",{attrs:{index:"newtopic",route:{name:"newtopic"}}},["发布话题"]):_e()])])},staticRenderFns:[function(){with(this)return _h("a",{attrs:{id:"logo"}},[_h("img",{attrs:{src:"https://o4j806krb.qnssl.com/public/images/cnodejs_light.svg",alt:""}})])},function(){with(this)return _h("span",["积分:"])},function(){with(this)return _h("i",{staticClass:"el-icon-message"})},function(){with(this)return _h("i",{staticClass:"el-icon-upload2"})}]}},function(t,e,n){var r=n(38);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)},function(t,e,n){"use strict";e.default={data:function(){return{}},props:["showLoading"]}},function(t,e,n){e=t.exports=n(3)(),e.push([t.i,"\n.el-loading-demo {\n border: 1px solid #999;\n border-radius: 4px;\n height: 100px;\n}\n",""])},function(t,e,n){var r,i;n(46),r=n(42);var o=n(45);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"loading",i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(module,exports){module.exports={render:function(){with(this)return _h("div",{directives:[{name:"loading",rawName:"v-loading.fullscreen",value:showLoading,expression:"showLoading",modifiers:{fullscreen:!0}}]})},staticRenderFns:[]}},function(t,e,n){var r=n(43);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)},function(t,e,n){"use strict";(function(t){function n(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}e.default={data:function(){var t;return{author:{},bodyStyle:(t={display:"-webkit-flex"},n(t,"display","ms-flex"),n(t,"display","flex"),n(t,"padding",0),n(t,"flexDirection","column"),n(t,"position","relative"),t)}},props:["authorName","topicId","hasRecent"],computed:{recentLength:function(){var t=this.author.recent_topics.length;return t>10&&10||t}},created:function(){this.authorName&&this.fetchUserInfo()},mounted:function(){},watch:{authorName:function(){this.authorName&&this.fetchUserInfo()}},methods:{fetchUserInfo:function(){var e=this,n=this;t.ajax({url:"https://cnodejs.org/api/v1/user/"+n.authorName,type:"GET"}).done(function(t){t&&t.success&&(e.author=t.data)}).fail(function(t){})},goToTopic:function(t){t&&this.$router.push({name:"topic",params:{id:t}})}},components:{}}}).call(e,n(2))},function(t,e,n){e=t.exports=n(3)(),e.push([t.i,"\n.author-avatar {\n max-width: 100%;\n display: block;\n padding: 20px;\n text-align: center;\n border-bottom: 1px solid rgba(160, 160, 160, 0.2);\n}\n.author-avatar img {\n width: auto;\n max-width: 100%;\n max-height: 100px;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n}\n.author-info {\n padding: 20px;\n border-bottom: 1px solid rgba(160, 160, 160, 0.2);\n}\n.author-info .author-name {\n line-height: 48px;\n font-size: 24px;\n font-weight: 300;\n color: #212121;\n}\n.author-info .author-name:hover {\n text-decoration: underline;\n}\n.author-info .author-detail .author-score {\n color: #838383;\n}\n.author-recent-topic .title {\n padding: 18px 20px;\n border-bottom: 1px solid rgba(160, 160, 160, 0.2);\n}\n.author-recent-topic .topic-list ul {\n list-style: none;\n}\n.author-recent-topic .topic-list ul li {\n line-height: 1.5;\n border-bottom: 1px solid rgba(160, 160, 160, 0.2);\n padding: 10px;\n}\n.author-recent-topic .topic-list ul li a {\n color: #838383;\n}\n",""])},function(t,e,n){e.markdown=n(50),e.parse=e.markdown.toHTML},function(t,e,n){!function(t){function e(){return"Markdown.mk_block( "+uneval(this.toString())+", "+uneval(this.trailing)+", "+uneval(this.lineNumber)+" )"}function r(){var t=n(54);return"Markdown.mk_block( "+t.inspect(this.toString())+", "+t.inspect(this.trailing)+", "+t.inspect(this.lineNumber)+" )"}function i(t){for(var e=0,n=-1;(n=t.indexOf("\n",n+1))!==-1;)e++;return e}function o(t,e){function n(t){this.len_after=t,this.name="close_"+e}var r=t+"_state",i="strong"==t?"em_state":"strong_state";return function(o,a){if(this[r][0]==e)return this[r].shift(),[o.length,new n(o.length-e.length)];var s=this[i].slice(),c=this[r].slice();this[r].unshift(e);var l=this.processInline(o.substr(e.length)),u=l[l.length-1];if(this[r].shift(),u instanceof n){l.pop();var p=o.length-u.len_after;return[p,[t].concat(l)]}return this[i]=s,this[r]=c,[e.length,e]}}function s(t){for(var e=t.split(""),n=[""],r=!1;e.length;){var i=e.shift();switch(i){case" ":r?n[n.length-1]+=i:n.push("");break;case"'":case'"':r=!r;break;case"\\":i=e.shift();default:n[n.length-1]+=i}}return n}function c(t){return y(t)&&t.length>1&&"object"==typeof t[1]&&!y(t[1])?t[1]:void 0}function l(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function u(t){if("string"==typeof t)return l(t);var e=t.shift(),n={},r=[];for(!t.length||"object"!=typeof t[0]||t[0]instanceof Array||(n=t.shift());t.length;)r.push(u(t.shift()));var i="";for(var o in n)i+=" "+o+'="'+l(n[o])+'"';return"img"==e||"br"==e||"hr"==e?"<"+e+i+"/>":"<"+e+i+">"+r.join("")+"</"+e+">"}function h(t,e,n){var r;n=n||{};var i=t.slice(0);"function"==typeof n.preprocessTreeNode&&(i=n.preprocessTreeNode(i,e));var o=c(i);if(o){i[1]={};for(r in o)i[1][r]=o[r];o=i[1]}if("string"==typeof i)return i;switch(i[0]){case"header":i[0]="h"+i[1].level,delete i[1].level;break;case"bulletlist":i[0]="ul";break;case"numberlist":i[0]="ol";break;case"listitem":i[0]="li";break;case"para":i[0]="p";break;case"markdown":i[0]="html",o&&delete o.references;break;case"code_block":i[0]="pre",r=o?2:1;var a=["code"];a.push.apply(a,i.splice(r,i.length-r)),i[r]=a;break;case"inlinecode":i[0]="code";break;case"img":i[1].src=i[1].href,delete i[1].href;break;case"linebreak":i[0]="br";break;case"link":i[0]="a";break;case"link_ref":i[0]="a";var s=e[o.ref];if(!s)return o.original;delete o.ref,o.href=s.href,s.title&&(o.title=s.title),delete o.original;break;case"img_ref":i[0]="img";var s=e[o.ref];if(!s)return o.original;delete o.ref,o.src=s.href,s.title&&(o.title=s.title),delete o.original}if(r=1,o){for(var l in i[1]){r=2;break}1===r&&i.splice(r,1)}for(;r<i.length;++r)i[r]=h(i[r],e,n);return i}function f(t){for(var e=c(t)?2:1;e<t.length;)"string"==typeof t[e]?e+1<t.length&&"string"==typeof t[e+1]?t[e]+=t.splice(e+1,1)[0]:++e:(f(t[e]),++e)}var d=t.Markdown=function(t){switch(typeof t){case"undefined":this.dialect=d.dialects.Gruber;break;case"object":this.dialect=t;break;default:if(!(t in d.dialects))throw new Error("Unknown Markdown dialect '"+String(t)+"'");this.dialect=d.dialects[t]}this.em_state=[],this.strong_state=[],this.debug_indent=""};t.parse=function(t,e){var n=new d(e);return n.toTree(t)},t.toHTML=function(e,n,r){var i=t.toHTMLTree(e,n,r);return t.renderJsonML(i)},t.toHTMLTree=function(t,e,n){"string"==typeof t&&(t=this.parse(t,e));var r=c(t),i={};r&&r.references&&(i=r.references);var o=h(t,i,n);return f(o),o};var g=d.mk_block=function(t,n,i){1==arguments.length&&(n="\n\n");var o=new String(t);return o.trailing=n,o.inspect=r,o.toSource=e,void 0!=i&&(o.lineNumber=i),o};d.prototype.split_blocks=function(t,e){t=t.replace(/(\r\n|\n|\r)/g,"\n");var n,r=/([\s\S]+?)($|\n#|\n(?:\s*\n|$)+)/g,o=[],a=1;for(null!=(n=/^(\s*\n)/.exec(t))&&(a+=i(n[0]),r.lastIndex=n[0].length);null!==(n=r.exec(t));)"\n#"==n[2]&&(n[2]="\n",r.lastIndex--),o.push(g(n[1],n[2],a)),a+=i(n[0]);return o},d.prototype.processBlock=function(t,e){var n=this.dialect.block,r=n.__order__;if("__call__"in n)return n.__call__.call(this,t,e);for(var i=0;i<r.length;i++){var o=n[r[i]].call(this,t,e);if(o)return(!y(o)||o.length>0&&!y(o[0]))&&this.debug(r[i],"didn't return a proper array"),o}return[]},d.prototype.processInline=function(t){return this.dialect.inline.__call__.call(this,String(t))},d.prototype.toTree=function(t,e){var n=t instanceof Array?t:this.split_blocks(t),r=this.tree;try{for(this.tree=e||this.tree||["markdown"];n.length;){var i=this.processBlock(n.shift(),n);i.length&&this.tree.push.apply(this.tree,i)}return this.tree}finally{e&&(this.tree=r)}},d.prototype.debug=function(){var t=Array.prototype.slice.call(arguments);t.unshift(this.debug_indent),"undefined"!=typeof print&&print.apply(print,t),"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log.apply(null,t)},d.prototype.loop_re_over_block=function(t,e,n){for(var r,i=e.valueOf();i.length&&null!=(r=t.exec(i));)i=i.substr(r[0].length),n.call(this,r);return i},d.dialects={},d.dialects.Gruber={block:{atxHeader:function(t,e){var n=t.match(/^(#{1,6})\s*(.*?)\s*#*\s*(?:\n|$)/);if(n){var r=["header",{level:n[1].length}];return Array.prototype.push.apply(r,this.processInline(n[2])),n[0].length<t.length&&e.unshift(g(t.substr(n[0].length),t.trailing,t.lineNumber+2)),[r]}},setextHeader:function(t,e){var n=t.match(/^(.*)\n([-=])\2\2+(?:\n|$)/);if(n){var r="="===n[2]?1:2,i=["header",{level:r},n[1]];return n[0].length<t.length&&e.unshift(g(t.substr(n[0].length),t.trailing,t.lineNumber+2)),[i]}},code:function(t,e){var n=[],r=/^(?: {0,3}\t| {4})(.*)\n?/;if(t.match(r)){t:for(;;){var i=this.loop_re_over_block(r,t.valueOf(),function(t){n.push(t[1])});if(i.length){e.unshift(g(i,t.trailing));break t}if(!e.length)break t;if(!e[0].match(r))break t;n.push(t.trailing.replace(/[^\n]/g,"").substring(2)),t=e.shift()}return[["code_block",n.join("\n")]]}},horizRule:function(t,e){var n=t.match(/^(?:([\s\S]*?)\n)?[ \t]*([-_*])(?:[ \t]*\2){2,}[ \t]*(?:\n([\s\S]*))?$/);if(n){var r=[["hr"]];return n[1]&&r.unshift.apply(r,this.processBlock(n[1],[])),n[3]&&e.unshift(g(n[3])),r}},lists:function(){function t(t){return new RegExp("(?:^("+c+"{0,"+t+"} {0,3})("+o+")\\s+)|(^"+c+"{0,"+(t-1)+"}[ ]{0,4})")}function e(t){return t.replace(/ {0,3}\t/g," ")}function n(t,e,n,r){if(e)return void t.push(["para"].concat(n));var i=t[t.length-1]instanceof Array&&"para"==t[t.length-1][0]?t[t.length-1]:t;r&&t.length>1&&n.unshift(r);for(var o=0;o<n.length;o++){var a=n[o],s="string"==typeof a;s&&i.length>1&&"string"==typeof i[i.length-1]?i[i.length-1]+=a:i.push(a)}}function r(t,e){for(var n=new RegExp("^("+c+"{"+t+"}.*?\\n?)*$"),r=new RegExp("^"+c+"{"+t+"}","gm"),i=[];e.length>0&&n.exec(e[0]);){var o=e.shift(),a=o.replace(r,"");i.push(g(a,o.trailing,o.lineNumber))}return i}function i(t,e,n){var r=t.list,i=r[r.length-1];if(!(i[1]instanceof Array&&"para"==i[1][0]))if(e+1==n.length)i.push(["para"].concat(i.splice(1,i.length-1)));else{var o=i.pop();i.push(["para"].concat(i.splice(1,i.length-1)),o)}}var o="[*+-]|\\d+\\.",a=/[*+-]/,s=new RegExp("^( {0,3})("+o+")[ \t]+"),c="(?: {0,3}\\t| {4})";return function(o,c){function l(t){var e=a.exec(t[2])?["bulletlist"]:["numberlist"];return f.push({list:e,indent:t[1]}),e}var u=o.match(s);if(u){for(var p,h,f=[],d=l(u),g=!1,y=[f[0].list];;){for(var v=o.split(/(?=\n)/),_="",b=0;b<v.length;b++){var x="",w=v[b].replace(/^\n/,function(t){return x=t,""}),k=t(f.length);if(u=w.match(k),void 0!==u[1]){_.length&&(n(p,g,this.processInline(_),x),g=!1,_=""),u[1]=e(u[1]);var C=Math.floor(u[1].length/4)+1;if(C>f.length)d=l(u),p.push(d),p=d[1]=["listitem"];else{var S=!1;for(h=0;h<f.length;h++)if(f[h].indent==u[1]){d=f[h].list,f.splice(h+1,f.length-(h+1)),S=!0;break}S||(C++,C<=f.length?(f.splice(C,f.length-C),d=f[C-1].list):(d=l(u),p.push(d))),p=["listitem"],d.push(p)}x=""}w.length>u[0].length&&(_+=x+w.substr(u[0].length))}_.length&&(n(p,g,this.processInline(_),x),g=!1,_="");var T=r(f.length,c);T.length>0&&(m(f,i,this),p.push.apply(p,this.toTree(T,[])));var j=c[0]&&c[0].valueOf()||"";if(!j.match(s)&&!j.match(/^ /))break;o=c.shift();var $=this.dialect.block.horizRule(o,c);if($){y.push.apply(y,$);break}m(f,i,this),g=!0}return y}}}(),blockquote:function(t,e){if(t.match(/^>/m)){var n=[];if(">"!=t[0]){for(var r=t.split(/\n/),i=[],o=t.lineNumber;r.length&&">"!=r[0][0];)i.push(r.shift()),o++;var a=g(i.join("\n"),"\n",t.lineNumber);n.push.apply(n,this.processBlock(a,[])),t=g(r.join("\n"),t.trailing,o)}for(;e.length&&">"==e[0][0];){var s=e.shift();t=g(t+t.trailing+s,s.trailing,t.lineNumber)}var l=t.replace(/^> ?/gm,""),u=(this.tree,this.toTree(l,["blockquote"])),p=c(u);return p&&p.references&&(delete p.references,v(p)&&u.splice(1,1)),n.push(u),n}},referenceDefn:function(t,e){var n=/^\s*\[(.*?)\]:\s*(\S+)(?:\s+(?:(['"])(.*?)\3|\((.*?)\)))?\n?/;if(t.match(n)){c(this.tree)||this.tree.splice(1,0,{});var r=c(this.tree);void 0===r.references&&(r.references={});var i=this.loop_re_over_block(n,t,function(t){t[2]&&"<"==t[2][0]&&">"==t[2][t[2].length-1]&&(t[2]=t[2].substring(1,t[2].length-1));var e=r.references[t[1].toLowerCase()]={href:t[2]};void 0!==t[4]?e.title=t[4]:void 0!==t[5]&&(e.title=t[5])});return i.length&&e.unshift(g(i,t.trailing)),[]}},para:function(t,e){return[["para"].concat(this.processInline(t))]}}},d.dialects.Gruber.inline={__oneElement__:function(t,e,n){var r,i;e=e||this.dialect.inline.__patterns__;var o=new RegExp("([\\s\\S]*?)("+(e.source||e)+")");if(r=o.exec(t),!r)return[t.length,t];if(r[1])return[r[1].length,r[1]];var i;return r[2]in this.dialect.inline&&(i=this.dialect.inline[r[2]].call(this,t.substr(r.index),r,n||[])),i=i||[r[2].length,r[2]]},__call__:function(t,e){function n(t){"string"==typeof t&&"string"==typeof i[i.length-1]?i[i.length-1]+=t:i.push(t)}for(var r,i=[];t.length>0;)r=this.dialect.inline.__oneElement__.call(this,t,e,i),t=t.substr(r.shift()),m(r,n);return i},"]":function(){},"}":function(){},__escape__:/^\\[\\`\*_{}\[\]()#\+.!\-]/,"\\":function(t){return this.dialect.inline.__escape__.exec(t)?[2,t.charAt(1)]:[1,"\\"]},"![":function(t){var e=t.match(/^!\[(.*?)\][ \t]*\([ \t]*([^")]*?)(?:[ \t]+(["'])(.*?)\3)?[ \t]*\)/);if(e){e[2]&&"<"==e[2][0]&&">"==e[2][e[2].length-1]&&(e[2]=e[2].substring(1,e[2].length-1)),e[2]=this.dialect.inline.__call__.call(this,e[2],/\\/)[0];var n={alt:e[1],href:e[2]||""};return void 0!==e[4]&&(n.title=e[4]),[e[0].length,["img",n]]}return e=t.match(/^!\[(.*?)\][ \t]*\[(.*?)\]/),e?[e[0].length,["img_ref",{alt:e[1],ref:e[2].toLowerCase(),original:e[0]}]]:[2,"!["]},"[":function t(e){var n=String(e),r=d.DialectHelpers.inline_until_char.call(this,e.substr(1),"]");if(!r)return[1,"["];var t,i,o=1+r[0],a=r[1];e=e.substr(o);var s=e.match(/^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/);if(s){var c=s[1];if(o+=s[0].length,c&&"<"==c[0]&&">"==c[c.length-1]&&(c=c.substring(1,c.length-1)),!s[3])for(var l=1,u=0;u<c.length;u++)switch(c[u]){case"(":l++;break;case")":0==--l&&(o-=c.length-u,c=c.substring(0,u))}return c=this.dialect.inline.__call__.call(this,c,/\\/)[0],i={href:c||""},void 0!==s[3]&&(i.title=s[3]),t=["link",i].concat(a),[o,t]}return s=e.match(/^\s*\[(.*?)\]/),s?(o+=s[0].length,i={ref:(s[1]||String(a)).toLowerCase(),original:n.substr(0,o)},t=["link_ref",i].concat(a),[o,t]):1==a.length&&"string"==typeof a[0]?(i={ref:a[0].toLowerCase(),original:n.substr(0,o)},t=["link_ref",i,a[0]],[o,t]):[1,"["]},"<":function(t){var e;return null!=(e=t.match(/^<(?:((https?|ftp|mailto):[^>]+)|(.*?@.*?\.[a-zA-Z]+))>/))?e[3]?[e[0].length,["link",{href:"mailto:"+e[3]},e[3]]]:"mailto"==e[2]?[e[0].length,["link",{href:e[1]},e[1].substr("mailto:".length)]]:[e[0].length,["link",{href:e[1]},e[1]]]:[1,"<"]},"`":function(t){var e=t.match(/(`+)(([\s\S]*?)\1)/);return e&&e[2]?[e[1].length+e[2].length,["inlinecode",e[3]]]:[1,"`"]}," \n":function(t){return[3,["linebreak"]]}},d.dialects.Gruber.inline["**"]=o("strong","**"),d.dialects.Gruber.inline.__=o("strong","__"),d.dialects.Gruber.inline["*"]=o("em","*"),d.dialects.Gruber.inline._=o("em","_"),d.buildBlockOrder=function(t){var e=[];for(var n in t)"__order__"!=n&&"__call__"!=n&&e.push(n);t.__order__=e},d.buildInlinePatterns=function(t){var e=[];for(var n in t)if(!n.match(/^__.*__$/)){var r=n.replace(/([\\.*+?|()\[\]{}])/g,"\\$1").replace(/\n/,"\\n");e.push(1==n.length?r:"(?:"+r+")")}e=e.join("|"),t.__patterns__=e;var i=t.__call__;t.__call__=function(t,n){return void 0!=n?i.call(this,t,n):i.call(this,t,e)}},d.DialectHelpers={},d.DialectHelpers.inline_until_char=function(t,e){for(var n=0,r=[];;){if(t.charAt(n)==e)return n++,[n,r];if(n>=t.length)return null;var i=this.dialect.inline.__oneElement__.call(this,t.substr(n));n+=i[0],r.push.apply(r,i.slice(1))}},d.subclassDialect=function(t){function e(){}function n(){}return e.prototype=t.block,n.prototype=t.inline,{block:new e,inline:new n}},d.buildBlockOrder(d.dialects.Gruber.block),d.buildInlinePatterns(d.dialects.Gruber.inline),d.dialects.Maruku=d.subclassDialect(d.dialects.Gruber),d.dialects.Maruku.processMetaHash=function(t){for(var e=s(t),n={},r=0;r<e.length;++r)if(/^#/.test(e[r]))n.id=e[r].substring(1);else if(/^\./.test(e[r]))n.class?n.class=n.class+e[r].replace(/./," "):n.class=e[r].substring(1);else if(/\=/.test(e[r])){var i=e[r].split(/\=/);n[i[0]]=i[1]}return n},d.dialects.Maruku.block.document_meta=function(t,e){if(!(t.lineNumber>1)&&t.match(/^(?:\w+:.*\n)*\w+:.*$/)){c(this.tree)||this.tree.splice(1,0,{});var n=t.split(/\n/);for(p in n){var r=n[p].match(/(\w+):\s*(.*)$/),i=r[1].toLowerCase(),o=r[2];this.tree[1][i]=o}return[]}},d.dialects.Maruku.block.block_meta=function(t,e){var n=t.match(/(^|\n) {0,3}\{:\s*((?:\\\}|[^\}])*)\s*\}$/);if(n){var r,i=this.dialect.processMetaHash(n[2]);if(""===n[1]){var o=this.tree[this.tree.length-1];if(r=c(o),"string"==typeof o)return;r||(r={},o.splice(1,0,r));for(a in i)r[a]=i[a];return[]}var s=t.replace(/\n.*$/,""),l=this.processBlock(s,[]);r=c(l[0]),r||(r={},l[0].splice(1,0,r));for(a in i)r[a]=i[a];return l}},d.dialects.Maruku.block.definition_list=function(t,e){var n,r,i=/^((?:[^\s:].*\n)+):\s+([\s\S]+)$/,o=["dl"];if(r=t.match(i)){for(var a=[t];e.length&&i.exec(e[0]);)a.push(e.shift());for(var s=0;s<a.length;++s){var r=a[s].match(i),c=r[1].replace(/\n$/,"").split(/\n/),l=r[2].split(/\n:\s+/);for(n=0;n<c.length;++n)o.push(["dt",c[n]]);for(n=0;n<l.length;++n)o.push(["dd"].concat(this.processInline(l[n].replace(/(\n)\s+/,"$1"))))}return[o]}},d.dialects.Maruku.block.table=function t(e,n){var r,i,o=function(t,e){e=e||"\\s",e.match(/^[\\|\[\]{}?*.+^$]$/)&&(e="\\"+e);for(var n,r=[],i=new RegExp("^((?:\\\\.|[^\\\\"+e+"])*)"+e+"(.*)");n=t.match(i);)r.push(n[1]),t=n[2];return r.push(t),r},a=/^ {0,3}\|(.+)\n {0,3}\|\s*([\-:]+[\-| :]*)\n((?:\s*\|.*(?:\n|$))*)(?=\n|$)/,s=/^ {0,3}(\S(?:\\.|[^\\|])*\|.*)\n {0,3}([\-:]+\s*\|[\-| :]*)\n((?:(?:\\.|[^\\|])*\|.*(?:\n|$))*)(?=\n|$)/;if(i=e.match(a))i[3]=i[3].replace(/^\s*\|/gm,"");else if(!(i=e.match(s)))return;var t=["table",["thead",["tr"]],["tbody"]];i[2]=i[2].replace(/\|\s*$/,"").split("|");var c=[];for(m(i[2],function(t){t.match(/^\s*-+:\s*$/)?c.push({align:"right"}):t.match(/^\s*:-+\s*$/)?c.push({align:"left"}):t.match(/^\s*:-+:\s*$/)?c.push({align:"center"}):c.push({})}),i[1]=o(i[1].replace(/\|\s*$/,""),"|"),r=0;r<i[1].length;r++)t[1][1].push(["th",c[r]||{}].concat(this.processInline(i[1][r].trim())));return m(i[3].replace(/\|\s*$/gm,"").split("\n"),function(e){var n=["tr"];for(e=o(e,"|"),r=0;r<e.length;r++)n.push(["td",c[r]||{}].concat(this.processInline(e[r].trim())));t[2].push(n)},this),[t]},d.dialects.Maruku.inline["{:"]=function(t,e,n){if(!n.length)return[2,"{:"];var r=n[n.length-1];if("string"==typeof r)return[2,"{:"];var i=t.match(/^\{:\s*((?:\\\}|[^\}])*)\s*\}/);if(!i)return[2,"{:"];var o=this.dialect.processMetaHash(i[1]),a=c(r);a||(a={},r.splice(1,0,a));for(var s in o)a[s]=o[s];return[i[0].length,""]},d.dialects.Maruku.inline.__escape__=/^\\[\\`\*_{}\[\]()#\+.!\-|:]/,d.buildBlockOrder(d.dialects.Maruku.block),d.buildInlinePatterns(d.dialects.Maruku.inline);var m,y=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)};m=Array.prototype.forEach?function(t,e,n){return t.forEach(e,n)}:function(t,e,n){for(var r=0;r<t.length;r++)e.call(n||t,t[r],r,t)};var v=function(t){for(var e in t)if(hasOwnProperty.call(t,e))return!1;return!0};t.renderJsonML=function(t,e){e=e||{},e.root=e.root||!1;var n=[];if(e.root)n.push(u(t));else for(t.shift(),!t.length||"object"!=typeof t[0]||t[0]instanceof Array||t.shift();t.length;)n.push(u(t.shift()));return n.join("\n\n")}}(function(){return e}())},function(t,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(t){if(u===setTimeout)return setTimeout(t,0);if((u===n||!u)&&setTimeout)return u=setTimeout,setTimeout(t,0);try{return u(t,0)}catch(e){try{return u.call(null,t,0)}catch(e){return u.call(this,t,0)}}}function o(t){if(p===clearTimeout)return clearTimeout(t);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(t);try{return p(t)}catch(e){try{return p.call(null,t)}catch(e){return p.call(this,t)}}}function a(){g&&f&&(g=!1,f.length?d=f.concat(d):m=-1,d.length&&s())}function s(){if(!g){var t=i(a);g=!0;for(var e=d.length;e;){for(f=d,d=[];++m<e;)f&&f[m].run();m=-1,e=d.length}f=null,g=!1,o(t)}}function c(t,e){this.fun=t,this.array=e}function l(){}var u,p,h=t.exports={};!function(){try{u="function"==typeof setTimeout?setTimeout:n}catch(t){u=n}try{p="function"==typeof clearTimeout?clearTimeout:r}catch(t){p=r}}();var f,d=[],g=!1,m=-1;h.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];d.push(new c(t,e)),1!==d.length||g||i(s)},c.prototype.run=function(){this.fun.apply(null,this.array)},h.title="browser",h.browser=!0,h.env={},h.argv=[],h.version="",h.versions={},h.on=l,h.addListener=l,h.once=l,h.off=l,h.removeListener=l,h.removeAllListeners=l,h.emit=l,h.binding=function(t){throw new Error("process.binding is not supported")},h.cwd=function(){return"/"},h.chdir=function(t){throw new Error("process.chdir is not supported")},h.umask=function(){return 0}},function(t,e){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},function(t,e){t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},function(t,e,n){(function(t,r){function i(t,n){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(n)?r.showHidden=n:n&&e._extend(r,n),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),c(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function c(t,n,r){if(t.customInspect&&n&&T(n.inspect)&&n.inspect!==e.inspect&&(!n.constructor||n.constructor.prototype!==n)){var i=n.inspect(r,t);return _(i)||(i=c(t,i,r)),i}var o=l(t,n);if(o)return o;var a=Object.keys(n),g=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return u(n);if(0===a.length){if(T(n)){var m=n.name?": "+n.name:"";return t.stylize("[Function"+m+"]","special")}if(w(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(C(n))return t.stylize(Date.prototype.toString.call(n),"date");if(S(n))return u(n)}var y="",v=!1,b=["{","}"];if(d(n)&&(v=!0,b=["[","]"]),T(n)){var x=n.name?": "+n.name:"";y=" [Function"+x+"]"}if(w(n)&&(y=" "+RegExp.prototype.toString.call(n)),C(n)&&(y=" "+Date.prototype.toUTCString.call(n)),S(n)&&(y=" "+u(n)),0===a.length&&(!v||0==n.length))return b[0]+y+b[1];if(r<0)return w(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special");t.seen.push(n);var k;return k=v?p(t,n,r,g,a):a.map(function(e){return h(t,n,r,g,e,v)}),t.seen.pop(),f(k,y,b)}function l(t,e){if(x(e))return t.stylize("undefined","undefined");if(_(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return v(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function u(t){return"["+Error.prototype.toString.call(t)+"]"}function p(t,e,n,r,i){for(var o=[],a=0,s=e.length;a<s;++a)O(e,String(a))?o.push(h(t,e,n,r,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,n,r,i,!0))}),o}function h(t,e,n,r,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?s=l.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(s=m(n)?c(t,l.value,null):c(t,l.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n"))):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function f(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function y(t){return null==t}function v(t){return"number"==typeof t}function _(t){return"string"==typeof t}function b(t){return"symbol"==typeof t}function x(t){return void 0===t}function w(t){return k(t)&&"[object RegExp]"===$(t)}function k(t){return"object"==typeof t&&null!==t}function C(t){return k(t)&&"[object Date]"===$(t)}function S(t){return k(t)&&("[object Error]"===$(t)||t instanceof Error)}function T(t){return"function"==typeof t}function j(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function $(t){return Object.prototype.toString.call(t)}function R(t){return t<10?"0"+t.toString(10):t.toString(10)}function I(){var t=new Date,e=[R(t.getHours()),R(t.getMinutes()),R(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var E=/%[sdj%]/g;e.format=function(t){if(!_(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(i(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(t).replace(E,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(t){return"[Circular]"}default:return t}}),s=r[n];n<o;s=r[++n])a+=m(s)||!k(s)?" "+s:" "+i(s);return a},e.deprecate=function(n,i){function o(){if(!a){if(r.throwDeprecation)throw new Error(i);r.traceDeprecation?console.trace(i):console.error(i),a=!0}return n.apply(this,arguments)}if(x(t.process))return function(){return e.deprecate(n,i).apply(this,arguments)};if(r.noDeprecation===!0)return n;var a=!1;return o};var B,L={};e.debuglog=function(t){if(x(B)&&(B={NODE_ENV:"production"}.NODE_DEBUG||""),t=t.toUpperCase(),!L[t])if(new RegExp("\\b"+t+"\\b","i").test(B)){var n=r.pid;L[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else L[t]=function(){};return L[t]},e.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=y,e.isNumber=v,e.isString=_,e.isSymbol=b,e.isUndefined=x,e.isRegExp=w,e.isObject=k,e.isDate=C,e.isError=S,e.isFunction=T,e.isPrimitive=j,e.isBuffer=n(53);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=n(52),e._extend=function(t,e){if(!e||!k(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(e,n(5),n(51))},function(t,e,n){var r,i;n(57),r=n(47);var o=n(56);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"aside",i.render=o.render,i.staticRenderFns=o.staticRenderFns,
t.exports=r},function(module,exports){module.exports={render:function(){with(this)return author.loginname?_h("el-card",{attrs:{"body-style":bodyStyle}},[_h("div",{slot:"header",staticClass:"clearfix"},[hasRecent?_h("span",["作者信息"]):_h("span",["个人信息"])," "])," ",_h("div",{staticClass:"text"},[_h("router-link",{staticClass:"author-avatar",attrs:{to:{name:"user",params:{name:author.loginname}}}},[_h("img",{staticClass:"img",attrs:{src:author.avatar_url,alt:""}})])," ",_h("section",{staticClass:"author-info"},[_h("router-link",{staticClass:"author-name",attrs:{to:{name:"user",params:{name:author.loginname}}}},[_h("span",{domProps:{textContent:_s(author.loginname)}})])," ",_h("p",{staticClass:"author-detail"},[_h("span",{staticClass:"author-score"},["积分:"+_s(author.score)])])])," ",hasRecent?_h("section",{staticClass:"author-recent-topic"},[_m(0)," ",_h("main",{staticClass:"topic-list"},[_h("ul",[_l(recentLength,function(t){return author.recent_topics[t-1].id!==topicId?_h("li",[_h("a",{attrs:{href:"javascript:"},on:{click:function(e){e.preventDefault(),goToTopic(author.recent_topics[t-1].id)}}},[_s(author.recent_topics[t-1].title)])]):_e()})," ",author.recent_topics.length?_h("li",["..."]):_h("li",["暂无"])," "])])]):_e()])]):_e()},staticRenderFns:[function(){with(this)return _h("header",{staticClass:"title"},[_h("span",["最近其他文章"])])}]}},function(t,e,n){var r=n(48);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)},,,function(t,e){},,,,function(t,e,n){var r,i;n(101),r=n(66);var o=n(91);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"reply",i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(t,e,n){"use strict";(function(t){var r=n(64),i=n.n(r),o=n(0),a=n.n(o),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default={data:function(){return{user:{loginname:localStorage.loginname||"",accesstoken:localStorage.accesstoken||"",id:localStorage.id||""},currentReplyId:""}},props:["topic","commentList","commentCount"],watch:{commentList:function(){var t=this;this.commentList.forEach(function(e,n){a.a.set(e,"isUp",t.checkIsUp(e.ups)),a.a.set(e,"upBtn",{type:e.isUp&&"on"||"off",on:"star-on",off:"star-off",load:"loading",lock:!1,switch:function(t){this.type=t||"on"}})})}},computed:{},mounted:function(){},methods:{goLogin:function(){this.$router.replace({name:"login",query:{redirect:encodeURIComponent(this.$route.path)}})},commentUp:function(e){var n=this;if(this.user.loginname){var r=function(){if(e.author.loginname===n.user.loginname)return n.$message({showClose:!0,message:"不能给自己点赞",type:"warning"}),{v:void 0};var r=e.upBtn.type;e.upBtn.switch("load");var i=n;t.ajax({url:"https://cnodejs.org/api/v1/reply/"+e.id+"/ups",type:"POST",dataType:"json",data:{accesstoken:i.user.accesstoken}}).done(function(t){return t&&t.success?void("up"==t.action?(e.upBtn.type="on",e.ups.push(i.user.id)):"down"==t.action&&(e.upBtn.type="off",e.ups.splice(e.ups.indexOf(i.user.id),1))):void i.$message({showClose:!0,message:"操作失败",type:"warning"})}).fail(function(t){e.upBtn.type=r,i.$message({showClose:!0,message:"操作失败",type:"warning"})})}();if("object"===("undefined"==typeof r?"undefined":s(r)))return r.v}else this.goLogin()},addReply:function(t){this.user.loginname?this.currentReplyId=this.currentReplyId===t?"":t:this.goLogin()},hideReplyPanel:function(){this.currentReplyId&&(this.currentReplyId="")},checkIsUp:function(t){var e="",n=this;return e=t.find(function(t){if(t===n.user.id)return!0}),e&&!0||!1}},components:{cvReply:i.a}}}).call(e,n(2))},function(t,e,n){"use strict";(function(t){var r=n(60),i=(n.n(r),n(6)),o=n.n(i),a=n(12),s=n.n(a),c=n(49),l=n.n(c),u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},p=l.a.markdown,h=null;e.default={data:function(){return{user:{loginname:localStorage.loginname||"",accesstoken:localStorage.accesstoken||"",id:localStorage.id||"",avatar:localStorage.avatar||""},flag:(new Date).getTime(),tagText:'<br/><br/><a class="tag" target="new" href="https://github.com/BubblyPoker/cnode-vue">来自 cnode-vue</a>',placeholder:"请输入评论...",btnText:"评论",replyCache:localStorage.replyCache||""}},props:["topic","replyId","replyTo"],computed:{},created:function(){this.user.loginname||(this.placeholder="您未登录,评论将暂存...",this.btnText="登录后评论")},mounted:function(){if(this.replyId){var e=t("#answereditor"+this.flag).offset().top,n=t(window).scrollTop(),r=t(window).height();e>n+r&&t("body").animate({scrollTop:t("#answereditor"+this.flag).offset().top-r/3},500)}h=new o.a({element:document.getElementById("answereditor"+this.flag),forceSync:!0,toolbarTips:!0,showIcons:["bold","italic","strikethrough","heading","heading-smaller","heading-bigger","heading-1","heading-2","heading-3","code","quote","unordered-list","ordered-list","clean-block","link","image","table","horizontal-rule","preview","side-by-side","fullscreen","guide"]}),this.replyTo&&h.value("@"+this.replyTo),this.topic.id===localStorage.topicId&&this.replyCache&&h.value(this.replyCache)},methods:{unLoginHandle:function(){var t=document.getElementById("answereditor"+this.flag).value;t&&(localStorage.topicId=this.topic.id,localStorage.replyCache=t),this.$router.replace({name:"login",query:{redirect:encodeURIComponent(this.$route.path)}})},clearReplyCache:function(){this.replyCache="",localStorage.removeItem("topicId"),localStorage.removeItem("replyCache")},reply:function(){var e=this;if(this.user.loginname){var n=function(){var n=e,r=document.getElementById("answereditor"+e.flag).value||"";if(!r)return n.$message({showClose:!0,message:"请输入评论内容",type:"warning"}),{v:void 0};var i=s.a.linkUsers(r),o=p.toHTML(i)+n.tagText,a=t('<div class="markdown-text"></div>').append(o)[0].outerHTML,c=new Date,l={accesstoken:n.user.accesstoken,content:r+n.tagText};n.replyId&&(l.reply_id=n.replyId),t.ajax({url:"https://cnodejs.org/api/v1/topic/"+n.topic.id+"/replies",type:"POST",dataType:"json",data:l}).done(function(t){return t&&t.success?(n.$message({showClose:!0,message:"评论成功",type:"success"}),n.topic.replies.push({id:t.reply_id,author:{loginname:n.user.loginname,avatar_url:n.user.avatar},content:a,ups:[],create_at:c}),h.value(""),n.$emit("hideReplyPanel"),void e.clearReplyCache()):void n.$message({showClose:!0,message:"操作失败",type:"warning"})}).fail(function(t){n.$message({showClose:!0,message:"操作失败",type:"warning"})})}();if("object"===("undefined"==typeof n?"undefined":u(n)))return n.v}else this.unLoginHandle()}},components:{}}}).call(e,n(2))},,,,,,,function(t,e,n){"use strict";(function(t){var r=n(39),i=n.n(r),o=n(44),a=n.n(o),s=n(55),c=n.n(s),l=n(86),u=n.n(l),p=n(64),h=n.n(p);e.default={data:function(){return{topic:{id:this.$route.params.id,author:{loginname:""}},collectBtn:{type:"off",on:"el-icon-star-on",off:"el-icon-star-off",load:"el-icon-loading",lock:!1,switch:function(t){this.type=t||"on"}},user:{accesstoken:localStorage.accesstoken||"",loginname:localStorage.loginname||""},loading:{showLoading:!1,show:function(){this.showLoading=!0},hide:function(){this.showLoading=!1}},topicerror:!1}},computed:{},created:function(){this.fetchTopicData()},mounted:function(){},watch:{$route:function(t,e){t.name===e.name&&(this.topic.id=t.params.id,this.collectBtn.type="off",this.fetchTopicData())}},methods:{fetchTopicData:function(){var e=this,n=this;n.loading.show(),t.ajax({url:"https://cnodejs.org/api/v1/topic/"+n.topic.id,type:"GET",dataType:"json",data:{mdrender:!0,accesstoken:n.user.accesstoken}}).done(function(t){n.loading.hide(),t&&t.success&&(n.topic=t.data||n.topic,n.topic.typeClass=e.getTypeClass(n.topic.top,n.topic.good,n.topic.tab),n.topic.is_collect&&(n.collectBtn.type="on"))}).fail(function(t){n.loading.hide(),n.topicerror=!0,n.$message({showClose:!0,message:JSON.parse(t.responseText).error_msg||"获取数据失败",type:"warning"})})},topicCollect:function(){if(!this.collectBtn.lock){var e=this,n="https://cnodejs.org/api/v1/topic_collect/collect",r="on"===e.collectBtn.type;e.collectBtn.switch("load"),e.collectBtn.lock=!0,r&&(n="https://cnodejs.org/api/v1/topic_collect/de_collect"),t.ajax({url:n,type:"POST",dataType:"json",data:{topic_id:e.topic.id,accesstoken:e.user.accesstoken}}).done(function(t){return t&&t.success?(e.$message({showClose:!0,message:(r&&"取消"||"")+"收藏成功",type:"success"}),e.collectBtn.switch(r&&"off"||"on"),e.topic.is_collect=!r,void(e.collectBtn.lock=!1)):void e.$message({showClose:!0,message:"操作失败",type:"warning"})}).fail(function(t){e.error=!0,e.$message({showClose:!0,message:"操作失败",type:"warning"})})}},topicEdit:function(){if(this.user.accesstoken){var t={tab:this.topic.tab,title:this.topic.title,content:""};localStorage.editTopic=JSON.stringify(t),this.$router.push({name:"edittopic",params:{id:this.topic.id}})}else this.$router.push({name:"login",query:{redirect:encodeURIComponent(this.$route.path)}})},getTypeClass:function(t,e,n){return t?"success":e?"danger":"ask"==n?"primary":"job"==n?"warning":"share"==n?"":(t||e||n)&&this.$route.query.tab!==n?"":"hidden"}},components:{cvHead:i.a,cvAside:c.a,cvComment:u.a,cvReply:h.a,cvLoading:a.a}}}).call(e,n(2))},,function(t,e,n){e=t.exports=n(3)(),e.push([t.i,"\n.comment {\n display: -webkit-flex;\n display: -ms-flex;\n display: flex;\n flex-flow: row nowrap;\n border-top: 1px solid rgba(160, 160, 160, 0.2);\n padding: 10px 0;\n}\n.comment:first-of-type {\n border-top: none;\n}\n.comment .comment-avatar {\n flex: 1 0 30px;\n}\n.comment .comment-avatar img {\n max-width: 100%;\n border-radius: 3px;\n}\n.comment .comment-detail {\n margin-left: 20px;\n width: 100%;\n overflow: auto;\n}\n.comment .comment-detail .name {\n color: #666;\n font-size: 12px;\n}\n.comment .comment-detail .time, .comment .comment-detail .floor {\n margin-left: 10px;\n color: #08c;\n font-size: 11px;\n}\n.comment .comment-detail .comment-action {\n float: right;\n}\n.comment .comment-detail .comment-action .comment-reply {\n margin-left: 10px;\n}\n.comment .comment-detail .comment-content {\n margin-top: 5px;\n}\n",""])},,,,function(t,e,n){e=t.exports=n(3)(),e.push([t.i,"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n",""])},,,,function(t,e,n){e=t.exports=n(3)(),e.push([t.i,'\n@charset "UTF-8";\n#container #topic-detail .title {\n font-size: 18px;\n display: inline;\n}\n#container #topic-detail .topic-info {\n margin-top: 10px;\n position: relative;\n}\n#container #topic-detail .topic-info span {\n font-size: 12px;\n margin-left: 10px;\n display: inline-block;\n color: #838383;\n}\n#container #topic-detail .topic-info span:before {\n content: "\\2022";\n margin-right: 5px;\n}\n#container #topic-detail .topic-info .actionBtn {\n color: #20a0ff;\n position: absolute;\n bottom: -12px;\n right: 0;\n}\n#container #topic-detail .topic-info .actionBtn.editBtn {\n right: 60px;\n}\n',""])},,,function(t,e,n){var r,i;n(97),r=n(65);var o=n(87);i=r=r||{},"object"!=typeof r.default&&"function"!=typeof r.default||(i=r=r.default),"function"==typeof i&&(i=i.options),i.name=i.name||"comment",i.render=o.render,i.staticRenderFns=o.staticRenderFns,t.exports=r},function(module,exports){module.exports={render:function(){with(this)return _h("el-row",{staticClass:"cv-panel",attrs:{id:"comment-panel"}},[_h("el-col",{attrs:{span:24,id:"comment-panel"}},[_h("div",{staticClass:"grid-content bg-purple"},[_h("el-card",{staticClass:"box-card"},[_h("div",{slot:"header",staticClass:"clearfix"},[commentCount?_h("span",[_s(commentCount)+" 条评论"]):_h("span",["暂无评论"])," "])," ",_h("main",{staticClass:"markdown-body comment-area"},[_l(commentList,function(t,e){return _h("article",{staticClass:"comment"},[_h("router-link",{staticClass:"comment-avatar",attrs:{to:{name:"user",params:{name:t.author.loginname}}}},[_h("img",{staticClass:"img",attrs:{src:t.author.avatar_url,alt:""}})])," ",_h("section",{staticClass:"comment-detail"},[_h("header",{staticClass:"comment-title"},[_h("span",{staticClass:"name",domProps:{textContent:_s(t.author.loginname)}})," ",_h("span",{staticClass:"floor"},[_s(e+1)+"楼"])," ",_h("span",{staticClass:"time"},["发布于 "+_s(_f("getDateFromNow")(t.create_at))])," ",_h("el-button-group",{staticClass:"comment-action"},[t.upBtn?_h("el-button",{staticClass:"comment-up nopadding",attrs:{type:"text",plain:!0,icon:t.upBtn[t.upBtn.type],disabled:t.author.loginname===user.loginname},nativeOn:{click:function(e){commentUp(t)}}},[_s(t.ups.length)]):_e()," ",_h("el-button",{staticClass:"comment-reply nopadding",attrs:{plain:!0,type:"text",icon:"edit",show:currentReplyId},nativeOn:{click:function(e){addReply(t.id)}}})])])," ",_h("main",{staticClass:"comment-content"},[_h("p",{staticClass:"content",domProps:{innerHTML:_s(t.content)}})])," ",currentReplyId===t.id?_h("cvReply",{attrs:{topic:topic,"reply-id":t.id,"reply-to":t.author.loginname},on:{hideReplyPanel:hideReplyPanel}}):_e()])])})])])])])])},staticRenderFns:[]}},,,,function(module,exports){module.exports={render:function(){with(this)return _h("section",{staticClass:"reply-panel"},[_h("textarea",{attrs:{id:"answereditor"+flag,placeholder:placeholder,autofocus:""}})," ",_h("el-button",{attrs:{type:"primary"},nativeOn:{click:function(t){reply(t)}}},[_s(btnText)])])},staticRenderFns:[]}},,,,function(module,exports){module.exports={render:function(){with(this)return _h("div",{attrs:{id:"container"}},[_h("cvHead")," ",topicerror?_e():_h("main",{attrs:{id:"main"}},[_h("el-row",{attrs:{gutter:20}},[_h("el-col",{attrs:{span:18}},[_h("el-row",[_h("el-col",{attrs:{span:24,id:"topic-detail"}},[_h("div",{staticClass:"grid-content bg-purple"},[_h("el-card",{staticClass:"box-card"},[_h("div",{slot:"header",staticClass:"clearfix"},[_h("div",{staticClass:"topic-title"},[_h("el-tag",{class:topic.typeClass,attrs:{type:topic.typeClass,hit:!1}},[_s(_f("getArticleType")(topic.top,topic.good,topic.tab))])," ",_h("h1",{staticClass:"title",domProps:{textContent:_s(topic.title)}})])," ",_h("p",{staticClass:"topic-info"},[_h("span",["发布于 "+_s(_f("getDateFromNow")(topic.create_at))])," "," ",topic.author?_h("span",["作者 "+_s(topic.author.loginname)]):_e()," ",_h("span",[_s(topic.visit_count)+" 次浏览"])," ",topic.replies?_h("span",[_s(topic.replies.length)+" 评论"]):_e()," ",_h("span",["来自 "+_s(_f("getArticleType")(topic.top,topic.good,topic.tab))])," ",user.loginname&&user.loginname==topic.author.loginname?_h("el-button",{staticClass:"editBtn actionBtn",attrs:{type:"text"},nativeOn:{click:function(t){topicEdit(t)}}},[_m(0),"编辑\n "]):_e()," ",user.loginname?_h("el-button",{staticClass:"collectBtn actionBtn",attrs:{type:"text"},nativeOn:{click:function(t){topicCollect(t)}}},[_h("i",{class:collectBtn[collectBtn.type]}),"\n "+_s(topic.is_collect&&"已"||"")+"收藏\n "]):_e()])])," ",_h("main",{staticClass:"markdown-body topic-content",domProps:{innerHTML:_s(topic.content)}})])])])])," ",_h("cvComment",{attrs:{topic:topic,"comment-list":topic.replies,"comment-count":topic.reply_count}})," ",_h("el-row",{staticClass:"cv-panel",attrs:{id:"reply-panel"}},[_h("el-col",{attrs:{span:24,id:"topic-detail"}},[_h("div",{staticClass:"grid-content bg-purple"},[_h("el-card",{staticClass:"box-card"},[_h("div",{slot:"header",staticClass:"clearfix"},[_m(1)])," ",_h("main",{staticClass:"markdown-body reply-content"},[_h("cvReply",{attrs:{topic:topic}})])])])])])])," ",_h("el-col",{attrs:{span:6}},[_h("div",{staticClass:"grid-content bg-purple"},[topic.author?_h("cvAside",{attrs:{"topic-id":topic.id,hasRecent:!0,"author-name":topic.author.loginname}}):_e()])])])])," ",_h("cvLoading",{attrs:{"show-loading":loading.showLoading}})])},staticRenderFns:[function(){with(this)return _h("i",{staticClass:"el-icon-edit"})},function(){with(this)return _h("span",["回复评论"])}]}},,function(t,e,n){var r=n(75);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)},,,,function(t,e,n){var r=n(79);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)},,,,function(t,e,n){var r=n(83);"string"==typeof r&&(r=[[t.i,r,""]]),n(4)(r,{}),r.locals&&(t.exports=r.locals)}]));