diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index ffb96145..cb1eb37b 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -114,7 +114,7 @@ }; - var pagerEvents = 'filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete ' + + var pagerEvents = 'filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete ' + 'pageSize pageSet pageAndSize pagerUpdate refreshComplete ', $this = this, @@ -909,15 +909,15 @@ c.$table.trigger('applyWidgets'); } }) - .bind('disable' + namespace, function(e){ + .bind('disablePager' + namespace, function(e){ e.stopPropagation(); showAllRows(table, p); }) - .bind('enable' + namespace, function(e){ + .bind('enablePager' + namespace, function(e){ e.stopPropagation(); enablePager(table, p, true); }) - .bind('destroy' + namespace, function(e){ + .bind('destroyPager' + namespace, function(e){ e.stopPropagation(); destroyPager(table, p); }) diff --git a/dist/js/extras/jquery.tablesorter.pager.min.js b/dist/js/extras/jquery.tablesorter.pager.min.js index 4ab8b46f..1d2f03b1 100644 --- a/dist/js/extras/jquery.tablesorter.pager.min.js +++ b/dist/js/extras/jquery.tablesorter.pager.min.js @@ -2,4 +2,4 @@ * tablesorter (FORK) pager plugin * updated 7/28/2015 (v2.22.4) */ -!function(a){"use strict";var b=a.tablesorter;a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(a,b){return b},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(a){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,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 c="filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete ",d=this,e=function(a,b){var c="addClass",d="removeClass",e=a.cssDisabled,f=!!b,g=f||0===a.page,h=Math.min(a.totalPages,a.filteredPages),i=f||a.page===h-1||0===h;a.updateArrows&&(a.$container.find(a.cssFirst+","+a.cssPrev)[g?c:d](e).attr("aria-disabled",g),a.$container.find(a.cssNext+","+a.cssLast)[i?c:d](e).attr("aria-disabled",i))},f=function(a,c){var d,e,f,g=a.config,h=g.$table.hasClass("hasFilters");if(h&&!c.ajaxUrl)if(b.isEmptyObject(g.cache))c.filteredRows=c.totalRows=g.$tbodies.eq(0).children("tr").not(c.countChildRows?"":"."+g.cssChildRow).length;else for(c.filteredRows=0,d=g.cache[0].normalized,f=d.length,e=0;f>e;e++)c.filteredRows+=c.regexRows.test(d[e][g.columns].$row[0].className)?0:1;else h||(c.filteredRows=c.totalRows)},g=function(c,d,g){if(!d.initializing){var j,k,l,m,n,o,p=c.config,q=p.namespace+"pager",r=d.size||d.settings.size||10;if(d.countChildRows&&k.push(p.cssChildRow),d.totalPages=Math.ceil(d.totalRows/r),p.totalRows=d.totalRows,f(c,d),p.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/r)||0,Math.min(d.totalPages,d.filteredPages)>=0){if(k=d.size*d.page>d.filteredRows&&g,d.page=k?d.pageReset||0:d.page,d.startRow=k?d.size*d.page+1:0===d.filteredRows?0:d.size*d.page+1,d.endRow=Math.min(d.filteredRows,d.totalRows,d.size*(d.page+1)),l=d.$container.find(d.cssPageDisplay),j=(d.ajaxData&&d.ajaxData.output?d.ajaxData.output||d.output:d.output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return d.totalPages?d.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,e=a.replace(/[{}\s]/g,""),f=e.split(":"),g=d.ajaxData,h=/(rows?|pages?)$/i.test(e)?0:"";return/(startRow|page)/.test(f[0])&&"input"===f[1]?(b=(""+("page"===f[0]?d.totalPages:d.totalRows)).length,c="page"===f[0]?d.page+1:d.startRow,''):f.length>1&&g&&g[f[0]]?g[f[0]][f[1]]:d[e]||(g?g[e]:h)||h}),d.$goto.length){for(k="",o=h(d),n=o.length,m=0;n>m;m++)k+='";d.$goto.html(k).val(d.page+1)}l.length&&(l["INPUT"===l[0].nodeName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change"+q).bind("change"+q,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;p.$table.trigger("pageSet"+q,[c])}))}e(d),i(c,d),d.initialized&&g!==!1&&(p.debug&&console.log("Pager: Triggering pagerComplete"),p.$table.trigger("pagerComplete",d),d.savePages&&b.storage&&b.storage(c,d.storageKey,{page:d.page,size:d.size}))}},h=function(b){var c,d,e,f,g,h,i=Math.min(b.totalPages,b.filteredPages)||1,j=5*Math.ceil(i/b.maxOptionSize/5),k=i>b.maxOptionSize,l=b.page+1,m=j,n=i-j,o=[1],p=k?j:1;for(c=p;i>=c;)o.push(c),c+=k?j:1;if(o.push(i),k){for(e=[],d=Math.max(Math.floor(b.maxOptionSize/j)-1,5),m=l-d,1>m&&(m=1),n=l+d,n>i&&(n=i),c=m;n>=c;c++)e.push(c);o=a.grep(o,function(b,c){return a.inArray(b,o)===c}),g=o.length,h=e.length,g-h>j/2&&g+h>b.maxOptionSize&&(f=Math.floor(g/2)-Math.floor(h/2),Array.prototype.splice.apply(o,[f,h])),o=o.concat(e)}return o=a.grep(o,function(b,c){return a.inArray(b,o)===c}).sort(function(a,b){return a-b})},i=function(b,c){var d,e,f=b.config,g=f.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),c.fixedHeight&&!c.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-g.height(),d>5&&a.data(b,"pagerLastSize")===c.size&&g.children("tr:visible").length')))},j=function(b,c){var d,e=b.config,f=e.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),d=f.children("tr").eq(0).height()*c.size,a.data(b,"pagerSavedHeight",d),i(b,c),a.data(b,"pagerLastSize",c.size)},k=function(a,c){if(!c.ajaxUrl){var d,e=0,f=a.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,i=c.page*c.size,j=i+c.size,k=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",l=0,m=0;for(c.cacheIndex=[],d=0;h>d;d++)g[d].className.match(k)||(m===i&&g[d].className.match(f.cssChildRow)?g[d].style.display="none":(g[d].style.display=m>=i&&j>m?"":"none",l!==m&&m>=i&&j>m&&(c.cacheIndex.push(d),l=m),m+=g[d].className.match(f.cssChildRow+"|"+f.selectorRemove.slice(1))&&!c.countChildRows?0:1,m===j&&"none"!==g[d].style.display&&g[d].className.match(b.css.cssHasChild)&&(e=d)));if(e>0&&g[e].className.match(b.css.cssHasChild))for(;++e> Ajax Error",f,h),b.showError(d,0===f.status?"Not connected, verify Network":404===f.status?"Requested page not found [404]":500===f.status?"Internal Server Error [500]":"parsererror"===h?"Requested JSON parse failed":"timeout"===h?"Time out error":"abort"===h?"Ajax Request aborted":"Uncaught error: "+f.statusText+" ["+f.status+"]"),w.$tbodies.eq(0).children("tr").detach(),e.totalRows=0;else{if(a.isArray(z)?(k=isNaN(z[0])&&!isNaN(z[1]),u=z[k?1:0],e.totalRows=isNaN(u)?e.totalRows||0:u,w.totalRows=w.filteredRows=e.filteredRows=e.totalRows,s=0===e.totalRows?[]:z[k?0:1]||[],r=z[2]):(e.ajaxData=z,w.totalRows=e.totalRows=z.total,w.filteredRows=e.filteredRows="undefined"!=typeof z.filteredRows?z.filteredRows:z.total,r=z.headers,s=z.rows||[]),t=s&&s.length,s instanceof jQuery)e.processAjaxOnInit&&(w.$tbodies.eq(0).children("tr").detach(),w.$tbodies.eq(0).append(s));else if(t){for(i=0;t>i;i++){for(y+="",j=0;j"+s[i][j]+"";y+=""}e.processAjaxOnInit&&w.$tbodies.eq(0).html(y)}if(e.processAjaxOnInit=!0,r&&r.length===A)for(l=x.hasClass("hasStickyHeaders"),n=l?w.widgetOptions.$sticky.children("thead:first").children("tr").children():"",m=x.find("tfoot tr:first").children(),o=w.$headers.filter("th "),v=o.length,j=0;v>j;j++)p=o.eq(j),p.find("."+b.css.icon).length?(q=p.find("."+b.css.icon).clone(!0),p.find(".tablesorter-header-inner").html(r[j]).append(q),l&&n.length&&(q=n.eq(j).find("."+b.css.icon).clone(!0),n.eq(j).find(".tablesorter-header-inner").html(r[j]).append(q))):(p.find(".tablesorter-header-inner").html(r[j]),l&&n.length&&n.eq(j).find(".tablesorter-header-inner").html(r[j])),m.eq(j).html(r[j])}w.showProcessing&&b.isProcessing(d),e.totalPages=Math.ceil(e.totalRows/(e.size||e.settings.size||10)),e.last.totalRows=e.totalRows,e.last.currentFilters=e.currentFilters,e.last.sortList=(w.sortList||[]).join(","),g(d,e,!1),x.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){w.debug&&console.log("Pager: Triggering pagerChange"),x.trigger("applyWidgets").trigger("pagerChange",e),g(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,d.config.debug&&console.log("Pager: Triggering pagerInitialized"),a(d).trigger("applyWidgets").trigger("pagerInitialized",e),g(d,e))},n=function(c,d){var e,f=o(c,d),g=a(document),h=c.config,i=h.namespace+"pager";""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError"+i,function(a,b,e,f){m(null,c,d,b,f),g.unbind("ajaxError"+i)}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){ed;d++)l.push(j+"["+h[d][0]+"]="+h[d][1]);g=g.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):j),l=[]}if(k){for(k=k[1],e=i.length,d=0;e>d;d++)i[d]&&l.push(k+"["+d+"]="+encodeURIComponent(i[d]));g=g.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):k),c.currentFilters=i}return"function"==typeof c.customAjaxUrl&&(g=c.customAjaxUrl(b,g)),f.debug&&console.log("Pager: Ajax url = "+g),g},p=function(c,d,e){var f,h,i,j,l=a(c),m=c.config,n=m.$table.hasClass("hasFilters"),o=d&&d.length||0,p=e.page*e.size,q=e.size;if(1>o)return void(m.debug&&console.warn("Pager: >> No rows for pager to render"));if(e.page>=e.totalPages&&v(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&(m.debug&&console.log("Pager: Triggering pagerChange"),l.trigger("pagerChange",e)),e.removeRows){for(b.clearTableBody(c),f=b.processTbody(c,m.$tbodies.eq(0),!0),h=n?0:p,i=n?0:p,j=0;q>j&&hp&&q>=j&&(j++,e.cacheIndex.push(h),f.append(d[h]))),h++;b.processTbody(c,f,!1)}else k(c,e);g(c,e),c.isUpdating&&(m.debug&&console.log("Pager: Triggering updateComplete"),l.trigger("updateComplete",[c,!0]))},q=function(b,c){var d,f,g;for(c.ajax?e(c,!0):(c.isDisabled=!0,a.data(b,"pagerLastPage",c.page),a.data(b,"pagerLastSize",c.size),c.page=0,c.size=c.totalRows,c.totalPages=1,a(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(b,b.config.rowsCopy,c),a(b).trigger("applyWidgets"),b.config.debug&&console.log("Pager: Disabled")),f=c.$size.add(c.$goto).add(c.$container.find(".ts-startRow, .ts-page")),g=f.length,d=0;g>d;d++)f.eq(d).attr("aria-disabled","true").addClass(c.cssDisabled)[0].disabled=!0},r=function(a){var b=a.config,c=b.pager;b.$table.trigger("updateCache",[function(){var d,e=[],f=a.config.cache[0].normalized;for(c.totalRows=f.length,d=0;dg-1&&0!==g&&(d.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,d.currentFilters=""===(d.currentFilters||[]).join("")?[]:d.currentFilters,(j.page!==d.page||j.size!==d.size||j.totalRows!==d.totalRows||(j.currentFilters||[]).join(",")!==(d.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(d.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(d.ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&console.log("Pager: Changing to page "+d.page),d.last={page:d.page,size:d.size,sortList:(h.sortList||[]).join(","),totalRows:d.totalRows,currentFilters:d.currentFilters||[],ajaxUrl:d.ajaxObject.url||"",optAjaxUrl:d.ajaxUrl||""},d.ajax?n(c,d):d.ajax||p(c,h.rowsCopy,d),a.data(c,"pagerLastPage",d.page),d.initialized&&e!==!1&&(h.debug&&console.log("Pager: Triggering pageMoved"),i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&(h.debug&&console.log("Pager: Triggering updateComplete"),i.trigger("updateComplete",[c,!0]))))))}},t=function(b,c,d){d.size=c||d.size||d.settings.size||10,d.$size.val(d.size),a.data(b,"pagerLastPage",d.page),a.data(b,"pagerLastSize",d.size),d.totalPages=Math.ceil(d.totalRows/d.size),d.filteredPages=Math.ceil(d.filteredRows/d.size),s(b,d)},u=function(a,b){b.page=0,s(a,b)},v=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1,s(a,b)},w=function(a,b){b.page++,b.page>=Math.min(b.totalPages,b.filteredPages)-1&&(b.page=Math.min(b.totalPages,b.filteredPages)-1),s(a,b)},x=function(a,b){b.page--,b.page<=0&&(b.page=0),s(a,b)},y=function(d,e){q(d,e),e.$container.hide();var f=d.config;f.appender=null,e.initialized=!1,delete f.rowsCopy,a(d).unbind(c.split(" ").join(f.namespace+"pager ").replace(/\s+/g," ")),b.storage&&b.storage(d,e.storageKey,"")},z=function(b,c,d){var e,f=b.config;c.$size.add(c.$goto).add(c.$container.find(".ts-startRow, .ts-page")).removeClass(c.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),c.isDisabled=!1,c.page=a.data(b,"pagerLastPage")||c.page||0,c.size=a.data(b,"pagerLastSize")||parseInt(c.$size.find("option[selected]").val(),10)||c.size||c.settings.size||10,c.$size.val(c.size),c.totalPages=Math.ceil(Math.min(c.totalRows,c.filteredRows)/c.size),b.id&&(e=b.id+"_pager_info",c.$container.find(c.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby",e)),j(b,c),d&&(f.$table.trigger("updateRows"),t(b,c.size,c),l(b,c),f.debug&&console.log("Pager: Enabled"))};d.appender=function(b,c){var d=b.config,e=d.pager;e.ajax||(d.rowsCopy=c,e.totalRows=e.countChildRows?d.$tbodies.eq(0).children("tr").length:c.length,e.size=a.data(b,"pagerLastSize")||e.size||e.settings.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),p(b,c,e),g(b,e,!1))},d.construct=function(e){return this.each(function(){if(this.config&&this.hasInitialized){var f,h,i,m=this,n=m.config,o=n.widgetOptions,p=n.pager=a.extend(!0,{},a.tablesorterPager.defaults,e),A=n.$table,B=n.namespace+"pager",C=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&console.log("Pager: Initializing"),p.oldAjaxSuccess=p.oldAjaxSuccess||p.ajaxObject.success,n.appender=d.appender,p.initializing=!0,p.savePages&&b.storage&&(f=b.storage(m,p.storageKey)||{},p.page=isNaN(f.page)?p.page:f.page,p.size=(isNaN(f.size)?p.size:f.size)||p.settings.size||10,a.data(m,"pagerLastSize",p.size)),p.regexRows=new RegExp("("+(o.filter_filteredRow||"filtered")+"|"+n.selectorRemove.slice(1)+"|"+n.cssChildRow+")"),A.unbind(c.split(" ").join(B+" ").replace(/\s+/g," ")).bind("filterInit filterStart ".split(" ").join(B+" "),function(b,c){p.currentFilters=a.isArray(c)?c:n.$table.data("lastSearch"),"filterStart"===b.type&&p.pageReset!==!1&&(n.lastCombinedFilter||"")!==(p.currentFilters||[]).join("")&&(p.page=p.pageReset)}).bind("filterEnd sortEnd ".split(" ").join(B+" "),function(){p.currentFilters=n.$table.data("lastSearch"),(p.initialized||p.initializing)&&(n.delayInit&&n.rowsCopy&&0===n.rowsCopy.length&&r(m),g(m,p,!1),s(m,p,!1),n.$table.trigger("applyWidgets"))}).bind("disable"+B,function(a){a.stopPropagation(),q(m,p)}).bind("enable"+B,function(a){a.stopPropagation(),z(m,p,!0)}).bind("destroy"+B,function(a){a.stopPropagation(),y(m,p)}).bind("updateComplete"+B,function(a,b,c){if(a.stopPropagation(),b&&!c&&!p.ajax){var d=n.$tbodies.eq(0).children("tr").not(n.selectorRemove);p.totalRows=d.length-(p.countChildRows?0:d.filter("."+n.cssChildRow).length),p.totalPages=Math.ceil(p.totalRows/p.size),d.length&&n.rowsCopy&&0===n.rowsCopy.length&&r(b),p.page>=p.totalPages&&v(b,p),k(b,p),j(b,p),g(b,p,!0)}}).bind("pageSize refreshComplete ".split(" ").join(B+" "),function(a,b){a.stopPropagation(),t(m,parseInt(b,10)||p.settings.size||10,p),k(m,p),g(m,p,!1)}).bind("pageSet pagerUpdate ".split(" ").join(B+" "),function(a,b){a.stopPropagation(),"pagerUpdate"===a.type&&(b="undefined"==typeof b?p.page+1:b,p.last.page=!0),p.page=(parseInt(b,10)||1)-1,s(m,p,!0),g(m,p,!1)}).bind("pageAndSize"+B,function(a,b,c){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,t(m,parseInt(c,10)||p.settings.size||10,p),s(m,p,!0),k(m,p),g(m,p,!1)}),h=[p.cssFirst,p.cssPrev,p.cssNext,p.cssLast],i=[u,x,w,v],n.debug&&!C.length&&console.warn("Pager: >> Container not found"),C.find(h.join(",")).attr("tabindex",0).unbind("click"+B).bind("click"+B,function(b){b.stopPropagation();var c,d=a(this),e=h.length;if(!d.hasClass(p.cssDisabled))for(c=0;e>c;c++)if(d.is(h[c])){i[c](m,p);break}}),p.$goto=C.find(p.cssGoto),p.$goto.length?p.$goto.unbind("change"+B).bind("change"+B,function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}):n.debug&&console.warn("Pager: >> Goto selector not found"),p.$size=C.find(p.cssPageSize),p.$size.length?(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change"+B).bind("change"+B,function(){return p.$size.val(a(this).val()),a(this).hasClass(p.cssDisabled)||(t(m,parseInt(a(this).val(),10),p),j(m,p)),!1})):n.debug&&console.warn("Pager: >> Size selector not found"),p.initialized=!1,A.trigger("pagerBeforeInitialized",p),z(m,p,!1),"string"==typeof p.ajaxUrl?(p.ajax=!0,n.widgetOptions.filter_serversideFiltering=!0,n.serverSideSorting=!0,s(m,p)):(p.ajax=!1,a(this).trigger("appendCache",!0),l(m,p)),p.ajax||p.initialized||(p.initializing=!1,p.initialized=!0,s(m,p),n.debug&&console.log("Pager: Triggering pagerInitialized"),n.$table.trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1)),n.widgetInit.pager=!0}})}}}),b.showError=function(b,c){var d,e,f,g,h=a(b),i=h.length;for(d=0;i>d;d++)f=h[d].config,f&&(g=f.pager&&f.pager.cssErrorRow||f.widgetOptions.pager_css&&f.widgetOptions.pager_css.errorRow||"tablesorter-errorRow","undefined"==typeof c?f.$table.find("thead").find(f.selectorRemove).remove():e=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(f.$table.find("thead:first")).addClass(g+" "+f.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))},a.fn.extend({tablesorterPager:a.tablesorterPager.construct})}(jQuery); \ No newline at end of file +!function(a){"use strict";var b=a.tablesorter;a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(a,b){return b},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(a){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,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 c="filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete ",d=this,e=function(a,b){var c="addClass",d="removeClass",e=a.cssDisabled,f=!!b,g=f||0===a.page,h=Math.min(a.totalPages,a.filteredPages),i=f||a.page===h-1||0===h;a.updateArrows&&(a.$container.find(a.cssFirst+","+a.cssPrev)[g?c:d](e).attr("aria-disabled",g),a.$container.find(a.cssNext+","+a.cssLast)[i?c:d](e).attr("aria-disabled",i))},f=function(a,c){var d,e,f,g=a.config,h=g.$table.hasClass("hasFilters");if(h&&!c.ajaxUrl)if(b.isEmptyObject(g.cache))c.filteredRows=c.totalRows=g.$tbodies.eq(0).children("tr").not(c.countChildRows?"":"."+g.cssChildRow).length;else for(c.filteredRows=0,d=g.cache[0].normalized,f=d.length,e=0;f>e;e++)c.filteredRows+=c.regexRows.test(d[e][g.columns].$row[0].className)?0:1;else h||(c.filteredRows=c.totalRows)},g=function(c,d,g){if(!d.initializing){var j,k,l,m,n,o,p=c.config,q=p.namespace+"pager",r=d.size||d.settings.size||10;if(d.countChildRows&&k.push(p.cssChildRow),d.totalPages=Math.ceil(d.totalRows/r),p.totalRows=d.totalRows,f(c,d),p.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/r)||0,Math.min(d.totalPages,d.filteredPages)>=0){if(k=d.size*d.page>d.filteredRows&&g,d.page=k?d.pageReset||0:d.page,d.startRow=k?d.size*d.page+1:0===d.filteredRows?0:d.size*d.page+1,d.endRow=Math.min(d.filteredRows,d.totalRows,d.size*(d.page+1)),l=d.$container.find(d.cssPageDisplay),j=(d.ajaxData&&d.ajaxData.output?d.ajaxData.output||d.output:d.output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return d.totalPages?d.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,e=a.replace(/[{}\s]/g,""),f=e.split(":"),g=d.ajaxData,h=/(rows?|pages?)$/i.test(e)?0:"";return/(startRow|page)/.test(f[0])&&"input"===f[1]?(b=(""+("page"===f[0]?d.totalPages:d.totalRows)).length,c="page"===f[0]?d.page+1:d.startRow,''):f.length>1&&g&&g[f[0]]?g[f[0]][f[1]]:d[e]||(g?g[e]:h)||h}),d.$goto.length){for(k="",o=h(d),n=o.length,m=0;n>m;m++)k+='";d.$goto.html(k).val(d.page+1)}l.length&&(l["INPUT"===l[0].nodeName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change"+q).bind("change"+q,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;p.$table.trigger("pageSet"+q,[c])}))}e(d),i(c,d),d.initialized&&g!==!1&&(p.debug&&console.log("Pager: Triggering pagerComplete"),p.$table.trigger("pagerComplete",d),d.savePages&&b.storage&&b.storage(c,d.storageKey,{page:d.page,size:d.size}))}},h=function(b){var c,d,e,f,g,h,i=Math.min(b.totalPages,b.filteredPages)||1,j=5*Math.ceil(i/b.maxOptionSize/5),k=i>b.maxOptionSize,l=b.page+1,m=j,n=i-j,o=[1],p=k?j:1;for(c=p;i>=c;)o.push(c),c+=k?j:1;if(o.push(i),k){for(e=[],d=Math.max(Math.floor(b.maxOptionSize/j)-1,5),m=l-d,1>m&&(m=1),n=l+d,n>i&&(n=i),c=m;n>=c;c++)e.push(c);o=a.grep(o,function(b,c){return a.inArray(b,o)===c}),g=o.length,h=e.length,g-h>j/2&&g+h>b.maxOptionSize&&(f=Math.floor(g/2)-Math.floor(h/2),Array.prototype.splice.apply(o,[f,h])),o=o.concat(e)}return o=a.grep(o,function(b,c){return a.inArray(b,o)===c}).sort(function(a,b){return a-b})},i=function(b,c){var d,e,f=b.config,g=f.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),c.fixedHeight&&!c.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-g.height(),d>5&&a.data(b,"pagerLastSize")===c.size&&g.children("tr:visible").length')))},j=function(b,c){var d,e=b.config,f=e.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),d=f.children("tr").eq(0).height()*c.size,a.data(b,"pagerSavedHeight",d),i(b,c),a.data(b,"pagerLastSize",c.size)},k=function(a,c){if(!c.ajaxUrl){var d,e=0,f=a.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,i=c.page*c.size,j=i+c.size,k=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",l=0,m=0;for(c.cacheIndex=[],d=0;h>d;d++)g[d].className.match(k)||(m===i&&g[d].className.match(f.cssChildRow)?g[d].style.display="none":(g[d].style.display=m>=i&&j>m?"":"none",l!==m&&m>=i&&j>m&&(c.cacheIndex.push(d),l=m),m+=g[d].className.match(f.cssChildRow+"|"+f.selectorRemove.slice(1))&&!c.countChildRows?0:1,m===j&&"none"!==g[d].style.display&&g[d].className.match(b.css.cssHasChild)&&(e=d)));if(e>0&&g[e].className.match(b.css.cssHasChild))for(;++e> Ajax Error",f,h),b.showError(d,0===f.status?"Not connected, verify Network":404===f.status?"Requested page not found [404]":500===f.status?"Internal Server Error [500]":"parsererror"===h?"Requested JSON parse failed":"timeout"===h?"Time out error":"abort"===h?"Ajax Request aborted":"Uncaught error: "+f.statusText+" ["+f.status+"]"),w.$tbodies.eq(0).children("tr").detach(),e.totalRows=0;else{if(a.isArray(z)?(k=isNaN(z[0])&&!isNaN(z[1]),u=z[k?1:0],e.totalRows=isNaN(u)?e.totalRows||0:u,w.totalRows=w.filteredRows=e.filteredRows=e.totalRows,s=0===e.totalRows?[]:z[k?0:1]||[],r=z[2]):(e.ajaxData=z,w.totalRows=e.totalRows=z.total,w.filteredRows=e.filteredRows="undefined"!=typeof z.filteredRows?z.filteredRows:z.total,r=z.headers,s=z.rows||[]),t=s&&s.length,s instanceof jQuery)e.processAjaxOnInit&&(w.$tbodies.eq(0).children("tr").detach(),w.$tbodies.eq(0).append(s));else if(t){for(i=0;t>i;i++){for(y+="",j=0;j"+s[i][j]+"";y+=""}e.processAjaxOnInit&&w.$tbodies.eq(0).html(y)}if(e.processAjaxOnInit=!0,r&&r.length===A)for(l=x.hasClass("hasStickyHeaders"),n=l?w.widgetOptions.$sticky.children("thead:first").children("tr").children():"",m=x.find("tfoot tr:first").children(),o=w.$headers.filter("th "),v=o.length,j=0;v>j;j++)p=o.eq(j),p.find("."+b.css.icon).length?(q=p.find("."+b.css.icon).clone(!0),p.find(".tablesorter-header-inner").html(r[j]).append(q),l&&n.length&&(q=n.eq(j).find("."+b.css.icon).clone(!0),n.eq(j).find(".tablesorter-header-inner").html(r[j]).append(q))):(p.find(".tablesorter-header-inner").html(r[j]),l&&n.length&&n.eq(j).find(".tablesorter-header-inner").html(r[j])),m.eq(j).html(r[j])}w.showProcessing&&b.isProcessing(d),e.totalPages=Math.ceil(e.totalRows/(e.size||e.settings.size||10)),e.last.totalRows=e.totalRows,e.last.currentFilters=e.currentFilters,e.last.sortList=(w.sortList||[]).join(","),g(d,e,!1),x.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){w.debug&&console.log("Pager: Triggering pagerChange"),x.trigger("applyWidgets").trigger("pagerChange",e),g(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,d.config.debug&&console.log("Pager: Triggering pagerInitialized"),a(d).trigger("applyWidgets").trigger("pagerInitialized",e),g(d,e))},n=function(c,d){var e,f=o(c,d),g=a(document),h=c.config,i=h.namespace+"pager";""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError"+i,function(a,b,e,f){m(null,c,d,b,f),g.unbind("ajaxError"+i)}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){ed;d++)l.push(j+"["+h[d][0]+"]="+h[d][1]);g=g.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):j),l=[]}if(k){for(k=k[1],e=i.length,d=0;e>d;d++)i[d]&&l.push(k+"["+d+"]="+encodeURIComponent(i[d]));g=g.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):k),c.currentFilters=i}return"function"==typeof c.customAjaxUrl&&(g=c.customAjaxUrl(b,g)),f.debug&&console.log("Pager: Ajax url = "+g),g},p=function(c,d,e){var f,h,i,j,l=a(c),m=c.config,n=m.$table.hasClass("hasFilters"),o=d&&d.length||0,p=e.page*e.size,q=e.size;if(1>o)return void(m.debug&&console.warn("Pager: >> No rows for pager to render"));if(e.page>=e.totalPages&&v(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&(m.debug&&console.log("Pager: Triggering pagerChange"),l.trigger("pagerChange",e)),e.removeRows){for(b.clearTableBody(c),f=b.processTbody(c,m.$tbodies.eq(0),!0),h=n?0:p,i=n?0:p,j=0;q>j&&hp&&q>=j&&(j++,e.cacheIndex.push(h),f.append(d[h]))),h++;b.processTbody(c,f,!1)}else k(c,e);g(c,e),c.isUpdating&&(m.debug&&console.log("Pager: Triggering updateComplete"),l.trigger("updateComplete",[c,!0]))},q=function(b,c){var d,f,g;for(c.ajax?e(c,!0):(c.isDisabled=!0,a.data(b,"pagerLastPage",c.page),a.data(b,"pagerLastSize",c.size),c.page=0,c.size=c.totalRows,c.totalPages=1,a(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(b,b.config.rowsCopy,c),a(b).trigger("applyWidgets"),b.config.debug&&console.log("Pager: Disabled")),f=c.$size.add(c.$goto).add(c.$container.find(".ts-startRow, .ts-page")),g=f.length,d=0;g>d;d++)f.eq(d).attr("aria-disabled","true").addClass(c.cssDisabled)[0].disabled=!0},r=function(a){var b=a.config,c=b.pager;b.$table.trigger("updateCache",[function(){var d,e=[],f=a.config.cache[0].normalized;for(c.totalRows=f.length,d=0;dg-1&&0!==g&&(d.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,d.currentFilters=""===(d.currentFilters||[]).join("")?[]:d.currentFilters,(j.page!==d.page||j.size!==d.size||j.totalRows!==d.totalRows||(j.currentFilters||[]).join(",")!==(d.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(d.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(d.ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&console.log("Pager: Changing to page "+d.page),d.last={page:d.page,size:d.size,sortList:(h.sortList||[]).join(","),totalRows:d.totalRows,currentFilters:d.currentFilters||[],ajaxUrl:d.ajaxObject.url||"",optAjaxUrl:d.ajaxUrl||""},d.ajax?n(c,d):d.ajax||p(c,h.rowsCopy,d),a.data(c,"pagerLastPage",d.page),d.initialized&&e!==!1&&(h.debug&&console.log("Pager: Triggering pageMoved"),i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&(h.debug&&console.log("Pager: Triggering updateComplete"),i.trigger("updateComplete",[c,!0]))))))}},t=function(b,c,d){d.size=c||d.size||d.settings.size||10,d.$size.val(d.size),a.data(b,"pagerLastPage",d.page),a.data(b,"pagerLastSize",d.size),d.totalPages=Math.ceil(d.totalRows/d.size),d.filteredPages=Math.ceil(d.filteredRows/d.size),s(b,d)},u=function(a,b){b.page=0,s(a,b)},v=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1,s(a,b)},w=function(a,b){b.page++,b.page>=Math.min(b.totalPages,b.filteredPages)-1&&(b.page=Math.min(b.totalPages,b.filteredPages)-1),s(a,b)},x=function(a,b){b.page--,b.page<=0&&(b.page=0),s(a,b)},y=function(d,e){q(d,e),e.$container.hide();var f=d.config;f.appender=null,e.initialized=!1,delete f.rowsCopy,a(d).unbind(c.split(" ").join(f.namespace+"pager ").replace(/\s+/g," ")),b.storage&&b.storage(d,e.storageKey,"")},z=function(b,c,d){var e,f=b.config;c.$size.add(c.$goto).add(c.$container.find(".ts-startRow, .ts-page")).removeClass(c.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),c.isDisabled=!1,c.page=a.data(b,"pagerLastPage")||c.page||0,c.size=a.data(b,"pagerLastSize")||parseInt(c.$size.find("option[selected]").val(),10)||c.size||c.settings.size||10,c.$size.val(c.size),c.totalPages=Math.ceil(Math.min(c.totalRows,c.filteredRows)/c.size),b.id&&(e=b.id+"_pager_info",c.$container.find(c.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby",e)),j(b,c),d&&(f.$table.trigger("updateRows"),t(b,c.size,c),l(b,c),f.debug&&console.log("Pager: Enabled"))};d.appender=function(b,c){var d=b.config,e=d.pager;e.ajax||(d.rowsCopy=c,e.totalRows=e.countChildRows?d.$tbodies.eq(0).children("tr").length:c.length,e.size=a.data(b,"pagerLastSize")||e.size||e.settings.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),p(b,c,e),g(b,e,!1))},d.construct=function(e){return this.each(function(){if(this.config&&this.hasInitialized){var f,h,i,m=this,n=m.config,o=n.widgetOptions,p=n.pager=a.extend(!0,{},a.tablesorterPager.defaults,e),A=n.$table,B=n.namespace+"pager",C=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&console.log("Pager: Initializing"),p.oldAjaxSuccess=p.oldAjaxSuccess||p.ajaxObject.success,n.appender=d.appender,p.initializing=!0,p.savePages&&b.storage&&(f=b.storage(m,p.storageKey)||{},p.page=isNaN(f.page)?p.page:f.page,p.size=(isNaN(f.size)?p.size:f.size)||p.settings.size||10,a.data(m,"pagerLastSize",p.size)),p.regexRows=new RegExp("("+(o.filter_filteredRow||"filtered")+"|"+n.selectorRemove.slice(1)+"|"+n.cssChildRow+")"),A.unbind(c.split(" ").join(B+" ").replace(/\s+/g," ")).bind("filterInit filterStart ".split(" ").join(B+" "),function(b,c){p.currentFilters=a.isArray(c)?c:n.$table.data("lastSearch"),"filterStart"===b.type&&p.pageReset!==!1&&(n.lastCombinedFilter||"")!==(p.currentFilters||[]).join("")&&(p.page=p.pageReset)}).bind("filterEnd sortEnd ".split(" ").join(B+" "),function(){p.currentFilters=n.$table.data("lastSearch"),(p.initialized||p.initializing)&&(n.delayInit&&n.rowsCopy&&0===n.rowsCopy.length&&r(m),g(m,p,!1),s(m,p,!1),n.$table.trigger("applyWidgets"))}).bind("disablePager"+B,function(a){a.stopPropagation(),q(m,p)}).bind("enablePager"+B,function(a){a.stopPropagation(),z(m,p,!0)}).bind("destroyPager"+B,function(a){a.stopPropagation(),y(m,p)}).bind("updateComplete"+B,function(a,b,c){if(a.stopPropagation(),b&&!c&&!p.ajax){var d=n.$tbodies.eq(0).children("tr").not(n.selectorRemove);p.totalRows=d.length-(p.countChildRows?0:d.filter("."+n.cssChildRow).length),p.totalPages=Math.ceil(p.totalRows/p.size),d.length&&n.rowsCopy&&0===n.rowsCopy.length&&r(b),p.page>=p.totalPages&&v(b,p),k(b,p),j(b,p),g(b,p,!0)}}).bind("pageSize refreshComplete ".split(" ").join(B+" "),function(a,b){a.stopPropagation(),t(m,parseInt(b,10)||p.settings.size||10,p),k(m,p),g(m,p,!1)}).bind("pageSet pagerUpdate ".split(" ").join(B+" "),function(a,b){a.stopPropagation(),"pagerUpdate"===a.type&&(b="undefined"==typeof b?p.page+1:b,p.last.page=!0),p.page=(parseInt(b,10)||1)-1,s(m,p,!0),g(m,p,!1)}).bind("pageAndSize"+B,function(a,b,c){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,t(m,parseInt(c,10)||p.settings.size||10,p),s(m,p,!0),k(m,p),g(m,p,!1)}),h=[p.cssFirst,p.cssPrev,p.cssNext,p.cssLast],i=[u,x,w,v],n.debug&&!C.length&&console.warn("Pager: >> Container not found"),C.find(h.join(",")).attr("tabindex",0).unbind("click"+B).bind("click"+B,function(b){b.stopPropagation();var c,d=a(this),e=h.length;if(!d.hasClass(p.cssDisabled))for(c=0;e>c;c++)if(d.is(h[c])){i[c](m,p);break}}),p.$goto=C.find(p.cssGoto),p.$goto.length?p.$goto.unbind("change"+B).bind("change"+B,function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}):n.debug&&console.warn("Pager: >> Goto selector not found"),p.$size=C.find(p.cssPageSize),p.$size.length?(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change"+B).bind("change"+B,function(){return p.$size.val(a(this).val()),a(this).hasClass(p.cssDisabled)||(t(m,parseInt(a(this).val(),10),p),j(m,p)),!1})):n.debug&&console.warn("Pager: >> Size selector not found"),p.initialized=!1,A.trigger("pagerBeforeInitialized",p),z(m,p,!1),"string"==typeof p.ajaxUrl?(p.ajax=!0,n.widgetOptions.filter_serversideFiltering=!0,n.serverSideSorting=!0,s(m,p)):(p.ajax=!1,a(this).trigger("appendCache",!0),l(m,p)),p.ajax||p.initialized||(p.initializing=!1,p.initialized=!0,s(m,p),n.debug&&console.log("Pager: Triggering pagerInitialized"),n.$table.trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1)),n.widgetInit.pager=!0}})}}}),b.showError=function(b,c){var d,e,f,g,h=a(b),i=h.length;for(d=0;i>d;d++)f=h[d].config,f&&(g=f.pager&&f.pager.cssErrorRow||f.widgetOptions.pager_css&&f.widgetOptions.pager_css.errorRow||"tablesorter-errorRow","undefined"==typeof c?f.$table.find("thead").find(f.selectorRemove).remove():e=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(f.$table.find("thead:first")).addClass(g+" "+f.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))},a.fn.extend({tablesorterPager:a.tablesorterPager.construct})}(jQuery); \ No newline at end of file diff --git a/dist/js/jquery.tablesorter.combined.js b/dist/js/jquery.tablesorter.combined.js index 090bade0..d04ffae2 100644 --- a/dist/js/jquery.tablesorter.combined.js +++ b/dist/js/jquery.tablesorter.combined.js @@ -1,4 +1,4 @@ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { diff --git a/dist/js/jquery.tablesorter.combined.min.js b/dist/js/jquery.tablesorter.combined.min.js index 5f866ddd..450e4fa6 100644 --- a/dist/js/jquery.tablesorter.combined.min.js +++ b/dist/js/jquery.tablesorter.combined.min.js @@ -1,4 +1,4 @@ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a){"use strict";a.extend({tablesorter:new function(){function b(b,c,d,e){for(var f,g,h=q.parsers.length,i=!1,j="",k=!0;""===j&&k;)d++,c[d]?(i=c[d].cells[e],j=q.getElementText(b,i,e),g=a(i),b.debug&&console.log("Checking if value was empty on row "+d+", column: "+e+': "'+j+'"')):k=!1;for(;--h>=0;)if(f=q.parsers[h],f&&"text"!==f.id&&f.is&&f.is(j,b.table,i,g))return f;return q.getParserById("text")}function c(a,c){var d,e,f,g,h,i,j,k,l,m,n,o,p=a.table,r=0,s={};if(a.$tbodies=a.$table.children("tbody:not(."+a.cssInfoBlock+")"),n="undefined"==typeof c?a.$tbodies:c,o=n.length,0===o)return a.debug?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(a.debug&&(m=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),e={extractors:[],parsers:[]};o>r;){if(d=n[r].rows,d.length)for(f=a.columns,g=0;f>g;g++)h=a.$headerIndexed[g],i=q.getColumnData(p,a.headers,g),l=q.getParserById(q.getData(h,i,"extractor")),k=q.getParserById(q.getData(h,i,"sorter")),j="false"===q.getData(h,i,"parser"),a.empties[g]=(q.getData(h,i,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top")).toLowerCase(),a.strings[g]=(q.getData(h,i,"string")||a.stringTo||"max").toLowerCase(),j&&(k=q.getParserById("no-parser")),l||(l=!1),k||(k=b(a,d,-1,g)),a.debug&&(s["("+g+") "+h.text()]={parser:k.id,extractor:l?l.id:"none",string:a.strings[g],empty:a.empties[g]}),e.parsers[g]=k,e.extractors[g]=l;r+=e.parsers.length?o:1}a.debug&&(q.isEmptyObject(s)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](s),console.log("Completed detecting parsers"+q.benchmark(m)),console.groupEnd&&console.groupEnd()),a.parsers=e.parsers,a.extractors=e.extractors}function d(b,c,d){var e,f,g,h,i,j,k,l,m,n,o,p,r,s,t=b.config,u=t.parsers;if(t.$tbodies=t.$table.children("tbody:not(."+t.cssInfoBlock+")"),k="undefined"==typeof d?t.$tbodies:d,t.cache={},t.totalRows=0,!u)return t.debug?console.warn("Warning: *Empty table!* Not building a cache"):"";for(t.debug&&(n=new Date),t.showProcessing&&q.isProcessing(b,!0),j=0;jh;++h)if(p={child:[],raw:[]},l=a(k[j].rows[h]),m=[],l.hasClass(t.cssChildRow)&&0!==h)for(f=e.normalized.length-1,r=e.normalized[f][t.columns],r.$row=r.$row.add(l),l.prev().hasClass(t.cssChildRow)||l.prev().addClass(q.css.cssHasChild),g=l.children("th, td"),f=r.child.length,r.child[f]=[],i=0;i':"",m.$headers=a(a.map(a(b).find(m.selectorHeaders),function(h,k){return d=a(h),d.parent().hasClass(m.cssIgnoreRow)?void 0:(c=q.getColumnData(b,m.headers,k,!0),m.headerContent[k]=d.html(),""===m.headerTemplate||d.find("."+q.css.headerIn).length||(i=m.headerTemplate.replace(/\{content\}/g,d.html()).replace(/\{icon\}/g,d.find("."+q.css.icon).length?"":g),m.onRenderTemplate&&(f=m.onRenderTemplate.apply(d,[k,i]),f&&"string"==typeof f&&(i=f)),d.html('
'+i+"
")),m.onRenderHeader&&m.onRenderHeader.apply(d,[k,m,m.$table]),h.column=parseInt(d.attr("data-column"),10),h.order=e(q.getData(d,c,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2],h.count=-1,h.lockedOrder=!1,j=q.getData(d,c,"lockedOrder")||!1,"undefined"!=typeof j&&j!==!1&&(h.order=h.lockedOrder=e(j)?[1,1,1]:[0,0,0]),d.addClass(q.css.header+" "+m.cssHeader),m.headerList[k]=h,d.parent().addClass(q.css.headerRow+" "+m.cssHeaderRow).attr("role","row"),m.tabIndex&&d.attr("tabindex",0),h)})),m.$headerIndexed=[],l=0;lb;b++)d=f.$headers.eq(b),e=q.getColumnData(a,f.headers,b,!0),c="false"===q.getData(d,e,"sorter")||"false"===q.getData(d,e,"parser"),d[0].sortDisabled=c,d[c?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+c),a.id&&(c?d.removeAttr("aria-controls"):d.attr("aria-controls",a.id))}function i(b){var c,d,e,f,g,h,i,j,k=b.config,l=k.sortList,m=l.length,n=q.css.sortNone+" "+k.cssNone,o=[q.css.sortAsc+" "+k.cssAsc,q.css.sortDesc+" "+k.cssDesc],p=[k.cssIconAsc,k.cssIconDesc,k.cssIconNone],r=["ascending","descending"],s=a(b).find("tfoot tr").children().add(a(k.namespace+"_extra_headers")).removeClass(o.join(" "));for(k.$headers.removeClass(o.join(" ")).addClass(n).attr("aria-sort","none").find("."+q.css.icon).removeClass(p.join(" ")).addClass(p[2]),e=0;m>e;e++)if(2!==l[e][1]&&(c=k.$headers.not(".sorter-false").filter('[data-column="'+l[e][0]+'"]'+(1===m?":last":"")),c.length)){for(f=0;fe;e++)h=g.eq(e),h.length&&(d=g[e],i=d.order[(d.count+1)%(k.sortReset?3:2)],j=a.trim(h.text())+": "+q.language[h.hasClass(q.css.sortAsc)?"sortAsc":h.hasClass(q.css.sortDesc)?"sortDesc":"sortNone"]+q.language[0===i?"nextAsc":1===i?"nextDesc":"nextNone"],h.attr("aria-label",j))}function j(b,c){var d,e,f,g,h,i,j,k,l=b.config,m=c||l.sortList,n=m.length;for(l.sortList=[],h=0;n>h;h++)if(k=m[h],d=parseInt(k[0],10),d=0?e:f[1]%(l.sortReset?3:2)}}function k(a,b){return a&&a[b]?a[b].type||"":""}function l(b,c,d){if(b.isUpdating)return setTimeout(function(){l(b,c,d)},50);var e,f,g,h,j,k,n,o=b.config,p=!d[o.sortMultiSortKey],r=o.$table,s=o.$headers.length;if(r.trigger("sortStart",b),c.count=d[o.sortResetKey]?2:(c.count+1)%(o.sortReset?3:2),o.sortRestart)for(f=c,g=0;s>g;g++)n=o.$headers.eq(g),n[0]===f||!p&&n.is("."+q.css.sortDesc+",."+q.css.sortAsc)||(n[0].count=-1);if(f=parseInt(a(c).attr("data-column"),10),p){if(o.sortList=[],null!==o.sortForce)for(e=o.sortForce,h=0;hj&&(o.sortList.push([f,j]),c.colSpan>1))for(h=1;h1)for(h=0;h=0&&o.sortList.splice(k,1);if(q.isValueInArray(f,o.sortList)>=0)for(h=0;hj&&(o.sortList.push([f,j]),c.colSpan>1))for(h=1;hc;c++)g=o.cache[c].colMax,h=o.cache[c].normalized,h.sort(function(c,f){for(b=0;s>b;b++){if(e=r[b][0],i=r[b][1],n=0===i,o.sortStable&&c[e]===f[e]&&1===s)return c[o.columns].order-f[o.columns].order;if(d=/n/i.test(k(o.parsers,e)),d&&o.strings[e]?(d="boolean"==typeof o.string[o.strings[e]]?(n?1:-1)*(o.string[o.strings[e]]?-1:1):o.strings[e]?o.string[o.strings[e]]||0:0,j=o.numberSorter?o.numberSorter(c[e],f[e],n,g[e],a):q["sortNumeric"+(n?"Asc":"Desc")](c[e],f[e],d,g[e],e,a)):(l=n?c:f,m=n?f:c,j="function"==typeof p?p(l[e],m[e],n,e,a):"object"==typeof p&&p.hasOwnProperty(e)?p[e](l[e],m[e],n,e,a):q["sortNatural"+(n?"Asc":"Desc")](c[e],f[e],e,a,o)),j)return j}return c[o.columns].order-f[o.columns].order});o.debug&&console.log("Sorting on "+r.toString()+" and dir "+i+" time"+q.benchmark(f))}}function n(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function o(b,c,d){var e=a.isArray(c)?c:b.sortList,f="undefined"==typeof c?b.resort:c;f===!1||b.serverSideSorting||b.table.isProcessing?(n(b,d),q.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){n(b,d)},!0]):b.$table.trigger("sortReset",[function(){n(b,d),q.applyWidget(b.table,!1)}])}function p(b){var c=b.config,d=c.$table,e="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");d.unbind(e.replace(/\s+/g," ")).bind("sortReset"+c.namespace,function(a,b){a.stopPropagation(),q.sortReset(this.config,b)}).bind("updateAll"+c.namespace,function(a,b,c){a.stopPropagation(),q.updateAll(this.config,b,c)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,b,c){a.stopPropagation(),q.update(this.config,b,c)}).bind("updateCell"+c.namespace,function(a,b,c,d){a.stopPropagation(),q.updateCell(this.config,b,c,d)}).bind("addRows"+c.namespace,function(a,b,c,d){a.stopPropagation(),q.addRows(this.config,b,c,d)}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(a,b,c,d){a.stopPropagation(),q.sortOn(this.config,b,c,d)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),q.appendCache(this.config,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(a,b,c){a.stopPropagation(),q.updateCache(this.config,b,c)}).bind("applyWidgetId"+c.namespace,function(a,c){a.stopPropagation(),q.getWidgetById(c).format(b,this.config,this.config.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),q.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),q.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),q.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(d){d.stopPropagation(),q.removeWidget(b,!0,!1),c=a.extend(!0,q.defaults,c.originalSettings),b.hasInitialized=!1,q.setup(b,c)})}var q=this;q.version="2.22.5",q.parsers=[],q.widgets=[],q.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},q.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},q.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},q.instanceMethods={},q.isEmptyObject=function(a){for(var b in a)return!1;return!0},q.getElementText=function(b,c,d){if(!c)return"";var e,f=b.textExtraction||"",g=c.jquery?c:a(c);return"string"==typeof f?"basic"===f&&"undefined"!=typeof(e=g.attr(b.textAttribute))?a.trim(e):a.trim(c.textContent||g.text()):"function"==typeof f?a.trim(f(g[0],b.table,d)):"function"==typeof(e=q.getColumnData(b.table,f,d))?a.trim(e(g[0],b.table,d)):a.trim(g[0].textContent||g.text())},q.getParsedText=function(a,b,c,d){"undefined"==typeof d&&(d=q.getElementText(a,b,c));var e=""+d,f=a.parsers[c],g=a.extractors[c];return f&&(g&&"function"==typeof g.format&&(d=g.format(d,a.table,b,c)),e="no-parser"===f.id?"":f.format(""+d,a.table,b,c),a.ignoreCase&&"string"==typeof e&&(e=e.toLowerCase())),e},q.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},q.defaults,b,q.instanceMethods);d.originalSettings=b,!c.hasInitialized&&q.buildTable&&"TABLE"!==this.nodeName?q.buildTable(c,d):q.setup(c,d)})},q.setup=function(b,e){if(!b||!b.tHead||0===b.tBodies.length||b.hasInitialized===!0)return void(e.debug&&(b.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody")));var g="",h=a(b),j=a.metadata;b.hasInitialized=!1,b.isProcessing=!0,b.config=e,a.data(b,"tablesorter",e),e.debug&&(console[console.group?"group":"log"]("Initializing tablesorter"),a.data(b,"startoveralltimer",new Date)),e.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")),e.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},e.emptyTo=e.emptyTo.toLowerCase(),e.stringTo=e.stringTo.toLowerCase(),/tablesorter\-/.test(h.attr("class"))||(g=""!==e.theme?" tablesorter-"+e.theme:""),e.table=b,e.$table=h.addClass(q.css.table+" "+e.tableClass+g).attr("role","grid"),e.$headers=h.find(e.selectorHeaders),e.namespace?e.namespace="."+e.namespace.replace(/\W/g,""):e.namespace=".tablesorter"+Math.random().toString(16).slice(2),e.$table.children().children("tr").attr("role","row"),e.$tbodies=h.children("tbody:not(."+e.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),e.$table.children("caption").length&&(g=e.$table.children("caption")[0],g.id||(g.id=e.namespace.slice(1)+"caption"),e.$table.attr("aria-labelledby",g.id)),e.widgetInit={},e.textExtraction=e.$table.attr("data-text-extraction")||e.textExtraction||"basic",f(b),q.fixColumnWidth(b),q.applyWidgetOptions(b,e),c(e),e.totalRows=0,e.delayInit||d(b),q.bindEvents(b,e.$headers,!0),p(b),e.supportsDataObject&&"undefined"!=typeof h.data().sortlist?e.sortList=h.data().sortlist:j&&h.metadata()&&h.metadata().sortlist&&(e.sortList=h.metadata().sortlist),q.applyWidget(b,!0),e.sortList.length>0?h.trigger("sorton",[e.sortList,{},!e.initWidgets,!0]):(i(b),e.initWidgets&&q.applyWidget(b,!1)),e.showProcessing&&h.unbind("sortBegin"+e.namespace+" sortEnd"+e.namespace).bind("sortBegin"+e.namespace+" sortEnd"+e.namespace,function(a){clearTimeout(e.processTimer),q.isProcessing(b),"sortBegin"===a.type&&(e.processTimer=setTimeout(function(){q.isProcessing(b,!0)},500))}),b.hasInitialized=!0,b.isProcessing=!1,e.debug&&(console.log("Overall initialization time: "+q.benchmark(a.data(b,"startoveralltimer"))),e.debug&&console.groupEnd&&console.groupEnd()),h.trigger("tablesorter-initialized",b),"function"==typeof e.initialized&&e.initialized(b)},q.fixColumnWidth=function(b){b=a(b)[0];var c,d,e,f,g,h=b.config,i=h.$table.children("colgroup");if(i.length&&i.hasClass(q.css.colgroup)&&i.remove(),h.widthFixed&&0===h.$table.children("colgroup").length){for(i=a(''),c=h.$table.width(),e=h.$tbodies.find("tr:first").children(":visible"),f=e.length,g=0;f>g;g++)d=parseInt(e.eq(g).width()/c*1e3,10)/10+"%",i.append(a("").css("width",d));h.$table.prepend(i)}},q.getColumnData=function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers,k=i.$headerIndexed&&i.$headerIndexed[d]||j.filter('[data-column="'+d+'"]:last');if(c[d])return e?c[d]:c[j.index(k)];for(h in c)if("string"==typeof h&&(g=k.filter(h).add(k.find(h)),g.length))return c[h]}},q.computeColumnIndex=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[],q={};for(c=0;ce;e++)for("undefined"==typeof o[e]&&(o[e]=[]),p=o[e],f=n;n+m>f;f++)p[f]="x"}return p.length},q.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+q.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:q.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(q.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(q.css.processing+" "+e.cssProcessing)},q.processTbody=function(b,c,d){b=a(b)[0];var e;return d?(b.isProcessing=!0,c.before(''),e=a.fn.detach?c.detach():c.remove()):(e=a(b).find("colgroup.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},q.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},q.bindEvents=function(b,c,e){b=a(b)[0];var f,g=null,h=b.config;e!==!0&&(c.addClass(h.namespace.slice(1)+"_extra_headers"),f=a.fn.closest?c.closest("table")[0]:c.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==b&&a(f).addClass(h.namespace.slice(1)+"_extra_table")),f=(h.pointerDown+" "+h.pointerUp+" "+h.pointerClick+" sort keyup ").replace(/\s+/g," ").split(" ").join(h.namespace+" "),c.find(h.selectorSort).add(c.filter(h.selectorSort)).unbind(f).bind(f,function(e,f){var i,j,k=a(e.target),m=" "+e.type+" ";if(!(1!==(e.which||e.button)&&!m.match(" "+h.pointerClick+" | sort | keyup ")||" keyup "===m&&13!==e.which||m.match(" "+h.pointerClick+" ")&&"undefined"!=typeof e.which||m.match(" "+h.pointerUp+" ")&&g!==e.target&&f!==!0)){if(m.match(" "+h.pointerDown+" "))return g=e.target,j=k.jquery.split("."),void("1"===j[0]&&j[1]<4&&e.preventDefault());if(g=null,/(input|select|button|textarea)/i.test(e.target.nodeName)||k.hasClass(h.cssNoSort)||k.parents("."+h.cssNoSort).length>0||k.parents("button").length>0)return!h.cancelSelection;h.delayInit&&q.isEmptyObject(h.cache)&&d(b),i=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:a(this).parents("th, td")[0],i=h.$headers[c.index(i)],i.sortDisabled||l(b,i,e)}}),h.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},q.sortReset=function(b,c){var d=b.table;b.sortList=[],i(d),m(d),q.appendCache(b),a.isFunction(c)&&c(d)},q.updateAll=function(a,b,c){var d=a.table;d.isUpdating=!0,q.refreshWidgets(d,!0,!0),f(d),q.bindEvents(d,a.$headers,!0),p(d),g(d,b,c)},q.update=function(a,b,c){var d=a.table;d.isUpdating=!0,h(d),g(d,b,c)},q.updateCell=function(b,c,d,e){b.table.isUpdating=!0,b.$table.find(b.selectorRemove).remove();var f,g,h,i,j=b.table,k=b.$tbodies,l=a(c),m=k.index(a.fn.closest?l.closest("tbody"):l.parents("tbody").filter(":first")),n=b.cache[m],p=a.fn.closest?l.closest("tr"):l.parents("tr").filter(":first");c=l[0],k.length&&m>=0&&(g=k.eq(m).find("tr").index(p),i=n.normalized[g],h=l.index(),f=q.getParsedText(b,c,h),i[h]=f,i[b.columns].$row=p,"numeric"===(b.parsers[h].type||"").toLowerCase()&&(n.colMax[h]=Math.max(Math.abs(f)||0,n.colMax[h]||0)),f="undefined"!==d?d:b.resort,f!==!1?o(b,f,e):(a.isFunction(e)&&e(j),b.$table.trigger("updateComplete",b.table)))},q.addRows=function(b,d,e,f){var i,j,k,l,m,n,p,r="string"==typeof d&&1===b.$tbodies.length&&/i;i++){for(k=d[i].cells.length,m=[],l={child:[],$row:d.eq(i),order:b.cache[p].normalized.length},j=0;k>j;j++)m[j]=q.getParsedText(b,d[i].cells[j],j),"numeric"===(b.parsers[j].type||"").toLowerCase()&&(b.cache[p].colMax[j]=Math.max(Math.abs(m[j])||0,b.cache[p].colMax[j]||0));m.push(l),b.cache[p].normalized.push(m)}o(b,e,f)}},q.updateCache=function(a,b,e){a.parsers&&a.parsers.length||c(a,e),d(a.table,b,e)},q.appendCache=function(a,b){var c,d,e,f,g,h,i,j=a.table,k=a.widgetOptions,l=a.$tbodies,m=[],n=a.cache;if(q.isEmptyObject(n))return a.appender?a.appender(j,m):j.isUpdating?a.$table.trigger("updateComplete",j):"";for(a.debug&&(i=new Date),h=0;hg;g++)m.push(c[g][a.columns].$row),a.appender&&(!a.pager||a.pager.removeRows&&k.pager_removeRows||a.pager.ajax)||f.append(c[g][a.columns].$row);q.processTbody(j,f,!1)}a.appender&&a.appender(j,m),a.debug&&console.log("Rebuilt table"+q.benchmark(i)),b||a.appender||q.applyWidget(j),j.isUpdating&&a.$table.trigger("updateComplete",j)},q.sortOn=function(b,c,e,f){var g=b.table;b.$table.trigger("sortStart",g),j(g,c),i(g),b.delayInit&&q.isEmptyObject(b.cache)&&d(g),b.$table.trigger("sortBegin",g),m(g),q.appendCache(b,f),b.$table.trigger("sortEnd",g),q.applyWidget(g),a.isFunction(e)&&e(g)},q.restoreHeaders=function(b){var c,d,e=a(b)[0].config,f=e.$table.find(e.selectorHeaders),g=f.length;for(c=0;g>c;c++)d=f.eq(c),d.find("."+q.css.headerIn).length&&d.html(e.headerContent[c])},q.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){q.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=g.debug,i=f.find("thead:first"),j=i.find("tr."+q.css.headerRow).removeClass(q.css.headerRow+" "+g.cssHeaderRow),k=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),i.find("tr").not(j).remove(),e="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(g.namespace+" "),f.removeData("tablesorter").unbind(e.replace(/\s+/g," ")),g.$headers.add(k).removeClass([q.css.header,g.cssHeader,g.cssAsc,g.cssDesc,q.css.sortAsc,q.css.sortDesc,q.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),j.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),q.restoreHeaders(b),f.toggleClass(q.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b),h&&console.log("tablesorter has been removed")}},q.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},q.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=q.regex;if(k.hex.test(b)){if(d=parseInt(a.match(k.hex),16),f=parseInt(b.match(k.hex),16),f>d)return-1;if(d>f)return 1}for(c=a.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),e=b.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),j=Math.max(c.length,e.length),i=0;j>i;i++){if(g=isNaN(c[i])?c[i]||0:parseFloat(c[i])||0,h=isNaN(e[i])?e[i]||0:parseFloat(e[i])||0,isNaN(g)!==isNaN(h))return isNaN(g)?1:-1;if(typeof g!=typeof h&&(g+="",h+=""),h>g)return-1;if(g>h)return 1}return 0},q.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:f||1:q.sortNatural(a,b)},q.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:q.sortNatural(b,a)},q.sortText=function(a,b){return a>b?1:b>a?-1:0},q.getTextValue=function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},q.sortNumericAsc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=q.getTextValue(a,c,d)),isNaN(b)&&(b=q.getTextValue(b,c,d)),a-b)},q.sortNumericDesc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=q.getTextValue(a,c,d)),isNaN(b)&&(b=q.getTextValue(b,c,d)),b-a)},q.sortNumeric=function(a,b){return a-b},q.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},q.replaceAccents=function(a){var b,c="[",d=q.characterEquivalents;if(!q.characterRegex){q.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],q.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));q.characterRegex=new RegExp(c+"]")}if(q.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(q.characterRegexArray[b],b));return a},q.isValueInArray=function(a,b){var c,d=b&&b.length||0;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},q.addParser=function(a){var b,c=q.parsers.length,d=!0;for(b=0;c>b;b++)q.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&q.parsers.push(a)},q.addInstanceMethods=function(b){a.extend(q.instanceMethods,b)},q.getParserById=function(a){if("false"==a)return!1;var b,c=q.parsers.length;for(b=0;c>b;b++)if(q.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return q.parsers[b];return!1},q.addWidget=function(a){q.widgets.push(a)},q.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},q.getWidgetById=function(a){var b,c,d=q.widgets.length;for(b=0;d>b;b++)if(c=q.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},q.applyWidgetOptions=function(b,c){var d,e,f=c.widgets.length,g=c.widgetOptions;if(f)for(d=0;f>d;d++)e=q.getWidgetById(c.widgets[d]),e&&"options"in e&&(g=b.config.widgetOptions=a.extend(!0,{},e.options,g))},q.applyWidget=function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k,l,m,n,o=b.config,p=o.widgetOptions,r=" "+o.table.className+" ",s=[];if(c===!1||!b.hasInitialized||!b.isApplyingWidgets&&!b.isUpdating){if(o.debug&&(k=new Date),n=new RegExp("\\s"+o.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),r.match(n)&&(m=r.match(n)))for(f=m.length,e=0;f>e;e++)o.widgets.push(m[e].replace(n,"$1"));if(o.widgets.length){for(b.isApplyingWidgets=!0,o.widgets=a.grep(o.widgets,function(b,c){return a.inArray(b,o.widgets)===c}),g=o.widgets||[],f=g.length,e=0;f>e;e++)n=q.getWidgetById(g[e]),n&&n.id&&(n.priority||(n.priority=10),s[e]=n);for(s.sort(function(a,b){return a.prioritye;e++)h=s[e],h&&(i=h.id,j=!1,o.debug&&(l=new Date),(c||!o.widgetInit[i])&&(o.widgetInit[i]=!0,b.hasInitialized&&q.applyWidgetOptions(b,o),"init"in h&&(j=!0,o.debug&&console[console.group?"group":"log"]("Initializing "+i+" widget"),h.init(b,h,o,p))),!c&&"format"in h&&(j=!0,o.debug&&console[console.group?"group":"log"]("Updating "+i+" widget"),h.format(b,o,p,!1)),o.debug&&j&&(console.log("Completed "+(c?"initializing ":"applying ")+i+" widget"+q.benchmark(l)),console.groupEnd&&console.groupEnd()));o.debug&&console.groupEnd&&console.groupEnd(),c||"function"!=typeof d||d(b)}setTimeout(function(){b.isApplyingWidgets=!1,a.data(b,"lastWidgetApplication",new Date)},0),o.debug&&(m=o.widgets.length,console.log("Completed "+(c===!0?"initializing ":"applying ")+m+" widget"+(1!==m?"s":"")+q.benchmark(k)))}},q.removeWidget=function(b,c,d){b=a(b)[0];var e,f,g,h,i=b.config;if(c===!0)for(c=[],h=q.widgets.length,g=0;h>g;g++)f=q.widgets[g],f&&f.id&&c.push(f.id);else c=(a.isArray(c)?c.join(","):c||"").toLowerCase().split(/[\s,]+/);for(h=c.length,e=0;h>e;e++)f=q.getWidgetById(c[e]),g=a.inArray(c[e],i.widgets),f&&"remove"in f&&(i.debug&&g>=0&&console.log('Removing "'+c[e]+'" widget'),i.debug&&console.log((d?"Refreshing":"Removing")+' "'+c[e]+'" widget'),f.remove(b,i,i.widgetOptions,d),i.widgetInit[c[e]]=!1),g>=0&&d!==!0&&i.widgets.splice(g,1)},q.refreshWidgets=function(b,c,d){b=a(b)[0];var e,f=b.config,g=f.widgets,h=q.widgets,i=h.length,j=[],k=function(b){a(b).trigger("refreshComplete")};for(e=0;i>e;e++)h[e]&&h[e].id&&(c||a.inArray(h[e].id,g)<0)&&j.push(h[e].id);q.removeWidget(b,j.join(","),!0),d!==!0?(q.applyWidget(b,c||!1,k),c&&q.applyWidget(b,!1,k)):k(b)},q.getColumnText=function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k,l,m,n,o="function"==typeof d,p="all"===c,r={raw:[],parsed:[],$cell:[]},s=b.config;if(!q.isEmptyObject(s)){for(i=s.$tbodies.length,e=0;i>e;e++)for(g=s.cache[e].normalized,j=g.length,f=0;j>f;f++)n=!0,h=g[f],l=p?h.slice(0,s.columns):h[c],h=h[s.columns],k=p?h.raw:h.raw[c],m=p?h.$row.children():h.$row.children().eq(c),o&&(n=d({tbodyIndex:e,rowIndex:f,parsed:l,raw:k,$row:h.$row,$cell:m})),n!==!1&&(r.parsed.push(l),r.raw.push(k),r.$cell.push(m));return r}s.debug&&console.warn("No cache found - aborting getColumnText function!")},q.getData=function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},q.formatFloat=function(b,c){if("string"!=typeof b||""===b)return b;var d,e=c&&c.config?c.config.usNumberFormat!==!1:"undefined"!=typeof c?c:!0;return b=e?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1")),d=parseFloat(b),isNaN(d)?a.trim(b):d},q.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):""!==a; }}});var b=a.tablesorter;a.fn.extend({tablesorter:b.construct}),console&&console.log||(b.logs=[],console={},console.log=console.warn=console.error=console.table=function(){b.logs.push([Date.now(),arguments])}),b.log=function(){console.log(arguments)},b.benchmark=function(a){return" ("+((new Date).getTime()-a.getTime())+"ms)"},b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"currency",is:function(a){return a=(a||"").replace(/[+\-,. ]/g,""),/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(b){return b?a.trim(b.replace(/(https?|ftp|file):\/\//,"")):b},parsed:!0,type:"text"}),b.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(a)},format:function(a,b){var c=a?new Date(a.replace(/-/g,"/")):a;return c instanceof Date&&isFinite(c)?c.getTime():a},type:"numeric"}),b.addParser({id:"percent",is:function(a){return/(\d\s*?%|%\s*?\d)/.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(/%/g,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(a)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(a)},format:function(a,b){var c=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return c instanceof Date&&isFinite(c)?c.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return a=(a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"),/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test(a)},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.$headerIndexed[e],j=i.length&&i[0].dateFormat||b.getData(i,b.getColumnData(c,h.headers,e),"dateFormat")||h.dateFormat;return g=a.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===j&&(g=g.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),f=new Date(g),f instanceof Date&&isFinite(f)?f.getTime():a}return a},type:"numeric"}),b.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){var c=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return c instanceof Date&&isFinite(c)?c.getTime():a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l,m=new RegExp(c.cssChildRow,"i"),n=c.$tbodies.add(a(c.namespace+"_extra_table").children("tbody:not(."+c.cssInfoBlock+")"));for(c.debug&&(i=new Date),j=0;jk;k++)f=e.eq(k),m.test(f[0].className)||g++,h=g%2===0,f.removeClass(d.zebra[h?1:0]).addClass(d.zebra[h?0:1])},remove:function(a,c,d,e){if(!e){var f,g,h=c.$tbodies,i=(d.zebra||["even","odd"]).join(" ");for(f=0;f')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f=]/g,query:"(q|query)"},types:{or:function(c,d,e){if(/\|/.test(d.iFilter)||b.filter.regex.orSplit.test(d.filter)){var f,g,h,i,j=a.extend({},d),k=d.index,l=d.parsed[k],m=d.filter.split(b.filter.regex.orSplit),n=d.iFilter.split(b.filter.regex.orSplit),o=m.length;for(f=0;o>f;f++){j.nestedFilters=!0,j.filter=""+(b.filter.parseFilter(c,m[f],k,l)||""),j.iFilter=""+(b.filter.parseFilter(c,n[f],k,l)||""),h="("+(b.filter.parseFilter(c,j.filter,k,l)||"")+")";try{if(i=new RegExp(d.isMatch?h:"^"+h+"$",c.widgetOptions.filter_ignoreCase?"i":""),g=i.test(j.exact)||b.filter.processTypes(c,j,e))return g}catch(p){return null}}return g||!1}return null},and:function(c,d,e){if(b.filter.regex.andTest.test(d.filter)){var f,g,h,i,j,k=a.extend({},d),l=d.index,m=d.parsed[l],n=d.filter.split(b.filter.regex.andSplit),o=d.iFilter.split(b.filter.regex.andSplit),p=n.length;for(f=0;p>f;f++){k.nestedFilters=!0,k.filter=""+(b.filter.parseFilter(c,n[f],l,m)||""),k.iFilter=""+(b.filter.parseFilter(c,o[f],l,m)||""),i=("("+(b.filter.parseFilter(c,k.filter,l,m)||"")+")").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*");try{j=new RegExp(d.isMatch?i:"^"+i+"$",c.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.filter.processTypes(c,k,e),g=0===f?h:g&&h}catch(q){return null}}return g||!1}return null},regex:function(a,c){if(b.filter.regex.regex.test(c.filter)){var d,e=c.filter_regexCache[c.index]||b.filter.regex.regex.exec(c.filter),f=e instanceof RegExp;try{f||(c.filter_regexCache[c.index]=e=new RegExp(e[1],e[2])),d=e.test(c.exact)}catch(g){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)&&""!==d.iExact){var e,f,g,h=c.table,i=d.index,j=d.parsed[i],k=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),h),l=c.parsers[i],m=k;return(j||"numeric"===l.type)&&(g=a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),f=b.filter.parseFilter(c,g,i,!0),k="number"!=typeof f||""===f||isNaN(f)?k:f),!j&&"numeric"!==l.type||isNaN(k)||"undefined"==typeof d.cache?(g=isNaN(d.iExact)?d.iExact.replace(b.filter.regex.nondigit,""):d.iExact,e=b.formatFloat(g,h)):e=d.cache,/>/.test(d.iFilter)?f=/>=/.test(d.iFilter)?e>=k:e>k:/=e:k>e),f||""!==m||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=d.iFilter.replace("!",""),g=b.filter.parseFilter(c,f,d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(g)?(g=g.replace(b.filter.regex.exact,""),""===g?!0:a.trim(g)!==d.iExact):(e=d.iExact.search(a.trim(g)),""===g?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=d.iFilter.replace(b.filter.regex.exact,""),f=b.filter.parseFilter(c,e,d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(f,d.rowArray)>=0:f==d.iExact}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f,g,h=a.table,i=c.index,j=c.parsed[i],k=c.iFilter.split(b.filter.regex.toSplit);return e=k[0].replace(b.filter.regex.nondigit,"")||"",f=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),e=k[1].replace(b.filter.regex.nondigit,"")||"",g=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),(j||"numeric"===a.parsers[i].type)&&(d=a.parsers[i].format(""+k[0],h,a.$headers.eq(i),i),f=""===d||isNaN(d)?f:d,d=a.parsers[i].format(""+k[1],h,a.$headers.eq(i),i),g=""===d||isNaN(d)?g:d),!j&&"numeric"!==a.parsers[i].type||isNaN(f)||isNaN(g)?(e=isNaN(c.iExact)?c.iExact.replace(b.filter.regex.nondigit,""):c.iExact,d=b.formatFloat(e,h)):d=c.cache,f>g&&(e=f,f=g,g=e),d>=f&&g>=d||""===f||""===g}return null},wild:function(a,c){if(/[\?\*\|]/.test(c.iFilter)){var d=c.index,e=c.parsed[d],f=""+(b.filter.parseFilter(a,c.iFilter,d,e)||"");!/\?\*/.test(f)&&c.nestedFilters&&(f=c.isMatch?f:"^("+f+")$");try{return new RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(c.exact)}catch(g){return null}}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=c.iFilter.slice(1),h=b.filter.parseFilter(a,g,c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===h[e]&&(e+=1);return e===h.length?!0:!1}return null}},init:function(d,e,f){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var g,h,i,j,k,l,m,n,o,p=b.filter.regex;if(e.$table.addClass("hasFilters"),f.searchTimer=null,f.filter_initTimer=null,f.filter_formatterCount=0,f.filter_formatterInit=[],f.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',f.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',m="\\{"+b.filter.regex.query+"\\}",a.extend(p,{child:new RegExp(e.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orSplit:new RegExp("(?:\\s+(?:"+b.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(m,"i"),igQuery:new RegExp(m,"ig")}),m=e.$headers.filter(".filter-false, .parser-false").length,f.filter_columnFilters!==!1&&m!==e.$headers.length&&b.filter.buildRow(d,e,f),i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter "),e.$table.bind(i,function(g,h){return m=f.filter_hideEmpty&&a.isEmptyObject(e.cache)&&!(e.delayInit&&"appendCache"===g.type),e.$table.find("."+c.filterRow).toggleClass(f.filter_filteredRow,m),/(search|filter)/.test(g.type)||(g.stopPropagation(),b.filter.buildDefault(d,!0)),"filterReset"===g.type?(e.$table.find("."+c.filter).add(f.filter_$externalFilters).val(""),b.filter.searching(d,[])):"filterEnd"===g.type?b.filter.buildDefault(d,!0):(h="search"===g.type?h:"updateComplete"===g.type?e.$table.data("lastSearch"):"",/(update|add)/.test(g.type)&&"updateComplete"!==g.type&&(e.lastCombinedFilter=null,e.lastSearch=[]),b.filter.searching(d,h,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof a?f.filter_reset.click(function(){e.$table.trigger("filterReset")}):a(f.filter_reset).length&&a(document).undelegate(f.filter_reset,"click.tsfilter").delegate(f.filter_reset,"click.tsfilter",function(){e.$table.trigger("filterReset")})),f.filter_functions)for(k=0;k'+(j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.select||"")+"":"",m=h,i=h,h.indexOf(f.filter_selectSourceSeparator)>=0&&(m=h.split(f.filter_selectSourceSeparator),i=m[1],m=m[0]),g+="");e.$table.find("thead").find("select."+c.filter+'[data-column="'+k+'"]').append(g),i=f.filter_selectSource,n=a.isFunction(i)?!0:b.getColumnData(d,i,k),n&&b.filter.buildSelect(e.table,k,"",!0,j.hasClass(f.filter_onlyAvail))}b.filter.buildDefault(d,!0),b.filter.bindSearch(d,e.$table.find("."+c.filter),!0),f.filter_external&&b.filter.bindSearch(d,f.filter_external),f.filter_hideFilters&&b.filter.hideFilters(d,e),e.showProcessing&&(i="filterStart filterEnd ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(f,g){j=g?e.$table.find("."+c.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",b.isProcessing(d,"filterStart"===f.type,g?j:"")})),e.filteredRows=e.totalRows,i="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(){var a=this.config.widgetOptions;l=b.filter.setDefaults(d,e,a)||[],l.length&&(e.delayInit&&""===l.join("")||b.setFilters(d,l,!0)),e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(e)},100)}),e.pager&&e.pager.initialized&&!f.filter_initialized&&(e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(e)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;c.filter_initialized||(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.filter.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},setDefaults:function(c,d,e){var f,g,h,i,j,k=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(k=g)),""===k.join(""))for(j=d.$headers.add(e.filter_$externalFilters).filter("["+e.filter_defaultAttrib+"]"),h=0;h<=d.columns;h++)i=h===d.columns?"all":h,k[h]=j.filter('[data-column="'+i+'"]').attr(e.filter_defaultAttrib)||k[h]||"";return d.$table.data("lastSearch",k),k},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n,o=f.filter_cellFilter,p=e.columns,q=a.isArray(o),r='';for(h=0;p>h;h++)r+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;p>h;h++)k=!1,i=e.$headerIndexed[h],m=b.getColumnData(d,f.filter_functions,h),j=f.filter_functions&&m&&"function"!=typeof m||i.hasClass("filter-select"),g=b.getColumnData(d,e.headers,h),k="false"===b.getData(i[0],g,"filter")||"false"===b.getData(i[0],g,"parser"),j?r=a("').appendTo(e.$filters.eq(h)),r&&(n=i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"",r.attr("placeholder",n))),r&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",r.addClass(c.filter+" "+l).attr("data-column",h),k&&(r.attr("placeholder","").addClass(c.filterDisabled)[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f,g=c.config,h=g.widgetOptions,i=g.namespace+"filter",j=h.filter_$externalFilters;e!==!0&&(f=h.filter_anyColumnSelector+","+h.filter_multipleColumnSelector,h.filter_$anyMatch=d.filter(f),j&&j.length?h.filter_$externalFilters=h.filter_$externalFilters.add(d):h.filter_$externalFilters=d,b.setFilters(c,g.$table.data("lastSearch")||[],e===!1)),f="keypress keyup search change ".split(" ").join(i+" "),d.attr("data-lastSearchTime",(new Date).getTime()).unbind(f.replace(/\s+/g," ")).bind("keyup"+i,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(h.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof h.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(i+" "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==g.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(d,e,f){var g=d.config,h=g.widgetOptions,i=a.isArray(e),j=i?e:b.getFilters(d,!0),k=(j||[]).join("");return a.isEmptyObject(g.cache)?void(g.delayInit&&g.pager&&g.pager.initialized&&g.$table.trigger("updateCache",[function(){b.filter.checkFilters(d,!1,f)}])):(i&&(b.setFilters(d,j,!1,f!==!0),h.filter_initialized||(g.lastCombinedFilter="")),h.filter_hideFilters&&g.$table.find("."+c.filterRow).trigger(""===k?"mouseleave":"mouseenter"),g.lastCombinedFilter!==k||e===!1?(e===!1&&(g.lastCombinedFilter=null,g.lastSearch=[]),h.filter_initialized&&g.$table.trigger("filterStart",[j]),g.showProcessing?void setTimeout(function(){return b.filter.findRows(d,j,k),!1},30):(b.filter.findRows(d,j,k),!1)):void 0)},hideFilters:function(d,e){var f;e.$table.find("."+c.filterRow).bind("mouseenter mouseleave",function(b){var d=b,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(d.type)?g.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===e.lastCombinedFilter&&g.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){var g=d,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===b.getFilters(e.$table).join("")&&h.toggleClass(c.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.filter.getLatestSearch(d).attr("data-column")||"");if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l-1?(d.parsed[e]?m=d.cacheArray[e]:(m=d.rawArray[e],m=a.trim(o.filter_ignoreCase?m.toLowerCase():m),c.sortLocaleCompare&&(m=b.replaceAccents(m))),m):void 0}).get(),d.filter=d.anyMatchFilter,d.iFilter=d.iAnyMatchFilter,d.exact=d.rowArray.join(" "),d.iExact=o.filter_ignoreCase?d.exact.toLowerCase():d.exact,d.cache=d.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,j=b.filter.processTypes(c,d,e),null!==j)p=j;else if(o.filter_startsWith)for(p=!1,f=c.columns;!p&&f>0;)f--,p=p||0===d.rowArray[f].indexOf(d.iFilter);else p=(d.iExact+d.childRowText).indexOf(d.iFilter)>=0;if(d.anyMatch=!1,d.filters.join("")===d.filter)return p}for(f=0;f=0:d.filter===d.exact:"function"==typeof k?j=k(d.exact,d.cache,d.filter,f,d.$row,c,d):"function"==typeof k[l||d.filter]&&(m=l||d.filter,j=k[m](d.exact,d.cache,d.filter,f,d.$row,c,d))),null===j?(j=b.filter.processTypes(c,d,e),null!==j?h=j:(m=(d.iExact+d.childRowText).indexOf(b.filter.parseFilter(c,d.iFilter,f,d.parsed[f])),h=!o.filter_startsWith&&m>=0||o.filter_startsWith&&0===m)):h=j,p=h?p:!1);return p},findRows:function(c,d,e){if(c.config.lastCombinedFilter!==e&&c.config.widgetOptions.filter_initialized){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a.extend([],d),C=b.filter.regex,D=c.config,E=D.widgetOptions,F={anyMatch:!1,filters:d,filter_regexCache:[]},G={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)||""};for(F.parsed=D.$headers.map(function(d){return D.parsers&&D.parsers[d]&&D.parsers[d].parsed||b.getData&&"parsed"===b.getData(D.$headerIndexed[d],b.getColumnData(c,D.headers,d),"filter")||a(this).hasClass("filter-parsed")}).get(),m=0;m1&&(z=parseInt(y[0],10)-1,z>=0&&zt;t++)s=d[t]||"",v||(t=m),v=!(!v||!p.length||0!==s.indexOf(p[t]||"")||C.alreadyFiltered.test(s)||/[=\"\|!]/.test(s)||/(>=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s)||""!==s&&D.$filters&&D.$filters.eq(t).find("select").length&&!D.$headerIndexed[t].hasClass("filter-match"));for(u=i.not("."+E.filter_filteredRow).length,v&&0===u&&(v=!1),D.debug&&console.log("Filter: Searching through "+(v&&f>u?u:"all")+" rows"),F.anyMatchFlag&&(D.sortLocaleCompare&&(F.anyMatchFilter=b.replaceAccents(F.anyMatchFilter)),E.filter_defaultFilter&&C.iQuery.test(G.defaultAnyFilter)&&(F.anyMatchFilter=b.filter.defaultFilter(F.anyMatchFilter,G.defaultAnyFilter),v=!1),F.iAnyMatchFilter=E.filter_ignoreCase&&D.ignoreCase?F.anyMatchFilter.toLowerCase():F.anyMatchFilter),j=0;f>j;j++)if(A=i[j].className,n=j&&C.child.test(A),!(n||v&&C.filtered.test(A))){if(F.$row=i.eq(j),F.cacheArray=g[j],h=F.cacheArray[D.columns],F.rawArray=h.raw,F.childRowText="", !E.filter_childByColumn){for(A="",o=h.child,t=0;t")>=0)return p;a.isArray(p)?m=p:"object"===a.type(n)&&p&&(m=p(c,d,e))}if(m===!1&&(m=b.filter.getOptions(c,d,e)),m=a.grep(m,function(b,c){return a.inArray(b,m)===c}),j.$headerIndexed[d].hasClass("filter-select-nosort"))return m;for(i=m.length,h=0;i>h;h++)g=m[h],l.push({t:g,p:j.parsers&&j.parsers.length&&j.parsers[d].format(g,c,[],d)||g});for(f=j.textSorter||"",l.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),m=[],i=l.length,h=0;i>h;h++)m.push(l[h].t);return m},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j=b.config,k=j.widgetOptions,l=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][j.columns].$row[0],d&&h.className.match(k.filter_filteredRow)||(k.filter_useParsedData||j.parsers[c].parsed||j.$headerIndexed[c].hasClass("filter-parsed")?l.push(""+i.normalized[e][c]):l.push(i.normalized[e][j.columns].raw[c]));return l},buildSelect:function(d,e,f,g,h){if(d=a(d)[0],e=parseInt(e,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var i,j,k,l,m,n,o=d.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+c.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.filter.getOptionSource(d,e,h)),a.isArray(f)){for(i=0;i=0&&(l=k.split(p.filter_selectSourceSeparator),j=l[0],k=l[1]),r+=""!==f[i]?"":"";f=[]}m=(o.$filters?o.$filters:o.$table.children("thead")).find("."+c.filter),p.filter_$externalFilters&&(m=m&&m.length?m.add(p.filter_$externalFilters):p.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](r),a.isArray(f)||n.append(f).val(s),n.val(s))}},buildDefault:function(a,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headerIndexed[d],f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(d,e,f,g){var h,i,j,k,l=!1,m=d?a(d)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(d).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+c.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change.tsfilter")):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},b.setFilters=function(c,d,e,f){var g=c?a(c)[0].config:"",h=b.getFilters(c,!0,d,f);return g&&e&&(g.lastCombinedFilter=null,g.lastSearch=[],b.filter.searching(g.table,d,f),g.$table.trigger("filterFomatterUpdate")),!!h}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(w,e)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);j.one("tablesorter-initialized",function(){c.resizable.setHandlePosition(b,d),c.resizable.bindings(this.config,this.config.widgetOptions)})}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d){var e=b.namespace+"tsresize";b.widgetOptions.resizable_vars.disabled=d,a("body").toggleClass(c.css.resizableNoSelect,d),d?a("body").attr("unselectable","on").bind("selectstart"+e,!1):a("body").removeAttr("unselectable").unbind("selectstart"+e)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[k]))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file diff --git a/dist/js/jquery.tablesorter.widgets.js b/dist/js/jquery.tablesorter.widgets.js index 06eb6fa7..c88d9f6b 100644 --- a/dist/js/jquery.tablesorter.widgets.js +++ b/dist/js/jquery.tablesorter.widgets.js @@ -1,4 +1,4 @@ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { diff --git a/dist/js/jquery.tablesorter.widgets.min.js b/dist/js/jquery.tablesorter.widgets.min.js index 90f2bac3..1b235d95 100644 --- a/dist/js/jquery.tablesorter.widgets.min.js +++ b/dist/js/jquery.tablesorter.widgets.min.js @@ -1,3 +1,3 @@ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a,b,c){"use strict";var d=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=m&&m.widgetOptions,o=g&&g.useSessionStorage||n&&n.storage_useSessionStorage?"sessionStorage":"localStorage",p=a(d),q=g&&g.id||p.attr(g&&g.group||n&&n.storage_group||"data-table-group")||n&&n.storage_tableId||d.id||a(".tablesorter").index(p),r=g&&g.url||p.attr(g&&g.page||n&&n.storage_page||"data-table-page")||n&&n.storage_fixedUrl||m&&m.fixedUrl||b.location.pathname;if(o in b)try{b[o].setItem("_tmptest","temp"),k=!0,b[o].removeItem("_tmptest")}catch(s){m&&m.debug&&console.warn(o+" is not supported in this browser")}return a.parseJSON&&(k?l=a.parseJSON(b[o][e]||"null")||{}:(i=c.cookie.split(/[;\s|=]/),h=a.inArray(e,i)+1,l=0!==h?a.parseJSON(i[h]||"null")||{}:{})),(f||""===f)&&b.JSON&&JSON.hasOwnProperty("stringify")?(l[r]||(l[r]={}),l[r][q]=f,k?b[o][e]=JSON.stringify(l):(j=new Date,j.setTime(j.getTime()+31536e6),c.cookie=e+"="+JSON.stringify(l).replace(/\"/g,'"')+"; expires="+j.toGMTString()+"; path=/"),void 0):l&&l[r]?l[r][q]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter||{};b.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},a.extend(b.css,{wrapper:"tablesorter-wrapper"}),b.addWidget({id:"uitheme",priority:10,format:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r=b.themes,s=d.$table.add(a(d.namespace+"_extra_table")),t=d.$headers.add(a(d.namespace+"_extra_headers")),u=d.theme||"jui",v=r[u]||{},w=a.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=a.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" "));for(d.debug&&(i=new Date),s.hasClass("tablesorter-"+u)&&d.theme===d.appliedTheme&&e.uitheme_applied||(e.uitheme_applied=!0,n=r[d.appliedTheme]||{},q=!a.isEmptyObject(n),o=q?[n.sortNone,n.sortDesc,n.sortAsc,n.active].join(" "):"",p=q?[n.iconSortNone,n.iconSortDesc,n.iconSortAsc].join(" "):"",q&&(e.zebra[0]=a.trim(" "+e.zebra[0].replace(" "+n.even,"")),e.zebra[1]=a.trim(" "+e.zebra[1].replace(" "+n.odd,"")),d.$tbodies.children().removeClass([n.even,n.odd].join(" "))),v.even&&(e.zebra[0]+=" "+v.even),v.odd&&(e.zebra[1]+=" "+v.odd),s.children("caption").removeClass(n.caption||"").addClass(v.caption),l=s.removeClass((d.appliedTheme?"tablesorter-"+(d.appliedTheme||""):"")+" "+(n.table||"")).addClass("tablesorter-"+u+" "+(v.table||"")).children("tfoot"),d.appliedTheme=d.theme,l.length&&l.children("tr").removeClass(n.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(n.footerCells||"").addClass(v.footerCells),t.removeClass((q?[n.header,n.hover,o].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(b){a(this)["mouseenter"===b.type?"addClass":"removeClass"](v.hover||"")}),t.each(function(){var c=a(this);c.find("."+b.css.wrapper).length||c.wrapInner('
')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f=]/g,query:"(q|query)"},types:{or:function(c,d,e){if(/\|/.test(d.iFilter)||b.filter.regex.orSplit.test(d.filter)){var f,g,h,i,j=a.extend({},d),k=d.index,l=d.parsed[k],m=d.filter.split(b.filter.regex.orSplit),n=d.iFilter.split(b.filter.regex.orSplit),o=m.length;for(f=0;o>f;f++){j.nestedFilters=!0,j.filter=""+(b.filter.parseFilter(c,m[f],k,l)||""),j.iFilter=""+(b.filter.parseFilter(c,n[f],k,l)||""),h="("+(b.filter.parseFilter(c,j.filter,k,l)||"")+")";try{if(i=new RegExp(d.isMatch?h:"^"+h+"$",c.widgetOptions.filter_ignoreCase?"i":""),g=i.test(j.exact)||b.filter.processTypes(c,j,e))return g}catch(p){return null}}return g||!1}return null},and:function(c,d,e){if(b.filter.regex.andTest.test(d.filter)){var f,g,h,i,j,k=a.extend({},d),l=d.index,m=d.parsed[l],n=d.filter.split(b.filter.regex.andSplit),o=d.iFilter.split(b.filter.regex.andSplit),p=n.length;for(f=0;p>f;f++){k.nestedFilters=!0,k.filter=""+(b.filter.parseFilter(c,n[f],l,m)||""),k.iFilter=""+(b.filter.parseFilter(c,o[f],l,m)||""),i=("("+(b.filter.parseFilter(c,k.filter,l,m)||"")+")").replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*");try{j=new RegExp(d.isMatch?i:"^"+i+"$",c.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.filter.processTypes(c,k,e),g=0===f?h:g&&h}catch(q){return null}}return g||!1}return null},regex:function(a,c){if(b.filter.regex.regex.test(c.filter)){var d,e=c.filter_regexCache[c.index]||b.filter.regex.regex.exec(c.filter),f=e instanceof RegExp;try{f||(c.filter_regexCache[c.index]=e=new RegExp(e[1],e[2])),d=e.test(c.exact)}catch(g){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)&&""!==d.iExact){var e,f,g,h=c.table,i=d.index,j=d.parsed[i],k=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),h),l=c.parsers[i],m=k;return(j||"numeric"===l.type)&&(g=a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),f=b.filter.parseFilter(c,g,i,!0),k="number"!=typeof f||""===f||isNaN(f)?k:f),!j&&"numeric"!==l.type||isNaN(k)||"undefined"==typeof d.cache?(g=isNaN(d.iExact)?d.iExact.replace(b.filter.regex.nondigit,""):d.iExact,e=b.formatFloat(g,h)):e=d.cache,/>/.test(d.iFilter)?f=/>=/.test(d.iFilter)?e>=k:e>k:/=e:k>e),f||""!==m||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=d.iFilter.replace("!",""),g=b.filter.parseFilter(c,f,d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(g)?(g=g.replace(b.filter.regex.exact,""),""===g?!0:a.trim(g)!==d.iExact):(e=d.iExact.search(a.trim(g)),""===g?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=d.iFilter.replace(b.filter.regex.exact,""),f=b.filter.parseFilter(c,e,d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(f,d.rowArray)>=0:f==d.iExact}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f,g,h=a.table,i=c.index,j=c.parsed[i],k=c.iFilter.split(b.filter.regex.toSplit);return e=k[0].replace(b.filter.regex.nondigit,"")||"",f=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),e=k[1].replace(b.filter.regex.nondigit,"")||"",g=b.formatFloat(b.filter.parseFilter(a,e,i,j),h),(j||"numeric"===a.parsers[i].type)&&(d=a.parsers[i].format(""+k[0],h,a.$headers.eq(i),i),f=""===d||isNaN(d)?f:d,d=a.parsers[i].format(""+k[1],h,a.$headers.eq(i),i),g=""===d||isNaN(d)?g:d),!j&&"numeric"!==a.parsers[i].type||isNaN(f)||isNaN(g)?(e=isNaN(c.iExact)?c.iExact.replace(b.filter.regex.nondigit,""):c.iExact,d=b.formatFloat(e,h)):d=c.cache,f>g&&(e=f,f=g,g=e),d>=f&&g>=d||""===f||""===g}return null},wild:function(a,c){if(/[\?\*\|]/.test(c.iFilter)){var d=c.index,e=c.parsed[d],f=""+(b.filter.parseFilter(a,c.iFilter,d,e)||"");!/\?\*/.test(f)&&c.nestedFilters&&(f=c.isMatch?f:"^("+f+")$");try{return new RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(c.exact)}catch(g){return null}}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=c.iFilter.slice(1),h=b.filter.parseFilter(a,g,c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===h[e]&&(e+=1);return e===h.length?!0:!1}return null}},init:function(d,e,f){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var g,h,i,j,k,l,m,n,o,p=b.filter.regex;if(e.$table.addClass("hasFilters"),f.searchTimer=null,f.filter_initTimer=null,f.filter_formatterCount=0,f.filter_formatterInit=[],f.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',f.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',m="\\{"+b.filter.regex.query+"\\}",a.extend(p,{child:new RegExp(e.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orSplit:new RegExp("(?:\\s+(?:"+b.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(m,"i"),igQuery:new RegExp(m,"ig")}),m=e.$headers.filter(".filter-false, .parser-false").length,f.filter_columnFilters!==!1&&m!==e.$headers.length&&b.filter.buildRow(d,e,f),i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter "),e.$table.bind(i,function(g,h){return m=f.filter_hideEmpty&&a.isEmptyObject(e.cache)&&!(e.delayInit&&"appendCache"===g.type),e.$table.find("."+c.filterRow).toggleClass(f.filter_filteredRow,m),/(search|filter)/.test(g.type)||(g.stopPropagation(),b.filter.buildDefault(d,!0)),"filterReset"===g.type?(e.$table.find("."+c.filter).add(f.filter_$externalFilters).val(""),b.filter.searching(d,[])):"filterEnd"===g.type?b.filter.buildDefault(d,!0):(h="search"===g.type?h:"updateComplete"===g.type?e.$table.data("lastSearch"):"",/(update|add)/.test(g.type)&&"updateComplete"!==g.type&&(e.lastCombinedFilter=null,e.lastSearch=[]),b.filter.searching(d,h,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof a?f.filter_reset.click(function(){e.$table.trigger("filterReset")}):a(f.filter_reset).length&&a(document).undelegate(f.filter_reset,"click.tsfilter").delegate(f.filter_reset,"click.tsfilter",function(){e.$table.trigger("filterReset")})),f.filter_functions)for(k=0;k'+(j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.select||"")+"":"",m=h,i=h,h.indexOf(f.filter_selectSourceSeparator)>=0&&(m=h.split(f.filter_selectSourceSeparator),i=m[1],m=m[0]),g+="");e.$table.find("thead").find("select."+c.filter+'[data-column="'+k+'"]').append(g),i=f.filter_selectSource,n=a.isFunction(i)?!0:b.getColumnData(d,i,k),n&&b.filter.buildSelect(e.table,k,"",!0,j.hasClass(f.filter_onlyAvail))}b.filter.buildDefault(d,!0),b.filter.bindSearch(d,e.$table.find("."+c.filter),!0),f.filter_external&&b.filter.bindSearch(d,f.filter_external),f.filter_hideFilters&&b.filter.hideFilters(d,e),e.showProcessing&&(i="filterStart filterEnd ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(f,g){j=g?e.$table.find("."+c.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",b.isProcessing(d,"filterStart"===f.type,g?j:"")})),e.filteredRows=e.totalRows,i="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),e.$table.unbind(i.replace(/\s+/g," ")).bind(i,function(){var a=this.config.widgetOptions;l=b.filter.setDefaults(d,e,a)||[],l.length&&(e.delayInit&&""===l.join("")||b.setFilters(d,l,!0)),e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(e)},100)}),e.pager&&e.pager.initialized&&!f.filter_initialized&&(e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(e)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;c.filter_initialized||(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.filter.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},setDefaults:function(c,d,e){var f,g,h,i,j,k=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(k=g)),""===k.join(""))for(j=d.$headers.add(e.filter_$externalFilters).filter("["+e.filter_defaultAttrib+"]"),h=0;h<=d.columns;h++)i=h===d.columns?"all":h,k[h]=j.filter('[data-column="'+i+'"]').attr(e.filter_defaultAttrib)||k[h]||"";return d.$table.data("lastSearch",k),k},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n,o=f.filter_cellFilter,p=e.columns,q=a.isArray(o),r='';for(h=0;p>h;h++)r+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;p>h;h++)k=!1,i=e.$headerIndexed[h],m=b.getColumnData(d,f.filter_functions,h),j=f.filter_functions&&m&&"function"!=typeof m||i.hasClass("filter-select"),g=b.getColumnData(d,e.headers,h),k="false"===b.getData(i[0],g,"filter")||"false"===b.getData(i[0],g,"parser"),j?r=a("').appendTo(e.$filters.eq(h)),r&&(n=i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"",r.attr("placeholder",n))),r&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",r.addClass(c.filter+" "+l).attr("data-column",h),k&&(r.attr("placeholder","").addClass(c.filterDisabled)[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f,g=c.config,h=g.widgetOptions,i=g.namespace+"filter",j=h.filter_$externalFilters;e!==!0&&(f=h.filter_anyColumnSelector+","+h.filter_multipleColumnSelector,h.filter_$anyMatch=d.filter(f),j&&j.length?h.filter_$externalFilters=h.filter_$externalFilters.add(d):h.filter_$externalFilters=d,b.setFilters(c,g.$table.data("lastSearch")||[],e===!1)),f="keypress keyup search change ".split(" ").join(i+" "),d.attr("data-lastSearchTime",(new Date).getTime()).unbind(f.replace(/\s+/g," ")).bind("keyup"+i,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(h.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof h.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(i+" "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==g.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(d,e,f){var g=d.config,h=g.widgetOptions,i=a.isArray(e),j=i?e:b.getFilters(d,!0),k=(j||[]).join("");return a.isEmptyObject(g.cache)?void(g.delayInit&&g.pager&&g.pager.initialized&&g.$table.trigger("updateCache",[function(){b.filter.checkFilters(d,!1,f)}])):(i&&(b.setFilters(d,j,!1,f!==!0),h.filter_initialized||(g.lastCombinedFilter="")),h.filter_hideFilters&&g.$table.find("."+c.filterRow).trigger(""===k?"mouseleave":"mouseenter"),g.lastCombinedFilter!==k||e===!1?(e===!1&&(g.lastCombinedFilter=null,g.lastSearch=[]),h.filter_initialized&&g.$table.trigger("filterStart",[j]),g.showProcessing?void setTimeout(function(){return b.filter.findRows(d,j,k),!1},30):(b.filter.findRows(d,j,k),!1)):void 0)},hideFilters:function(d,e){var f;e.$table.find("."+c.filterRow).bind("mouseenter mouseleave",function(b){var d=b,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(d.type)?g.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===e.lastCombinedFilter&&g.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){var g=d,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===b.getFilters(e.$table).join("")&&h.toggleClass(c.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.filter.getLatestSearch(d).attr("data-column")||"");if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l-1?(d.parsed[e]?m=d.cacheArray[e]:(m=d.rawArray[e],m=a.trim(o.filter_ignoreCase?m.toLowerCase():m),c.sortLocaleCompare&&(m=b.replaceAccents(m))),m):void 0}).get(),d.filter=d.anyMatchFilter,d.iFilter=d.iAnyMatchFilter,d.exact=d.rowArray.join(" "),d.iExact=o.filter_ignoreCase?d.exact.toLowerCase():d.exact,d.cache=d.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,j=b.filter.processTypes(c,d,e),null!==j)p=j;else if(o.filter_startsWith)for(p=!1,f=c.columns;!p&&f>0;)f--,p=p||0===d.rowArray[f].indexOf(d.iFilter);else p=(d.iExact+d.childRowText).indexOf(d.iFilter)>=0;if(d.anyMatch=!1,d.filters.join("")===d.filter)return p}for(f=0;f=0:d.filter===d.exact:"function"==typeof k?j=k(d.exact,d.cache,d.filter,f,d.$row,c,d):"function"==typeof k[l||d.filter]&&(m=l||d.filter,j=k[m](d.exact,d.cache,d.filter,f,d.$row,c,d))),null===j?(j=b.filter.processTypes(c,d,e),null!==j?h=j:(m=(d.iExact+d.childRowText).indexOf(b.filter.parseFilter(c,d.iFilter,f,d.parsed[f])),h=!o.filter_startsWith&&m>=0||o.filter_startsWith&&0===m)):h=j,p=h?p:!1);return p},findRows:function(c,d,e){if(c.config.lastCombinedFilter!==e&&c.config.widgetOptions.filter_initialized){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B=a.extend([],d),C=b.filter.regex,D=c.config,E=D.widgetOptions,F={anyMatch:!1,filters:d,filter_regexCache:[]},G={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)||""};for(F.parsed=D.$headers.map(function(d){return D.parsers&&D.parsers[d]&&D.parsers[d].parsed||b.getData&&"parsed"===b.getData(D.$headerIndexed[d],b.getColumnData(c,D.headers,d),"filter")||a(this).hasClass("filter-parsed")}).get(),m=0;m1&&(z=parseInt(y[0],10)-1,z>=0&&zt;t++)s=d[t]||"",v||(t=m),v=!(!v||!p.length||0!==s.indexOf(p[t]||"")||C.alreadyFiltered.test(s)||/[=\"\|!]/.test(s)||/(>=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s)||""!==s&&D.$filters&&D.$filters.eq(t).find("select").length&&!D.$headerIndexed[t].hasClass("filter-match"));for(u=i.not("."+E.filter_filteredRow).length,v&&0===u&&(v=!1),D.debug&&console.log("Filter: Searching through "+(v&&f>u?u:"all")+" rows"),F.anyMatchFlag&&(D.sortLocaleCompare&&(F.anyMatchFilter=b.replaceAccents(F.anyMatchFilter)),E.filter_defaultFilter&&C.iQuery.test(G.defaultAnyFilter)&&(F.anyMatchFilter=b.filter.defaultFilter(F.anyMatchFilter,G.defaultAnyFilter),v=!1),F.iAnyMatchFilter=E.filter_ignoreCase&&D.ignoreCase?F.anyMatchFilter.toLowerCase():F.anyMatchFilter),j=0;f>j;j++)if(A=i[j].className,n=j&&C.child.test(A),!(n||v&&C.filtered.test(A))){if(F.$row=i.eq(j),F.cacheArray=g[j],h=F.cacheArray[D.columns],F.rawArray=h.raw,F.childRowText="",!E.filter_childByColumn){for(A="",o=h.child,t=0;t")>=0)return p;a.isArray(p)?m=p:"object"===a.type(n)&&p&&(m=p(c,d,e))}if(m===!1&&(m=b.filter.getOptions(c,d,e)),m=a.grep(m,function(b,c){return a.inArray(b,m)===c}),j.$headerIndexed[d].hasClass("filter-select-nosort"))return m;for(i=m.length,h=0;i>h;h++)g=m[h],l.push({t:g,p:j.parsers&&j.parsers.length&&j.parsers[d].format(g,c,[],d)||g});for(f=j.textSorter||"",l.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),m=[],i=l.length,h=0;i>h;h++)m.push(l[h].t);return m},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j=b.config,k=j.widgetOptions,l=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][j.columns].$row[0],d&&h.className.match(k.filter_filteredRow)||(k.filter_useParsedData||j.parsers[c].parsed||j.$headerIndexed[c].hasClass("filter-parsed")?l.push(""+i.normalized[e][c]):l.push(i.normalized[e][j.columns].raw[c]));return l},buildSelect:function(d,e,f,g,h){if(d=a(d)[0],e=parseInt(e,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var i,j,k,l,m,n,o=d.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+c.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.filter.getOptionSource(d,e,h)),a.isArray(f)){for(i=0;i=0&&(l=k.split(p.filter_selectSourceSeparator),j=l[0],k=l[1]),r+=""!==f[i]?"":"";f=[]}m=(o.$filters?o.$filters:o.$table.children("thead")).find("."+c.filter),p.filter_$externalFilters&&(m=m&&m.length?m.add(p.filter_$externalFilters):p.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](r),a.isArray(f)||n.append(f).val(s),n.val(s))}},buildDefault:function(a,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headerIndexed[d],f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(d,e,f,g){var h,i,j,k,l=!1,m=d?a(d)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(d).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+c.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters), i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change.tsfilter")):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},b.setFilters=function(c,d,e,f){var g=c?a(c)[0].config:"",h=b.getFilters(c,!0,d,f);return g&&e&&(g.lastCombinedFilter=null,g.lastSearch=[],b.filter.searching(g.table,d,f),g.$table.trigger("filterFomatterUpdate")),!!h}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(w,e)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);j.one("tablesorter-initialized",function(){c.resizable.setHandlePosition(b,d),c.resizable.bindings(this.config,this.config.widgetOptions)})}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d){var e=b.namespace+"tsresize";b.widgetOptions.resizable_vars.disabled=d,a("body").toggleClass(c.css.resizableNoSelect,d),d?a("body").attr("unselectable","on").bind("selectstart"+e,!1):a("body").removeAttr("unselectable").unbind("selectstart"+e)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[k]))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file diff --git a/dist/js/widgets/widget-pager.min.js b/dist/js/widgets/widget-pager.min.js index 8c6f334e..af2c0b8b 100644 --- a/dist/js/widgets/widget-pager.min.js +++ b/dist/js/widgets/widget-pager.min.js @@ -1,2 +1,2 @@ /*! Widget: Pager - updated 7/28/2015 (v2.22.4) */ -!function(a){"use strict";var b,c=a.tablesorter;c.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(a,b){return b},pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(a){return[0,[],null]},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(a){b.init(a)},format:function(a,c){return c.pager&&c.pager.initialized?void b.moveToPage(a,c.pager,!1):b.initComplete(a,c)},remove:function(a,c,d,e){b.destroyPager(a,c,e)}}),b=c.pager={init:function(d){if(!d.hasInitialized||!d.config.pager.initialized){var e,f=d.config,g=f.widgetOptions,h=g.pager_selectors,i=f.pager=a.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:g.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:g.pager_size,setPage:g.pager_startPage,events:"filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete "},f.pager);i.isInitializing||(i.isInitializing=!0,f.debug&&console.log("Pager: Initializing"),i.size=a.data(d,"pagerLastSize")||g.pager_size,i.$container=a(h.container).addClass(g.pager_css.container).show(),i.$goto=i.$container.find(h.gotoPage),i.$size=i.$container.find(h.pageSize),i.totalRows=f.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+f.cssChildRow).length,i.oldAjaxSuccess=i.oldAjaxSuccess||g.pager_ajaxObject.success,f.appender=b.appender,i.initializing=!0,g.pager_savePages&&c.storage&&(e=c.storage(d,g.pager_storageKey)||{},i.page=(isNaN(e.page)?i.page:e.page)||i.setPage||0,i.size=(isNaN(e.size)?i.size:e.size)||i.setSize||10,a.data(d,"pagerLastSize",i.size)),i.regexRows=new RegExp("("+(g.filter_filteredRow||"filtered")+"|"+f.selectorRemove.slice(1)+"|"+f.cssChildRow+")"),i.initialized=!1,f.$table.trigger("pagerBeforeInitialized",f),b.enablePager(d,f,!1),i.ajaxObject=g.pager_ajaxObject,i.ajaxObject.url=g.pager_ajaxUrl,"string"==typeof g.pager_ajaxUrl?(i.ajax=!0,g.filter_serversideFiltering=!0,f.serverSideSorting=!0,b.moveToPage(d,i)):(i.ajax=!1,f.$table.trigger("appendCache",[{},!0])))}},initComplete:function(a,d){var e=d.pager;b.bindEvents(a,d),b.setPageSize(a,0,d),e.ajax||b.hideRowsSetup(a,d),e.initialized=!0,e.initializing=!1,e.isInitializing=!1,d.debug&&console.log("Pager: Triggering pagerInitialized"),d.$table.trigger("pagerInitialized",d),d.widgetOptions.filter_initialized&&c.hasWidget(a,"filter")||b.updatePageDisplay(a,d,!e.ajax)},bindEvents:function(c,d){var e,f,g=d.pager,h=d.widgetOptions,i=d.namespace+"pager",j=h.pager_selectors;d.$table.off(a.trim(g.events.split(" ").join(i+" "))).on("filterInit filterStart ".split(" ").join(i+" "),function(b,c){g.currentFilters=a.isArray(c)?c:d.$table.data("lastSearch"),"filterStart"===b.type&&h.pager_pageReset!==!1&&(d.lastCombinedFilter||"")!==(g.currentFilters||[]).join("")&&(g.page=h.pager_pageReset)}).on("filterEnd sortEnd ".split(" ").join(i+" "),function(){g.currentFilters=d.$table.data("lastSearch"),(g.initialized||g.initializing)&&(d.delayInit&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"))}).on("disable"+i,function(a){a.stopPropagation(),b.showAllRows(c,d)}).on("enable"+i,function(a){a.stopPropagation(),b.enablePager(c,d,!0)}).on("destroy"+i,function(a,e){a.stopPropagation(),b.destroyPager(c,d,e)}).on("updateComplete"+i,function(a,c,e){if(a.stopPropagation(),c&&!e&&!g.ajax){var f=d.$tbodies.eq(0).children("tr").not(d.selectorRemove);g.totalRows=f.length-(h.pager_countChildRows?0:f.filter("."+d.cssChildRow).length),g.totalPages=Math.ceil(g.totalRows/g.size),f.length&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),g.page>=g.totalPages&&b.moveToLastPage(c,g),b.hideRows(c,d),b.changeHeight(c,d),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"),b.updatePageDisplay(c,d)}}).on("pageSize refreshComplete ".split(" ").join(i+" "),function(a,e){a.stopPropagation(),b.setPageSize(c,parseInt(e,10)||g.setSize||10,d),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}).on("pageSet pagerUpdate ".split(" ").join(i+" "),function(a,e){a.stopPropagation(),"pagerUpdate"===a.type&&(e="undefined"==typeof e?g.page+1:e,g.last.page=!0),g.page=(parseInt(e,10)||1)-1,b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}).on("pageAndSize"+i,function(a,e,f){a.stopPropagation(),g.page=(parseInt(e,10)||1)-1,b.setPageSize(c,parseInt(f,10)||g.setSize||10,d),b.moveToPage(c,g,!0),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}),e=[j.first,j.prev,j.next,j.last],f=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],d.debug&&!g.$container.length&&console.warn("Pager: >> Container not found"),g.$container.find(e.join(",")).attr("tabindex",0).off("click"+i).on("click"+i,function(d){d.stopPropagation();var i,j=a(this),k=e.length;if(!j.hasClass(h.pager_css.disabled))for(i=0;k>i;i++)if(j.is(e[i])){b[f[i]](c,g);break}}),g.$goto.length?g.$goto.off("change"+i).on("change"+i,function(){g.page=a(this).val()-1,b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}):d.debug&&console.warn("Pager: >> Goto selector not found"),g.$size.length?(g.$size.find("option").removeAttr("selected"),g.$size.off("change"+i).on("change"+i,function(){return g.$size.val(a(this).val()),a(this).hasClass(h.pager_css.disabled)||(b.setPageSize(c,parseInt(a(this).val(),10),d),b.changeHeight(c,d)),!1})):d.debug&&console.warn("Pager: >> Size selector not found")},pagerArrows:function(a,b){var c=a.pager,d=!!b,e=d||0===c.page,f=Math.min(c.totalPages,c.filteredPages),g=d||c.page===f-1||0===f,h=a.widgetOptions,i=h.pager_selectors;h.pager_updateArrows&&(c.$container.find(i.first+","+i.prev).toggleClass(h.pager_css.disabled,e).attr("aria-disabled",e),c.$container.find(i.next+","+i.last).toggleClass(h.pager_css.disabled,g).attr("aria-disabled",g))},calcFilters:function(b,c){var d,e,f,g=c.widgetOptions,h=c.pager,i=c.$table.hasClass("hasFilters");if(i&&!g.pager_ajaxUrl)if(a.isEmptyObject(c.cache))h.filteredRows=h.totalRows=c.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+c.cssChildRow).length;else for(h.filteredRows=0,d=c.cache[0].normalized,f=d.length,e=0;f>e;e++)h.filteredRows+=h.regexRows.test(d[e][c.columns].$row[0].className)?0:1;else i||(h.filteredRows=h.totalRows)},updatePageDisplay:function(d,e,f){if(!e.pager.initializing){var g,h,i,j,k,l,m=e.widgetOptions,n=e.pager,o=e.namespace+"pager",p=n.size||n.setSize||10;if(m.pager_countChildRows&&h.push(e.cssChildRow),n.$size.add(n.$goto).removeClass(m.pager_css.disabled).removeAttr("disabled").attr("aria-disabled","false"),n.totalPages=Math.ceil(n.totalRows/p),e.totalRows=n.totalRows,b.calcFilters(d,e),e.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/p)||0,Math.min(n.totalPages,n.filteredPages)>=0){if(h=n.size*n.page>n.filteredRows&&f,n.page=h?m.pager_pageReset||0:n.page,n.startRow=h?n.size*n.page+1:0===n.filteredRows?0:n.size*n.page+1,n.endRow=Math.min(n.filteredRows,n.totalRows,n.size*(n.page+1)),i=n.$container.find(m.pager_selectors.pageDisplay),g=(n.ajaxData&&n.ajaxData.output?n.ajaxData.output||m.pager_output:m.pager_output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return n.totalPages?n.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,d=a.replace(/[{}\s]/g,""),e=d.split(":"),f=n.ajaxData,g=/(rows?|pages?)$/i.test(d)?0:"";return/(startRow|page)/.test(e[0])&&"input"===e[1]?(b=(""+("page"===e[0]?n.totalPages:n.totalRows)).length,c="page"===e[0]?n.page+1:n.startRow,''):e.length>1&&f&&f[e[0]]?f[e[0]][e[1]]:n[d]||(f?f[d]:g)||g}),n.$goto.length){for(h="",j=b.buildPageSelect(n,e),l=j.length,k=0;l>k;k++)h+='";n.$goto.html(h).val(n.page+1)}i.length&&(i["INPUT"===i[0].nodeName?"val":"html"](g),i.find(".ts-startRow, .ts-page").off("change"+o).on("change"+o,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/n.size)+1:b;e.$table.trigger("pageSet"+o,[c])}))}b.pagerArrows(e),b.fixHeight(d,e),n.initialized&&f!==!1&&(e.debug&&console.log("Pager: Triggering pagerComplete"),e.$table.trigger("pagerComplete",e),m.pager_savePages&&c.storage&&c.storage(d,m.pager_storageKey,{page:n.page,size:n.size}))}},buildPageSelect:function(b,c){var d,e,f,g,h,i,j=c.widgetOptions,k=Math.min(b.totalPages,b.filteredPages)||1,l=5*Math.ceil(k/j.pager_maxOptionSize/5),m=k>j.pager_maxOptionSize,n=b.page+1,o=l,p=k-l,q=[1],r=m?l:1;for(d=r;k>=d;)q.push(d),d+=m?l:1;if(q.push(k),m){for(f=[],e=Math.max(Math.floor(j.pager_maxOptionSize/l)-1,5),o=n-e,1>o&&(o=1),p=n+e,p>k&&(p=k),d=o;p>=d;d++)f.push(d);q=a.grep(q,function(b,c){return a.inArray(b,q)===c}),h=q.length,i=f.length,h-i>l/2&&h+i>j.pager_maxOptionSize&&(g=Math.floor(h/2)-Math.floor(i/2),Array.prototype.splice.apply(q,[g,i])),q=q.concat(f)}return q=a.grep(q,function(b,c){return a.inArray(b,q)===c}).sort(function(a,b){return a-b})},fixHeight:function(b,c){var d,e,f=c.pager,g=c.widgetOptions,h=c.$tbodies.eq(0);h.find("tr.pagerSavedHeightSpacer").remove(),g.pager_fixedHeight&&!f.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-h.height(),d>5&&a.data(b,"pagerLastSize")===f.size&&h.children("tr:visible").length')))},changeHeight:function(c,d){var e,f=d.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),e=f.children("tr").eq(0).height()*d.pager.size,a.data(c,"pagerSavedHeight",e),b.fixHeight(c,d),a.data(c,"pagerLastSize",d.pager.size)},hideRows:function(a,b){if(!b.widgetOptions.pager_ajaxUrl){var d,e,f,g,h,i=b.pager,j=b.widgetOptions,k=b.$tbodies.length,l=i.page*i.size,m=l+i.size,n=j&&j.filter_filteredRow||"filtered",o=0,p=0;for(i.cacheIndex=[],d=0;k>d;d++){for(f=b.$tbodies.eq(d).children("tr"),g=f.length,h=0,o=0,p=0,e=0;g>e;e++)f[e].className.match(n)||(p===l&&f[e].className.match(b.cssChildRow)?f[e].style.display="none":(f[e].style.display=p>=l&&m>p?"":"none",o!==p&&p>=l&&m>p&&(i.cacheIndex.push(e),o=p),p+=f[e].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!j.pager_countChildRows?0:1,p===m&&"none"!==f[e].style.display&&f[e].className.match(c.css.cssHasChild)&&(h=e)));if(h>0&&f[h].className.match(c.css.cssHasChild))for(;++h> Ajax Error",g,h),c.showError(e,h.message+" ("+g.status+")"),f.$tbodies.eq(0).children("tr").detach(),i.totalRows=0;else{if(a.isArray(A)?(m=isNaN(A[0])&&!isNaN(A[1]),w=A[m?1:0],i.totalRows=isNaN(w)?i.totalRows||0:w,f.totalRows=f.filteredRows=i.filteredRows=i.totalRows,u=0===i.totalRows?[]:A[m?0:1]||[],t=A[2]):(i.ajaxData=A,f.totalRows=i.totalRows=A.total,f.filteredRows=i.filteredRows="undefined"!=typeof A.filteredRows?A.filteredRows:A.total,t=A.headers,u=A.rows||[]),v=u&&u.length,u instanceof jQuery)j.pager_processAjaxOnInit&&(f.$tbodies.eq(0).children("tr").detach(),f.$tbodies.eq(0).append(u));else if(v){for(k=0;v>k;k++){for(z+="",l=0;l"+u[k][l]+"";z+=""}j.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(z)}if(j.pager_processAjaxOnInit=!0,t&&t.length===B)for(n=y.hasClass("hasStickyHeaders"),p=n?j.$sticky.children("thead:first").children("tr").children():"",o=y.find("tfoot tr:first").children(),q=f.$headers.filter("th "),x=q.length,l=0;x>l;l++)r=q.eq(l),r.find("."+c.css.icon).length?(s=r.find("."+c.css.icon).clone(!0),r.find(".tablesorter-header-inner").html(t[l]).append(s),n&&p.length&&(s=p.eq(l).find("."+c.css.icon).clone(!0),p.eq(l).find(".tablesorter-header-inner").html(t[l]).append(s))):(r.find(".tablesorter-header-inner").html(t[l]),n&&p.length&&p.eq(l).find(".tablesorter-header-inner").html(t[l])),o.eq(l).html(t[l])}f.showProcessing&&c.isProcessing(e),i.totalPages=Math.ceil(i.totalRows/(i.size||i.setSize||10)),i.last.totalRows=i.totalRows,i.last.currentFilters=i.currentFilters,i.last.sortList=(f.sortList||[]).join(","),i.initializing=!1,b.updatePageDisplay(e,f,!1),y.trigger("updateCache",[function(){i.initialized&&setTimeout(function(){f.debug&&console.log("Pager: Triggering pagerChange"),y.trigger("applyWidgets").trigger("pagerChange",i),b.updatePageDisplay(e,f)},0)}])}i.initialized||f.$table.trigger("applyWidgets")},getAjax:function(d,e){var f,g=b.getAjaxUrl(d,e),h=a(document),i=e.namespace+"pager",j=e.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError"+i,function(a,c,f,g){b.renderAjax(null,d,e,c,g),h.off("ajaxError"+i)}),f=++j.ajaxCounter,j.last.ajaxUrl=g,j.ajaxObject.url=g,j.ajaxObject.success=function(a,c,g){fd;d++)m.push(k+"["+i[d][0]+"]="+i[d][1]);h=h.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):k),m=[]}if(l){for(l=l[1],e=j.length,d=0;e>d;d++)j[d]&&m.push(l+"["+d+"]="+encodeURIComponent(j[d]));h=h.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),f.currentFilters=j}return a.isFunction(g.pager_customAjaxUrl)&&(h=g.pager_customAjaxUrl(b,h)),c.debug&&console.log("Pager: Ajax url = "+h),h},renderTable:function(a,d){var e,f,g,h,i=a.config,j=i.pager,k=i.widgetOptions,l=i.$table.hasClass("hasFilters"),m=d&&d.length||0,n=j.page*j.size,o=j.size;if(1>m)return void(i.debug&&console.warn("Pager: >> No rows for pager to render"));if(j.page>=j.totalPages)return b.moveToLastPage(a,j);if(j.cacheIndex=[],j.isDisabled=!1,j.initialized&&(i.debug&&console.log("Pager: Triggering pagerChange"),i.$table.trigger("pagerChange",i)),k.pager_removeRows){for(c.clearTableBody(a),e=c.processTbody(a,i.$tbodies.eq(0),!0),f=l?0:n,g=l?0:n,h=0;o>h&&fn&&o>=h&&(h++,j.cacheIndex.push(f),e.append(d[f]))),f++;c.processTbody(a,e,!1)}else b.hideRows(a,i);b.updatePageDisplay(a,i),k.pager_startPage=j.page,k.pager_size=j.size,a.isUpdating&&(i.debug&&console.log("Pager: Triggering updateComplete"),i.$table.trigger("updateComplete",[a,!0]))},showAllRows:function(c,d){var e,f,g,h=d.pager,i=d.widgetOptions;for(h.ajax?b.pagerArrows(d,!0):(h.isDisabled=!0,a.data(c,"pagerLastPage",h.page),a.data(c,"pagerLastSize",h.size),h.page=0,h.size=h.totalRows,h.totalPages=1,d.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(c,d.rowsCopy),d.$table.trigger("applyWidgets"),d.debug&&console.log("Pager: Disabled")),f=h.$size.add(h.$goto).add(h.$container.find(".ts-startRow, .ts-page ")),g=f.length,e=0;g>e;e++)f.eq(e).attr("aria-disabled","true").addClass(i.pager_css.disabled)[0].disabled=!0},updateCache:function(c){var d=c.config,e=d.pager;d.$table.trigger("updateCache",[function(){if(!a.isEmptyObject(c.config.cache)){var f,g=[],h=c.config.cache[0].normalized;for(e.totalRows=h.length,f=0;fg-1&&0!==g&&(e.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,e.currentFilters=""===(e.currentFilters||[]).join("")?[]:e.currentFilters,(j.page!==e.page||j.size!==e.size||j.totalRows!==e.totalRows||(j.currentFilters||[]).join(",")!==(e.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(e.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(i.pager_ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&console.log("Pager: Changing to page "+e.page),e.last={page:e.page,size:e.size,sortList:(h.sortList||[]).join(","),totalRows:e.totalRows,currentFilters:e.currentFilters||[],ajaxUrl:e.ajaxObject.url||"",optAjaxUrl:i.pager_ajaxUrl},e.ajax?b.getAjax(d,h):e.ajax||b.renderTable(d,h.rowsCopy),a.data(d,"pagerLastPage",e.page),e.initialized&&f!==!1&&(h.debug&&console.log("Pager: Triggering pageMoved"),h.$table.trigger("pageMoved",h).trigger("applyWidgets"),!e.ajax&&d.isUpdating&&(h.debug&&console.log("Pager: Triggering updateComplete"),h.$table.trigger("updateComplete",[d,!0])))))}},setPageSize:function(c,d,e){var f=e.pager;f.size=d||f.size||f.setSize||10,f.$size.val(f.size),a.data(c,"pagerLastPage",f.page),a.data(c,"pagerLastSize",f.size),f.totalPages=Math.ceil(f.totalRows/f.size),f.filteredPages=Math.ceil(f.filteredRows/f.size),b.moveToPage(c,f,!0)},moveToFirstPage:function(a,c){c.page=0,b.moveToPage(a,c,!0)},moveToLastPage:function(a,c){c.page=Math.min(c.totalPages,c.filteredPages)-1,b.moveToPage(a,c,!0)},moveToNextPage:function(a,c){c.page++,c.page>=Math.min(c.totalPages,c.filteredPages)-1&&(c.page=Math.min(c.totalPages,c.filteredPages)-1),b.moveToPage(a,c,!0)},moveToPrevPage:function(a,c){c.page--,c.page<=0&&(c.page=0),b.moveToPage(a,c,!0)},destroyPager:function(d,e,f){var g=e.pager,h=e.namespace+"pager";g.initialized=!1,e.$table.off(a.trim(g.events.split(" ").join(h+" "))),f||(b.showAllRows(d,e),g.$container.hide(),e.appender=null,delete d.config.rowsCopy,c.storage&&c.storage(d,e.widgetOptions.pager_storageKey,""))},enablePager:function(c,d,e){var f,g=d.pager;g.isDisabled=!1,g.page=a.data(c,"pagerLastPage")||g.page||0,g.size=a.data(c,"pagerLastSize")||parseInt(g.$size.find("option[selected]").val(),10)||g.size||g.setSize||10,g.$size.val(g.size),g.totalPages=Math.ceil(Math.min(g.totalRows,g.filteredRows)/g.size),d.$table.removeClass("pagerDisabled"),c.id&&(f=c.id+"_pager_info",g.$container.find(d.widgetOptions.pager_selectors.pageDisplay).attr("id",f),d.$table.attr("aria-describedby",f)),b.changeHeight(c,d),e&&(d.$table.trigger("updateRows"),b.setPageSize(c,g.size,d),b.hideRowsSetup(c,d),d.debug&&console.log("Pager: Enabled"))},appender:function(c,d){var e=c.config,f=e.widgetOptions,g=e.pager;g.ajax?b.moveToPage(c,g,!0):(e.rowsCopy=d,g.totalRows=f.pager_countChildRows?e.$tbodies.eq(0).children("tr").length:d.length,g.size=a.data(c,"pagerLastSize")||g.size||f.pager_size||g.setSize||10,g.totalPages=Math.ceil(g.totalRows/g.size),b.moveToPage(c,g),b.updatePageDisplay(c,e,!1))}},c.showError=function(b,c){var d,e,f,g,h,i=a(b),j=i.length;for(d=0;j>d;d++)f=i[d].config,f&&(g=f.widgetOptions,h=f.pager&&f.pager.cssErrorRow||g.pager_css&&g.pager_css.errorRow||"tablesorter-errorRow","undefined"==typeof c?f.$table.find("thead").find(f.selectorRemove).remove():e=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(f.$table.find("thead:first")).addClass(h+" "+f.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))}}(jQuery); \ No newline at end of file +!function(a){"use strict";var b,c=a.tablesorter;c.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(a,b){return b},pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(a){return[0,[],null]},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(a){b.init(a)},format:function(a,c){return c.pager&&c.pager.initialized?void b.moveToPage(a,c.pager,!1):b.initComplete(a,c)},remove:function(a,c,d,e){b.destroyPager(a,c,e)}}),b=c.pager={init:function(d){if(!d.hasInitialized||!d.config.pager.initialized){var e,f=d.config,g=f.widgetOptions,h=g.pager_selectors,i=f.pager=a.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:g.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:g.pager_size,setPage:g.pager_startPage,events:"filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete "},f.pager);i.isInitializing||(i.isInitializing=!0,f.debug&&console.log("Pager: Initializing"),i.size=a.data(d,"pagerLastSize")||g.pager_size,i.$container=a(h.container).addClass(g.pager_css.container).show(),i.$goto=i.$container.find(h.gotoPage),i.$size=i.$container.find(h.pageSize),i.totalRows=f.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+f.cssChildRow).length,i.oldAjaxSuccess=i.oldAjaxSuccess||g.pager_ajaxObject.success,f.appender=b.appender,i.initializing=!0,g.pager_savePages&&c.storage&&(e=c.storage(d,g.pager_storageKey)||{},i.page=(isNaN(e.page)?i.page:e.page)||i.setPage||0,i.size=(isNaN(e.size)?i.size:e.size)||i.setSize||10,a.data(d,"pagerLastSize",i.size)),i.regexRows=new RegExp("("+(g.filter_filteredRow||"filtered")+"|"+f.selectorRemove.slice(1)+"|"+f.cssChildRow+")"),i.initialized=!1,f.$table.trigger("pagerBeforeInitialized",f),b.enablePager(d,f,!1),i.ajaxObject=g.pager_ajaxObject,i.ajaxObject.url=g.pager_ajaxUrl,"string"==typeof g.pager_ajaxUrl?(i.ajax=!0,g.filter_serversideFiltering=!0,f.serverSideSorting=!0,b.moveToPage(d,i)):(i.ajax=!1,f.$table.trigger("appendCache",[{},!0])))}},initComplete:function(a,d){var e=d.pager;b.bindEvents(a,d),b.setPageSize(a,0,d),e.ajax||b.hideRowsSetup(a,d),e.initialized=!0,e.initializing=!1,e.isInitializing=!1,d.debug&&console.log("Pager: Triggering pagerInitialized"),d.$table.trigger("pagerInitialized",d),d.widgetOptions.filter_initialized&&c.hasWidget(a,"filter")||b.updatePageDisplay(a,d,!e.ajax)},bindEvents:function(c,d){var e,f,g=d.pager,h=d.widgetOptions,i=d.namespace+"pager",j=h.pager_selectors;d.$table.off(a.trim(g.events.split(" ").join(i+" "))).on("filterInit filterStart ".split(" ").join(i+" "),function(b,c){g.currentFilters=a.isArray(c)?c:d.$table.data("lastSearch"),"filterStart"===b.type&&h.pager_pageReset!==!1&&(d.lastCombinedFilter||"")!==(g.currentFilters||[]).join("")&&(g.page=h.pager_pageReset)}).on("filterEnd sortEnd ".split(" ").join(i+" "),function(){g.currentFilters=d.$table.data("lastSearch"),(g.initialized||g.initializing)&&(d.delayInit&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"))}).on("disablePager"+i,function(a){a.stopPropagation(),b.showAllRows(c,d)}).on("enablePager"+i,function(a){a.stopPropagation(),b.enablePager(c,d,!0)}).on("destroyPager"+i,function(a,e){a.stopPropagation(),b.destroyPager(c,d,e)}).on("updateComplete"+i,function(a,c,e){if(a.stopPropagation(),c&&!e&&!g.ajax){var f=d.$tbodies.eq(0).children("tr").not(d.selectorRemove);g.totalRows=f.length-(h.pager_countChildRows?0:f.filter("."+d.cssChildRow).length),g.totalPages=Math.ceil(g.totalRows/g.size),f.length&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),g.page>=g.totalPages&&b.moveToLastPage(c,g),b.hideRows(c,d),b.changeHeight(c,d),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"),b.updatePageDisplay(c,d)}}).on("pageSize refreshComplete ".split(" ").join(i+" "),function(a,e){a.stopPropagation(),b.setPageSize(c,parseInt(e,10)||g.setSize||10,d),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}).on("pageSet pagerUpdate ".split(" ").join(i+" "),function(a,e){a.stopPropagation(),"pagerUpdate"===a.type&&(e="undefined"==typeof e?g.page+1:e,g.last.page=!0),g.page=(parseInt(e,10)||1)-1,b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}).on("pageAndSize"+i,function(a,e,f){a.stopPropagation(),g.page=(parseInt(e,10)||1)-1,b.setPageSize(c,parseInt(f,10)||g.setSize||10,d),b.moveToPage(c,g,!0),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}),e=[j.first,j.prev,j.next,j.last],f=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],d.debug&&!g.$container.length&&console.warn("Pager: >> Container not found"),g.$container.find(e.join(",")).attr("tabindex",0).off("click"+i).on("click"+i,function(d){d.stopPropagation();var i,j=a(this),k=e.length;if(!j.hasClass(h.pager_css.disabled))for(i=0;k>i;i++)if(j.is(e[i])){b[f[i]](c,g);break}}),g.$goto.length?g.$goto.off("change"+i).on("change"+i,function(){g.page=a(this).val()-1,b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}):d.debug&&console.warn("Pager: >> Goto selector not found"),g.$size.length?(g.$size.find("option").removeAttr("selected"),g.$size.off("change"+i).on("change"+i,function(){return g.$size.val(a(this).val()),a(this).hasClass(h.pager_css.disabled)||(b.setPageSize(c,parseInt(a(this).val(),10),d),b.changeHeight(c,d)),!1})):d.debug&&console.warn("Pager: >> Size selector not found")},pagerArrows:function(a,b){var c=a.pager,d=!!b,e=d||0===c.page,f=Math.min(c.totalPages,c.filteredPages),g=d||c.page===f-1||0===f,h=a.widgetOptions,i=h.pager_selectors;h.pager_updateArrows&&(c.$container.find(i.first+","+i.prev).toggleClass(h.pager_css.disabled,e).attr("aria-disabled",e),c.$container.find(i.next+","+i.last).toggleClass(h.pager_css.disabled,g).attr("aria-disabled",g))},calcFilters:function(b,c){var d,e,f,g=c.widgetOptions,h=c.pager,i=c.$table.hasClass("hasFilters");if(i&&!g.pager_ajaxUrl)if(a.isEmptyObject(c.cache))h.filteredRows=h.totalRows=c.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+c.cssChildRow).length;else for(h.filteredRows=0,d=c.cache[0].normalized,f=d.length,e=0;f>e;e++)h.filteredRows+=h.regexRows.test(d[e][c.columns].$row[0].className)?0:1;else i||(h.filteredRows=h.totalRows)},updatePageDisplay:function(d,e,f){if(!e.pager.initializing){var g,h,i,j,k,l,m=e.widgetOptions,n=e.pager,o=e.namespace+"pager",p=n.size||n.setSize||10;if(m.pager_countChildRows&&h.push(e.cssChildRow),n.$size.add(n.$goto).removeClass(m.pager_css.disabled).removeAttr("disabled").attr("aria-disabled","false"),n.totalPages=Math.ceil(n.totalRows/p),e.totalRows=n.totalRows,b.calcFilters(d,e),e.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/p)||0,Math.min(n.totalPages,n.filteredPages)>=0){if(h=n.size*n.page>n.filteredRows&&f,n.page=h?m.pager_pageReset||0:n.page,n.startRow=h?n.size*n.page+1:0===n.filteredRows?0:n.size*n.page+1,n.endRow=Math.min(n.filteredRows,n.totalRows,n.size*(n.page+1)),i=n.$container.find(m.pager_selectors.pageDisplay),g=(n.ajaxData&&n.ajaxData.output?n.ajaxData.output||m.pager_output:m.pager_output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return n.totalPages?n.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,d=a.replace(/[{}\s]/g,""),e=d.split(":"),f=n.ajaxData,g=/(rows?|pages?)$/i.test(d)?0:"";return/(startRow|page)/.test(e[0])&&"input"===e[1]?(b=(""+("page"===e[0]?n.totalPages:n.totalRows)).length,c="page"===e[0]?n.page+1:n.startRow,''):e.length>1&&f&&f[e[0]]?f[e[0]][e[1]]:n[d]||(f?f[d]:g)||g}),n.$goto.length){for(h="",j=b.buildPageSelect(n,e),l=j.length,k=0;l>k;k++)h+='";n.$goto.html(h).val(n.page+1)}i.length&&(i["INPUT"===i[0].nodeName?"val":"html"](g),i.find(".ts-startRow, .ts-page").off("change"+o).on("change"+o,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/n.size)+1:b;e.$table.trigger("pageSet"+o,[c])}))}b.pagerArrows(e),b.fixHeight(d,e),n.initialized&&f!==!1&&(e.debug&&console.log("Pager: Triggering pagerComplete"),e.$table.trigger("pagerComplete",e),m.pager_savePages&&c.storage&&c.storage(d,m.pager_storageKey,{page:n.page,size:n.size}))}},buildPageSelect:function(b,c){var d,e,f,g,h,i,j=c.widgetOptions,k=Math.min(b.totalPages,b.filteredPages)||1,l=5*Math.ceil(k/j.pager_maxOptionSize/5),m=k>j.pager_maxOptionSize,n=b.page+1,o=l,p=k-l,q=[1],r=m?l:1;for(d=r;k>=d;)q.push(d),d+=m?l:1;if(q.push(k),m){for(f=[],e=Math.max(Math.floor(j.pager_maxOptionSize/l)-1,5),o=n-e,1>o&&(o=1),p=n+e,p>k&&(p=k),d=o;p>=d;d++)f.push(d);q=a.grep(q,function(b,c){return a.inArray(b,q)===c}),h=q.length,i=f.length,h-i>l/2&&h+i>j.pager_maxOptionSize&&(g=Math.floor(h/2)-Math.floor(i/2),Array.prototype.splice.apply(q,[g,i])),q=q.concat(f)}return q=a.grep(q,function(b,c){return a.inArray(b,q)===c}).sort(function(a,b){return a-b})},fixHeight:function(b,c){var d,e,f=c.pager,g=c.widgetOptions,h=c.$tbodies.eq(0);h.find("tr.pagerSavedHeightSpacer").remove(),g.pager_fixedHeight&&!f.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-h.height(),d>5&&a.data(b,"pagerLastSize")===f.size&&h.children("tr:visible").length')))},changeHeight:function(c,d){var e,f=d.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),e=f.children("tr").eq(0).height()*d.pager.size,a.data(c,"pagerSavedHeight",e),b.fixHeight(c,d),a.data(c,"pagerLastSize",d.pager.size)},hideRows:function(a,b){if(!b.widgetOptions.pager_ajaxUrl){var d,e,f,g,h,i=b.pager,j=b.widgetOptions,k=b.$tbodies.length,l=i.page*i.size,m=l+i.size,n=j&&j.filter_filteredRow||"filtered",o=0,p=0;for(i.cacheIndex=[],d=0;k>d;d++){for(f=b.$tbodies.eq(d).children("tr"),g=f.length,h=0,o=0,p=0,e=0;g>e;e++)f[e].className.match(n)||(p===l&&f[e].className.match(b.cssChildRow)?f[e].style.display="none":(f[e].style.display=p>=l&&m>p?"":"none",o!==p&&p>=l&&m>p&&(i.cacheIndex.push(e),o=p),p+=f[e].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!j.pager_countChildRows?0:1,p===m&&"none"!==f[e].style.display&&f[e].className.match(c.css.cssHasChild)&&(h=e)));if(h>0&&f[h].className.match(c.css.cssHasChild))for(;++h> Ajax Error",g,h),c.showError(e,h.message+" ("+g.status+")"),f.$tbodies.eq(0).children("tr").detach(),i.totalRows=0;else{if(a.isArray(A)?(m=isNaN(A[0])&&!isNaN(A[1]),w=A[m?1:0],i.totalRows=isNaN(w)?i.totalRows||0:w,f.totalRows=f.filteredRows=i.filteredRows=i.totalRows,u=0===i.totalRows?[]:A[m?0:1]||[],t=A[2]):(i.ajaxData=A,f.totalRows=i.totalRows=A.total,f.filteredRows=i.filteredRows="undefined"!=typeof A.filteredRows?A.filteredRows:A.total,t=A.headers,u=A.rows||[]),v=u&&u.length,u instanceof jQuery)j.pager_processAjaxOnInit&&(f.$tbodies.eq(0).children("tr").detach(),f.$tbodies.eq(0).append(u));else if(v){for(k=0;v>k;k++){for(z+="",l=0;l"+u[k][l]+"";z+=""}j.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(z)}if(j.pager_processAjaxOnInit=!0,t&&t.length===B)for(n=y.hasClass("hasStickyHeaders"),p=n?j.$sticky.children("thead:first").children("tr").children():"",o=y.find("tfoot tr:first").children(),q=f.$headers.filter("th "),x=q.length,l=0;x>l;l++)r=q.eq(l),r.find("."+c.css.icon).length?(s=r.find("."+c.css.icon).clone(!0),r.find(".tablesorter-header-inner").html(t[l]).append(s),n&&p.length&&(s=p.eq(l).find("."+c.css.icon).clone(!0),p.eq(l).find(".tablesorter-header-inner").html(t[l]).append(s))):(r.find(".tablesorter-header-inner").html(t[l]),n&&p.length&&p.eq(l).find(".tablesorter-header-inner").html(t[l])),o.eq(l).html(t[l])}f.showProcessing&&c.isProcessing(e),i.totalPages=Math.ceil(i.totalRows/(i.size||i.setSize||10)),i.last.totalRows=i.totalRows,i.last.currentFilters=i.currentFilters,i.last.sortList=(f.sortList||[]).join(","),i.initializing=!1,b.updatePageDisplay(e,f,!1),y.trigger("updateCache",[function(){i.initialized&&setTimeout(function(){f.debug&&console.log("Pager: Triggering pagerChange"),y.trigger("applyWidgets").trigger("pagerChange",i),b.updatePageDisplay(e,f)},0)}])}i.initialized||f.$table.trigger("applyWidgets")},getAjax:function(d,e){var f,g=b.getAjaxUrl(d,e),h=a(document),i=e.namespace+"pager",j=e.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError"+i,function(a,c,f,g){b.renderAjax(null,d,e,c,g),h.off("ajaxError"+i)}),f=++j.ajaxCounter,j.last.ajaxUrl=g,j.ajaxObject.url=g,j.ajaxObject.success=function(a,c,g){fd;d++)m.push(k+"["+i[d][0]+"]="+i[d][1]);h=h.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):k),m=[]}if(l){for(l=l[1],e=j.length,d=0;e>d;d++)j[d]&&m.push(l+"["+d+"]="+encodeURIComponent(j[d]));h=h.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),f.currentFilters=j}return a.isFunction(g.pager_customAjaxUrl)&&(h=g.pager_customAjaxUrl(b,h)),c.debug&&console.log("Pager: Ajax url = "+h),h},renderTable:function(a,d){var e,f,g,h,i=a.config,j=i.pager,k=i.widgetOptions,l=i.$table.hasClass("hasFilters"),m=d&&d.length||0,n=j.page*j.size,o=j.size;if(1>m)return void(i.debug&&console.warn("Pager: >> No rows for pager to render"));if(j.page>=j.totalPages)return b.moveToLastPage(a,j);if(j.cacheIndex=[],j.isDisabled=!1,j.initialized&&(i.debug&&console.log("Pager: Triggering pagerChange"),i.$table.trigger("pagerChange",i)),k.pager_removeRows){for(c.clearTableBody(a),e=c.processTbody(a,i.$tbodies.eq(0),!0),f=l?0:n,g=l?0:n,h=0;o>h&&fn&&o>=h&&(h++,j.cacheIndex.push(f),e.append(d[f]))),f++;c.processTbody(a,e,!1)}else b.hideRows(a,i);b.updatePageDisplay(a,i),k.pager_startPage=j.page,k.pager_size=j.size,a.isUpdating&&(i.debug&&console.log("Pager: Triggering updateComplete"),i.$table.trigger("updateComplete",[a,!0]))},showAllRows:function(c,d){var e,f,g,h=d.pager,i=d.widgetOptions;for(h.ajax?b.pagerArrows(d,!0):(h.isDisabled=!0,a.data(c,"pagerLastPage",h.page),a.data(c,"pagerLastSize",h.size),h.page=0,h.size=h.totalRows,h.totalPages=1,d.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(c,d.rowsCopy),d.$table.trigger("applyWidgets"),d.debug&&console.log("Pager: Disabled")),f=h.$size.add(h.$goto).add(h.$container.find(".ts-startRow, .ts-page ")),g=f.length,e=0;g>e;e++)f.eq(e).attr("aria-disabled","true").addClass(i.pager_css.disabled)[0].disabled=!0},updateCache:function(c){var d=c.config,e=d.pager;d.$table.trigger("updateCache",[function(){if(!a.isEmptyObject(c.config.cache)){var f,g=[],h=c.config.cache[0].normalized;for(e.totalRows=h.length,f=0;fg-1&&0!==g&&(e.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,e.currentFilters=""===(e.currentFilters||[]).join("")?[]:e.currentFilters,(j.page!==e.page||j.size!==e.size||j.totalRows!==e.totalRows||(j.currentFilters||[]).join(",")!==(e.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(e.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(i.pager_ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&console.log("Pager: Changing to page "+e.page),e.last={page:e.page,size:e.size,sortList:(h.sortList||[]).join(","),totalRows:e.totalRows,currentFilters:e.currentFilters||[],ajaxUrl:e.ajaxObject.url||"",optAjaxUrl:i.pager_ajaxUrl},e.ajax?b.getAjax(d,h):e.ajax||b.renderTable(d,h.rowsCopy),a.data(d,"pagerLastPage",e.page),e.initialized&&f!==!1&&(h.debug&&console.log("Pager: Triggering pageMoved"),h.$table.trigger("pageMoved",h).trigger("applyWidgets"),!e.ajax&&d.isUpdating&&(h.debug&&console.log("Pager: Triggering updateComplete"),h.$table.trigger("updateComplete",[d,!0])))))}},setPageSize:function(c,d,e){var f=e.pager;f.size=d||f.size||f.setSize||10,f.$size.val(f.size),a.data(c,"pagerLastPage",f.page),a.data(c,"pagerLastSize",f.size),f.totalPages=Math.ceil(f.totalRows/f.size),f.filteredPages=Math.ceil(f.filteredRows/f.size),b.moveToPage(c,f,!0)},moveToFirstPage:function(a,c){c.page=0,b.moveToPage(a,c,!0)},moveToLastPage:function(a,c){c.page=Math.min(c.totalPages,c.filteredPages)-1,b.moveToPage(a,c,!0)},moveToNextPage:function(a,c){c.page++,c.page>=Math.min(c.totalPages,c.filteredPages)-1&&(c.page=Math.min(c.totalPages,c.filteredPages)-1),b.moveToPage(a,c,!0)},moveToPrevPage:function(a,c){c.page--,c.page<=0&&(c.page=0),b.moveToPage(a,c,!0)},destroyPager:function(d,e,f){var g=e.pager,h=e.namespace+"pager";g.initialized=!1,e.$table.off(a.trim(g.events.split(" ").join(h+" "))),f||(b.showAllRows(d,e),g.$container.hide(),e.appender=null,delete d.config.rowsCopy,c.storage&&c.storage(d,e.widgetOptions.pager_storageKey,""))},enablePager:function(c,d,e){var f,g=d.pager;g.isDisabled=!1,g.page=a.data(c,"pagerLastPage")||g.page||0,g.size=a.data(c,"pagerLastSize")||parseInt(g.$size.find("option[selected]").val(),10)||g.size||g.setSize||10,g.$size.val(g.size),g.totalPages=Math.ceil(Math.min(g.totalRows,g.filteredRows)/g.size),d.$table.removeClass("pagerDisabled"),c.id&&(f=c.id+"_pager_info",g.$container.find(d.widgetOptions.pager_selectors.pageDisplay).attr("id",f),d.$table.attr("aria-describedby",f)),b.changeHeight(c,d),e&&(d.$table.trigger("updateRows"),b.setPageSize(c,g.size,d),b.hideRowsSetup(c,d),d.debug&&console.log("Pager: Enabled"))},appender:function(c,d){var e=c.config,f=e.widgetOptions,g=e.pager;g.ajax?b.moveToPage(c,g,!0):(e.rowsCopy=d,g.totalRows=f.pager_countChildRows?e.$tbodies.eq(0).children("tr").length:d.length,g.size=a.data(c,"pagerLastSize")||g.size||f.pager_size||g.setSize||10,g.totalPages=Math.ceil(g.totalRows/g.size),b.moveToPage(c,g),b.updatePageDisplay(c,e,!1))}},c.showError=function(b,c){var d,e,f,g,h,i=a(b),j=i.length;for(d=0;j>d;d++)f=i[d].config,f&&(g=f.widgetOptions,h=f.pager&&f.pager.cssErrorRow||g.pager_css&&g.pager_css.errorRow||"tablesorter-errorRow","undefined"==typeof c?f.$table.find("thead").find(f.selectorRemove).remove():e=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(f.$table.find("thead:first")).addClass(h+" "+f.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))}}(jQuery); \ No newline at end of file diff --git a/docs/example-pager-filtered.html b/docs/example-pager-filtered.html index 779806df..9507c64b 100644 --- a/docs/example-pager-filtered.html +++ b/docs/example-pager-filtered.html @@ -24,8 +24,9 @@ diff --git a/docs/index.html b/docs/index.html index cd5350e9..2a6ffbdc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -5074,11 +5074,12 @@ $('table').trigger( 'search', [['', '', '', '', 'orange']] ); // find orange in - - Calling this method will reveal the entire table, remove the pager functionality, and hide the actual pager (v2.0.16). + + Calling this method will reveal the entire table, remove the pager functionality, and hide the actual pager (v2.0.16; v2.23.0).
+

In v2.23.0, this method was changed from destroy.pager to destroyPager because of issues with unique namespacing.

$(function(){
-  $('table').trigger('destroy.pager');
+  $('table').trigger('destroyPager');
 });
The only way to restore the pager is to re-initialize the pager addon
@@ -5090,25 +5091,26 @@ $('table').trigger( 'search', [['', '', '', '', 'orange']] ); // find orange in - - This method will put the pager into a disabled state (v2.0.21.2). + + This method will put the pager into a disabled state (v2.0.21.2; v2.23.0).
-
+

In v2.23.0, this method was changed from disable.pager to disablePager because of issues with unique namespacing.

The disabled state will reveal all table rows and disable, but not hide, pager controls.
$(function(){
-  $('table').trigger('disable.pager');
+  $('table').trigger('disablePager');
 });
Example - - This method will re-enable the pager, but only from the disabled state (v2.0.21.2). + + This method will re-enable the pager, but only from the disabled state (v2.0.21.2; v2.23.0).
+

In v2.23.0, this method was changed from enable.pager to enablePager because of issues with unique namespacing.

$(function(){
-  $('table').trigger('enable.pager');
+  $('table').trigger('enablePager');
 });
Example diff --git a/js/jquery.tablesorter.combined.js b/js/jquery.tablesorter.combined.js index 3b07a2e6..0a8d01e5 100644 --- a/js/jquery.tablesorter.combined.js +++ b/js/jquery.tablesorter.combined.js @@ -4,7 +4,7 @@ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██ █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀ */ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 75f2a226..f044c24a 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -4,7 +4,7 @@ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██ █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀ */ -/*! tablesorter (FORK) - updated 07-29-2015 (v2.22.5)*/ +/*! tablesorter (FORK) - updated 07-30-2015 (v2.22.5)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { diff --git a/js/widgets/widget-pager.js b/js/widgets/widget-pager.js index 363cc21e..6673d49e 100644 --- a/js/widgets/widget-pager.js +++ b/js/widgets/widget-pager.js @@ -145,7 +145,7 @@ // save original pager size setSize: wo.pager_size, setPage: wo.pager_startPage, - events: 'filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete ' + + events: 'filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete ' + 'pageSize pageSet pageAndSize pagerUpdate refreshComplete ' }, c.pager); @@ -257,15 +257,15 @@ c.$table.trigger('applyWidgets'); } }) - .on('disable' + namespace, function(e){ + .on('disablePager' + namespace, function(e){ e.stopPropagation(); tsp.showAllRows(table, c); }) - .on('enable' + namespace, function(e){ + .on('enablePager' + namespace, function(e){ e.stopPropagation(); tsp.enablePager(table, c, true); }) - .on('destroy' + namespace, function(e, refreshing){ + .on('destroyPager' + namespace, function(e, refreshing){ e.stopPropagation(); tsp.destroyPager(table, c, refreshing); })