diff --git a/dist/js/extras/jquery.tablesorter.pager.min.js b/dist/js/extras/jquery.tablesorter.pager.min.js index 432285a1..08849833 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 3/5/2015 (v2.21.0) */ -!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(){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 ",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(b,c){var d,e,f,g=b.config,h=g.$table.hasClass("hasFilters");if(h&&!c.ajaxUrl)if(a.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=d.size||d.settings.size||10;if(d.countChildRows&&k.push(p.cssChildRow),d.totalPages=Math.ceil(d.totalRows/q),p.totalRows=d.totalRows,f(c,d),p.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/q)||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].tagName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change.pager").bind("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;p.$table.trigger("pageSet.pager",[c])}))}e(d),i(c,d),d.initialized&&g!==!1&&(p.debug&&b.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+"]"),s.$tbodies.eq(0).children("tr").detach(),e.totalRows=0;else{if(a.isArray(v)?(n=isNaN(v[0])&&!isNaN(v[1]),r=v[n?1:0],e.totalRows=isNaN(r)?e.totalRows||0:r,s.totalRows=s.filteredRows=e.filteredRows=e.totalRows,p=0===e.totalRows?[""]:v[n?0:1]||[],o=v[2]):(e.ajaxData=v,s.totalRows=e.totalRows=v.total,s.filteredRows=e.filteredRows="undefined"!=typeof v.filteredRows?v.filteredRows:v.total,o=v.headers,p=v.rows),q=p&&p.length,p instanceof jQuery)e.processAjaxOnInit&&(s.$tbodies.eq(0).children("tr").detach(),s.$tbodies.eq(0).append(p));else if(q){for(i=0;q>i;i++){for(u+="",j=0;j"+p[i][j]+"";u+=""}e.processAjaxOnInit&&s.$tbodies.eq(0).html(u)}e.processAjaxOnInit=!0,o&&o.length===w&&(k=t.hasClass("hasStickyHeaders"),m=k?s.widgetOptions.$sticky.children("thead:first").children("tr").children():"",l=t.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(c){var d,e=a(this);e.find("."+b.css.icon).length?(d=e.find("."+b.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(o[c]).append(d),k&&m.length&&(d=m.eq(c).find("."+b.css.icon).clone(!0),m.eq(c).find(".tablesorter-header-inner").html(o[c]).append(d))):(e.find(".tablesorter-header-inner").html(o[c]),k&&m.length&&m.eq(c).find(".tablesorter-header-inner").html(o[c])),l.eq(c).html(o[c])}))}s.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=(s.sortList||[]).join(","),g(d,e,!1),t.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){s.debug&&b.log("Pager: Triggering pagerChange"),t.trigger("applyWidgets").trigger("pagerChange",e),g(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,d.config.debug&&b.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;""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError.pager",function(a,b,e,f){m(null,c,d,b,f),g.unbind("ajaxError.pager")}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){ee;e++)m.push(k+"["+i[e][0]+"]="+i[e][1]);h=h.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):k),m=[]}if(l){for(l=l[1],f=j.length,e=0;f>e;e++)j[e]&&m.push(l+"["+e+"]="+encodeURIComponent(j[e]));h=h.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),d.currentFilters=j}return"function"==typeof d.customAjaxUrl&&(h=d.customAjaxUrl(c,h)),g.debug&&b.log("Pager: Ajax url = "+h),h},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&&b.log("Pager: >> No rows for pager to render"));if(e.page>=e.totalPages&&v(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&(m.debug&&b.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&&b.log("Pager: Triggering updateComplete"),l.trigger("updateComplete",[c,!0]))},q=function(c,d){d.ajax?e(d,!0):(d.isDisabled=!0,a.data(c,"pagerLastPage",d.page),a.data(c,"pagerLastSize",d.size),d.page=0,d.size=d.totalRows,d.totalPages=1,a(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(c,c.config.rowsCopy,d),a(c).trigger("applyWidgets"),c.config.debug&&b.log("Pager: Disabled")),d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).each(function(){a(this).attr("aria-disabled","true").addClass(d.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&&b.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&&b.log("Pager: Triggering pageMoved"),i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&(h.debug&&b.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(),d.config.appender=null,e.initialized=!1,delete d.config.rowsCopy,a(d).unbind(c.split(" ").join(".pager ").replace(/\s+/g," ")),b.storage&&b.storage(d,e.storageKey,"")},z=function(c,d,e){var f,g=c.config;d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).removeClass(d.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),d.isDisabled=!1,d.page=a.data(c,"pagerLastPage")||d.page||0,d.size=a.data(c,"pagerLastSize")||parseInt(d.$size.find("option[selected]").val(),10)||d.size||d.settings.size||10,d.$size.val(d.size),d.totalPages=Math.ceil(Math.min(d.totalRows,d.filteredRows)/d.size),c.id&&(f=c.id+"_pager_info",d.$container.find(d.cssPageDisplay).attr("id",f),g.$table.attr("aria-describedby",f)),j(c,d),e&&(g.$table.trigger("updateRows"),t(c,d.size,d),l(c,d),g.debug&&b.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=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&b.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(".pager ").replace(/\s+/g," ")).bind("filterInit.pager filterStart.pager",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.pager sortEnd.pager",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.pager",function(a){a.stopPropagation(),q(m,p)}).bind("enable.pager",function(a){a.stopPropagation(),z(m,p,!0)}).bind("destroy.pager",function(a){a.stopPropagation(),y(m,p)}).bind("updateComplete.pager",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.pager refreshComplete.pager",function(a,b){a.stopPropagation(),t(m,parseInt(b,10)||p.settings.size||10,p),k(m,p),g(m,p,!1)}).bind("pageSet.pager pagerUpdate.pager",function(a,b){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,"pagerUpdate"===a.type&&(p.last.page=!0),s(m,p,!0),g(m,p,!1)}).bind("pageAndSize.pager",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&&!B.length&&b.log("Pager: >> Container not found"),B.find(h.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",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=B.find(p.cssGoto),p.$goto.length?p.$goto.unbind("change.pager").bind("change.pager",function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}):n.debug&&b.log("Pager: >> Goto selector not found"),p.$size=B.find(p.cssPageSize),p.$size.length?(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change.pager").bind("change.pager",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&&b.log("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&&b.log("Pager: Triggering pagerInitialized"),n.$table.trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1))}})}}}),b.showError=function(b,c){a(b).each(function(){var b,d=this.config,e=d.pager&&d.pager.cssErrorRow||d.widgetOptions.pager_css&&d.widgetOptions.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(e+" "+d.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(){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 ",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(b,c){var d,e,f,g=b.config,h=g.$table.hasClass("hasFilters");if(h&&!c.ajaxUrl)if(a.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=d.size||d.settings.size||10;if(d.countChildRows&&k.push(p.cssChildRow),d.totalPages=Math.ceil(d.totalRows/q),p.totalRows=d.totalRows,f(c,d),p.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/q)||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.pager").bind("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;p.$table.trigger("pageSet.pager",[c])}))}e(d),i(c,d),d.initialized&&g!==!1&&(p.debug&&b.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+"]"),s.$tbodies.eq(0).children("tr").detach(),e.totalRows=0;else{if(a.isArray(v)?(n=isNaN(v[0])&&!isNaN(v[1]),r=v[n?1:0],e.totalRows=isNaN(r)?e.totalRows||0:r,s.totalRows=s.filteredRows=e.filteredRows=e.totalRows,p=0===e.totalRows?[""]:v[n?0:1]||[],o=v[2]):(e.ajaxData=v,s.totalRows=e.totalRows=v.total,s.filteredRows=e.filteredRows="undefined"!=typeof v.filteredRows?v.filteredRows:v.total,o=v.headers,p=v.rows),q=p&&p.length,p instanceof jQuery)e.processAjaxOnInit&&(s.$tbodies.eq(0).children("tr").detach(),s.$tbodies.eq(0).append(p));else if(q){for(i=0;q>i;i++){for(u+="",j=0;j"+p[i][j]+"";u+=""}e.processAjaxOnInit&&s.$tbodies.eq(0).html(u)}e.processAjaxOnInit=!0,o&&o.length===w&&(k=t.hasClass("hasStickyHeaders"),m=k?s.widgetOptions.$sticky.children("thead:first").children("tr").children():"",l=t.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(c){var d,e=a(this);e.find("."+b.css.icon).length?(d=e.find("."+b.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(o[c]).append(d),k&&m.length&&(d=m.eq(c).find("."+b.css.icon).clone(!0),m.eq(c).find(".tablesorter-header-inner").html(o[c]).append(d))):(e.find(".tablesorter-header-inner").html(o[c]),k&&m.length&&m.eq(c).find(".tablesorter-header-inner").html(o[c])),l.eq(c).html(o[c])}))}s.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=(s.sortList||[]).join(","),g(d,e,!1),t.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){s.debug&&b.log("Pager: Triggering pagerChange"),t.trigger("applyWidgets").trigger("pagerChange",e),g(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,d.config.debug&&b.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;""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError.pager",function(a,b,e,f){m(null,c,d,b,f),g.unbind("ajaxError.pager")}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){ee;e++)m.push(k+"["+i[e][0]+"]="+i[e][1]);h=h.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):k),m=[]}if(l){for(l=l[1],f=j.length,e=0;f>e;e++)j[e]&&m.push(l+"["+e+"]="+encodeURIComponent(j[e]));h=h.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),d.currentFilters=j}return"function"==typeof d.customAjaxUrl&&(h=d.customAjaxUrl(c,h)),g.debug&&b.log("Pager: Ajax url = "+h),h},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&&b.log("Pager: >> No rows for pager to render"));if(e.page>=e.totalPages&&v(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&(m.debug&&b.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&&b.log("Pager: Triggering updateComplete"),l.trigger("updateComplete",[c,!0]))},q=function(c,d){d.ajax?e(d,!0):(d.isDisabled=!0,a.data(c,"pagerLastPage",d.page),a.data(c,"pagerLastSize",d.size),d.page=0,d.size=d.totalRows,d.totalPages=1,a(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(c,c.config.rowsCopy,d),a(c).trigger("applyWidgets"),c.config.debug&&b.log("Pager: Disabled")),d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).each(function(){a(this).attr("aria-disabled","true").addClass(d.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&&b.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&&b.log("Pager: Triggering pageMoved"),i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&(h.debug&&b.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(),d.config.appender=null,e.initialized=!1,delete d.config.rowsCopy,a(d).unbind(c.split(" ").join(".pager ").replace(/\s+/g," ")),b.storage&&b.storage(d,e.storageKey,"")},z=function(c,d,e){var f,g=c.config;d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).removeClass(d.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),d.isDisabled=!1,d.page=a.data(c,"pagerLastPage")||d.page||0,d.size=a.data(c,"pagerLastSize")||parseInt(d.$size.find("option[selected]").val(),10)||d.size||d.settings.size||10,d.$size.val(d.size),d.totalPages=Math.ceil(Math.min(d.totalRows,d.filteredRows)/d.size),c.id&&(f=c.id+"_pager_info",d.$container.find(d.cssPageDisplay).attr("id",f),g.$table.attr("aria-describedby",f)),j(c,d),e&&(g.$table.trigger("updateRows"),t(c,d.size,d),l(c,d),g.debug&&b.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=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&b.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(".pager ").replace(/\s+/g," ")).bind("filterInit.pager filterStart.pager",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.pager sortEnd.pager",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.pager",function(a){a.stopPropagation(),q(m,p)}).bind("enable.pager",function(a){a.stopPropagation(),z(m,p,!0)}).bind("destroy.pager",function(a){a.stopPropagation(),y(m,p)}).bind("updateComplete.pager",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.pager refreshComplete.pager",function(a,b){a.stopPropagation(),t(m,parseInt(b,10)||p.settings.size||10,p),k(m,p),g(m,p,!1)}).bind("pageSet.pager pagerUpdate.pager",function(a,b){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,"pagerUpdate"===a.type&&(p.last.page=!0),s(m,p,!0),g(m,p,!1)}).bind("pageAndSize.pager",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&&!B.length&&b.log("Pager: >> Container not found"),B.find(h.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",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=B.find(p.cssGoto),p.$goto.length?p.$goto.unbind("change.pager").bind("change.pager",function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}):n.debug&&b.log("Pager: >> Goto selector not found"),p.$size=B.find(p.cssPageSize),p.$size.length?(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change.pager").bind("change.pager",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&&b.log("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&&b.log("Pager: Triggering pagerInitialized"),n.$table.trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1))}})}}}),b.showError=function(b,c){a(b).each(function(){var b,d=this.config,e=d.pager&&d.pager.cssErrorRow||d.widgetOptions.pager_css&&d.widgetOptions.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(e+" "+d.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.js b/dist/js/jquery.tablesorter.js index 5db598f2..b79ad941 100644 --- a/dist/js/jquery.tablesorter.js +++ b/dist/js/jquery.tablesorter.js @@ -1067,7 +1067,7 @@ // save initial settings c.originalSettings = settings; // create a table from data (build table widget) - if (!table.hasInitialized && ts.buildTable && this.tagName !== 'TABLE') { + if (!table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE') { // return the table (in case the original target is the table's container) ts.buildTable(table, c); } else { @@ -1334,10 +1334,14 @@ ts.bindEvents = function(table, $headers, core){ table = $(table)[0]; - var downTarget = null, + var t, downTarget = null, c = table.config; if (core !== true) { c.$extraHeaders = c.$extraHeaders ? c.$extraHeaders.add($headers) : $headers; + t = $.fn.closest ? $headers.closest('table')[0] : $headers.parents('table')[0]; + if (t && t.nodeName === 'TABLE' && t !== table) { + c.$extraTables = c.$extraTables ? c.$extraTables.add(t) : $(t); + } } // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc) $headers @@ -1365,7 +1369,7 @@ } downTarget = null; // prevent sort being triggered on form elements - if ( /(input|select|button|textarea)/i.test(e.target.tagName) || + if ( /(input|select|button|textarea)/i.test(e.target.nodeName) || // nosort class name, or elements within a nosort container $target.hasClass(c.cssNoSort) || $target.parents('.' + c.cssNoSort).length > 0 || // elements within a button @@ -1374,7 +1378,7 @@ } if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); } // jQuery v1.2.6 doesn't have closest() - cell = $.fn.closest ? $(this).closest('th, td')[0] : /TH|TD/.test(this.tagName) ? this : $(this).parents('th, td')[0]; + cell = $.fn.closest ? $(this).closest('th, td')[0] : /TH|TD/.test(this.nodeName) ? this : $(this).parents('th, td')[0]; // reference original table headers and find the same cell cell = c.$headers[ $headers.index( cell ) ]; if (!cell.sortDisabled) { @@ -2052,8 +2056,8 @@ priority: 90, format: function(table, c, wo) { var $tb, $tv, $tr, row, even, time, k, - child = new RegExp(c.cssChildRow, 'i'), - b = c.$tbodies; + child = new RegExp(c.cssChildRow, 'i'), + b = c.$tbodies.add( c.$extraTables && c.$extraTables.children( 'tbody' ) ); if (c.debug) { time = new Date(); } diff --git a/dist/js/jquery.tablesorter.min.js b/dist/js/jquery.tablesorter.min.js index 3d5580ca..7097141e 100644 --- a/dist/js/jquery.tablesorter.min.js +++ b/dist/js/jquery.tablesorter.min.js @@ -1,3 +1,3 @@ /*! TableSorter (FORK) v2.21.2 */ -!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){"use strict";a.extend({tablesorter:new function(){function b(){var a=arguments[0],b=arguments.length>1?Array.prototype.slice.call(arguments):a;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(a)?"error":/warn/i.test(a)?"warn":"log"](b):alert(b)}function c(a,c){b(a+" ("+((new Date).getTime()-c.getTime())+"ms)")}function d(a){for(var b in a)return!1;return!0}function e(c,d,e,f){for(var g,h,i=c.config,j=u.parsers.length,k=!1,l="",m=!0;""===l&&m;)e++,d[e]?(k=d[e].cells[f],l=u.getElementText(i,k,f),h=a(k),c.config.debug&&b("Checking if value was empty on row "+e+", column: "+f+': "'+l+'"')):m=!1;for(;--j>=0;)if(g=u.parsers[j],g&&"text"!==g.id&&g.is&&g.is(l,c,k,h))return g;return u.getParserById("text")}function f(a){var d,f,g,h,i,j,k,l,m,n,o=a.config,p=o.$tbodies=o.$table.children("tbody:not(."+o.cssInfoBlock+")"),q=0,r="",s=p.length;if(0===s)return o.debug?b("Warning: *Empty table!* Not building a parser cache"):"";for(o.debug&&(n=new Date,b("Detecting parsers for each column")),f={extractors:[],parsers:[]};s>q;){if(d=p[q].rows,d.length)for(g=o.columns,h=0;g>h;h++)i=o.$headerIndexed[h],j=u.getColumnData(a,o.headers,h),m=u.getParserById(u.getData(i,j,"extractor")),l=u.getParserById(u.getData(i,j,"sorter")),k="false"===u.getData(i,j,"parser"),o.empties[h]=(u.getData(i,j,"empty")||o.emptyTo||(o.emptyToBottom?"bottom":"top")).toLowerCase(),o.strings[h]=(u.getData(i,j,"string")||o.stringTo||"max").toLowerCase(),k&&(l=u.getParserById("no-parser")),m||(m=!1),l||(l=e(a,d,-1,h)),o.debug&&(r+="column:"+h+"; extractor:"+m.id+"; parser:"+l.id+"; string:"+o.strings[h]+"; empty: "+o.empties[h]+"\n"),f.parsers[h]=l,f.extractors[h]=m;q+=f.parsers.length?s:1}o.debug&&(b(r?r:"No parsers detected"),c("Completed detecting parsers",n)),o.parsers=f.parsers,o.extractors=f.extractors}function g(d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r=d.config,s=r.$tbodies,t=r.extractors,v=r.parsers;if(r.cache={},r.totalRows=0,!v)return r.debug?b("Warning: *Empty table!* Not building a cache"):"";for(r.debug&&(n=new Date),r.showProcessing&&u.isProcessing(d,!0),k=0;ki;++i)if(p={child:[],raw:[]},l=a(s[k].rows[i]),m=[],l.hasClass(r.cssChildRow)&&0!==i)f=e.normalized.length-1,e.normalized[f][r.columns].$row=e.normalized[f][r.columns].$row.add(l),l.prev().hasClass(r.cssChildRow)||l.prev().addClass(u.css.cssHasChild),p.child[f]=a.trim(l[0].textContent||l.text()||"");else{for(p.$row=l,p.order=i,j=0;ji;i++)o.push(e[i][l.columns].$row),l.appender&&(!l.pager||l.pager.removeRows&&m.pager_removeRows||l.pager.ajax)||h.append(e[i][l.columns].$row);u.processTbody(a,h,!1)}l.appender&&l.appender(a,o),l.debug&&c("Rebuilt table",k),b||l.appender||u.applyWidget(a),a.isUpdating&&l.$table.trigger("updateComplete",a)}function i(a){return/^d/i.test(a)||1===a}function j(d){var e,f,g,h,j,k,m,n,o=d.config;for(o.headerList=[],o.headerContent=[],o.debug&&(m=new Date),o.columns=u.computeColumnIndex(o.$table.children("thead, tfoot").children("tr")),h=o.cssIcon?'':"",o.$headers=a(a.map(a(d).find(o.selectorHeaders),function(b,c){return f=a(b),f.parent().hasClass(o.cssIgnoreRow)?void 0:(e=u.getColumnData(d,o.headers,c,!0),o.headerContent[c]=f.html(),""===o.headerTemplate||f.find("."+u.css.headerIn).length||(j=o.headerTemplate.replace(/\{content\}/g,f.html()).replace(/\{icon\}/g,f.find("."+u.css.icon).length?"":h),o.onRenderTemplate&&(g=o.onRenderTemplate.apply(f,[c,j]),g&&"string"==typeof g&&(j=g)),f.html('
'+j+"
")),o.onRenderHeader&&o.onRenderHeader.apply(f,[c,o,o.$table]),b.column=parseInt(f.attr("data-column"),10),b.order=i(u.getData(f,e,"sortInitialOrder")||o.sortInitialOrder)?[1,0,2]:[0,1,2],b.count=-1,b.lockedOrder=!1,k=u.getData(f,e,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(b.order=b.lockedOrder=i(k)?[1,1,1]:[0,0,0]),f.addClass(u.css.header+" "+o.cssHeader),o.headerList[c]=b,f.parent().addClass(u.css.headerRow+" "+o.cssHeaderRow).attr("role","row"),o.tabIndex&&f.attr("tabindex",0),b)})),o.$headerIndexed=[],n=0;nd;d++)if(2!==g[d][1]&&(c=f.$headers.not(".sorter-false").filter('[data-column="'+g[d][0]+'"]'+(1===h?":last":"")),c.length)){for(e=0;eh;h++)if(k=m[h],d=parseInt(k[0],10),g=l.$headerIndexed[d][0]){switch(e=(""+k[1]).match(/^(1|d|s|o|n)/),e=e?e[0]:""){case"1":case"d":e=1;break;case"s":e=i||0;break;case"o":j=g.order[(i||0)%(l.sortReset?3:2)],e=0===j?1:1===j?0:2;break;case"n":g.count=g.count+1,e=g.order[g.count%(l.sortReset?3:2)];break;default:e=0}i=0===h?e:i,f=[d,parseInt(e,10)||0],l.sortList.push(f),e=a.inArray(f[1],g.order),g.count=e>=0?e:f[1]%(l.sortReset?3:2)}}function o(a,b){return a&&a[b]?a[b].type||"":""}function p(b,c,d){if(b.isUpdating)return setTimeout(function(){p(b,c,d)},50);var e,f,g,i,j,k=b.config,l=!d[k.sortMultiSortKey],n=k.$table;if(n.trigger("sortStart",b),c.count=d[k.sortResetKey]?2:(c.count+1)%(k.sortReset?3:2),k.sortRestart&&(f=c,k.$headers.each(function(){this===f||!l&&a(this).is("."+u.css.sortDesc+",."+u.css.sortAsc)||(this.count=-1)})),f=parseInt(a(c).attr("data-column"),10),l){if(k.sortList=[],null!==k.sortForce)for(e=k.sortForce,g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;g1)for(g=0;g=0&&k.sortList.splice(j,1);if(u.isValueInArray(f,k.sortList)>=0)for(g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;ge;e++)i=q.cache[e].colMax,j=q.cache[e].normalized,j.sort(function(c,d){for(b=0;t>b;b++){if(g=s[b][0],k=s[b][1],p=0===k,q.sortStable&&c[g]===d[g]&&1===t)return c[q.columns].order-d[q.columns].order;if(f=/n/i.test(o(q.parsers,g)),f&&q.strings[g]?(f="boolean"==typeof q.string[q.strings[g]]?(p?1:-1)*(q.string[q.strings[g]]?-1:1):q.strings[g]?q.string[q.strings[g]]||0:0,l=q.numberSorter?q.numberSorter(c[g],d[g],p,i[g],a):u["sortNumeric"+(p?"Asc":"Desc")](c[g],d[g],f,i[g],g,a)):(m=p?c:d,n=p?d:c,l="function"==typeof r?r(m[g],n[g],p,g,a):"object"==typeof r&&r.hasOwnProperty(g)?r[g](m[g],n[g],p,g,a):u["sortNatural"+(p?"Asc":"Desc")](c[g],d[g],g,a,q)),l)return l}return c[q.columns].order-d[q.columns].order});q.debug&&c("Sorting on "+s.toString()+" and dir "+k+" time",h)}}function r(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function s(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?(r(b,d),u.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){r(b,d)},!0]):b.$table.trigger("sortReset",[function(){r(b,d),u.applyWidget(b.table,!1)}])}function t(b){var c=b.config,e=c.$table,i="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");e.unbind(i.replace(/\s+/g," ")).bind("sortReset"+c.namespace,function(d,e){d.stopPropagation(),c.sortList=[],m(b),q(b),h(b),a.isFunction(e)&&e(b)}).bind("updateAll"+c.namespace,function(a,d,e){a.stopPropagation(),b.isUpdating=!0,u.refreshWidgets(b,!0,!0),j(b),u.bindEvents(b,c.$headers,!0),t(b),k(b,d,e)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,c,d){a.stopPropagation(),b.isUpdating=!0,l(b),k(b,c,d)}).bind("updateCell"+c.namespace,function(d,f,g,h){d.stopPropagation(),b.isUpdating=!0,e.find(c.selectorRemove).remove();var i,j,k,l,m=c.$tbodies,n=a(f),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");f=n[0],m.length&&o>=0&&(k=m.eq(o).find("tr").index(p),l=n.index(),c.cache[o].normalized[k][c.columns].$row=p,j="undefined"==typeof c.extractors[l].id?u.getElementText(c,f,l):c.extractors[l].format(u.getElementText(c,f,l),b,f,l),i="no-parser"===c.parsers[l].id?"":c.parsers[l].format(j,b,f,l),c.cache[o].normalized[k][l]=c.ignoreCase&&"string"==typeof i?i.toLowerCase():i,"numeric"===(c.parsers[l].type||"").toLowerCase()&&(c.cache[o].colMax[l]=Math.max(Math.abs(i)||0,c.cache[o].colMax[l]||0)),i="undefined"!==g?g:c.resort,i!==!1?s(c,i,h):(a.isFunction(h)&&h(b),c.$table.trigger("updateComplete",c.table)))}).bind("addRows"+c.namespace,function(e,g,h,i){if(e.stopPropagation(),b.isUpdating=!0,d(c.cache))l(b),k(b,h,i);else{g=a(g).attr("role","row");var j,m,n,o,p,q,r,t=g.filter("tr").length,v=c.$tbodies.index(g.parents("tbody").filter(":first"));for(c.parsers&&c.parsers.length||f(b),j=0;t>j;j++){for(n=g[j].cells.length,r=[],q={child:[],$row:g.eq(j),order:c.cache[v].normalized.length},m=0;n>m;m++)o="undefined"==typeof c.extractors[m].id?u.getElementText(c,g[j].cells[m],m):c.extractors[m].format(u.getElementText(c,g[j].cells[m],m),b,g[j].cells[m],m),p="no-parser"===c.parsers[m].id?"":c.parsers[m].format(o,b,g[j].cells[m],m),r[m]=c.ignoreCase&&"string"==typeof p?p.toLowerCase():p,"numeric"===(c.parsers[m].type||"").toLowerCase()&&(c.cache[v].colMax[m]=Math.max(Math.abs(r[m])||0,c.cache[v].colMax[m]||0));r.push(q),c.cache[v].normalized.push(r)}s(c,h,i)}}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(c,f,i,j){var k=b.config;c.stopPropagation(),e.trigger("sortStart",this),n(b,f),m(b),k.delayInit&&d(k.cache)&&g(b),e.trigger("sortBegin",this),q(b),h(b,j),e.trigger("sortEnd",this),u.applyWidget(b),a.isFunction(i)&&i(b)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),h(b,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(d,e){c.parsers&&c.parsers.length||f(b),g(b),a.isFunction(e)&&e(b)}).bind("applyWidgetId"+c.namespace,function(a,d){a.stopPropagation(),u.getWidgetById(d).format(b,c,c.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),u.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),u.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),u.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(){u.removeWidget(b,!0,!1),c=a.extend(!0,u.defaults,c.originalSettings),b.hasInitialized=!1,u.setup(b,c)})}var u=this;u.version="2.21.2",u.parsers=[],u.widgets=[],u.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",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},u.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"},u.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"},u.instanceMethods={},u.log=b,u.benchmark=c,u.getElementText=function(b,c,d){if(!c)return"";var e,f=b.textExtraction||"",g=c.jquery?c:a(c);return a.trim("string"==typeof f?("basic"===f?g.attr(b.textAttribute)||c.textContent:c.textContent)||g.text()||"":"function"==typeof f?f(g[0],b.table,d):"function"==typeof(e=u.getColumnData(b.table,f,d))?e(g[0],b.table,d):g[0].textContent||g.text()||"")},u.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},u.defaults,b,u.instanceMethods);d.originalSettings=b,!c.hasInitialized&&u.buildTable&&"TABLE"!==this.tagName?u.buildTable(c,d):u.setup(c,d)})},u.setup=function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return d.debug?b("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var e="",h=a(c),i=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&a.data(c,"startoveralltimer",new Date),d.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(".")),d.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),/tablesorter\-/.test(h.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=h.addClass(u.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=h.find(d.selectorHeaders),d.namespace=d.namespace?"."+d.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=h.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",j(c),u.fixColumnWidth(c),u.applyWidgetOptions(c,d),f(c),d.totalRows=0,d.delayInit||g(c),u.bindEvents(c,d.$headers,!0),t(c),d.supportsDataObject&&"undefined"!=typeof h.data().sortlist?d.sortList=h.data().sortlist:i&&h.metadata()&&h.metadata().sortlist&&(d.sortList=h.metadata().sortlist),u.applyWidget(c,!0),d.sortList.length>0?h.trigger("sorton",[d.sortList,{},!d.initWidgets,!0]):(m(c),d.initWidgets&&u.applyWidget(c,!1)),d.showProcessing&&h.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),u.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){u.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&u.benchmark("Overall initialization time",a.data(c,"startoveralltimer")),h.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},u.fixColumnWidth=function(b){b=a(b)[0];var c,d,e=b.config,f=e.$table.children("colgroup");f.length&&f.hasClass(u.css.colgroup)&&f.remove(),e.widthFixed&&0===e.$table.children("colgroup").length&&(f=a(''),c=e.$table.width(),e.$tbodies.find("tr:first").children(":visible").each(function(){d=parseInt(a(this).width()/c*1e3,10)/10+"%",f.append(a("").css("width",d))}),e.$table.prepend(f))},u.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]}},u.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 p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return o.length},u.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+u.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:u.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(u.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(u.css.processing+" "+e.cssProcessing)},u.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("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},u.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},u.bindEvents=function(b,c,e){b=a(b)[0];var f=null,h=b.config;e!==!0&&(h.$extraHeaders=h.$extraHeaders?h.$extraHeaders.add(c):c),c.find(h.selectorSort).add(c.filter(h.selectorSort)).unbind("mousedown mouseup click sort keyup ".split(" ").join(h.namespace+" ").replace(/\s+/g," ")).bind("mousedown mouseup click sort keyup ".split(" ").join(h.namespace+" "),function(e,i){var j,k=a(e.target),l=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup|click/.test(l)||"keyup"===l&&13!==e.which||"click"===l&&"undefined"!=typeof e.which||"mouseup"===l&&f!==e.target&&i!==!0)){if("mousedown"===l)return void(f=e.target);if(f=null,/(input|select|button|textarea)/i.test(e.target.tagName)||k.hasClass(h.cssNoSort)||k.parents("."+h.cssNoSort).length>0||k.parents("button").length>0)return!h.cancelSelection;h.delayInit&&d(h.cache)&&g(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:a(this).parents("th, td")[0],j=h.$headers[c.index(j)],j.sortDisabled||p(b,j,e)}}),h.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},u.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+u.css.headerIn).length&&c.html(d.headerContent[b])})},u.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){u.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+u.css.headerRow).removeClass(u.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).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(j).removeClass([u.css.header,g.cssHeader,g.cssAsc,g.cssDesc,u.css.sortAsc,u.css.sortDesc,u.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),u.restoreHeaders(b),f.toggleClass(u.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},u.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},u.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=u.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},u.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:u.sortNatural(a,b)},u.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:u.sortNatural(b,a)},u.sortText=function(a,b){return a>b?1:b>a?-1:0},u.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},u.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=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),a-b)},u.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=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),b-a)},u.sortNumeric=function(a,b){return a-b},u.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},u.replaceAccents=function(a){var b,c="[",d=u.characterEquivalents;if(!u.characterRegex){u.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],u.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));u.characterRegex=new RegExp(c+"]")}if(u.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(u.characterRegexArray[b],b));return a},u.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},u.addParser=function(a){var b,c=u.parsers.length,d=!0;for(b=0;c>b;b++)u.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&u.parsers.push(a)},u.addInstanceMethods=function(b){a.extend(u.instanceMethods,b)},u.getParserById=function(a){if("false"==a)return!1;var b,c=u.parsers.length;for(b=0;c>b;b++)if(u.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return u.parsers[b];return!1},u.addWidget=function(a){u.widgets.push(a)},u.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},u.getWidgetById=function(a){var b,c,d=u.widgets.length;for(b=0;d>b;b++)if(c=u.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},u.applyWidgetOptions=function(b,c){var d,e,f=c.widgets.length,g=c.widgetOptions;if(f)for(d=0;f>d;d++)e=u.getWidgetById(c.widgets[d]),e&&"options"in e&&(g=b.config.widgetOptions=a.extend(!0,{},e.options,g))},u.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m=b.config,n=m.widgetOptions,o=" "+m.table.className+" ",p=[];if(d===!1||!b.hasInitialized||!b.isApplyingWidgets&&!b.isUpdating){if(m.debug&&(i=new Date),l=new RegExp("\\s"+m.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),o.match(l)&&(k=o.match(l)))for(g=k.length,f=0;g>f;f++)m.widgets.push(k[f].replace(l,"$1"));if(m.widgets.length){for(b.isApplyingWidgets=!0,m.widgets=a.grep(m.widgets,function(b,c){return a.inArray(b,m.widgets)===c}),h=m.widgets||[],g=h.length,f=0;g>f;f++)l=u.getWidgetById(h[f]),l&&l.id&&(l.priority||(l.priority=10),p[f]=l);for(p.sort(function(a,b){return a.priorityf;f++)p[f]&&((d||!m.widgetInit[p[f].id])&&(m.widgetInit[p[f].id]=!0,b.hasInitialized&&u.applyWidgetOptions(b,m),"init"in p[f]&&(m.debug&&(j=new Date),p[f].init(b,p[f],m,n),m.debug&&u.benchmark("Initializing "+p[f].id+" widget",j))),!d&&"format"in p[f]&&(m.debug&&(j=new Date),p[f].format(b,m,n,!1),m.debug&&u.benchmark((d?"Initializing ":"Applying ")+p[f].id+" widget",j)));d||"function"!=typeof e||e(b)}setTimeout(function(){b.isApplyingWidgets=!1,a.data(b,"lastWidgetApplication",new Date)},0),m.debug&&(k=m.widgets.length,c("Completed "+(d===!0?"initializing ":"applying ")+k+" widget"+(1!==k?"s":""),i))}},u.removeWidget=function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=u.widgets.length,h=0;i>h;h++)g=u.widgets[h],g&&g.id&&d.push(g.id);else d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;f++)g=u.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&"remove"in g&&(j.debug&&h>=0&&b('Removing "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},u.refreshWidgets=function(b,c,d){b=a(b)[0];var e,f=b.config,g=f.widgets,h=u.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);u.removeWidget(b,j.join(","),!0),d!==!0?(u.applyWidget(b,c||!1,k),c&&u.applyWidget(b,!1,k)):k(b)},u.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)):""},u.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},u.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),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/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},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){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.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){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},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){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.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=new RegExp(c.cssChildRow,"i"),m=c.$tbodies;for(c.debug&&(j=new Date),k=0;k1?Array.prototype.slice.call(arguments):a;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(a)?"error":/warn/i.test(a)?"warn":"log"](b):alert(b)}function c(a,c){b(a+" ("+((new Date).getTime()-c.getTime())+"ms)")}function d(a){for(var b in a)return!1;return!0}function e(c,d,e,f){for(var g,h,i=c.config,j=u.parsers.length,k=!1,l="",m=!0;""===l&&m;)e++,d[e]?(k=d[e].cells[f],l=u.getElementText(i,k,f),h=a(k),c.config.debug&&b("Checking if value was empty on row "+e+", column: "+f+': "'+l+'"')):m=!1;for(;--j>=0;)if(g=u.parsers[j],g&&"text"!==g.id&&g.is&&g.is(l,c,k,h))return g;return u.getParserById("text")}function f(a){var d,f,g,h,i,j,k,l,m,n,o=a.config,p=o.$tbodies=o.$table.children("tbody:not(."+o.cssInfoBlock+")"),q=0,r="",s=p.length;if(0===s)return o.debug?b("Warning: *Empty table!* Not building a parser cache"):"";for(o.debug&&(n=new Date,b("Detecting parsers for each column")),f={extractors:[],parsers:[]};s>q;){if(d=p[q].rows,d.length)for(g=o.columns,h=0;g>h;h++)i=o.$headerIndexed[h],j=u.getColumnData(a,o.headers,h),m=u.getParserById(u.getData(i,j,"extractor")),l=u.getParserById(u.getData(i,j,"sorter")),k="false"===u.getData(i,j,"parser"),o.empties[h]=(u.getData(i,j,"empty")||o.emptyTo||(o.emptyToBottom?"bottom":"top")).toLowerCase(),o.strings[h]=(u.getData(i,j,"string")||o.stringTo||"max").toLowerCase(),k&&(l=u.getParserById("no-parser")),m||(m=!1),l||(l=e(a,d,-1,h)),o.debug&&(r+="column:"+h+"; extractor:"+m.id+"; parser:"+l.id+"; string:"+o.strings[h]+"; empty: "+o.empties[h]+"\n"),f.parsers[h]=l,f.extractors[h]=m;q+=f.parsers.length?s:1}o.debug&&(b(r?r:"No parsers detected"),c("Completed detecting parsers",n)),o.parsers=f.parsers,o.extractors=f.extractors}function g(d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r=d.config,s=r.$tbodies,t=r.extractors,v=r.parsers;if(r.cache={},r.totalRows=0,!v)return r.debug?b("Warning: *Empty table!* Not building a cache"):"";for(r.debug&&(n=new Date),r.showProcessing&&u.isProcessing(d,!0),k=0;ki;++i)if(p={child:[],raw:[]},l=a(s[k].rows[i]),m=[],l.hasClass(r.cssChildRow)&&0!==i)f=e.normalized.length-1,e.normalized[f][r.columns].$row=e.normalized[f][r.columns].$row.add(l),l.prev().hasClass(r.cssChildRow)||l.prev().addClass(u.css.cssHasChild),p.child[f]=a.trim(l[0].textContent||l.text()||"");else{for(p.$row=l,p.order=i,j=0;ji;i++)o.push(e[i][l.columns].$row),l.appender&&(!l.pager||l.pager.removeRows&&m.pager_removeRows||l.pager.ajax)||h.append(e[i][l.columns].$row);u.processTbody(a,h,!1)}l.appender&&l.appender(a,o),l.debug&&c("Rebuilt table",k),b||l.appender||u.applyWidget(a),a.isUpdating&&l.$table.trigger("updateComplete",a)}function i(a){return/^d/i.test(a)||1===a}function j(d){var e,f,g,h,j,k,m,n,o=d.config;for(o.headerList=[],o.headerContent=[],o.debug&&(m=new Date),o.columns=u.computeColumnIndex(o.$table.children("thead, tfoot").children("tr")),h=o.cssIcon?'':"",o.$headers=a(a.map(a(d).find(o.selectorHeaders),function(b,c){return f=a(b),f.parent().hasClass(o.cssIgnoreRow)?void 0:(e=u.getColumnData(d,o.headers,c,!0),o.headerContent[c]=f.html(),""===o.headerTemplate||f.find("."+u.css.headerIn).length||(j=o.headerTemplate.replace(/\{content\}/g,f.html()).replace(/\{icon\}/g,f.find("."+u.css.icon).length?"":h),o.onRenderTemplate&&(g=o.onRenderTemplate.apply(f,[c,j]),g&&"string"==typeof g&&(j=g)),f.html('
'+j+"
")),o.onRenderHeader&&o.onRenderHeader.apply(f,[c,o,o.$table]),b.column=parseInt(f.attr("data-column"),10),b.order=i(u.getData(f,e,"sortInitialOrder")||o.sortInitialOrder)?[1,0,2]:[0,1,2],b.count=-1,b.lockedOrder=!1,k=u.getData(f,e,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(b.order=b.lockedOrder=i(k)?[1,1,1]:[0,0,0]),f.addClass(u.css.header+" "+o.cssHeader),o.headerList[c]=b,f.parent().addClass(u.css.headerRow+" "+o.cssHeaderRow).attr("role","row"),o.tabIndex&&f.attr("tabindex",0),b)})),o.$headerIndexed=[],n=0;nd;d++)if(2!==g[d][1]&&(c=f.$headers.not(".sorter-false").filter('[data-column="'+g[d][0]+'"]'+(1===h?":last":"")),c.length)){for(e=0;eh;h++)if(k=m[h],d=parseInt(k[0],10),g=l.$headerIndexed[d][0]){switch(e=(""+k[1]).match(/^(1|d|s|o|n)/),e=e?e[0]:""){case"1":case"d":e=1;break;case"s":e=i||0;break;case"o":j=g.order[(i||0)%(l.sortReset?3:2)],e=0===j?1:1===j?0:2;break;case"n":g.count=g.count+1,e=g.order[g.count%(l.sortReset?3:2)];break;default:e=0}i=0===h?e:i,f=[d,parseInt(e,10)||0],l.sortList.push(f),e=a.inArray(f[1],g.order),g.count=e>=0?e:f[1]%(l.sortReset?3:2)}}function o(a,b){return a&&a[b]?a[b].type||"":""}function p(b,c,d){if(b.isUpdating)return setTimeout(function(){p(b,c,d)},50);var e,f,g,i,j,k=b.config,l=!d[k.sortMultiSortKey],n=k.$table;if(n.trigger("sortStart",b),c.count=d[k.sortResetKey]?2:(c.count+1)%(k.sortReset?3:2),k.sortRestart&&(f=c,k.$headers.each(function(){this===f||!l&&a(this).is("."+u.css.sortDesc+",."+u.css.sortAsc)||(this.count=-1)})),f=parseInt(a(c).attr("data-column"),10),l){if(k.sortList=[],null!==k.sortForce)for(e=k.sortForce,g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;g1)for(g=0;g=0&&k.sortList.splice(j,1);if(u.isValueInArray(f,k.sortList)>=0)for(g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;ge;e++)i=q.cache[e].colMax,j=q.cache[e].normalized,j.sort(function(c,d){for(b=0;t>b;b++){if(g=s[b][0],k=s[b][1],p=0===k,q.sortStable&&c[g]===d[g]&&1===t)return c[q.columns].order-d[q.columns].order;if(f=/n/i.test(o(q.parsers,g)),f&&q.strings[g]?(f="boolean"==typeof q.string[q.strings[g]]?(p?1:-1)*(q.string[q.strings[g]]?-1:1):q.strings[g]?q.string[q.strings[g]]||0:0,l=q.numberSorter?q.numberSorter(c[g],d[g],p,i[g],a):u["sortNumeric"+(p?"Asc":"Desc")](c[g],d[g],f,i[g],g,a)):(m=p?c:d,n=p?d:c,l="function"==typeof r?r(m[g],n[g],p,g,a):"object"==typeof r&&r.hasOwnProperty(g)?r[g](m[g],n[g],p,g,a):u["sortNatural"+(p?"Asc":"Desc")](c[g],d[g],g,a,q)),l)return l}return c[q.columns].order-d[q.columns].order});q.debug&&c("Sorting on "+s.toString()+" and dir "+k+" time",h)}}function r(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function s(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?(r(b,d),u.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){r(b,d)},!0]):b.$table.trigger("sortReset",[function(){r(b,d),u.applyWidget(b.table,!1)}])}function t(b){var c=b.config,e=c.$table,i="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");e.unbind(i.replace(/\s+/g," ")).bind("sortReset"+c.namespace,function(d,e){d.stopPropagation(),c.sortList=[],m(b),q(b),h(b),a.isFunction(e)&&e(b)}).bind("updateAll"+c.namespace,function(a,d,e){a.stopPropagation(),b.isUpdating=!0,u.refreshWidgets(b,!0,!0),j(b),u.bindEvents(b,c.$headers,!0),t(b),k(b,d,e)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,c,d){a.stopPropagation(),b.isUpdating=!0,l(b),k(b,c,d)}).bind("updateCell"+c.namespace,function(d,f,g,h){d.stopPropagation(),b.isUpdating=!0,e.find(c.selectorRemove).remove();var i,j,k,l,m=c.$tbodies,n=a(f),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");f=n[0],m.length&&o>=0&&(k=m.eq(o).find("tr").index(p),l=n.index(),c.cache[o].normalized[k][c.columns].$row=p,j="undefined"==typeof c.extractors[l].id?u.getElementText(c,f,l):c.extractors[l].format(u.getElementText(c,f,l),b,f,l),i="no-parser"===c.parsers[l].id?"":c.parsers[l].format(j,b,f,l),c.cache[o].normalized[k][l]=c.ignoreCase&&"string"==typeof i?i.toLowerCase():i,"numeric"===(c.parsers[l].type||"").toLowerCase()&&(c.cache[o].colMax[l]=Math.max(Math.abs(i)||0,c.cache[o].colMax[l]||0)),i="undefined"!==g?g:c.resort,i!==!1?s(c,i,h):(a.isFunction(h)&&h(b),c.$table.trigger("updateComplete",c.table)))}).bind("addRows"+c.namespace,function(e,g,h,i){if(e.stopPropagation(),b.isUpdating=!0,d(c.cache))l(b),k(b,h,i);else{g=a(g).attr("role","row");var j,m,n,o,p,q,r,t=g.filter("tr").length,v=c.$tbodies.index(g.parents("tbody").filter(":first"));for(c.parsers&&c.parsers.length||f(b),j=0;t>j;j++){for(n=g[j].cells.length,r=[],q={child:[],$row:g.eq(j),order:c.cache[v].normalized.length},m=0;n>m;m++)o="undefined"==typeof c.extractors[m].id?u.getElementText(c,g[j].cells[m],m):c.extractors[m].format(u.getElementText(c,g[j].cells[m],m),b,g[j].cells[m],m),p="no-parser"===c.parsers[m].id?"":c.parsers[m].format(o,b,g[j].cells[m],m),r[m]=c.ignoreCase&&"string"==typeof p?p.toLowerCase():p,"numeric"===(c.parsers[m].type||"").toLowerCase()&&(c.cache[v].colMax[m]=Math.max(Math.abs(r[m])||0,c.cache[v].colMax[m]||0));r.push(q),c.cache[v].normalized.push(r)}s(c,h,i)}}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(c,f,i,j){var k=b.config;c.stopPropagation(),e.trigger("sortStart",this),n(b,f),m(b),k.delayInit&&d(k.cache)&&g(b),e.trigger("sortBegin",this),q(b),h(b,j),e.trigger("sortEnd",this),u.applyWidget(b),a.isFunction(i)&&i(b)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),h(b,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(d,e){c.parsers&&c.parsers.length||f(b),g(b),a.isFunction(e)&&e(b)}).bind("applyWidgetId"+c.namespace,function(a,d){a.stopPropagation(),u.getWidgetById(d).format(b,c,c.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),u.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),u.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),u.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(){u.removeWidget(b,!0,!1),c=a.extend(!0,u.defaults,c.originalSettings),b.hasInitialized=!1,u.setup(b,c)})}var u=this;u.version="2.21.2",u.parsers=[],u.widgets=[],u.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",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},u.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"},u.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"},u.instanceMethods={},u.log=b,u.benchmark=c,u.getElementText=function(b,c,d){if(!c)return"";var e,f=b.textExtraction||"",g=c.jquery?c:a(c);return a.trim("string"==typeof f?("basic"===f?g.attr(b.textAttribute)||c.textContent:c.textContent)||g.text()||"":"function"==typeof f?f(g[0],b.table,d):"function"==typeof(e=u.getColumnData(b.table,f,d))?e(g[0],b.table,d):g[0].textContent||g.text()||"")},u.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},u.defaults,b,u.instanceMethods);d.originalSettings=b,!c.hasInitialized&&u.buildTable&&"TABLE"!==this.nodeName?u.buildTable(c,d):u.setup(c,d)})},u.setup=function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return d.debug?b("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var e="",h=a(c),i=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&a.data(c,"startoveralltimer",new Date),d.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(".")),d.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),/tablesorter\-/.test(h.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=h.addClass(u.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=h.find(d.selectorHeaders),d.namespace=d.namespace?"."+d.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=h.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",j(c),u.fixColumnWidth(c),u.applyWidgetOptions(c,d),f(c),d.totalRows=0,d.delayInit||g(c),u.bindEvents(c,d.$headers,!0),t(c),d.supportsDataObject&&"undefined"!=typeof h.data().sortlist?d.sortList=h.data().sortlist:i&&h.metadata()&&h.metadata().sortlist&&(d.sortList=h.metadata().sortlist),u.applyWidget(c,!0),d.sortList.length>0?h.trigger("sorton",[d.sortList,{},!d.initWidgets,!0]):(m(c),d.initWidgets&&u.applyWidget(c,!1)),d.showProcessing&&h.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),u.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){u.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&u.benchmark("Overall initialization time",a.data(c,"startoveralltimer")),h.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},u.fixColumnWidth=function(b){b=a(b)[0];var c,d,e=b.config,f=e.$table.children("colgroup");f.length&&f.hasClass(u.css.colgroup)&&f.remove(),e.widthFixed&&0===e.$table.children("colgroup").length&&(f=a(''),c=e.$table.width(),e.$tbodies.find("tr:first").children(":visible").each(function(){d=parseInt(a(this).width()/c*1e3,10)/10+"%",f.append(a("").css("width",d))}),e.$table.prepend(f))},u.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]}},u.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 p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return o.length},u.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+u.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:u.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(u.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(u.css.processing+" "+e.cssProcessing)},u.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("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},u.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},u.bindEvents=function(b,c,e){b=a(b)[0];var f,h=null,i=b.config;e!==!0&&(i.$extraHeaders=i.$extraHeaders?i.$extraHeaders.add(c):c,f=a.fn.closest?c.closest("table")[0]:c.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==b&&(i.$extraTables=i.$extraTables?i.$extraTables.add(f):a(f))),c.find(i.selectorSort).add(c.filter(i.selectorSort)).unbind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" ").replace(/\s+/g," ")).bind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" "),function(e,f){var j,k=a(e.target),l=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup|click/.test(l)||"keyup"===l&&13!==e.which||"click"===l&&"undefined"!=typeof e.which||"mouseup"===l&&h!==e.target&&f!==!0)){if("mousedown"===l)return void(h=e.target);if(h=null,/(input|select|button|textarea)/i.test(e.target.nodeName)||k.hasClass(i.cssNoSort)||k.parents("."+i.cssNoSort).length>0||k.parents("button").length>0)return!i.cancelSelection;i.delayInit&&d(i.cache)&&g(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:a(this).parents("th, td")[0],j=i.$headers[c.index(j)],j.sortDisabled||p(b,j,e)}}),i.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},u.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+u.css.headerIn).length&&c.html(d.headerContent[b])})},u.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){u.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+u.css.headerRow).removeClass(u.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).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(j).removeClass([u.css.header,g.cssHeader,g.cssAsc,g.cssDesc,u.css.sortAsc,u.css.sortDesc,u.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),u.restoreHeaders(b),f.toggleClass(u.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},u.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},u.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=u.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},u.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:u.sortNatural(a,b)},u.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:u.sortNatural(b,a)},u.sortText=function(a,b){return a>b?1:b>a?-1:0},u.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},u.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=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),a-b)},u.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=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),b-a)},u.sortNumeric=function(a,b){return a-b},u.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},u.replaceAccents=function(a){var b,c="[",d=u.characterEquivalents;if(!u.characterRegex){u.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],u.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));u.characterRegex=new RegExp(c+"]")}if(u.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(u.characterRegexArray[b],b));return a},u.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},u.addParser=function(a){var b,c=u.parsers.length,d=!0;for(b=0;c>b;b++)u.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&u.parsers.push(a)},u.addInstanceMethods=function(b){a.extend(u.instanceMethods,b)},u.getParserById=function(a){if("false"==a)return!1;var b,c=u.parsers.length;for(b=0;c>b;b++)if(u.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return u.parsers[b];return!1},u.addWidget=function(a){u.widgets.push(a)},u.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},u.getWidgetById=function(a){var b,c,d=u.widgets.length;for(b=0;d>b;b++)if(c=u.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},u.applyWidgetOptions=function(b,c){var d,e,f=c.widgets.length,g=c.widgetOptions;if(f)for(d=0;f>d;d++)e=u.getWidgetById(c.widgets[d]),e&&"options"in e&&(g=b.config.widgetOptions=a.extend(!0,{},e.options,g))},u.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m=b.config,n=m.widgetOptions,o=" "+m.table.className+" ",p=[];if(d===!1||!b.hasInitialized||!b.isApplyingWidgets&&!b.isUpdating){if(m.debug&&(i=new Date),l=new RegExp("\\s"+m.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),o.match(l)&&(k=o.match(l)))for(g=k.length,f=0;g>f;f++)m.widgets.push(k[f].replace(l,"$1"));if(m.widgets.length){for(b.isApplyingWidgets=!0,m.widgets=a.grep(m.widgets,function(b,c){return a.inArray(b,m.widgets)===c}),h=m.widgets||[],g=h.length,f=0;g>f;f++)l=u.getWidgetById(h[f]),l&&l.id&&(l.priority||(l.priority=10),p[f]=l);for(p.sort(function(a,b){return a.priorityf;f++)p[f]&&((d||!m.widgetInit[p[f].id])&&(m.widgetInit[p[f].id]=!0,b.hasInitialized&&u.applyWidgetOptions(b,m),"init"in p[f]&&(m.debug&&(j=new Date),p[f].init(b,p[f],m,n),m.debug&&u.benchmark("Initializing "+p[f].id+" widget",j))),!d&&"format"in p[f]&&(m.debug&&(j=new Date),p[f].format(b,m,n,!1),m.debug&&u.benchmark((d?"Initializing ":"Applying ")+p[f].id+" widget",j)));d||"function"!=typeof e||e(b)}setTimeout(function(){b.isApplyingWidgets=!1,a.data(b,"lastWidgetApplication",new Date)},0),m.debug&&(k=m.widgets.length,c("Completed "+(d===!0?"initializing ":"applying ")+k+" widget"+(1!==k?"s":""),i))}},u.removeWidget=function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=u.widgets.length,h=0;i>h;h++)g=u.widgets[h],g&&g.id&&d.push(g.id);else d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;f++)g=u.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&"remove"in g&&(j.debug&&h>=0&&b('Removing "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},u.refreshWidgets=function(b,c,d){b=a(b)[0];var e,f=b.config,g=f.widgets,h=u.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);u.removeWidget(b,j.join(","),!0),d!==!0?(u.applyWidget(b,c||!1,k),c&&u.applyWidget(b,!1,k)):k(b)},u.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)):""},u.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},u.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),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/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},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){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.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){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},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){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.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=new RegExp(c.cssChildRow,"i"),m=c.$tbodies.add(c.$extraTables&&c.$extraTables.children("tbody"));for(c.debug&&(j=new Date),k=0;k' + txt + ''; } } - c.$table.find('thead').find('select.' + ts.css.filter + '[data-column="' + column + '"]').append(options); + c.$table.find('thead').find('select.' + tscss.filter + '[data-column="' + column + '"]').append(options); } } } @@ -715,7 +718,7 @@ ts.filter = { // it would append the same options twice. ts.filter.buildDefault(table, true); - ts.filter.bindSearch( table, c.$table.find('.' + ts.css.filter), true ); + ts.filter.bindSearch( table, c.$table.find('.' + tscss.filter), true ); if (wo.filter_external) { ts.filter.bindSearch( table, wo.filter_external ); } @@ -730,7 +733,7 @@ ts.filter = { .unbind( ('filterStart filterEnd '.split(' ').join(c.namespace + 'filter ')).replace(/\s+/g, ' ') ) .bind( 'filterStart filterEnd '.split(' ').join(c.namespace + 'filter '), function(event, columns) { // only add processing to certain columns to all columns - $header = (columns) ? c.$table.find('.' + ts.css.header).filter('[data-column]').filter(function() { + $header = (columns) ? c.$table.find('.' + tscss.header).filter('[data-column]').filter(function() { return columns[$(this).data('column')] !== ''; }) : ''; ts.isProcessing(table, event.type === 'filterStart', columns ? $header : ''); @@ -844,7 +847,7 @@ ts.filter = { // c.columns defined in computeThIndexes() columns = c.columns, arry = $.isArray(wo.filter_cellFilter), - buildFilter = ''; + buildFilter = ''; for (column = 0; column < columns; column++) { if (arry) { buildFilter += ''; @@ -893,9 +896,9 @@ ts.filter = { name = ( $.isArray(wo.filter_cssFilter) ? (typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '') : wo.filter_cssFilter ) || ''; - buildFilter.addClass( ts.css.filter + ' ' + name ).attr('data-column', column); + buildFilter.addClass( tscss.filter + ' ' + name ).attr('data-column', column); if (disabled) { - buildFilter.attr('placeholder', '').addClass('disabled')[0].disabled = true; // disabled! + buildFilter.attr('placeholder', '').addClass(tscss.filterDisabled)[0].disabled = true; // disabled! } } } @@ -989,7 +992,7 @@ ts.filter = { } if (wo.filter_hideFilters) { // show/hide filter row as needed - c.$table.find('.' + ts.css.filterRow).trigger( combinedFilters === '' ? 'mouseleave' : 'mouseenter' ); + c.$table.find('.' + tscss.filterRow).trigger( combinedFilters === '' ? 'mouseleave' : 'mouseenter' ); } // return if the last search is the same; but filter === false when updating the search // see example-widget-filter.html filter toggle buttons @@ -1015,8 +1018,8 @@ ts.filter = { hideFilters: function(table, c) { var $filterRow, $filterRow2, timer; $(table) - .find('.' + ts.css.filterRow) - .addClass('hideme') + .find('.' + tscss.filterRow) + .addClass(tscss.filterRowHide) .bind('mouseenter mouseleave', function(e) { // save event object - http://bugs.jquery.com/ticket/12140 var event = e; @@ -1024,14 +1027,14 @@ ts.filter = { clearTimeout(timer); timer = setTimeout(function() { if ( /enter|over/.test(event.type) ) { - $filterRow.removeClass('hideme'); + $filterRow.removeClass(tscss.filterRowHide); } else { // don't hide if input has focus // $(':focus') needs jQuery 1.6+ if ( $(document.activeElement).closest('tr')[0] !== $filterRow[0] ) { // don't hide row if any filter has a value if (c.lastCombinedFilter === '') { - $filterRow.addClass('hideme'); + $filterRow.addClass(tscss.filterRowHide); } } } @@ -1044,7 +1047,7 @@ ts.filter = { timer = setTimeout(function() { // don't hide row if any filter has a value if (ts.getFilters(c.$table).join('') === '') { - $filterRow2[ event.type === 'focus' ? 'removeClass' : 'addClass']('hideme'); + $filterRow2[ event.type === 'focus' ? 'removeClass' : 'addClass'](tscss.filterRowHide); } }, 200); }); @@ -1532,7 +1535,7 @@ ts.filter = { // t.data('placeholder') won't work in jQuery older than 1.4.3 options = '', // Get curent filter value - currentValue = c.$table.find('thead').find('select.' + ts.css.filter + '[data-column="' + column + '"]').val(); + currentValue = c.$table.find('thead').find('select.' + tscss.filter + '[data-column="' + column + '"]').val(); // nothing included in arry (external source), so get the options from filter_selectSource or column data if (typeof arry === 'undefined' || arry === '') { arry = ts.filter.getOptionSource(table, column, onlyAvail); @@ -1559,7 +1562,7 @@ ts.filter = { } // update all selects in the same column (clone thead in sticky headers & any external selects) - fixes 473 - $filters = ( c.$filters ? c.$filters : c.$table.children('thead') ).find('.' + ts.css.filter); + $filters = ( c.$filters ? c.$filters : c.$table.children('thead') ).find('.' + tscss.filter); if (wo.filter_$externalFilters) { $filters = $filters && $filters.length ? $filters.add(wo.filter_$externalFilters) : wo.filter_$externalFilters; } @@ -1603,7 +1606,7 @@ ts.getFilters = function(table, getRaw, setFilters, skipFirst) { } if (c) { if (c.$filters) { - $filters = c.$filters.find('.' + ts.css.filter); + $filters = c.$filters.find('.' + tscss.filter); } if (wo.filter_$externalFilters) { $filters = $filters && $filters.length ? $filters.add(wo.filter_$externalFilters) : wo.filter_$externalFilters; @@ -1850,7 +1853,7 @@ ts.addWidget({ resizeHeader(); }); - ts.bindEvents(table, $stickyThead.children().children('.tablesorter-header')); + ts.bindEvents(table, $stickyThead.children().children('.' + ts.css.header)); // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned. $table.after( $stickyWrap ); diff --git a/dist/js/jquery.tablesorter.widgets.min.js b/dist/js/jquery.tablesorter.widgets.min.js index 057f1917..d3e97b19 100644 --- a/dist/js/jquery.tablesorter.widgets.min.js +++ b/dist/js/jquery.tablesorter.widgets.min.js @@ -1,3 +1,3 @@ -/*! tablesorter (FORK) widgets - updated 03-13-2015 (v2.21.2)*/ -!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=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[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[p]||(l[p]={}),l[p][o]=f,k?localStorage[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[p]?l[p][o]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter=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(d.$extraTables),t=d.$headers.add(d.$extraHeaders),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:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!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=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(c,d,e){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var f,g,h,i,j,k,l,m,n,o=b.filter.regex;if(d.$table.addClass("hasFilters"),e.searchTimer=null,e.filter_initTimer=null,e.filter_formatterCount=0,e.filter_formatterInit=[],e.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',e.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',h="\\{"+b.filter.regex.query+"\\}",a.extend(o,{child:new RegExp(d.cssChildRow),filtered:new RegExp(e.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"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(h,"i"),igQuery:new RegExp(h,"ig")}),e.filter_columnFilters!==!1&&d.$headers.filter(".filter-false, .parser-false").length!==d.$headers.length&&b.filter.buildRow(c,d,e),h="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(h,function(f,g){return l=e.filter_hideEmpty&&a.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===f.type),d.$table.find("."+b.css.filterRow).toggleClass(e.filter_filteredRow,l),/(search|filter)/.test(f.type)||(f.stopPropagation(),b.filter.buildDefault(c,!0)),"filterReset"===f.type?(d.$table.find("."+b.css.filter).add(e.filter_$externalFilters).val(""),b.filter.searching(c,[])):"filterEnd"===f.type?b.filter.buildDefault(c,!0):(g="search"===f.type?g:"updateComplete"===f.type?d.$table.data("lastSearch"):"",/(update|add)/.test(f.type)&&"updateComplete"!==f.type&&(d.lastCombinedFilter=null,d.lastSearch=[]),b.filter.searching(c,g,!0)),!1}),e.filter_reset&&(e.filter_reset instanceof a?e.filter_reset.click(function(){d.$table.trigger("filterReset")}):a(e.filter_reset).length&&a(document).undelegate(e.filter_reset,"click.tsfilter").delegate(e.filter_reset,"click.tsfilter",function(){d.$table.trigger("filterReset")})),e.filter_functions)for(j=0;j'+(i.data("placeholder")||i.attr("data-placeholder")||e.filter_placeholder.select||"")+"":"",l=g,h=g,g.indexOf(e.filter_selectSourceSeparator)>=0&&(l=g.split(e.filter_selectSourceSeparator),h=l[1],l=l[0]),f+="");d.$table.find("thead").find("select."+b.css.filter+'[data-column="'+j+'"]').append(f)}b.filter.buildDefault(c,!0),b.filter.bindSearch(c,d.$table.find("."+b.css.filter),!0),e.filter_external&&b.filter.bindSearch(c,e.filter_external),e.filter_hideFilters&&b.filter.hideFilters(c,d),d.showProcessing&&d.$table.unbind("filterStart filterEnd ".split(" ").join(d.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(d.namespace+"filter "),function(e,f){i=f?d.$table.find("."+b.css.header).filter("[data-column]").filter(function(){return""!==f[a(this).data("column")]}):"",b.isProcessing(c,"filterStart"===e.type,f?i:"")}),d.filteredRows=d.totalRows,d.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "),function(){var a=this.config.widgetOptions;k=b.filter.setDefaults(c,d,a)||[],k.length&&(d.delayInit&&""===k.join("")||b.setFilters(c,k,!0)),d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(d)},100)}),d.pager&&d.pager.initialized&&!e.filter_initialized&&(d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(d)},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,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(c,d,e){var f,g,h,i,j,k,l,m=d.columns,n=a.isArray(e.filter_cellFilter),o='';for(g=0;m>g;g++)o+=n?"":"";for(d.$filters=a(o+="").appendTo(d.$table.children("thead").eq(0)).find("td"),g=0;m>g;g++)j=!1,h=d.$headerIndexed[g],l=b.getColumnData(c,e.filter_functions,g),i=e.filter_functions&&l&&"function"!=typeof l||h.hasClass("filter-select"),f=b.getColumnData(c,d.headers,g),j="false"===b.getData(h[0],f,"filter")||"false"===b.getData(h[0],f,"parser"),i?o=a("').appendTo(d.$filters.eq(g)),o&&o.attr("placeholder",h.data("placeholder")||h.attr("data-placeholder")||e.filter_placeholder.search||"")),o&&(k=(a.isArray(e.filter_cssFilter)?"undefined"!=typeof e.filter_cssFilter[g]?e.filter_cssFilter[g]||"":"":e.filter_cssFilter)||"",o.addClass(b.css.filter+" "+k).attr("data-column",g),j&&(o.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.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(c,d,e){var f=c.config,g=f.widgetOptions,h=a.isArray(d),i=h?d:b.getFilters(c,!0),j=(i||[]).join("");return a.isEmptyObject(f.cache)?void(f.delayInit&&f.pager&&f.pager.initialized&&f.$table.trigger("updateCache",[function(){b.filter.checkFilters(c,!1,e)}])):(h&&(b.setFilters(c,i,!1,e!==!0),g.filter_initialized||(f.lastCombinedFilter="")),g.filter_hideFilters&&f.$table.find("."+b.css.filterRow).trigger(""===j?"mouseleave":"mouseenter"),f.lastCombinedFilter!==j||d===!1?(d===!1&&(f.lastCombinedFilter=null,f.lastSearch=[]),g.filter_initialized&&f.$table.trigger("filterStart",[i]),f.showProcessing?void setTimeout(function(){return b.filter.findRows(c,i,j),!1},30):(b.filter.findRows(c,i,j),!1)):void 0)},hideFilters:function(c,d){var e,f,g;a(c).find("."+b.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){var c=b;e=a(this),clearTimeout(g),g=setTimeout(function(){/enter|over/.test(c.type)?e.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==e[0]&&""===d.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(c){f=a(this).closest("tr"),clearTimeout(g);var e=c;g=setTimeout(function(){""===b.getFilters(d.$table).join("")&&f["focus"===e.type?"removeClass":"addClass"]("hideme")},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")}):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),l1&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.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}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},buildSelect:function(c,d,e,f,g){if(c=a(c)[0],d=parseInt(d,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var h,i,j,k,l,m,n=c.config,o=n.widgetOptions,p=n.$headerIndexed[d],q='",r=n.$table.find("thead").find("select."+b.css.filter+'[data-column="'+d+'"]').val();if(("undefined"==typeof e||""===e)&&(e=b.filter.getOptionSource(c,d,g)),a.isArray(e)){for(h=0;h=0&&(k=j.split(o.filter_selectSourceSeparator),i=k[0],j=k[1]),q+=""!==e[h]?"":"";e=[]}l=(n.$filters?n.$filters:n.$table.children("thead")).find("."+b.css.filter),o.filter_$externalFilters&&(l=l&&l.length?l.add(o.filter_$externalFilters):o.filter_$externalFilters),m=l.filter('select[data-column="'+d+'"]'),m.length&&(m[f?"html":"append"](q),a.isArray(e)||m.append(e).val(r),m.val(r))}},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(c,d,e,f){var g,h,i,j,k=!1,l=c?a(c)[0].config:"",m=l?l.widgetOptions:"";if(d!==!0&&m&&!m.filter_columnFilters)return a(c).data("lastSearch");if(l&&(l.$filters&&(h=l.$filters.find("."+b.css.filter)),m.filter_$externalFilters&&(h=h&&h.length?h.add(m.filter_$externalFilters):m.filter_$externalFilters),h&&h.length))for(k=e||[],g=0;g=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this); -"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children(".tablesorter-header")),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
'),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?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 +/*! tablesorter (FORK) widgets - updated 03-24-2015 (v2.21.2)*/ +!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=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[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[p]||(l[p]={}),l[p][o]=f,k?localStorage[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[p]?l[p][o]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter=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(d.$extraTables),t=d.$headers.add(d.$extraHeaders),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:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!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=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.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*=","]',i="\\{"+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"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(i,"i"),igQuery:new RegExp(i,"ig")}),f.filter_columnFilters!==!1&&e.$headers.filter(".filter-false, .parser-false").length!==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)}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&&e.$table.unbind("filterStart filterEnd ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(e.namespace+"filter "),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,e.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),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,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n=e.columns,o=a.isArray(f.filter_cellFilter),p='';for(h=0;n>h;h++)p+=o?"":"";for(e.$filters=a(p+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;n>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?p=a("').appendTo(e.$filters.eq(h)),p&&p.attr("placeholder",i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"")),p&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",p.addClass(c.filter+" "+l).attr("data-column",h),k&&(p.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=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.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,g,h;a(d).find("."+c.filterRow).addClass(c.filterRowHide).bind("mouseenter mouseleave",function(b){var d=b;f=a(this),clearTimeout(h),h=setTimeout(function(){/enter|over/.test(d.type)?f.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==f[0]&&""===e.lastCombinedFilter&&f.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){g=a(this).closest("tr"),clearTimeout(h);var f=d;h=setTimeout(function(){""===b.getFilters(e.$table).join("")&&g["focus"===f.type?"removeClass":"addClass"](c.filterRowHide)},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")}):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),l1&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.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}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},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)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;h=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this); +"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
'),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?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/parsers/parser-input-select.min.js b/dist/js/parsers/parser-input-select.min.js index 3657cd32..56a298b1 100644 --- a/dist/js/parsers/parser-input-select.min.js +++ b/dist/js/parsers/parser-input-select.min.js @@ -2,4 +2,4 @@ * Updated 3/5/2015 (v2.21.0) * Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html */ -!function(a){"use strict";var b=function(){};a.tablesorter.addParser({id:"inputs",is:function(){return!1},format:function(b,c,d){return a(d).find("input").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"checkbox",is:function(){return!1},format:function(b,c,d,e){var f=a(d),g=c.config.widgetOptions,h=g.group_checkbox?g.group_checkbox:["checked","unchecked"],i=f.find('input[type="checkbox"]'),j=i.length?i[0].checked:"";return f.closest("tr").toggleClass("checked-"+e,j),i.length?h[j?0:1]:b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select",is:function(){return!1},format:function(b,c,d){return a(d).find("select").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select-text",is:function(){return!1},format:function(b,c,d){var e=a(d).find("select");return e.length?e.find("option:selected").text()||"":b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"textarea",is:function(){return!1},format:function(b,c,d){return a(d).find("textarea").val()||b},parsed:!0,type:"text"}),a(function(){a("table").on("tablesorter-initialized",function(){var c=function(b){b&&a(":focus").blur()};a(this).children("tbody").on("mouseleave",function(a){c("TBODY"===a.target.tagName)}).on("focus","select, input, textarea",function(){a(this).data("ts-original-value",this.value)}).on("blur","input, textarea",function(){this.value=a(this).data("ts-original-value")}).on("change keyup","select, input, textarea",function(d){if(27===d.which)return void(this.value=a(this).data("ts-original-value"));if("change"===d.type||"keyup"===d.type&&13===d.which&&("INPUT"===d.target.tagName||"TEXTAREA"===d.target.tagName&&d.altKey)){var e,f=a(d.target),g=f.closest("td"),h=g.closest("table"),i=g[0].cellIndex,j=h[0].config||!1,k=j&&j.$headers&&j.$headers.eq(i);if(!j||k&&k.length&&(k.hasClass("parser-false")||k.hasClass("sorter-false")&&k.hasClass("filter-false")))return c();(f.val()!==f.data("ts-original-value")||"checkbox"===d.target.type)&&(f.data("ts-original-value",f.val()),h.trigger("updateCell",[f.closest("td"),e,function(){b(d,h,f)}]))}})})})}(jQuery); \ No newline at end of file +!function(a){"use strict";var b=function(){};a.tablesorter.addParser({id:"inputs",is:function(){return!1},format:function(b,c,d){return a(d).find("input").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"checkbox",is:function(){return!1},format:function(b,c,d,e){var f=a(d),g=c.config.widgetOptions,h=g.group_checkbox?g.group_checkbox:["checked","unchecked"],i=f.find('input[type="checkbox"]'),j=i.length?i[0].checked:"";return f.closest("tr").toggleClass("checked-"+e,j),i.length?h[j?0:1]:b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select",is:function(){return!1},format:function(b,c,d){return a(d).find("select").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select-text",is:function(){return!1},format:function(b,c,d){var e=a(d).find("select");return e.length?e.find("option:selected").text()||"":b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"textarea",is:function(){return!1},format:function(b,c,d){return a(d).find("textarea").val()||b},parsed:!0,type:"text"}),a(function(){a("table").on("tablesorter-initialized",function(){var c=function(b){b&&a(":focus").blur()};a(this).children("tbody").on("mouseleave",function(a){c("TBODY"===a.target.nodeName)}).on("focus","select, input, textarea",function(){a(this).data("ts-original-value",this.value)}).on("blur","input, textarea",function(){this.value=a(this).data("ts-original-value")}).on("change keyup","select, input, textarea",function(d){if(27===d.which)return void(this.value=a(this).data("ts-original-value"));if("change"===d.type||"keyup"===d.type&&13===d.which&&("INPUT"===d.target.nodeName||"TEXTAREA"===d.target.nodeName&&d.altKey)){var e,f=a(d.target),g=f.closest("td"),h=g.closest("table"),i=g[0].cellIndex,j=h[0].config||!1,k=j&&j.$headers&&j.$headers.eq(i);if(!j||k&&k.length&&(k.hasClass("parser-false")||k.hasClass("sorter-false")&&k.hasClass("filter-false")))return c();(f.val()!==f.data("ts-original-value")||"checkbox"===d.target.type)&&(f.data("ts-original-value",f.val()),h.trigger("updateCell",[f.closest("td"),e,function(){b(d,h,f)}]))}})})})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-build-table.min.js b/dist/js/widgets/widget-build-table.min.js index 3d8fe3e9..fd8e2249 100644 --- a/dist/js/widgets/widget-build-table.min.js +++ b/dist/js/widgets/widget-build-table.min.js @@ -1,4 +1,4 @@ /*! Build Table widget for tableSorter v2.16.0; updated 2/7/2015 (v2.19.0) * by Rob Garrison */ -!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{},c=b.buildTable=function(d,e){var f="TABLE"===d.tagName?a(d):a("").appendTo(d),g=f[0],h=e.widgetOptions=a.extend(!0,{},c.defaults,e.widgetOptions),i=h.build_processing,j=h.build_type,k=h.build_source||e.data,l=function(b){var d=a.type(b),f=b instanceof jQuery;if("function"==typeof i&&(b=i(b,h)),e.data=b,f||"string"===d){if(f||/<\s*\/tr\s*>/.test(b))return c.html(g,b,h);try{if(b=a.parseJSON(b||"null"))return c.object(g,b,h)}catch(k){}}return"array"===d||"string"===d||"array"===j||"csv"===j?c.csv(g,b,h):c.object(g,b,h)};return g.config=e,b.buildTable.hasOwnProperty(j)||""===j?void(k instanceof jQuery?l(a.trim(k.html())):k&&(k.hasOwnProperty("url")||"json"===j)?a.ajax(h.build_source).done(function(a){l(a)}).fail(function(a,c){e.debug&&b.log("aborting build table widget, failed ajax load"),f.html('")}):l(k)):(e.debug&&b.log("aborting build table widget, incorrect build type"),!1)};c.defaults={build_type:"",build_source:"",build_processing:null,build_complete:"tablesorter-build-complete",build_headers:{rows:1,classes:[],text:[],widths:[]},build_footers:{rows:1,classes:[],text:[]},build_numbers:{addColumn:!1,sortable:!1},build_csvStartLine:0,build_csvSeparator:",",build_objectRowKey:"rows",build_objectCellKey:"cells",build_objectHeaderKey:"headers",build_objectFooterKey:"footers"},c.build={colgroup:function(b){var c="";return b&&b.length&&(c+="",a.each(b,function(a,b){c+=""}),c+=""),c},cell:function(b,c,d,e,f){var g,h,i=f?a(""):"",j=c.build_headers.classes,k=c.build_headers.widths;if(/string|number/.test(typeof b))h=a("<"+d+(j&&j[e]?' class="'+j[e]+'"':"")+">"+b+""),f&&k&&k[e]&&i.width(k[e]||"");else{h=a("<"+d+">");for(g in b)b.hasOwnProperty(g)&&("text"===g||"html"===g?h[g](b[g]):f&&"width"===g?i.width(b[g]||""):h.attr(g,b[g]))}return[h,i]},header:function(b,c){var d=c.build_headers.text,e=c.build_headers.classes,f=""+(c.build_numbers.addColumn?""+c.build_numbers.addColumn+"":"");return a.each(b,function(a,b){f+=/<\s*\/t(d|h)\s*>/.test(b)?b:""+(d&&d[a]?d[a]:b)+""}),f+""},rows:function(b,c,d,e,f,g){var h=g?"th":"td",i=""+(e.build_numbers.addColumn?"<"+h+">"+(g?"":f)+"":"");return a.each(b,function(a,b){i+=/<\s*\/t(d|h)\s*>/.test(b)?b:"<"+(g?h+(d&&d[a]?' class="'+d[a]+'"':""):h)+">"+(g&&c&&c.length&&c[a]?c[a]:b)+""}),i+""}},c.buildComplete=function(c,d){a(c).trigger(d.build_complete),b.setup(c,c.config)},c.array=function(a,b,d){return c.csv(a,b,d)},c.csv=function(b,d,e){var f,g,h,i="csv"===e.build_type||"string"==typeof d,j=a(b),k=i?d.replace("\r","").split("\n"):d,l=k.length,m=0,n=!1,o=e.build_headers.rows+(i?e.build_csvStartLine:0),p=e.build_footers.rows,q=0,r="",s=c.build.colgroup(e.build_headers.widths)+"";a.each(k,function(a,b){a>=l-p&&(n=!0),(i?a>=e.build_csvStartLine:!0)&&o>a?(g=i?c.splitCSV(b,e.build_csvSeparator):b,q=g.length,s+=c.build.header(g,e)):a>=o&&(a===o&&(s+=""),h=i?c.splitCSV(b,e.build_csvSeparator):b,n&&p>0&&(s+=(a===l-p?"":"")+(a===l?"":"")),h.length>1&&(m++,h.length!==q&&(r+="error on line "+a+": Item count ("+h.length+") does not match header count ("+q+") \n"),f=n?e.build_footers.classes:"",s+=c.build.rows(h,e.build_footers.text,f,e,m,n)))}),s+=p>0?"":"",r?j.html(r):(j.html(s),c.buildComplete(b,e))},c.splitCSV=function(b,c){var d,e,f=a.trim(b).split(c=c||",");for(d=f.length-1;d>=0;d--)'"'===f[d].replace(/\"\s+$/,'"').charAt(f[d].length-1)?(e=f[d].replace(/^\s+\"/,'"')).length>1&&'"'===e.charAt(0)?f[d]=f[d].replace(/^\s*"|"\s*$/g,"").replace(/""/g,'"'):d?f.splice(d-1,2,[f[d-1],f[d]].join(c)):f=f.shift().split(c).concat(f):f[d].replace(/""/g,'"');return f},c.html=function(b,d,e){var f=a(b);d instanceof jQuery?f.empty().append(d):f.html(d),c.buildComplete(b,e)},c.object=function(d,e,f){var g,h,i,j,k,l,m,n=d.config,o=f.build_objectHeaderKey,p=f.build_objectRowKey,q=e.hasOwnProperty(o)&&!a.isEmptyObject(e.kh)?e.kh:e.hasOwnProperty("headers")?e.headers:!1,r=e.hasOwnProperty(p)&&!a.isEmptyObject(e.kr)?e.kr:e.hasOwnProperty("rows")?e.rows:!1;return q&&r&&0!==q.length&&0!==r.length?(j=a(""),k=a("
'+a.status+" "+c+"
"),a.each(q,function(b,d){for(m=a("").appendTo(k.find("thead")),h=d.length,g=0;h>g;g++)i=c.build.cell(d[g],f,"th",g,0===b),i[0]&&i[0].length&&i[0].appendTo(m),0===b&&i[1]&&i[1].appendTo(j)}),j.find("col[style]").length&&k.prepend(j),l=a(""),a.each(r,function(b,d){var e;if(i="object"===a.type(d),i&&d.newTbody){l=a("").appendTo(k);for(e in d)d.hasOwnProperty(e)&&"newTbody"!==e&&l.attr(e,d[e])}else{if(0===b&&l.appendTo(k),m=a("").appendTo(l),i){for(e in d)d.hasOwnProperty(e)&&e!==f.build_objectCellKey&&m.attr(e,d[e]);d.hasOwnProperty(f.build_objectCellKey)&&(d=d.cells)}for(h=d.length,e=0;h>e;e++)j=c.build.cell(d[e],f,"td",e),j[0]&&j[0].length&&j[0].appendTo(m)}}),e.hasOwnProperty(f.build_objectFooterKey)&&(i=e[f.build_objectFooterKey],"clone"===i?(j=k.find("thead").html(),k.append(""+j+"")):(j=a("").appendTo(k),a.each(i,function(b,d){for(m=a("").appendTo(j),h=d.length,g=0;h>g;g++)l=c.build.cell(d[g],f,"th",g),l[0]&&l[0].length&&l[0].appendTo(m)}))),a(d).html(k.html()),void c.buildComplete(d,f)):(n.debug&&b.log("aborting build table widget, missing data for object build"),!1)},c.ajax=c.json=function(a,b,d){return c.object(a,b,d)}}(jQuery); \ No newline at end of file +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{},c=b.buildTable=function(d,e){var f="TABLE"===d.nodeName?a(d):a("").appendTo(d),g=f[0],h=e.widgetOptions=a.extend(!0,{},c.defaults,e.widgetOptions),i=h.build_processing,j=h.build_type,k=h.build_source||e.data,l=function(b){var d=a.type(b),f=b instanceof jQuery;if("function"==typeof i&&(b=i(b,h)),e.data=b,f||"string"===d){if(f||/<\s*\/tr\s*>/.test(b))return c.html(g,b,h);try{if(b=a.parseJSON(b||"null"))return c.object(g,b,h)}catch(k){}}return"array"===d||"string"===d||"array"===j||"csv"===j?c.csv(g,b,h):c.object(g,b,h)};return g.config=e,b.buildTable.hasOwnProperty(j)||""===j?void(k instanceof jQuery?l(a.trim(k.html())):k&&(k.hasOwnProperty("url")||"json"===j)?a.ajax(h.build_source).done(function(a){l(a)}).fail(function(a,c){e.debug&&b.log("aborting build table widget, failed ajax load"),f.html('")}):l(k)):(e.debug&&b.log("aborting build table widget, incorrect build type"),!1)};c.defaults={build_type:"",build_source:"",build_processing:null,build_complete:"tablesorter-build-complete",build_headers:{rows:1,classes:[],text:[],widths:[]},build_footers:{rows:1,classes:[],text:[]},build_numbers:{addColumn:!1,sortable:!1},build_csvStartLine:0,build_csvSeparator:",",build_objectRowKey:"rows",build_objectCellKey:"cells",build_objectHeaderKey:"headers",build_objectFooterKey:"footers"},c.build={colgroup:function(b){var c="";return b&&b.length&&(c+="",a.each(b,function(a,b){c+=""}),c+=""),c},cell:function(b,c,d,e,f){var g,h,i=f?a(""):"",j=c.build_headers.classes,k=c.build_headers.widths;if(/string|number/.test(typeof b))h=a("<"+d+(j&&j[e]?' class="'+j[e]+'"':"")+">"+b+""),f&&k&&k[e]&&i.width(k[e]||"");else{h=a("<"+d+">");for(g in b)b.hasOwnProperty(g)&&("text"===g||"html"===g?h[g](b[g]):f&&"width"===g?i.width(b[g]||""):h.attr(g,b[g]))}return[h,i]},header:function(b,c){var d=c.build_headers.text,e=c.build_headers.classes,f=""+(c.build_numbers.addColumn?""+c.build_numbers.addColumn+"":"");return a.each(b,function(a,b){f+=/<\s*\/t(d|h)\s*>/.test(b)?b:""+(d&&d[a]?d[a]:b)+""}),f+""},rows:function(b,c,d,e,f,g){var h=g?"th":"td",i=""+(e.build_numbers.addColumn?"<"+h+">"+(g?"":f)+"":"");return a.each(b,function(a,b){i+=/<\s*\/t(d|h)\s*>/.test(b)?b:"<"+(g?h+(d&&d[a]?' class="'+d[a]+'"':""):h)+">"+(g&&c&&c.length&&c[a]?c[a]:b)+""}),i+""}},c.buildComplete=function(c,d){a(c).trigger(d.build_complete),b.setup(c,c.config)},c.array=function(a,b,d){return c.csv(a,b,d)},c.csv=function(b,d,e){var f,g,h,i="csv"===e.build_type||"string"==typeof d,j=a(b),k=i?d.replace("\r","").split("\n"):d,l=k.length,m=0,n=!1,o=e.build_headers.rows+(i?e.build_csvStartLine:0),p=e.build_footers.rows,q=0,r="",s=c.build.colgroup(e.build_headers.widths)+"";a.each(k,function(a,b){a>=l-p&&(n=!0),(i?a>=e.build_csvStartLine:!0)&&o>a?(g=i?c.splitCSV(b,e.build_csvSeparator):b,q=g.length,s+=c.build.header(g,e)):a>=o&&(a===o&&(s+=""),h=i?c.splitCSV(b,e.build_csvSeparator):b,n&&p>0&&(s+=(a===l-p?"":"")+(a===l?"":"")),h.length>1&&(m++,h.length!==q&&(r+="error on line "+a+": Item count ("+h.length+") does not match header count ("+q+") \n"),f=n?e.build_footers.classes:"",s+=c.build.rows(h,e.build_footers.text,f,e,m,n)))}),s+=p>0?"":"",r?j.html(r):(j.html(s),c.buildComplete(b,e))},c.splitCSV=function(b,c){var d,e,f=a.trim(b).split(c=c||",");for(d=f.length-1;d>=0;d--)'"'===f[d].replace(/\"\s+$/,'"').charAt(f[d].length-1)?(e=f[d].replace(/^\s+\"/,'"')).length>1&&'"'===e.charAt(0)?f[d]=f[d].replace(/^\s*"|"\s*$/g,"").replace(/""/g,'"'):d?f.splice(d-1,2,[f[d-1],f[d]].join(c)):f=f.shift().split(c).concat(f):f[d].replace(/""/g,'"');return f},c.html=function(b,d,e){var f=a(b);d instanceof jQuery?f.empty().append(d):f.html(d),c.buildComplete(b,e)},c.object=function(d,e,f){var g,h,i,j,k,l,m,n=d.config,o=f.build_objectHeaderKey,p=f.build_objectRowKey,q=e.hasOwnProperty(o)&&!a.isEmptyObject(e.kh)?e.kh:e.hasOwnProperty("headers")?e.headers:!1,r=e.hasOwnProperty(p)&&!a.isEmptyObject(e.kr)?e.kr:e.hasOwnProperty("rows")?e.rows:!1;return q&&r&&0!==q.length&&0!==r.length?(j=a(""),k=a("
'+a.status+" "+c+"
"),a.each(q,function(b,d){for(m=a("").appendTo(k.find("thead")),h=d.length,g=0;h>g;g++)i=c.build.cell(d[g],f,"th",g,0===b),i[0]&&i[0].length&&i[0].appendTo(m),0===b&&i[1]&&i[1].appendTo(j)}),j.find("col[style]").length&&k.prepend(j),l=a(""),a.each(r,function(b,d){var e;if(i="object"===a.type(d),i&&d.newTbody){l=a("").appendTo(k);for(e in d)d.hasOwnProperty(e)&&"newTbody"!==e&&l.attr(e,d[e])}else{if(0===b&&l.appendTo(k),m=a("").appendTo(l),i){for(e in d)d.hasOwnProperty(e)&&e!==f.build_objectCellKey&&m.attr(e,d[e]);d.hasOwnProperty(f.build_objectCellKey)&&(d=d.cells)}for(h=d.length,e=0;h>e;e++)j=c.build.cell(d[e],f,"td",e),j[0]&&j[0].length&&j[0].appendTo(m)}}),e.hasOwnProperty(f.build_objectFooterKey)&&(i=e[f.build_objectFooterKey],"clone"===i?(j=k.find("thead").html(),k.append(""+j+"")):(j=a("").appendTo(k),a.each(i,function(b,d){for(m=a("").appendTo(j),h=d.length,g=0;h>g;g++)l=c.build.cell(d[g],f,"th",g),l[0]&&l[0].length&&l[0].appendTo(m)}))),a(d).html(k.html()),void c.buildComplete(d,f)):(n.debug&&b.log("aborting build table widget, missing data for object build"),!1)},c.ajax=c.json=function(a,b,d){return c.object(a,b,d)}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter.min.js b/dist/js/widgets/widget-filter.min.js index 8fe285a7..a9927b02 100644 --- a/dist/js/widgets/widget-filter.min.js +++ b/dist/js/widgets/widget-filter.min.js @@ -1,2 +1,2 @@ /*! Widget: filter - updated 3/5/2015 (v2.21.0) */ -!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};a.extend(b.css,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter"}),b.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(a,c,d){c.$table.hasClass("hasFilters")||b.filter.init(a,c,d)},remove:function(c,d,e,f){var g,h,i=d.$table,j=d.$tbodies,k="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter ");if(i.removeClass("hasFilters").unbind(k.replace(/\s+/g," ")).find("."+b.css.filterRow).remove(),!f){for(g=0;g=]/g,query:"(q|query)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!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=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(c,d,e){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var f,g,h,i,j,k,l,m,n,o=b.filter.regex;if(d.$table.addClass("hasFilters"),e.searchTimer=null,e.filter_initTimer=null,e.filter_formatterCount=0,e.filter_formatterInit=[],e.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',e.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',h="\\{"+b.filter.regex.query+"\\}",a.extend(o,{child:new RegExp(d.cssChildRow),filtered:new RegExp(e.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"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(h,"i"),igQuery:new RegExp(h,"ig")}),e.filter_columnFilters!==!1&&d.$headers.filter(".filter-false, .parser-false").length!==d.$headers.length&&b.filter.buildRow(c,d,e),h="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(h,function(f,g){return l=e.filter_hideEmpty&&a.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===f.type),d.$table.find("."+b.css.filterRow).toggleClass(e.filter_filteredRow,l),/(search|filter)/.test(f.type)||(f.stopPropagation(),b.filter.buildDefault(c,!0)),"filterReset"===f.type?(d.$table.find("."+b.css.filter).add(e.filter_$externalFilters).val(""),b.filter.searching(c,[])):"filterEnd"===f.type?b.filter.buildDefault(c,!0):(g="search"===f.type?g:"updateComplete"===f.type?d.$table.data("lastSearch"):"",/(update|add)/.test(f.type)&&"updateComplete"!==f.type&&(d.lastCombinedFilter=null,d.lastSearch=[]),b.filter.searching(c,g,!0)),!1}),e.filter_reset&&(e.filter_reset instanceof a?e.filter_reset.click(function(){d.$table.trigger("filterReset")}):a(e.filter_reset).length&&a(document).undelegate(e.filter_reset,"click.tsfilter").delegate(e.filter_reset,"click.tsfilter",function(){d.$table.trigger("filterReset")})),e.filter_functions)for(j=0;j'+(i.data("placeholder")||i.attr("data-placeholder")||e.filter_placeholder.select||"")+"":"",l=g,h=g,g.indexOf(e.filter_selectSourceSeparator)>=0&&(l=g.split(e.filter_selectSourceSeparator),h=l[1],l=l[0]),f+="");d.$table.find("thead").find("select."+b.css.filter+'[data-column="'+j+'"]').append(f)}b.filter.buildDefault(c,!0),b.filter.bindSearch(c,d.$table.find("."+b.css.filter),!0),e.filter_external&&b.filter.bindSearch(c,e.filter_external),e.filter_hideFilters&&b.filter.hideFilters(c,d),d.showProcessing&&d.$table.unbind("filterStart filterEnd ".split(" ").join(d.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(d.namespace+"filter "),function(e,f){i=f?d.$table.find("."+b.css.header).filter("[data-column]").filter(function(){return""!==f[a(this).data("column")]}):"",b.isProcessing(c,"filterStart"===e.type,f?i:"")}),d.filteredRows=d.totalRows,d.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "),function(){var a=this.config.widgetOptions;k=b.filter.setDefaults(c,d,a)||[],k.length&&(d.delayInit&&""===k.join("")||b.setFilters(c,k,!0)),d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(d)},100)}),d.pager&&d.pager.initialized&&!e.filter_initialized&&(d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(d)},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,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(c,d,e){var f,g,h,i,j,k,l,m=d.columns,n=a.isArray(e.filter_cellFilter),o='';for(g=0;m>g;g++)o+=n?"":"";for(d.$filters=a(o+="").appendTo(d.$table.children("thead").eq(0)).find("td"),g=0;m>g;g++)j=!1,h=d.$headerIndexed[g],l=b.getColumnData(c,e.filter_functions,g),i=e.filter_functions&&l&&"function"!=typeof l||h.hasClass("filter-select"),f=b.getColumnData(c,d.headers,g),j="false"===b.getData(h[0],f,"filter")||"false"===b.getData(h[0],f,"parser"),i?o=a("').appendTo(d.$filters.eq(g)),o&&o.attr("placeholder",h.data("placeholder")||h.attr("data-placeholder")||e.filter_placeholder.search||"")),o&&(k=(a.isArray(e.filter_cssFilter)?"undefined"!=typeof e.filter_cssFilter[g]?e.filter_cssFilter[g]||"":"":e.filter_cssFilter)||"",o.addClass(b.css.filter+" "+k).attr("data-column",g),j&&(o.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.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(c,d,e){var f=c.config,g=f.widgetOptions,h=a.isArray(d),i=h?d:b.getFilters(c,!0),j=(i||[]).join("");return a.isEmptyObject(f.cache)?void(f.delayInit&&f.pager&&f.pager.initialized&&f.$table.trigger("updateCache",[function(){b.filter.checkFilters(c,!1,e)}])):(h&&(b.setFilters(c,i,!1,e!==!0),g.filter_initialized||(f.lastCombinedFilter="")),g.filter_hideFilters&&f.$table.find("."+b.css.filterRow).trigger(""===j?"mouseleave":"mouseenter"),f.lastCombinedFilter!==j||d===!1?(d===!1&&(f.lastCombinedFilter=null,f.lastSearch=[]),g.filter_initialized&&f.$table.trigger("filterStart",[i]),f.showProcessing?void setTimeout(function(){return b.filter.findRows(c,i,j),!1},30):(b.filter.findRows(c,i,j),!1)):void 0)},hideFilters:function(c,d){var e,f,g;a(c).find("."+b.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){var c=b;e=a(this),clearTimeout(g),g=setTimeout(function(){/enter|over/.test(c.type)?e.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==e[0]&&""===d.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(c){f=a(this).closest("tr"),clearTimeout(g);var e=c;g=setTimeout(function(){""===b.getFilters(d.$table).join("")&&f["focus"===e.type?"removeClass":"addClass"]("hideme")},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")}):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),l1&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.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}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},buildSelect:function(c,d,e,f,g){if(c=a(c)[0],d=parseInt(d,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var h,i,j,k,l,m,n=c.config,o=n.widgetOptions,p=n.$headerIndexed[d],q='",r=n.$table.find("thead").find("select."+b.css.filter+'[data-column="'+d+'"]').val();if(("undefined"==typeof e||""===e)&&(e=b.filter.getOptionSource(c,d,g)),a.isArray(e)){for(h=0;h=0&&(k=j.split(o.filter_selectSourceSeparator),i=k[0],j=k[1]),q+=""!==e[h]?"":"";e=[]}l=(n.$filters?n.$filters:n.$table.children("thead")).find("."+b.css.filter),o.filter_$externalFilters&&(l=l&&l.length?l.add(o.filter_$externalFilters):o.filter_$externalFilters),m=l.filter('select[data-column="'+d+'"]'),m.length&&(m[f?"html":"append"](q),a.isArray(e)||m.append(e).val(r),m.val(r))}},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(c,d,e,f){var g,h,i,j,k=!1,l=c?a(c)[0].config:"",m=l?l.widgetOptions:"";if(d!==!0&&m&&!m.filter_columnFilters)return a(c).data("lastSearch");if(l&&(l.$filters&&(h=l.$filters.find("."+b.css.filter)),m.filter_$externalFilters&&(h=h&&h.length?h.add(m.filter_$externalFilters):m.filter_$externalFilters),h&&h.length))for(k=e||[],g=0;g=]/g,query:"(q|query)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!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=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.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*=","]',i="\\{"+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"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(i,"i"),igQuery:new RegExp(i,"ig")}),f.filter_columnFilters!==!1&&e.$headers.filter(".filter-false, .parser-false").length!==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)}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&&e.$table.unbind("filterStart filterEnd ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(e.namespace+"filter "),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,e.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),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,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n=e.columns,o=a.isArray(f.filter_cellFilter),p='';for(h=0;n>h;h++)p+=o?"":"";for(e.$filters=a(p+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;n>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?p=a("').appendTo(e.$filters.eq(h)),p&&p.attr("placeholder",i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"")),p&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",p.addClass(c.filter+" "+l).attr("data-column",h),k&&(p.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=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.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,g,h;a(d).find("."+c.filterRow).addClass(c.filterRowHide).bind("mouseenter mouseleave",function(b){var d=b;f=a(this),clearTimeout(h),h=setTimeout(function(){/enter|over/.test(d.type)?f.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==f[0]&&""===e.lastCombinedFilter&&f.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){g=a(this).closest("tr"),clearTimeout(h);var f=d;h=setTimeout(function(){""===b.getFilters(e.$table).join("")&&g["focus"===f.type?"removeClass":"addClass"](c.filterRowHide)},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")}):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),l1&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.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}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},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)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;h=h.totalPages&&b.moveToLastPage(c,h),b.hideRows(c,e),b.changeHeight(c,e),b.updatePageDisplay(c,e,!1),e.$table.trigger("applyWidgets"),b.updatePageDisplay(c,e)}}).on("pageSize.pager refreshComplete.pager",function(a,c){a.stopPropagation(),b.setPageSize(d,parseInt(c,10)||h.setSize||10,e),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}).on("pageSet.pager pagerUpdate.pager",function(a,c){a.stopPropagation(),h.page=(parseInt(c,10)||1)-1,"pagerUpdate"===a.type&&(h.last.page=!0),b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}).on("pageAndSize.pager",function(a,c,f){a.stopPropagation(),h.page=(parseInt(c,10)||1)-1,b.setPageSize(d,parseInt(f,10)||h.setSize||10,e),b.moveToPage(d,h,!0),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}),f=[j.first,j.prev,j.next,j.last],g=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],e.debug&&!h.$container.length&&c.log("Pager: >> Container not found"),h.$container.find(f.join(",")).attr("tabindex",0).off("click.pager").on("click.pager",function(c){c.stopPropagation();var e,j=a(this),k=f.length;if(!j.hasClass(i.pager_css.disabled))for(e=0;k>e;e++)if(j.is(f[e])){b[g[e]](d,h);break}}),h.$goto.length?h.$goto.off("change.pager").on("change.pager",function(){h.page=a(this).val()-1,b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}):e.debug&&c.log("Pager: >> Goto selector not found"),h.$size.length?(h.$size.find("option").removeAttr("selected"),h.$size.off("change.pager").on("change.pager",function(){return h.$size.val(a(this).val()),a(this).hasClass(i.pager_css.disabled)||(b.setPageSize(d,parseInt(a(this).val(),10),e),b.changeHeight(d,e)),!1})):e.debug&&c.log("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=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/o),e.totalRows=n.totalRows,b.calcFilters(d,e),e.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/o)||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].tagName?"val":"html"](g),i.find(".ts-startRow, .ts-page").off("change.pager").on("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/n.size)+1:b;e.$table.trigger("pageSet.pager",[c])}))}b.pagerArrows(e),b.fixHeight(d,e),n.initialized&&f!==!1&&(e.debug&&c.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=0,f=b.pager,g=b.widgetOptions,h=b.$tbodies.eq(0).children("tr"),i=h.length,j=f.page*f.size,k=j+f.size,l=g&&g.filter_filteredRow||"filtered",m=0,n=0;for(f.cacheIndex=[],d=0;i>d;d++)h[d].className.match(l)||(n===j&&h[d].className.match(b.cssChildRow)?h[d].style.display="none":(h[d].style.display=n>=j&&k>n?"":"none",m!==n&&n>=j&&k>n&&(f.cacheIndex.push(d),m=n),n+=h[d].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!g.pager_countChildRows?0:1,n===k&&"none"!==h[d].style.display&&h[d].className.match(c.css.cssHasChild)&&(e=d)));if(e>0&&h[e].className.match(c.css.cssHasChild))for(;++e> 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(w)?(m=isNaN(w[0])&&!isNaN(w[1]),t=w[m?1:0],i.totalRows=isNaN(t)?i.totalRows||0:t,f.totalRows=f.filteredRows=i.filteredRows=i.totalRows,r=0===i.totalRows?[""]:w[m?0:1]||[],q=w[2]):(i.ajaxData=w,f.totalRows=i.totalRows=w.total,f.filteredRows=i.filteredRows="undefined"!=typeof w.filteredRows?w.filteredRows:w.total,q=w.headers,r=w.rows),s=r&&r.length,r instanceof jQuery)j.pager_processAjaxOnInit&&(f.$tbodies.eq(0).children("tr").detach(),f.$tbodies.eq(0).append(r));else if(s){for(k=0;s>k;k++){for(v+="",l=0;l"+r[k][l]+"";v+=""}j.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(v)}j.pager_processAjaxOnInit=!0,q&&q.length===x&&(n=u.hasClass("hasStickyHeaders"),p=n?j.$sticky.children("thead:first").children("tr").children():"",o=u.find("tfoot tr:first").children(),f.$headers.filter("th").each(function(b){var d,e=a(this);e.find("."+c.css.icon).length?(d=e.find("."+c.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(q[b]).append(d),n&&p.length&&(d=p.eq(b).find("."+c.css.icon).clone(!0),p.eq(b).find(".tablesorter-header-inner").html(q[b]).append(d))):(e.find(".tablesorter-header-inner").html(q[b]),n&&p.length&&p.eq(b).find(".tablesorter-header-inner").html(q[b])),o.eq(b).html(q[b])}))}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),u.trigger("updateCache",[function(){i.initialized&&setTimeout(function(){f.debug&&c.log("Pager: Triggering pagerChange"),u.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.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError.pager",function(a,c,f,g){b.renderAjax(null,d,e,c,g),h.off("ajaxError.pager")}),f=++i.ajaxCounter,i.last.ajaxUrl=g,i.ajaxObject.url=g,i.ajaxObject.success=function(a,c,g){fe;e++)n.push(l+"["+j[e][0]+"]="+j[e][1]);i=i.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,n.length?n.join("&"):l),n=[]}if(m){for(m=m[1],f=k.length,e=0;f>e;e++)k[e]&&n.push(m+"["+e+"]="+encodeURIComponent(k[e]));i=i.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,n.length?n.join("&"):m),g.currentFilters=k}return a.isFunction(h.pager_customAjaxUrl)&&(i=h.pager_customAjaxUrl(b,i)),d.debug&&c.log("Pager: Ajax url = "+i),i},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&&c.log("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&&c.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&&c.log("Pager: Triggering updateComplete"),i.$table.trigger("updateComplete",[a,!0]))},showAllRows:function(d,e){var f=e.pager,g=e.widgetOptions;f.ajax?b.pagerArrows(e,!0):(f.isDisabled=!0,a.data(d,"pagerLastPage",f.page),a.data(d,"pagerLastSize",f.size),f.page=0,f.size=f.totalRows,f.totalPages=1,e.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(d,e.rowsCopy),e.$table.trigger("applyWidgets"),e.debug&&c.log("Pager: Disabled")),f.$size.add(f.$goto).each(function(){a(this).attr("aria-disabled","true").addClass(g.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&&c.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&&c.log("Pager: Triggering pageMoved"),h.$table.trigger("pageMoved",h).trigger("applyWidgets"),!e.ajax&&d.isUpdating&&(h.debug&&c.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;g.initialized=!1,e.$table.off(a.trim(g.events.split(" ").join(".pager "))),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(d,e,f){var g,h=e.pager;h.isDisabled=!1,h.page=a.data(d,"pagerLastPage")||h.page||0,h.size=a.data(d,"pagerLastSize")||parseInt(h.$size.find("option[selected]").val(),10)||h.size||h.setSize||10,h.$size.val(h.size),h.totalPages=Math.ceil(Math.min(h.totalRows,h.filteredRows)/h.size),e.$table.removeClass("pagerDisabled"),d.id&&(g=d.id+"_pager_info",h.$container.find(e.widgetOptions.pager_selectors.pageDisplay).attr("id",g),e.$table.attr("aria-describedby",g)),b.changeHeight(d,e),f&&(e.$table.trigger("updateRows"),b.setPageSize(d,h.size,e),b.hideRowsSetup(d,e),e.debug&&c.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){a(b).each(function(){var b,d=this.config,e=d.widgetOptions,f=d.pager&&d.pager.cssErrorRow||e.pager_css&&e.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(f+" "+d.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(){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 "},f.pager);i.isInitializing||(i.isInitializing=!0,f.debug&&c.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&&c.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(d,e){var f,g,h=e.pager,i=e.widgetOptions,j=i.pager_selectors;e.$table.off(a.trim(h.events.split(" ").join(".pager "))).on("filterInit.pager filterStart.pager",function(b,c){h.currentFilters=a.isArray(c)?c:e.$table.data("lastSearch"),"filterStart"===b.type&&i.pager_pageReset!==!1&&(e.lastCombinedFilter||"")!==(h.currentFilters||[]).join("")&&(h.page=i.pager_pageReset)}).on("filterEnd.pager sortEnd.pager",function(){h.currentFilters=e.$table.data("lastSearch"),(h.initialized||h.initializing)&&(e.delayInit&&e.rowsCopy&&0===e.rowsCopy.length&&b.updateCache(d),b.updatePageDisplay(d,e,!1),e.$table.trigger("applyWidgets"))}).on("disable.pager",function(a){a.stopPropagation(),b.showAllRows(d,e)}).on("enable.pager",function(a){a.stopPropagation(),b.enablePager(d,e,!0)}).on("destroy.pager",function(a,c){a.stopPropagation(),b.destroyPager(d,e,c)}).on("updateComplete.pager",function(a,c,d){if(a.stopPropagation(),c&&!d&&!h.ajax){var f=e.$tbodies.eq(0).children("tr").not(e.selectorRemove);h.totalRows=f.length-(i.pager_countChildRows?0:f.filter("."+e.cssChildRow).length),h.totalPages=Math.ceil(h.totalRows/h.size),f.length&&e.rowsCopy&&0===e.rowsCopy.length&&b.updateCache(c),h.page>=h.totalPages&&b.moveToLastPage(c,h),b.hideRows(c,e),b.changeHeight(c,e),b.updatePageDisplay(c,e,!1),e.$table.trigger("applyWidgets"),b.updatePageDisplay(c,e)}}).on("pageSize.pager refreshComplete.pager",function(a,c){a.stopPropagation(),b.setPageSize(d,parseInt(c,10)||h.setSize||10,e),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}).on("pageSet.pager pagerUpdate.pager",function(a,c){a.stopPropagation(),h.page=(parseInt(c,10)||1)-1,"pagerUpdate"===a.type&&(h.last.page=!0),b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}).on("pageAndSize.pager",function(a,c,f){a.stopPropagation(),h.page=(parseInt(c,10)||1)-1,b.setPageSize(d,parseInt(f,10)||h.setSize||10,e),b.moveToPage(d,h,!0),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}),f=[j.first,j.prev,j.next,j.last],g=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],e.debug&&!h.$container.length&&c.log("Pager: >> Container not found"),h.$container.find(f.join(",")).attr("tabindex",0).off("click.pager").on("click.pager",function(c){c.stopPropagation();var e,j=a(this),k=f.length;if(!j.hasClass(i.pager_css.disabled))for(e=0;k>e;e++)if(j.is(f[e])){b[g[e]](d,h);break}}),h.$goto.length?h.$goto.off("change.pager").on("change.pager",function(){h.page=a(this).val()-1,b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}):e.debug&&c.log("Pager: >> Goto selector not found"),h.$size.length?(h.$size.find("option").removeAttr("selected"),h.$size.off("change.pager").on("change.pager",function(){return h.$size.val(a(this).val()),a(this).hasClass(i.pager_css.disabled)||(b.setPageSize(d,parseInt(a(this).val(),10),e),b.changeHeight(d,e)),!1})):e.debug&&c.log("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=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/o),e.totalRows=n.totalRows,b.calcFilters(d,e),e.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/o)||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.pager").on("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/n.size)+1:b;e.$table.trigger("pageSet.pager",[c])}))}b.pagerArrows(e),b.fixHeight(d,e),n.initialized&&f!==!1&&(e.debug&&c.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=0,f=b.pager,g=b.widgetOptions,h=b.$tbodies.eq(0).children("tr"),i=h.length,j=f.page*f.size,k=j+f.size,l=g&&g.filter_filteredRow||"filtered",m=0,n=0;for(f.cacheIndex=[],d=0;i>d;d++)h[d].className.match(l)||(n===j&&h[d].className.match(b.cssChildRow)?h[d].style.display="none":(h[d].style.display=n>=j&&k>n?"":"none",m!==n&&n>=j&&k>n&&(f.cacheIndex.push(d),m=n),n+=h[d].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!g.pager_countChildRows?0:1,n===k&&"none"!==h[d].style.display&&h[d].className.match(c.css.cssHasChild)&&(e=d)));if(e>0&&h[e].className.match(c.css.cssHasChild))for(;++e> 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(w)?(m=isNaN(w[0])&&!isNaN(w[1]),t=w[m?1:0],i.totalRows=isNaN(t)?i.totalRows||0:t,f.totalRows=f.filteredRows=i.filteredRows=i.totalRows,r=0===i.totalRows?[""]:w[m?0:1]||[],q=w[2]):(i.ajaxData=w,f.totalRows=i.totalRows=w.total,f.filteredRows=i.filteredRows="undefined"!=typeof w.filteredRows?w.filteredRows:w.total,q=w.headers,r=w.rows),s=r&&r.length,r instanceof jQuery)j.pager_processAjaxOnInit&&(f.$tbodies.eq(0).children("tr").detach(),f.$tbodies.eq(0).append(r));else if(s){for(k=0;s>k;k++){for(v+="",l=0;l"+r[k][l]+"";v+=""}j.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(v)}j.pager_processAjaxOnInit=!0,q&&q.length===x&&(n=u.hasClass("hasStickyHeaders"),p=n?j.$sticky.children("thead:first").children("tr").children():"",o=u.find("tfoot tr:first").children(),f.$headers.filter("th").each(function(b){var d,e=a(this);e.find("."+c.css.icon).length?(d=e.find("."+c.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(q[b]).append(d),n&&p.length&&(d=p.eq(b).find("."+c.css.icon).clone(!0),p.eq(b).find(".tablesorter-header-inner").html(q[b]).append(d))):(e.find(".tablesorter-header-inner").html(q[b]),n&&p.length&&p.eq(b).find(".tablesorter-header-inner").html(q[b])),o.eq(b).html(q[b])}))}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),u.trigger("updateCache",[function(){i.initialized&&setTimeout(function(){f.debug&&c.log("Pager: Triggering pagerChange"),u.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.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError.pager",function(a,c,f,g){b.renderAjax(null,d,e,c,g),h.off("ajaxError.pager")}),f=++i.ajaxCounter,i.last.ajaxUrl=g,i.ajaxObject.url=g,i.ajaxObject.success=function(a,c,g){fe;e++)n.push(l+"["+j[e][0]+"]="+j[e][1]);i=i.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,n.length?n.join("&"):l),n=[]}if(m){for(m=m[1],f=k.length,e=0;f>e;e++)k[e]&&n.push(m+"["+e+"]="+encodeURIComponent(k[e]));i=i.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,n.length?n.join("&"):m),g.currentFilters=k}return a.isFunction(h.pager_customAjaxUrl)&&(i=h.pager_customAjaxUrl(b,i)),d.debug&&c.log("Pager: Ajax url = "+i),i},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&&c.log("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&&c.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&&c.log("Pager: Triggering updateComplete"),i.$table.trigger("updateComplete",[a,!0]))},showAllRows:function(d,e){var f=e.pager,g=e.widgetOptions;f.ajax?b.pagerArrows(e,!0):(f.isDisabled=!0,a.data(d,"pagerLastPage",f.page),a.data(d,"pagerLastSize",f.size),f.page=0,f.size=f.totalRows,f.totalPages=1,e.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(d,e.rowsCopy),e.$table.trigger("applyWidgets"),e.debug&&c.log("Pager: Disabled")),f.$size.add(f.$goto).each(function(){a(this).attr("aria-disabled","true").addClass(g.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&&c.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&&c.log("Pager: Triggering pageMoved"),h.$table.trigger("pageMoved",h).trigger("applyWidgets"),!e.ajax&&d.isUpdating&&(h.debug&&c.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;g.initialized=!1,e.$table.off(a.trim(g.events.split(" ").join(".pager "))),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(d,e,f){var g,h=e.pager;h.isDisabled=!1,h.page=a.data(d,"pagerLastPage")||h.page||0,h.size=a.data(d,"pagerLastSize")||parseInt(h.$size.find("option[selected]").val(),10)||h.size||h.setSize||10,h.$size.val(h.size),h.totalPages=Math.ceil(Math.min(h.totalRows,h.filteredRows)/h.size),e.$table.removeClass("pagerDisabled"),d.id&&(g=d.id+"_pager_info",h.$container.find(e.widgetOptions.pager_selectors.pageDisplay).attr("id",g),e.$table.attr("aria-describedby",g)),b.changeHeight(d,e),f&&(e.$table.trigger("updateRows"),b.setPageSize(d,h.size,e),b.hideRowsSetup(d,e),e.debug&&c.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){a(b).each(function(){var b,d=this.config,e=d.widgetOptions,f=d.pager&&d.pager.cssErrorRow||e.pager_css&&e.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(f+" "+d.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))})}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-stickyHeaders.min.js b/dist/js/widgets/widget-stickyHeaders.min.js index 361b7a24..b60f2157 100644 --- a/dist/js/widgets/widget-stickyHeaders.min.js +++ b/dist/js/widgets/widget-stickyHeaders.min.js @@ -1,2 +1,2 @@ /*! Widget: stickyHeaders - updated 3/5/2015 (v2.21.0) */ -!function(a,b){"use strict";var c=a.tablesorter=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){b=a(b)[0];var e,f={timer:250},g=a.extend({},f,d),h=b.config,i=h.widgetOptions,j=function(b){i.resize_flag=!0,e=[],h.$headers.each(function(){var b=a(this),c=b.data("savedSizes")||[0,0],d=this.offsetWidth,f=this.offsetHeight;(d!==c[0]||f!==c[1])&&(b.data("savedSizes",[d,f]),e.push(this))}),e.length&&b!==!1&&h.$table.trigger("resize",[e]),i.resize_flag=!1};return j(!1),clearInterval(i.resize_timer),c?(i.resize_flag=!1,!1):void(i.resize_timer=setInterval(function(){i.resize_flag||j()},g.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=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this);"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children(".tablesorter-header")),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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); \ No newline at end of file +!function(a,b){"use strict";var c=a.tablesorter=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){b=a(b)[0];var e,f={timer:250},g=a.extend({},f,d),h=b.config,i=h.widgetOptions,j=function(b){i.resize_flag=!0,e=[],h.$headers.each(function(){var b=a(this),c=b.data("savedSizes")||[0,0],d=this.offsetWidth,f=this.offsetHeight;(d!==c[0]||f!==c[1])&&(b.data("savedSizes",[d,f]),e.push(this))}),e.length&&b!==!1&&h.$table.trigger("resize",[e]),i.resize_flag=!1};return j(!1),clearInterval(i.resize_timer),c?(i.resize_flag=!1,!1):void(i.resize_timer=setInterval(function(){i.resize_flag||j()},g.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=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this);"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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); \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index bcb6ef29..45ab3989 100644 --- a/docs/index.html +++ b/docs/index.html @@ -475,14 +475,14 @@