/* * 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 . */ function showPageLink(sUrl, iPage, iCount, sAnchor) { var i = 0; i = Math.max(1, iPage - 1); if (iPage == 1) { document.write("1st "); document.write("« "); } else { document.write("1st "); document.write("« "); } if (iPage > 6) { document.write("... "); } for (i = Math.max(1, iPage - 5); i < iPage; i++) { document.write("" + i + " "); } document.write("" + iPage + " "); for (i = iPage + 1; i <= Math.min(iCount, iPage + 5); i++) { document.write("" + i + " "); } i = Math.min(iCount, iPage + 1); if (iCount > iPage + 5) { document.write("... "); } if (iPage == iCount) { document.write("» "); document.write("Last "); } else { document.write(" »"); document.write("Last "); } }