diff --git a/README.md b/README.md index a83fab31..280b2173 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,31 @@ tablesorter can successfully parse and sort many types of data including linked View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Change). +#### Version 2.17.1 (5/28/2014) + +* Docs: + * Add some missing examples & updated some version number comments for the last update + * Reflow widget: Fix demo to use preset widths & css transitions instead of forcing users to manually resize the examples. + * Output widget: add note about modifying the `.htaccess` file to enable downloading in both IE & Firefox. + +* Core + * Allow use of select & buttons within header cells. Previously only inputs were allowed. Fixes [issue #625](https://github.com/Mottie/tablesorter/issues/625). + * Add `parser-false` setting to prevent extracting & parsing of content from set columns. Fixes [issue #629](https://github.com/Mottie/tablesorter/issues/629). + +* Filter widget + * Add a not-exact-match (`!=`) filter type (e.g. `!"Bruce"` or `!Bruce=` will show all rows that don't exactly match `Bruce`). See [issue #628](https://github.com/Mottie/tablesorter/issues/628). + +* Math widget + * Values are now obtained from data-attributes first, then the actual cell content. This will allow making calculations with higher precision values. Fixes [issue #624](https://github.com/Mottie/tablesorter/issues/624). + +* Pager (addon & widget) + * The `ajaxProcessing` function now includes the jqxhr parameter. Thanks [JuarezTurrini](https://github.com/JuarezTurrini)! See [pull #626](https://github.com/Mottie/tablesorter/pull/626) + * Update the custom controls example to properly work with the pager widget. Fixes [issue #631](https://github.com/Mottie/tablesorter/issues/631). + * Fix widgets sometimes not being applied after page change. + +* Parser + * input-select parser no longer binds to non-tablesorter tables. Fixes [issue #633](https://github.com/Mottie/tablesorter/issues/633). + #### Version 2.17.0 (5/22/2014) * Overall @@ -276,9 +301,3 @@ View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Chan * Check for filters before trying to set focus. Fixes [issue #594](https://github.com/Mottie/tablesorter/issues/594). * Add `stickyHeaders_filteredToTop` option. Fixes [issue #570](https://github.com/Mottie/tablesorter/issues/570). * Input select parser: don't update columns with both sorter & filter disabled. See [issue #570](https://github.com/Mottie/tablesorter/issues/570). - -#### Version 2.16.1 (4/24/2014) - -* Core: - * Fixed an issue where ajax loaded data would cause a javascript error because of improper ignoring of data. - * Ajax loaded data will now be parsed and cached - so stuff like the grouping widget will work properly. diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 273d9671..26fa83ad 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 5/22/2014 (v2.17.0) + * updated 5/28/2014 (v2.17.1) */ /*jshint browser:true, jquery:true, unused:false */ ;(function($) { diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index ee89694b..0645f77e 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,2 +1,2 @@ -/* tablesorter pager plugin updated 5/22/2014 (v2.17.0) */ -;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(b,a){var c=b.cssDisabled,e=!!a,f=e||0===b.page,g=Math.min(b.totalPages,b.filteredPages),e=e||b.page===g-1||0===b.totalPages;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f?"addClass":"removeClass"](c).attr("aria-disabled", f),b.$container.find(b.cssNext+","+b.cssLast)[e?"addClass":"removeClass"](c).attr("aria-disabled",e))},t=function(b,a,c){var e,f,g,l=b.config;e=l.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=[];f=a.size||10;g=[l.widgetOptions&&l.widgetOptions.filter_filteredRow||"filtered",l.selectorRemove];a.countChildRows&&g.push(l.cssChildRow);g.join("|");a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=e?0:a.totalRows;a.filteredPages=a.totalPages;e&&(h.each(l.cache[0].normalized,function(d,b){a.filteredRows+= a.regexRows.test(b[l.columns].$row[0].className)?0:1}),a.filteredPages=Math.ceil(a.filteredRows/f)||0);if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),e=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(d,b){return a.totalPages?a.page+(b?parseInt(b, 10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(d){d=d.replace(/[{}\s]/g,"");var b=d.split(":"),c=a.ajaxData,e=/(rows?|pages?)$/i.test(d)?0:"";return 1"+e+"";a.$goto.html(g).val(a.page+1)}p(a);a.initialized&&!1!==c&&(l.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b, a.storageKey,{page:a.page,size:a.size}))},u=function(b,a){var c,e=b.config,f=e.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=h.data(b,"pagerSavedHeight"))&&(c-=f.height(),5'))},z=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b, "pagerSavedHeight",c.height());u(b,a);h.data(b,"pagerLastSize",a.size)},v=function(b,a){if(!a.ajaxUrl){var c,e=0,f=b.config,g=f.$tbodies.eq(0).children(),h=g.length,d=a.page*a.size,m=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",r=0;for(c=0;c=d&&r";for(f=0;f"+e[g][f]+"";p+=""}c.processAjaxOnInit&&s.$tbodies.eq(0).html(p)}c.processAjaxOnInit=!0;n&&n.length===b&&(m=(l=q.hasClass("hasStickyHeaders"))?s.widgetOptions.$sticky.children("thead:first").children().children(): "",d=q.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(a){var b=h(this),c;b.find("."+k.css.icon).length?(c=b.find("."+k.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(n[a]).append(c),l&&m.length&&(c=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(c))):(b.find(".tablesorter-header-inner").html(n[a]),l&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));d.eq(a).html(n[a])}))}s.showProcessing&&k.isProcessing(a); c.totalPages=Math.ceil(c.totalRows/(c.size||10));c.last.totalRows=c.totalRows;c.last.currentFilters=c.currentFilters;c.last.sortList=(s.sortList||[]).join(",");t(a,c);u(a,c);q.trigger("updateCache",[function(){c.initialized&&q.trigger("applyWidgets").trigger("pagerChange",c)}])}c.initialized||(c.initialized=!0,h(a).trigger("applyWidgets").trigger("pagerInitialized",c))},G=function(b,a){var c=F(b,a),e=h(document),f,g=b.config;""!==c&&(g.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager", function(c,d,f,g){B(null,b,a,d,g);e.unbind("ajaxError.pager")}),f=++a.ajaxCounter,a.ajaxObject.url=c,a.ajaxObject.success=function(c){f(a&&a.length||0))){c.page>=c.totalPages&&C(b,c);c.isDisabled=!1;c.initialized&&d.trigger("pagerChange",c);if(c.removeRows){k.clearTableBody(b);e=k.processTbody(b,e.$tbodies.eq(0),!0);f=m?0:n;g=m?0:n;for(l=0;ln&&l<=r&&(l++,e.append(a[f]))),f++;k.processTbody(b,e,!1)}else v(b, c);t(b,c);c.isDisabled||u(b,c);d.trigger("applyWidgets");b.isUpdating&&d.trigger("updateComplete",b)}},D=function(b,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(b,"pagerLastPage",a.page),h.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),x(b,b.config.rowsCopy,a),b.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).each(function(){h(this).attr("aria-disabled","true").addClass(a.cssDisabled)[0].disabled= !0})},q=function(b,a,c){if(!a.isDisabled){var e=b.config,f=h(b),g=a.last,l=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>l-1&&0!==l&&(a.page=l-1);g.currentFilters=""===(g.currentFilters||[]).join("")?[]:g.currentFilters;a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters;if(g.page!==a.page||g.size!==a.size||g.totalRows!==a.totalRows||(g.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||g.sortList!==(e.sortList||[]).join(","))e.debug&&k.log("Pager changing to page "+ a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[]},a.ajax?G(b,a):a.ajax||x(b,e.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(f.trigger("pageMoved",a).trigger("applyWidgets"),b.isUpdating&&f.trigger("updateComplete"))}},y=function(b,a,c){c.size=a||c.size||10;c.$size.val(c.size);h.data(b,"pagerLastPage",c.page);h.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);c.filteredPages= Math.ceil(c.filteredRows/c.size);q(b,c)},H=function(b,a){a.page=0;q(b,a)},C=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;q(b,a)},I=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);q(b,a)},J=function(b,a){a.page--;0>=a.page&&(a.page=0);q(b,a)},E=function(b,a,c){var e,f=b.config;a.$size.add(a.$goto).removeClass(a.cssDisabled).removeAttr("disabled").attr("aria-disabled","false");a.isDisabled=!1;a.page=h.data(b, "pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")||parseInt(a.$size.find("option[selected]").val(),10)||a.size||10;a.$size.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalRows,a.filteredRows)/a.size);b.id&&(e=b.id+"_pager_info",a.$container.find(a.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby",e));c&&(f.$table.trigger("updateRows"),y(b,a.size,a),A(b,a),u(b,a),f.debug&&k.log("pager enabled"))};w.appender=function(b,a){var c=b.config,e=c.pager;e.ajax||(c.rowsCopy=a,e.totalRows= e.countChildRows?c.$tbodies.eq(0).children().length:a.length,e.size=h.data(b,"pagerLastSize")||e.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),x(b,a,e),t(b,e,!1))};w.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,e,f=this,g=f.config,l=g.widgetOptions,d=g.pager=h.extend(!0,{},h.tablesorterPager.defaults,b),m=g.$table,n=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess|| d.ajaxObject.success;g.appender=w.appender;k.filter&&0<=h.inArray("filter",g.widgets)&&(d.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,d.currentFilters,!1));d.savePages&&k.storage&&(a=k.storage(f,d.storageKey)||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10,h.data(f,"pagerLastSize",d.size));d.regexRows=new RegExp("("+(l.filter_filteredRow||"filtered")+"|"+g.selectorRemove.substring(1)+"|"+g.cssChildRow+")"); m.unbind("filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b;!1!==d.pageReset&&(g.lastCombinedFilter||"")!==(b||[]).join("")&&(d.page=d.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){d.initialized&&(t(f,d,!1),q(f,d,!1),u(f,d))}).bind("disable.pager",function(a){a.stopPropagation();D(f,d)}).bind("enable.pager",function(a){a.stopPropagation();E(f,d,!0)}).bind("destroy.pager", function(a){a.stopPropagation();D(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;delete f.config.rowsCopy;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,d.storageKey,"")}).bind("update.pager updateRows.pager updateAll.pager addRows.pager ",function(a){a.stopPropagation();u(f,d);a=g.$tbodies.eq(0).children();d.totalRows=a.length-(d.countChildRows?0:a.filter("."+g.cssChildRow).length);d.totalPages=Math.ceil(d.totalRows/ d.size);t(f,d);v(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();y(f,parseInt(b,10)||10,d);v(f,d);t(f,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);q(f,d);t(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[H,J,I,C];n.find(c.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var b=h(this),g=c.length;if(!b.hasClass(d.cssDisabled))for(a= 0;a/.test(p)?h(p):h(''+p+"")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^[.#]/,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery); +/* tablesorter pager plugin updated 5/28/2014 (v2.17.1) */ +;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(b,a){var c=b.cssDisabled,e=!!a,f=e||0===b.page,g=Math.min(b.totalPages,b.filteredPages),e=e||b.page===g-1||0===b.totalPages;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f?"addClass":"removeClass"](c).attr("aria-disabled", f),b.$container.find(b.cssNext+","+b.cssLast)[e?"addClass":"removeClass"](c).attr("aria-disabled",e))},t=function(b,a,c){var e,f,g,l=b.config;e=l.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=[];f=a.size||10;g=[l.widgetOptions&&l.widgetOptions.filter_filteredRow||"filtered",l.selectorRemove];a.countChildRows&&g.push(l.cssChildRow);g.join("|");a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=e?0:a.totalRows;a.filteredPages=a.totalPages;e&&(h.each(l.cache[0].normalized,function(d,b){a.filteredRows+= a.regexRows.test(b[l.columns].$row[0].className)?0:1}),a.filteredPages=Math.ceil(a.filteredRows/f)||0);if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),e=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(d,b){return a.totalPages?a.page+(b?parseInt(b, 10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(d){d=d.replace(/[{}\s]/g,"");var b=d.split(":"),c=a.ajaxData,e=/(rows?|pages?)$/i.test(d)?0:"";return 1"+e+"";a.$goto.html(g).val(a.page+1)}p(a);a.initialized&&!1!==c&&(l.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b, a.storageKey,{page:a.page,size:a.size}))},u=function(b,a){var c,e=b.config,f=e.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=h.data(b,"pagerSavedHeight"))&&(c-=f.height(),5'))},z=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b, "pagerSavedHeight",c.height());u(b,a);h.data(b,"pagerLastSize",a.size)},v=function(b,a){if(!a.ajaxUrl){var c,e=0,f=b.config,g=f.$tbodies.eq(0).children(),h=g.length,d=a.page*a.size,m=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",r=0;for(c=0;c=d&&r";for(f=0;f"+e[g][f]+"";p+=""}c.processAjaxOnInit&&s.$tbodies.eq(0).html(p)}c.processAjaxOnInit=!0;n&&n.length===b&&(m=(l=q.hasClass("hasStickyHeaders"))?s.widgetOptions.$sticky.children("thead:first").children().children(): "",d=q.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(a){var b=h(this),c;b.find("."+k.css.icon).length?(c=b.find("."+k.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(n[a]).append(c),l&&m.length&&(c=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(c))):(b.find(".tablesorter-header-inner").html(n[a]),l&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));d.eq(a).html(n[a])}))}s.showProcessing&&k.isProcessing(a); c.totalPages=Math.ceil(c.totalRows/(c.size||10));c.last.totalRows=c.totalRows;c.last.currentFilters=c.currentFilters;c.last.sortList=(s.sortList||[]).join(",");t(a,c);u(a,c);q.trigger("updateCache",[function(){c.initialized&&setTimeout(function(){q.trigger("applyWidgets").trigger("pagerChange",c)},0)}])}c.initialized||(c.initialized=!0,h(a).trigger("applyWidgets").trigger("pagerInitialized",c))},G=function(b,a){var c=F(b,a),e=h(document),f,g=b.config;""!==c&&(g.showProcessing&&k.isProcessing(b,!0), e.bind("ajaxError.pager",function(c,d,f,g){B(null,b,a,d,g);e.unbind("ajaxError.pager")}),f=++a.ajaxCounter,a.ajaxObject.url=c,a.ajaxObject.success=function(c,d,g){f(a&&a.length||0))){c.page>=c.totalPages&&C(b,c);c.isDisabled=!1;c.initialized&&d.trigger("pagerChange",c);if(c.removeRows){k.clearTableBody(b);e=k.processTbody(b,e.$tbodies.eq(0),!0);f=m?0:n;g=m?0:n;for(l=0;ln&&l<= r&&(l++,e.append(a[f]))),f++;k.processTbody(b,e,!1)}else v(b,c);t(b,c);c.isDisabled||u(b,c);d.trigger("applyWidgets");b.isUpdating&&d.trigger("updateComplete",b)}},D=function(b,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(b,"pagerLastPage",a.page),h.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),x(b,b.config.rowsCopy,a),b.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).each(function(){h(this).attr("aria-disabled", "true").addClass(a.cssDisabled)[0].disabled=!0})},q=function(b,a,c){if(!a.isDisabled){var e=b.config,f=h(b),g=a.last,l=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>l-1&&0!==l&&(a.page=l-1);g.currentFilters=""===(g.currentFilters||[]).join("")?[]:g.currentFilters;a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters;if(g.page!==a.page||g.size!==a.size||g.totalRows!==a.totalRows||(g.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||g.sortList!== (e.sortList||[]).join(","))e.debug&&k.log("Pager changing to page "+a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[]},a.ajax?G(b,a):a.ajax||x(b,e.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(f.trigger("pageMoved",a).trigger("applyWidgets"),b.isUpdating&&f.trigger("updateComplete"))}},y=function(b,a,c){c.size=a||c.size||10;c.$size.val(c.size);h.data(b,"pagerLastPage",c.page);h.data(b,"pagerLastSize", c.size);c.totalPages=Math.ceil(c.totalRows/c.size);c.filteredPages=Math.ceil(c.filteredRows/c.size);q(b,c)},H=function(b,a){a.page=0;q(b,a)},C=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;q(b,a)},I=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);q(b,a)},J=function(b,a){a.page--;0>=a.page&&(a.page=0);q(b,a)},E=function(b,a,c){var e,f=b.config;a.$size.add(a.$goto).removeClass(a.cssDisabled).removeAttr("disabled").attr("aria-disabled", "false");a.isDisabled=!1;a.page=h.data(b,"pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")||parseInt(a.$size.find("option[selected]").val(),10)||a.size||10;a.$size.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalRows,a.filteredRows)/a.size);b.id&&(e=b.id+"_pager_info",a.$container.find(a.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby",e));c&&(f.$table.trigger("updateRows"),y(b,a.size,a),A(b,a),u(b,a),f.debug&&k.log("pager enabled"))};w.appender=function(b,a){var c=b.config, e=c.pager;e.ajax||(c.rowsCopy=a,e.totalRows=e.countChildRows?c.$tbodies.eq(0).children().length:a.length,e.size=h.data(b,"pagerLastSize")||e.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),x(b,a,e),t(b,e,!1))};w.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,e,f=this,g=f.config,l=g.widgetOptions,d=g.pager=h.extend(!0,{},h.tablesorterPager.defaults,b),m=g.$table,n=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing"); d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;g.appender=w.appender;k.filter&&0<=h.inArray("filter",g.widgets)&&(d.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,d.currentFilters,!1));d.savePages&&k.storage&&(a=k.storage(f,d.storageKey)||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10,h.data(f,"pagerLastSize",d.size));d.regexRows=new RegExp("("+(l.filter_filteredRow||"filtered")+"|"+g.selectorRemove.substring(1)+ "|"+g.cssChildRow+")");m.unbind("filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b;!1!==d.pageReset&&(g.lastCombinedFilter||"")!==(b||[]).join("")&&(d.page=d.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){d.initialized&&(t(f,d,!1),q(f,d,!1),u(f,d))}).bind("disable.pager",function(a){a.stopPropagation();D(f,d)}).bind("enable.pager",function(a){a.stopPropagation(); E(f,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();D(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;delete f.config.rowsCopy;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,d.storageKey,"")}).bind("update.pager updateRows.pager updateAll.pager addRows.pager ",function(a){a.stopPropagation();u(f,d);a=g.$tbodies.eq(0).children();d.totalRows=a.length-(d.countChildRows?0:a.filter("."+g.cssChildRow).length);d.totalPages= Math.ceil(d.totalRows/d.size);t(f,d);v(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();y(f,parseInt(b,10)||10,d);v(f,d);t(f,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);q(f,d);t(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[H,J,I,C];n.find(c.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var b=h(this), g=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;a/.test(p)?h(p):h(''+p+"")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^[.#]/,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery); diff --git a/bower.json b/bower.json index 0045f761..42b6f51a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tablesorter", - "version": "2.17.0", + "version": "2.17.1", "dependencies": { "jquery": ">=1.2.6" }, diff --git a/docs/index.html b/docs/index.html index 97c90a26..e67270cc 100644 --- a/docs/index.html +++ b/docs/index.html @@ -2976,8 +2976,8 @@ $.extend($.tablesorter.themes.jui, { .tablesorter() .tablesorterPager({ ajaxUrl: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}", - ajaxProcessing: function(ajax){ - // do something with the ajax + ajaxProcessing: function(data, table, xhr){ + // do something with the ajax data return [ formatted_data, total_rows ]; } }); @@ -3023,8 +3023,8 @@ $.extend($.tablesorter.themes.jui, { .tablesorter() .tablesorterPager({ ajaxUrl: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}", - ajaxProcessing: function(ajax){ - // do something with the ajax + ajaxProcessing: function(data, table, xhr){ + // do something with the ajax data return [ formatted_data, total_rows ]; }, // modify the url after all processing has been applied @@ -3061,8 +3061,8 @@ $.extend($.tablesorter.themes.jui, { // see http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings dataType: 'json' }, - ajaxProcessing: function(ajax){ - // do something with the ajax; + ajaxProcessing: function(data, table, xhr){ + // do something with the ajax data; return [ total_rows ]; } }); @@ -3130,7 +3130,7 @@ $.extend($.tablesorter.themes.jui, { .tablesorter() .tablesorterPager({ ajaxUrl: "http://mydatabase.com?page={page}&size={size}", - ajaxProcessing: function(data){ + ajaxProcessing: function(data, table, xhr){ if (data && data.hasOwnProperty('rows')) { var r, row, c, d = data.rows, // total number of rows (required) @@ -3158,7 +3158,7 @@ $.extend($.tablesorter.themes.jui, { } }); });Or, in tablesorter v2.10, return a jQuery object -
ajaxProcessing: function(data, table){
+
ajaxProcessing: function(data, table, xhr){
   if (data && data.hasOwnProperty('rows')) {
     var r, row, c, d = data.rows,
     // total number of rows (required)
@@ -3186,7 +3186,7 @@ $.extend($.tablesorter.themes.jui, {
     return [ total, $(rows), headers ];
   }
 }
Or, also in tablesorter v2.10, just build the table yourself and return the total number of rows: -
ajaxProcessing: function(data, table){
+
ajaxProcessing: function(data, table, xhr){
   if (data && data.hasOwnProperty('rows')) {
     var r, row, c, d = data.rows,
     // total number of rows (required)
@@ -3224,7 +3224,7 @@ So, lets say the data sent by the server looks like this:
     "tasty"         : "It's delicious!"
 }
This ajaxProcessing function must return an object with "total", "headers" and "rows" properties! As before, "total" is the only required property; if the headers don't need to be changed, don't return a headers array, and if you append the rows to the table yourself within the ajaxProcessing function, you don't need to return a "rows" property. -
ajaxProcessing: function(result, table){
+
ajaxProcessing: function(result, table, xhr){
     if (result && result.hasOwnProperty('data')) {
 
         // "total" is a required property!
diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js
index 4bd146c2..29f29140 100644
--- a/js/jquery.tablesorter.js
+++ b/js/jquery.tablesorter.js
@@ -1,5 +1,5 @@
 /**!
-* TableSorter 2.17.0 - Client-side table sorting with ease!
+* TableSorter 2.17.1 - Client-side table sorting with ease!
 * @requires jQuery v1.2.6+
 *
 * Copyright (c) 2007 Christian Bach
@@ -24,7 +24,7 @@
 
 			var ts = this;
 
-			ts.version = "2.17.0";
+			ts.version = "2.17.1";
 
 			ts.parsers = [];
 			ts.widgets = [];
@@ -953,7 +953,7 @@
 					e.stopPropagation();
 					ts.destroy(table, c, cb);
 				})
-				.bind("resetToLoadState" + c.namespace, function(e){
+				.bind("resetToLoadState" + c.namespace, function(){
 					// remove all widgets
 					ts.refreshWidgets(table, true, true);
 					// restore original settings; this clears out current settings, but does not clear
@@ -1641,7 +1641,7 @@
 		is: function() {
 			return false;
 		},
-		format: function(s) {
+		format: function() {
 			return '';
 		},
 		type: 'text'
diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js
index 163a773b..0c52bdc0 100644
--- a/js/jquery.tablesorter.min.js
+++ b/js/jquery.tablesorter.min.js
@@ -1,5 +1,5 @@
 /*!
-* TableSorter 2.17.0 min - Client-side table sorting with ease!
+* TableSorter 2.17.1 min - Client-side table sorting with ease!
 * Copyright (c) 2007 Christian Bach
 */
-!function(g){g.extend({tablesorter:new function(){function d(){var b=arguments[0],a=1':"";m.$headers.each(function(d){c=g(this);a=f.getColumnData(b,m.headers,d,!0);m.headerContent[d]=g(this).html();s=m.headerTemplate.replace(/\{content\}/g, g(this).html()).replace(/\{icon\}/g,e);m.onRenderTemplate&&(h=m.onRenderTemplate.apply(c,[d,s]))&&"string"===typeof h&&(s=h);g(this).html('
'+s+"
");m.onRenderHeader&&m.onRenderHeader.apply(c,[d]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,a,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;k=f.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof k&&!1!==k&&(this.order=this.lockedOrder=C(k)? [1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+m.cssHeader);m.headerList[d]=this;c.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow).attr("role","row");m.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});B(b);m.debug&&(v("Built headers:",l),d(m.$headers))}function E(b,a,c){var h=b.config;h.$table.find(h.selectorRemove).remove();u(b);y(b);H(h.$table,a,c)}function B(b){var a,c,h=b.config;h.$headers.each(function(e,s){c=g(s);a="false"===f.getData(s,f.getColumnData(b,h.headers, e,!0),"sorter");s.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function G(b){var a,c,h=b.config,e=h.sortList,s=e.length,d=f.css.sortNone+" "+h.cssNone,l=[f.css.sortAsc+" "+h.cssAsc,f.css.sortDesc+" "+h.cssDesc],m=["ascending","descending"],r=g(b).find("tfoot tr").children().add(h.$extraHeaders).removeClass(l.join(" "));h.$headers.removeClass(l.join(" ")).addClass(d).attr("aria-sort","none"); for(a=0;a"),c=g(b).width();g(b.tBodies[0]).find("tr:first").children("td:visible").each(function(){a.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(b).prepend(a)}}function M(b,a){var c,h,e,f,d,l=b.config,m=a||l.sortList;l.sortList=[];g.each(m,function(b,a){f= parseInt(a[0],10);if(e=l.$headers.filter('[data-column="'+f+'"]:last')[0]){h=(h=(""+a[1]).match(/^(1|d|s|o|n)/))?h[0]:"";switch(h){case "1":case "d":h=1;break;case "s":h=d||0;break;case "o":c=e.order[(d||0)%(l.sortReset?3:2)];h=0===c?1:1===c?0:2;break;case "n":e.count+=1;h=e.order[e.count%(l.sortReset?3:2)];break;default:h=0}d=0===b?h:d;c=[f,parseInt(h,10)||0];l.sortList.push(c);h=g.inArray(c[1],e.order);e.count=0<=h?h:c[1]%(l.sortReset?3:2)}})}function N(b,a){return b&&b[a]?b[a].type||"":""}function O(b, a,c){var h,e,d,k=b.config,l=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this===e||!l&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=a.column;if(l){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,c=0;ch&&(k.sortList.push([e,h]),1h&&(k.sortList.push([e,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc", sortNone:"tablesorter-headerUnSorted"};f.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"};f.log=d;f.benchmark=v;f.construct=function(b){return this.each(function(){var a=g.extend(!0,{},f.defaults,b);a.originalSettings=b;!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,a):f.setup(this, a)})};f.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",h=g(b),e=g.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;g.data(b,"tablesorter",a);a.debug&&g.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=g.fn.detach?a.detach():a.remove();c=g(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};f.clearTableBody=function(b){g(b)[0].config.$tbodies.detach()};f.bindEvents=function(b,a,c){b=g(b)[0];var d,e=b.config;!0!==c&&(e.$extraHeaders= e.$extraHeaders?e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" "),function(c,f){var l;l=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==c.which||"mouseup"===l&&!0!==f&&250<(new Date).getTime()-d)){if("mousedown"===l)return d=(new Date).getTime(),"INPUT"===c.target.tagName?"":!e.cancelSelection;e.delayInit&& n(e.cache)&&y(b);l=g.fn.closest?g(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];l=e.$headers[a.index(l)];l.sortDisabled||O(b,l,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(b){var a=g(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){g(this).find("."+f.css.headerIn).length&&g(this).html(a.headerContent[b])})};f.destroy=function(b,a,c){b=g(b)[0]; if(b.hasInitialized){f.refreshWidgets(b,!0,!0);var d=g(b),e=b.config,s=d.find("thead:first"),k=s.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),l=d.find("tfoot:first > tr").children("th, td");!1===a&&0<=g.inArray("uitheme",e.widgets)&&(d.trigger("applyWidgetId",["uitheme"]),d.trigger("applyWidgetId",["zebra"]));s.find("tr").not(k).remove();d.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(e.namespace+ " "));e.$headers.add(l).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");k.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(b);d.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(b,a){if(b===a)return 0;var c,d,e,g,k,l;d=f.regex;if(d.hex.test(a)){c=parseInt(b.match(d.hex),16);e=parseInt(a.match(d.hex),16);if(ce)return 1}c=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");l=Math.max(c.length,d.length);for(k=0;kg)return 1}return 0};f.sortNaturalAsc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(b,a)};f.sortNaturalDesc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:f.sortNatural(a,b)};f.sortText=function(b,a){return b>a?1:bg.inArray(k[h].id,n))&&(e.debug&&d('Refeshing widgets: Removing "'+k[h].id+'"'),k[h].hasOwnProperty("remove")&&e.widgetInit[k[h].id]&&(k[h].remove(b,e,e.widgetOptions),e.widgetInit[k[h].id]=!1));!0!==c&&f.applyWidget(b,a)};f.getData=function(b,a,c){var d= "";b=g(b);var e,f;if(!b.length)return"";e=g.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())?d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(d)};f.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat: "undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)?g.trim(b):c};f.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=g.tablesorter;g.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(d,v){var n=v.config;d&&(d=g.trim(n.ignoreCase?d.toLocaleLowerCase():d), d=n.sortLocaleCompare?p.replaceAccents(d):d);return d},type:"text"});p.addParser({id:"digit",is:function(d){return p.isDigit(d)},format:function(d,v){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof n?n:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d, v){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof n?n:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var n,w=d?d.split("."):"",u="",y=w.length;for(n=0;nd.length},format:function(d,g){return d?p.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});p.addParser({id:"usLongDate", is:function(d){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(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,n,w){if(d){n=g.config; var u=n.$headers.filter("[data-column="+w+"]:last");w=u.length&&u[0].dateFormat||p.getData(u,p.getColumnData(g,n.headers,w),"dateFormat")||n.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===w&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?p.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"}); p.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"metadata",is:function(){return!1},format:function(d,p,n){d=p.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(n).metadata()[d]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(d,v,n){var w,u, y,z,C,D,E=new RegExp(v.cssChildRow,"i"),B=v.$tbodies;v.debug&&(C=new Date);for(d=0;d':"";m.$headers.each(function(d){c=g(this);a=f.getColumnData(b,m.headers,d,!0);m.headerContent[d]=g(this).html(); r=m.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,e);m.onRenderTemplate&&(h=m.onRenderTemplate.apply(c,[d,r]))&&"string"===typeof h&&(r=h);g(this).html('
'+r+"
");m.onRenderHeader&&m.onRenderHeader.apply(c,[d]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,a,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;k=f.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof k&& !1!==k&&(this.order=this.lockedOrder=C(k)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+m.cssHeader);m.headerList[d]=this;c.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow).attr("role","row");m.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});B(b);m.debug&&(v("Built headers:",l),d(m.$headers))}function E(b,a,c){var h=b.config;h.$table.find(h.selectorRemove).remove();t(b);x(b);H(h.$table,a,c)}function B(b){var a,c,h=b.config;h.$headers.each(function(e,r){c=g(r);a="false"=== f.getData(r,f.getColumnData(b,h.headers,e,!0),"sorter");r.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function G(b){var a,c,h=b.config,e=h.sortList,r=e.length,d=f.css.sortNone+" "+h.cssNone,l=[f.css.sortAsc+" "+h.cssAsc,f.css.sortDesc+" "+h.cssDesc],m=["ascending","descending"],y=g(b).find("tfoot tr").children().add(h.$extraHeaders).removeClass(l.join(" "));h.$headers.removeClass(l.join(" ")).addClass(d).attr("aria-sort", "none");for(a=0;a"),c=g(b).width();g(b.tBodies[0]).find("tr:first").children("td:visible").each(function(){a.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(b).prepend(a)}}function M(b,a){var c,h,e,f,d,l=b.config,m=a||l.sortList;l.sortList=[];g.each(m,function(b, a){f=parseInt(a[0],10);if(e=l.$headers.filter('[data-column="'+f+'"]:last')[0]){h=(h=(""+a[1]).match(/^(1|d|s|o|n)/))?h[0]:"";switch(h){case "1":case "d":h=1;break;case "s":h=d||0;break;case "o":c=e.order[(d||0)%(l.sortReset?3:2)];h=0===c?1:1===c?0:2;break;case "n":e.count+=1;h=e.order[e.count%(l.sortReset?3:2)];break;default:h=0}d=0===b?h:d;c=[f,parseInt(h,10)||0];l.sortList.push(c);h=g.inArray(c[1],e.order);e.count=0<=h?h:c[1]%(l.sortReset?3:2)}})}function N(b,a){return b&&b[a]?b[a].type||"":""} function O(b,a,c){var h,e,d,k=b.config,l=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this===e||!l&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=a.column;if(l){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,c=0;ch&&(k.sortList.push([e,h]),1h&&(k.sortList.push([e,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc", sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};f.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"};f.log=d;f.benchmark=v;f.construct=function(b){return this.each(function(){var a=g.extend(!0,{},f.defaults,b);a.originalSettings=b;!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName? f.buildTable(this,a):f.setup(this,a)})};f.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",h=g(b),e=g.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;g.data(b,"tablesorter",a);a.debug&&g.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=g.fn.detach?a.detach():a.remove();c=g(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};f.clearTableBody=function(b){g(b)[0].config.$tbodies.detach()};f.bindEvents=function(b,a,c){b=g(b)[0];var d,e=b.config;!0!==c&&(e.$extraHeaders= e.$extraHeaders?e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" "),function(c,f){var l;l=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==c.which||"mouseup"===l&&!0!==f&&250<(new Date).getTime()-d)){if("mousedown"===l)return d=(new Date).getTime(),/(input|select|button|textarea)/i.test(c.target.tagName)? "":!e.cancelSelection;e.delayInit&&p(e.cache)&&x(b);l=g.fn.closest?g(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];l=e.$headers[a.index(l)];l.sortDisabled||O(b,l,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(b){var a=g(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){g(this).find("."+f.css.headerIn).length&&g(this).html(a.headerContent[b])})}; f.destroy=function(b,a,c){b=g(b)[0];if(b.hasInitialized){f.refreshWidgets(b,!0,!0);var d=g(b),e=b.config,r=d.find("thead:first"),k=r.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),l=d.find("tfoot:first > tr").children("th, td");!1===a&&0<=g.inArray("uitheme",e.widgets)&&(d.trigger("applyWidgetId",["uitheme"]),d.trigger("applyWidgetId",["zebra"]));r.find("tr").not(k).remove();d.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(e.namespace+ " "));e.$headers.add(l).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");k.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(b);d.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(b,a){if(b===a)return 0;var c,d,e,g,k,l;d=f.regex;if(d.hex.test(a)){c=parseInt(b.match(d.hex),16);e=parseInt(a.match(d.hex),16);if(ce)return 1}c=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");l=Math.max(c.length,d.length);for(k=0;kg)return 1}return 0};f.sortNaturalAsc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(b,a)};f.sortNaturalDesc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:f.sortNatural(a,b)};f.sortText=function(b,a){return b>a?1:bg.inArray(k[h].id,p))&&(e.debug&&d('Refeshing widgets: Removing "'+k[h].id+'"'),k[h].hasOwnProperty("remove")&&e.widgetInit[k[h].id]&&(k[h].remove(b,e,e.widgetOptions),e.widgetInit[k[h].id]=!1));!0!==c&&f.applyWidget(b,a)};f.getData=function(b,a,c){var d= "";b=g(b);var e,f;if(!b.length)return"";e=g.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())?d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(d)};f.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat: "undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)?g.trim(b):c};f.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var n=g.tablesorter;g.fn.extend({tablesorter:n.construct});n.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"});n.addParser({id:"text",is:function(){return!0}, format:function(d,v){var p=v.config;d&&(d=g.trim(p.ignoreCase?d.toLocaleLowerCase():d),d=p.sortLocaleCompare?n.replaceAccents(d):d);return d},type:"text"});n.addParser({id:"digit",is:function(d){return n.isDigit(d)},format:function(d,v){var p=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof p?p:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d|| "").replace(/[+\-,. ]/g,""))},format:function(d,v){var p=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof p?p:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var p,w=d?d.split("."):"",t="",x=w.length;for(p=0;pd.length},format:function(d,g){return d?n.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});n.addParser({id:"usLongDate", is:function(d){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(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,p,w){if(d){p=g.config; var t=p.$headers.filter("[data-column="+w+"]:last");w=t.length&&t[0].dateFormat||n.getData(t,n.getColumnData(g,p.headers,w),"dateFormat")||p.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===w&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?n.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"}); n.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"metadata",is:function(){return!1},format:function(d,n,p){d=n.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(p).metadata()[d]},type:"numeric"});n.addWidget({id:"zebra",priority:90,format:function(d,v,p){var w,t, x,z,C,D,E=new RegExp(v.cssChildRow,"i"),B=v.$tbodies;v.debug&&(C=new Date);for(d=0;d'),a.cssIcon&&g.find("."+c.css.icon).addClass(n.icons),d.hasClass("hasFilters")&&g.find("."+c.css.filterRow).addClass(n.filterRow));for(d=0;d=]/g},types:{regex:function(b,a,e,d){if(c.filter.regex.regex.test(a)){var f;b=c.filter.regex.regex.exec(a);try{f=(new RegExp(b[1],b[2])).test(d)}catch(g){f=!1}return f}return null},operators:function(b,a,e,d,f,g,h,k,n){if(/^[<>]=?/.test(a)){var p;e=h.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),h);k=e.parsers[g];e=b;if(n[g]||"numeric"=== k.type)p=k.format(l.trim(""+a.replace(c.filter.regex.operators,"")),h,[],g),b="number"!==typeof p||""===p||isNaN(p)?b:p;d=!n[g]&&"numeric"!==k.type||isNaN(b)||"undefined"===typeof f?isNaN(d)?c.formatFloat(d.replace(c.filter.regex.nondigit,""),h):c.formatFloat(d,h):f;/>/.test(a)&&(p=/>=/.test(a)?d>=b:d>b);/k&&(d=e,e=k,k=d);return a>=e&&a<=k||""===e||""===k}return null},wild:function(b,a,e,d,f,g,h,k,n,p){return/[\?|\*]/.test(a)|| c.filter.regex.orReplace.test(b)?(b=h.config,a=a.replace(c.filter.regex.orReplace,"|"),!b.$headers.filter('[data-column="'+g+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=l.isArray(p)?"("+a+")":"^("+a+")$"),(new RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"))).test(d)):null},fuzzy:function(b,a,c,d){if(/^~/.test(a)){b=0;c=d.length;var f=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||e.filter_placeholder.select|| "")+"":"",d+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+h+'"]').append(d)}c.filter.buildDefault(b,!0);c.filter.bindSearch(b,a.$table.find("."+c.css.filter),!0);e.filter_external&&c.filter.bindSearch(b,e.filter_external);e.filter_hideFilters&&c.filter.hideFilters(b,a);a.showProcessing&&a.$table.bind("filterStart"+a.namespace+"filter filterEnd"+a.namespace+"filter",function(d,e){g=e?a.$table.find("."+c.css.header).filter("[data-column]").filter(function(){return""!== e[l(this).data("column")]}):"";c.isProcessing(b,"filterStart"===d.type,e?g:"")});a.debug&&c.benchmark("Applying Filter widget",n);a.$table.bind("tablesorter-initialized pagerInitialized",function(){k=c.filter.setDefaults(b,a,e)||[];k.length&&c.setFilters(b,k,!0);a.$table.trigger("filterFomatterUpdate");c.filter.checkFilters(b,k)});e.filter_initialized=!0;a.$table.trigger("filterInit")},setDefaults:function(b,a,e){var d,f=c.getFilters(b)||[];e.filter_saveFilters&&c.storage&&(d=c.storage(b,"tablesorter-filters")|| [],(b=l.isArray(d))&&""===d.join("")||!b||(f=d));if(""===f.join(""))for(b=0;b';for(d=0;d";a.$filters=l(g+"").appendTo(a.$table.children("thead").eq(0)).find("td");for(d=0;d").appendTo(a.$filters.eq(d)):((g=c.getColumnData(b,e.filter_formatter,d))?((g=g(a.$filters.eq(d),d))&&0===g.length&&(g=a.$filters.eq(d).children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==a.$filters[d])&&a.$filters.eq(d).append(g)):g=l('').appendTo(a.$filters.eq(d)),g&& g.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||e.filter_placeholder.search||"")),g&&(f=(l.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[d]?e.filter_cssFilter[d]||"":"":e.filter_cssFilter)||"",g.addClass(c.css.filter+" "+f).attr("data-column",d),h&&(g.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a,e){b=l(b)[0];a=l(a);if(a.length){var d=b.config,f=d.widgetOptions,g=f.filter_$externalFilters;!0!==e&&(f.filter_$anyMatch= a.filter('[data-column="all"]'),f.filter_$externalFilters=g&&g.length?f.filter_$externalFilters.add(a):a,c.setFilters(b,d.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keypress","keyup","search","change",""].join(d.namespace+"filter ")).bind(["keyup","search","change",""].join(d.namespace+"filter "),function(a){l(this).attr("data-lastSearchTime",(new Date).getTime());if(27===a.which)this.value="";else if("number"===typeof f.filter_liveSearch&&this.value.length< f.filter_liveSearch&&""!==this.value||"keyup"===a.type&&(32>a.which&&8!==a.which&&!0===f.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===f.filter_liveSearch))return;c.filter.searching(b,"change"!==a.type,!0)}).bind("keypress."+d.namespace+"filter",function(a){13===a.which&&(a.preventDefault(),l(this).blur())});d.$table.bind("filterReset",function(){a.val("")})}},checkFilters:function(b,a,e){var d=b.config,f=d.widgetOptions,g=l.isArray(a),h=g?a:c.getFilters(b,!0),k=(h|| []).join("");if(!l.isEmptyObject(d.cache)&&(g&&c.setFilters(b,h,!1,!0!==e),f.filter_hideFilters&&d.$table.find("."+c.css.filterRow).trigger(""===k?"mouseleave":"mouseenter"),d.lastCombinedFilter!==k||!1===a))if(!1===a&&(d.lastCombinedFilter=null,d.lastSearch=[]),d.$table.trigger("filterStart",[h]),d.showProcessing)setTimeout(function(){c.filter.findRows(b,h,k);return!1},30);else return c.filter.findRows(b,h,k),!1},hideFilters:function(b,a){var e,d,f;l(b).find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave", function(b){e=l(this);clearTimeout(f);f=setTimeout(function(){/enter|over/.test(b.type)?e.removeClass("hideme"):l(document.activeElement).closest("tr")[0]!==e[0]&&""===a.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(b){d=l(this).closest("tr");clearTimeout(f);f=setTimeout(function(){if(""===c.getFilters(a.$table).join(""))d["focus"===b.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var d, f,g,h,k,n,p,m,s,r,t,x,v,w,z,y,A,B,L,C,G,H,I,J,M,D,E=c.filter.regex,q=b.config,u=q.widgetOptions,N=q.columns,K=q.$table.children("tbody"),O=["range","notMatch","operators"],F=q.$headers.map(function(a){return q.parsers&&q.parsers[a]&&q.parsers[a].parsed||c.getData&&"parsed"===c.getData(q.$headers.filter('[data-column="'+a+'"]:last'),c.getColumnData(b,q.headers,a),"filter")||l(this).hasClass("filter-parsed")}).get();q.debug&&(L=new Date);for(k=0;k=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s))&&!(""!==s&&q.$filters&& q.$filters.eq(r).find("select").length&&!q.$headers.filter('[data-column="'+r+'"]:last').hasClass("filter-match"));p=g.not("."+u.filter_filteredRow).length;y&&0===p&&(y=!1);q.debug&&c.log("Searching through "+(y&&pl.inArray(a,O)&&(w=d(C, G,I,J,M,N,b,u,F,H),null!==w))return A=w,!1}),B=null!==A?A:0<=(J+r).indexOf(G));for(m=0;m'+(h.data("placeholder")||h.attr("data-placeholder")||g.filter_placeholder.select||"")+"",k=c.filter.getOptionSource(b,a,d),n=f.$table.find("thead").find("select."+c.css.filter+'[data-column="'+a+'"]').val();for(b=0;b"+k[b]+"":"";f=(f.$filters? f.$filters:f.$table.children("thead")).find("."+c.css.filter);g.filter_$externalFilters&&(f=f&&f.length?f.add(g.filter_$externalFilters):g.filter_$externalFilters);f.filter('select[data-column="'+a+'"]')[e?"html":"append"](h);g.filter_functions||(g.filter_functions={});g.filter_functions[a]=!0}},buildDefault:function(b,a){var e,d,f=b.config,g=f.widgetOptions,h=f.columns;for(e=0;eb.top&&cMath.abs(n.parent().width()-n.width()),t=function(){c.storage&&m&&s&&(k={},k[m.index()]= m.width(),k[s.index()]=s.width(),m.width(k[m.index()]),s.width(k[s.index()]),!1!==e.resizable&&c.storage(b,"tablesorter-resizable",a.$headers.map(function(){return l(this).width()}).get()));p=0;m=s=null;l(window).trigger("resize")};if(k=c.storage&&!1!==e.resizable?c.storage(b,"tablesorter-resizable"):{})for(h in k)!isNaN(h)&&h');e.resizable_addLastColumn||(g=g.slice(0,-1));f=f?f.add(g):g});f.each(function(){var a=l(this),b=parseInt(a.css("padding-right"),10)+10;a.find("."+ c.css.wrapper).append('
')}).bind("mousemove.tsresize",function(a){if(0!==p&&m){var b=a.pageX-p,c=m.width();m.width(c+b);m.width()!==c&&r&&s.width(s.width()-b);p=a.pageX}}).bind("mouseup.tsresize",function(){t()}).find("."+c.css.resizer+",."+c.css.grip).bind("mousedown",function(b){m=l(b.target).closest("th");var c=a.$headers.filter('[data-column="'+m.attr("data-column")+ '"]');1'),a.cssIcon&&g.find("."+c.css.icon).addClass(n.icons),d.hasClass("hasFilters")&&g.find("."+c.css.filterRow).addClass(n.filterRow));for(d=0;d=]/g},types:{regex:function(b,a,e,d){if(c.filter.regex.regex.test(a)){var f;b=c.filter.regex.regex.exec(a);try{f=(new RegExp(b[1],b[2])).test(d)}catch(g){f=!1}return f}return null},operators:function(b,a,e,d,f,g,h,l,n){if(/^[<>]=?/.test(a)){var p;e=h.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),h);l=e.parsers[g];e=b;if(n[g]||"numeric"=== l.type)p=l.format(k.trim(""+a.replace(c.filter.regex.operators,"")),h,[],g),b="number"!==typeof p||""===p||isNaN(p)?b:p;d=!n[g]&&"numeric"!==l.type||isNaN(b)||"undefined"===typeof f?isNaN(d)?c.formatFloat(d.replace(c.filter.regex.nondigit,""),h):c.formatFloat(d,h):f;/>/.test(a)&&(p=/>=/.test(a)?d>=b:d>b);/ l&&(d=e,e=l,l=d);return a>=e&&a<=l||""===e||""===l}return null},wild:function(b,a,e,d,f,g,h,l,n,p){return/[\?|\*]/.test(a)||c.filter.regex.orReplace.test(b)?(b=h.config,a=a.replace(c.filter.regex.orReplace,"|"),!b.$headers.filter('[data-column="'+g+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=k.isArray(p)?"("+a+")":"^("+a+")$"),(new RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"))).test(d)):null},fuzzy:function(b,a,c,d){if(/^~/.test(a)){b=0;c=d.length;var f=a.slice(1);for(a=0;a'+ (g.data("placeholder")||g.attr("data-placeholder")||e.filter_placeholder.select||"")+"":"",d+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+h+'"]').append(d)}c.filter.buildDefault(b,!0);c.filter.bindSearch(b,a.$table.find("."+c.css.filter),!0);e.filter_external&&c.filter.bindSearch(b,e.filter_external);e.filter_hideFilters&&c.filter.hideFilters(b,a);a.showProcessing&&a.$table.bind("filterStart"+a.namespace+"filter filterEnd"+a.namespace+ "filter",function(d,e){g=e?a.$table.find("."+c.css.header).filter("[data-column]").filter(function(){return""!==e[k(this).data("column")]}):"";c.isProcessing(b,"filterStart"===d.type,e?g:"")});a.debug&&c.benchmark("Applying Filter widget",n);a.$table.bind("tablesorter-initialized pagerInitialized",function(){l=c.filter.setDefaults(b,a,e)||[];l.length&&c.setFilters(b,l,!0);a.$table.trigger("filterFomatterUpdate");c.filter.checkFilters(b,l)});e.filter_initialized=!0;a.$table.trigger("filterInit")}, setDefaults:function(b,a,e){var d,f=c.getFilters(b)||[];e.filter_saveFilters&&c.storage&&(d=c.storage(b,"tablesorter-filters")||[],(b=k.isArray(d))&&""===d.join("")||!b||(f=d));if(""===f.join(""))for(b=0;b';for(d=0;d";a.$filters=k(g+"").appendTo(a.$table.children("thead").eq(0)).find("td"); for(d=0;d").appendTo(a.$filters.eq(d)):((g=c.getColumnData(b,e.filter_formatter,d))?((g=g(a.$filters.eq(d),d))&&0===g.length&&(g=a.$filters.eq(d).children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==a.$filters[d])&& a.$filters.eq(d).append(g)):g=k('').appendTo(a.$filters.eq(d)),g&&g.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||e.filter_placeholder.search||"")),g&&(f=(k.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[d]?e.filter_cssFilter[d]||"":"":e.filter_cssFilter)||"",g.addClass(c.css.filter+" "+f).attr("data-column",d),h&&(g.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a,e){b=k(b)[0];a=k(a);if(a.length){var d= b.config,f=d.widgetOptions,g=f.filter_$externalFilters;!0!==e&&(f.filter_$anyMatch=a.filter('[data-column="all"]'),f.filter_$externalFilters=g&&g.length?f.filter_$externalFilters.add(a):a,c.setFilters(b,d.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keypress","keyup","search","change",""].join(d.namespace+"filter ")).bind(["keyup","search","change",""].join(d.namespace+"filter "),function(a){k(this).attr("data-lastSearchTime",(new Date).getTime()); if(27===a.which)this.value="";else if("number"===typeof f.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===f.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===f.filter_liveSearch))return;c.filter.searching(b,"change"!==a.type,!0)}).bind("keypress."+d.namespace+"filter",function(a){13===a.which&&(a.preventDefault(),k(this).blur())});d.$table.bind("filterReset",function(){a.val("")})}},checkFilters:function(b, a,e){var d=b.config,f=d.widgetOptions,g=k.isArray(a),h=g?a:c.getFilters(b,!0),l=(h||[]).join("");if(!k.isEmptyObject(d.cache)&&(g&&c.setFilters(b,h,!1,!0!==e),f.filter_hideFilters&&d.$table.find("."+c.css.filterRow).trigger(""===l?"mouseleave":"mouseenter"),d.lastCombinedFilter!==l||!1===a))if(!1===a&&(d.lastCombinedFilter=null,d.lastSearch=[]),d.$table.trigger("filterStart",[h]),d.showProcessing)setTimeout(function(){c.filter.findRows(b,h,l);return!1},30);else return c.filter.findRows(b,h,l),!1}, hideFilters:function(b,a){var e,d,f;k(b).find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){e=k(this);clearTimeout(f);f=setTimeout(function(){/enter|over/.test(b.type)?e.removeClass("hideme"):k(document.activeElement).closest("tr")[0]!==e[0]&&""===a.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(b){d=k(this).closest("tr");clearTimeout(f);f=setTimeout(function(){if(""===c.getFilters(a.$table).join(""))d["focus"=== b.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var d,f,g,h,l,n,p,m,s,r,t,x,v,w,z,y,A,B,L,C,G,H,I,J,M,D,E=c.filter.regex,q=b.config,u=q.widgetOptions,N=q.columns,K=q.$table.children("tbody"),O=["range","notMatch","operators"],F=q.$headers.map(function(a){return q.parsers&&q.parsers[a]&&q.parsers[a].parsed||c.getData&&"parsed"===c.getData(q.$headers.filter('[data-column="'+a+'"]:last'),c.getColumnData(b,q.headers,a),"filter")||k(this).hasClass("filter-parsed")}).get(); q.debug&&(L=new Date);for(l=0;l=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s))&&!(""!==s&&q.$filters&&q.$filters.eq(r).find("select").length&&!q.$headers.filter('[data-column="'+r+'"]:last').hasClass("filter-match"));p=g.not("."+u.filter_filteredRow).length;y&&0===p&&(y=!1);q.debug&&c.log("Searching through "+(y&&pk.inArray(a,O)&&(w=d(C,G,I,J,M,N,b,u,F,H),null!==w))return A=w,!1}),B=null!==A?A:0<=(J+r).indexOf(G));for(m=0;m'+(h.data("placeholder")||h.attr("data-placeholder")||g.filter_placeholder.select||"")+"",l=c.filter.getOptionSource(b,a,d),n=f.$table.find("thead").find("select."+c.css.filter+'[data-column="'+a+'"]').val();for(b=0;b"+l[b]+"":"";f=(f.$filters?f.$filters:f.$table.children("thead")).find("."+c.css.filter);g.filter_$externalFilters&&(f=f&&f.length?f.add(g.filter_$externalFilters):g.filter_$externalFilters);f.filter('select[data-column="'+a+'"]')[e?"html":"append"](h);g.filter_functions||(g.filter_functions={});g.filter_functions[a]=!0}},buildDefault:function(b,a){var e,d,f=b.config,g=f.widgetOptions,h=f.columns;for(e=0;eb.top&&cMath.abs(n.parent().width()-n.width()), t=function(){c.storage&&m&&s&&(l={},l[m.index()]=m.width(),l[s.index()]=s.width(),m.width(l[m.index()]),s.width(l[s.index()]),!1!==e.resizable&&c.storage(b,"tablesorter-resizable",a.$headers.map(function(){return k(this).width()}).get()));p=0;m=s=null;k(window).trigger("resize")};if(l=c.storage&&!1!==e.resizable?c.storage(b,"tablesorter-resizable"):{})for(h in l)!isNaN(h)&&h');e.resizable_addLastColumn||(g=g.slice(0,-1));f=f?f.add(g):g});f.each(function(){var a=k(this),b=parseInt(a.css("padding-right"), 10)+10;a.find("."+c.css.wrapper).append('
')}).bind("mousemove.tsresize",function(a){if(0!==p&&m){var b=a.pageX-p,c=m.width();m.width(c+b);m.width()!==c&&r&&s.width(s.width()-b);p=a.pageX}}).bind("mouseup.tsresize",function(){t()}).find("."+c.css.resizer+",."+c.css.grip).bind("mousedown",function(b){m=k(b.target).closest("th");var c=a.$headers.filter('[data-column="'+ m.attr("data-column")+'"]');1