/* * Copyright (c) 2009, 2010, 2011, 2012, 2013, B3log Team * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @fileoverview ease js. * * @author Liyuan Li * @version 1.0.1.5, Jan 29, 2013 */ var goTranslate = function () { window.open("http://translate.google.com/translate?sl=auto&tl=auto&u=" + location.href); }; var getNextPage = function () { var $more = $(".article-next"); currentPage += 1; var path = "/articles/"; if($("#tag").length === 1) { var pathnames = location.pathname.split("/"); path = "/articles/tags/" + pathnames[pathnames.length - 1] + "/"; } else if ($("#archive").length === 1) { var pathnames = location.pathname.split("/"); path = "/articles/archives/" + pathnames[pathnames.length - 2] + "/" + pathnames[pathnames.length - 1] + "/"; } else if ($("#author").length === 1) { var pathnames = location.pathname.split("/"); path = "/articles/authors/" + pathnames[pathnames.length - 1] + "/"; } $.ajax({ url: latkeConfig.servePath + path + currentPage, type: "GET", beforeSend: function () { $more.css("background", "url(" + latkeConfig.staticServePath + "/skins/ease/images/ajax-loader.gif) no-repeat scroll center center #fefefe"); }, success: function(result, textStatus){ if (!result.sc) { return; } var articlesHTML = "", pagination = result.rslts.pagination; // append articles for (var i = 0; i < result.rslts.articles.length; i++) { var article = result.rslts.articles[i], lastClass = ""; if (result.rslts.articles.length - 1 === i) { lastClass = " article-last"; } articlesHTML += '