Commit c37bf256 authored by Van's avatar Van

🎨 vditor -> 0.2.5

parent ef9ffe76
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<title>${adminConsoleLabel} - ${blogTitle}</title> <title>${adminConsoleLabel} - ${blogTitle}</title>
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-base${miniPostfix}.css?${staticResourceVersion}" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-base${miniPostfix}.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-admin${miniPostfix}.css?${staticResourceVersion}" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/css/default-admin${miniPostfix}.css?${staticResourceVersion}" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/vditor-0.2.0/index.classic.css" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/vditor-0.2.5/index.classic.css" />
<link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/highlight-9.13.1/styles/github.css?${staticResourceVersion}" /> <link type="text/css" rel="stylesheet" href="${staticServePath}/js/lib/highlight-9.13.1/styles/github.css?${staticResourceVersion}" />
<link rel="icon" type="image/png" href="${staticServePath}/favicon.png" /> <link rel="icon" type="image/png" href="${staticServePath}/favicon.png" />
<link rel="manifest" href="${servePath}/manifest.json"> <link rel="manifest" href="${servePath}/manifest.json">
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
</div> </div>
</div> </div>
<script src="${staticServePath}/js/lib/compress/admin-lib.min.js"></script> <script src="${staticServePath}/js/lib/compress/admin-lib.min.js"></script>
<script src="${staticServePath}/js/lib/vditor-0.2.0/index.min.js"></script> <script src="${staticServePath}/js/lib/vditor-0.2.5/index.min.js"></script>
<script src="${staticServePath}/js/common${miniPostfix}.js"></script> <script src="${staticServePath}/js/common${miniPostfix}.js"></script>
<#if "" == miniPostfix> <#if "" == miniPostfix>
<script src="${staticServePath}/js/admin/admin.js"></script> <script src="${staticServePath}/js/admin/admin.js"></script>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.6.0.3, Feb 17, 2019 * @version 2.6.0.4, Feb 19, 2019
*/ */
/* start resset */ /* start resset */
...@@ -76,7 +76,7 @@ a:hover { ...@@ -76,7 +76,7 @@ a:hover {
.content-reset img.emoji { .content-reset img.emoji {
cursor: auto; cursor: auto;
max-width: 18px; max-width: 20px;
} }
.content-reset h1, .content-reset h1,
......
This diff is collapsed.
/**
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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/>.
*/
body,dd,div,dl,h1,h2,h3,h4,h5,h6,html,img,li,ol,p,ul{padding:0;margin:0}.clear,.fn-clear:after{clear:both}.form th,.nowrap{white-space:nowrap}.goBottomIcon,.goTopIcon{position:fixed;right:20px}#tags,#tags li{list-style:none}body{background-color:#FFF;color:#000;font-family:elvetica,Arial,sans-serif,'\5fae\8f6f\96c5\9ed1';font-size:small}img{border:none;vertical-align:middle}h1{font-size:160%}h2{font-size:140%}h3{font-size:120%}h4{font-size:110%}textarea{overflow:auto}.button,button{background:url(../images/icon.png) center bottom;border:1px solid;border-color:#CCC #BBB #A0A0A0;border-radius:4px;height:28px;margin:0;padding:0 6px;vertical-align:top}.button:hover,button:hover{border-color:#BBB}.padding12{padding:12px}.paddingBottom12{padding-bottom:12px!important}.paddingTop12{padding-top:12px!important}.margin12{margin:12px}.marginTop12{margin-top:12px!important}.marginBottom12{margin-bottom:12px!important}.marginLeft12{margin-left:12px!important}.marginLeft6{margin-left:6px!important}.marginRight12{margin-right:12px!important}.f-bold{font-weight:700!important}.left{float:left}.right{float:right}.clear{background-color:transparent;border:0;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.fn-clear:after,.fn-clear:before{display:table;content:""}.fn__flex{display:flex}.fn__flex1{flex:1;min-width:1px}.fn__flex-inline{display:inline-flex!important;align-items:center}.none{display:none}.pointer{cursor:pointer}.no-underline{text-decoration:none!important}#tags a,.logo{text-decoration:none}.red{color:red}.contentBody{margin-bottom:12px;padding:3px 12px}.form th{text-align:right}.form input[type=text],.form input[type=password],.form textarea{border-color:silver #D9D9D9 #D9D9D9;border-right:1px solid #D9D9D9;border-style:solid;border-width:1px;font-family:Helvetica,Arial,sans-serif;font-size:12px;outline:0;width:99%;padding:0 3px}.form input{height:24px}.form input[type=checkbox]{border:0;vertical-align:sub;height:20px}.form input.normalInput{width:auto}.form input[type=checkbox]:focus{border:0;box-shadow:0 0 0}.form input:focus,.form textarea:focus{box-shadow:0 1px 2px rgba(0,0,0,.3) inset}.form textarea{padding:3px;overflow:auto;resize:vertical}.logo{padding:0 5px;text-shadow:0 0 1px #EEE}.article-body h1,.article-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.aboutIcon,.adminIcon,.articlesIcon,.browserIcon,.cacheIcon,.calendarIcon,.commentIcon,.deleteIcon,.draftsIcon,.falseIcon,.fileIcon,.goBottomIcon,.goTopIcon,.homeIcon,.linkIcon,.loginIcon,.logoutIcon,.notPutTopIcon,.othersIcon,.pageIcon,.postIcon,.preferenceIcon,.putTopIcon,.trueIcon,.updateIcon,.usersIcon{background-image:url(../images/icon.png);cursor:pointer;height:16px;width:16px}.adminIcon,.homeIcon,.loginIcon,.logoutIcon{margin-top:3px}.pageIcon{background-position:-144px 0}.postIcon{background-position:-16px 0}.linkIcon{background-position:-32px 0}.preferenceIcon{background-position:-48px 0}.articlesIcon{background-position:-64px 0}.trueIcon{background-position:-80px 0;cursor:auto}.falseIcon{background-position:-96px 0;cursor:auto}.fileIcon{background-position:-112px 0}.deleteIcon{background-position:0 -16px}.updateIcon{background-position:-16px -16px}.commentIcon{background-position:-32px -16px}.homeIcon{background-position:-64px -16px}.adminIcon{background-position:-80px -16px}.logoutIcon{background-position:-96px -16px}.loginIcon{background-position:-112px -16px}.browserIcon{background-position:-128px -16px}.calendarIcon{background-position:-144px -16px}.putTopIcon{background-position:-16px -32px;float:left}.notPutTopIcon{background-position:-32px -32px;float:left}.othersIcon{background-position:-48px -32px}.cacheIcon,.draftsIcon{background-position:-96px -32px}.usersIcon{background-position:-112px -32px}.goTopIcon{background-position:-64px -32px;top:45%}.goBottomIcon{background-position:-80px -32px;bottom:40%}.article-body{word-wrap:break-word;overflow:auto;line-height:1.65;font-size:16px;word-break:break-word}.article-body ol,.article-body ul{padding-left:2em;margin-top:0;margin-bottom:16px}.article-body li{margin-top:.25em}.article-body img{cursor:zoom-in}.article-body img.emoji{cursor:auto;max-width:18px}#captcha,#captchaReply,#emotions span{cursor:pointer}.article-body h1,.article-body h2,.article-body h3,.article-body h4,.article-body h5,.article-body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.article-body h1{font-size:1.7em}.article-body h2{font-size:1.5em}.article-body h3{font-size:1.25em}.article-body h4{font-size:1em}.article-body h5{font-size:.875em}.article-body h6{font-size:.85em}.article-body hr{height:.15em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.article-body p{margin-top:0;margin-bottom:16px}.article-body blockquote{padding:0 1em;color:#777;border-left:.25em solid #ddd;margin-bottom:16px}.article-body blockquote p{margin:0}.article-body ins>iframe{border:0}.article-body iframe{border:1px solid rgba(0,0,0,.38)}.article-body table{width:100%;border:1px solid #dedede;margin:15px auto;border-collapse:collapse;empty-cells:show}.article-body thead{text-align:center}.article-body td,.article-body th{height:35px;border:1px solid #dedede;padding:0 10px}.article-body th{font-weight:700;text-align:center!important;background:rgba(158,188,226,.2)}.article-body tbody tr:nth-child(2n){background:rgba(158,188,226,.12)}.article-body tr:hover{background:#efefef}.article-body code{padding:.2em .4em;margin:0;font-size:85%;background-color:rgba(252,41,41,.12);border-radius:3px;word-break:break-word}.article-body pre{position:relative}.article-body pre textarea{position:absolute;top:-100000px}.article-body pre>code{padding:.5em;background-color:rgba(0,0,0,.04);background-size:20px 20px;border-radius:5px;display:block}.article-body kbd{display:inline-block;padding:3px 5px;font:11px Consolas,"Liberation Mono",Menlo,Courier,monospace;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:1px solid rgba(0,0,0,.38);border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.article-body .task-list-item,.article-body__task{list-style:none;margin-left:-1em}.em00,.em01,.em02,.em03,.em04,.em05,.em06,.em07,.em08,.em09,.em10,.em11,.em12,.em13,.em14{background-image:url(../images/emotions/emotions.png);background-size:120px;float:left;height:24px;margin-right:5px;width:24px}.em01{background-position:-24px 0}.em02{background-position:-48px 0}.em03{background-position:-72px 0}.em04{background-position:-96px 0}.em05{background-position:0 -24px}.em06{background-position:-24px -24px}.em07{background-position:-48px -24px}.em08{background-position:-72px -24px}.em09{background-position:-96px -24px}.em10{background-position:0 -48px}.em11{background-position:-24px -48px}.em12{background-position:-48px -48px}.em13{background-position:-72px -48px}.em14{background-position:-96px -48px}#tags li{float:left;height:38px}#tags a:hover{text-shadow:0 0 2px #555}#tags a{border-radius:3px;box-shadow:1px 1px 3px #555;float:left;margin:3px 6px;padding:3px 12px}#tags .tags1{font-size:12px;font-weight:400}#tags .tags2{font-size:14px;font-weight:400}#tags .tags3{font-size:16px;font-weight:400}#tags .tags4{font-size:18px;font-weight:700}#tags .tags5{font-size:20px;font-weight:700} body,dd,div,dl,h1,h2,h3,h4,h5,h6,html,img,li,ol,p,ul{padding:0;margin:0}.clear,.fn-clear:after{clear:both}.form th,.nowrap{white-space:nowrap}.goBottomIcon,.goTopIcon{position:fixed;right:20px}#tags,#tags li{list-style:none}body{background-color:#FFF;color:#000;font-family:elvetica,Arial,sans-serif,'\5fae\8f6f\96c5\9ed1';font-size:small}img{border:none;vertical-align:middle}h1{font-size:160%}h2{font-size:140%}h3{font-size:120%}h4{font-size:110%}textarea{overflow:auto}.button,button{background:url(../images/icon.png) center bottom;border:1px solid;border-color:#CCC #BBB #A0A0A0;border-radius:4px;height:28px;margin:0;padding:0 6px;vertical-align:top}.button:hover,button:hover{border-color:#BBB}.padding12{padding:12px}.paddingBottom12{padding-bottom:12px!important}.paddingTop12{padding-top:12px!important}.margin12{margin:12px}.marginTop12{margin-top:12px!important}.marginBottom12{margin-bottom:12px!important}.marginLeft12{margin-left:12px!important}.marginLeft6{margin-left:6px!important}.marginRight12{margin-right:12px!important}.f-bold{font-weight:700!important}.left{float:left}.right{float:right}.clear{background-color:transparent;border:0;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.fn-clear:after,.fn-clear:before{display:table;content:""}.fn__flex{display:flex}.fn__flex1{flex:1;min-width:1px}.fn__flex-inline{display:inline-flex!important;align-items:center}.none{display:none}.pointer{cursor:pointer}.no-underline{text-decoration:none!important}#tags a,.logo{text-decoration:none}.red{color:red}.contentBody{margin-bottom:12px;padding:3px 12px}.form th{text-align:right}.form input[type=text],.form input[type=password],.form textarea{border-color:silver #D9D9D9 #D9D9D9;border-right:1px solid #D9D9D9;border-style:solid;border-width:1px;font-family:Helvetica,Arial,sans-serif;font-size:12px;outline:0;width:99%;padding:0 3px}.form input{height:24px}.form input[type=checkbox]{border:0;vertical-align:sub;height:20px}.form input.normalInput{width:auto}.form input[type=checkbox]:focus{border:0;box-shadow:0 0 0}.form input:focus,.form textarea:focus{box-shadow:0 1px 2px rgba(0,0,0,.3) inset}.form textarea{padding:3px;overflow:auto;resize:vertical}.logo{padding:0 5px;text-shadow:0 0 1px #EEE}.article-body h1,.article-body h2{padding-bottom:.3em;border-bottom:1px solid #eee}.aboutIcon,.adminIcon,.articlesIcon,.browserIcon,.cacheIcon,.calendarIcon,.commentIcon,.deleteIcon,.draftsIcon,.falseIcon,.fileIcon,.goBottomIcon,.goTopIcon,.homeIcon,.linkIcon,.loginIcon,.logoutIcon,.notPutTopIcon,.othersIcon,.pageIcon,.postIcon,.preferenceIcon,.putTopIcon,.trueIcon,.updateIcon,.usersIcon{background-image:url(../images/icon.png);cursor:pointer;height:16px;width:16px}.adminIcon,.homeIcon,.loginIcon,.logoutIcon{margin-top:3px}.pageIcon{background-position:-144px 0}.postIcon{background-position:-16px 0}.linkIcon{background-position:-32px 0}.preferenceIcon{background-position:-48px 0}.articlesIcon{background-position:-64px 0}.trueIcon{background-position:-80px 0;cursor:auto}.falseIcon{background-position:-96px 0;cursor:auto}.fileIcon{background-position:-112px 0}.deleteIcon{background-position:0 -16px}.updateIcon{background-position:-16px -16px}.commentIcon{background-position:-32px -16px}.homeIcon{background-position:-64px -16px}.adminIcon{background-position:-80px -16px}.logoutIcon{background-position:-96px -16px}.loginIcon{background-position:-112px -16px}.browserIcon{background-position:-128px -16px}.calendarIcon{background-position:-144px -16px}.putTopIcon{background-position:-16px -32px;float:left}.notPutTopIcon{background-position:-32px -32px;float:left}.othersIcon{background-position:-48px -32px}.cacheIcon,.draftsIcon{background-position:-96px -32px}.usersIcon{background-position:-112px -32px}.goTopIcon{background-position:-64px -32px;top:45%}.goBottomIcon{background-position:-80px -32px;bottom:40%}.article-body{word-wrap:break-word;overflow:auto;line-height:1.65;font-size:16px;word-break:break-word}.article-body ol,.article-body ul{padding-left:2em;margin-top:0;margin-bottom:16px}.article-body li{margin-top:.25em}.article-body img{cursor:zoom-in}.article-body img.emoji{cursor:auto;max-width:18px}#captcha,#captchaReply,#emotions span{cursor:pointer}.article-body h1,.article-body h2,.article-body h3,.article-body h4,.article-body h5,.article-body h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.article-body h1{font-size:1.7em}.article-body h2{font-size:1.5em}.article-body h3{font-size:1.25em}.article-body h4{font-size:1em}.article-body h5{font-size:.875em}.article-body h6{font-size:.85em}.article-body hr{height:.15em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.article-body p{margin-top:0;margin-bottom:16px}.article-body blockquote{padding:0 1em;color:#777;border-left:.25em solid #ddd;margin-bottom:16px}.article-body blockquote p{margin:0}.article-body ins>iframe{border:0}.article-body iframe{border:1px solid rgba(0,0,0,.38)}.article-body table{width:100%;border:1px solid #dedede;margin:15px auto;border-collapse:collapse;empty-cells:show}.article-body thead{text-align:center}.article-body td,.article-body th{height:35px;border:1px solid #dedede;padding:0 10px}.article-body th{font-weight:700;text-align:center!important;background:rgba(158,188,226,.2)}.article-body tbody tr:nth-child(2n){background:rgba(158,188,226,.12)}.article-body tr:hover{background:#efefef}.article-body code{padding:.2em .4em;margin:0;font-size:85%;background-color:rgba(252,41,41,.12);border-radius:3px;word-break:break-word}.article-body pre{position:relative}.article-body pre textarea{position:absolute;top:-100000px}.article-body pre>code{padding:.5em;background-color:rgba(0,0,0,.04);background-size:20px 20px;border-radius:5px;display:block}.article-body kbd{display:inline-block;padding:3px 5px;font:11px Consolas,"Liberation Mono",Menlo,Courier,monospace;line-height:10px;color:#555;vertical-align:middle;background-color:#fcfcfc;border:1px solid rgba(0,0,0,.38);border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.article-body .task-list-item,.article-body__task{list-style:none;margin-left:-1em}.em00,.em01,.em02,.em03,.em04,.em05,.em06,.em07,.em08,.em09,.em10,.em11,.em12,.em13,.em14{background-image:url(../images/emotions/emotions.png);background-size:120px;float:left;height:24px;margin-right:5px;width:24px}.em01{background-position:-24px 0}.em02{background-position:-48px 0}.em03{background-position:-72px 0}.em04{background-position:-96px 0}.em05{background-position:0 -24px}.em06{background-position:-24px -24px}.em07{background-position:-48px -24px}.em08{background-position:-72px -24px}.em09{background-position:-96px -24px}.em10{background-position:0 -48px}.em11{background-position:-24px -48px}.em12{background-position:-48px -48px}.em13{background-position:-72px -48px}.em14{background-position:-96px -48px}#tags li{float:left;height:38px}#tags a:hover{text-shadow:0 0 2px #555}#tags a{border-radius:3px;box-shadow:1px 1px 3px #555;float:left;margin:3px 6px;padding:3px 12px}#tags .tags1{font-size:12px;font-weight:400}#tags .tags2{font-size:14px;font-weight:400}#tags .tags3{font-size:16px;font-weight:400}#tags .tags4{font-size:18px;font-weight:700}#tags .tags5{font-size:20px;font-weight:700}
\ No newline at end of file
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 1.3.0.0, Feb 17, 2019 * @version 1.3.0.1, Feb 19, 2019
*/ */
/* reset */ /* reset */
...@@ -293,7 +293,7 @@ input[type=text]:focus { ...@@ -293,7 +293,7 @@ input[type=text]:focus {
} }
.content-reset img.emoji { .content-reset img.emoji {
max-width: 18px; max-width: 20px;
} }
.content-reset h1, .content-reset h1,
......
This diff is collapsed.
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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 Admin=function(){this.register={},this.tools=["#page-list","#file-list","#link-list","#preference","#user-list","#plugin-list","#others","#category-list"],this.adTools=["link-list","preference","file-list","page-list","user-list","plugin-list","others","category-list"]};$.extend(Admin.prototype,{logout:function(){window.location.href=latkeConfig.servePath+"/logout"},toggleMenu:function(){"-240px"===$("#tabs").css("left")?($("#tabs").css("left",0),$(".tabs__bg").show()):($("#tabs").css("left","-240px"),$(".tabs__bg").hide())},clearTip:function(){$("#tipMsg").text(""),$("#loadMsg").text("")},setHashByPage:function(t){var e=window.location.hash.split("/");/^\d*$/.test(e[e.length-1])?e[e.length-1]=t:e.push(t),window.location.hash=e.join("/")},selectTab:function(t){window.location.hash="#"+t},analyseHash:function(){for(var t=window.location.hash,e=t.substr(1,t.length-1).split("/"),i={page:1,hashList:[]},a=0;a<e.length;a++)a===e.length-1&&/^\d+$/.test(e[a])?i.page=e[a]:i.hashList.push(e[a]);return i},setCurByHash:function(){$(window).scrollTop(0),$("#tipMsg").text("");var t=admin.analyseHash(),e=t.hashList[1],i=t.hashList[2];if(1===t.hashList.length&&(e=t.hashList[0]),""!==e){"article"!==e?admin.article.clearDraftTimer():"article"===e&&(admin.article.autoSaveDraftTimer=setInterval(function(){admin.article._autoSaveToDraft()},admin.article.AUTOSAVETIME));try{if("article"!==e&&admin.article.isConfirm&&""!==admin.editors.articleEditor.getContent().replace(/\s/g,"")&&admin.article.content!==admin.editors.articleEditor.getContent()&&!confirm(Label.editorLeaveLabel))return void(window.location.hash="#article/article");if("article"===e&&admin.article.isConfirm&&""!==admin.editors.articleEditor.getContent().replace(/\s/g,"")&&admin.article.content!==admin.editors.articleEditor.getContent())return}catch(t){var a=$("#articleContent");if(0<a.length){if("article"!==e&&admin.article.isConfirm&&""!==a.val().replace(/\s/g,"")&&admin.article.content!==a.val()&&!confirm(Label.editorLeaveLabel))return void(window.location.hash="#article/article");if("article"===e&&admin.article.isConfirm&&""!==a.val().replace(/\s/g,"")&&admin.article.content!==a.val())return}}"article"!==e&&admin.editors.articleEditor.setContent&&admin.article.clear(),admin.article.isConfirm=!0,$("#tabs").tabs("setCurrent",e),$("#loadMsg").text(Label.loadingLabel),1===$("#tabsPanel_"+e).length?""===$("#tabsPanel_"+e).html().replace(/\s/g,"")?$("#tabsPanel_"+e).load("admin-"+e+".do",function(){"article"===e&&admin.article.status.id?admin.register[e].init.call(admin.register[e].obj,admin.article.getAndSet):admin.register[e].init.call(admin.register[e].obj,t.page),i&&$("#tab"+e.substring(0,1).toUpperCase()+e.substring(1)).tabs("setCurrent",i),admin.plugin.setCurByHash(t)}):("article"===e&&admin.article.status.id&&admin.article.getAndSet(),admin.register[e]&&admin.register[e].refresh&&admin.register[e].refresh.call(admin.register[e].obj,t.page),i&&$("#tab"+e.substring(0,1).toUpperCase()+e.substring(1)).tabs("setCurrent",i),admin.plugin.setCurByHash(t)):($("#tipMsg").text("Error: No tab! "+Label.reportIssueLabel),$("#loadMsg").text(""))}},init:function(){Util.killIE(),$("#loadMsg").text(Label.loadingLabel),$("#tabs").tabs(),setInterval(function(){""!==$("#tipMsg").text()&&setTimeout(function(){$("#tipMsg").text("")},7e3)},6e3),$("#loadMsg").text("")},collapseNav:function(t){$(t).next().slideToggle("normal",function(){"none"!==this.style.display?($(t).find(".icon-chevron-down")[0].className="icon-chevron-up right",$(t).addClass("tab-current")):($(t).find(".icon-chevron-up")[0].className="icon-chevron-down right",$(t).removeClass("tab-current")),$("#tabs > ul").height("auto"),$("#tabs > ul").height($("#tabs > ul").height()+80)})},inited:function(){if("adminRole"!==Label.userRole)for(var t=0;t<this.adTools.length;t++)$("#tabs").tabs("remove",this.adTools[t]);else for(var e=0;e<this.tools.length;e++)if("#"+window.location.hash.split("/")[1]===this.tools[e]){$("#tabToolsTitle").click();break}this.setCurByHash()}});var admin=new Admin; var Admin=function(){this.register={},this.tools=["#page-list","#file-list","#link-list","#preference","#user-list","#plugin-list","#others","#category-list"],this.adTools=["link-list","preference","file-list","page-list","user-list","plugin-list","others","category-list"]};$.extend(Admin.prototype,{logout:function(){window.location.href=latkeConfig.servePath+"/logout"},toggleMenu:function(){"-240px"===$("#tabs").css("left")?($("#tabs").css("left",0),$(".tabs__bg").show()):($("#tabs").css("left","-240px"),$(".tabs__bg").hide())},clearTip:function(){$("#tipMsg").text(""),$("#loadMsg").text("")},setHashByPage:function(t){var e=window.location.hash.split("/");/^\d*$/.test(e[e.length-1])?e[e.length-1]=t:e.push(t),window.location.hash=e.join("/")},selectTab:function(t){window.location.hash="#"+t},analyseHash:function(){for(var t=window.location.hash,e=t.substr(1,t.length-1).split("/"),i={page:1,hashList:[]},a=0;a<e.length;a++)a===e.length-1&&/^\d+$/.test(e[a])?i.page=e[a]:i.hashList.push(e[a]);return i},setCurByHash:function(){$(window).scrollTop(0),$("#tipMsg").text("");var t=admin.analyseHash(),e=t.hashList[1],i=t.hashList[2];if(1===t.hashList.length&&(e=t.hashList[0]),""!==e){"article"!==e?admin.article.clearDraftTimer():"article"===e&&(admin.article.autoSaveDraftTimer=setInterval(function(){admin.article._autoSaveToDraft()},admin.article.AUTOSAVETIME));try{if("article"!==e&&admin.article.isConfirm&&""!==admin.editors.articleEditor.getContent().replace(/\s/g,"")&&admin.article.content!==admin.editors.articleEditor.getContent()&&!confirm(Label.editorLeaveLabel))return void(window.location.hash="#article/article");if("article"===e&&admin.article.isConfirm&&""!==admin.editors.articleEditor.getContent().replace(/\s/g,"")&&admin.article.content!==admin.editors.articleEditor.getContent())return}catch(t){var a=$("#articleContent");if(0<a.length){if("article"!==e&&admin.article.isConfirm&&""!==a.val().replace(/\s/g,"")&&admin.article.content!==a.val()&&!confirm(Label.editorLeaveLabel))return void(window.location.hash="#article/article");if("article"===e&&admin.article.isConfirm&&""!==a.val().replace(/\s/g,"")&&admin.article.content!==a.val())return}}"article"!==e&&admin.editors.articleEditor.setContent&&admin.article.clear(),admin.article.isConfirm=!0,$("#tabs").tabs("setCurrent",e),$("#loadMsg").text(Label.loadingLabel),1===$("#tabsPanel_"+e).length?""===$("#tabsPanel_"+e).html().replace(/\s/g,"")?$("#tabsPanel_"+e).load("admin-"+e+".do",function(){"article"===e&&admin.article.status.id?admin.register[e].init.call(admin.register[e].obj,admin.article.getAndSet):admin.register[e].init.call(admin.register[e].obj,t.page),i&&$("#tab"+e.substring(0,1).toUpperCase()+e.substring(1)).tabs("setCurrent",i),admin.plugin.setCurByHash(t)}):("article"===e&&admin.article.status.id&&admin.article.getAndSet(),admin.register[e]&&admin.register[e].refresh&&admin.register[e].refresh.call(admin.register[e].obj,t.page),i&&$("#tab"+e.substring(0,1).toUpperCase()+e.substring(1)).tabs("setCurrent",i),admin.plugin.setCurByHash(t)):($("#tipMsg").text("Error: No tab! "+Label.reportIssueLabel),$("#loadMsg").text(""))}},init:function(){Util.killIE(),$("#loadMsg").text(Label.loadingLabel),$("#tabs").tabs(),setInterval(function(){""!==$("#tipMsg").text()&&setTimeout(function(){$("#tipMsg").text("")},7e3)},6e3),$("#loadMsg").text("")},collapseNav:function(t){$(t).next().slideToggle("normal",function(){"none"!==this.style.display?($(t).find(".icon-chevron-down")[0].className="icon-chevron-up right",$(t).addClass("tab-current")):($(t).find(".icon-chevron-up")[0].className="icon-chevron-down right",$(t).removeClass("tab-current")),$("#tabs > ul").height("auto"),$("#tabs > ul").height($("#tabs > ul").height()+80)})},inited:function(){if("adminRole"!==Label.userRole)for(var t=0;t<this.adTools.length;t++)$("#tabs").tabs("remove",this.adTools[t]);else for(var e=0;e<this.tools.length;e++)if("#"+window.location.hash.split("/")[1]===this.tools[e]){$("#tabToolsTitle").click();break}this.setCurByHash()}});var admin=new Admin;
admin.editors={};var SoloEditor=function(e){this.conf=e,this.init()};$.extend(SoloEditor.prototype,{init:function(){this.editor=new Vditor(this.conf.id,{cache:!0,hint:{emojiPath:latkeConfig.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},preview:{delay:500,show:this.conf.previewShow,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()))}},upload:{max:10485760,url:Label.uploadURL,token:Label.uploadToken,filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")}},height:this.conf.height,counter:102400,resize:{enable:this.conf.resize},lang:Label.localeString,classes:{preview:"content-reset"}}),"function"==typeof this.conf.fun&&this.conf.fun()},getContent:function(){return this.editor.getValue()},setContent:function(e){this.editor.setValue(e)},remove:function(){document.getElementById(this.editor.vditor.id).outerHTML=""}}),admin.editors.articleEditor={},admin.editors.abstractEditor={},admin.editors.pageEditor={}; admin.editors={};var SoloEditor=function(e){this.conf=e,this.init()};$.extend(SoloEditor.prototype,{init:function(){this.editor=new Vditor(this.conf.id,{cache:!0,hint:{emojiPath:latkeConfig.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},preview:{delay:500,show:this.conf.previewShow,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()))}},upload:{max:10485760,url:Label.uploadURL,token:Label.uploadToken,filename:function(e){return e.replace(/\?|\\|\/|:|\||<|>|\*|\[|\]|\s+/g,"-")}},height:this.conf.height,counter:102400,resize:{enable:this.conf.resize},lang:Label.localeString,classes:{preview:"content-reset"}}),"function"==typeof this.conf.fun&&this.conf.fun()},getContent:function(){return this.editor.getValue()},setContent:function(e){this.editor.setValue(e)},remove:function(){document.getElementById(this.editor.vditor.id).outerHTML=""}}),admin.editors.articleEditor={},admin.editors.abstractEditor={},admin.editors.pageEditor={};
var TablePaginate=function(a){this.id=a,this.currentPage=1};$.extend(TablePaginate.prototype,{buildTable:function(a,t){var e={colModel:a,noDataTip:Label.noDataLabel};t||(e.expendRow={index:"expendRow"}),$("#"+this.id+"Table").table(e)},initPagination:function(){var a=this.id;$("#"+a+"Pagination").paginate({bind:function(a,t){t?$("#tipMsg").text(t):admin.setHashByPage(a)},currentPage:1,errorMessage:Label.inputErrorLabel,nextPageText:">",previousPageText:"<",goText:Label.gotoLabel,type:"custom",custom:[1],pageCount:1})},initCommentsDialog:function(){var a=this;$("#"+this.id+"Comments").dialog({modal:!0,hideFooter:!0,close:function(){return admin[a.id+"List"].getList(a.currentPage),!0}})},updateTablePagination:function(a,t,e){if((t=parseInt(t))>e.paginationPageCount&&1<t)return $("#tipMsg").text(Label.pageLabel+t+Label.notFoundLabel),void $("#loadMsg").text("");$("#"+this.id+"Table").table("update",{data:[{groupName:"all",groupData:a}]}),0===e.paginationPageCount&&(e.paginationPageCount=1),$("#"+this.id+"Pagination").paginate("update",{pageCount:e.paginationPageCount,currentPage:t,custom:e.paginationPageNums}),this.currentPage=t}}); var TablePaginate=function(a){this.id=a,this.currentPage=1};$.extend(TablePaginate.prototype,{buildTable:function(a,t){var e={colModel:a,noDataTip:Label.noDataLabel};t||(e.expendRow={index:"expendRow"}),$("#"+this.id+"Table").table(e)},initPagination:function(){var a=this.id;$("#"+a+"Pagination").paginate({bind:function(a,t){t?$("#tipMsg").text(t):admin.setHashByPage(a)},currentPage:1,errorMessage:Label.inputErrorLabel,nextPageText:">",previousPageText:"<",goText:Label.gotoLabel,type:"custom",custom:[1],pageCount:1})},initCommentsDialog:function(){var a=this;$("#"+this.id+"Comments").dialog({modal:!0,hideFooter:!0,close:function(){return admin[a.id+"List"].getList(a.currentPage),!0}})},updateTablePagination:function(a,t,e){if((t=parseInt(t))>e.paginationPageCount&&1<t)return $("#tipMsg").text(Label.pageLabel+t+Label.notFoundLabel),void $("#loadMsg").text("");$("#"+this.id+"Table").table("update",{data:[{groupName:"all",groupData:a}]}),0===e.paginationPageCount&&(e.paginationPageCount=1),$("#"+this.id+"Pagination").paginate("update",{pageCount:e.paginationPageCount,currentPage:t,custom:e.paginationPageNums}),this.currentPage=t}});
......
/*
* Solo - A small and beautiful blogging system written in Java.
* Copyright (c) 2010-2019, b3log.org & hacpai.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* 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={htmlDecode:function(e){var t=document.createElement("div");return t.innerHTML=decodeURIComponent(e),t.innerText},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(e){var t=!1,i=!1;e=e||"article-body";if($("."+e).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!(t=!0)}),0<$(this).find("code.lang-flow, code.language-flow").length)return!(i=!0)}),t){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(i){var o=function(){$("."+e+" code.lang-flow, ."+e+" 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()})}},isLoggedIn:function(){return!!(1===$("#admin").length&&$("#admin").data("login")||"true"===latkeConfig.isLoggedIn)},getUserName:function(){return 1===$("#adminName").length?$("#adminName").text():latkeConfig.userName},error:function(){$("#tipMsg").text("Error: "+arguments[0]+" File: "+arguments[1]+"\nLine: "+arguments[2]+" please report this issue on https://github.com/b3log/solo/issues/new"),$("#loadMsg").text("")},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},proessURL:function(e){return/^\w+:\/\//.test(e)||(e="http://"+e),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},getWinHeight:function(){return window.innerHeight?window.innerHeight:"CSS1Compat"===document.compatMode?window.document.documentElement.clientHeight:window.document.body.clientHeight}};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=/"}}; var Util={htmlDecode:function(e){var t=document.createElement("div");return t.innerHTML=decodeURIComponent(e),t.innerText},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(e){var t=!1,i=!1;e=e||"article-body";if($("."+e).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!(t=!0)}),0<$(this).find("code.lang-flow, code.language-flow").length)return!(i=!0)}),t){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(i){var o=function(){$("."+e+" code.lang-flow, ."+e+" 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()})}},isLoggedIn:function(){return!!(1===$("#admin").length&&$("#admin").data("login")||"true"===latkeConfig.isLoggedIn)},getUserName:function(){return 1===$("#adminName").length?$("#adminName").text():latkeConfig.userName},error:function(){$("#tipMsg").text("Error: "+arguments[0]+" File: "+arguments[1]+"\nLine: "+arguments[2]+" please report this issue on https://github.com/b3log/solo/issues/new"),$("#loadMsg").text("")},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},proessURL:function(e){return/^\w+:\/\//.test(e)||(e="http://"+e),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},getWinHeight:function(){return window.innerHeight?window.innerHeight:"CSS1Compat"===document.compatMode?window.document.documentElement.clientHeight:window.document.body.clientHeight}};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
This diff is collapsed.
This diff is collapsed.
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a> * @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @author <a href="http://88250.b3log.org">Liang Ding</a> * @author <a href="http://88250.b3log.org">Liang Ding</a>
* @version 2.0.0.2, Feb 18, 2019 * @version 2.0.0.3, Feb 19, 2019
*/ */
var Page = function (tips) { var Page = function (tips) {
this.currentCommentId = '' this.currentCommentId = ''
...@@ -105,11 +105,11 @@ $.extend(Page.prototype, { ...@@ -105,11 +105,11 @@ $.extend(Page.prototype, {
if (typeof Vditor === 'undefined') { if (typeof Vditor === 'undefined') {
$('head'). $('head').
append( append(
$('<link rel=\'stylesheet\' href=\'' + latkeConfig.staticServePath + '/js/lib/vditor-0.2.0/index.classic.css\'>')) $('<link rel=\'stylesheet\' href=\'' + latkeConfig.staticServePath + '/js/lib/vditor-0.2.5/index.classic.css\'>'))
$.ajax({ $.ajax({
method: 'GET', method: 'GET',
url: latkeConfig.staticServePath + '/js/lib/vditor-0.2.0/index.min.js', url: latkeConfig.staticServePath + '/js/lib/vditor-0.2.5/index.min.js',
dataType: 'script', dataType: 'script',
cache: true, cache: true,
async: false, async: false,
......
This diff is collapsed.
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