/* tablesorter pager plugin updated 6/18/2014 (v2.17.2) */ ;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(b,a){var c=b.cssDisabled,e=!!a,f=e||0===b.page,g=Math.min(b.totalPages,b.filteredPages),e=e||b.page===g-1||0===b.totalPages;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f?"addClass":"removeClass"](c).attr("aria-disabled", f),b.$container.find(b.cssNext+","+b.cssLast)[e?"addClass":"removeClass"](c).attr("aria-disabled",e))},t=function(b,a,c){var e,f,g,l=b.config;e=l.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=[];f=a.size||10;g=[l.widgetOptions&&l.widgetOptions.filter_filteredRow||"filtered",l.selectorRemove];a.countChildRows&&g.push(l.cssChildRow);g.join("|");a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=e?0:a.totalRows;a.filteredPages=a.totalPages;e&&(h.each(l.cache[0].normalized,function(d,b){a.filteredRows+= a.regexRows.test(b[l.columns].$row[0].className)?0:1}),a.filteredPages=Math.ceil(a.filteredRows/f)||0);if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),e=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(d,b){return a.totalPages?a.page+(b?parseInt(b, 10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(d){d=d.replace(/[{}\s]/g,"");var b=d.split(":"),c=a.ajaxData,e=/(rows?|pages?)$/i.test(d)?0:"";return 1"+e+"";a.$goto.html(g).val(a.page+1)}p(a);a.initialized&&!1!==c&&(l.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b, a.storageKey,{page:a.page,size:a.size}))},u=function(b,a){var c,e=b.config,f=e.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=h.data(b,"pagerSavedHeight"))&&(c-=f.height(),5'))},z=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b, "pagerSavedHeight",c.height());u(b,a);h.data(b,"pagerLastSize",a.size)},v=function(b,a){if(!a.ajaxUrl){var c,e=0,f=b.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,d=a.page*a.size,m=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",r=0;for(c=0;c=d&&r";for(f=0;f"+e[g][f]+"";p+=""}c.processAjaxOnInit&&s.$tbodies.eq(0).html(p)}c.processAjaxOnInit=!0;n&&n.length===b&&(m=(l= q.hasClass("hasStickyHeaders"))?s.widgetOptions.$sticky.children("thead:first").children("tr").children():"",d=q.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(a){var b=h(this),c;b.find("."+k.css.icon).length?(c=b.find("."+k.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(n[a]).append(c),l&&m.length&&(c=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(c))):(b.find(".tablesorter-header-inner").html(n[a]),l&&m.length&& m.eq(a).find(".tablesorter-header-inner").html(n[a]));d.eq(a).html(n[a])}))}s.showProcessing&&k.isProcessing(a);c.totalPages=Math.ceil(c.totalRows/(c.size||10));c.last.totalRows=c.totalRows;c.last.currentFilters=c.currentFilters;c.last.sortList=(s.sortList||[]).join(",");t(a,c);u(a,c);q.trigger("updateCache",[function(){c.initialized&&setTimeout(function(){q.trigger("applyWidgets").trigger("pagerChange",c)},0)}])}c.initialized||(c.initialized=!0,h(a).trigger("applyWidgets").trigger("pagerInitialized", c))},G=function(b,a){var c=F(b,a),e=h(document),f,g=b.config;""!==c&&(g.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager",function(c,d,f,g){B(null,b,a,d,g);e.unbind("ajaxError.pager")}),f=++a.ajaxCounter,a.ajaxObject.url=c,a.ajaxObject.success=function(c,d,g){f(a&&a.length||0))){c.page>=c.totalPages&&C(b,c);c.isDisabled=!1;c.initialized&&d.trigger("pagerChange",c);if(c.removeRows){k.clearTableBody(b);e=k.processTbody(b,e.$tbodies.eq(0), !0);f=m?0:n;g=m?0:n;for(l=0;ln&&l<=r&&(l++,e.append(a[f]))),f++;k.processTbody(b,e,!1)}else v(b,c);t(b,c);c.isDisabled||u(b,c);d.trigger("applyWidgets");b.isUpdating&&d.trigger("updateComplete",b)}},D=function(b,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(b,"pagerLastPage",a.page),h.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(), x(b,b.config.rowsCopy,a),b.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).each(function(){h(this).attr("aria-disabled","true").addClass(a.cssDisabled)[0].disabled=!0})},q=function(b,a,c){if(!a.isDisabled){var e=b.config,f=h(b),g=a.last,l=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>l-1&&0!==l&&(a.page=l-1);g.currentFilters=""===(g.currentFilters||[]).join("")?[]:g.currentFilters;a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters;if(g.page!== a.page||g.size!==a.size||g.totalRows!==a.totalRows||(g.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||g.sortList!==(e.sortList||[]).join(","))e.debug&&k.log("Pager changing to page "+a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[]},a.ajax?G(b,a):a.ajax||x(b,e.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(f.trigger("pageMoved",a).trigger("applyWidgets"),b.isUpdating&&f.trigger("updateComplete"))}}, y=function(b,a,c){c.size=a||c.size||10;c.$size.val(c.size);h.data(b,"pagerLastPage",c.page);h.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);c.filteredPages=Math.ceil(c.filteredRows/c.size);q(b,c)},H=function(b,a){a.page=0;q(b,a)},C=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;q(b,a)},I=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);q(b,a)},J=function(b,a){a.page--;0>=a.page&&(a.page= 0);q(b,a)},E=function(b,a,c){var e,f=b.config;a.$size.add(a.$goto).removeClass(a.cssDisabled).removeAttr("disabled").attr("aria-disabled","false");a.isDisabled=!1;a.page=h.data(b,"pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")||parseInt(a.$size.find("option[selected]").val(),10)||a.size||10;a.$size.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalRows,a.filteredRows)/a.size);b.id&&(e=b.id+"_pager_info",a.$container.find(a.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby", e));c&&(f.$table.trigger("updateRows"),y(b,a.size,a),A(b,a),u(b,a),f.debug&&k.log("pager enabled"))};w.appender=function(b,a){var c=b.config,e=c.pager;e.ajax||(c.rowsCopy=a,e.totalRows=e.countChildRows?c.$tbodies.eq(0).children("tr").length:a.length,e.size=h.data(b,"pagerLastSize")||e.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),x(b,a,e),t(b,e,!1))};w.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,e,f=this,g=f.config,l=g.widgetOptions,d=g.pager= h.extend(!0,{},h.tablesorterPager.defaults,b),m=g.$table,n=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;g.appender=w.appender;k.filter&&0<=h.inArray("filter",g.widgets)&&(d.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,d.currentFilters,!1));d.savePages&&k.storage&&(a=k.storage(f,d.storageKey)||{},d.page=isNaN(a.page)?d.page:a.page, d.size=(isNaN(a.size)?d.size:a.size)||10,h.data(f,"pagerLastSize",d.size));d.regexRows=new RegExp("("+(l.filter_filteredRow||"filtered")+"|"+g.selectorRemove.substring(1)+"|"+g.cssChildRow+")");m.unbind("filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b;!1!==d.pageReset&&(g.lastCombinedFilter||"")!==(b||[]).join("")&&(d.page=d.pageReset)}).bind("filterEnd.pager sortEnd.pager", function(){d.initialized&&(t(f,d,!1),q(f,d,!1),u(f,d))}).bind("disable.pager",function(a){a.stopPropagation();D(f,d)}).bind("enable.pager",function(a){a.stopPropagation();E(f,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();D(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;delete f.config.rowsCopy;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,d.storageKey,"")}).bind("update.pager updateRows.pager updateAll.pager addRows.pager ", function(a){a.stopPropagation();u(f,d);a=g.$tbodies.eq(0).children("tr");d.totalRows=a.length-(d.countChildRows?0:a.filter("."+g.cssChildRow).length);d.totalPages=Math.ceil(d.totalRows/d.size);t(f,d);v(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();y(f,parseInt(b,10)||10,d);v(f,d);t(f,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);q(f,d);t(f,d,!1)});c=[d.cssFirst,d.cssPrev, d.cssNext,d.cssLast];e=[H,J,I,C];n.find(c.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var b=h(this),g=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;a/.test(p)?h(p):h(''+p+"")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^[.#]/,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery);