From d81d64f4182104fa3f704391c7808207afc8a4bd Mon Sep 17 00:00:00 2001 From: Mottie Date: Mon, 2 Dec 2013 13:26:31 -0600 Subject: [PATCH] version bump & cleanup --- README.md | 29 ++++++++++++++++++ addons/pager/jquery.tablesorter.pager.js | 4 +-- addons/pager/jquery.tablesorter.pager.min.js | 4 +-- component.json | 2 +- js/jquery.tablesorter.js | 4 +-- js/jquery.tablesorter.min.js | 4 +-- js/jquery.tablesorter.widgets.js | 7 ++--- js/jquery.tablesorter.widgets.min.js | 31 ++++++++++---------- js/widgets/widget-pager.js | 4 +-- package.json | 2 +- tablesorter.jquery.json | 2 +- 11 files changed, 60 insertions(+), 33 deletions(-) diff --git a/README.md b/README.md index 3cc29f7e..3e27ca2b 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,35 @@ 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.14.3 (12/2/2013) + +* Core + * Refreshing widgets now only applies to previously installed widgets. Fixes [issue #442](https://github.com/Mottie/tablesorter/issues/442). +* Pager + * Ajax arrays now accept html instead of cell contents, e.g. `- 10`. Thanks [@christhomas](https://github.com/christhomas); fixes [issue #434](https://github.com/Mottie/tablesorter/pull/434). + * Add ajax counter to only allow the most recent request to process. Thanks [@christhomas](https://github.com/christhomas); fixes [issue #443](https://github.com/Mottie/tablesorter/pull/443). + * When filtering rows, the output will now show zeros for row & page counts instead of empty strings. + * No more `fixedHeight` pager errors. Thanks [@hempel](https://github.com/hempel); fixes [issue #448](https://github.com/Mottie/tablesorter/issues/448). +* Filter widget + * Exact filter matches now properly override other queries. Fixes [issue #441](https://github.com/Mottie/tablesorter/issues/441). + * Reverse range `20 - 10` work properly, again. See [issue #441](https://github.com/Mottie/tablesorter/issues/441). + * Updated docs to show the filter precendence. See [footnote (2) under Notes](http://mottie.github.io/tablesorter/docs/example-widget-filter.html). +* Sticky Headers widget + * Now uses the filter widget `bindSearch` function allowing live search, delayed searching and escape to cancel on sticky header filters. + * Thanks to [@haraldkrischner](https://github.com/haraldkrischner) for his help! + * Fixes issues [#439](https://github.com/Mottie/tablesorter/issues/439) & [#440](https://github.com/Mottie/tablesorter/pull/440). +* CSS Sticky Headers widget (beta) + * Now works properly in IE9+. + * Thanks [@gakreol](https://github.com/gakreol) + * Fixes [issue #447](https://github.com/Mottie/tablesorter/issues/447). +* Added Semantic version sorting demo + * See the [demo here](http://mottie.github.io/tablesorter/docs/example-option-textsorter-semver.html). + * This demo does not use a custom parser nor widget, it requires a modified [`semver.js` for node](https://github.com/isaacs/node-semver) file to sort the column using the `textSorter` option. + * The modified `semver-mod.js` file is contained within the new "extras" folder (tablesorter/js/extras) along with the original unmodified `semver.js` file. + * Extra code is also included to highlight invalid semantic versions within the table. + * Fixes [issue #395](https://github.com/Mottie/tablesorter/issues/395). +* Sorry I didn't get around to finding solutions for some of the other issues that I promised to have done this patch :( + #### Version 2.14.2 (11/25/2013) * Removed Bootstrap filter cell background color. Fixes [issue #425](https://github.com/Mottie/tablesorter/issues/425). diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index f225ef9c..1f2ef4bb 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 11/22/2013 (v2.14.1) + * updated 12/2/2013 (v2.14.3) */ /*jshint browser:true, jquery:true, unused:false */ ;(function($) { @@ -284,7 +284,7 @@ tds += ''; for ( j = 0; j < d[i].length; j++ ) { // build tbody cells; watch for data containing HTML markup - see #434 - tds += /^\s*\' + d[i][j] + ''; + tds += /^\s*' + d[i][j] + ''; } tds += ''; } diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index bc2a09f2..4a5b4475 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,2 +1,2 @@ -/*! tablesorter pager plugin minified - updated 11/22/2013 (v2.14.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"},ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,savePages:!0,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,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var v=this,w=function(b,a){var c=b.cssDisabled,e=!!a,f=Math.min(b.totalPages,b.filteredPages);b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[e||0===b.page?"addClass":"removeClass"](c),b.$container.find(b.cssNext+","+b.cssLast)[e||b.page===f-1?"addClass":"removeClass"](c))},r=function(b,a,c){var e,f,g,d=b.config;e= d.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=(d.widgetOptions&&d.widgetOptions.filter_filteredRow||"filtered")+","+d.selectorRemove;f=a.size||10;a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=e?d.$tbodies.eq(0).children("tr:not(."+g+")").length:a.totalRows;a.filteredPages=e?Math.ceil(a.filteredRows/f)||1:a.totalPages;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(b,d){return a.page+(d?parseInt(d,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var d=b.split(":"),c=a.ajaxData;return 1"+e+"";a.$goto.html(g).val(a.page+1)}w(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=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'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b,"pagerSavedHeight",c.height());t(b,a);h.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,e=b.config,f=e.$tbodies.eq(0).children(),g=f.length,d=a.page*a.size,h=d+a.size,k=e.widgetOptions&&e.widgetOptions.filter_filteredRow||"filtered",n=0;for(c=0;c=d&& n'+(0===e.status?"Not connected, verify Network":404===e.status?"Requested page not found [404]":500===e.status?"Internal Server Error [500]":"parsererror"===f?"Requested JSON parse failed":"timeout"===f?"Time out error":"abort"===f?"Ajax Request aborted":"Uncaught error: "+e.statusText+" ["+e.status+"]")+"").click(function(){h(this).remove()}).appendTo(l.find("thead:first")),p.$tbodies.eq(0).empty(); else{h.isArray(g)?(e=isNaN(g[0])&&!isNaN(g[1]),f=g[e?1:0],c.totalRows=isNaN(f)?c.totalRows||0:f,e=g[e?0:1]||[],n=g[2]):(c.ajaxData=g,c.totalRows=g.total,n=g.headers,e=g.rows);x=e.length;if(e instanceof jQuery)p.$tbodies.eq(0).empty().append(e);else if(x){for(g=0;g";for(f=0;f"+e[g][f]+"";q+=""}p.$tbodies.eq(0).html(q)}n&&n.length===b&&(m=(d=l.hasClass("hasStickyHeaders"))?p.$sticky.children("thead:first").children().children():"",s=l.find("tfoot tr:first").children(), p.$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),d&&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]),d&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));s.eq(a).html(n[a])}))}p.showProcessing&&k.isProcessing(a);c.last.totalPages=c.totalPages= Math.ceil(c.totalRows/(c.size||10));c.last.currentFilters=c.currentFilters;c.last.sortList=(p.sortList||[]).join(",");r(a,c);t(a,c);l.trigger("applyWidgets");c.initialized?(l.trigger("pagerChange",c),l.trigger("updateComplete")):l.trigger("update")}c.initialized||(c.initialized=!0,h(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),e=h(document),f=b.config;""!==c&&(f.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager",function(c,d,f,h){C(null,b,a,d,h);e.unbind("ajaxError.pager")}), a.ajaxObject.url=c,a.ajaxObject.success=function(c){C(c,b,a);e.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},f.debug&&k.log("ajax initialized",a.ajaxObject),h.ajax(a.ajaxObject))},G=function(b,a){var c=b.config,e=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(b,c){return a.page+(c?parseInt(c,10):0)}).replace(/\{size\}/g,a.size):"",f=c.sortList,g=a.currentFilters||h(b).data("lastSearch")||[],d=e.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),l=e.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/), m=[];d&&(d=d[1],h.each(f,function(a,b){m.push(d+"["+b[0]+"]="+b[1])}),e=e.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):d),m=[]);l&&(l=l[1],h.each(g,function(a,b){b&&m.push(l+"["+a+"]="+encodeURIComponent(b))}),e=e.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),a.currentFilters=g);"function"===typeof a.customAjaxUrl&&(e=a.customAjaxUrl(b,e));c.debug&&k.log("Pager ajax url: "+e);return e},y=function(b,a,c){var e,f;e=c.page*c.size;var g=e+c.size;if(!(1> (a&&a.length||0))){c.page>=c.totalPages&&D(b,c);c.isDisabled=!1;c.initialized&&h(b).trigger("pagerChange",c);if(c.removeRows){g>a.length&&(g=a.length);k.clearTableBody(b);for(f=k.processTbody(b,b.config.$tbodies.eq(0),!0);ea.page&&(a.page=0);a.page>g-1&&0!==g&&(a.page=g-1);if(f.page!==a.page||f.size!==a.size||f.totalPages!==a.totalPages||(f.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||f.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(","),totalPages:a.totalPages,currentFilters:a.currentFilters||[]},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(e.$table.trigger("pageMoved",a),e.$table.trigger("applyWidgets"))}},z=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);l(b,c)},I=function(b,a){a.page= 0;l(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;l(b,a)},J=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);l(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);l(b,a)},F=function(b,a,c){var e=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=h.data(b,"pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")|| parseInt(e.find("option[selected]").val(),10)||a.size||10;e.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/a.size);c&&(h(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a),b.config.debug&&k.log("pager enabled"))};v.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),y(b,a,e))};v.construct=function(b){return this.each(function(){if(this.config&& this.hasInitialized){var a,c,e,f=this,g=f.config,d=g.pager=h.extend({},h.tablesorterPager.defaults,b),s=g.$table,m=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;g.appender=v.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, "tablesorter-pager")||{},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));s.unbind("filterStart filterEnd sortEnd disable enable destroy update pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(){d.initialized&&(l(f,d,!1),r(f,d,!1),t(f,d))}).bind("disable.pager",function(a){a.stopPropagation();E(f,d)}).bind("enable.pager",function(a){a.stopPropagation(); F(f,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();z(f,parseInt(b,10)||10,d);u(f,d);r(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);l(f,d);r(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[I,K,J,D];m.find(c.join(",")).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;aa.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(b,d){return a.page+(d?parseInt(d,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var d=b.split(":"),c=a.ajaxData,e=/(rows?|pages?)$/i.test(b)?0:"";return 1"+e+"";a.$goto.html(g).val(a.page+1)}w(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=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'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b,"pagerSavedHeight",c.height());t(b,a);h.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,e=b.config,f=e.$tbodies.eq(0).children(),g=f.length,d=a.page*a.size,h=d+a.size,k=e.widgetOptions&&e.widgetOptions.filter_filteredRow||"filtered",n=0;for(c=0;c=d&&n'+(0===e.status?"Not connected, verify Network":404===e.status?"Requested page not found [404]":500===e.status?"Internal Server Error [500]":"parsererror"===f?"Requested JSON parse failed":"timeout"===f?"Time out error":"abort"===f?"Ajax Request aborted":"Uncaught error: "+e.statusText+" ["+e.status+"]")+"").click(function(){h(this).remove()}).appendTo(l.find("thead:first")), p.$tbodies.eq(0).empty();else{h.isArray(g)?(e=isNaN(g[0])&&!isNaN(g[1]),f=g[e?1:0],c.totalRows=isNaN(f)?c.totalRows||0:f,e=g[e?0:1]||[],n=g[2]):(c.ajaxData=g,c.totalRows=g.total,n=g.headers,e=g.rows);x=e.length;if(e instanceof jQuery)p.$tbodies.eq(0).empty().append(e);else if(x){for(g=0;g";for(f=0;f"+e[g][f]+"";q+=""}p.$tbodies.eq(0).html(q)}n&&n.length===b&&(m=(d=l.hasClass("hasStickyHeaders"))?p.$sticky.children("thead:first").children().children(): "",s=l.find("tfoot tr:first").children(),p.$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),d&&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]),d&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));s.eq(a).html(n[a])}))}p.showProcessing&&k.isProcessing(a); c.last.totalPages=c.totalPages=Math.ceil(c.totalRows/(c.size||10));c.last.currentFilters=c.currentFilters;c.last.sortList=(p.sortList||[]).join(",");r(a,c);t(a,c);l.trigger("applyWidgets");c.initialized?(l.trigger("pagerChange",c),l.trigger("updateComplete")):l.trigger("update")}c.initialized||(c.initialized=!0,h(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),e=h(document),f,g=b.config;""!==c&&(g.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager",function(d,c,f,g){C(null, b,a,c,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&&D(b,c);c.isDisabled=!1;c.initialized&&h(b).trigger("pagerChange",c);if(c.removeRows){g>a.length&&(g=a.length);k.clearTableBody(b);for(f=k.processTbody(b,b.config.$tbodies.eq(0),!0);ea.page&&(a.page=0);a.page>g-1&&0!==g&&(a.page=g-1);if(f.page!==a.page||f.size!==a.size|| f.totalPages!==a.totalPages||(f.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||f.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(","),totalPages:a.totalPages,currentFilters:a.currentFilters||[]},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(e.$table.trigger("pageMoved",a),e.$table.trigger("applyWidgets"))}},z=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);l(b,c)},I=function(b,a){a.page=0;l(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;l(b,a)},J=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);l(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);l(b,a)},F=function(b,a,c){var e=a.$size.removeClass(a.cssDisabled).removeAttr("disabled"); a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=h.data(b,"pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")||parseInt(e.find("option[selected]").val(),10)||a.size||10;e.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/a.size);c&&(h(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a),b.config.debug&&k.log("pager enabled"))};v.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),y(b,a,e))};v.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,e,f=this,g=f.config,d=g.pager=h.extend({},h.tablesorterPager.defaults,b),s=g.$table,m=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;g.appender=v.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,"tablesorter-pager")||{},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));s.unbind("filterStart filterEnd sortEnd disable enable destroy update pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager", function(){d.initialized&&(l(f,d,!1),r(f,d,!1),t(f,d))}).bind("disable.pager",function(a){a.stopPropagation();E(f,d)}).bind("enable.pager",function(a){a.stopPropagation();F(f,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(f,d)}).bind("pageSize.pager", function(a,b){a.stopPropagation();z(f,parseInt(b,10)||10,d);u(f,d);r(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);l(f,d);r(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[I,K,J,D];m.find(c.join(",")).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=1.2.6" } diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index e26a367b..899630c7 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /**! -* TableSorter 2.14.2 - Client-side table sorting with ease! +* TableSorter 2.14.3 - 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.14.2"; + ts.version = "2.14.3"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 59a54c7e..22453d21 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.14.2 min - Client-side table sorting with ease! +* TableSorter 2.14.3 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(g){g.extend({tablesorter:new function(){function c(){var a=1':"";m.$headers=g(a).find(m.selectorHeaders).each(function(a){h= g(this);d=m.headers[a];m.headerContent[a]=g(this).html();l=m.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,n);m.onRenderTemplate&&(e=m.onRenderTemplate.apply(h,[a,l]))&&"string"===typeof e&&(l=e);g(this).html('
'+l+"
");m.onRenderHeader&&m.onRenderHeader.apply(h,[a]);this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=B(f.getData(h,d,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder= !1;v=f.getData(h,d,"lockedOrder")||!1;"undefined"!==typeof v&&!1!==v&&(this.order=this.lockedOrder=B(v)?[1,1,1]:[0,0,0]);h.addClass(f.css.header+" "+m.cssHeader);m.headerList[a]=this;h.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow);m.tabIndex&&h.attr("tabindex",0)});I(a);m.debug&&(q("Built headers:",k),c(m.$headers))}function C(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();s(a);w(a);F(h.$table,b,d)}function I(a){var b,d=a.config;d.$headers.each(function(a,e){b="false"===f.getData(e, d.headers[a],"sorter");e.sortDisabled=b;g(e)[b?"addClass":"removeClass"]("sorter-false")})}function G(a){var b,d,h,e=a.config,n=e.sortList,c=[f.css.sortAsc+" "+e.cssAsc,f.css.sortDesc+" "+e.cssDesc],v=g(a).find("tfoot tr").children().removeClass(c.join(" "));e.$headers.removeClass(c.join(" "));h=n.length;for(b=0;b"),d=g(a).width();g(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(g("").css("width",parseInt(g(this).width()/d*1E3,10)/10+"%"))});g(a).prepend(b)}}function M(a,b){var d,h,e,n=a.config,c=b||n.sortList;n.sortList=[];g.each(c,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(e=n.$headers[d[0]])n.sortList.push(d), h=g.inArray(d[1],e.order),e.count=0<=h?h:d[1]%(n.sortReset?3:2)})}function N(a,b){return a&&a[b]?a[b].type||"":""}function O(a,b,d){var h,e,n,c=a.config,v=!d[c.sortMultiSortKey],k=g(a);k.trigger("sortStart",a);b.count=d[c.sortResetKey]?2:(b.count+1)%(c.sortReset?3:2);c.sortRestart&&(e=b,c.$headers.each(function(){this===e||!v&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=b.column;if(v){c.sortList=[];if(null!==c.sortForce)for(h=c.sortForce,d=0;dh&&(c.sortList.push([e,h]),1h&&(c.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",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc"};f.log=c;f.benchmark=q;f.construct=function(a){return this.each(function(){var b=g.extend(!0,{},f.defaults,a);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName&&f.buildTable(this,b);f.setup(this, b)})};f.setup=function(a,b){if(!a||!a.tHead||0===a.tBodies.length||!0===a.hasInitialized)return b.debug?c("stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var d="",h=g(a),e=g.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;g.data(a,"tablesorter",b);b.debug&&g.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===g("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),d=g.fn.detach? b.detach():b.remove();d=g(a).find("span.tablesorter-savemyplace");b.insertAfter(d);d.remove();a.isProcessing=!1};f.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};f.restoreHeaders=function(a){var b=a.config;b.$table.find(b.selectorHeaders).each(function(a){g(this).find(".tablesorter-header-inner").length&&g(this).html(b.headerContent[a])})};f.destroy=function(a,b,d){a=g(a)[0];if(a.hasInitialized){f.refreshWidgets(a,!0,!0);var c=g(a),e=a.config,n=c.find("thead:first"),l=n.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+ " "+e.cssHeaderRow),k=c.find("tfoot:first > tr").children("th, td");n.find("tr").not(l).remove();c.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(".tablesorter "));e.$headers.add(k).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc].join(" ")).removeAttr("data-column");l.find(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter"); f.restoreHeaders(a);!1!==b&&c.removeClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme);a.hasInitialized=!1;"function"===typeof d&&d(a)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(a,b){if(a===b)return 0;var d,c,e,g,l,k;c=f.regex;if(c.hex.test(b)){d=parseInt(a.match(c.hex),16);e=parseInt(b.match(c.hex),16);if(de)return 1}d=a.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/, "").split("\\0");c=b.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");k=Math.max(d.length,c.length);for(l=0;lg)return 1}return 0};f.sortNaturalAsc=function(a,b,d,c,e){if(a===b)return 0;d=e.string[e.empties[d]||e.emptyTo];return""===a&&0!==d?"boolean"===typeof d?d?-1:1:-d||-1:""=== b&&0!==d?"boolean"===typeof d?d?1:-1:d||1:f.sortNatural(a,b)};f.sortNaturalDesc=function(a,b,d,c,e){if(a===b)return 0;d=e.string[e.empties[d]||e.emptyTo];return""===a&&0!==d?"boolean"===typeof d?d?-1:1:d||1:""===b&&0!==d?"boolean"===typeof d?d?1:-1:-d||-1:f.sortNatural(b,a)};f.sortText=function(a,b){return a>b?1:ag.inArray(l[h].id,k))&&(e.debug&&c("Refeshing widgets: Removing "+l[h].id),l[h].hasOwnProperty("remove")&&(l[h].remove(a,e,e.widgetOptions), e.widgetInit[l[h].id]=!1));!0!==d&&f.applyWidget(a,b)};f.getData=function(a,b,d){var c="";a=g(a);var e,f;if(!a.length)return"";e=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(d)||"undefined"!==typeof a.data(d.toLowerCase())?c+=a.data(d)||a.data(d.toLowerCase()):e&&"undefined"!==typeof e[d]?c+=e[d]:b&&"undefined"!==typeof b[d]?c+=b[d]:" "!==f&&f.match(" "+d+"-")&&(c=f.match(RegExp("\\s"+d+"-([\\w-]+)"))[1]||"");return g.trim(c)};f.formatFloat=function(a,b){if("string"!== typeof a||""===a)return a;var c;a=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?a.replace(/,/g,""):a.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(a)&&(a=a.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(a);return isNaN(c)?g.trim(a):c};f.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.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(c, q){var k=q.config;c&&(c=g.trim(k.ignoreCase?c.toLocaleLowerCase():c),c=k.sortLocaleCompare?p.replaceAccents(c):c);return c},type:"text"});p.addParser({id:"digit",is:function(c){return p.isDigit(c)},format:function(c,q){var k=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),q);return c&&"number"===typeof k?k:c?g.trim(c&&q.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});p.addParser({id:"currency",is:function(c){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((c|| "").replace(/[,. ]/g,""))},format:function(c,q){var k=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),q);return c&&"number"===typeof k?k:c?g.trim(c&&q.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});p.addParser({id:"ipAddress",is:function(c){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(c)},format:function(c,g){var k,t=c?c.split("."):"",s="",w=t.length;for(k=0;kc.length},format:function(c,g){return c?p.formatFloat(c.replace(/%/g,""),g):c},type:"numeric"});p.addParser({id:"usLongDate", is:function(c){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(c)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(c)},format:function(c,g){return c?p.formatFloat((new Date(c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"shortDate",is:function(c){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((c||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(c,g,k,t){if(c){k=g.config; var s=k.headerList[t];t=s.dateFormat||p.getData(s,k.headers[t],"dateFormat")||k.dateFormat;c=c.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===t?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===t?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===t&&(c=c.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return c?p.formatFloat((new Date(c)).getTime()||"",g):c},type:"numeric"});p.addParser({id:"time",is:function(c){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(c)}, format:function(c,g){return c?p.formatFloat((new Date("2000/01/01 "+c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"metadata",is:function(){return!1},format:function(c,p,k){c=p.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return g(k).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c,q,k){var t,s,w,z,D,B,E=RegExp(q.cssChildRow,"i"),C=q.$tbodies;q.debug&&(D=new Date);for(c=0;c':"";m.$headers=g(a).find(m.selectorHeaders).each(function(a){h= g(this);d=m.headers[a];m.headerContent[a]=g(this).html();l=m.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,n);m.onRenderTemplate&&(e=m.onRenderTemplate.apply(h,[a,l]))&&"string"===typeof e&&(l=e);g(this).html('
'+l+"
");m.onRenderHeader&&m.onRenderHeader.apply(h,[a]);this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=B(f.getData(h,d,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder= !1;w=f.getData(h,d,"lockedOrder")||!1;"undefined"!==typeof w&&!1!==w&&(this.order=this.lockedOrder=B(w)?[1,1,1]:[0,0,0]);h.addClass(f.css.header+" "+m.cssHeader);m.headerList[a]=this;h.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow);m.tabIndex&&h.attr("tabindex",0)});I(a);m.debug&&(q("Built headers:",k),c(m.$headers))}function C(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();s(a);v(a);F(h.$table,b,d)}function I(a){var b,d=a.config;d.$headers.each(function(a,e){b="false"===f.getData(e, d.headers[a],"sorter");e.sortDisabled=b;g(e)[b?"addClass":"removeClass"]("sorter-false")})}function G(a){var b,d,h,e=a.config,n=e.sortList,l=[f.css.sortAsc+" "+e.cssAsc,f.css.sortDesc+" "+e.cssDesc],c=g(a).find("tfoot tr").children().removeClass(l.join(" "));e.$headers.removeClass(l.join(" "));h=n.length;for(b=0;b"),d=g(a).width();g(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(g("").css("width",parseInt(g(this).width()/d*1E3,10)/10+"%"))});g(a).prepend(b)}}function M(a,b){var d,h,e,n=a.config,c=b||n.sortList;n.sortList=[];g.each(c,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(e=n.$headers[d[0]])n.sortList.push(d), h=g.inArray(d[1],e.order),e.count=0<=h?h:d[1]%(n.sortReset?3:2)})}function N(a,b){return a&&a[b]?a[b].type||"":""}function O(a,b,d){var h,e,n,c=a.config,w=!d[c.sortMultiSortKey],k=g(a);k.trigger("sortStart",a);b.count=d[c.sortResetKey]?2:(b.count+1)%(c.sortReset?3:2);c.sortRestart&&(e=b,c.$headers.each(function(){this===e||!w&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=b.column;if(w){c.sortList=[];if(null!==c.sortForce)for(h=c.sortForce,d=0;dh&&(c.sortList.push([e,h]),1h&&(c.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",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc"};f.log=c;f.benchmark=q;f.construct=function(a){return this.each(function(){var b=g.extend(!0,{},f.defaults,a);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName&&f.buildTable(this,b);f.setup(this, b)})};f.setup=function(a,b){if(!a||!a.tHead||0===a.tBodies.length||!0===a.hasInitialized)return b.debug?c("stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var d="",h=g(a),e=g.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;g.data(a,"tablesorter",b);b.debug&&g.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===g("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),d=g.fn.detach? b.detach():b.remove();d=g(a).find("span.tablesorter-savemyplace");b.insertAfter(d);d.remove();a.isProcessing=!1};f.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};f.restoreHeaders=function(a){var b=a.config;b.$table.find(b.selectorHeaders).each(function(a){g(this).find(".tablesorter-header-inner").length&&g(this).html(b.headerContent[a])})};f.destroy=function(a,b,d){a=g(a)[0];if(a.hasInitialized){f.refreshWidgets(a,!0,!0);var c=g(a),e=a.config,n=c.find("thead:first"),l=n.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+ " "+e.cssHeaderRow),k=c.find("tfoot:first > tr").children("th, td");n.find("tr").not(l).remove();c.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(".tablesorter "));e.$headers.add(k).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc].join(" ")).removeAttr("data-column");l.find(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter"); f.restoreHeaders(a);!1!==b&&c.removeClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme);a.hasInitialized=!1;"function"===typeof d&&d(a)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(a,b){if(a===b)return 0;var d,c,e,g,l,k;c=f.regex;if(c.hex.test(b)){d=parseInt(a.match(c.hex),16);e=parseInt(b.match(c.hex),16);if(de)return 1}d=a.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/, "").split("\\0");c=b.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");k=Math.max(d.length,c.length);for(l=0;lg)return 1}return 0};f.sortNaturalAsc=function(a,b,d,c,e){if(a===b)return 0;d=e.string[e.empties[d]||e.emptyTo];return""===a&&0!==d?"boolean"===typeof d?d?-1:1:-d||-1:""=== b&&0!==d?"boolean"===typeof d?d?1:-1:d||1:f.sortNatural(a,b)};f.sortNaturalDesc=function(a,b,d,c,e){if(a===b)return 0;d=e.string[e.empties[d]||e.emptyTo];return""===a&&0!==d?"boolean"===typeof d?d?-1:1:d||1:""===b&&0!==d?"boolean"===typeof d?d?1:-1:-d||-1:f.sortNatural(b,a)};f.sortText=function(a,b){return a>b?1:ag.inArray(l[h].id,k))&&(e.debug&&c("Refeshing widgets: Removing "+l[h].id),l[h].hasOwnProperty("remove")&&e.widgetInit[l[h].id]&&(l[h].remove(a, e,e.widgetOptions),e.widgetInit[l[h].id]=!1));!0!==d&&f.applyWidget(a,b)};f.getData=function(a,b,d){var c="";a=g(a);var e,f;if(!a.length)return"";e=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(d)||"undefined"!==typeof a.data(d.toLowerCase())?c+=a.data(d)||a.data(d.toLowerCase()):e&&"undefined"!==typeof e[d]?c+=e[d]:b&&"undefined"!==typeof b[d]?c+=b[d]:" "!==f&&f.match(" "+d+"-")&&(c=f.match(RegExp("\\s"+d+"-([\\w-]+)"))[1]||"");return g.trim(c)};f.formatFloat= function(a,b){if("string"!==typeof a||""===a)return a;var c;a=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?a.replace(/,/g,""):a.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(a)&&(a=a.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(a);return isNaN(c)?g.trim(a):c};f.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.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(c,q){var k=q.config;c&&(c=g.trim(k.ignoreCase?c.toLocaleLowerCase():c),c=k.sortLocaleCompare?p.replaceAccents(c):c);return c},type:"text"});p.addParser({id:"digit",is:function(c){return p.isDigit(c)},format:function(c,q){var k=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),q);return c&&"number"===typeof k?k:c?g.trim(c&&q.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});p.addParser({id:"currency",is:function(c){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((c|| "").replace(/[,. ]/g,""))},format:function(c,q){var k=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),q);return c&&"number"===typeof k?k:c?g.trim(c&&q.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});p.addParser({id:"ipAddress",is:function(c){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(c)},format:function(c,g){var k,t=c?c.split("."):"",s="",v=t.length;for(k=0;kc.length},format:function(c,g){return c?p.formatFloat(c.replace(/%/g,""),g):c},type:"numeric"});p.addParser({id:"usLongDate", is:function(c){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(c)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(c)},format:function(c,g){return c?p.formatFloat((new Date(c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"shortDate",is:function(c){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((c||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(c,g,k,t){if(c){k=g.config; var s=k.headerList[t];t=s.dateFormat||p.getData(s,k.headers[t],"dateFormat")||k.dateFormat;c=c.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===t?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===t?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===t&&(c=c.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return c?p.formatFloat((new Date(c)).getTime()||"",g):c},type:"numeric"});p.addParser({id:"time",is:function(c){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(c)}, format:function(c,g){return c?p.formatFloat((new Date("2000/01/01 "+c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"metadata",is:function(){return!1},format:function(c,p,k){c=p.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return g(k).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c,q,k){var t,s,v,z,D,B,E=RegExp(q.cssChildRow,"i"),C=q.$tbodies;q.debug&&(D=new Date);for(c=0;c'),a.cssIcon&&m.find("."+f.css.icon).addClass(n.icons),q.hasClass("hasFilters")&& m.find(".tablesorter-filter-row").addClass(n.filterRow));k.each(m,function(){g=k(this);h=f.css.icon?g.find("."+f.css.icon):g;this.sortDisabled?(g.removeClass(u),h.removeClass(u+" tablesorter-icon "+n.icons)):(d=g.hasClass(f.css.sortAsc)?n.sortAsc:g.hasClass(f.css.sortDesc)?n.sortDesc:g.hasClass(f.css.header)?n.sortNone:"",g[d===n.sortNone?"removeClass":"addClass"](n.active),h.removeClass(u).addClass(d))});a.debug&&f.benchmark("Applying "+l+" theme",e)},remove:function(b,a,c){b=a.$table;a=a.theme|| "jui";c=f.themes[a]||f.themes.jui;var e=b.children("thead").children(),d=c.sortNone+" "+c.sortDesc+" "+c.sortAsc;b.removeClass("tablesorter-"+a+" "+c.table).find(f.css.header).removeClass(c.header);e.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(c.hover+" "+d+" "+c.active).find(".tablesorter-filter-row").removeClass(c.filterRow);e.find(".tablesorter-icon").removeClass(c.icons)}}); -f.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(b, a,c){var e,d,g,h,p,q,m,l,n=a.$table,u=a.$tbodies,r=a.sortList,w=r.length,v=c&&c.columns||["primary","secondary","tertiary"],y=v.length-1;m=v.join(" ");a.debug&&(e=new Date);for(g=0;g=]/g},types:{regex:function(b,a,c,e){if(f.filter.regex.regex.test(a)){var d;b=f.filter.regex.regex.exec(a);try{d=RegExp(b[1],b[2]).test(e)}catch(g){d=!1}return d}return null},exact:function(b,a,c,e){return a.replace(f.filter.regex.exact, "")==e?!0:null},notMatch:function(b,a,c,e,d,f,h,p){return/^\!/.test(a)?(a=a.replace("!",""),b=e.search(k.trim(a)),""===a?!0:!(p.filter_startsWith?0===b:0<=b)):null},operators:function(b,a,c,e,d,g,h,k,q){if(/^[<>]=?/.test(a)){var m,l;m=h.config;b=f.formatFloat(a.replace(f.filter.regex.operators,""),h);c=m.parsers[g];k=b;if(q[g]||"numeric"===c.type)m=c.format(""+a.replace(f.filter.regex.operators,""),h,m.$headers.eq(g),g),b="number"!==typeof b||""===m||isNaN(m)?b:m;m=!q[g]&&"numeric"!==c.type||isNaN(b)|| !d?isNaN(e)?f.formatFloat(e.replace(f.filter.regex.nondigit,""),h):f.formatFloat(e,h):d;/>/.test(a)&&(l=/>=/.test(a)?m>=b:m>b);/m&&(a=k,k=m,m=a);return a>=k&&a<=m||""===k|| ""===m}return null},wild:function(b,a,c,e,d,f,h){return/[\?|\*]/.test(a)||/\s+OR\s+/.test(b)?(b=h.config,a=a.replace(/\s+OR\s+/gi,"|"),!b.$headers.filter('[data-column="'+f+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a="^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(e)):null},fuzzy:function(b,a,c,e){if(/^~/.test(a)){b=0;c=e.length;var d=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||"")+"":"",e+='");a.$table.find("thead").find('select.tablesorter-filter[data-column="'+h+'"]').append(e)}f.filter.buildDefault(b, !0);a.$table.find("select.tablesorter-filter").bind("change search",function(a,c){f.filter.checkFilters(b,c)});c.filter_hideFilters&&f.filter.hideFilters(b,a,c);a.showProcessing&&a.$table.bind("filterStart.tsfilter filterEnd.tsfilter",function(c,d){g=d?a.$table.find("."+f.css.header).filter("[data-column]").filter(function(){return""!==d[k(this).data("column")]}):"";f.isProcessing(b,"filterStart"===c.type,d?g:"")});a.debug&&f.benchmark("Applying Filter widget",q);a.$table.bind("tablesorter-initialized pagerInitialized", function(){p=f.filter.setDefaults(b,a,c)||[];p.length&&f.setFilters(b,p,!0);f.filter.checkFilters(b,p)});c.filter_Initialized=!0;a.$table.trigger("filterInit")},setDefaults:function(b,a,c){var e,d=[],g=a.columns;c.filter_saveFilters&&f.storage&&(d=f.storage(b,"tablesorter-filters")||[],(e=k.isArray(d))&&""===d.join("")||!e)&&(d=[]);if(!d.length)for(e=0;e';for(b=0;b";a.$filters=k(d+"").appendTo(a.$table.find("thead").eq(0)).find("td");for(b=0;b").appendTo(a.$filters.eq(b)):(c.filter_formatter&&k.isFunction(c.filter_formatter[b])?((d=c.filter_formatter[b](a.$filters.eq(b),b))&&0===d.length&&(d=a.$filters.eq(b).children("input")),d&&(0===d.parent().length||d.parent().length&&d.parent()[0]!==a.$filters[b])&&a.$filters.eq(b).append(d)):d=k('').appendTo(a.$filters.eq(b)),d&&d.attr("placeholder",e.data("placeholder")||e.attr("data-placeholder")||"")),d&&(d.addClass("tablesorter-filter "+c.filter_cssFilter).attr("data-column", b),g&&(d.addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a){b=k(b)[0];var c,e=b.config.widgetOptions;a.unbind("keyup search filterReset").bind("keyup search",function(d,g){if(27===d.which)this.value="";else if("number"===typeof e.filter_liveSearch&&this.value.lengthd.which&&8!==d.which&&!0===e.filter_liveSearch&&13!==d.which||37<=d.which&&40>=d.which||13!==d.which&&!1===e.filter_liveSearch))return;k(this).hasClass("tablesorter-filter")? c=g:(c=[],a.each(function(){c[k(this).data("column")||0]=k(this).val()}));f.filter.searching(b,g,c)}).bind("filterReset",function(){a.val("")})},checkFilters:function(b,a){var c=b.config,e=c.widgetOptions,d=k.isArray(a),g=d?a:f.getFilters(b),h=(g||[]).join("");d&&f.setFilters(b,g);e.filter_hideFilters&&c.$table.find(".tablesorter-filter-row").trigger(""===h?"mouseleave":"mouseenter");if(c.lastCombinedFilter!==h||!1===a)if(c.$table.trigger("filterStart",[g]),c.showProcessing)setTimeout(function(){f.filter.findRows(b, g,h);return!1},30);else return f.filter.findRows(b,g,h),!1},hideFilters:function(b,a,c){var e,d,g;a.$table.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){e=k(this);clearTimeout(g);g=setTimeout(function(){/enter|over/.test(a.type)?e.removeClass("hideme"):k(document.activeElement).closest("tr")[0]!==e[0]&&""===f.getFilters(b).join("")&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(a){d=k(this).closest("tr");clearTimeout(g); g=setTimeout(function(){if(""===f.getFilters(b).join(""))d["focus"===a.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,c){if(b.config.lastCombinedFilter!==c){var e,d,g,h,p,q,m,l,n,u,r,w,v,y,A,x,B,C,z,E,t=b.config,s=t.widgetOptions,G=t.columns,D=t.$tbodies,H=["range","notMatch","operators"],F=t.$headers.map(function(a){return f.getData?"parsed"===f.getData(t.$headers.filter('[data-column="'+a+'"]:last'),t.headers[a],"filter"):k(this).hasClass("filter-parsed")}).get();t.debug&& (E=new Date);for(p=0;pk.inArray(c,H))if(A=d(a[l],v,r,w,e,l,b,s,F),null!==A)return C=A,!1}),null!==C?x=C:(r=(w+u).indexOf(v),x=!s.filter_startsWith&&0<=r||s.filter_startsWith&&0===r));if(s.filter_anyMatch){if(z=x)break}else z=x?z:!1}g[h].style.display=z?"":"none";g.eq(h)[z?"removeClass":"addClass"](s.filter_filteredRow);if(n.length){if(t.pager&&t.pager.countChildRows||s.pager_countChildRows)n[z?"removeClass":"addClass"](s.filter_filteredRow); n.toggle(z)}}f.processTbody(b,q,!1)}t.lastCombinedFilter=c;t.lastSearch=a;t.$table.data("lastSearch",a);s.filter_saveFilters&&f.storage&&f.storage(b,"tablesorter-filters",a);t.debug&&f.benchmark("Completed filter widget search",E);t.$table.trigger("applyWidgets");t.$table.trigger("filterEnd")}},buildSelect:function(b,a,c,e){a=parseInt(a,10);var d,g,h;b=b.config;var p=b.widgetOptions,q=b.$tbodies,m=[],l=b.$headers.filter('[data-column="'+a+'"]:last'),n='";for(g=0;g"+m[e]+"":"";b.$table.find("thead").find('select.tablesorter-filter[data-column="'+a+'"]')[c?"html":"append"](n)},buildDefault:function(b,a){var c,e,d=b.config,g=d.widgetOptions,h=d.columns;for(c=0;cb.top&&eb.which&&8!==b.which||37<=b.which&&40>=b.which)){y=!0;b=k(this);var d=b.attr("data-column"); a.$filters.find(".tablesorter-filter").eq(d).val(b.val()).trigger("search");setTimeout(function(){y=!1},c.filter_searchDelay)}});d.trigger("stickyHeadersInit")}},remove:function(b,a,c){a.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find(".tablesorter-stickyHeader").remove();c.$sticky&&c.$sticky.length&&c.$sticky.remove();k(".hasStickyHeaders").length||k(window).unbind("scroll.tsSticky resize.tsSticky");f.addHeaderResizeEvent(b,!1)}}); -f.addWidget({id:"resizable", priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(b,a,c){if(!a.$table.hasClass("hasResizable")){a.$table.addClass("hasResizable");var e,d,g,h,p={},q=a.$table,m=0,l=null,n=null,u=20>Math.abs(q.parent().width()-q.width()),r=function(){f.storage&&l&&(p[l.index()]=l.width(),p[n.index()]=n.width(),l.width(p[l.index()]),n.width(p[n.index()]),!1!==c.resizable&&f.storage(b,"tablesorter-resizable",p));m=0;l=n=null;k(window).trigger("resize")};if(p=f.storage&&!1!==c.resizable?f.storage(b, "tablesorter-resizable"):{})for(h in p)!isNaN(h)&&h'); c.resizable_addLastColumn||(g=g.slice(0,-1));d=d?d.add(g):g});d.each(function(){var a=k(this),b=parseInt(a.css("padding-right"),10)+10;a.find(".tablesorter-wrapper").append('
')}).bind("mousemove.tsresize",function(a){if(0!==m&&l){var b=a.pageX-m,c=l.width();l.width(c+b);l.width()!==c&&u&&n.width(n.width()-b);m=a.pageX}}).bind("mouseup.tsresize",function(){r()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown", function(b){l=k(b.target).closest("th");var c=a.$headers.filter('[data-column="'+l.attr("data-column")+'"]');1'),a.cssIcon&&n.find("."+e.css.icon).addClass(m.icons),q.hasClass("hasFilters")&& n.find(".tablesorter-filter-row").addClass(m.filterRow));k.each(n,function(){g=k(this);h=e.css.icon?g.find("."+e.css.icon):g;this.sortDisabled?(g.removeClass(u),h.removeClass(u+" tablesorter-icon "+m.icons)):(d=g.hasClass(e.css.sortAsc)?m.sortAsc:g.hasClass(e.css.sortDesc)?m.sortDesc:g.hasClass(e.css.header)?m.sortNone:"",g[d===m.sortNone?"removeClass":"addClass"](m.active),h.removeClass(u).addClass(d))});a.debug&&e.benchmark("Applying "+l+" theme",f)},remove:function(b,a,c){b=a.$table;a=a.theme|| "jui";c=e.themes[a]||e.themes.jui;var f=b.children("thead").children(),d=c.sortNone+" "+c.sortDesc+" "+c.sortAsc;b.removeClass("tablesorter-"+a+" "+c.table).find(e.css.header).removeClass(c.header);f.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(c.hover+" "+d+" "+c.active).find(".tablesorter-filter-row").removeClass(c.filterRow);f.find(".tablesorter-icon").removeClass(c.icons)}}); +e.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(b, a,c){var f,d,g,h,p,q,n,l,m=a.$table,u=a.$tbodies,r=a.sortList,w=r.length,v=c&&c.columns||["primary","secondary","tertiary"],y=v.length-1;n=v.join(" ");a.debug&&(f=new Date);for(g=0;g=]/g},types:{regex:function(b,a,c,f){if(e.filter.regex.regex.test(a)){var d;b=e.filter.regex.regex.exec(a);try{d=RegExp(b[1],b[2]).test(f)}catch(g){d=!1}return d}return null},exact:function(b,a,c,f){return e.filter.regex.exact.test(a)? a.replace(e.filter.regex.exact,"")==f:null},notMatch:function(b,a,c,f,d,e,h,p){return/^\!/.test(a)?(a=a.replace("!",""),b=f.search(k.trim(a)),""===a?!0:!(p.filter_startsWith?0===b:0<=b)):null},operators:function(b,a,c,f,d,g,h,k,q){if(/^[<>]=?/.test(a)){var n,l;n=h.config;b=e.formatFloat(a.replace(e.filter.regex.operators,""),h);c=n.parsers[g];k=b;if(q[g]||"numeric"===c.type)n=c.format(""+a.replace(e.filter.regex.operators,""),h,n.$headers.eq(g),g),b="number"!==typeof b||""===n||isNaN(n)?b:n;n=!q[g]&& "numeric"!==c.type||isNaN(b)||!d?isNaN(f)?e.formatFloat(f.replace(e.filter.regex.nondigit,""),h):e.formatFloat(f,h):d;/>/.test(a)&&(l=/>=/.test(a)?n>=b:n>b);/k&&(f=c,c=k,k=f); return a>=c&&a<=k||""===c||""===k}return null},wild:function(b,a,c,f,d,e,h){return/[\?|\*]/.test(a)||/\s+OR\s+/.test(b)?(b=h.config,a=a.replace(/\s+OR\s+/gi,"|"),!b.$headers.filter('[data-column="'+e+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a="^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(f)):null},fuzzy:function(b,a,c,f){if(/^~/.test(a)){b=0;c=f.length;var d=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||"")+"":"",f+='");a.$table.find("thead").find('select.tablesorter-filter[data-column="'+h+'"]').append(f)}e.filter.buildDefault(b, !0);a.$table.find("select.tablesorter-filter").bind("change search",function(a,c){e.filter.checkFilters(b,c)});c.filter_hideFilters&&e.filter.hideFilters(b,a);a.showProcessing&&a.$table.bind("filterStart.tsfilter filterEnd.tsfilter",function(c,d){g=d?a.$table.find("."+e.css.header).filter("[data-column]").filter(function(){return""!==d[k(this).data("column")]}):"";e.isProcessing(b,"filterStart"===c.type,d?g:"")});a.debug&&e.benchmark("Applying Filter widget",q);a.$table.bind("tablesorter-initialized pagerInitialized", function(){p=e.filter.setDefaults(b,a,c)||[];p.length&&e.setFilters(b,p,!0);e.filter.checkFilters(b,p)});c.filter_Initialized=!0;a.$table.trigger("filterInit")},setDefaults:function(b,a,c){var f,d=[],g=a.columns;c.filter_saveFilters&&e.storage&&(d=e.storage(b,"tablesorter-filters")||[],(f=k.isArray(d))&&""===d.join("")||!f)&&(d=[]);if(!d.length)for(f=0;f';for(b=0;b";a.$filters=k(d+"").appendTo(a.$table.find("thead").eq(0)).find("td");for(b=0;b").appendTo(a.$filters.eq(b)):(c.filter_formatter&&k.isFunction(c.filter_formatter[b])?((d=c.filter_formatter[b](a.$filters.eq(b),b))&&0===d.length&&(d=a.$filters.eq(b).children("input")),d&&(0===d.parent().length||d.parent().length&&d.parent()[0]!==a.$filters[b])&&a.$filters.eq(b).append(d)):d=k('').appendTo(a.$filters.eq(b)),d&&d.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||"")),d&&(d.addClass("tablesorter-filter "+c.filter_cssFilter).attr("data-column", b),g&&(d.addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a){b=k(b)[0];var c,f=b.config.widgetOptions;a.unbind("keyup search filterReset").bind("keyup search",function(d,g){var h=k(this);if(27===d.which)this.value="";else if("number"===typeof f.filter_liveSearch&&this.value.lengthd.which&&8!==d.which&&!0===f.filter_liveSearch&&13!==d.which||37<=d.which&&40>=d.which||13!==d.which&&!1===f.filter_liveSearch))return;h.hasClass("tablesorter-filter")&& !h.hasClass("tablesorter-external-filter")?c=g:(c=[],a.each(function(){c[k(this).data("column")||0]=k(this).val()}));e.filter.searching(b,g,c)}).bind("filterReset",function(){a.val("")})},checkFilters:function(b,a){var c=b.config,f=c.widgetOptions,d=k.isArray(a),g=d?a:e.getFilters(b),h=(g||[]).join("");d&&e.setFilters(b,g);f.filter_hideFilters&&c.$table.find(".tablesorter-filter-row").trigger(""===h?"mouseleave":"mouseenter");if(c.lastCombinedFilter!==h||!1===a)if(c.$table.trigger("filterStart",[g]), c.showProcessing)setTimeout(function(){e.filter.findRows(b,g,h);return!1},30);else return e.filter.findRows(b,g,h),!1},hideFilters:function(b,a){var c,f,d;a.$table.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){c=k(this);clearTimeout(d);d=setTimeout(function(){/enter|over/.test(a.type)?c.removeClass("hideme"):k(document.activeElement).closest("tr")[0]!==c[0]&&""===e.getFilters(b).join("")&&c.addClass("hideme")},200)}).find("input, select").bind("focus blur", function(a){f=k(this).closest("tr");clearTimeout(d);d=setTimeout(function(){if(""===e.getFilters(b).join(""))f["focus"===a.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,c){if(b.config.lastCombinedFilter!==c){var f,d,g,h,p,q,n,l,m,u,r,w,v,y,A,z,B,C,x,E,t=b.config,s=t.widgetOptions,G=t.columns,D=t.$tbodies,H=["range","notMatch","operators"],F=t.$headers.map(function(a){return e.getData?"parsed"===e.getData(t.$headers.filter('[data-column="'+a+'"]:last'),t.headers[a],"filter"): k(this).hasClass("filter-parsed")}).get();t.debug&&(E=new Date);for(p=0;pk.inArray(c,H))if(A=d(a[l],v,r,w,f,l,b,s,F),null!==A)return C=A,!1}),null!==C?z=C:(r=(w+u).indexOf(v),z=!s.filter_startsWith&&0<=r||s.filter_startsWith&&0===r));if(s.filter_anyMatch){if(x=z)break}else x=z?x:!1}g[h].style.display=x?"":"none";g.eq(h)[x?"removeClass":"addClass"](s.filter_filteredRow);if(m.length){if(t.pager&&t.pager.countChildRows||s.pager_countChildRows)m[x? "removeClass":"addClass"](s.filter_filteredRow);m.toggle(x)}}e.processTbody(b,q,!1)}t.lastCombinedFilter=c;t.lastSearch=a;t.$table.data("lastSearch",a);s.filter_saveFilters&&e.storage&&e.storage(b,"tablesorter-filters",a);t.debug&&e.benchmark("Completed filter widget search",E);t.$table.trigger("applyWidgets");t.$table.trigger("filterEnd")}},buildSelect:function(b,a,c,f){a=parseInt(a,10);var d,g,h;b=b.config;var p=b.widgetOptions,q=b.$tbodies,n=[],l=b.$headers.filter('[data-column="'+a+'"]:last'), m='";for(g=0;g"+n[f]+"":"";b.$table.find("thead").find('select.tablesorter-filter[data-column="'+a+'"]')[c?"html":"append"](m)},buildDefault:function(b,a){var c,f,d=b.config,g=d.widgetOptions,h=d.columns;for(c=0;cb.top&&eMath.abs(q.parent().width()-q.width()),r=function(){e.storage&&l&&(p[l.index()]=l.width(),p[m.index()]=m.width(),l.width(p[l.index()]),m.width(p[m.index()]),!1!==c.resizable&&e.storage(b,"tablesorter-resizable",p));n=0;l=m=null;k(window).trigger("resize")};if(p=e.storage&&!1!==c.resizable?e.storage(b,"tablesorter-resizable"): {})for(h in p)!isNaN(h)&&h'); c.resizable_addLastColumn||(g=g.slice(0,-1));d=d?d.add(g):g});d.each(function(){var a=k(this),b=parseInt(a.css("padding-right"),10)+10;a.find(".tablesorter-wrapper").append('
')}).bind("mousemove.tsresize",function(a){if(0!==n&&l){var b=a.pageX-n,c=l.width();l.width(c+b);l.width()!==c&&u&&m.width(m.width()-b);n=a.pageX}}).bind("mouseup.tsresize",function(){r()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown", function(b){l=k(b.target).closest("th");var c=a.$headers.filter('[data-column="'+l.attr("data-column")+'"]');1' + d[i][j] + ''; + tds += /^\s*' + d[i][j] + ''; } tds += ''; } diff --git a/package.json b/package.json index 85f83bac..a2843394 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "tablesorter", "title": "tablesorter", - "version": "2.14.2", + "version": "2.14.3", "description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.", "author": { "name": "Christian Bach", diff --git a/tablesorter.jquery.json b/tablesorter.jquery.json index 85f83bac..a2843394 100644 --- a/tablesorter.jquery.json +++ b/tablesorter.jquery.json @@ -1,7 +1,7 @@ { "name": "tablesorter", "title": "tablesorter", - "version": "2.14.2", + "version": "2.14.3", "description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.", "author": { "name": "Christian Bach",