D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
stickain
/
davidsteele.com
/
wp-content
/
plugins
/
alidswoo
/
assets
/
js
/
global
/
Filename :
simplePagination.min.js
back
Copy
!function(e){var t={};function a(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)a.d(n,s,function(t){return e[t]}.bind(null,s));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="/",a(a.s=275)}({275:function(e,t,a){e.exports=a(276)},276:function(e,t){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var n,s;n=jQuery,s={init:function(e){var t=n.extend({items:1,itemsOnPage:1,pages:0,displayedPages:5,edges:2,currentPage:0,hrefTextPrefix:"#adspage-",hrefTextSuffix:"",prevText:"Prev",nextText:"Next",ellipseText:"…",cssStyle:"light-theme",labelMap:[],selectOnClick:!0,nextAtFront:!1,invertPageOrder:!1,onPageClick:function(e,t){},onInit:function(){}},e||{}),a=this;return t.pages=t.pages?t.pages:Math.ceil(t.items/t.itemsOnPage)?Math.ceil(t.items/t.itemsOnPage):1,t.currentPage?t.currentPage=t.currentPage-1:t.currentPage=t.invertPageOrder?t.pages-1:0,t.halfDisplayed=t.displayedPages/2,this.each((function(){a.addClass(t.cssStyle+" simple-pagination").data("pagination",t),s._draw.call(a)})),t.onInit(),this},selectPage:function(e){return s._selectPage.call(this,e-1),this},prevPage:function(){var e=this.data("pagination");return e.invertPageOrder?e.currentPage<e.pages-1&&s._selectPage.call(this,e.currentPage+1):e.currentPage>0&&s._selectPage.call(this,e.currentPage-1),this},nextPage:function(){var e=this.data("pagination");return e.invertPageOrder?e.currentPage>0&&s._selectPage.call(this,e.currentPage-1):e.currentPage<e.pages-1&&s._selectPage.call(this,e.currentPage+1),this},getPagesCount:function(){return this.data("pagination").pages},getCurrentPage:function(){return this.data("pagination").currentPage+1},destroy:function(){return this.empty(),this},drawPage:function(e){var t=this.data("pagination");return t.currentPage=e-1,this.data("pagination",t),s._draw.call(this),this},redraw:function(){return s._draw.call(this),this},disable:function(){var e=this.data("pagination");return e.disabled=!0,this.data("pagination",e),s._draw.call(this),this},enable:function(){var e=this.data("pagination");return e.disabled=!1,this.data("pagination",e),s._draw.call(this),this},updateItems:function(e){var t=this.data("pagination");t.items=e,t.pages=s._getPages(t),this.data("pagination",t),s._draw.call(this)},updateItemsOnPage:function(e){var t=this.data("pagination");return t.itemsOnPage=e,t.pages=s._getPages(t),this.data("pagination",t),s._selectPage.call(this,0),this},_draw:function(){var e,t=this.data("pagination"),a=s._getInterval(t);s.destroy.call(this);var i="UL"===("function"==typeof this.prop?this.prop("tagName"):this.attr("tagName"))?this:n('<ul class="pagination"></ul>').appendTo(this);if(t.prevText&&s._appendItem.call(this,t.invertPageOrder?t.currentPage+1:t.currentPage-1,{text:t.prevText,classes:"prev"}),t.nextText&&t.nextAtFront&&s._appendItem.call(this,t.invertPageOrder?t.currentPage-1:t.currentPage+1,{text:t.nextText,classes:"next"}),t.invertPageOrder){if(a.end<t.pages&&t.edges>0){var r=Math.max(t.pages-t.edges,a.end);for(e=t.pages-1;e>=r;e--)s._appendItem.call(this,e);t.pages-t.edges>a.end&&t.pages-t.edges-a.end!=1?i.append('<li class="disabled"><span class="ellipse">'+t.ellipseText+"</span></li>"):t.pages-t.edges-a.end==1&&s._appendItem.call(this,a.end)}}else if(a.start>0&&t.edges>0){var l=Math.min(t.edges,a.start);for(e=0;e<l;e++)s._appendItem.call(this,e);t.edges<a.start&&a.start-t.edges!=1?i.append('<li class="disabled"><span class="ellipse">'+t.ellipseText+"</span></li>"):a.start-t.edges==1&&s._appendItem.call(this,t.edges)}if(t.invertPageOrder)for(e=a.end-1;e>=a.start;e--)s._appendItem.call(this,e);else for(e=a.start;e<a.end;e++)s._appendItem.call(this,e);if(t.invertPageOrder){if(a.start>0&&t.edges>0)for(t.edges<a.start&&a.start-t.edges!=1?i.append('<li class="disabled"><span class="ellipse">'+t.ellipseText+"</span></li>"):a.start-t.edges==1&&s._appendItem.call(this,t.edges),e=(l=Math.min(t.edges,a.start))-1;e>=0;e--)s._appendItem.call(this,e)}else if(a.end<t.pages&&t.edges>0)for(t.pages-t.edges>a.end&&t.pages-t.edges-a.end!=1?i.append('<li class="disabled"><span class="ellipse">'+t.ellipseText+"</span></li>"):t.pages-t.edges-a.end==1&&s._appendItem.call(this,a.end),e=r=Math.max(t.pages-t.edges,a.end);e<t.pages;e++)s._appendItem.call(this,e);t.nextText&&!t.nextAtFront&&s._appendItem.call(this,t.invertPageOrder?t.currentPage-1:t.currentPage+1,{text:t.nextText,classes:"next"})},_getPages:function(e){return Math.ceil(e.items/e.itemsOnPage)||1},_getInterval:function(e){return{start:Math.ceil(e.currentPage>e.halfDisplayed?Math.max(Math.min(e.currentPage-e.halfDisplayed,e.pages-e.displayedPages),0):0),end:Math.ceil(e.currentPage>e.halfDisplayed?Math.min(e.currentPage+e.halfDisplayed,e.pages):Math.min(e.displayedPages,e.pages))}},_appendItem:function(e,t){var a,i,r=this,l=r.data("pagination"),p=n("<li></li>"),d=r.find("ul");a={text:(e=e<0?0:e<l.pages?e:l.pages-1)+1,classes:""},l.labelMap.length&&l.labelMap[e]&&(a.text=l.labelMap[e]),a=n.extend(a,t||{}),e==l.currentPage||l.disabled?(l.disabled?p.addClass("disabled"):p.addClass("active"),i=n('<span class="current">'+a.text+"</span>")):(i=n('<a href="'+l.hrefTextPrefix+(e+1)+l.hrefTextSuffix+'" class="page-link">'+a.text+"</a>")).click((function(t){return s._selectPage.call(r,e,t)})),a.classes&&i.addClass(a.classes),p.append(i),d.length?d.append(p):r.append(p)},_selectPage:function(e,t){var a=this.data("pagination");return a.currentPage=e,a.selectOnClick&&s._draw.call(this),a.onPageClick(e+1,t)}},n.fn.pagination=function(e){return s[e]&&"_"!=e.charAt(0)?s[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!==a(e)&&e?void n.error("Method "+e+" does not exist on jQuery.pagination"):s.init.apply(this,arguments)}}});