1/* 2 3 bootpag - jQuery plugin for dynamic pagination 4 5 Copyright (c) 2013 [email protected] 6 7 Licensed under the MIT license: 8 http://www.opensource.org/licenses/mit-license.php 9 10 Project home: 11 http://botmonster.com/jquery-bootpag/ 12 13 Version: 1.0.5 14 15*/ 16(function (f) { 17 f.fn.bootpag = function (n) { 18 function j(e, b) { 19 var c, d = 0 == a.maxVisible ? 1 : a.maxVisible, m = 1 == a.maxVisible ? 0 : 1, l = Math.floor((b - 1) / d) * d, g = e.find("li"); a.page = b = 0 > b ? 0 : b > a.total ? a.total : b; g.removeClass("FRM_disabled"); c = 1 > b - 1 ? 1 : a.leaps && b - 1 >= a.maxVisible ? Math.floor((b - 1) / d) * d : b - 1; g.first().toggleClass("FRM_disabled", 1 === b).attr("data-lp", c).find("a").attr("href", h(c)); m = 1 == a.maxVisible ? 0 : 1; c = b + 1 > a.total ? a.total : a.leaps && b + 1 < a.total - a.maxVisible ? l + a.maxVisible + m : b + 1; g.last().toggleClass("FRM_disabled", b === a.total).attr("data-lp", 20 c).find("a").attr("href", h(c)); d = g.filter("[data-lp=" + b + "]"); if (!d.not(".FRM_next,.FRM_prev").length) { var j = b <= l ? -a.maxVisible : 0; g.not(".FRM_next,.FRM_prev").each(function (b) { c = b + 1 + l + j; f(this).attr("data-lp", c).toggle(c <= a.total).find("a").html(c).attr("href", h(c)) }); d = g.filter("[data-lp=" + b + "]") } d.addClass("FRM_disabled"); k.data("settings", a) 21 } function h(e) { return a.href.replace(a.hrefVariable, e) } var k = this, a = f.extend({ 22 total: 0, page: 1, maxVisible: null, leaps: !0, href: "javascript:void(0);", hrefVariable: "{{number}}", next: "»", 23 prev: "«" 24 }, k.data("settings") || {}, n || {}); if (0 >= a.total) return this; !f.isNumeric(a.maxVisible) && !a.maxVisible && (a.maxVisible = a.total); k.data("settings", a); return this.each(function () { 25 var e, b, c = f(this), d = ['<ul class="FRM_pagination bootpag">']; a.prev && d.push('<li data-lp="1" class="FRM_prev"><a href="' + h(1) + '">' + a.prev + "</a></li>"); for (b = 1; b <= Math.min(a.total, a.maxVisible) ; b++) d.push('<li data-lp="' + b + '"><a href="' + h(b) + '">' + b + "</a></li>"); a.next && (b = a.leaps && a.total > a.maxVisible ? Math.min(a.maxVisible + 26 1, a.total) : 2, d.push('<li data-lp="' + b + '" class="FRM_next"><a href="' + h(b) + '">' + a.next + "</a></li>")); d.push("</ul>"); c.find("ul.bootpag").remove(); c.append(d.join("")); e = c.find("ul.bootpag"); c.find("li").click(function () { var a = f(this); a.hasClass("FRM_disabled") || (a = parseInt(a.attr("data-lp"), 10), j(e, a), k.trigger("page", a)) }); j(e, a.page) 27 }) 28 } 29})(jQuery, window);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.