From 6ca3f2c627adf28a526d251e1f22c59f82dee4ab Mon Sep 17 00:00:00 2001 From: Van Date: Wed, 5 Dec 2018 12:36:15 +0800 Subject: [PATCH] https://github.com/b3log/solo/issues/12583 --- ease/js/ease.js | 2 +- ease/js/ease.min.js | 2 +- timeline/js/timeline.js | 2 +- timeline/js/timeline.min.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ease/js/ease.js b/ease/js/ease.js index 89964e1..b2479ae 100644 --- a/ease/js/ease.js +++ b/ease/js/ease.js @@ -41,7 +41,7 @@ var getNextPage = function () { } $.ajax({ - url: latkeConfig.servePath + path + currentPage, + url: latkeConfig.servePath + path + '?p=' + currentPage, type: "GET", beforeSend: function () { $more.css("background", diff --git a/ease/js/ease.min.js b/ease/js/ease.min.js index 92122be..90e6a1c 100644 --- a/ease/js/ease.min.js +++ b/ease/js/ease.min.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -var goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getNextPage=function(){var c=$(".article-next");currentPage+=1;var e="/articles/";if(1===$("#tag").length)e="/articles/tags/"+(t=location.pathname.split("/"))[t.length-1]+"/";else if(1===$("#archive").length){e="/articles/archives/"+(t=location.pathname.split("/"))[t.length-2]+"/"+t[t.length-1]+"/"}else if(1===$("#author").length){var t;e="/articles/authors/"+(t=location.pathname.split("/"))[t.length-1]+"/"}$.ajax({url:latkeConfig.servePath+e+currentPage,type:"GET",beforeSend:function(){c.css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe")},success:function(e,t){if(e.sc){for(var a="",i=e.rslts.pagination,r=0;r

'+l.articleTitle+"",l.hasUpdated&&(a+=""+Label.updatedLabel+""),l.articlePutTop&&(a+=""+Label.topArticleLabel+""),a+='

'+l.articleAbstract+'
',l.hasUpdated?a+=Util.toDate(l.articleUpdateTime,"yy-MM-dd HH:mm"):a+=Util.toDate(l.articleCreateTime,"yy-MM-dd HH:mm"),a+=' '+l.authorName+'
'+Label.tag1Label+" ";for(var s=l.articleTags.split(","),o=0;o
"}e.html(a);for(var o=$(".archives>div"),c=0,h=0,g=[],d=0;d=o.length);f++)o[d].style.left=310*f+"px",g[f]=0i.headerH){var t=$(window).height(),a=e+t-21;$("body").height()-58<=e+t&&(a=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",a)}else $("#goTop").hide()})},setDynamic:function(){var e=$(".dynamic");if(!($(".dynamic").length<1)){var t=e.find(".side-categories"),a=e.find(".side-tags"),i=e.find(".side-most-comment"),r=e.find(".side-most-view");t.height()>a.height()?a.height(t.height()):t.height(a.height()),i.height()>r.height()?r.height(i.height()):i.height(r.height()),$(".article-body").each(function(){this.innerHTML=Util.replaceEmString($(this).html())})}}};ease.getCurrentPage(),ease.initCommon(),ease.scrollEvent(),ease.setNavCurrent(),ease.initArchives(),ease.setDynamic(); \ No newline at end of file +var goTranslate=function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getNextPage=function(){var c=$(".article-next");currentPage+=1;var e="/articles/";if(1===$("#tag").length)e="/articles/tags/"+(t=location.pathname.split("/"))[t.length-1]+"/";else if(1===$("#archive").length){e="/articles/archives/"+(t=location.pathname.split("/"))[t.length-2]+"/"+t[t.length-1]+"/"}else if(1===$("#author").length){var t;e="/articles/authors/"+(t=location.pathname.split("/"))[t.length-1]+"/"}$.ajax({url:latkeConfig.servePath+e+"?p="+currentPage,type:"GET",beforeSend:function(){c.css("background","url("+latkeConfig.staticServePath+"/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe")},success:function(e,t){if(e.sc){for(var a="",i=e.rslts.pagination,r=0;r

'+l.articleTitle+"",l.hasUpdated&&(a+=""+Label.updatedLabel+""),l.articlePutTop&&(a+=""+Label.topArticleLabel+""),a+='

'+l.articleAbstract+'
',l.hasUpdated?a+=Util.toDate(l.articleUpdateTime,"yy-MM-dd HH:mm"):a+=Util.toDate(l.articleCreateTime,"yy-MM-dd HH:mm"),a+=' '+l.authorName+'
'+Label.tag1Label+" ";for(var s=l.articleTags.split(","),o=0;o
"}e.html(a);for(var o=$(".archives>div"),c=0,h=0,g=[],d=0;d=o.length);f++)o[d].style.left=310*f+"px",g[f]=0i.headerH){var t=$(window).height(),a=e+t-21;$("body").height()-58<=e+t&&(a=$(".footer").offset().top-21),$("#goTop").fadeIn("slow").css("top",a)}else $("#goTop").hide()})},setDynamic:function(){var e=$(".dynamic");if(!($(".dynamic").length<1)){var t=e.find(".side-categories"),a=e.find(".side-tags"),i=e.find(".side-most-comment"),r=e.find(".side-most-view");t.height()>a.height()?a.height(t.height()):t.height(a.height()),i.height()>r.height()?r.height(i.height()):i.height(r.height()),$(".article-body").each(function(){this.innerHTML=Util.replaceEmString($(this).html())})}}};ease.getCurrentPage(),ease.initCommon(),ease.scrollEvent(),ease.setNavCurrent(),ease.initArchives(),ease.setDynamic(); \ No newline at end of file diff --git a/timeline/js/timeline.js b/timeline/js/timeline.js index a09507d..90dcddd 100644 --- a/timeline/js/timeline.js +++ b/timeline/js/timeline.js @@ -214,7 +214,7 @@ var timeline = { path = "/articles/archives/" + archive + "/"; } $.ajax({ - url: latkeConfig.servePath + path + currentPage, + url: latkeConfig.servePath + path + '?p=' + currentPage, type: "GET", beforeSend: function() { $more.css("background", diff --git a/timeline/js/timeline.min.js b/timeline/js/timeline.min.js index 012699c..9c48f88 100644 --- a/timeline/js/timeline.min.js +++ b/timeline/js/timeline.min.js @@ -15,4 +15,4 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ -var timeline={_COLHA:0,_COLHB:20,_initArticleList:function(){var e=$(".articles");0===e.length||0<$(".articles > .fn-clear").length||($(window).resize(function(){if("auto"===$("#hideTop").css("top")){var i=[timeline._COLHA,timeline._COLHB];e.find("article").each(function(){var e=$(this),t=i[1]>i[0],a=t?i[0]:i[1];parseInt(e.css("top"))===a&&0!==a||(e.css({top:a+"px",position:"absolute"}),this.className=t?"l":"r"),i[t?"0":"1"]+=parseInt(e.outerHeight(!0))}),e.height(i[0]>i[1]?i[0]:i[1])}else e.find("article").each(function(){$(this).css({position:"inherit",top:"auto"}).removeClass("r l")}),e.css("height","auto")}),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()}))},_initIndexList:function(){var e=$(".articles > .fn-clear");if(0!==e.length){var a=0;$(".nav-abs li").each(function(e){var t=$(this);t.hide(),a!==t.data("year")&&(a=t.data("year"),t.before("
  • "+a+"
  • "))}),$(".article-more").parent().data("count")<=$(".article-more").parent().find("article").length&&$(".article-more").remove(),$(window).resize(function(){e.each(function(){if("auto"===$("#hideTop").css("top")){var i=[timeline._COLHA+60,4*timeline._COLHB];0===(e=$(this).find("article")).length?($(this).find("h2").remove(),$(this).css("margin-bottom",0)):(e.each(function(){var e=$(this),t=i[1]>i[0],a=t?i[0]:i[1];parseInt(e.css("top"))===a&&0!==a||(e.css({top:a+"px",position:"absolute"}),this.className=t?"l":"r"),i[t?"0":"1"]+=parseInt(e.outerHeight(!0))}),$(this).height(i[0]>i[1]?i[0]:i[1]))}else{var e;0===(e=$(this).find("article")).length?($(this).find("h2").remove(),$(this).css("margin-bottom",0)):(e.each(function(){$(this).css({position:"inherit",top:"auto"}).removeClass("r l")}),$(this).css("height","auto"))}})}),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()})}},_setNavCurrent:function(){$(".header li a").each(function(){$(this).prop("href")===location.href.split("#")[0]?this.className="current":this.className=""})},init:function(){$(window).scroll(function(){60<$(window).scrollTop()?$(".ico-top").show():$(".ico-top").hide()}),timeline._initIndexList(),timeline._initArticleList(),timeline._setNavCurrent(),$(".ico-list").click(function(){"0px"===$(".header > .container > form").css("height")?$(".header > .container > ul, .header > .container > form").css({height:"auto"}):$(".header > .container > ul, .header > .container > form").animate({height:"0px"})})},translate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getArchive:function(e,t,a){var i=e+t,s=e+"/"+t;if(window.location.hash="#"+i,0===$("#"+i+" > article").length){var n=e+" "+Label.yearLabel+" "+t+" "+Label.monthLabel;"en"===Label.localeString.substring(0,2)&&(n=a+" "+e);var r='

    '+n+'

    '+Label.moreLabel+"
    ";$("#"+i).html(r).css("margin-bottom","50px"),timeline.getNextPage($("#"+i).find(".article-more")[0],s)}},getNextPage:function(e,t){var l=$(e),c=l.data("page")+1,a="/articles/";if(1===$("#tag").length)a="/articles/tags/"+(i=location.pathname.split("/"))[i.length-1]+"/";else if(1===$("#author").length){var i;a="/articles/authors/"+(i=location.pathname.split("/"))[i.length-1]+"/"}else t&&(a="/articles/archives/"+t+"/");$.ajax({url:latkeConfig.servePath+a+c,type:"GET",beforeSend:function(){l.css("background","url("+latkeConfig.staticServePath+"/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("")},success:function(e,t){if(e.sc)if(0!==e.rslts.articles.length){for(var a="",i=e.rslts.pagination,s=0;s

    '+n.articleTitle+"",n.hasUpdated&&(a+=""+Label.updatedLabel+""),n.articlePutTop&&(a+=""+Label.topArticleLabel+""),a+="

    "+n.articleAbstract+'

    ';for(var r=n.articleTags.split(","),o=0;o'+r[o]+"",o  '+(0===n.articleCommentCount?Label.noCommentLabel:n.articleCommentCount)+' '+n.articleViewCount+"
    "}l.before(a).data("page",c),i.paginationPageCount<=c?l.remove():l.css("background","none #60829F").text(Label.moreLabel),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()})}else l.remove();else l.css("background","none #60829F").text("Error")}})},toggleArchives:function(a,i){$(".nav-abs li").each(function(e){var t=$(this);t.hasClass("year")||(t.hide(),i===t.data("year")&&$(a).hasClass("close")&&t.show())}),$(".nav-abs li.year").each(function(){parseInt($(this).text())===i?$(a).hasClass("close")?a.className="year open":a.className="year close":this.className="year close"})}};!function(u,e){"use strict";var g="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";u.fn.imagesLoaded=function(a){var i=this,s=u.isFunction(u.Deferred)?u.Deferred():0,n=u.isFunction(s.notify),r=i.find("img").add(i.filter("img")),o=[],l=[],c=[];function h(){var e=u(l),t=u(c);s&&(c.length?s.reject(r,e,t):s.resolve(r)),u.isFunction(a)&&a.call(i,r,e,t)}function d(e){m(e.target,"error"===e.type)}function m(e,t){e.src!==g&&-1===u.inArray(e,o)&&(o.push(e),t?c.push(e):l.push(e),u.data(e,"imagesLoaded",{isBroken:t,src:e.src}),n&&s.notifyWith(u(e),[t,r,u(l),u(c)]),r.length===o.length&&(setTimeout(h),r.unbind(".imagesLoaded",d)))}return u.isPlainObject(a)&&u.each(a,function(e,t){"callback"===e?a=t:s&&s[e](t)}),r.length?r.bind("load.imagesLoaded error.imagesLoaded",d).each(function(e,t){var a=t.src,i=u.data(t,"imagesLoaded");i&&i.src===a?m(t,i.isBroken):t.complete&&void 0!==t.naturalWidth?m(t,0===t.naturalWidth||0===t.naturalHeight):(t.readyState||t.complete)&&(t.src=g,t.src=a)}):h(),s?s.promise(i):i}}(jQuery),Util.init(),Util.replaceSideEm($(".comments .article-body")),Util.buildTags("tagsSide"),timeline.init(); \ No newline at end of file +var timeline={_COLHA:0,_COLHB:20,_initArticleList:function(){var e=$(".articles");0===e.length||0<$(".articles > .fn-clear").length||($(window).resize(function(){if("auto"===$("#hideTop").css("top")){var i=[timeline._COLHA,timeline._COLHB];e.find("article").each(function(){var e=$(this),t=i[1]>i[0],a=t?i[0]:i[1];parseInt(e.css("top"))===a&&0!==a||(e.css({top:a+"px",position:"absolute"}),this.className=t?"l":"r"),i[t?"0":"1"]+=parseInt(e.outerHeight(!0))}),e.height(i[0]>i[1]?i[0]:i[1])}else e.find("article").each(function(){$(this).css({position:"inherit",top:"auto"}).removeClass("r l")}),e.css("height","auto")}),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()}))},_initIndexList:function(){var e=$(".articles > .fn-clear");if(0!==e.length){var a=0;$(".nav-abs li").each(function(e){var t=$(this);t.hide(),a!==t.data("year")&&(a=t.data("year"),t.before("
  • "+a+"
  • "))}),$(".article-more").parent().data("count")<=$(".article-more").parent().find("article").length&&$(".article-more").remove(),$(window).resize(function(){e.each(function(){if("auto"===$("#hideTop").css("top")){var i=[timeline._COLHA+60,4*timeline._COLHB];0===(e=$(this).find("article")).length?($(this).find("h2").remove(),$(this).css("margin-bottom",0)):(e.each(function(){var e=$(this),t=i[1]>i[0],a=t?i[0]:i[1];parseInt(e.css("top"))===a&&0!==a||(e.css({top:a+"px",position:"absolute"}),this.className=t?"l":"r"),i[t?"0":"1"]+=parseInt(e.outerHeight(!0))}),$(this).height(i[0]>i[1]?i[0]:i[1]))}else{var e;0===(e=$(this).find("article")).length?($(this).find("h2").remove(),$(this).css("margin-bottom",0)):(e.each(function(){$(this).css({position:"inherit",top:"auto"}).removeClass("r l")}),$(this).css("height","auto"))}})}),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()})}},_setNavCurrent:function(){$(".header li a").each(function(){$(this).prop("href")===location.href.split("#")[0]?this.className="current":this.className=""})},init:function(){$(window).scroll(function(){60<$(window).scrollTop()?$(".ico-top").show():$(".ico-top").hide()}),timeline._initIndexList(),timeline._initArticleList(),timeline._setNavCurrent(),$(".ico-list").click(function(){"0px"===$(".header > .container > form").css("height")?$(".header > .container > ul, .header > .container > form").css({height:"auto"}):$(".header > .container > ul, .header > .container > form").animate({height:"0px"})})},translate:function(){window.open("http://translate.google.com/translate?sl=auto&tl=auto&u="+location.href)},getArchive:function(e,t,a){var i=e+t,s=e+"/"+t;if(window.location.hash="#"+i,0===$("#"+i+" > article").length){var n=e+" "+Label.yearLabel+" "+t+" "+Label.monthLabel;"en"===Label.localeString.substring(0,2)&&(n=a+" "+e);var r='

    '+n+'

    '+Label.moreLabel+"
    ";$("#"+i).html(r).css("margin-bottom","50px"),timeline.getNextPage($("#"+i).find(".article-more")[0],s)}},getNextPage:function(e,t){var l=$(e),c=l.data("page")+1,a="/articles/";if(1===$("#tag").length)a="/articles/tags/"+(i=location.pathname.split("/"))[i.length-1]+"/";else if(1===$("#author").length){var i;a="/articles/authors/"+(i=location.pathname.split("/"))[i.length-1]+"/"}else t&&(a="/articles/archives/"+t+"/");$.ajax({url:latkeConfig.servePath+a+"?p="+c,type:"GET",beforeSend:function(){l.css("background","url("+latkeConfig.staticServePath+"/skins/timeline/images/ajax-loader.gif) no-repeat scroll center center #60829F").text("")},success:function(e,t){if(e.sc)if(0!==e.rslts.articles.length){for(var a="",i=e.rslts.pagination,s=0;s

    '+n.articleTitle+"",n.hasUpdated&&(a+=""+Label.updatedLabel+""),n.articlePutTop&&(a+=""+Label.topArticleLabel+""),a+="

    "+n.articleAbstract+'

    ';for(var r=n.articleTags.split(","),o=0;o'+r[o]+"",o  '+(0===n.articleCommentCount?Label.noCommentLabel:n.articleCommentCount)+' '+n.articleViewCount+"
    "}l.before(a).data("page",c),i.paginationPageCount<=c?l.remove():l.css("background","none #60829F").text(Label.moreLabel),$(window).resize(),$(".module img").imagesLoaded(function(){$(window).resize()})}else l.remove();else l.css("background","none #60829F").text("Error")}})},toggleArchives:function(a,i){$(".nav-abs li").each(function(e){var t=$(this);t.hasClass("year")||(t.hide(),i===t.data("year")&&$(a).hasClass("close")&&t.show())}),$(".nav-abs li.year").each(function(){parseInt($(this).text())===i?$(a).hasClass("close")?a.className="year open":a.className="year close":this.className="year close"})}};!function(u,e){"use strict";var g="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";u.fn.imagesLoaded=function(a){var i=this,s=u.isFunction(u.Deferred)?u.Deferred():0,n=u.isFunction(s.notify),r=i.find("img").add(i.filter("img")),o=[],l=[],c=[];function h(){var e=u(l),t=u(c);s&&(c.length?s.reject(r,e,t):s.resolve(r)),u.isFunction(a)&&a.call(i,r,e,t)}function d(e){m(e.target,"error"===e.type)}function m(e,t){e.src!==g&&-1===u.inArray(e,o)&&(o.push(e),t?c.push(e):l.push(e),u.data(e,"imagesLoaded",{isBroken:t,src:e.src}),n&&s.notifyWith(u(e),[t,r,u(l),u(c)]),r.length===o.length&&(setTimeout(h),r.unbind(".imagesLoaded",d)))}return u.isPlainObject(a)&&u.each(a,function(e,t){"callback"===e?a=t:s&&s[e](t)}),r.length?r.bind("load.imagesLoaded error.imagesLoaded",d).each(function(e,t){var a=t.src,i=u.data(t,"imagesLoaded");i&&i.src===a?m(t,i.isBroken):t.complete&&void 0!==t.naturalWidth?m(t,0===t.naturalWidth||0===t.naturalHeight):(t.readyState||t.complete)&&(t.src=g,t.src=a)}):h(),s?s.promise(i):i}}(jQuery),Util.init(),Util.replaceSideEm($(".comments .article-body")),Util.buildTags("tagsSide"),timeline.init(); \ No newline at end of file