Commit 6f0f2b5b authored by Van's avatar Van

math 改进

parent 12f7594d
......@@ -106,13 +106,11 @@ var Util = {
if ($(this).text().split('$').length > 2 ||
($(this).text().split('\\(').length > 1 &&
$(this).text().split('\\)').length > 1)) {
hasMathJax = true;
return false;
hasMathJax = true
}
});
})
if ($(this).find('code.lang-flow, code.language-flow').length > 0) {
hasFlow = true
return false;
}
});
......@@ -120,27 +118,30 @@ var Util = {
var initMathJax = function () {
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$', '$'], ["\\(", "\\)"]],
inlineMath: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['pre', 'code', 'script']
skipTags: ['pre', 'code', 'script'],
},
asciimath2jax: {
delimiters: [['$','$']]
}
});
MathJax.Hub.Typeset();
};
})
MathJax.Hub.Typeset()
}
if (typeof MathJax !== 'undefined') {
initMathJax();
initMathJax()
} else {
$.ajax({
method: "GET",
url: "https://cdn.staticfile.org/MathJax/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&_=1473258780393",
dataType: "script",
cache: true
method: 'GET',
url: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML',
dataType: 'script',
cache: true,
}).done(function () {
initMathJax();
});
initMathJax()
})
}
}
......
......@@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Util={isArticlePage:function(e){var t=!0;return-1<e.indexOf(latkeConfig.servePath+"/tags/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/tags.html")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/category/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/archives.html")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/archives/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/links.html")&&(t=!1),e===latkeConfig.servePath&&(t=!1),/^[0-9]*$/.test(e.replace(latkeConfig.servePath+"/",""))&&(t=!1),t},initPjax:function(e){1===$("#pjax").length&&($.pjax({selector:"a",container:"#pjax",show:"",cache:!1,storage:!0,titleSuffix:"",filter:function(e){return e===latkeConfig.servePath+"/rss.xml"||-1<e.indexOf(latkeConfig.servePath+"/admin-index.do")||!(-1<e.indexOf(latkeConfig.servePath))},callback:function(){e&&e()}}),NProgress.configure({showSpinner:!1}),$("#pjax").bind("pjax.start",function(){NProgress.start()}),$("#pjax").bind("pjax.end",function(){window.scroll(window.scrollX,0),NProgress.done()}))},parseMarkdown:function(){var e=!1,t=!1,i="content-reset";if($("."+i).each(function(){if($(this).find("p").each(function(){if(2<$(this).text().split("$").length||1<$(this).text().split("\\(").length&&1<$(this).text().split("\\)").length)return!(e=!0)}),0<$(this).find("code.lang-flow, code.language-flow").length)return!(t=!0)}),e){var n=function(){MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"]],processEscapes:!0,processEnvironments:!0,skipTags:["pre","code","script"]}}),MathJax.Hub.Typeset()};"undefined"!=typeof MathJax?n():$.ajax({method:"GET",url:"https://cdn.staticfile.org/MathJax/MathJax-2.6-latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML&_=1473258780393",dataType:"script",cache:!0}).done(function(){n()})}if(t){var o=function(){$("."+i+" code.lang-flow, ."+i+" code.language-flow").each(function(e){var t=$(this),i="symFlow"+(new Date).getTime()+e;t.hide();var n=flowchart.parse($.trim(t.text()));t.parent().after('<div style="text-align: center" id="'+i+'"></div>'),n.drawSVG(i),t.parent().remove(),$("#"+i).find("svg").height("auto").width("auto")})};"undefined"!=typeof flowchart?o():$.ajax({method:"GET",url:latkeConfig.staticServePath+"/js/lib/flowchart/flowchart.min.js",dataType:"script",cache:!0}).done(function(){o()})}},killIE:function(e){var t=navigator.userAgent.split("MSIE")[1];t&&(e||(e=7),parseFloat(t.split(";"))<=e&&function(){if(""===Cookie.readCookie("showKill"))try{var t="<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:"+($(window).width()-781)/2+"px;z-index:120;top: "+($(window).height()-680)/2+"px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='"+latkeConfig.servePath+"/kill-browser'></iframe>";$("body").append(t)}catch(e){t="<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:10px;z-index:120;top: 0px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='"+latkeConfig.servePath+"/kill-browser'></iframe>",document.body.innerHTML=document.body.innerHTML+t}}())},replaceEmString:function(e){var t=e.split("[em");if(1===t.length)return e;e=t[0];for(var i=1;i<t.length;i++){var n=t[i].substr(0,2);e+="<img width='20' src='"+latkeConfig.staticServePath+"/images/emotions/em"+n+".png' alt='"+Label["em"+n+"Label"]+"' title='"+Label["em"+n+"Label"]+"'/> "+t[i].substr(3)}return e},switchMobile:function(e){Cookie.createCookie("btouch_switch_toggle",e,365),setTimeout(function(){location.reload()},1250)},setTopBar:function(){var e=$("#top");if(1===e.length){var t=$("#showTop");t.click(function(){e.slideDown(),t.hide()}),$("#hideTop").click(function(){e.slideUp(),t.show()})}},goTop:function(){$("html, body").animate({scrollTop:0},800)},goBottom:function(e){e||(e=0);var t=$("body").height()>$(document).height()?$("body").height():$(document).height();window.scrollTo(0,t-$(window).height()-e)},init:function(){Util.killIE(),Util.setTopBar(),Util.parseMarkdown(),Util.initSW()},initSW:function(){navigator.serviceWorker&&navigator.serviceWorker.register("/sw.js",{scope:"/"})},replaceSideEm:function(e){for(var t=0;t<e.length;t++){var i=$(e[t]);i.html(Util.replaceEmString(i.html()))}},buildTags:function(e){e=e||"tags";for(var t=["tags1","tags2","tags3","tags4","tags5"],i=$("#"+e+" b").get(),n=parseInt($("#"+e+" b").last().text()),o=Math.ceil(n/t.length),a=0;a<i.length;a++)for(var r=parseInt(i[a].innerHTML),s=0;s<t.length;s++)if(s*o<r&&r<=(s+1)*o){i[a].parentNode.className=t[s];break}$("#"+e).html($("#"+e+" li").get().sort(function(e,t){var i=$(e).find("span").text().toLowerCase(),n=$(t).find("span").text().toLowerCase();return i.localeCompare(n)}))},toDate:function(e,t){var i=new Date(e),n={"M+":i.getMonth()+1,"d+":i.getDate(),"H+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};for(var o in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(i.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+o+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return t}};if(!Cookie)var Cookie={readCookie:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return""},eraseCookie:function(e){this.createCookie(e,"",-1)},createCookie:function(e,t,i){var n="";if(i){var o=new Date;o.setTime(o.getTime()+24*i*60*60*1e3),n="; expires="+o.toGMTString()}document.cookie=e+"="+encodeURIComponent(t)+n+"; path=/"}};
\ No newline at end of file
var Util={isArticlePage:function(e){var t=!0;return-1<e.indexOf(latkeConfig.servePath+"/tags/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/tags.html")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/category/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/archives.html")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/archives/")&&(t=!1),-1<e.indexOf(latkeConfig.servePath+"/links.html")&&(t=!1),e===latkeConfig.servePath&&(t=!1),/^[0-9]*$/.test(e.replace(latkeConfig.servePath+"/",""))&&(t=!1),t},initPjax:function(e){1===$("#pjax").length&&($.pjax({selector:"a",container:"#pjax",show:"",cache:!1,storage:!0,titleSuffix:"",filter:function(e){return e===latkeConfig.servePath+"/rss.xml"||-1<e.indexOf(latkeConfig.servePath+"/admin-index.do")||!(-1<e.indexOf(latkeConfig.servePath))},callback:function(){e&&e()}}),NProgress.configure({showSpinner:!1}),$("#pjax").bind("pjax.start",function(){NProgress.start()}),$("#pjax").bind("pjax.end",function(){window.scroll(window.scrollX,0),NProgress.done()}))},parseMarkdown:function(){var e=!1,t=!1,i="content-reset";if($("."+i).each(function(){$(this).find("p").each(function(){(2<$(this).text().split("$").length||1<$(this).text().split("\\(").length&&1<$(this).text().split("\\)").length)&&(e=!0)}),0<$(this).find("code.lang-flow, code.language-flow").length&&(t=!0)}),e){var n=function(){MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"]],processEscapes:!0,processEnvironments:!0,skipTags:["pre","code","script"]},asciimath2jax:{delimiters:[["$","$"]]}}),MathJax.Hub.Typeset()};"undefined"!=typeof MathJax?n():$.ajax({method:"GET",url:"https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML",dataType:"script",cache:!0}).done(function(){n()})}if(t){var o=function(){$("."+i+" code.lang-flow, ."+i+" code.language-flow").each(function(e){var t=$(this),i="symFlow"+(new Date).getTime()+e;t.hide();var n=flowchart.parse($.trim(t.text()));t.parent().after('<div style="text-align: center" id="'+i+'"></div>'),n.drawSVG(i),t.parent().remove(),$("#"+i).find("svg").height("auto").width("auto")})};"undefined"!=typeof flowchart?o():$.ajax({method:"GET",url:latkeConfig.staticServePath+"/js/lib/flowchart/flowchart.min.js",dataType:"script",cache:!0}).done(function(){o()})}},killIE:function(e){var t=navigator.userAgent.split("MSIE")[1];t&&(e||(e=7),parseFloat(t.split(";"))<=e&&function(){if(""===Cookie.readCookie("showKill"))try{var t="<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:"+($(window).width()-781)/2+"px;z-index:120;top: "+($(window).height()-680)/2+"px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='"+latkeConfig.servePath+"/kill-browser'></iframe>";$("body").append(t)}catch(e){t="<div style='display: block; height: 100%; width: 100%; position: fixed; background-color: rgb(0, 0, 0); opacity: 0.6;filter: alpha(opacity=60); top: 0px;z-index:110'></div><iframe style='left:10px;z-index:120;top: 0px; position: fixed; border: 0px none; width: 781px; height: 680px;' src='"+latkeConfig.servePath+"/kill-browser'></iframe>",document.body.innerHTML=document.body.innerHTML+t}}())},replaceEmString:function(e){var t=e.split("[em");if(1===t.length)return e;e=t[0];for(var i=1;i<t.length;i++){var n=t[i].substr(0,2);e+="<img width='20' src='"+latkeConfig.staticServePath+"/images/emotions/em"+n+".png' alt='"+Label["em"+n+"Label"]+"' title='"+Label["em"+n+"Label"]+"'/> "+t[i].substr(3)}return e},switchMobile:function(e){Cookie.createCookie("btouch_switch_toggle",e,365),setTimeout(function(){location.reload()},1250)},setTopBar:function(){var e=$("#top");if(1===e.length){var t=$("#showTop");t.click(function(){e.slideDown(),t.hide()}),$("#hideTop").click(function(){e.slideUp(),t.show()})}},goTop:function(){$("html, body").animate({scrollTop:0},800)},goBottom:function(e){e||(e=0);var t=$("body").height()>$(document).height()?$("body").height():$(document).height();window.scrollTo(0,t-$(window).height()-e)},init:function(){Util.killIE(),Util.setTopBar(),Util.parseMarkdown(),Util.initSW()},initSW:function(){navigator.serviceWorker&&navigator.serviceWorker.register("/sw.js",{scope:"/"})},replaceSideEm:function(e){for(var t=0;t<e.length;t++){var i=$(e[t]);i.html(Util.replaceEmString(i.html()))}},buildTags:function(e){e=e||"tags";for(var t=["tags1","tags2","tags3","tags4","tags5"],i=$("#"+e+" b").get(),n=parseInt($("#"+e+" b").last().text()),o=Math.ceil(n/t.length),a=0;a<i.length;a++)for(var r=parseInt(i[a].innerHTML),s=0;s<t.length;s++)if(s*o<r&&r<=(s+1)*o){i[a].parentNode.className=t[s];break}$("#"+e).html($("#"+e+" li").get().sort(function(e,t){var i=$(e).find("span").text().toLowerCase(),n=$(t).find("span").text().toLowerCase();return i.localeCompare(n)}))},toDate:function(e,t){var i=new Date(e),n={"M+":i.getMonth()+1,"d+":i.getDate(),"H+":i.getHours(),"m+":i.getMinutes(),"s+":i.getSeconds(),"q+":Math.floor((i.getMonth()+3)/3),S:i.getMilliseconds()};for(var o in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(i.getFullYear()+"").substr(4-RegExp.$1.length))),n)new RegExp("("+o+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?n[o]:("00"+n[o]).substr((""+n[o]).length)));return t}};if(!Cookie)var Cookie={readCookie:function(e){for(var t=e+"=",i=document.cookie.split(";"),n=0;n<i.length;n++){for(var o=i[n];" "==o.charAt(0);)o=o.substring(1,o.length);if(0==o.indexOf(t))return decodeURIComponent(o.substring(t.length,o.length))}return""},eraseCookie:function(e){this.createCookie(e,"",-1)},createCookie:function(e,t,i){var n="";if(i){var o=new Date;o.setTime(o.getTime()+24*i*60*60*1e3),n="; expires="+o.toGMTString()}document.cookie=e+"="+encodeURIComponent(t)+n+"; path=/"}};
\ No newline at end of file
/*!
* Vditor v0.2.5 - A markdown editor written in TypeScript.
*
* MIT License
*
* Copyright (c) 2019 B3log 开源, b3log.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/@-webkit-keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}@keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}.vditor-tooltipped{position:relative;cursor:pointer}.vditor-tooltipped:after{z-index:1000000;padding:5px 8px;font-size:11px;font-weight:400;-webkit-font-smoothing:subpixel-antialiased;color:#fff;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;content:attr(aria-label);background:rgba(0,0,0,.8);border-radius:3px;line-height:16px}.vditor-tooltipped:after,.vditor-tooltipped:before{position:absolute;display:none;pointer-events:none;opacity:0}.vditor-tooltipped:before{z-index:1000001;width:0;height:0;color:rgba(0,0,0,.8);content:"";border:5px solid transparent}.vditor-tooltipped--hover:after,.vditor-tooltipped--hover:before,.vditor-tooltipped:active:after,.vditor-tooltipped:active:before,.vditor-tooltipped:focus:after,.vditor-tooltipped:focus:before,.vditor-tooltipped:hover:after,.vditor-tooltipped:hover:before{display:inline-block;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:.4s;animation-delay:.4s}.vditor-tooltipped__s:after,.vditor-tooltipped__se:after,.vditor-tooltipped__sw:after{top:100%;right:50%;margin-top:5px}.vditor-tooltipped__s:before,.vditor-tooltipped__se:before,.vditor-tooltipped__sw:before{top:auto;right:50%;bottom:-5px;margin-right:-5px;border-bottom-color:rgba(0,0,0,.8)}.vditor-tooltipped__se:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__sw:after{margin-right:-15px}.vditor-tooltipped__n:after,.vditor-tooltipped__ne:after,.vditor-tooltipped__nw:after{right:50%;bottom:100%;margin-bottom:5px}.vditor-tooltipped__n:before,.vditor-tooltipped__ne:before,.vditor-tooltipped__nw:before{top:-5px;right:50%;bottom:auto;margin-right:-5px;border-top-color:rgba(0,0,0,.8)}.vditor-tooltipped__ne:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__nw:after{margin-right:-15px}.vditor-tooltipped__n:after,.vditor-tooltipped__s:after{-webkit-transform:translateX(50%);transform:translateX(50%)}.vditor-tooltipped__w:after{right:100%;bottom:50%;margin-right:5px;-webkit-transform:translateY(50%);transform:translateY(50%)}.vditor-tooltipped__w:before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:rgba(0,0,0,.8)}.vditor-tooltipped__e:after{bottom:50%;left:100%;margin-left:5px;-webkit-transform:translateY(50%);transform:translateY(50%)}.vditor-tooltipped__e:before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:rgba(0,0,0,.8)}.vditor-panel{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,.2);border-radius:3px;padding:5px;z-index:1;font-size:14px;display:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:200px;min-width:80px}.vditor-panel h1,.vditor-panel h2,.vditor-panel h3,.vditor-panel h4,.vditor-panel h5,.vditor-panel h6{margin:0;cursor:pointer;padding:3px 10px;border-radius:3px;line-height:normal}.vditor-panel h1:hover,.vditor-panel h2:hover,.vditor-panel h3:hover,.vditor-panel h4:hover,.vditor-panel h5:hover,.vditor-panel h6:hover{background-color:#4285f4;color:#fff}.vditor-toolbar{background-color:#f6f8fa;border-bottom:1px solid #d1d5da;padding:0 5px;border-radius:3px 3px 0 0}.vditor-toolbar>div{padding:10px 5px;float:left;line-height:14px;height:36px;box-sizing:border-box}.vditor-toolbar svg{fill:currentColor;display:inline-block;stroke-width:0;stroke:currentColor;width:14px;height:14px}.vditor-toolbar .vditor-tooltipped{color:#586069}.vditor-toolbar .vditor-tooltipped:hover{color:#4285f4}.vditor-toolbar label{overflow:hidden;position:relative;height:14px;width:15px;display:block;cursor:pointer}.vditor-toolbar input{position:absolute;width:1px;opacity:.001;height:14px;overflow:hidden}.vditor-menu--current svg{color:#4285f4}.vditor-menu__divider{width:10px}.vditor-menu__br{width:100%;padding:0!important;height:0!important}.vditor-emojis{display:inline-block}.vditor-emojis__tail{font-size:12px;text-align:right;color:#586069}.vditor-emojis__tail a{text-decoration:none;color:#586069}.vditor-emojis__tail a:hover{color:#4285f4}.vditor-emojis span{cursor:pointer;border-radius:3px;float:left;height:26px;width:26px;text-align:center;line-height:20px;padding:3px;box-sizing:border-box;font-size:16px}.vditor-emojis span:hover{background-color:#4285f4}.vditor-emojis img{height:20px;width:20px;float:left}.vditor{display:flex;flex-direction:column;border:1px solid #d1d5da;border-radius:3px;box-sizing:border-box}.vditor--fullscreen{position:fixed;top:0;width:100%!important;left:0;height:100vh!important;z-index:90;background-color:#fff}.vditor-content{display:flex;min-height:60px;flex:1;position:relative}.vditor-textarea{flex:1;border:0;resize:none;padding:10px;box-sizing:border-box;background-color:#fafbfc;outline:0 none;font-size:16px;line-height:22px;color:#24292e;border-radius:0 0 3px 3px}.vditor-textarea[disabled]{opacity:.3;cursor:not-allowed}.vditor-preview,.vditor-textarea:focus{background-color:#fff}.vditor-preview{flex:1;overflow:auto;padding:10px;box-shadow:inset 1px 0 #d1d5da;box-sizing:border-box;border-radius:0 0 3px 0}.vditor-preview::-webkit-scrollbar{display:none}.vditor-counter{padding:0 3px;position:absolute;bottom:10px;right:20px;color:#24292e;background-color:hsla(0,0%,100%,.6);border-radius:3px;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vditor-counter--error{color:#d23f31;background-color:rgba(210,63,49,.1)}.vditor-resize{padding:1px 0;border-radius:5px;cursor:row-resize;transition:all .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#f6f8fa}.vditor-resize:hover{background-color:#4285f4}.vditor-resize:hover svg{color:#fff}.vditor-resize svg{fill:currentColor;stroke-width:0;stroke:currentColor;width:13px;height:3px;display:block;margin:0 auto;color:#586069}.vditor-upload{opacity:0;position:absolute;width:100%;height:5px;left:0;top:-3px;border-radius:3px;overflow:hidden;transition:all .15s ease-in-out}.vditor-upload--tip{height:20px;font-size:12px;line-height:20px;color:#fff;opacity:1!important}.vditor-upload--tip .vditor-upload__close{position:absolute;right:5px;top:0;cursor:pointer;display:block}.vditor-upload--tip .vditor-upload__progress{padding:0 5px}.vditor-upload__close{display:none}.vditor-upload__progress{height:100%;background-color:rgba(66,133,244,.8);transition:all .15s ease-in-out}.vditor-hint{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,.2);border-radius:3px;padding:5px 0;z-index:1;line-height:20px;list-style:none;color:#24292e;font-size:12px;margin:0;max-width:200px;min-width:80px;display:none}.vditor-hint li{cursor:pointer;padding:3px 10px;border-bottom:1px solid #d1d5da;line-height:20px}.vditor-hint li:last-child{border-bottom:0}.vditor-hint--current,.vditor-hint li:hover{background-color:#4285f4;color:#fff}.vditor-hint__emoji{font-size:16px;float:left;margin-right:3px}.vditor-hint img{height:20px;width:20px;float:left;margin-right:3px}
\ No newline at end of file
/*!
* Vditor v0.2.5 - A markdown editor written in TypeScript.
*
* MIT License
*
* Copyright (c) 2019 B3log 开源, b3log.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/@-webkit-keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}@keyframes tooltip-appear{0%{opacity:0}to{opacity:1}}.vditor-tooltipped{position:relative;cursor:pointer}.vditor-tooltipped:after{z-index:1000000;padding:5px 8px;font-size:11px;font-weight:400;-webkit-font-smoothing:subpixel-antialiased;color:#fff;text-align:center;text-decoration:none;text-shadow:none;text-transform:none;letter-spacing:normal;word-wrap:break-word;white-space:pre;content:attr(aria-label);background:rgba(0,0,0,.8);border-radius:3px;line-height:16px}.vditor-tooltipped:after,.vditor-tooltipped:before{position:absolute;display:none;pointer-events:none;opacity:0}.vditor-tooltipped:before{z-index:1000001;width:0;height:0;color:rgba(0,0,0,.8);content:"";border:5px solid transparent}.vditor-tooltipped--hover:after,.vditor-tooltipped--hover:before,.vditor-tooltipped:active:after,.vditor-tooltipped:active:before,.vditor-tooltipped:focus:after,.vditor-tooltipped:focus:before,.vditor-tooltipped:hover:after,.vditor-tooltipped:hover:before{display:inline-block;text-decoration:none;-webkit-animation-name:tooltip-appear;animation-name:tooltip-appear;-webkit-animation-duration:.1s;animation-duration:.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;-webkit-animation-delay:.4s;animation-delay:.4s}.vditor-tooltipped__s:after,.vditor-tooltipped__se:after,.vditor-tooltipped__sw:after{top:100%;right:50%;margin-top:5px}.vditor-tooltipped__s:before,.vditor-tooltipped__se:before,.vditor-tooltipped__sw:before{top:auto;right:50%;bottom:-5px;margin-right:-5px;border-bottom-color:rgba(0,0,0,.8)}.vditor-tooltipped__se:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__sw:after{margin-right:-15px}.vditor-tooltipped__n:after,.vditor-tooltipped__ne:after,.vditor-tooltipped__nw:after{right:50%;bottom:100%;margin-bottom:5px}.vditor-tooltipped__n:before,.vditor-tooltipped__ne:before,.vditor-tooltipped__nw:before{top:-5px;right:50%;bottom:auto;margin-right:-5px;border-top-color:rgba(0,0,0,.8)}.vditor-tooltipped__ne:after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__nw:after{margin-right:-15px}.vditor-tooltipped__n:after,.vditor-tooltipped__s:after{-webkit-transform:translateX(50%);transform:translateX(50%)}.vditor-tooltipped__w:after{right:100%;bottom:50%;margin-right:5px;-webkit-transform:translateY(50%);transform:translateY(50%)}.vditor-tooltipped__w:before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:rgba(0,0,0,.8)}.vditor-tooltipped__e:after{bottom:50%;left:100%;margin-left:5px;-webkit-transform:translateY(50%);transform:translateY(50%)}.vditor-tooltipped__e:before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:rgba(0,0,0,.8)}.vditor-panel{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,.2);border-radius:3px;padding:5px;z-index:1;font-size:14px;display:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;max-width:200px;min-width:80px}.vditor-panel h1,.vditor-panel h2,.vditor-panel h3,.vditor-panel h4,.vditor-panel h5,.vditor-panel h6{margin:0;cursor:pointer;padding:3px 10px;border-radius:3px;line-height:normal}.vditor-panel h1:hover,.vditor-panel h2:hover,.vditor-panel h3:hover,.vditor-panel h4:hover,.vditor-panel h5:hover,.vditor-panel h6:hover{background-color:#2c2c2c;color:#fff}.vditor-toolbar{background-color:#2c2c2c;border-bottom:1px solid #fff;padding:0 5px;border-radius:3px 3px 0 0}.vditor-toolbar>div{padding:10px 5px;float:left;line-height:14px;height:36px;box-sizing:border-box}.vditor-toolbar svg{fill:currentColor;display:inline-block;stroke-width:0;stroke:currentColor;width:14px;height:14px}.vditor-toolbar .vditor-tooltipped{color:#b9b9b9}.vditor-toolbar .vditor-tooltipped:hover{color:#fff}.vditor-toolbar label{overflow:hidden;position:relative;height:14px;width:15px;display:block;cursor:pointer}.vditor-toolbar input{position:absolute;width:1px;opacity:.001;height:14px;overflow:hidden}.vditor-menu--current svg{color:#fff}.vditor-menu__divider{width:10px}.vditor-menu__br{width:100%;padding:0!important;height:0!important}.vditor-emojis{display:inline-block}.vditor-emojis__tail{font-size:12px;text-align:right;color:#b9b9b9}.vditor-emojis__tail a{text-decoration:none;color:#b9b9b9}.vditor-emojis__tail a:hover{color:#2c2c2c}.vditor-emojis span{cursor:pointer;border-radius:3px;float:left;height:26px;width:26px;text-align:center;line-height:20px;padding:3px;box-sizing:border-box;font-size:16px}.vditor-emojis span:hover{background-color:#2c2c2c}.vditor-emojis img{height:20px;width:20px;float:left}.vditor{display:flex;flex-direction:column;border:1px solid #fff;border-radius:3px;box-sizing:border-box}.vditor--fullscreen{position:fixed;top:0;width:100%!important;left:0;height:100vh!important;z-index:90;background-color:#fff}.vditor-content{display:flex;min-height:60px;flex:1;position:relative}.vditor-textarea{flex:1;border:0;resize:none;padding:10px;box-sizing:border-box;background-color:#fff;outline:0 none;font-size:16px;line-height:22px;color:rgba(0,0,0,.8);border-radius:0 0 3px 3px}.vditor-textarea[disabled]{opacity:.3;cursor:not-allowed}.vditor-textarea:focus{background-color:#fff}.vditor-preview{flex:1;background-color:#f3f3f3;overflow:auto;padding:10px;box-shadow:inset 1px 0 #fff;box-sizing:border-box;border-radius:0 0 3px 0}.vditor-preview::-webkit-scrollbar{display:none}.vditor-counter{padding:0 3px;position:absolute;bottom:10px;right:20px;color:rgba(0,0,0,.8);background-color:hsla(0,0%,100%,.6);border-radius:3px;font-size:12px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.vditor-counter--error{color:#d23f31;background-color:rgba(210,63,49,.1)}.vditor-resize{padding:1px 0;border-radius:5px;cursor:row-resize;transition:all .15s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:#f3f3f3}.vditor-resize:hover{background-color:#2c2c2c}.vditor-resize:hover svg{color:#fff}.vditor-resize svg{fill:currentColor;stroke-width:0;stroke:currentColor;width:13px;height:3px;display:block;margin:0 auto;color:#b9b9b9}.vditor-upload{opacity:0;position:absolute;width:100%;height:5px;left:0;top:-3px;border-radius:3px;overflow:hidden;transition:all .15s ease-in-out}.vditor-upload--tip{height:20px;font-size:12px;line-height:20px;color:#fff;opacity:1!important}.vditor-upload--tip .vditor-upload__close{position:absolute;right:5px;top:0;cursor:pointer;display:block}.vditor-upload--tip .vditor-upload__progress{padding:0 5px}.vditor-upload__close{display:none}.vditor-upload__progress{height:100%;background-color:rgba(44,44,44,.8);transition:all .15s ease-in-out}.vditor-hint{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,.2);border-radius:3px;padding:5px 0;z-index:1;line-height:20px;list-style:none;color:rgba(0,0,0,.8);font-size:12px;margin:0;max-width:200px;min-width:80px;display:none}.vditor-hint li{cursor:pointer;padding:3px 10px;border-bottom:1px solid #fff;line-height:20px}.vditor-hint li:last-child{border-bottom:0}.vditor-hint--current,.vditor-hint li:hover{background-color:#2c2c2c;color:#fff}.vditor-hint__emoji{font-size:16px;float:left;margin-right:3px}.vditor-hint img{height:20px;width:20px;float:left;margin-right:3px}
\ No newline at end of file
(window.webpackJsonpVditor=window.webpackJsonpVditor||[]).push([[1],{25:function(e,n){},26:function(e,n,t){"use strict";function r(e,n){return Array(n+1).join(e)}t.r(n);var i=["address","article","aside","audio","blockquote","body","canvas","center","dd","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frameset","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","isindex","li","main","menu","nav","noframes","noscript","ol","output","p","pre","section","table","tbody","td","tfoot","th","thead","tr","ul"];function o(e){return-1!==i.indexOf(e.nodeName.toLowerCase())}var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"];function l(e){return-1!==a.indexOf(e.nodeName.toLowerCase())}var u=a.join();var c={};function s(e){for(var n in this.options=e,this._keep=[],this._remove=[],this.blankRule={replacement:e.blankReplacement},this.keepReplacement=e.keepReplacement,this.defaultRule={replacement:e.defaultReplacement},this.array=[],e.rules)this.array.push(e.rules[n])}function f(e,n,t){for(var r=0;r<e.length;r++){var i=e[r];if(d(i,n,t))return i}}function d(e,n,t){var r=e.filter;if("string"==typeof r){if(r===n.nodeName.toLowerCase())return!0}else if(Array.isArray(r)){if(r.indexOf(n.nodeName.toLowerCase())>-1)return!0}else{if("function"!=typeof r)throw new TypeError("`filter` needs to be a string, array, or function");if(r.call(e,n,t))return!0}}function p(e){var n=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),n}function h(e,n,t){return e&&e.parentNode===n||t(n)?n.nextSibling||n.parentNode:n.firstChild||n.nextSibling||n.parentNode}c.paragraph={filter:"p",replacement:function(e){return"\n\n"+e+"\n\n"}},c.lineBreak={filter:"br",replacement:function(e,n,t){return t.br+"\n"}},c.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function(e,n,t){var i=Number(n.nodeName.charAt(1));return"setext"===t.headingStyle&&i<3?"\n\n"+e+"\n"+r(1===i?"=":"-",e.length)+"\n\n":"\n\n"+r("#",i)+" "+e+"\n\n"}},c.blockquote={filter:"blockquote",replacement:function(e){return"\n\n"+(e=(e=e.replace(/^\n+|\n+$/g,"")).replace(/^/gm,"> "))+"\n\n"}},c.list={filter:["ul","ol"],replacement:function(e,n){var t=n.parentNode;return"LI"===t.nodeName&&t.lastElementChild===n?"\n"+e:"\n\n"+e+"\n\n"}},c.listItem={filter:"li",replacement:function(e,n,t){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");var r=t.bulletListMarker+" ",i=n.parentNode;if("OL"===i.nodeName){var o=i.getAttribute("start"),a=Array.prototype.indexOf.call(i.children,n);r=(o?Number(o)+a:a+1)+". "}return r+e+(n.nextSibling&&!/\n$/.test(e)?"\n":"")}},c.indentedCodeBlock={filter:function(e,n){return"indented"===n.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,n,t){return"\n\n "+n.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},c.fencedCodeBlock={filter:function(e,n){return"fenced"===n.codeBlockStyle&&"PRE"===e.nodeName&&e.firstChild&&"CODE"===e.firstChild.nodeName},replacement:function(e,n,t){var r=((n.firstChild.className||"").match(/language-(\S+)/)||[null,""])[1];return"\n\n"+t.fence+r+"\n"+n.firstChild.textContent+"\n"+t.fence+"\n\n"}},c.horizontalRule={filter:"hr",replacement:function(e,n,t){return"\n\n"+t.hr+"\n\n"}},c.inlineLink={filter:function(e,n){return"inlined"===n.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,n){return"["+e+"]("+n.getAttribute("href")+(n.title?' "'+n.title+'"':"")+")"}},c.referenceLink={filter:function(e,n){return"referenced"===n.linkStyle&&"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,n,t){var r,i,o=n.getAttribute("href"),a=n.title?' "'+n.title+'"':"";switch(t.linkReferenceStyle){case"collapsed":r="["+e+"][]",i="["+e+"]: "+o+a;break;case"shortcut":r="["+e+"]",i="["+e+"]: "+o+a;break;default:var l=this.references.length+1;r="["+e+"]["+l+"]",i="["+l+"]: "+o+a}return this.references.push(i),r},references:[],append:function(e){var n="";return this.references.length&&(n="\n\n"+this.references.join("\n")+"\n\n",this.references=[]),n}},c.emphasis={filter:["em","i"],replacement:function(e,n,t){return e.trim()?t.emDelimiter+e+t.emDelimiter:""}},c.strong={filter:["strong","b"],replacement:function(e,n,t){return e.trim()?t.strongDelimiter+e+t.strongDelimiter:""}},c.code={filter:function(e){var n=e.previousSibling||e.nextSibling,t="PRE"===e.parentNode.nodeName&&!n;return"CODE"===e.nodeName&&!t},replacement:function(e){if(!e.trim())return"";var n="`",t="",r="",i=e.match(/`+/gm);if(i)for(/^`/.test(e)&&(t=" "),/`$/.test(e)&&(r=" ");-1!==i.indexOf(n);)n+="`";return n+t+e+r+n}},c.image={filter:"img",replacement:function(e,n){var t=n.alt||"",r=n.getAttribute("src")||"",i=n.title||"";return r?"!["+t+"]("+r+(i?' "'+i+'"':"")+")":""}},s.prototype={add:function(e,n){this.array.unshift(n)},keep:function(e){this._keep.unshift({filter:e,replacement:this.keepReplacement})},remove:function(e){this._remove.unshift({filter:e,replacement:function(){return""}})},forNode:function(e){return e.isBlank?this.blankRule:(n=f(this.array,e,this.options))?n:(n=f(this._keep,e,this.options))?n:(n=f(this._remove,e,this.options))?n:this.defaultRule;var n},forEach:function(e){for(var n=0;n<this.array.length;n++)e(this.array[n],n)}};var m="undefined"!=typeof window?window:{};var g,y,v,k=function(){var e=m.DOMParser,n=!1;try{(new e).parseFromString("","text/html")&&(n=!0)}catch(e){}return n}()?m.DOMParser:(g=function(){},y=t(25).JSDOM,g.prototype.parseFromString=function(e){return new y(e).window.document},g);function b(e){var n;"string"==typeof e?n=(v=v||new k).parseFromString('<x-turndown id="turndown-root">'+e+"</x-turndown>","text/html").getElementById("turndown-root"):n=e.cloneNode(!0);return function(e){var n=e.element,t=e.isBlock,r=e.isVoid,i=e.isPre||function(e){return"PRE"===e.nodeName};if(n.firstChild&&!i(n)){for(var o=null,a=!1,l=null,u=h(l,n,i);u!==n;){if(3===u.nodeType||4===u.nodeType){var c=u.data.replace(/[ \r\n\t]+/g," ");if(o&&!/ $/.test(o.data)||a||" "!==c[0]||(c=c.substr(1)),!c){u=p(u);continue}u.data=c,o=u}else{if(1!==u.nodeType){u=p(u);continue}t(u)||"BR"===u.nodeName?(o&&(o.data=o.data.replace(/ $/,"")),o=null,a=!1):r(u)&&(o=null,a=!0)}var s=h(l,u,i);l=u,u=s}o&&(o.data=o.data.replace(/ $/,""),o.data||p(o))}}({element:n,isBlock:o,isVoid:l}),n}function w(e){return e.isBlock=o(e),e.isCode="code"===e.nodeName.toLowerCase()||e.parentNode.isCode,e.isBlank=function(e){return-1===["A","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"].indexOf(e.nodeName)&&/^\s*$/i.test(e.textContent)&&!l(e)&&!function(e){return e.querySelector&&e.querySelector(u)}(e)}(e),e.flankingWhitespace=function(e){var n="",t="";if(!e.isBlock){var r=/^[ \r\n\t]/.test(e.textContent),i=/[ \r\n\t]$/.test(e.textContent);r&&!N("left",e)&&(n=" "),i&&!N("right",e)&&(t=" ")}return{leading:n,trailing:t}}(e),e}function N(e,n){var t,r,i;return"left"===e?(t=n.previousSibling,r=/ $/):(t=n.nextSibling,r=/^ /),t&&(3===t.nodeType?i=r.test(t.nodeValue):1!==t.nodeType||o(t)||(i=r.test(t.textContent))),i}var C=Array.prototype.reduce,S=/^\n*/,x=/\n*$/,R=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function A(e){if(!(this instanceof A))return new A(e);var n={rules:c,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",blankReplacement:function(e,n){return n.isBlock?"\n\n":""},keepReplacement:function(e,n){return n.isBlock?"\n\n"+n.outerHTML+"\n\n":n.outerHTML},defaultReplacement:function(e,n){return n.isBlock?"\n\n"+e+"\n\n":e}};this.options=function(e){for(var n=1;n<arguments.length;n++){var t=arguments[n];for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])}return e}({},n,e),this.rules=new s(this.options)}function T(e){var n=this;return C.call(e.childNodes,function(e,t){var r="";return 3===(t=new w(t)).nodeType?r=t.isCode?t.nodeValue:n.escape(t.nodeValue):1===t.nodeType&&(r=function(e){var n=this.rules.forNode(e),t=T.call(this,e),r=e.flankingWhitespace;(r.leading||r.trailing)&&(t=t.trim());return r.leading+n.replacement(t,e,this.options)+r.trailing}.call(n,t)),B(e,r)},"")}function B(e,n){var t,r,i,o=(t=n,r=[e.match(x)[0],t.match(S)[0]].sort(),(i=r[r.length-1]).length<2?i:"\n\n");return(e=e.replace(x,""))+o+(n=n.replace(S,""))}A.prototype={turndown:function(e){if(!function(e){return null!=e&&("string"==typeof e||e.nodeType&&(1===e.nodeType||9===e.nodeType||11===e.nodeType))}(e))throw new TypeError(e+" is not a string, or an element/document/fragment node.");if(""===e)return"";var n=T.call(this,new b(e));return function(e){var n=this;return this.rules.forEach(function(t){"function"==typeof t.append&&(e=B(e,t.append(n.options)))}),e.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}.call(this,n)},use:function(e){if(Array.isArray(e))for(var n=0;n<e.length;n++)this.use(e[n]);else{if("function"!=typeof e)throw new TypeError("plugin must be a Function or an Array of Functions");e(this)}return this},addRule:function(e,n){return this.rules.add(e,n),this},keep:function(e){return this.rules.keep(e),this},remove:function(e){return this.rules.remove(e),this},escape:function(e){return R.reduce(function(e,n){return e.replace(n[0],n[1])},e)}},n.default=A}}]);
\ No newline at end of file
(window.webpackJsonpVditor=window.webpackJsonpVditor||[]).push([[2],{27:function(e,a,o){"use strict";o.r(a),o.d(a,"getAllEmoji",function(){return r});var r=function(e){return{"+1":"👍","-1":"👎",100:"💯",1234:"🔢","8ball":"🎱",a:"🅰",ab:"🆎",abc:"🔤",abcd:"🔡",accept:"🉑",aerial_tramway:"🚡",airplane:"",alarm_clock:"",alien:"👽",ambulance:"🚑",anchor:"",angel:"👼",anger:"💢",angry:"😠",anguished:"😧",ant:"🐜",apple:"🍎",aquarius:"",aries:"",arrow_backward:"",arrow_double_down:"",arrow_double_up:"",arrow_down:"",arrow_down_small:"🔽",arrow_forward:"",arrow_heading_down:"",arrow_heading_up:"",arrow_left:"",arrow_lower_left:"",arrow_lower_right:"",arrow_right:"",arrow_right_hook:"",arrow_up:"",arrow_up_down:"",arrow_up_small:"🔼",arrow_upper_left:"",arrow_upper_right:"",arrows_clockwise:"🔃",arrows_counterclockwise:"🔄",art:"🎨",articulated_lorry:"🚛",astonished:"😲",atm:"🏧",b:"🅱",baby:"👶",baby_bottle:"🍼",baby_chick:"🐤",baby_symbol:"🚼",back:"🔙",baggage_claim:"🛄",balloon:"🎈",ballot_box_with_check:"",bamboo:"🎍",banana:"🍌",bangbang:"",bank:"🏦",bar_chart:"📊",barber:"💈",baseball:"",basketball:"🏀",bath:"🛀",bathtub:"🛁",battery:"🔋",bear:"🐻",bee:"🐝",beer:"🍺",beers:"🍻",beetle:"🐞",beginner:"🔰",bell:"🔔",bento:"🍱",bicyclist:"🚴",bike:"🚲",bikini:"👙",bird:"🐦",birthday:"🎂",black_circle:"",black_joker:"🃏",black_large_square:"",black_medium_small_square:"",black_medium_square:"",black_nib:"",black_small_square:"",black_square_button:"🔲",blossom:"🌼",blowfish:"🐡",blue_book:"📘",blue_car:"🚙",blue_heart:"💙",blush:"😊",boar:"🐗",boat:"",bomb:"💣",book:"📖",bookmark:"🔖",bookmark_tabs:"📑",books:"📚",boom:"💥",boot:"👢",bouquet:"💐",bow:"🙇",bowling:"🎳",boy:"👦",bread:"🍞",bride_with_veil:"👰",bridge_at_night:"🌉",briefcase:"💼",broken_heart:"💔",bug:"🐛",bulb:"💡",bullettrain_front:"🚅",bullettrain_side:"🚄",bus:"🚌",busstop:"🚏",bust_in_silhouette:"👤",busts_in_silhouette:"👥",c:e+"/c.png",cactus:"🌵",cake:"🍰",calendar:"📆",calling:"📲",camel:"🐫",camera:"📷",cancer:"🦀",candy:"🍬",capital_abcd:"🔠",capricorn:"",car:"🚗",card_index:"📇",carousel_horse:"🎠",cat:"🐱",cat2:"🐈",cd:"🇨🇩",chart:"💹",chart_with_downwards_trend:"📉",chart_with_upwards_trend:"📈",checkered_flag:"🏁",cherries:"🍒",cherry_blossom:"🌸",chestnut:"🌰",chicken:"🐔",children_crossing:"🚸",chocolate_bar:"🍫",christmas_tree:"🎄",church:"",cinema:"🎦",circus_tent:"🎪",city_sunrise:"🌇",city_sunset:"🌆",cl:"🇨🇱",clap:"👏",clapper:"🎬",clipboard:"📋",clock1:"🕐",clock10:"🕙",clock1030:"🕥",clock11:"🕚",clock1130:"🕦",clock12:"🕛",clock1230:"🕧",clock130:"🕜",clock2:"🕑",clock230:"🕝",clock3:"🕒",clock330:"🕞",clock4:"🕓",clock430:"🕟",clock5:"🕔",clock530:"🕠",clock6:"🕕",clock630:"🕡",clock7:"🕖",clock730:"🕢",clock8:"🕗",clock830:"🕣",clock9:"🕘",clock930:"🕤",closed_book:"📕",closed_lock_with_key:"🔐",closed_umbrella:"🌂",cloud:"",clubs:"",cn:"🇨🇳",cocktail:"🍸",coffee:"",cold_sweat:"😰",collision:"💥",computer:"💻",confetti_ball:"🎊",confounded:"😖",confused:"😕",congratulations:"",construction:"🚧",construction_worker:"👷",convenience_store:"🏪",cookie:"🍪",cool:"🆒",cop:"👮",copyright:"©",corn:"🌽",couple:"👫",couple_with_heart:"💑",couplekiss:"💏",cow:"🐮",cow2:"🐄",credit_card:"💳",crescent_moon:"🌙",crocodile:"🐊",crossed_flags:"🎌",crown:"👑",cry:"😢",crying_cat_face:"😿",crystal_ball:"🔮",cupid:"💘",curly_loop:"",currency_exchange:"💱",curry:"🍛",custard:"🍮",customs:"🛃",cyclone:"🌀",d:e+"/d.png",dancer:"💃",dancers:"👯",dango:"🍡",dart:"🎯",dash:"💨",date:"📅",de:"🇩🇪",deciduous_tree:"🌳",department_store:"🏬",diamond_shape_with_a_dot_inside:"💠",diamonds:"",disappointed:"😞",disappointed_relieved:"😥",dizzy:"💫",dizzy_face:"😵",do_not_litter:"🚯",dog:"🐶",dog2:"🐕",dollar:"💵",dolls:"🎎",dolphin:"🐬",door:"🚪",doughnut:"🍩",dragon:"🐉",dragon_face:"🐲",dress:"👗",dromedary_camel:"🐪",droplet:"💧",dvd:"📀","e-mail":"📧",e50a:e+"/e50a.png",ear:"👂",ear_of_rice:"🌾",earth_africa:"🌍",earth_americas:"🌎",earth_asia:"🌏",egg:"🥚",eggplant:"🍆",eight:"8⃣",eight_pointed_black_star:"",eight_spoked_asterisk:"",electric_plug:"🔌",elephant:"🐘",email:"",end:"🔚",envelope:"",es:"🇪🇸",euro:"💶",european_castle:"🏰",european_post_office:"🏤",evergreen_tree:"🌲",exclamation:"",expressionless:"😑",eyeglasses:"👓",eyes:"👀",f:e+"/f.png",facepunch:"👊",factory:"🏭",fallen_leaf:"🍂",family:"👪",fast_forward:"",fax:"📠",fearful:"😨",feet:"🐾",ferris_wheel:"🎡",file_folder:"📁",fire:"🔥",fire_engine:"🚒",fireworks:"🎆",first_quarter_moon:"🌓",first_quarter_moon_with_face:"🌛",fish:"🐟",fish_cake:"🍥",fishing_pole_and_fish:"🎣",fist:"",five:"5⃣",flags:"🎏",flashlight:"🔦",floppy_disk:"💾",flower_playing_cards:"🎴",flushed:"😳",foggy:"🌁",football:"🏈",fork_and_knife:"🍴",fountain:"",four:"4⃣",four_leaf_clover:"🍀",fr:"🇫🇷",free:"🆓",fried_shrimp:"🍤",fries:"🍟",frog:"🐸",frowning:"😦",fuelpump:"",full_moon:"🌕",full_moon_with_face:"🌝",g:e+"/g.png",game_die:"🎲",gb:"🇬🇧",gem:"💎",gemini:"",ghost:"👻",gift:"🎁",gift_heart:"💝",girl:"👧",globe_with_meridians:"🌐",goat:"🐐",golf:"",grapes:"🍇",green_apple:"🍏",green_book:"📗",green_heart:"💚",grey_exclamation:"",grey_question:"",grimacing:"😬",grin:"😁",grinning:"😀",guardsman:"💂",guitar:"🎸",gun:"🔫",haircut:"💇",hamburger:"🍔",hammer:"🔨",hamster:"🐹",hand:"",handbag:"👜",hankey:"💩",hash:"#⃣",hatched_chick:"🐥",hatching_chick:"🐣",headphones:"🎧",hear_no_evil:"🙉",heart:"❤️",heart_decoration:"💟",heart_eyes:"😍",heart_eyes_cat:"😻",heartbeat:"💓",heartpulse:"💗",hearts:"♥️",heavy_check_mark:"",heavy_division_sign:"",heavy_dollar_sign:"💲",heavy_exclamation_mark:"",heavy_minus_sign:"",heavy_multiplication_x:"",heavy_plus_sign:"",helicopter:"🚁",herb:"🌿",hibiscus:"🌺",high_brightness:"🔆",high_heel:"👠",hocho:"🔪",honey_pot:"🍯",honeybee:"🐝",horse:"🐴",horse_racing:"🏇",hospital:"🏥",hotel:"🏨",hotsprings:"",hourglass:"",hourglass_flowing_sand:"",house:"🏠",house_with_garden:"🏡",huaji:e+"/huaji.gif",hushed:"😯",i:e+"/i.png",ice_cream:"🍨",icecream:"🍦",id:"🇮🇩",ideograph_advantage:"🉐",imp:"👿",inbox_tray:"📥",incoming_envelope:"📨",information_desk_person:"💁",information_source:"",innocent:"😇",interrobang:"",iphone:"📱",it:"🇮🇹",izakaya_lantern:"🏮",j:e+"/j.png",jack_o_lantern:"🎃",japan:"🗾",japanese_castle:"🏯",japanese_goblin:"👺",japanese_ogre:"👹",jeans:"👖",joy:"😂",joy_cat:"😹",jp:"🇯🇵",k:e+"/k.png",key:"🔑",keycap_ten:"🔟",kimono:"👘",kiss:"💋",kissing:"😗",kissing_cat:"😽",kissing_closed_eyes:"😚",kissing_heart:"😘",kissing_smiling_eyes:"😙",koala:"🐨",koko:"🈁",kr:"🇰🇷",large_blue_circle:"🔵",large_blue_diamond:"🔷",large_orange_diamond:"🔶",last_quarter_moon:"🌗",last_quarter_moon_with_face:"🌜",laughing:"😆",leaves:"🍃",ledger:"📒",left_luggage:"🛅",left_right_arrow:"",leftwards_arrow_with_hook:"",lemon:"🍋",leo:"",leopard:"🐆",libra:"",light_rail:"🚈",link:"🔗",lips:"👄",lipstick:"💄",lock:"🔒",lock_with_ink_pen:"🔏",lollipop:"🍭",loop:"",loudspeaker:"📢",love_hotel:"🏩",love_letter:"💌",low_brightness:"🔅",m:"",mag:"🔍",mag_right:"🔎",mahjong:"🀄",mailbox:"📫",mailbox_closed:"📪",mailbox_with_mail:"📬",mailbox_with_no_mail:"📭",man:"👨",man_with_gua_pi_mao:"👲",man_with_turban:"👳",mans_shoe:"👞",maple_leaf:"🍁",mask:"😷",massage:"💆",meat_on_bone:"🍖",mega:"📣",melon:"🍈",memo:"📝",mens:"🚹",metro:"🚇",microphone:"🎤",microscope:"🔬",milky_way:"🌌",minibus:"🚐",minidisc:"💽",mobile_phone_off:"📴",money_with_wings:"💸",moneybag:"💰",monkey:"🐒",monkey_face:"🐵",monorail:"🚝",mortar_board:"🎓",mount_fuji:"🗻",mountain_bicyclist:"🚵",mountain_cableway:"🚠",mountain_railway:"🚞",mouse:"🐭",mouse2:"🐁",movie_camera:"🎥",moyai:"🗿",muscle:"💪",mushroom:"🍄",musical_keyboard:"🎹",musical_note:"🎵",musical_score:"🎼",mute:"🔇",nail_care:"💅",name_badge:"📛",necktie:"👔",negative_squared_cross_mark:"",neutral_face:"😐",new:"🆕",new_moon:"🌑",new_moon_with_face:"🌚",newspaper:"📰",ng:"🇳🇬",nine:"9⃣",no_bell:"🔕",no_bicycles:"🚳",no_entry:"",no_entry_sign:"🚫",no_good:"🙅",no_mobile_phones:"📵",no_mouth:"😶",no_pedestrians:"🚷",no_smoking:"🚭","non-potable_water":"🚱",nose:"👃",notebook:"📓",notebook_with_decorative_cover:"📔",notes:"🎶",nut_and_bolt:"🔩",o:"",o2:"🅾",ocean:"🌊",octocat:e+"/octocat.png",octopus:"🐙",oden:"🍢",office:"🏢",ok:"🆗",ok_hand:"👌",ok_woman:"🙆",older_man:"👴",older_woman:"👵",on:"🔛",oncoming_automobile:"🚘",oncoming_bus:"🚍",oncoming_police_car:"🚔",oncoming_taxi:"🚖",one:"1⃣",open_file_folder:"📂",open_hands:"👐",open_mouth:"😮",ophiuchus:"",orange_book:"📙",outbox_tray:"📤",ox:"🐂",package:"📦",page_facing_up:"📄",page_with_curl:"📃",pager:"📟",palm_tree:"🌴",panda_face:"🐼",paperclip:"📎",parking:"🅿",part_alternation_mark:"",partly_sunny:"",passport_control:"🛂",paw_prints:"🐾",peach:"🍑",pear:"🍐",pencil:"📝",pencil2:"",penguin:"🐧",pensive:"😔",performing_arts:"🎭",persevere:"😣",person_frowning:"🙍",person_with_blond_hair:"👱",person_with_pouting_face:"🙎",phone:"",pig:"🐷",pig2:"🐖",pig_nose:"🐽",pill:"💊",pineapple:"🍍",pisces:"",pizza:"🍕",point_down:"👇",point_left:"👈",point_right:"👉",point_up:"",point_up_2:"👆",police_car:"🚓",poodle:"🐩",poop:"💩",postal_horn:"📯",postbox:"📮",potable_water:"🚰",pouch:"👝",poultry_leg:"🍗",pound:"💷",pouting_cat:"😾",pray:"🙏",princess:"👸",punch:"👊",purple_heart:"💜",purse:"👛",pushpin:"📌",put_litter_in_its_place:"🚮",question:"",r:e+"/r.png",rabbit:"🐰",rabbit2:"🐇",racehorse:"🐎",radio:"📻",radio_button:"🔘",rage:"😡",railway_car:"🚃",rainbow:"🌈",raised_hand:"",raised_hands:"🙌",raising_hand:"🙋",ram:"🐏",ramen:"🍜",rat:"🐀",recycle:"",red_car:"🚗",red_circle:"🔴",registered:"®",relaxed:"",relieved:"😌",repeat:"🔁",repeat_one:"🔂",restroom:"🚻",revolving_hearts:"💞",rewind:"",ribbon:"🎀",rice:"🍚",rice_ball:"🍙",rice_cracker:"🍘",rice_scene:"🎑",ring:"💍",rocket:"🚀",roller_coaster:"🎢",rooster:"🐓",rose:"🌹",rotating_light:"🚨",round_pushpin:"📍",rowboat:"🚣",ru:"🇷🇺",rugby_football:"🏉",running:"🏃",running_shirt_with_sash:"🎽",sa:"🇸🇦",sagittarius:"",sailboat:"",sake:"🍶",sandal:"👡",santa:"🎅",satellite:"🛰",satisfied:"😆",saxophone:"🎷",school:"🏫",school_satchel:"🎒",scissors:"",scorpius:"",scream:"😱",scream_cat:"🙀",scroll:"📜",seat:"💺",secret:"",see_no_evil:"🙈",seedling:"🌱",seven:"7⃣",shaved_ice:"🍧",sheep:"🐑",shell:"🐚",ship:"🚢",shirt:"👕",shoe:"👞",shower:"🚿",signal_strength:"📶",six:"6⃣",six_pointed_star:"🔯",ski:"🎿",skull:"💀",sleeping:"😴",sleepy:"😪",slot_machine:"🎰",small_blue_diamond:"🔹",small_orange_diamond:"🔸",small_red_triangle:"🔺",small_red_triangle_down:"🔻",smile:"😄",smile_cat:"😸",smiley:"😃",smiley_cat:"😺",smiling_imp:"😈",smirk:"😏",smirk_cat:"😼",smoking:"🚬",snail:"🐌",snake:"🐍",snowboarder:"🏂",snowflake:"",snowman:"",sob:"😭",soccer:"",soon:"🔜",sos:"🆘",sound:"🔉",space_invader:"👾",spades:"",spaghetti:"🍝",sparkle:"",sparkler:"🎇",sparkles:"",sparkling_heart:"💖",speak_no_evil:"🙊",speaker:"🔈",speech_balloon:"💬",speedboat:"🚤",squirrel:"🐿",star:"",star2:"🌟",stars:"🌠",station:"🚉",statue_of_liberty:"🗽",steam_locomotive:"🚂",stew:"🍲",straight_ruler:"📏",strawberry:"🍓",stuck_out_tongue:"😛",stuck_out_tongue_closed_eyes:"😝",stuck_out_tongue_winking_eye:"😜",sun_with_face:"🌞",sunflower:"🌻",sunglasses:"😎",sunny:"",sunrise:"🌅",sunrise_over_mountains:"🌄",surfer:"🏄",sushi:"🍣",suspension_railway:"🚟",sweat:"😓",sweat_drops:"💦",sweat_smile:"😅",sweet_potato:"🍠",swimmer:"🏊",symbols:"🔣",syringe:"💉",tada:"🎉",tanabata_tree:"🎋",tangerine:"🍊",taurus:"",taxi:"🚕",tea:"🍵",telephone:"",telephone_receiver:"📞",telescope:"🔭",tennis:"🎾",tent:"🏕",thought_balloon:"💭",three:"3⃣",thumbsdown:"👎",thumbsup:"👍",ticket:"🎫",tiger:"🐯",tiger2:"🐅",tired_face:"😫",tm:"🇹🇲",toilet:"🚽",tokyo_tower:"🗼",tomato:"🍅",tongue:"👅",top:"🔝",tophat:"🎩",tractor:"🚜",traffic_light:"🚥",train:"🚋",train2:"🚆",tram:"🚊",triangular_flag_on_post:"🚩",triangular_ruler:"📐",trident:"🔱",triumph:"😤",trolleybus:"🚎",trollface:e+"/trollface.png",trophy:"🏆",tropical_drink:"🍹",tropical_fish:"🐠",truck:"🚚",trumpet:"🎺",tshirt:"👕",tulip:"🌷",turtle:"🐢",tv:"🇹🇻",twisted_rightwards_arrows:"🔀",two:"2⃣",two_hearts:"💕",two_men_holding_hands:"👬",two_women_holding_hands:"👭",u:e+"/u.png",u5272:"🈹",u5408:"🈴",u55b6:"🈺",u6307:"🈯",u6708:"🈷",u6709:"🈶",u6e80:"🈵",u7121:"🈚",u7533:"🈸",u7981:"🈲",u7a7a:"🈳",umbrella:"",unamused:"😒",underage:"🔞",unicorn_face:"🦄",unlock:"🔓",up:"🆙",us:"🇺🇸",v:"",vertical_traffic_light:"🚦",vhs:"📼",vibration_mode:"📳",video_camera:"📹",video_game:"🎮",violin:"🎻",virgo:"",volcano:"🌋",vs:"🆚",walking:"🚶",waning_crescent_moon:"🌘",waning_gibbous_moon:"🌖",warning:"",watch:"",water_buffalo:"🐃",watermelon:"🍉",wave:"👋",wavy_dash:"",waxing_crescent_moon:"🌒",waxing_gibbous_moon:"🌔",wc:"🚾",weary:"😩",wedding:"💒",whale:"🐳",whale2:"🐋",wheelchair:"",white_check_mark:"",white_circle:"",white_flower:"💮",white_large_square:"",white_medium_small_square:"",white_medium_square:"",white_small_square:"",white_square_button:"🔳",wind_chime:"🎐",wine_glass:"🍷",wink:"😉",wolf:"🐺",woman:"👩",womans_clothes:"👚",womans_hat:"👒",womens:"🚺",worried:"😟",wrench:"🔧",x:"",yellow_heart:"💛",yen:"💴",yum:"😋",zap:"",zero:"0⃣",zzz:"💤"}}}}]);
\ No newline at end of file
......@@ -103,10 +103,6 @@ $.extend(Page.prototype, {
var that = this
if (typeof Vditor === 'undefined') {
$('head').
append(
$('<link rel=\'stylesheet\' href=\'' + latkeConfig.staticServePath + '/js/lib/vditor-0.2.5/index.classic.css\'>'))
$.ajax({
method: 'GET',
url: latkeConfig.staticServePath + '/js/lib/vditor-0.2.5/index.min.js',
......
......@@ -15,4 +15,4 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
var Page=function(e){this.currentCommentId="",this.tips=e};$.extend(Page.prototype,{replaceCommentsEm:function(e){for(var t=$(e),i=0;i<t.length;i++){var o=t[i].innerHTML;t[i].innerHTML=Util.replaceEmString(o)}},parseLanguage:function(e){var t=!1;$(".content-reset pre").each(function(){t=!0}),t&&(document.createStyleSheet?document.createStyleSheet(latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/styles/"+(e&&e.theme||"github")+".css"):$("head").append($("<link rel='stylesheet' href='"+latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/styles/"+(e&&e.theme||"github")+".css'>")),Label.markedAvailable||$.ajax({url:latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/highlight.pack.js",dataType:"script",cache:!0,success:function(){hljs.initHighlighting.called=!1,hljs.initHighlighting()}}))},load:function(e){var t=this;t.parseLanguage(e),$("#comment").click(function(){t.toggleEditor()}).attr("readonly","readonly"),$("#soloEditorCancel").click(function(){t.toggleEditor()}),$("#soloEditorAdd").click(function(){t.submitComment()})},toggleEditor:function(e,t){var i=this;"undefined"==typeof Vditor&&($("head").append($("<link rel='stylesheet' href='"+latkeConfig.staticServePath+"/js/lib/vditor-0.2.5/index.classic.css'>")),$.ajax({method:"GET",url:latkeConfig.staticServePath+"/js/lib/vditor-0.2.5/index.min.js",dataType:"script",cache:!0,async:!1,success:function(){window.vditor=new Vditor("soloEditorComment",{placeholder:i.tips.commentContentCannotEmptyLabel,height:180,hint:{emojiPath:latkeConfig.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},esc:function(){$("#soloEditorCancel").click()},ctrlEnter:function(){$("#soloEditorAdd").click()},preview:{delay:500,show:!1,url:latkeConfig.servePath+"/console/markdown/2html",parse:function(e){"none"!==e.style.display&&(Util.parseMarkdown("content-reset"),Label.markedAvailable||(hljs.initHighlighting.called=!1,hljs.initHighlighting()))}},counter:500,resize:{enable:!0,position:"top",after:function(){$("body").css("padding-bottom",$("#soloEditor").outerHeight())}},lang:i.tips.langLabel,toolbar:["emoji","headings","bold","italic","strike","|","line","quote","|","list","ordered-list","check","|","code","inline-code","|","undo","redo","|","link","table","|","preview","fullscreen","info","help"],classes:{preview:"content__reset"}}),vditor.focus()}}));var o=$("#soloEditor");0!==o.length?"0px"===$("body").css("padding-bottom")||e?($("#soloEditorError").text(""),o.css({bottom:"0",opacity:1}),$("body").css("padding-bottom","238px"),this.currentCommentId=e,$("#soloEditorReplyTarget").text(t?"@"+t:""),"undefined"!=typeof vditor&&vditor.focus()):(o.css({bottom:"-300px",opacity:0}),$("body").css("padding-bottom",0)):location.href=latkeConfig.servePath+"/start"},loadRandomArticles:function(s){var c=this.tips.randomArticles1Label;$.ajax({url:latkeConfig.servePath+"/articles/random",type:"POST",success:function(e,t){var i=e.randomArticles;if(i&&0!==i.length){for(var o="",n=0;n<i.length;n++){var l=i[n],a=l.articleTitle;o+="<li><a rel='nofollow' title='"+a+"' href='"+latkeConfig.servePath+l.articlePermalink+"'>"+a+"</a></li>"}var r=(s||"<h4>"+c+"</h4>")+"<ul>"+o+"</ul>";$("#randomArticles").append(r)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(e,s){$.ajax({url:latkeConfig.servePath+"/article/id/"+e+"/relevant/articles",type:"GET",success:function(e,t){var i=e.relevantArticles;if(i&&0!==i.length){for(var o="",n=0;n<i.length;n++){var l=i[n],a=l.articleTitle;o+="<li><a rel='nofollow' title='"+a+"' href='"+latkeConfig.servePath+l.articlePermalink+"'>"+a+"</a></li>"}var r=s+"<ul>"+o+"</ul>";$("#relevantArticles").append(r)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(e,s){var c=this.tips;try{$.ajax({url:"https://rhythm.b3log.org/get-articles-by-tags.do?tags="+e+"&blogHost="+c.blogHost+"&paginationPageSize="+c.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(e,t){var i=e.articles;if(i&&0!==i.length){for(var o="",n=0;n<i.length;n++){var l=i[n],a=l.articleTitle;o+="<li><a rel='nofollow' title='"+a+"' target='_blank' href='"+l.articlePermalink+"'>"+a+"</a></li>"}var r=(s||"<h4>"+c.externalRelevantArticles1Label+"</h4>")+"<ul>"+o+"</ul>";$("#externalRelevantArticles").append(r)}else $("#externalRelevantArticles").remove()}})}catch(e){}},submitComment:function(){var t=this,e=this.tips,i="article";if(void 0===e.externalRelevantArticlesDisplayCount&&(i="page"),1<vditor.getValue().length&&vditor.getValue().length<500){$("#soloEditorAdd").attr("disabled","disabled");var o={oId:e.oId,commentContent:vditor.getValue()};this.currentCommentId&&(o.commentOriginalCommentId=this.currentCommentId),$.ajax({type:"POST",url:latkeConfig.servePath+"/"+i+"/comments",cache:!1,contentType:"application/json",data:JSON.stringify(o),success:function(e){$("#soloEditorAdd").removeAttr("disabled"),e.sc?(t.toggleEditor(),vditor.setValue(""),t.addCommentAjax(Util.replaceEmString(e.cmtTpl))):$("#soloEditorError").html(e.msg)}})}else $("#soloEditorError").text(t.tips.commentContentCannotEmptyLabel)},addReplyForm:function(e,t){this.currentCommentId=e,this.toggleEditor(e,t)},hideComment:function(e){$("#commentRef"+e).hide()},showComment:function(e,t,i,o){var n=parseInt($(e).position().top);if(o&&(n=parseInt($(e).parents(o).position().top)),0<$("#commentRef"+t).length)$("#commentRef"+t).show().css("top",n+i+"px");else{var l=$("#"+t).clone();l.addClass("comment-body-ref").attr("id","commentRef"+t),l.find("#replyForm").remove(),$("#comments").append(l),$("#commentRef"+t).css("top",n+i+"px")}},addCommentAjax:function(e){0<$("#comments").children().length?$($("#comments").children()[0]).before(e):$("#comments").html(e),window.location.hash="#comments"}});
\ No newline at end of file
var Page=function(e){this.currentCommentId="",this.tips=e};$.extend(Page.prototype,{replaceCommentsEm:function(e){for(var t=$(e),o=0;o<t.length;o++){var i=t[o].innerHTML;t[o].innerHTML=Util.replaceEmString(i)}},parseLanguage:function(e){var t=!1;$(".content-reset pre").each(function(){t=!0}),t&&(document.createStyleSheet?document.createStyleSheet(latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/styles/"+(e&&e.theme||"github")+".css"):$("head").append($("<link rel='stylesheet' href='"+latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/styles/"+(e&&e.theme||"github")+".css'>")),Label.markedAvailable||$.ajax({url:latkeConfig.staticServePath+"/js/lib/highlight-9.13.1/highlight.pack.js",dataType:"script",cache:!0,success:function(){hljs.initHighlighting.called=!1,hljs.initHighlighting()}}))},load:function(e){var t=this;t.parseLanguage(e),$("#comment").click(function(){t.toggleEditor()}).attr("readonly","readonly"),$("#soloEditorCancel").click(function(){t.toggleEditor()}),$("#soloEditorAdd").click(function(){t.submitComment()})},toggleEditor:function(e,t){var o=this;"undefined"==typeof Vditor&&$.ajax({method:"GET",url:latkeConfig.staticServePath+"/js/lib/vditor-0.2.5/index.min.js",dataType:"script",cache:!0,async:!1,success:function(){window.vditor=new Vditor("soloEditorComment",{placeholder:o.tips.commentContentCannotEmptyLabel,height:180,hint:{emojiPath:latkeConfig.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},esc:function(){$("#soloEditorCancel").click()},ctrlEnter:function(){$("#soloEditorAdd").click()},preview:{delay:500,show:!1,url:latkeConfig.servePath+"/console/markdown/2html",parse:function(e){"none"!==e.style.display&&(Util.parseMarkdown("content-reset"),Label.markedAvailable||(hljs.initHighlighting.called=!1,hljs.initHighlighting()))}},counter:500,resize:{enable:!0,position:"top",after:function(){$("body").css("padding-bottom",$("#soloEditor").outerHeight())}},lang:o.tips.langLabel,toolbar:["emoji","headings","bold","italic","strike","|","line","quote","|","list","ordered-list","check","|","code","inline-code","|","undo","redo","|","link","table","|","preview","fullscreen","info","help"],classes:{preview:"content__reset"}}),vditor.focus()}});var i=$("#soloEditor");0!==i.length?"0px"===$("body").css("padding-bottom")||e?($("#soloEditorError").text(""),i.css({bottom:"0",opacity:1}),$("body").css("padding-bottom","238px"),this.currentCommentId=e,$("#soloEditorReplyTarget").text(t?"@"+t:""),"undefined"!=typeof vditor&&vditor.focus()):(i.css({bottom:"-300px",opacity:0}),$("body").css("padding-bottom",0)):location.href=latkeConfig.servePath+"/start"},loadRandomArticles:function(s){var c=this.tips.randomArticles1Label;$.ajax({url:latkeConfig.servePath+"/articles/random",type:"POST",success:function(e,t){var o=e.randomArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var l=o[n],a=l.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+latkeConfig.servePath+l.articlePermalink+"'>"+a+"</a></li>"}var r=(s||"<h4>"+c+"</h4>")+"<ul>"+i+"</ul>";$("#randomArticles").append(r)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(e,s){$.ajax({url:latkeConfig.servePath+"/article/id/"+e+"/relevant/articles",type:"GET",success:function(e,t){var o=e.relevantArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var l=o[n],a=l.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+latkeConfig.servePath+l.articlePermalink+"'>"+a+"</a></li>"}var r=s+"<ul>"+i+"</ul>";$("#relevantArticles").append(r)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(e,s){var c=this.tips;try{$.ajax({url:"https://rhythm.b3log.org/get-articles-by-tags.do?tags="+e+"&blogHost="+c.blogHost+"&paginationPageSize="+c.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(e,t){var o=e.articles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var l=o[n],a=l.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' target='_blank' href='"+l.articlePermalink+"'>"+a+"</a></li>"}var r=(s||"<h4>"+c.externalRelevantArticles1Label+"</h4>")+"<ul>"+i+"</ul>";$("#externalRelevantArticles").append(r)}else $("#externalRelevantArticles").remove()}})}catch(e){}},submitComment:function(){var t=this,e=this.tips,o="article";if(void 0===e.externalRelevantArticlesDisplayCount&&(o="page"),1<vditor.getValue().length&&vditor.getValue().length<500){$("#soloEditorAdd").attr("disabled","disabled");var i={oId:e.oId,commentContent:vditor.getValue()};this.currentCommentId&&(i.commentOriginalCommentId=this.currentCommentId),$.ajax({type:"POST",url:latkeConfig.servePath+"/"+o+"/comments",cache:!1,contentType:"application/json",data:JSON.stringify(i),success:function(e){$("#soloEditorAdd").removeAttr("disabled"),e.sc?(t.toggleEditor(),vditor.setValue(""),t.addCommentAjax(Util.replaceEmString(e.cmtTpl))):$("#soloEditorError").html(e.msg)}})}else $("#soloEditorError").text(t.tips.commentContentCannotEmptyLabel)},addReplyForm:function(e,t){this.currentCommentId=e,this.toggleEditor(e,t)},hideComment:function(e){$("#commentRef"+e).hide()},showComment:function(e,t,o,i){var n=parseInt($(e).position().top);if(i&&(n=parseInt($(e).parents(i).position().top)),0<$("#commentRef"+t).length)$("#commentRef"+t).show().css("top",n+o+"px");else{var l=$("#"+t).clone();l.addClass("comment-body-ref").attr("id","commentRef"+t),l.find("#replyForm").remove(),$("#comments").append(l),$("#commentRef"+t).css("top",n+o+"px")}},addCommentAjax:function(e){0<$("#comments").children().length?$($("#comments").children()[0]).before(e):$("#comments").html(e),window.location.hash="#comments"}});
\ No newline at end of file
Subproject commit 3a5132b6ba245f04deab73e914c4de78df1cce07
Subproject commit 34635fd9f5c77416fd99de336203d4616dfb8560
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment