Commit c7834cd7 authored by Van's avatar Van

#12787

parent 91a55753
...@@ -47,8 +47,6 @@ ...@@ -47,8 +47,6 @@
}); });
$(document).ready(function () { $(document).ready(function () {
page.load(); page.load();
// emotions
page.replaceCommentsEm("#comments .vditor-reset");
<#nested> <#nested>
}); });
</script> </script>
......
...@@ -2,7 +2,7 @@ Util.htmlDecode=function(t){var e=document.createElement("div");return e.innerHT ...@@ -2,7 +2,7 @@ Util.htmlDecode=function(t){var e=document.createElement("div");return e.innerHT
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,tab:"\t",hint:{emojiPath:Label.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},preview:{delay:500,show:this.conf.previewShow,url:Label.servePath+"/console/markdown/2html",parse:function(e){"none"!==e.style.display&&Util.parseLanguage()}},upload:{max:10485760,url:Label.uploadURL,token:Label.uploadToken,filename:function(e){return e.replace(/[^(a-zA-Z0-9\u4e00-\u9fa5\.)]/g,"").replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g,"").replace("/\\s/g","")}},height:this.conf.height,counter:102400,resize:{enable:this.conf.resize},lang:Label.localeString}),"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={};var SoloEditor=function(e){this.conf=e,this.init()};$.extend(SoloEditor.prototype,{init:function(){this.editor=new Vditor(this.conf.id,{cache:!0,tab:"\t",hint:{emojiPath:Label.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},preview:{delay:500,show:this.conf.previewShow,url:Label.servePath+"/console/markdown/2html",parse:function(e){"none"!==e.style.display&&Util.parseLanguage()}},upload:{max:10485760,url:Label.uploadURL,token:Label.uploadToken,filename:function(e){return e.replace(/[^(a-zA-Z0-9\u4e00-\u9fa5\.)]/g,"").replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g,"").replace("/\\s/g","")}},height:this.conf.height,counter:102400,resize:{enable:this.conf.resize},lang:Label.localeString}),"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={};
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}});
admin.article={isConfirm:!0,status:{id:void 0,isArticle:void 0},content:"",get:function(t,e){this.status.id=t,this.status.isArticle=e,admin.selectTab("article/article")},getAndSet:function(){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/article/"+admin.article.status.id,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){$("#title").val(e.article.articleTitle),admin.editors.articleEditor.setContent(e.article.articleContent),admin.editors.abstractEditor.setContent(e.article.articleAbstract),admin.article.content=admin.editors.articleEditor.getContent();for(var i=e.article.articleTags,a="",l=0;l<i.length;l++)0===l?a=i[l].tagTitle:a+=","+i[l].tagTitle;$("#tag").val(a),$("#permalink").val(e.article.articlePermalink),$("#viewPwd").val(e.article.articleViewPwd),$("#articleCommentable").prop("checked",e.article.articleCommentable);var s=e.article.signs;$(".signs button").each(function(t){parseInt(e.article.articleSignId)===parseInt(s[t].oId)?$("#articleSign"+s[t].oId).addClass("selected"):$("#articleSign"+s[t].oId).removeClass("selected")}),admin.article.setStatus(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(t,i,e){confirm(Label.confirmRemoveLabel+Label.articleLabel+'"'+Util.htmlDecode(e)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/article/"+t,type:"DELETE",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc?admin[i+"List"].getList(1):$("#loadMsg").text("")}}))},add:function(e){if(admin.article.validate()){var i=this;i._addDisabled(),$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var t="";$(".signs button").each(function(){"selected"===this.className&&(t=this.id.substr(this.id.length-1,1))});var a=admin.editors.articleEditor.getContent(),l=admin.editors.abstractEditor.getContent();if($("#articleThumbnail").prop("checked")){var s=$(".thumbnail__img").css("background-image");a="![]("+s.substring(5,s.length-2).replace("w/768","w/960").replace("h/432","h/540")+")\n\n"+a}var c={article:{articleTitle:$("#title").val(),articleContent:a,articleAbstract:l,articleTags:this.trimUniqueArray($("#tag").val()).toString(),articlePermalink:$("#permalink").val(),articleStatus:e,articleSignId:t,postToCommunity:$("#postToCommunity").prop("checked"),articleCommentable:$("#articleCommentable").prop("checked"),articleViewPwd:$("#viewPwd").val()}};$.ajax({url:Label.servePath+"/console/article/",type:"POST",cache:!1,data:JSON.stringify(c),success:function(t){$("#tipMsg").text(t.msg),t.sc&&(admin.article.status.id=void 0,0===e?admin.selectTab("article/article-list"):admin.selectTab("article/draft-list"),admin.article.isConfirm=!1)},complete:function(t,e){i._removeDisabled(),$("#loadMsg").text("")}})}},update:function(i){if(admin.article.validate()){var a=this;a._addDisabled(),$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var t="";$(".signs button").each(function(){"selected"===this.className&&(t=this.id.substr(this.id.length-1,1))});var e=admin.editors.articleEditor.getContent(),l=admin.editors.abstractEditor.getContent();if($("#articleThumbnail").prop("checked")){var s=$(".thumbnail__img").css("background-image");e="![]("+s.substring(5,s.length-2).replace("w/768","w/960").replace("h/432","h/540")+") \n\n"+e}var c={article:{oId:this.status.id,articleTitle:$("#title").val(),articleContent:e,articleAbstract:l,articleTags:this.trimUniqueArray($("#tag").val()).toString(),articlePermalink:$("#permalink").val(),articleStatus:i,articleSignId:t,articleCommentable:$("#articleCommentable").prop("checked"),articleViewPwd:$("#viewPwd").val(),postToCommunity:$("#postToCommunity").prop("checked")}};$.ajax({url:Label.servePath+"/console/article/",type:"PUT",cache:!1,data:JSON.stringify(c),success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&(0===i?admin.selectTab("article/article-list"):admin.selectTab("article/draft-list"),$("#tipMsg").text(Label.updateSuccLabel),admin.article.status.id=void 0,admin.article.isConfirm=!1)},complete:function(t,e){a._removeDisabled(),$("#loadMsg").text("")}})}},setStatus:function(){$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){if(!(t.tags.length<=0)){$("#tagCheckboxPanel>span").remove("");for(var i="",a=0;a<t.tags.length;a++)i+="<span>"+t.tags[a].tagTitle+"</span>";$("#tagCheckboxPanel").html(i+'<div class="fn__clear"></div>'),$("#loadMsg").text("")}}else $("#loadMsg").text("")}}),this.status?this.status.isArticle?($("#unSubmitArticle").show(),$("#saveArticle").hide(),$("#submitArticle").show()):($("#submitArticle").show(),$("#unSubmitArticle").hide(),$("#saveArticle").show()):($("#submitArticle").show(),$("#unSubmitArticle").hide(),$("#saveArticle").show(),$("#postToCommunityPanel").show())},clear:function(){this.status={id:void 0,isArticle:void 0},this.setStatus(),$("#title").val(""),admin.editors.articleEditor.setContent(""),admin.editors.abstractEditor.setContent(""),$("#tag").val(""),$("#tagCheckboxPanel").hide().find("span").removeClass("selected"),$("#permalink").val(""),$("#articleCammentable").prop("checked",!0),$("#postToCommunity").prop("checked",!1),$(".signs button").each(function(t){this.className=0===t?"selected":""}),$("#articleThumbnail").prop("checked")&&$("#articleThumbnail").click()},init:function(t){$(".signs button").click(function(t){$(".signs button").removeClass("selected"),$(this).addClass("selected")}),$("#tipMsg").text(Label.uploadMsg),$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){if(!(t.tags.length<=0)){for(var i=[],a=0;a<t.tags.length;a++)i.push(t.tags[a].tagTitle);$("#tag").completed({height:160,buttonText:Label.selectLabel,data:i}),$("#loadMsg").text("")}}else $("#loadMsg").text("")}}),$("#submitArticle").click(function(){admin.article.status.id?admin.article.update(0):admin.article.add(0)}),$("#saveArticle").click(function(){admin.article.status.id?admin.article.update(admin.article.status.isArticle?0:1):admin.article.add(1)}),admin.editors.articleEditor=new SoloEditor({id:"articleContent",height:500,fun:t,previewShow:!0,resize:!1}),admin.editors.abstractEditor=new SoloEditor({id:"abstract",height:200,previewShow:!1,resize:!0}),$("#articleThumbnailBtn").click(function(){$.ajax({url:Label.servePath+"/console/thumbs?n=1&w=768&h=432",type:"GET",cache:!1,success:function(t,e){t.sc?$("#articleThumbnailBtn").prev().css("background-image","url("+t.data[0]+")"):$("#loadMsg").text(t.msg)}})}).click()},validate:function(){var t=admin.editors.articleEditor.getContent();if(""===$("#title").val().replace(/\s/g,""))$("#tipMsg").text(Label.titleEmptyLabel),$("#title").focus().val("");else{if(""!==t.replace(/\s/g,""))return!0;$("#tipMsg").text(Label.contentEmptyLabel)}return!1},unPublish:function(){var i=this;i._addDisabled(),$.ajax({url:Label.servePath+"/console/article/unpublish/"+admin.article.status.id,type:"PUT",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&(admin.selectTab("article/draft-list"),admin.article.status.id=void 0,admin.article.isConfirm=!1)},complete:function(t,e){i._removeDisabled(),$("#loadMsg").text("")}})},trimUniqueArray:function(t){for(var e=(t=t.toString()).split(","),i=0;i<e.length;i++)e[i]=e[i].replace(/(^\s*)|(\s*$)/g,""),""===e[i]&&(e.splice(i,1),i--);return $.unique(e).toString()},prePost:function(){if($("#loadMsg").text(Label.loadingLabel),admin.article.content="",admin.editors.articleEditor.getContent){var t=admin.editors.articleEditor.getContent();"#article/article"===window.location.hash&&""!==t.replace(/\s/g,"")&&confirm(Label.editorPostLabel)&&admin.article.clear(),$("#tipMsg").text(""),$("#loadMsg").text("")}},_addDisabled:function(){$("#unSubmitArticle").attr("disabled","disabled"),$("#saveArticle").attr("disabled","disabled"),$("#submitArticle").attr("disabled","disabled")},_removeDisabled:function(){$("#unSubmitArticle").removeAttr("disabled"),$("#saveArticle").removeAttr("disabled"),$("#submitArticle").removeAttr("disabled")}},admin.register.article={obj:admin.article,init:admin.article.init,refresh:function(){admin.editors.abstractEditor.setContent(""),admin.editors.articleEditor.setContent(""),$("#loadMsg").text(""),$("#tipMsg").text(Label.uploadMsg)}}; admin.article={isConfirm:!0,status:{id:void 0,isArticle:void 0},content:"",get:function(t,e){this.status.id=t,this.status.isArticle=e,admin.selectTab("article/article")},getAndSet:function(){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/article/"+admin.article.status.id,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){$("#title").val(e.article.articleTitle),admin.editors.articleEditor.setContent(e.article.articleContent),admin.editors.abstractEditor.setContent(e.article.articleAbstract),admin.article.content=admin.editors.articleEditor.getContent();for(var i=e.article.articleTags,a="",l=0;l<i.length;l++)0===l?a=i[l].tagTitle:a+=","+i[l].tagTitle;$("#tag").val(a),$("#permalink").val(e.article.articlePermalink),$("#viewPwd").val(e.article.articleViewPwd),$("#articleCommentable").prop("checked",e.article.articleCommentable);var s=e.article.signs;$(".signs button").each(function(t){parseInt(e.article.articleSignId)===parseInt(s[t].oId)?$("#articleSign"+s[t].oId).addClass("selected"):$("#articleSign"+s[t].oId).removeClass("selected")}),admin.article.setStatus(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(t,i,e){confirm(Label.confirmRemoveLabel+Label.articleLabel+'"'+Util.htmlDecode(e)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/article/"+t,type:"DELETE",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc?admin[i+"List"].getList(1):$("#loadMsg").text("")}}))},add:function(e){if(admin.article.validate()){var i=this;i._addDisabled(),$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var t="";$(".signs button").each(function(){"selected"===this.className&&(t=this.id.substr(this.id.length-1,1))});var a=admin.editors.articleEditor.getContent(),l=admin.editors.abstractEditor.getContent();if($("#articleThumbnail").prop("checked")){var s=$(".thumbnail__img").css("background-image");a="![]("+s.substring(5,s.length-2).replace("w/768","w/960").replace("h/432","h/540")+")\n\n"+a}var c={article:{articleTitle:$("#title").val(),articleContent:a,articleAbstract:l,articleTags:this.trimUniqueArray($("#tag").val()).toString(),articlePermalink:$("#permalink").val(),articleStatus:e,articleSignId:t,postToCommunity:$("#postToCommunity").prop("checked"),articleCommentable:$("#articleCommentable").prop("checked"),articleViewPwd:$("#viewPwd").val()}};$.ajax({url:Label.servePath+"/console/article/",type:"POST",cache:!1,data:JSON.stringify(c),success:function(t){$("#tipMsg").text(t.msg),t.sc&&(admin.article.status.id=void 0,0===e?admin.selectTab("article/article-list"):admin.selectTab("article/draft-list"),admin.article.isConfirm=!1)},complete:function(t,e){i._removeDisabled(),$("#loadMsg").text("")}})}},update:function(i){if(admin.article.validate()){var a=this;a._addDisabled(),$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var t="";$(".signs button").each(function(){"selected"===this.className&&(t=this.id.substr(this.id.length-1,1))});var e=admin.editors.articleEditor.getContent(),l=admin.editors.abstractEditor.getContent();if($("#articleThumbnail").prop("checked")){var s=$(".thumbnail__img").css("background-image");e="![]("+s.substring(5,s.length-2).replace("w/768","w/960").replace("h/432","h/540")+") \n\n"+e}var c={article:{oId:this.status.id,articleTitle:$("#title").val(),articleContent:e,articleAbstract:l,articleTags:this.trimUniqueArray($("#tag").val()).toString(),articlePermalink:$("#permalink").val(),articleStatus:i,articleSignId:t,articleCommentable:$("#articleCommentable").prop("checked"),articleViewPwd:$("#viewPwd").val(),postToCommunity:$("#postToCommunity").prop("checked")}};$.ajax({url:Label.servePath+"/console/article/",type:"PUT",cache:!1,data:JSON.stringify(c),success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&(0===i?admin.selectTab("article/article-list"):admin.selectTab("article/draft-list"),$("#tipMsg").text(Label.updateSuccLabel),admin.article.status.id=void 0,admin.article.isConfirm=!1)},complete:function(t,e){a._removeDisabled(),$("#loadMsg").text("")}})}},setStatus:function(){$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){if(!(t.tags.length<=0)){$("#tagCheckboxPanel>span").remove("");for(var i="",a=0;a<t.tags.length;a++)i+="<span>"+t.tags[a].tagTitle+"</span>";$("#tagCheckboxPanel").html(i+'<div class="fn__clear"></div>'),$("#loadMsg").text("")}}else $("#loadMsg").text("")}}),this.status?this.status.isArticle?($("#unSubmitArticle").show(),$("#saveArticle").hide(),$("#submitArticle").show()):($("#submitArticle").show(),$("#unSubmitArticle").hide(),$("#saveArticle").show()):($("#submitArticle").show(),$("#unSubmitArticle").hide(),$("#saveArticle").show(),$("#postToCommunityPanel").show())},clear:function(){this.status={id:void 0,isArticle:void 0},this.setStatus(),$("#title").val(""),admin.editors.articleEditor.setContent(""),admin.editors.abstractEditor.setContent(""),$("#tag").val(""),$("#tagCheckboxPanel").hide().find("span").removeClass("selected"),$("#permalink").val(""),$("#articleCammentable").prop("checked",!0),$("#postToCommunity").prop("checked",!1),$(".signs button").each(function(t){this.className=0===t?"selected":""}),$("#articleThumbnail").prop("checked")&&$("#articleThumbnail").click()},init:function(t){$(".signs button").click(function(t){$(".signs button").removeClass("selected"),$(this).addClass("selected")}),$("#tipMsg").text(Label.uploadMsg),$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){if(!(t.tags.length<=0)){for(var i=[],a=0;a<t.tags.length;a++)i.push(t.tags[a].tagTitle);$("#tag").completed({height:160,buttonText:Label.selectLabel,data:i}),$("#loadMsg").text("")}}else $("#loadMsg").text("")}}),$("#submitArticle").click(function(){admin.article.status.id?admin.article.update(0):admin.article.add(0)}),$("#saveArticle").click(function(){admin.article.status.id?admin.article.update(admin.article.status.isArticle?0:1):admin.article.add(1)}),admin.editors.articleEditor=new SoloEditor({id:"articleContent",height:500,fun:t,previewShow:!0,resize:!1}),admin.editors.abstractEditor=new SoloEditor({id:"abstract",height:200,previewShow:!1,resize:!0}),$("#articleThumbnailBtn").click(function(){$.ajax({url:Label.servePath+"/console/thumbs?n=1&w=768&h=432",type:"GET",cache:!1,success:function(t,e){t.sc?$("#articleThumbnailBtn").prev().css("background-image","url("+t.data[0]+")"):$("#loadMsg").text(t.msg)}})}).click()},validate:function(){var t=admin.editors.articleEditor.getContent();if(""===$("#title").val().replace(/\s/g,""))$("#tipMsg").text(Label.titleEmptyLabel),$("#title").focus().val("");else{if(""!==t.replace(/\s/g,""))return!0;$("#tipMsg").text(Label.contentEmptyLabel)}return!1},unPublish:function(){var i=this;i._addDisabled(),$.ajax({url:Label.servePath+"/console/article/unpublish/"+admin.article.status.id,type:"PUT",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&(admin.selectTab("article/draft-list"),admin.article.status.id=void 0,admin.article.isConfirm=!1)},complete:function(t,e){i._removeDisabled(),$("#loadMsg").text("")}})},trimUniqueArray:function(t){for(var e=(t=t.toString()).split(","),i=0;i<e.length;i++)e[i]=e[i].replace(/(^\s*)|(\s*$)/g,""),""===e[i]&&(e.splice(i,1),i--);return $.unique(e).toString()},prePost:function(){if($("#loadMsg").text(Label.loadingLabel),admin.article.content="",admin.editors.articleEditor.getContent){var t=admin.editors.articleEditor.getContent();"#article/article"===window.location.hash&&""!==t.replace(/\s/g,"")&&confirm(Label.editorPostLabel)&&admin.article.clear(),$("#tipMsg").text(""),$("#loadMsg").text("")}},_addDisabled:function(){$("#unSubmitArticle").attr("disabled","disabled"),$("#saveArticle").attr("disabled","disabled"),$("#submitArticle").attr("disabled","disabled")},_removeDisabled:function(){$("#unSubmitArticle").removeAttr("disabled"),$("#saveArticle").removeAttr("disabled"),$("#submitArticle").removeAttr("disabled")}},admin.register.article={obj:admin.article,init:admin.article.init,refresh:function(){admin.editors.abstractEditor.setContent(""),admin.editors.articleEditor.setContent(""),$("#loadMsg").text(""),$("#tipMsg").text(Label.uploadMsg)}};
admin.comment={open:function(e,t){this.getList(e,t),$("#"+t+"Comments").dialog("open")},getList:function(i,c){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$("#"+c+"Comments").html("");var e="article";"page"===c&&(e="page"),$.ajax({url:Label.servePath+"/console/comments/"+e+"/"+i,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){for(var a=e.comments,n="",m=0;m<a.length;m++){var s="<a target='_blank' href='"+a[m].commentURL+"'>",l=a[m].commentContent,o=Util.replaceEmString(l);"http://"===a[m].commentURL&&(s="<a target='_blank'>"),n+="<div class='comment-title'><span class='fn__left'>"+s+a[m].commentName+"</a>",a[m].commentOriginalCommentName&&(n+="@"+a[m].commentOriginalCommentName),n+="</span><a title='"+Label.removeLabel+"' class='fn__right fn__pointer' href=\"javascript:admin.comment.del('"+a[m].oId+"', '"+c+"', '"+i+"')\">"+Label.removeLabel+"</a><span class='fn__right'>&nbsp;&nbsp;"+$.bowknot.getDate(a[m].commentTime)+"&nbsp;</span><div class='fn__clear'></div></div><div class='vditor-reset'>"+o+"</div>"}""===n&&(n=Label.noCommentLabel),$("#"+c+"Comments").html(n),Util.parseMarkdown(),Util.parseLanguage(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(e,a,n){if(confirm(Label.confirmRemoveLabel+Label.commentLabel+"?")){$("#loadMsg").text(Label.loadingLabel);var t="article";"page"===a&&(t="page"),$.ajax({url:Label.servePath+"/console/"+t+"/comment/"+e,type:"DELETE",cache:!1,success:function(e,t){$("#tipMsg").text(e.msg),e.sc&&admin.comment.getList(n,a),$("#loadMsg").text("")}})}}}; admin.comment={open:function(e,t){this.getList(e,t),$("#"+t+"Comments").dialog("open")},getList:function(l,c){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$("#"+c+"Comments").html("");var e="article";"page"===c&&(e="page"),$.ajax({url:Label.servePath+"/console/comments/"+e+"/"+l,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){for(var a=e.comments,n="",m=0;m<a.length;m++){var s="<a target='_blank' href='"+a[m].commentURL+"'>",o=a[m].commentContent;"http://"===a[m].commentURL&&(s="<a target='_blank'>"),n+="<div class='comment-title'><span class='fn__left'>"+s+a[m].commentName+"</a>",a[m].commentOriginalCommentName&&(n+="@"+a[m].commentOriginalCommentName),n+="</span><a title='"+Label.removeLabel+"' class='fn__right fn__pointer' href=\"javascript:admin.comment.del('"+a[m].oId+"', '"+c+"', '"+l+"')\">"+Label.removeLabel+"</a><span class='fn__right'>&nbsp;&nbsp;"+$.bowknot.getDate(a[m].commentTime)+"&nbsp;</span><div class='fn__clear'></div></div><div class='vditor-reset'>"+o+"</div>"}""===n&&(n=Label.noCommentLabel),$("#"+c+"Comments").html(n),Util.parseMarkdown(),Util.parseLanguage(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(e,a,n){if(confirm(Label.confirmRemoveLabel+Label.commentLabel+"?")){$("#loadMsg").text(Label.loadingLabel);var t="article";"page"===a&&(t="page"),$.ajax({url:Label.servePath+"/console/"+t+"/comment/"+e,type:"DELETE",cache:!1,success:function(e,t){$("#tipMsg").text(e.msg),e.sc&&admin.comment.getList(n,a),$("#loadMsg").text("")}})}}};
admin.articleList={tablePagination:new TablePaginate("article"),init:function(t){this.tablePagination.buildTable([{text:Label.titleLabel,index:"title",minWidth:110,style:"padding-left: 12px;font-size:14px;"},{text:Label.authorLabel,index:"author",width:150,style:"padding-left: 12px;"},{text:Label.commentLabel,index:"comments",width:80,style:"padding-left: 12px;"},{text:Label.viewLabel,width:60,index:"articleViewCount",style:"padding-left: 12px;"},{text:Label.dateLabel,index:"date",width:90,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.tablePagination.initCommentsDialog(),this.getList(t);var e=this;$("#articleListBtn").click(function(){e.getList(t)})},syncToHacpai:function(t){$.ajax({url:Label.servePath+"/console/article/push2rhy?id="+t,type:"GET",cache:!1,success:function(t,e){$("#tipMsg").text(Label.pushSuccLabel)}})},getList:function(c){var o=this;$("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/articles/status/published/"+c+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE+"?k="+$("#articleListInput").val(),type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){for(var a=t.articles,i=[],l=0;l<a.length;l++){i[l]={},i[l].title='<a href="'+Label.servePath+a[l].articlePermalink+"\" target='_blank' title='"+a[l].articleTitle+"' class='no-underline'>"+a[l].articleTitle+"</a><span class='table-tag'>"+a[l].articleTags+"</span>",i[l].date=$.bowknot.getDate(a[l].articleCreateTime),i[l].comments=a[l].articleCommentCount,i[l].articleViewCount=a[l].articleViewCount,i[l].author=a[l].authorName;var n=a[l].articlePutTop?Label.cancelPutTopLabel:Label.putTopLabel;i[l].expendRow="<a href='javascript:void(0)' onclick=\"admin.article.get('"+a[l].oId+"', true)\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.article.del('"+a[l].oId+"', 'article', '"+encodeURIComponent(a[l].articleTitle)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.articleList.syncToHacpai('"+a[l].oId+"')\">"+Label.pushToHacpaiLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.articleList.popTop(this, '"+a[l].oId+"')\">"+n+"</a> <a href='javascript:void(0)' onclick=\"admin.comment.open('"+a[l].oId+"', 'article')\">"+Label.commentLabel+"</a>"}o.tablePagination.updateTablePagination(i,c,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},popTop:function(t,e){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var a=$(t),i="canceltop",l=Label.putTopLabel;a.html()===Label.putTopLabel&&(i="puttop",l=Label.cancelPutTopLabel),$.ajax({url:Label.servePath+"/console/article/"+i+"/"+e,type:"PUT",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&a.html(l),$("#loadMsg").text("")}})}},admin.register["article-list"]={obj:admin.articleList,init:admin.articleList.init,refresh:admin.articleList.getList}; admin.articleList={tablePagination:new TablePaginate("article"),init:function(t){this.tablePagination.buildTable([{text:Label.titleLabel,index:"title",minWidth:110,style:"padding-left: 12px;font-size:14px;"},{text:Label.authorLabel,index:"author",width:150,style:"padding-left: 12px;"},{text:Label.commentLabel,index:"comments",width:80,style:"padding-left: 12px;"},{text:Label.viewLabel,width:60,index:"articleViewCount",style:"padding-left: 12px;"},{text:Label.dateLabel,index:"date",width:90,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.tablePagination.initCommentsDialog(),this.getList(t);var e=this;$("#articleListBtn").click(function(){e.getList(t)})},syncToHacpai:function(t){$.ajax({url:Label.servePath+"/console/article/push2rhy?id="+t,type:"GET",cache:!1,success:function(t,e){$("#tipMsg").text(Label.pushSuccLabel)}})},getList:function(c){var o=this;$("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/articles/status/published/"+c+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE+"?k="+$("#articleListInput").val(),type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){for(var a=t.articles,i=[],l=0;l<a.length;l++){i[l]={},i[l].title='<a href="'+Label.servePath+a[l].articlePermalink+"\" target='_blank' title='"+a[l].articleTitle+"' class='no-underline'>"+a[l].articleTitle+"</a><span class='table-tag'>"+a[l].articleTags+"</span>",i[l].date=$.bowknot.getDate(a[l].articleCreateTime),i[l].comments=a[l].articleCommentCount,i[l].articleViewCount=a[l].articleViewCount,i[l].author=a[l].authorName;var n=a[l].articlePutTop?Label.cancelPutTopLabel:Label.putTopLabel;i[l].expendRow="<a href='javascript:void(0)' onclick=\"admin.article.get('"+a[l].oId+"', true)\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.article.del('"+a[l].oId+"', 'article', '"+encodeURIComponent(a[l].articleTitle)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.articleList.syncToHacpai('"+a[l].oId+"')\">"+Label.pushToHacpaiLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.articleList.popTop(this, '"+a[l].oId+"')\">"+n+"</a> <a href='javascript:void(0)' onclick=\"admin.comment.open('"+a[l].oId+"', 'article')\">"+Label.commentLabel+"</a>"}o.tablePagination.updateTablePagination(i,c,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},popTop:function(t,e){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var a=$(t),i="canceltop",l=Label.putTopLabel;a.html()===Label.putTopLabel&&(i="puttop",l=Label.cancelPutTopLabel),$.ajax({url:Label.servePath+"/console/article/"+i+"/"+e,type:"PUT",cache:!1,success:function(t,e){$("#tipMsg").text(t.msg),t.sc&&a.html(l),$("#loadMsg").text("")}})}},admin.register["article-list"]={obj:admin.articleList,init:admin.articleList.init,refresh:admin.articleList.getList};
admin.draftList={tablePagination:new TablePaginate("draft"),init:function(t){this.tablePagination.buildTable([{text:Label.titleLabel,index:"title",minWidth:110,style:"padding-left: 12px;font-size:14px;"},{text:Label.authorLabel,index:"author",width:150,style:"padding-left: 12px;"},{text:Label.commentLabel,index:"comments",width:80,style:"padding-left: 12px;"},{text:Label.viewLabel,width:60,index:"articleViewCount",style:"padding-left: 12px;"},{text:Label.dateLabel,index:"date",width:90,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.tablePagination.initCommentsDialog(),this.getList(t)},getList:function(n){$("#loadMsg").text(Label.loadingLabel);var d=this;$.ajax({url:Label.servePath+"/console/articles/status/unpublished/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){for(var a=t.articles,i=[],l=0;l<a.length;l++)i[l]={},i[l].tags=a[l].articleTags,i[l].date=$.bowknot.getDate(a[l].articleCreateTime),i[l].comments=a[l].articleCommentCount,i[l].articleViewCount=a[l].articleViewCount,i[l].author=a[l].authorName,i[l].title="<a class='no-underline' href='"+Label.servePath+a[l].articlePermalink+"' target='_blank'>"+a[l].articleTitle+"</a><span class='table-tag'>"+a[l].articleTags+"</span>",i[l].expendRow="<a href='javascript:void(0)' onclick=\"admin.article.get('"+a[l].oId+"', false);\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.article.del('"+a[l].oId+"', 'draft', '"+encodeURIComponent(a[l].articleTitle)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.comment.open('"+a[l].oId+"', 'draft')\">"+Label.commentLabel+"</a>";d.tablePagination.updateTablePagination(i,n,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},admin.register["draft-list"]={obj:admin.draftList,init:admin.draftList.init,refresh:admin.draftList.getList}; admin.draftList={tablePagination:new TablePaginate("draft"),init:function(t){this.tablePagination.buildTable([{text:Label.titleLabel,index:"title",minWidth:110,style:"padding-left: 12px;font-size:14px;"},{text:Label.authorLabel,index:"author",width:150,style:"padding-left: 12px;"},{text:Label.commentLabel,index:"comments",width:80,style:"padding-left: 12px;"},{text:Label.viewLabel,width:60,index:"articleViewCount",style:"padding-left: 12px;"},{text:Label.dateLabel,index:"date",width:90,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.tablePagination.initCommentsDialog(),this.getList(t)},getList:function(n){$("#loadMsg").text(Label.loadingLabel);var d=this;$.ajax({url:Label.servePath+"/console/articles/status/unpublished/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){for(var a=t.articles,i=[],l=0;l<a.length;l++)i[l]={},i[l].tags=a[l].articleTags,i[l].date=$.bowknot.getDate(a[l].articleCreateTime),i[l].comments=a[l].articleCommentCount,i[l].articleViewCount=a[l].articleViewCount,i[l].author=a[l].authorName,i[l].title="<a class='no-underline' href='"+Label.servePath+a[l].articlePermalink+"' target='_blank'>"+a[l].articleTitle+"</a><span class='table-tag'>"+a[l].articleTags+"</span>",i[l].expendRow="<a href='javascript:void(0)' onclick=\"admin.article.get('"+a[l].oId+"', false);\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.article.del('"+a[l].oId+"', 'draft', '"+encodeURIComponent(a[l].articleTitle)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.comment.open('"+a[l].oId+"', 'draft')\">"+Label.commentLabel+"</a>";d.tablePagination.updateTablePagination(i,n,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},admin.register["draft-list"]={obj:admin.draftList,init:admin.draftList.init,refresh:admin.draftList.getList};
admin.pageList={tablePagination:new TablePaginate("page"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},id:"",init:function(e){this.tablePagination.buildTable([{text:"",index:"pageOrder",width:60,style:"padding-left: 12px;font-size:14px;"},{style:"padding-left: 12px;",text:Label.titleLabel,index:"pageTitle",width:300},{style:"padding-left: 12px;",text:Label.permalinkLabel,index:"pagePermalink",minWidth:100},{style:"padding-left: 12px;",text:Label.openMethodLabel,index:"pageTarget",width:120}]),this.tablePagination.initPagination(),this.getList(e)},getList:function(p){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var l=this;$.ajax({url:Label.servePath+"/console/pages/"+p+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.pages,i=[];admin.pageList.pageInfo.currentCount=t.length,admin.pageList.pageInfo.pageCount=0===e.pagination.paginationPageCount?1:e.pagination.paginationPageCount;for(var n=0;n<t.length;n++){i[n]={},0===n?1===t.length?i[n].pageOrder="":i[n].pageOrder='<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'down\');" class="icon-move-down"></span></div>':n===t.length-1?i[n].pageOrder='<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'up\');" class="icon-move-up"></span> </div>':i[n].pageOrder='<div class="table-center" style="width:38px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'up\');" class="icon-move-up"></span> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'down\');" class="icon-move-down"></span> </div>';var g="";""!==t[n].pageIcon&&(g="<img class='navigation-icon' src='"+t[n].pageIcon+"'/> "),i[n].pageTitle=g+"<a class='no-underline' href='"+t[n].pagePermalink+"' target='_blank'>"+t[n].pageTitle+"</a>",i[n].pagePermalink="<a class='no-underline' href='"+t[n].pagePermalink+"' target='_blank'>"+t[n].pagePermalink+"</a>",i[n].pageTarget=t[n].pageOpenTarget,i[n].expendRow="<span><a href='"+t[n].pagePermalink+"' target='_blank'>"+Label.viewLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.pageList.get('"+t[n].oId+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.pageList.del('"+t[n].oId+"', '"+encodeURIComponent(t[n].pageTitle)+"')\">"+Label.removeLabel+"</a></span>"}l.tablePagination.updateTablePagination(i,p,e.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},get:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/page/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&(admin.pageList.id=t,$("#pageTitle").val(e.page.pageTitle),$("#pagePermalink").val(e.page.pagePermalink),$("#pageTarget").val(e.page.pageOpenTarget),$("#pageIcon").val(e.page.pageIcon)),$("#loadMsg").text("")}})},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.navLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/page/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.pageList.pageInfo.currentPage;1===admin.pageList.pageInfo.currentCount&&1!==admin.pageList.pageInfo.pageCount&&admin.pageList.pageInfo.currentPage===admin.pageList.pageInfo.pageCount&&(admin.pageList.pageInfo.pageCount--,t=admin.pageList.pageInfo.pageCount);var i=window.location.hash.split("/");t==i[i.length-1]?admin.pageList.getList(t):admin.setHashByPage(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},add:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g,""),a={page:{pageTitle:$("#pageTitle").val(),pagePermalink:e,pageOpenTarget:$("#pageTarget").val(),pageIcon:$("#pageIcon").val()}};$.ajax({url:Label.servePath+"/console/page/",type:"POST",cache:!1,data:JSON.stringify(a),success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){admin.pageList.id="",$("#pagePermalink").val(""),$("#pageTitle").val(""),$("#pageIcon").val(""),$("#pageTarget").val("_self"),admin.pageList.pageInfo.currentCount===Label.PAGE_SIZE&&admin.pageList.pageInfo.currentPage===admin.pageList.pageInfo.pageCount&&admin.pageList.pageInfo.pageCount++;var t=window.location.hash.split("/");admin.pageList.pageInfo.pageCount==t[t.length-1]?admin.pageList.getList(admin.pageList.pageInfo.pageCount):admin.setHashByPage(admin.pageList.pageInfo.pageCount),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},update:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g,""),a={page:{pageTitle:$("#pageTitle").val(),oId:this.id,pagePermalink:e,pageOpenTarget:$("#pageTarget").val(),pageIcon:$("#pageIcon").val()}};$.ajax({url:Label.servePath+"/console/page/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&(admin.pageList.id="",admin.pageList.getList(admin.pageList.pageInfo.currentPage),$("#pageTitle").val(""),$("#pageIcon").val(""),$("#pagePermalink").val(""),$("#pageTarget").val("_self")),$("#loadMsg").text("")}})}},validate:function(){if(""===$("#pageTitle").val().replace(/\s/g,""))$("#tipMsg").text(Label.titleEmptyLabel),$("#pageTitle").focus();else{if(""!==$("#pagePermalink").val().replace(/\s/g,""))return!0;$("#tipMsg").text(Label.linkEmptyLabel)}return!1},submit:function(){""!==this.id?this.update():this.add()},changeOrder:function(e,a,t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var i={oId:e.toString(),direction:t};$.ajax({url:Label.servePath+"/console/page/order/",type:"PUT",cache:!1,data:JSON.stringify(i),success:function(e,a){$("#tipMsg").text(e.msg),admin.pageList.getList(admin.pageList.pageInfo.currentPage),$("#loadMsg").text("")}})}},admin.register["page-list"]={obj:admin.pageList,init:admin.pageList.init,refresh:admin.pageList.getList}; admin.pageList={tablePagination:new TablePaginate("page"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},id:"",init:function(e){this.tablePagination.buildTable([{text:"",index:"pageOrder",width:60,style:"padding-left: 12px;font-size:14px;"},{style:"padding-left: 12px;",text:Label.titleLabel,index:"pageTitle",width:300},{style:"padding-left: 12px;",text:Label.permalinkLabel,index:"pagePermalink",minWidth:100},{style:"padding-left: 12px;",text:Label.openMethodLabel,index:"pageTarget",width:120}]),this.tablePagination.initPagination(),this.getList(e)},getList:function(p){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var l=this;$.ajax({url:Label.servePath+"/console/pages/"+p+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.pages,i=[];admin.pageList.pageInfo.currentCount=t.length,admin.pageList.pageInfo.pageCount=0===e.pagination.paginationPageCount?1:e.pagination.paginationPageCount;for(var n=0;n<t.length;n++){i[n]={},0===n?1===t.length?i[n].pageOrder="":i[n].pageOrder='<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'down\');" class="icon-move-down"></span></div>':n===t.length-1?i[n].pageOrder='<div class="table-center" style="width:14px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'up\');" class="icon-move-up"></span> </div>':i[n].pageOrder='<div class="table-center" style="width:38px"> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'up\');" class="icon-move-up"></span> <span onclick="admin.pageList.changeOrder('+t[n].oId+", "+n+', \'down\');" class="icon-move-down"></span> </div>';var g="";""!==t[n].pageIcon&&(g="<img class='navigation-icon' src='"+t[n].pageIcon+"'/> "),i[n].pageTitle=g+"<a class='no-underline' href='"+t[n].pagePermalink+"' target='_blank'>"+t[n].pageTitle+"</a>",i[n].pagePermalink="<a class='no-underline' href='"+t[n].pagePermalink+"' target='_blank'>"+t[n].pagePermalink+"</a>",i[n].pageTarget=t[n].pageOpenTarget,i[n].expendRow="<span><a href='"+t[n].pagePermalink+"' target='_blank'>"+Label.viewLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.pageList.get('"+t[n].oId+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.pageList.del('"+t[n].oId+"', '"+encodeURIComponent(t[n].pageTitle)+"')\">"+Label.removeLabel+"</a></span>"}l.tablePagination.updateTablePagination(i,p,e.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},get:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/page/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&(admin.pageList.id=t,$("#pageTitle").val(e.page.pageTitle),$("#pagePermalink").val(e.page.pagePermalink),$("#pageTarget").val(e.page.pageOpenTarget),$("#pageIcon").val(e.page.pageIcon)),$("#loadMsg").text("")}})},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.navLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/page/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.pageList.pageInfo.currentPage;1===admin.pageList.pageInfo.currentCount&&1!==admin.pageList.pageInfo.pageCount&&admin.pageList.pageInfo.currentPage===admin.pageList.pageInfo.pageCount&&(admin.pageList.pageInfo.pageCount--,t=admin.pageList.pageInfo.pageCount);var i=window.location.hash.split("/");t==i[i.length-1]?admin.pageList.getList(t):admin.setHashByPage(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},add:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g,""),a={page:{pageTitle:$("#pageTitle").val(),pagePermalink:e,pageOpenTarget:$("#pageTarget").val(),pageIcon:$("#pageIcon").val()}};$.ajax({url:Label.servePath+"/console/page/",type:"POST",cache:!1,data:JSON.stringify(a),success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){admin.pageList.id="",$("#pagePermalink").val(""),$("#pageTitle").val(""),$("#pageIcon").val(""),$("#pageTarget").val("_self"),admin.pageList.pageInfo.currentCount===Label.PAGE_SIZE&&admin.pageList.pageInfo.currentPage===admin.pageList.pageInfo.pageCount&&admin.pageList.pageInfo.pageCount++;var t=window.location.hash.split("/");admin.pageList.pageInfo.pageCount==t[t.length-1]?admin.pageList.getList(admin.pageList.pageInfo.pageCount):admin.setHashByPage(admin.pageList.pageInfo.pageCount),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},update:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#pagePermalink").val().replace(/(^\s*)|(\s*$)/g,""),a={page:{pageTitle:$("#pageTitle").val(),oId:this.id,pagePermalink:e,pageOpenTarget:$("#pageTarget").val(),pageIcon:$("#pageIcon").val()}};$.ajax({url:Label.servePath+"/console/page/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&(admin.pageList.id="",admin.pageList.getList(admin.pageList.pageInfo.currentPage),$("#pageTitle").val(""),$("#pageIcon").val(""),$("#pagePermalink").val(""),$("#pageTarget").val("_self")),$("#loadMsg").text("")}})}},validate:function(){if(""===$("#pageTitle").val().replace(/\s/g,""))$("#tipMsg").text(Label.titleEmptyLabel),$("#pageTitle").focus();else{if(""!==$("#pagePermalink").val().replace(/\s/g,""))return!0;$("#tipMsg").text(Label.linkEmptyLabel)}return!1},submit:function(){""!==this.id?this.update():this.add()},changeOrder:function(e,a,t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var i={oId:e.toString(),direction:t};$.ajax({url:Label.servePath+"/console/page/order/",type:"PUT",cache:!1,data:JSON.stringify(i),success:function(e,a){$("#tipMsg").text(e.msg),admin.pageList.getList(admin.pageList.pageInfo.currentPage),$("#loadMsg").text("")}})}},admin.register["page-list"]={obj:admin.pageList,init:admin.pageList.init,refresh:admin.pageList.getList};
...@@ -13,7 +13,7 @@ admin.themeList={skinDirName:"",mobileSkinDirName:"",init:function(){$.ajax({url ...@@ -13,7 +13,7 @@ admin.themeList={skinDirName:"",mobileSkinDirName:"",init:function(){$.ajax({url
admin.pluginList={tablePagination:new TablePaginate("plugin"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},init:function(t){this.tablePagination.buildTable([{style:"padding-left: 12px;",text:Label.pluginNameLabel,index:"name",width:230},{style:"padding-left: 12px;",text:Label.statusLabel,index:"status",minWidth:80},{style:"padding-left: 12px;",text:Label.authorLabel,index:"author",width:200},{style:"padding-left: 12px;",text:Label.versionLabel,index:"version",width:120}]),this.tablePagination.initPagination(),$("#pluginSetting").dialog({width:700,height:180,modal:!0,hideFooter:!0}),this.getList(t)},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var l=this;$.ajax({url:Label.servePath+"/console/plugins/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){admin.pluginList.pageInfo.currentPage=n;for(var a=t.plugins,i=0;i<a.length;i++)a[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.pluginList.changeStatus('"+a[i].oId+"', '"+a[i].status+"')\">","ENABLED"===a[i].status?(a[i].status=Label.enabledLabel,a[i].expendRow+=Label.disableLabel):(a[i].status=Label.disabledLabel,a[i].expendRow+=Label.enableLabel),a[i].expendRow+="</a> ","{}"!=a[i].setting&&(a[i].expendRow+="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+a[i].oId+"')\"> "+Label.settingLabel+" </a> ");l.tablePagination.updateTablePagination(t.plugins,n,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},toSetting:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e={oId:t};$.ajax({url:Label.servePath+"/console/plugin/toSetting",type:"POST",cache:!1,data:JSON.stringify(e),success:function(t,e){$("#tipMsg").text(t.msg),$("#pluginSetting").html(t),$("#pluginSetting").dialog("open"),$("#loadMsg").text("")}})},changeStatus:function(t,e){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var a={oId:t,status:e="ENABLED"===e?"DISABLED":"ENABLED"};$.ajax({url:Label.servePath+"/console/plugin/status/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(t,e){$("#tipMsg").text(t.msg),t.sc?($("#loadMsg").text(""),window.location.reload()):$("#loadMsg").text("")}})}},admin.register["plugin-list"]={obj:admin.pluginList,init:admin.pluginList.init,refresh:function(){$("#loadMsg").text("")}}; admin.pluginList={tablePagination:new TablePaginate("plugin"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},init:function(t){this.tablePagination.buildTable([{style:"padding-left: 12px;",text:Label.pluginNameLabel,index:"name",width:230},{style:"padding-left: 12px;",text:Label.statusLabel,index:"status",minWidth:80},{style:"padding-left: 12px;",text:Label.authorLabel,index:"author",width:200},{style:"padding-left: 12px;",text:Label.versionLabel,index:"version",width:120}]),this.tablePagination.initPagination(),$("#pluginSetting").dialog({width:700,height:180,modal:!0,hideFooter:!0}),this.getList(t)},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var l=this;$.ajax({url:Label.servePath+"/console/plugins/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(t,e){if($("#tipMsg").text(t.msg),t.sc){admin.pluginList.pageInfo.currentPage=n;for(var a=t.plugins,i=0;i<a.length;i++)a[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.pluginList.changeStatus('"+a[i].oId+"', '"+a[i].status+"')\">","ENABLED"===a[i].status?(a[i].status=Label.enabledLabel,a[i].expendRow+=Label.disableLabel):(a[i].status=Label.disabledLabel,a[i].expendRow+=Label.enableLabel),a[i].expendRow+="</a> ","{}"!=a[i].setting&&(a[i].expendRow+="<a href='javascript:void(0)' onclick=\"admin.pluginList.toSetting('"+a[i].oId+"')\"> "+Label.settingLabel+" </a> ");l.tablePagination.updateTablePagination(t.plugins,n,t.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},toSetting:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e={oId:t};$.ajax({url:Label.servePath+"/console/plugin/toSetting",type:"POST",cache:!1,data:JSON.stringify(e),success:function(t,e){$("#tipMsg").text(t.msg),$("#pluginSetting").html(t),$("#pluginSetting").dialog("open"),$("#loadMsg").text("")}})},changeStatus:function(t,e){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var a={oId:t,status:e="ENABLED"===e?"DISABLED":"ENABLED"};$.ajax({url:Label.servePath+"/console/plugin/status/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(t,e){$("#tipMsg").text(t.msg),t.sc?($("#loadMsg").text(""),window.location.reload()):$("#loadMsg").text("")}})}},admin.register["plugin-list"]={obj:admin.pluginList,init:admin.pluginList.init,refresh:function(){$("#loadMsg").text("")}};
admin.userList={tablePagination:new TablePaginate("user"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},userInfo:{oId:"",userRole:""},init:function(e){this.tablePagination.buildTable([{style:"padding-left: 12px;",text:Label.userNameLabel,index:"userName",width:230},{style:"padding-left: 12px;",text:Label.roleLabel,index:"isAdmin",width:120}]),this.tablePagination.initPagination(),this.getList(e),$("#userUpdate").dialog({width:700,height:450,modal:!0,hideFooter:!0})},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),this.pageInfo.currentPage=n;var r=this;$.ajax({url:Label.servePath+"/console/users/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.users,s=[];if(admin.userList.pageInfo.currentCount=t.length,admin.userList.pageInfo.pageCount=e.pagination.paginationPageCount,t.length<1)return $("#tipMsg").text("No user "+Label.reportIssueLabel),void $("#loadMsg").text("");$("#tipMsg").text(Label.uploadMsg);for(var i=0;i<t.length;i++)s[i]={},s[i].userName=t[i].userName,"adminRole"===t[i].userRole?(s[i].isAdmin="&nbsp;"+Label.administratorLabel,s[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.userList.get('"+t[i].oId+"', '"+t[i].userRole+"')\">"+Label.updateLabel+"</a>"):(s[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.userList.get('"+t[i].oId+"', '"+t[i].userRole+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.userList.del('"+t[i].oId+"', '"+encodeURIComponent(t[i].userName)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.userList.changeRole('"+t[i].oId+"')\">"+Label.changeRoleLabel+"</a>","defaultRole"===t[i].userRole?s[i].isAdmin=Label.commonUserLabel:s[i].isAdmin=Label.visitorUserLabel),r.tablePagination.updateTablePagination(s,n,e.pagination);$("#loadMsg").text("")}else $("#loadMsg").text("")}})},get:function(t,s){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$("#userUpdate").dialog("open"),$.ajax({url:Label.servePath+"/console/user/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&($("#userURLUpdate").val(e.user.userURL),$("#userAvatarUpdate").val(e.user.userAvatar),$("#userB3KeyUpdate").val(e.user.userB3Key),$("#userNameUpdate").val(e.user.userName).data("userInfo",{oId:t,userRole:s})),$("#loadMsg").text("")}})},update:function(){if(this.validate("Update")){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#userNameUpdate").data("userInfo"),a={userName:$("#userNameUpdate").val(),oId:e.oId,userURL:$("#userURLUpdate").val(),userRole:e.userRole,userAvatar:$("#userAvatarUpdate").val(),userB3Key:$("#userB3KeyUpdate").val()};$.ajax({url:Label.servePath+"/console/user/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(e,a){$("#userUpdate").dialog("close"),$("#tipMsg").text(e.msg),e.sc&&admin.userList.getList(admin.userList.pageInfo.currentPage),$("#loadMsg").text("")}})}},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.userLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/user/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.userList.pageInfo.currentPage;1===admin.userList.pageInfo.currentCount&&1!==admin.userList.pageInfo.pageCount&&admin.userList.pageInfo.currentPage===admin.userList.pageInfo.pageCount&&(admin.userList.pageInfo.pageCount--,t=admin.userList.pageInfo.pageCount);var s=window.location.hash.split("/");t!==parseInt(s[s.length-1])&&admin.setHashByPage(t),admin.userList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},changeRole:function(e){$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/changeRole/"+e,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.userList.pageInfo.currentPage;1===admin.userList.pageInfo.currentCount&&1!==admin.userList.pageInfo.pageCount&&admin.userList.pageInfo.currentPage===admin.userList.pageInfo.pageCount&&(admin.userList.pageInfo.pageCount--,t=admin.userList.pageInfo.pageCount);var s=window.location.hash.split("/");t!==parseInt(s[s.length-1])&&admin.setHashByPage(t),admin.userList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},validate:function(e){e||(e="");var a=$("#userName"+e).val().replace(/(^\s*)|(\s*$)/g,"");return!(a.length<2||20<a.length)||($("#tipMsg").text(Label.nameTooLongLabel),$("#userName"+e).focus(),!1)}},admin.register["user-list"]={obj:admin.userList,init:admin.userList.init,refresh:admin.userList.getList}; admin.userList={tablePagination:new TablePaginate("user"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},userInfo:{oId:"",userRole:""},init:function(e){this.tablePagination.buildTable([{style:"padding-left: 12px;",text:Label.userNameLabel,index:"userName",width:230},{style:"padding-left: 12px;",text:Label.roleLabel,index:"isAdmin",width:120}]),this.tablePagination.initPagination(),this.getList(e),$("#userUpdate").dialog({width:700,height:450,modal:!0,hideFooter:!0})},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),this.pageInfo.currentPage=n;var r=this;$.ajax({url:Label.servePath+"/console/users/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.users,s=[];if(admin.userList.pageInfo.currentCount=t.length,admin.userList.pageInfo.pageCount=e.pagination.paginationPageCount,t.length<1)return $("#tipMsg").text("No user "+Label.reportIssueLabel),void $("#loadMsg").text("");$("#tipMsg").text(Label.uploadMsg);for(var i=0;i<t.length;i++)s[i]={},s[i].userName=t[i].userName,"adminRole"===t[i].userRole?(s[i].isAdmin="&nbsp;"+Label.administratorLabel,s[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.userList.get('"+t[i].oId+"', '"+t[i].userRole+"')\">"+Label.updateLabel+"</a>"):(s[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.userList.get('"+t[i].oId+"', '"+t[i].userRole+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.userList.del('"+t[i].oId+"', '"+encodeURIComponent(t[i].userName)+"')\">"+Label.removeLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.userList.changeRole('"+t[i].oId+"')\">"+Label.changeRoleLabel+"</a>","defaultRole"===t[i].userRole?s[i].isAdmin=Label.commonUserLabel:s[i].isAdmin=Label.visitorUserLabel),r.tablePagination.updateTablePagination(s,n,e.pagination);$("#loadMsg").text("")}else $("#loadMsg").text("")}})},get:function(t,s){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$("#userUpdate").dialog("open"),$.ajax({url:Label.servePath+"/console/user/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&($("#userURLUpdate").val(e.user.userURL),$("#userAvatarUpdate").val(e.user.userAvatar),$("#userB3KeyUpdate").val(e.user.userB3Key),$("#userNameUpdate").val(e.user.userName).data("userInfo",{oId:t,userRole:s})),$("#loadMsg").text("")}})},update:function(){if(this.validate("Update")){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e=$("#userNameUpdate").data("userInfo"),a={userName:$("#userNameUpdate").val(),oId:e.oId,userURL:$("#userURLUpdate").val(),userRole:e.userRole,userAvatar:$("#userAvatarUpdate").val(),userB3Key:$("#userB3KeyUpdate").val()};$.ajax({url:Label.servePath+"/console/user/",type:"PUT",cache:!1,data:JSON.stringify(a),success:function(e,a){$("#userUpdate").dialog("close"),$("#tipMsg").text(e.msg),e.sc&&admin.userList.getList(admin.userList.pageInfo.currentPage),$("#loadMsg").text("")}})}},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.userLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/user/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.userList.pageInfo.currentPage;1===admin.userList.pageInfo.currentCount&&1!==admin.userList.pageInfo.pageCount&&admin.userList.pageInfo.currentPage===admin.userList.pageInfo.pageCount&&(admin.userList.pageInfo.pageCount--,t=admin.userList.pageInfo.pageCount);var s=window.location.hash.split("/");t!==parseInt(s[s.length-1])&&admin.setHashByPage(t),admin.userList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},changeRole:function(e){$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/changeRole/"+e,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.userList.pageInfo.currentPage;1===admin.userList.pageInfo.currentCount&&1!==admin.userList.pageInfo.pageCount&&admin.userList.pageInfo.currentPage===admin.userList.pageInfo.pageCount&&(admin.userList.pageInfo.pageCount--,t=admin.userList.pageInfo.pageCount);var s=window.location.hash.split("/");t!==parseInt(s[s.length-1])&&admin.setHashByPage(t),admin.userList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},validate:function(e){e||(e="");var a=$("#userName"+e).val().replace(/(^\s*)|(\s*$)/g,"");return!(a.length<2||20<a.length)||($("#tipMsg").text(Label.nameTooLongLabel),$("#userName"+e).focus(),!1)}},admin.register["user-list"]={obj:admin.userList,init:admin.userList.init,refresh:admin.userList.getList};
admin.categoryList={tablePagination:new TablePaginate("category"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},init:function(e){this.tablePagination.buildTable([{text:"",index:"linkOrder",width:60},{style:"padding-left: 12px;",text:Label.titleLabel,index:"categoryTitle",width:230},{style:"padding-left: 12px;",text:"URI",index:"categoryURI",width:230},{style:"padding-left: 12px;",text:Label.descriptionLabel,index:"categoryDesc",minWidth:180}]),this.tablePagination.initPagination(),this.getList(e),$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){if(!(e.tags.length<=0)){for(var t=[],o=0;o<e.tags.length;o++)t.push(e.tags[o].tagTitle);$("#categoryTags").completed({height:160,buttonText:Label.selectLabel,data:t}),$("#loadMsg").text("")}}else $("#loadMsg").text("")}})},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),this.pageInfo.currentPage=n;var g=this;$.ajax({url:Label.servePath+"/console/categories/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.categories,o=[];admin.categoryList.pageInfo.currentCount=t.length,admin.categoryList.pageInfo.pageCount=0===e.pagination.paginationPageCount?1:e.pagination.paginationPageCount;for(var i=0;i<t.length;i++)o[i]={},0===i?1===t.length?o[i].linkOrder="":o[i].linkOrder='<div class="table-center" style="width:14px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'down\');" class="icon-move-down"></span> </div>':i===t.length-1?o[i].linkOrder='<div class="table-center" style="width:14px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'up\');" class="icon-move-up"></span> </div>':o[i].linkOrder='<div class="table-center" style="width:38px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'up\');" class="icon-move-up"></span> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'down\');" class="icon-move-down"></span> </div>',o[i].categoryTitle=t[i].categoryTitle,o[i].categoryURI=t[i].categoryURI,o[i].categoryDesc=t[i].categoryDescription,o[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.categoryList.get('"+t[i].oId+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.categoryList.del('"+t[i].oId+"', '"+encodeURIComponent(t[i].categoryTitle)+"')\">"+Label.removeLabel+"</a> ";g.tablePagination.updateTablePagination(o,n,e.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},add:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e={categoryTitle:$("#categoryName").val(),categoryTags:$("#categoryTags").val(),categoryURI:$("#categoryURI").val(),categoryDescription:$("#categoryDesc").val()},o=$("#categoryName").data("oId"),a="POST";o&&(e.oId=o,a="PUT"),$.ajax({url:Label.servePath+"/console/category/",type:a,cache:!1,data:JSON.stringify(e),success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){if(!o){admin.categoryList.pageInfo.currentCount===Label.PAGE_SIZE&&admin.categoryList.pageInfo.currentPage===admin.categoryList.pageInfo.pageCount&&admin.categoryList.pageInfo.pageCount++;var t=window.location.hash.split("/");admin.categoryList.pageInfo.pageCount!==parseInt(t[t.length-1])&&admin.setHashByPage(admin.categoryList.pageInfo.pageCount)}$("#categoryName").val("").data("oId",""),$("#categoryTags").val(""),$("#categoryURI").val(""),$("#categoryDesc").val(""),admin.categoryList.getList(admin.categoryList.pageInfo.pageCount),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},get:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/category/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&($("#categoryName").val(e.categoryTitle).data("oId",t),$("#categoryURI").val(e.categoryURI),$("#categoryDesc").val(e.categoryDescription),$("#categoryTags").val(e.categoryTags)),$("#loadMsg").text("")}})},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.categoryLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/category/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.categoryList.pageInfo.currentPage;1===admin.categoryList.pageInfo.currentCount&&1!==admin.categoryList.pageInfo.pageCount&&admin.categoryList.pageInfo.currentPage===admin.categoryList.pageInfo.pageCount&&(admin.categoryList.pageInfo.pageCount--,t=admin.categoryList.pageInfo.pageCount);var o=window.location.hash.split("/");t!==parseInt(o[o.length-1])&&admin.setHashByPage(t),admin.categoryList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},validate:function(e){e||(e="");var a=$("#categoryName"+e).val().replace(/(^\s*)|(\s*$)/g,"");if(a.length<2||32<a.length)$("#tipMsg").text(Label.categoryTooLongLabel),$("#categoryName"+e).focus();else{if(""!==$.trim($("#categoryTags"+e).val()))return!0;$("#tipMsg").text(Label.tagsEmptyLabel),$("#categoryTags"+e).focus()}return!1},changeOrder:function(e,a,t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var o={oId:e.toString(),direction:t};$.ajax({url:Label.servePath+"/console/category/order/",type:"PUT",cache:!1,data:JSON.stringify(o),success:function(e,a){$("#tipMsg").text(e.msg),admin.categoryList.getList(admin.categoryList.pageInfo.currentPage),$("#loadMsg").text("")}})}},admin.register["category-list"]={obj:admin.categoryList,init:admin.categoryList.init,refresh:admin.categoryList.getList}; admin.categoryList={tablePagination:new TablePaginate("category"),pageInfo:{currentCount:1,pageCount:1,currentPage:1},init:function(e){this.tablePagination.buildTable([{text:"",index:"linkOrder",width:60},{style:"padding-left: 12px;",text:Label.titleLabel,index:"categoryTitle",width:230},{style:"padding-left: 12px;",text:"URI",index:"categoryURI",width:230},{style:"padding-left: 12px;",text:Label.descriptionLabel,index:"categoryDesc",minWidth:180}]),this.tablePagination.initPagination(),this.getList(e),$.ajax({url:Label.servePath+"/console/tags",type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){if(!(e.tags.length<=0)){for(var t=[],o=0;o<e.tags.length;o++)t.push(e.tags[o].tagTitle);$("#categoryTags").completed({height:160,buttonText:Label.selectLabel,data:t}),$("#loadMsg").text("")}}else $("#loadMsg").text("")}})},getList:function(n){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),this.pageInfo.currentPage=n;var g=this;$.ajax({url:Label.servePath+"/console/categories/"+n+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=e.categories,o=[];admin.categoryList.pageInfo.currentCount=t.length,admin.categoryList.pageInfo.pageCount=0===e.pagination.paginationPageCount?1:e.pagination.paginationPageCount;for(var i=0;i<t.length;i++)o[i]={},0===i?1===t.length?o[i].linkOrder="":o[i].linkOrder='<div class="table-center" style="width:14px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'down\');" class="icon-move-down"></span> </div>':i===t.length-1?o[i].linkOrder='<div class="table-center" style="width:14px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'up\');" class="icon-move-up"></span> </div>':o[i].linkOrder='<div class="table-center" style="width:38px"> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'up\');" class="icon-move-up"></span> <span onclick="admin.categoryList.changeOrder('+t[i].oId+", "+i+', \'down\');" class="icon-move-down"></span> </div>',o[i].categoryTitle=t[i].categoryTitle,o[i].categoryURI=t[i].categoryURI,o[i].categoryDesc=t[i].categoryDescription,o[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.categoryList.get('"+t[i].oId+"')\">"+Label.updateLabel+"</a> <a href='javascript:void(0)' onclick=\"admin.categoryList.del('"+t[i].oId+"', '"+encodeURIComponent(t[i].categoryTitle)+"')\">"+Label.removeLabel+"</a> ";g.tablePagination.updateTablePagination(o,n,e.pagination),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},add:function(){if(this.validate()){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var e={categoryTitle:$("#categoryName").val(),categoryTags:$("#categoryTags").val(),categoryURI:$("#categoryURI").val(),categoryDescription:$("#categoryDesc").val()},o=$("#categoryName").data("oId"),a="POST";o&&(e.oId=o,a="PUT"),$.ajax({url:Label.servePath+"/console/category/",type:a,cache:!1,data:JSON.stringify(e),success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){if(!o){admin.categoryList.pageInfo.currentCount===Label.PAGE_SIZE&&admin.categoryList.pageInfo.currentPage===admin.categoryList.pageInfo.pageCount&&admin.categoryList.pageInfo.pageCount++;var t=window.location.hash.split("/");admin.categoryList.pageInfo.pageCount!==parseInt(t[t.length-1])&&admin.setHashByPage(admin.categoryList.pageInfo.pageCount)}$("#categoryName").val("").data("oId",""),$("#categoryTags").val(""),$("#categoryURI").val(""),$("#categoryDesc").val(""),admin.categoryList.getList(admin.categoryList.pageInfo.pageCount),$("#loadMsg").text("")}else $("#loadMsg").text("")}})}},get:function(t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/category/"+t,type:"GET",cache:!1,success:function(e,a){$("#tipMsg").text(e.msg),e.sc&&($("#categoryName").val(e.categoryTitle).data("oId",t),$("#categoryURI").val(e.categoryURI),$("#categoryDesc").val(e.categoryDescription),$("#categoryTags").val(e.categoryTags)),$("#loadMsg").text("")}})},del:function(e,a){confirm(Label.confirmRemoveLabel+Label.categoryLabel+'"'+Util.htmlDecode(a)+'"?')&&($("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text(""),$.ajax({url:Label.servePath+"/console/category/"+e,type:"DELETE",cache:!1,success:function(e,a){if($("#tipMsg").text(e.msg),e.sc){var t=admin.categoryList.pageInfo.currentPage;1===admin.categoryList.pageInfo.currentCount&&1!==admin.categoryList.pageInfo.pageCount&&admin.categoryList.pageInfo.currentPage===admin.categoryList.pageInfo.pageCount&&(admin.categoryList.pageInfo.pageCount--,t=admin.categoryList.pageInfo.pageCount);var o=window.location.hash.split("/");t!==parseInt(o[o.length-1])&&admin.setHashByPage(t),admin.categoryList.getList(t),$("#loadMsg").text("")}else $("#loadMsg").text("")}}))},validate:function(e){e||(e="");var a=$("#categoryName"+e).val().replace(/(^\s*)|(\s*$)/g,"");if(a.length<2||32<a.length)$("#tipMsg").text(Label.categoryTooLongLabel),$("#categoryName"+e).focus();else{if(""!==$.trim($("#categoryTags"+e).val()))return!0;$("#tipMsg").text(Label.tagsEmptyLabel),$("#categoryTags"+e).focus()}return!1},changeOrder:function(e,a,t){$("#loadMsg").text(Label.loadingLabel),$("#tipMsg").text("");var o={oId:e.toString(),direction:t};$.ajax({url:Label.servePath+"/console/category/order/",type:"PUT",cache:!1,data:JSON.stringify(o),success:function(e,a){$("#tipMsg").text(e.msg),admin.categoryList.getList(admin.categoryList.pageInfo.currentPage),$("#loadMsg").text("")}})}},admin.register["category-list"]={obj:admin.categoryList,init:admin.categoryList.init,refresh:admin.categoryList.getList};
admin.commentList={tablePagination:new TablePaginate("comment"),pageInfo:{currentPage:1},init:function(e){this.tablePagination.buildTable([{text:Label.commentContentLabel,index:"content",minWidth:174,style:"padding-left: 12px;"},{text:Label.authorLabel,index:"title",style:"padding-left: 12px;",width:154},{text:Label.dateLabel,index:"date",width:60,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.getList(e)},getList:function(l){var o=this;$("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/comments/"+l+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){o.pageInfo.currentPage=l;for(var a=e.comments,n=[],i=0;i<a.length;i++){n[i]={},n[i].content='<div class="vditor-reset">'+Util.replaceEmString(a[i].commentContent)+"</div><span class='table-tag'> on &nbsp;&nbsp;</span><a href='"+Label.servePath+a[i].commentSharpURL+"' target='_blank'>"+a[i].commentTitle+"</a>",n[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.commentList.del('"+a[i].oId+"', 'Article')\">"+Label.removeLabel+"</a>",n[i].title="<img class='small-head' src='"+a[i].commentThumbnailURL+"'/>","http://"===a[i].commentURL?n[i].title+=a[i].commentName:n[i].title+="<a href='"+a[i].commentURL+"' target='_blank' class='no-underline'>"+a[i].commentName+"</a>",n[i].title+="<br/>",n[i].date=$.bowknot.getDate(a[i].commentTime)}o.tablePagination.updateTablePagination(n,l,e.pagination),Util.parseMarkdown(),Util.parseLanguage(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(e,t){confirm(Label.confirmRemoveLabel+Label.commentLabel+"?")&&($("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/"+t.toLowerCase()+"/comment/"+e,type:"DELETE",cache:!1,success:function(e,t){$("#tipMsg").text(e.msg),e.sc&&admin.commentList.getList(admin.commentList.pageInfo.currentPage),$("#loadMsg").text("")}}))}},admin.register["comment-list"]={obj:admin.commentList,init:admin.commentList.init,refresh:admin.commentList.getList}; admin.commentList={tablePagination:new TablePaginate("comment"),pageInfo:{currentPage:1},init:function(e){this.tablePagination.buildTable([{text:Label.commentContentLabel,index:"content",minWidth:174,style:"padding-left: 12px;"},{text:Label.authorLabel,index:"title",style:"padding-left: 12px;",width:154},{text:Label.dateLabel,index:"date",width:60,style:"padding-left: 12px;"}]),this.tablePagination.initPagination(),this.getList(e)},getList:function(l){var o=this;$("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/comments/"+l+"/"+Label.PAGE_SIZE+"/"+Label.WINDOW_SIZE,type:"GET",cache:!1,success:function(e,t){if($("#tipMsg").text(e.msg),e.sc){o.pageInfo.currentPage=l;for(var a=e.comments,n=[],i=0;i<a.length;i++){n[i]={},n[i].content='<div class="vditor-reset">'+a[i].commentContent+"</div><span class='table-tag'> on &nbsp;&nbsp;</span><a href='"+Label.servePath+a[i].commentSharpURL+"' target='_blank'>"+a[i].commentTitle+"</a>",n[i].expendRow="<a href='javascript:void(0)' onclick=\"admin.commentList.del('"+a[i].oId+"', 'Article')\">"+Label.removeLabel+"</a>",n[i].title="<img class='small-head' src='"+a[i].commentThumbnailURL+"'/>","http://"===a[i].commentURL?n[i].title+=a[i].commentName:n[i].title+="<a href='"+a[i].commentURL+"' target='_blank' class='no-underline'>"+a[i].commentName+"</a>",n[i].title+="<br/>",n[i].date=$.bowknot.getDate(a[i].commentTime)}o.tablePagination.updateTablePagination(n,l,e.pagination),Util.parseMarkdown(),Util.parseLanguage(),$("#loadMsg").text("")}else $("#loadMsg").text("")}})},del:function(e,t){confirm(Label.confirmRemoveLabel+Label.commentLabel+"?")&&($("#loadMsg").text(Label.loadingLabel),$.ajax({url:Label.servePath+"/console/"+t.toLowerCase()+"/comment/"+e,type:"DELETE",cache:!1,success:function(e,t){$("#tipMsg").text(e.msg),e.sc&&admin.commentList.getList(admin.commentList.pageInfo.currentPage),$("#loadMsg").text("")}}))}},admin.register["comment-list"]={obj:admin.commentList,init:admin.commentList.init,refresh:admin.commentList.getList};
var plugins={};admin.plugin={plugins:[],add:function(t){t.isInit=!1,t.hash=t.path.replace("/","#")+"/"+t.id,this.plugins.push(t);var a=this._analysePath(t.path);t.index&&a.length<2&&this._addNew(t,a)},setCurByHash:function(t){for(var a=this.plugins,e=0;e<a.length;e++){var n=a[e],i=this._analysePath(n.path),s=!1;n.index&&-1<window.location.hash.indexOf(n.hash)?s=!0:(n.path.replace("/","#")===window.location.hash||"#main"===window.location.hash&&-1<n.path.indexOf("/main/panel"))&&(s=!0),s&&(n.isInit?plugins[n.id].refresh&&plugins[n.id].refresh(t.page):(n.index?2===i.length&&this._addNew(n,i):this._addToExist(n,i),plugins[n.id].init(t.page),n.isInit=!0))}},_analysePath:function(t){var a=t.split("/");return a.splice(0,1),a},_addNew:function(t,a){if(2===a.length)return t.target=$("#tabPreference li").get(t.index-1),void $("#tabPreference").tabs("add",t);""===a[0]?t.target=$("#tabs>ul>li").get(t.index-1):"article"===a[0]?t.target=$("#tabArticleMgt>li").get(t.index-1):"tools"===a[0]&&(admin.tools.push("#"+t.id),t.target=$("#tabTools>li").get(t.index-1)),t.target||alert("data.index is error!"),$("#tabs").tabs("add",t)},_addToExist:function(t,a){switch(a[0]){case"main":$("#mainPanel"+a[1].charAt(5)).append(t.content);break;case"tools":case"article":2===a.length?$("#tabsPanel_"+a[1]).append(t.content):$("#tabPreferencePanel_"+a[2]).append(t.content);break;case"comment-list":$("#tabsPanel_comment-list").append(t.content)}}}; var plugins={};admin.plugin={plugins:[],add:function(t){t.isInit=!1,t.hash=t.path.replace("/","#")+"/"+t.id,this.plugins.push(t);var a=this._analysePath(t.path);t.index&&a.length<2&&this._addNew(t,a)},setCurByHash:function(t){for(var a=this.plugins,e=0;e<a.length;e++){var n=a[e],i=this._analysePath(n.path),s=!1;n.index&&-1<window.location.hash.indexOf(n.hash)?s=!0:(n.path.replace("/","#")===window.location.hash||"#main"===window.location.hash&&-1<n.path.indexOf("/main/panel"))&&(s=!0),s&&(n.isInit?plugins[n.id].refresh&&plugins[n.id].refresh(t.page):(n.index?2===i.length&&this._addNew(n,i):this._addToExist(n,i),plugins[n.id].init(t.page),n.isInit=!0))}},_analysePath:function(t){var a=t.split("/");return a.splice(0,1),a},_addNew:function(t,a){if(2===a.length)return t.target=$("#tabPreference li").get(t.index-1),void $("#tabPreference").tabs("add",t);""===a[0]?t.target=$("#tabs>ul>li").get(t.index-1):"article"===a[0]?t.target=$("#tabArticleMgt>li").get(t.index-1):"tools"===a[0]&&(admin.tools.push("#"+t.id),t.target=$("#tabTools>li").get(t.index-1)),t.target||alert("data.index is error!"),$("#tabs").tabs("add",t)},_addToExist:function(t,a){switch(a[0]){case"main":$("#mainPanel"+a[1].charAt(5)).append(t.content);break;case"tools":case"article":2===a.length?$("#tabsPanel_"+a[1]).append(t.content):$("#tabPreferencePanel_"+a[2]).append(t.content);break;case"comment-list":$("#tabsPanel_comment-list").append(t.content)}}};
admin.main={},admin.register.main={obj:admin.main,init:function(){admin.clearTip()},refresh:function(){admin.clearTip()}}; admin.main={},admin.register.main={obj:admin.main,init:function(){admin.clearTip()},refresh:function(){admin.clearTip()}};
admin.about={init:function(){$.ajax({url:"https://rhythm.b3log.org/version/solo/latest/"+Label.version,type:"GET",cache:!1,dataType:"jsonp",success:function(a,t){var e=a.soloVersion;e===Label.version?$("#aboutLatest").text(Label.upToDateLabel):$("#aboutLatest").html(Label.outOfDateLabel+"<a href='"+a.soloDownload+"'>"+e+"</a>")},complete:function(a,t){admin.clearTip()}})}},admin.register.about={obj:admin.about,init:admin.about.init,refresh:function(){admin.clearTip()}}; admin.about={init:function(){$.ajax({url:"https://rhythm.b3log.org/version/solo/latest/"+Label.version,type:"GET",cache:!1,dataType:"jsonp",success:function(a,t){var e=a.soloVersion;e===Label.version?$("#aboutLatest").text(Label.upToDateLabel):$("#aboutLatest").html(Label.outOfDateLabel+"<a href='"+a.soloDownload+"'>"+e+"</a>")},complete:function(a,t){admin.clearTip()}})}},admin.register.about={obj:admin.about,init:admin.about.init,refresh:function(){admin.clearTip()}};
\ No newline at end of file
...@@ -67,7 +67,7 @@ admin.comment = { ...@@ -67,7 +67,7 @@ admin.comment = {
var hrefHTML = '<a target=\'_blank\' href=\'' + comments[i].commentURL + var hrefHTML = '<a target=\'_blank\' href=\'' + comments[i].commentURL +
'\'>', '\'>',
content = comments[i].commentContent, content = comments[i].commentContent,
contentHTML = Util.replaceEmString(content) contentHTML = content
if (comments[i].commentURL === 'http://') { if (comments[i].commentURL === 'http://') {
hrefHTML = '<a target=\'_blank\'>' hrefHTML = '<a target=\'_blank\'>'
......
...@@ -82,7 +82,7 @@ admin.commentList = { ...@@ -82,7 +82,7 @@ admin.commentList = {
var type = 'Article' var type = 'Article'
commentsData[i] = {} commentsData[i] = {}
commentsData[i].content = '<div class="vditor-reset">' + commentsData[i].content = '<div class="vditor-reset">' +
Util.replaceEmString(comments[i].commentContent) + comments[i].commentContent +
'</div><span class=\'table-tag\'> on &nbsp;&nbsp;</span><a href=\'' + '</div><span class=\'table-tag\'> on &nbsp;&nbsp;</span><a href=\'' +
Label.servePath + comments[i].commentSharpURL + Label.servePath + comments[i].commentSharpURL +
'\' target=\'_blank\'>' + comments[i].commentTitle + '\' target=\'_blank\'>' + comments[i].commentTitle +
......
...@@ -225,27 +225,6 @@ var Util = { ...@@ -225,27 +225,6 @@ var Util = {
} }
} }
}, },
/**
* @description 替换[emXX] 为图片
* @param {String} str 替换字符串
* @returns {String} 替换后的字符
*/
replaceEmString: function (str) {
var commentSplited = str.split('[em')
if (commentSplited.length === 1) {
return str
}
str = commentSplited[0]
for (var j = 1; j < commentSplited.length; j++) {
var key = commentSplited[j].substr(0, 2)
str += '<img width=\'20\' src=\'' + Label.staticServePath +
'/images/emotions/em' + key + '.png\' alt=\'' +
Label['em' + key + 'Label'] + '\' title=\'' +
Label['em' + key + 'Label'] + '\'/> ' + commentSplited[j].substr(3)
}
return str
},
/** /**
* @description 切换到手机版 * @description 切换到手机版
* @param {String} skin 切换前的皮肤名称 * @param {String} skin 切换前的皮肤名称
...@@ -325,7 +304,7 @@ var Util = { ...@@ -325,7 +304,7 @@ var Util = {
replaceSideEm: function (comments) { replaceSideEm: function (comments) {
for (var i = 0; i < comments.length; i++) { for (var i = 0; i < comments.length; i++) {
var $comment = $(comments[i]) var $comment = $(comments[i])
$comment.html(Util.replaceEmString($comment.html())) $comment.html($comment.html())
} }
}, },
/** /**
......
var Util={isArticlePage:function(e){var t=!0;return-1<e.indexOf(Label.servePath+"/tags/")&&(t=!1),-1<e.indexOf(Label.servePath+"/tags.html")&&(t=!1),-1<e.indexOf(Label.servePath+"/category/")&&(t=!1),-1<e.indexOf(Label.servePath+"/archives.html")&&(t=!1),-1<e.indexOf(Label.servePath+"/archives/")&&(t=!1),-1<e.indexOf(Label.servePath+"/links.html")&&(t=!1),e===Label.servePath&&(t=!1),/^[0-9]*$/.test(e.replace(Label.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===Label.servePath+"/rss.xml"||-1<e.indexOf(Label.servePath+"/admin-index.do")||!(-1<e.indexOf(Label.servePath))},callback:function(){Util.parseMarkdown(),Util.parseLanguage(),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()}))},previewImg:function(){$("body").on("click",".vditor-reset img",function(){$(this).hasClass("prevent")||window.open(this.src)})},addStyle:function(e,t){if(!document.getElementById(t)){var i=document.createElement("link");i.id=t,i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(i)}},addScript:function(e,t){if(!document.getElementById(t)){var i=new XMLHttpRequest;i.open("GET",e,!1),i.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),i.send("");var n=document.createElement("script");n.id=t,n.type="text/javascript",n.text=i.responseText,document.getElementsByTagName("head")[0].appendChild(n)}},parseLanguage:function(){if(0!==$(".vditor-reset pre > code").length){Util.addStyle("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/js/highlight.js@9.15.6/styles/"+Label.hljsStyle+".css","vditorHljsStyle");function e(){hljs.initHighlighting.called=!1,hljs.initHighlighting()}Label.markedAvailable||("undefined"==typeof hljs?$.ajax({url:"https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/js/highlight.js@9.15.6/highlight.pack.js",dataType:"script",cache:!0,success:function(){e()}}):e())}},parseMarkdown:function(){var e=$(".vditor-reset").text();(0!==$(".vditor-reset pre > code").length||2<e.split("$").length||1<e.split("\\(").length&&1<e.split("\\)").length)&&(Util.addScript("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/index.min.js","vditorScript"),Vditor.mermaidRender(document.body),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel))},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='"+Label.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='"+Label.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='"+Label.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),$("html, body").animate({scrollTop:$(document).height()-$(window).height()-e},800)},init:function(){Util.killIE(),Util.parseMarkdown(),Util.parseLanguage(),Util.initSW(),Util.previewImg(),Util.initDebugInfo()},initDebugInfo:function(){console.log("%cSolo%c\n 🎸一款小而美的博客系统,专为程序员设计。"+Label.version+" © "+(new Date).getFullYear(),"font-size:96px;color:#3b3e43","font-size:12px;color:rgba(0,0,0,0.38);")},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),r=0;r<i.length;r++)for(var a=parseInt(i[r].innerHTML),s=0;s<t.length;s++)if(s*o<a&&a<=(s+1)*o){i[r].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=/"}}; var Util={isArticlePage:function(e){var t=!0;return-1<e.indexOf(Label.servePath+"/tags/")&&(t=!1),-1<e.indexOf(Label.servePath+"/tags.html")&&(t=!1),-1<e.indexOf(Label.servePath+"/category/")&&(t=!1),-1<e.indexOf(Label.servePath+"/archives.html")&&(t=!1),-1<e.indexOf(Label.servePath+"/archives/")&&(t=!1),-1<e.indexOf(Label.servePath+"/links.html")&&(t=!1),e===Label.servePath&&(t=!1),/^[0-9]*$/.test(e.replace(Label.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===Label.servePath+"/rss.xml"||-1<e.indexOf(Label.servePath+"/admin-index.do")||!(-1<e.indexOf(Label.servePath))},callback:function(){Util.parseMarkdown(),Util.parseLanguage(),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()}))},previewImg:function(){$("body").on("click",".vditor-reset img",function(){$(this).hasClass("prevent")||window.open(this.src)})},addStyle:function(e,t){if(!document.getElementById(t)){var i=document.createElement("link");i.id=t,i.setAttribute("rel","stylesheet"),i.setAttribute("type","text/css"),i.setAttribute("href",e),document.getElementsByTagName("head")[0].appendChild(i)}},addScript:function(e,t){if(!document.getElementById(t)){var i=new XMLHttpRequest;i.open("GET",e,!1),i.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),i.send("");var n=document.createElement("script");n.id=t,n.type="text/javascript",n.text=i.responseText,document.getElementsByTagName("head")[0].appendChild(n)}},parseLanguage:function(){if(0!==$(".vditor-reset pre > code").length){Util.addStyle("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/js/highlight.js@9.15.6/styles/"+Label.hljsStyle+".css","vditorHljsStyle");function e(){hljs.initHighlighting.called=!1,hljs.initHighlighting()}Label.markedAvailable||("undefined"==typeof hljs?$.ajax({url:"https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/js/highlight.js@9.15.6/highlight.pack.js",dataType:"script",cache:!0,success:function(){e()}}):e())}},parseMarkdown:function(){var e=$(".vditor-reset").text();(0!==$(".vditor-reset pre > code").length||2<e.split("$").length||1<e.split("\\(").length&&1<e.split("\\)").length)&&(Util.addScript("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/index.min.js","vditorScript"),Vditor.mermaidRender(document.body),Vditor.mathRender(document.body),Vditor.codeRender(document.body,Label.langLabel))},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='"+Label.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='"+Label.servePath+"/kill-browser'></iframe>",document.body.innerHTML=document.body.innerHTML+t}}())},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),$("html, body").animate({scrollTop:$(document).height()-$(window).height()-e},800)},init:function(){Util.killIE(),Util.parseMarkdown(),Util.parseLanguage(),Util.initSW(),Util.previewImg(),Util.initDebugInfo()},initDebugInfo:function(){console.log("%cSolo%c\n 🎸一款小而美的博客系统,专为程序员设计。"+Label.version+" © "+(new Date).getFullYear(),"font-size:96px;color:#3b3e43","font-size:12px;color:rgba(0,0,0,0.38);")},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(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 \ No newline at end of file
...@@ -76,17 +76,6 @@ $.extend(Page.prototype, { ...@@ -76,17 +76,6 @@ $.extend(Page.prototype, {
window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618') window.open(urls[key], '_blank', 'top=100,left=200,width=648,height=618')
}) })
}, },
/*
* @description 把评论中的标识替换为图片
* @param {Dom} selector
*/
replaceCommentsEm: function (selector) {
var $commentContents = $(selector)
for (var i = 0; i < $commentContents.length; i++) {
var str = $commentContents[i].innerHTML
$commentContents[i].innerHTML = Util.replaceEmString(str)
}
},
/* /*
* @description 文章加载 * @description 文章加载
*/ */
...@@ -349,7 +338,7 @@ $.extend(Page.prototype, { ...@@ -349,7 +338,7 @@ $.extend(Page.prototype, {
} }
that.toggleEditor() that.toggleEditor()
vditor.setValue('') vditor.setValue('')
that.addCommentAjax(Util.replaceEmString(result.cmtTpl)) that.addCommentAjax(result.cmtTpl)
}, },
}) })
} else { } else {
......
var Page=function(t){this.currentCommentId="",this.tips=t};$.extend(Page.prototype,{share:function(){var t=$(".article__share");if(0!==t.length){var e=t.find(".item__qr"),o=t.data("url"),i=t.data("avatar"),n=encodeURIComponent(t.data("title")+" - "+t.data("blogtitle")),r=encodeURIComponent(o),a={};a.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+r+"&pic="+i,a.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+r+"&pic="+i,a.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+r+"&sharesource=qzone&title="+n+"&pics="+i,a.twitter="https://twitter.com/intent/tweet?status="+n+" "+r,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===e.find("canvas").length?(Util.addScript(Label.staticServePath+"/js/lib/jquery.qrcode.min.js","qrcodeScript"),e.qrcode({width:128,height:128,text:o})):e.slideToggle(),!1):void window.open(a[t],"_blank","top=100,left=200,width=648,height=618")})}},replaceCommentsEm:function(t){for(var e=$(t),o=0;o<e.length;o++){var i=e[o].innerHTML;e[o].innerHTML=Util.replaceEmString(i)}},load:function(){var t=this;$("#comment").click(function(){t.toggleEditor()}).attr("readonly","readonly"),$("#soloEditorCancel").click(function(){t.toggleEditor()}),$("#soloEditorAdd").click(function(){t.submitComment()})},toggleEditor:function(t,e){var o=$("#soloEditor");if(0!==o.length){if(!$("#soloEditorComment").hasClass("vditor")){Util.addScript("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/index.min.js","vditorScript"),window.vditor=new Vditor("soloEditorComment",{placeholder:this.tips.commentContentCannotEmptyLabel,height:180,tab:"\t",hint:{emojiPath:Label.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},esc:function(){$("#soloEditorCancel").click()},ctrlEnter:function(){$("#soloEditorAdd").click()},preview:{delay:500,show:!1,url:Label.servePath+"/console/markdown/2html",hljs:{enable:!0,style:Label.hljsStyle},parse:function(t){"none"!==t.style.display&&Util.parseLanguage()}},counter:500,resize:{enable:!0,position:"top",after:function(){$("body").css("padding-bottom",$("#soloEditor").outerHeight())}},lang:Label.langLabel,toolbar:["emoji","headings","bold","italic","strike","|","line","quote","|","list","ordered-list","check","|","code","inline-code","|","undo","redo","|","link","table","|","preview","fullscreen","info","help"]}),vditor.focus()}"0px"===$("body").css("padding-bottom")||t?($("#soloEditorError").text(""),o.css({bottom:"0",opacity:1}),$("body").css("padding-bottom","238px"),this.currentCommentId=t,$("#soloEditorReplyTarget").text(e?"@"+e:""),"undefined"!=typeof vditor&&vditor.focus()):(o.css({bottom:"-300px",opacity:0}),$("body").css("padding-bottom",0))}else location.href=Label.servePath+"/start"},loadRandomArticles:function(s){var c=this.tips.randomArticles1Label;$.ajax({url:Label.servePath+"/articles/random",type:"POST",success:function(t,e){var o=t.randomArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+Label.servePath+r.articlePermalink+"'>"+a+"</a></li>"}var l=(s||"<h4>"+c+"</h4>")+"<ul>"+i+"</ul>";$("#randomArticles").append(l)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(t,s){$.ajax({url:Label.servePath+"/article/id/"+t+"/relevant/articles",type:"GET",success:function(t,e){var o=t.relevantArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+Label.servePath+r.articlePermalink+"'>"+a+"</a></li>"}var l=s+"<ul>"+i+"</ul>";$("#relevantArticles").append(l)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(t,s){var c=this.tips;try{$.ajax({url:"https://rhythm.b3log.org/get-articles-by-tags.do?tags="+t+"&blogHost="+c.blogHost+"&paginationPageSize="+c.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(t,e){var o=t.articles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' target='_blank' href='"+r.articlePermalink+"'>"+a+"</a></li>"}var l=(s||"<h4>"+c.externalRelevantArticles1Label+"</h4>")+"<ul>"+i+"</ul>";$("#externalRelevantArticles").append(l)}else $("#externalRelevantArticles").remove()}})}catch(t){}},submitComment:function(){var e=this,t=this.tips;if(1<vditor.getValue().length&&vditor.getValue().length<500){$("#soloEditorAdd").attr("disabled","disabled");var o={oId:t.oId,commentContent:vditor.getValue()};this.currentCommentId&&(o.commentOriginalCommentId=this.currentCommentId),$.ajax({type:"POST",url:Label.servePath+"/article/comments",cache:!1,contentType:"application/json",data:JSON.stringify(o),success:function(t){$("#soloEditorAdd").removeAttr("disabled"),t.sc?(e.toggleEditor(),vditor.setValue(""),e.addCommentAjax(Util.replaceEmString(t.cmtTpl))):$("#soloEditorError").html(t.msg)}})}else $("#soloEditorError").text(e.tips.commentContentCannotEmptyLabel)},addReplyForm:function(t,e){this.currentCommentId=t,this.toggleEditor(t,e)},hideComment:function(t){$("#commentRef"+t).hide()},showComment:function(t,e,o,i){var n=parseInt($(t).position().top);if(i&&(n=parseInt($(t).parents(i).position().top)),0<$("#commentRef"+e).length)$("#commentRef"+e).show().css("top",n+o+"px");else{var r=$("#"+e).clone();r.addClass("comment-body-ref").attr("id","commentRef"+e),r.find("#replyForm").remove(),$("#comments").append(r),$("#commentRef"+e).css("top",n+o+"px")}},addCommentAjax:function(t){0<$("#comments").children().length?$($("#comments").children()[0]).before(t):$("#comments").html(t),Util.parseMarkdown(),Util.parseLanguage(),window.location.hash="#comments"}}); var Page=function(t){this.currentCommentId="",this.tips=t};$.extend(Page.prototype,{share:function(){var t=$(".article__share");if(0!==t.length){var e=t.find(".item__qr"),o=t.data("url"),i=t.data("avatar"),n=encodeURIComponent(t.data("title")+" - "+t.data("blogtitle")),r=encodeURIComponent(o),a={};a.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+r+"&pic="+i,a.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+r+"&pic="+i,a.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+r+"&sharesource=qzone&title="+n+"&pics="+i,a.twitter="https://twitter.com/intent/tweet?status="+n+" "+r,t.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===e.find("canvas").length?(Util.addScript(Label.staticServePath+"/js/lib/jquery.qrcode.min.js","qrcodeScript"),e.qrcode({width:128,height:128,text:o})):e.slideToggle(),!1):void window.open(a[t],"_blank","top=100,left=200,width=648,height=618")})}},load:function(){var t=this;$("#comment").click(function(){t.toggleEditor()}).attr("readonly","readonly"),$("#soloEditorCancel").click(function(){t.toggleEditor()}),$("#soloEditorAdd").click(function(){t.submitComment()})},toggleEditor:function(t,e){var o=$("#soloEditor");if(0!==o.length){if(!$("#soloEditorComment").hasClass("vditor")){Util.addScript("https://cdn.jsdelivr.net/npm/vditor@1.3.5/dist/index.min.js","vditorScript"),window.vditor=new Vditor("soloEditorComment",{placeholder:this.tips.commentContentCannotEmptyLabel,height:180,tab:"\t",hint:{emojiPath:Label.staticServePath+"/js/lib/emojify.js-1.1.0/images/basic"},esc:function(){$("#soloEditorCancel").click()},ctrlEnter:function(){$("#soloEditorAdd").click()},preview:{delay:500,show:!1,url:Label.servePath+"/console/markdown/2html",hljs:{enable:!0,style:Label.hljsStyle},parse:function(t){"none"!==t.style.display&&Util.parseLanguage()}},counter:500,resize:{enable:!0,position:"top",after:function(){$("body").css("padding-bottom",$("#soloEditor").outerHeight())}},lang:Label.langLabel,toolbar:["emoji","headings","bold","italic","strike","|","line","quote","|","list","ordered-list","check","|","code","inline-code","|","undo","redo","|","link","table","|","preview","fullscreen","info","help"]}),vditor.focus()}"0px"===$("body").css("padding-bottom")||t?($("#soloEditorError").text(""),o.css({bottom:"0",opacity:1}),$("body").css("padding-bottom","238px"),this.currentCommentId=t,$("#soloEditorReplyTarget").text(e?"@"+e:""),"undefined"!=typeof vditor&&vditor.focus()):(o.css({bottom:"-300px",opacity:0}),$("body").css("padding-bottom",0))}else location.href=Label.servePath+"/start"},loadRandomArticles:function(s){var c=this.tips.randomArticles1Label;$.ajax({url:Label.servePath+"/articles/random",type:"POST",success:function(t,e){var o=t.randomArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+Label.servePath+r.articlePermalink+"'>"+a+"</a></li>"}var l=(s||"<h4>"+c+"</h4>")+"<ul>"+i+"</ul>";$("#randomArticles").append(l)}else $("#randomArticles").remove()}})},loadRelevantArticles:function(t,s){$.ajax({url:Label.servePath+"/article/id/"+t+"/relevant/articles",type:"GET",success:function(t,e){var o=t.relevantArticles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' href='"+Label.servePath+r.articlePermalink+"'>"+a+"</a></li>"}var l=s+"<ul>"+i+"</ul>";$("#relevantArticles").append(l)}else $("#relevantArticles").remove()},error:function(){$("#relevantArticles").remove()}})},loadExternalRelevantArticles:function(t,s){var c=this.tips;try{$.ajax({url:"https://rhythm.b3log.org/get-articles-by-tags.do?tags="+t+"&blogHost="+c.blogHost+"&paginationPageSize="+c.externalRelevantArticlesDisplayCount,type:"GET",cache:!0,dataType:"jsonp",error:function(){$("#externalRelevantArticles").remove()},success:function(t,e){var o=t.articles;if(o&&0!==o.length){for(var i="",n=0;n<o.length;n++){var r=o[n],a=r.articleTitle;i+="<li><a rel='nofollow' title='"+a+"' target='_blank' href='"+r.articlePermalink+"'>"+a+"</a></li>"}var l=(s||"<h4>"+c.externalRelevantArticles1Label+"</h4>")+"<ul>"+i+"</ul>";$("#externalRelevantArticles").append(l)}else $("#externalRelevantArticles").remove()}})}catch(t){}},submitComment:function(){var e=this,t=this.tips;if(1<vditor.getValue().length&&vditor.getValue().length<500){$("#soloEditorAdd").attr("disabled","disabled");var o={oId:t.oId,commentContent:vditor.getValue()};this.currentCommentId&&(o.commentOriginalCommentId=this.currentCommentId),$.ajax({type:"POST",url:Label.servePath+"/article/comments",cache:!1,contentType:"application/json",data:JSON.stringify(o),success:function(t){$("#soloEditorAdd").removeAttr("disabled"),t.sc?(e.toggleEditor(),vditor.setValue(""),e.addCommentAjax(t.cmtTpl)):$("#soloEditorError").html(t.msg)}})}else $("#soloEditorError").text(e.tips.commentContentCannotEmptyLabel)},addReplyForm:function(t,e){this.currentCommentId=t,this.toggleEditor(t,e)},hideComment:function(t){$("#commentRef"+t).hide()},showComment:function(t,e,o,i){var n=parseInt($(t).position().top);if(i&&(n=parseInt($(t).parents(i).position().top)),0<$("#commentRef"+e).length)$("#commentRef"+e).show().css("top",n+o+"px");else{var r=$("#"+e).clone();r.addClass("comment-body-ref").attr("id","commentRef"+e),r.find("#replyForm").remove(),$("#comments").append(r),$("#commentRef"+e).css("top",n+o+"px")}},addCommentAjax:function(t){0<$("#comments").children().length?$($("#comments").children()[0]).before(t):$("#comments").html(t),Util.parseMarkdown(),Util.parseLanguage(),window.location.hash="#comments"}});
\ No newline at end of file \ No newline at end of file
html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;height:100%}body{margin:0;font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size:14px;background-color:#fff;-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch}::-moz-selection{text-shadow:none;background:rgba(65,131,196,0.4)}::selection{text-shadow:none;background:rgba(66,133,244,0.4)}ul,ol{margin:0;padding:0}h1,h2,h3,h4,h5,h6,dl,dd,p{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none}a{outline:0;text-decoration:none}a:hover{text-decoration:underline}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;vertical-align:middle;border:0;height:auto;-ms-interpolation-mode:bicubic;overflow:hidden;font-size:12px}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;outline:none}button,input{line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}svg{fill:currentColor;display:inline-block;stroke-width:0;stroke:currentColor;width:14px;height:14px}blockquote{margin:0}@keyframes tooltip-appear{from{opacity:0}to{opacity:1}}.vditor-tooltipped{position:relative;cursor:pointer}.vditor-tooltipped::after{position:absolute;z-index:1000000;display:none;padding:5px 8px;font-size:11px;font-weight:normal;-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;pointer-events:none;content:attr(aria-label);background:rgba(0,0,0,0.8);border-radius:3px;line-height:16px;opacity:0}.vditor-tooltipped::before{position:absolute;z-index:1000001;display:none;width:0;height:0;color:rgba(0,0,0,0.8);pointer-events:none;content:"";border:5px solid transparent;opacity:0}.vditor-tooltipped--hover::before,.vditor-tooltipped--hover::after,.vditor-tooltipped:hover::before,.vditor-tooltipped:hover::after,.vditor-tooltipped:active::before,.vditor-tooltipped:active::after,.vditor-tooltipped:focus::before,.vditor-tooltipped:focus::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.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,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,0.8)}.vditor-tooltipped__ne::after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__nw::after{margin-right:-15px}.vditor-tooltipped__s::after,.vditor-tooltipped__n::after{transform:translateX(50%)}.vditor-tooltipped__w::after{right:100%;bottom:50%;margin-right:5px;transform:translateY(50%)}.vditor-tooltipped__w::before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:rgba(0,0,0,0.8)}.vditor-tooltipped__e::after{bottom:50%;left:100%;margin-left:5px;transform:translateY(50%)}.vditor-tooltipped__e::before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:rgba(0,0,0,0.8)}.vditor-panel{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,0.2);border-radius:3px;padding:5px;z-index:1;font-size:14px;display: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:0.3;cursor:not-allowed}.vditor-textarea:focus{background-color:#fff}.vditor-preview{flex:1;background-color:#fff;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:rgba(255,255,255,0.6);border-radius:3px;font-size:12px;user-select:none}.vditor-counter--error{color:#d23f31;background-color:rgba(210,63,49,0.1)}.vditor-resize{padding:1px 0;border-radius:5px;cursor:row-resize;transition:all .15s ease-in-out;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;color:#fff;font-size:12px;line-height:14px}.vditor-upload ul{margin:0}.vditor-upload--tip{height:auto;opacity:1 !important}.vditor-upload--tip .vditor-upload__close{display:block}.vditor-upload__close{display:none;position:absolute;right:5px;cursor:pointer;padding:5px;top:0}.vditor-upload__progress{height:100%;background-color:rgba(66,133,244,0.8);transition:all .15s ease-in-out;padding:5px;box-sizing:border-box}.vditor-hint{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,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}.vditor-reset{font-family:"Helvetica Neue","Luxi Sans","DejaVu Sans",Tahoma,"Hiragino Sans GB","Microsoft Yahei",sans-serif;word-wrap:break-word;overflow:auto;line-height:1.65;font-size:16px;word-break:break-word}.vditor-reset ul,.vditor-reset ol{padding-left:2em;margin-top:0;margin-bottom:16px}.vditor-reset li{margin-top:0.25em}.vditor-reset audio{max-width:100%}.vditor-reset video{max-height:90vh}.vditor-reset img.emoji{cursor:auto;max-width:20px;vertical-align:top}.vditor-reset h1,.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.vditor-reset h1{padding-bottom:0.3em;font-size:1.7em;border-bottom:1px solid #eee}.vditor-reset h2{padding-bottom:0.3em;font-size:1.5em;border-bottom:1px solid #eee}.vditor-reset h3{font-size:1.25em}.vditor-reset h4{font-size:1em}.vditor-reset h5{font-size:0.875em}.vditor-reset h6{font-size:0.85em}.vditor-reset hr{height:0.15em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.vditor-reset p{margin-top:0;margin-bottom:16px}.vditor-reset blockquote{padding:0 1em;color:#777;border-left:0.25em solid #ddd;margin:0 0 16px 0}.vditor-reset blockquote p{margin:0}.vditor-reset ins>iframe{border:0}.vditor-reset iframe{border:1px solid #d1d5da}.vditor-reset table{width:100%;border:1px solid #dedede;margin:15px auto;border-collapse:collapse;empty-cells:show}.vditor-reset thead{text-align:center}.vditor-reset td,.vditor-reset th{height:35px;border:1px solid #dedede;padding:0 10px}.vditor-reset th{font-weight:bold;text-align:center !important;background:rgba(158,188,226,0.2)}.vditor-reset tbody tr:nth-child(2n){background:rgba(158,188,226,0.12)}.vditor-reset tr:hover{background:#efefef}.vditor-reset code{padding:0.2em 0.4em;margin:0;font-size:85%;border-radius:3px;font-family:mononoki,Consolas,"Liberation Mono",Menlo,Courier,monospace;word-break:break-word;background-size:20px 20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==)}.vditor-reset pre>code{padding:0.5em;border-radius:5px;display:block;overflow:auto}.vditor-reset pre:hover div.vditor-copy{display:block}.vditor-reset 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:solid 1px #d1d5da;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.vditor-reset summary{cursor:pointer}.vditor-reset summary:focus{outline:none}.vditor-reset svg{height:auto;width:auto}.vditor-reset .katex{position:relative}.vditor-task{list-style:none;margin-left:-1.4em;display:flex;align-items:center}.vditor-task input{margin-right:5px}.vditor-copy{position:relative;display:none}.vditor-copy textarea{position:absolute;left:-100000px}.vditor-copy span{cursor:pointer;position:absolute;right:0.5em;top:0.5em;height:14px;width:14px;display:block;background-color:#f6f8fa;border-radius:3px;padding:3px}.vditor-copy svg{color:#586069;height:14px;width:14px;display:block;fill:currentColor}textarea{overflow:hidden}button,.button{background:url(../images/icon.png) repeat center bottom;border:1px solid;border-color:#CCC #BBBBBB #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:bold !important}.nowrap{white-space:nowrap}.left{float:left}.right{float:right}.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.fn-clear:before,.fn-clear:after{display:table;content:""}.fn-clear:after{clear:both}.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}.red{color:red}.contentBody{margin-bottom:12px;padding:3px 12px}.form th{text-align:right;white-space:nowrap}.form input[type='text'],.form input[type='password'],.form textarea{border-color:#C0C0C0 #D9D9D9 #D9D9D9;border-right:1px solid #D9D9D9;border-style:solid;border-width:1px;font-family:Helvetica,Arial,sans-serif;font-size:12px;outline:medium none;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,0.3) inset}.form textarea{padding:3px;overflow:auto;resize:vertical}.logo{padding:0 5px;text-decoration:none;text-shadow:0 0 1px #EEEEEE}.putTopIcon,.notPutTopIcon,.deleteIcon,.updateIcon,.commentIcon,.homeIcon,.adminIcon,.loginIcon,.logoutIcon,.calendarIcon,.browserIcon,.postIcon,.articlesIcon,.draftsIcon,.usersIcon,.linkIcon,.preferenceIcon,.pageIcon,.trueIcon,.falseIcon,.fileIcon,.othersIcon,.goTopIcon,.goBottomIcon,.cacheIcon,.aboutIcon{background-image:url("../images/icon.png");cursor:pointer;height:16px;width:16px}.adminIcon,.loginIcon,.logoutIcon,.homeIcon{margin-top:3px}.pageIcon{background-position:-144px 0px}.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{background-position:-96px -32px}.draftsIcon{background-position:-96px -32px}.usersIcon{background-position:-112px -32px}.goTopIcon{background-position:-64px -32px;position:fixed;right:20px;top:45%}.goBottomIcon{background-position:-80px -32px;bottom:40%;position:fixed;right:20px}.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}#emotions span{cursor:pointer}.em01{background-position:-24px 0}.em02{background-position:-48px 0}.em03{background-position:-72px 0}.em04{background-position:-96px 0}.em05{background-position:0px -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{list-style:none}#tags li{float:left;list-style:none;height:38px}#tags a:hover{text-shadow:0 0 2px #555555}#tags a{border-radius:3px 3px 3px 3px;box-shadow:1px 1px 3px #555555;float:left;margin:3px 6px;padding:3px 12px;text-decoration:none}#tags .tags1{font-size:12px;font-weight:normal}#tags .tags2{font-size:14px;font-weight:normal}#tags .tags3{font-size:16px;font-weight:normal}#tags .tags4{font-size:18px;font-weight:bold}#tags .tags5{font-size:20px;font-weight:bold}#captcha,#captchaReply{cursor:pointer} html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;height:100%}body{margin:0;font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;font-size:14px;background-color:#fff;-webkit-font-smoothing:antialiased;-webkit-overflow-scrolling:touch}::-moz-selection{text-shadow:none;background:rgba(65,131,196,0.4)}::selection{text-shadow:none;background:rgba(66,133,244,0.4)}ul,ol{margin:0;padding:0}h1,h2,h3,h4,h5,h6,dl,dd,p{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block}audio:not([controls]){display:none}a{outline:0;text-decoration:none}a:hover{text-decoration:underline}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{max-width:100%;vertical-align:middle;border:0;height:auto;-ms-interpolation-mode:bicubic;overflow:hidden;font-size:12px}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;font-family:"Helvetica Neue", "Luxi Sans", "DejaVu Sans", Tahoma, "Hiragino Sans GB", "Microsoft Yahei", sans-serif;outline:none}button,input{line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;resize:vertical}svg{fill:currentColor;display:inline-block;stroke-width:0;stroke:currentColor;width:14px;height:14px}blockquote{margin:0}@keyframes tooltip-appear{from{opacity:0}to{opacity:1}}.vditor-tooltipped{position:relative;cursor:pointer}.vditor-tooltipped::after{position:absolute;z-index:1000000;display:none;padding:5px 8px;font-size:11px;font-weight:normal;-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;pointer-events:none;content:attr(aria-label);background:rgba(0,0,0,0.8);border-radius:3px;line-height:16px;opacity:0}.vditor-tooltipped::before{position:absolute;z-index:1000001;display:none;width:0;height:0;color:rgba(0,0,0,0.8);pointer-events:none;content:"";border:5px solid transparent;opacity:0}.vditor-tooltipped--hover::before,.vditor-tooltipped--hover::after,.vditor-tooltipped:hover::before,.vditor-tooltipped:hover::after,.vditor-tooltipped:active::before,.vditor-tooltipped:active::after,.vditor-tooltipped:focus::before,.vditor-tooltipped:focus::after{display:inline-block;text-decoration:none;animation-name:tooltip-appear;animation-duration:0.1s;animation-fill-mode:forwards;animation-timing-function:ease-in;animation-delay:0.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,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,0.8)}.vditor-tooltipped__ne::after{right:auto;left:50%;margin-left:-15px}.vditor-tooltipped__nw::after{margin-right:-15px}.vditor-tooltipped__s::after,.vditor-tooltipped__n::after{transform:translateX(50%)}.vditor-tooltipped__w::after{right:100%;bottom:50%;margin-right:5px;transform:translateY(50%)}.vditor-tooltipped__w::before{top:50%;bottom:50%;left:-5px;margin-top:-5px;border-left-color:rgba(0,0,0,0.8)}.vditor-tooltipped__e::after{bottom:50%;left:100%;margin-left:5px;transform:translateY(50%)}.vditor-tooltipped__e::before{top:50%;right:-5px;bottom:50%;margin-top:-5px;border-right-color:rgba(0,0,0,0.8)}.vditor-panel{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,0,0,0.2);border-radius:3px;padding:5px;z-index:1;font-size:14px;display: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:0.3;cursor:not-allowed}.vditor-textarea:focus{background-color:#fff}.vditor-preview{flex:1;background-color:#fff;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:rgba(255,255,255,0.6);border-radius:3px;font-size:12px;user-select:none}.vditor-counter--error{color:#d23f31;background-color:rgba(210,63,49,0.1)}.vditor-resize{padding:1px 0;border-radius:5px;cursor:row-resize;transition:all .15s ease-in-out;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;color:#fff;font-size:12px;line-height:14px}.vditor-upload ul{margin:0}.vditor-upload--tip{height:auto;opacity:1 !important}.vditor-upload--tip .vditor-upload__close{display:block}.vditor-upload__close{display:none;position:absolute;right:5px;cursor:pointer;padding:5px;top:0}.vditor-upload__progress{height:100%;background-color:rgba(66,133,244,0.8);transition:all .15s ease-in-out;padding:5px;box-sizing:border-box}.vditor-hint{background-color:#fff;position:absolute;box-shadow:0 1px 2px rgba(0,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}.vditor-reset{font-family:"Helvetica Neue","Luxi Sans","DejaVu Sans",Tahoma,"Hiragino Sans GB","Microsoft Yahei",sans-serif;word-wrap:break-word;overflow:auto;line-height:1.65;font-size:16px;word-break:break-word}.vditor-reset ul,.vditor-reset ol{padding-left:2em;margin-top:0;margin-bottom:16px}.vditor-reset li{margin-top:0.25em}.vditor-reset audio{max-width:100%}.vditor-reset video{max-height:90vh}.vditor-reset img.emoji{cursor:auto;max-width:20px;vertical-align:top}.vditor-reset h1,.vditor-reset h2,.vditor-reset h3,.vditor-reset h4,.vditor-reset h5,.vditor-reset h6{margin-top:24px;margin-bottom:16px;font-weight:600;line-height:1.25}.vditor-reset h1{padding-bottom:0.3em;font-size:1.7em;border-bottom:1px solid #eee}.vditor-reset h2{padding-bottom:0.3em;font-size:1.5em;border-bottom:1px solid #eee}.vditor-reset h3{font-size:1.25em}.vditor-reset h4{font-size:1em}.vditor-reset h5{font-size:0.875em}.vditor-reset h6{font-size:0.85em}.vditor-reset hr{height:0.15em;padding:0;margin:24px 0;background-color:#e7e7e7;border:0}.vditor-reset p{margin-top:0;margin-bottom:16px}.vditor-reset blockquote{padding:0 1em;color:#777;border-left:0.25em solid #ddd;margin:0 0 16px 0}.vditor-reset blockquote p{margin:0}.vditor-reset ins>iframe{border:0}.vditor-reset iframe{border:1px solid #d1d5da}.vditor-reset table{width:100%;border:1px solid #dedede;margin:15px auto;border-collapse:collapse;empty-cells:show}.vditor-reset thead{text-align:center}.vditor-reset td,.vditor-reset th{height:35px;border:1px solid #dedede;padding:0 10px}.vditor-reset th{font-weight:bold;text-align:center !important;background:rgba(158,188,226,0.2)}.vditor-reset tbody tr:nth-child(2n){background:rgba(158,188,226,0.12)}.vditor-reset tr:hover{background:#efefef}.vditor-reset code{padding:0.2em 0.4em;margin:0;font-size:85%;border-radius:3px;font-family:mononoki,Consolas,"Liberation Mono",Menlo,Courier,monospace;word-break:break-word;background-size:20px 20px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8AgMAAABHkjHhAAAACVBMVEWAgIBaWlo+Pj7rTFvWAAAAA3RSTlMHCAw+VhR4AAAA+klEQVQoz4WSMW7EQAhFPxKWNh2FCx+HkaZI6RRb5DYbyVfIJXLKDCFoMbaTKSw/8ZnPAPjaH2xgZcUNUDADD7D9LtDBCLZ45fbkvo/30K8yeI64pPwl6znd/3n/Oe93P3ho9qeh72btTFzqkz0rsJle8Zr81OLEwZ1dv/713uWqvu2pl+k0fy7MWtj9r/tN5q/02z89qa/L4Dc2LvM93kezPfXlME/O86EbY/V9GB9ePX8G1/6W+/9h1dq/HGfTfzT3j/xNo7522Bfnqe5jO/fvhVthlfk434v3iO9zG/UOphyPeinPl1J8Gtaa7xPTa/Dk+RIs4deMvwGvcGsmsCvJ0AAAAABJRU5ErkJggg==)}.vditor-reset pre>code{padding:0.5em;border-radius:5px;display:block;overflow:auto}.vditor-reset pre:hover div.vditor-copy{display:block}.vditor-reset 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:solid 1px #d1d5da;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.vditor-reset summary{cursor:pointer}.vditor-reset summary:focus{outline:none}.vditor-reset svg{height:auto;width:auto}.vditor-reset .katex{position:relative}.vditor-task{list-style:none;margin-left:-1.4em;display:flex;align-items:center}.vditor-task input{margin-right:5px}.vditor-copy{position:relative;display:none}.vditor-copy textarea{position:absolute;left:-100000px}.vditor-copy span{cursor:pointer;position:absolute;right:0.5em;top:0.5em;height:14px;width:14px;display:block;background-color:#f6f8fa;border-radius:3px;padding:3px}.vditor-copy svg{color:#586069;height:14px;width:14px;display:block;fill:currentColor}textarea{overflow:hidden}button,.button{background:url(../images/icon.png) repeat center bottom;border:1px solid;border-color:#CCC #BBBBBB #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:bold !important}.nowrap{white-space:nowrap}.left{float:left}.right{float:right}.clear{background-color:transparent;border:0;clear:both;display:block;font-size:0;height:0;line-height:0;overflow:hidden}.fn-clear:before,.fn-clear:after{display:table;content:""}.fn-clear:after{clear:both}.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}.red{color:red}.contentBody{margin-bottom:12px;padding:3px 12px}.form th{text-align:right;white-space:nowrap}.form input[type='text'],.form input[type='password'],.form textarea{border-color:#C0C0C0 #D9D9D9 #D9D9D9;border-right:1px solid #D9D9D9;border-style:solid;border-width:1px;font-family:Helvetica,Arial,sans-serif;font-size:12px;outline:medium none;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,0.3) inset}.form textarea{padding:3px;overflow:auto;resize:vertical}.logo{padding:0 5px;text-decoration:none;text-shadow:0 0 1px #EEEEEE}.putTopIcon,.notPutTopIcon,.deleteIcon,.updateIcon,.commentIcon,.homeIcon,.adminIcon,.loginIcon,.logoutIcon,.calendarIcon,.browserIcon,.postIcon,.articlesIcon,.draftsIcon,.usersIcon,.linkIcon,.preferenceIcon,.pageIcon,.trueIcon,.falseIcon,.fileIcon,.othersIcon,.goTopIcon,.goBottomIcon,.cacheIcon,.aboutIcon{background-image:url("../images/icon.png");cursor:pointer;height:16px;width:16px}.adminIcon,.loginIcon,.logoutIcon,.homeIcon{margin-top:3px}.pageIcon{background-position:-144px 0px}.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{background-position:-96px -32px}.draftsIcon{background-position:-96px -32px}.usersIcon{background-position:-112px -32px}.goTopIcon{background-position:-64px -32px;position:fixed;right:20px;top:45%}.goBottomIcon{background-position:-80px -32px;bottom:40%;position:fixed;right:20px}#tags{list-style:none}#tags li{float:left;list-style:none;height:38px}#tags a:hover{text-shadow:0 0 2px #555555}#tags a{border-radius:3px 3px 3px 3px;box-shadow:1px 1px 3px #555555;float:left;margin:3px 6px;padding:3px 12px;text-decoration:none}#tags .tags1{font-size:12px;font-weight:normal}#tags .tags2{font-size:14px;font-weight:normal}#tags .tags3{font-size:16px;font-weight:normal}#tags .tags4{font-size:18px;font-weight:bold}#tags .tags5{font-size:20px;font-weight:bold}#captcha,#captchaReply{cursor:pointer}
...@@ -331,77 +331,6 @@ button:hover,.button:hover { ...@@ -331,77 +331,6 @@ button:hover,.button:hover {
} }
/* end icon */ /* end icon */
/* start emotions */
.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;
}
#emotions span {
cursor: pointer;
}
.em01 {
background-position: -24px 0;
}
.em02 {
background-position: -48px 0;
}
.em03 {
background-position: -72px 0;
}
.em04 {
background-position: -96px 0;
}
.em05 {
background-position: 0px -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;
}
/* end emotions */
/* start tags */ /* start tags */
#tags { #tags {
list-style: none; list-style: none;
......
Subproject commit 895d3cfa4c522932070377f8d19f4eae559d2de1 Subproject commit 7332ca1d7e2e39d76a7eaffbc6bf6c4c710fb06b
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