This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Solo - A small and beautiful blogging system written in Java.
|
||||
* Copyright (c) 2010-2019, b3log.org & hacpai.com
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
var bootstyle = {
|
||||
getCurrentPage: function () {
|
||||
var $next = $(".pagination-btn");
|
||||
|
||||
7
skins/bootstyle/js/bootstyle.min.js
vendored
7
skins/bootstyle/js/bootstyle.min.js
vendored
@@ -1,6 +1 @@
|
||||
var bootstyle={getCurrentPage:function(){var $next=$(".pagination-btn");if($next.length>0){window.currentPage=$next.data("page");}},setNavCurrent:function(){$(".nav li a").each(function(){var $this=$(this);var path1=latkeConfig.servePath+location.pathname,path2=latkeConfig.servePath+location.pathname.substr(0,location.pathname.length-1);if($this.attr("href")===path1||$this.attr("href")===path2){$this.parent().addClass("active");}else if(/\/[0-9]+$/.test(location.pathname)){$(".nav li")[0].className="current";}});},setCommentEmotions:function(){$(".comments").each(function(){$(this).html(Util.replaceEmString($(this).html()));});},init:function(){this.getCurrentPage();this.setNavCurrent();this.setCommentEmotions();}};$(function(){bootstyle.init();})
|
||||
var getNextPage=function(){var $more=$(".pagination-btn");currentPage+=1;var path="/articles/";if(location.pathname.indexOf("tags")>-1){var tagsPathnaem=location.pathname.split("/tags/");var tags=tagsPathnaem[1].split("/");path="/articles/tags/"+tags[0]+"/";}else if(location.pathname.indexOf("archives")>-1){var archivesPathname=location.pathname.split("/archives/");var archives=archivesPathname[1].split("/");path="/articles/archives/"+archives[0]+"/"+archives[1]+"/";}
|
||||
var nextLabel='',btn_background='';$.ajax({url:latkeConfig.servePath+path+currentPage,type:"GET",beforeSend:function(){nextLabel=$more.text();btn_background=$more.css('background');$more.text(' ').css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe");},success:function(result,textStatus){var pagination=result.rslts.pagination;for(var i=0;i<result.rslts.articles.length;i++){var article=result.rslts.articles[i];var articleHTML=new Array();articleHTML.push('<div class="page-header page-header-m">');articleHTML.push('<h3><a href="'+article.articlePermalink+'">'+article.articleTitle+'</a></h3>');articleHTML.push('</div>');articleHTML.push('<div class="page-header-bottom"><span>');articleHTML.push('<li class="icon-time"></li>');if(article.hasUpdated){articleHTML.push(Util.toDate(article.articleUpdateDate,' yyyy-MM-dd HH:mm '));}else{articleHTML.push(Util.toDate(article.articleCreateDate,' yyyy-MM-dd HH:mm '));}
|
||||
articleHTML.push('</span><span><li class="icon-user"></li>');articleHTML.push('<a href="/authors/'+article.authorId+'" title="'+Label.authorLabel+': '+article.authorName+'"> ');articleHTML.push(article.authorName);articleHTML.push(' </a>');articleHTML.push('</span><div class="pull-right"><span>');articleHTML.push('<li class="icon-eye-open"></li>');articleHTML.push('<a href="'+article.articlePermalink+'"> ');articleHTML.push(article.articleViewCount+' '+Label.viewLabel);articleHTML.push(' </a>');articleHTML.push('</span><span><li class="icon-comment"></li>');articleHTML.push('<a href="'+article.articlePermalink+'#comments"> '+article.articleCommentCount+' '+Label.commentLabel+' </a>');articleHTML.push('</span></div></div>');articleHTML.push(article.articleAbstract);articleHTML.push('<div class="article-tags">');articleHTML.push('<li class="icon-tags"></li>'+Label.tag1Label);var articleTags=article.articleTags.split(',');for(var j=0;j<articleTags.length;j++){var articleTag=articleTags[j];articleHTML.push('<span>');articleHTML.push('<a href="'+latkeConfig.servePath+'/tags/'+articleTag+'">');articleHTML.push(articleTag);articleHTML.push('</a></span>');}
|
||||
articleHTML.push('</div>');$more.before(articleHTML.join(''));}
|
||||
if(pagination.paginationPageCount===currentPage){$more.remove();}else{$more.text(nextLabel).css("background",'');}}});};
|
||||
var bootstyle={getCurrentPage:function(){var a=$(".pagination-btn");0<a.length&&(window.currentPage=a.data("page"))},setNavCurrent:function(){$(".nav li a").each(function(){var a=$(this),t=latkeConfig.servePath+location.pathname,e=latkeConfig.servePath+location.pathname.substr(0,location.pathname.length-1);a.attr("href")===t||a.attr("href")===e?a.parent().addClass("active"):/\/[0-9]+$/.test(location.pathname)&&($(".nav li")[0].className="current")})},setCommentEmotions:function(){$(".comments").each(function(){$(this).html(Util.replaceEmString($(this).html()))})},init:function(){this.getCurrentPage(),this.setNavCurrent(),this.setCommentEmotions()}};$(function(){bootstyle.init()});var getNextPage=function(){var c=$(".pagination-btn");currentPage+=1;var a="/articles/";if(-1<location.pathname.indexOf("tags"))a="/articles/tags/"+location.pathname.split("/tags/")[1].split("/")[0]+"/";else if(-1<location.pathname.indexOf("archives")){var t=location.pathname.split("/archives/")[1].split("/");a="/articles/archives/"+t[0]+"/"+t[1]+"/"}var h="";$.ajax({url:latkeConfig.servePath+a+currentPage,type:"GET",beforeSend:function(){h=c.text(),c.css("background"),c.text(" ").css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe")},success:function(a,t){for(var e=a.rslts.pagination,s=0;s<a.rslts.articles.length;s++){var i=a.rslts.articles[s],n=new Array;n.push('<div class="page-header page-header-m">'),n.push('<h3><a href="'+i.articlePermalink+'">'+i.articleTitle+"</a></h3>"),n.push("</div>"),n.push('<div class="page-header-bottom"><span>'),n.push('<li class="icon-time"></li>'),i.hasUpdated?n.push(Util.toDate(i.articleUpdateDate," yyyy-MM-dd HH:mm ")):n.push(Util.toDate(i.articleCreateDate," yyyy-MM-dd HH:mm ")),n.push('</span><span><li class="icon-user"></li>'),n.push('<a href="/authors/'+i.authorId+'" title="'+Label.authorLabel+": "+i.authorName+'"> '),n.push(i.authorName),n.push(" </a>"),n.push('</span><div class="pull-right"><span>'),n.push('<li class="icon-eye-open"></li>'),n.push('<a href="'+i.articlePermalink+'"> '),n.push(i.articleViewCount+" "+Label.viewLabel),n.push(" </a>"),n.push('</span><span><li class="icon-comment"></li>'),n.push('<a href="'+i.articlePermalink+'#comments"> '+i.articleCommentCount+" "+Label.commentLabel+" </a>"),n.push("</span></div></div>"),n.push(i.articleAbstract),n.push('<div class="article-tags">'),n.push('<li class="icon-tags"></li>'+Label.tag1Label);for(var r=i.articleTags.split(","),l=0;l<r.length;l++){var o=r[l];n.push("<span>"),n.push('<a href="'+latkeConfig.servePath+"/tags/"+o+'">'),n.push(o),n.push("</a></span>")}n.push("</div>"),c.before(n.join(""))}e.paginationPageCount===currentPage?c.remove():c.text(h).css("background","")}})};
|
||||
Reference in New Issue
Block a user