From 1cc8b0da33a81b8659b978002462dcb104cf0dac Mon Sep 17 00:00:00 2001 From: Mottie Date: Wed, 30 Oct 2013 17:47:58 -0500 Subject: [PATCH] version bump --- README.md | 26 +++++++++++++++++++ addons/pager/jquery.tablesorter.pager.js | 2 +- addons/pager/jquery.tablesorter.pager.min.js | 4 +-- component.json | 2 +- docs/example-widget-grouping.html | 2 +- docs/index.html | 2 +- js/jquery.tablesorter.js | 4 +-- js/jquery.tablesorter.min.js | 4 +-- ...ry.tablesorter.widgets-filter-formatter.js | 4 +-- ...ablesorter.widgets-filter-formatter.min.js | 2 +- js/jquery.tablesorter.widgets.js | 2 +- js/jquery.tablesorter.widgets.min.js | 10 +++---- js/widgets/widget-pager.js | 2 +- package.json | 2 +- tablesorter.jquery.json | 2 +- 15 files changed, 48 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index aedfd1c6..9c7147db 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,32 @@ 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.13 (10/30/2013) + +* Added a "Development" branch to the repository. + * I have started development on version 3 of tablesorter and this branch will have a basic structure to allow modularization of tablesorter. + * So far, only the tablesorter core has been restructured and reorganized. + * Added basic Zepto support to the core and some basic widgets, this is a work-in-progress. See [issue #398](https://github.com/Mottie/tablesorter/issues/398). + +* Ensure resized headers have stored data, or provide a fallback. Fixes [issue #394](https://github.com/Mottie/tablesorter/issues/394). +* Added pager `countChildRows` option (plugin & widget) + * When `true`, the pager treats child rows as if it were a parent row and strictly enforces showing only the set number of pager rows. + * This can cause problems as a child row may not appear associated with its parent, may be split across pages or possibly distort the table layout if the parent or child row contain row or cell spans. + * When `false` the pager always includes the child row with its parent, ignoring the set pager size. + * See [issue #396](https://github.com/Mottie/tablesorter/issues/396). +* Updated LESS theme to work properly with LESS 4.1+ +* Grouping widget update + * Added `group_separator` option which is used when a `group-separator-#` class name is applied + * Updated [grouping widget demo](http://mottie.github.io/tablesorter/docs/example-widget-grouping.html). +* Added a file-type parser + * Optimally used with the grouping widget to sort similar file types (e.g. video extensions: .mp4, .avi, .mov, etc) + * [File type sorting demo](http://mottie.github.io/tablesorter/docs/example-parsers-file-type.html) added. +* Internal changes + * Improved `formatFloat()` replace method. + * Sorting a zero hex value (`0x00`) is now possible. + + + #### Version 2.12 (10/18/2013) **Core** diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index de6bec07..5749032f 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 10/18/2013 + * updated 10/30/2013 */ /*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 d00d548b..be13aa69 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 10/18/2013 */ -;(function(g){var l=g.tablesorter;g.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,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 w=this,x=function(b,a){var c=b.cssDisabled,f=!!a,e=Math.min(b.totalPages,b.filteredPages);b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f||0===b.page?"addClass":"removeClass"](c),b.$container.find(b.cssNext+","+b.cssLast)[f||b.page===e-1?"addClass":"removeClass"](c))},r=function(b,a,c){var f,e,h,d=b.config;f=d.$table.hasClass("hasFilters")&&!a.ajaxUrl; h=(d.widgetOptions&&d.widgetOptions.filter_filteredRow||"filtered")+","+d.selectorRemove;e=a.size||10;a.totalPages=Math.ceil(a.totalRows/e);a.filteredRows=f?d.$tbodies.eq(0).children("tr:not(."+h+")").length:a.totalRows;a.filteredPages=f?Math.ceil(a.filteredRows/e)||1:a.totalPages;if(0<=Math.min(a.totalPages,a.filteredPages)&&(h=a.size*a.page>a.filteredRows,a.startRow=h?1:0===a.filteredRows?0:a.size*a.page+1,a.page=h?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),f=a.$container.find(a.cssPageDisplay), h=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(b,c){return a.page+(c?parseInt(c,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var c=b.split(":"),d=a.ajaxData;return 1"+f+"";a.$goto.html(h).val(a.page+ 1)}x(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&l.storage&&l.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=function(b,a){var c,f=b.config,e=f.$tbodies.eq(0);a.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),c=g.data(b,"pagerSavedHeight"))&&(c-=e.height(),5'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();g.data(b,"pagerSavedHeight",c.height());t(b,a);g.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,f=b.config,e=f.$tbodies.eq(0).children(),h=e.length,d=a.page*a.size,g=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",m=0;for(c=0;c=d&&m'+(0===f.status?"Not connected, verify Network": 404===f.status?"Requested page not found [404]":500===f.status?"Internal Server Error [500]":"parsererror"===e?"Requested JSON parse failed":"timeout"===e?"Time out error":"abort"===e?"Ajax Request aborted":"Uncaught error: "+f.statusText+" ["+f.status+"]")+"").click(function(){g(this).remove()}).appendTo(p.find("thead:first")),k.$tbodies.eq(0).empty();else{g.isArray(h)?(f=isNaN(h[0])&&!isNaN(h[1]),e=h[f?1:0],c.totalRows=isNaN(e)?c.totalRows||0:e,f=h[f?0:1]||[],m=h[2]):(c.ajaxData=h,c.totalRows= h.total,m=h.headers,f=h.rows);v=f.length;if(f instanceof jQuery)k.$tbodies.eq(0).empty().append(f);else if(v){if(0";for(e=0;e"+f[h][e]+"";q+=""}k.$tbodies.eq(0).html(q)}m&&m.length===b&&(n=(d=p.hasClass("hasStickyHeaders"))?k.$sticky.children("thead:first").children().children():"",s=p.find("tfoot tr:first").children(),k.$headers.filter("th").each(function(a){var b=g(this),c;b.find("."+l.css.icon).length?(c=b.find("."+l.css.icon).clone(!0), b.find(".tablesorter-header-inner").html(m[a]).append(c),d&&n.length&&(c=n.eq(a).find("."+l.css.icon).clone(!0),n.eq(a).find(".tablesorter-header-inner").html(m[a]).append(c))):(b.find(".tablesorter-header-inner").html(m[a]),d&&n.length&&n.eq(a).find(".tablesorter-header-inner").html(m[a]));s.eq(a).html(m[a])}))}k.showProcessing&&l.isProcessing(a);c.totalPages=Math.ceil(c.totalRows/(c.size||10));r(a,c);t(a,c);c.initialized?(p.trigger("pagerChange",c),p.trigger("updateComplete")):p.trigger("update")}c.initialized|| (c.initialized=!0,g(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),f=g(document),e=b.config;""!==c&&(e.showProcessing&&l.isProcessing(b,!0),f.bind("ajaxError.pager",function(c,d,e,g){C(null,b,a,d,g);f.unbind("ajaxError.pager")}),a.ajaxObject.url=c,a.ajaxObject.success=function(c){C(c,b,a);f.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},g.ajax(a.ajaxObject))},G=function(b,a){var c=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(c,b){return a.page+ (b?parseInt(b,10):0)}).replace(/\{size\}/g,a.size):"",f=b.config.sortList,e=a.currentFilters||[],h=c.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),d=c.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),k=[];h&&(h=h[1],g.each(f,function(a,b){k.push(h+"["+b[0]+"]="+b[1])}),c=c.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"):h),k=[]);d&&(d=d[1],g.each(e,function(a,b){b&&k.push(d+"["+a+"]="+encodeURIComponent(b))}),c=c.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"): d));"function"===typeof a.customAjaxUrl&&(c=a.customAjaxUrl(b,c));return c},y=function(b,a,c){var f,e;f=c.page*c.size;var h=f+c.size;if(!(1>(a&&a.length||0))){c.page>=c.totalPages&&D(b,c);c.isDisabled=!1;c.initialized&&g(b).trigger("pagerChange",c);if(c.removeRows){h>a.length&&(h=a.length);l.clearTableBody(b);for(e=l.processTbody(b,b.config.$tbodies.eq(0),!0);fa.page&&(a.page=0);a.page>e-1&&0!==e&&(a.page=e-1);if(f.page!==a.page||f.size!==a.size|| f.total!==a.totalPages||f.filters!==a.currentFilters)a.last={page:a.page,size:a.size,totalPages:a.totalPages,currentFilters:a.currentFilters},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),g.data(b,"pagerLastPage",a.page),g.data(b,"pagerUpdateTriggered",!0),a.initialized&&!1!==c&&g(b).trigger("pageMoved",a)}},z=function(b,a,c){c.size=a;c.$size.val(a);g.data(b,"pagerLastPage",c.page);g.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/(c.size||10));k(b,c)},I=function(b,a){a.page=0; k(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;k(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);k(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);k(b,a)},F=function(b,a,c){var f=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=g.data(b,"pagerLastPage")||a.page||0;a.size=g.data(b,"pagerLastSize")|| parseInt(f.find("option[selected]").val(),10)||a.size;f.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/(a.size||10));c&&(g(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a))};w.appender=function(b,a){var c=b.config.pager;c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=g.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/(c.size||10)),y(b,a,c))};w.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,f,e=this, h=e.config,d=h.pager=g.extend({},g.tablesorterPager.defaults,b),s=h.$table,n=d.$container=g(d.container).addClass("tablesorter-pager").show();d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;h.appender=w.appender;d.savePages&&l.storage&&(a=l.storage(e,"tablesorter-pager")||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10);s.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager").bind("filterStart.pager", function(a,b){g.data(e,"pagerUpdateTriggered",!1);d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(a){g.data(e,"pagerUpdateTriggered")?g.data(e,"pagerUpdateTriggered",!1):(("filterEnd"===a.type||"sortEnd"===a.type&&h.serverSideSorting)&&k(e,d,!1),r(e,d,!1),t(e,d))}).bind("disable.pager",function(a){a.stopPropagation();E(e,d)}).bind("enable.pager",function(a){a.stopPropagation();F(e,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(e,d);d.$container.hide();e.config.appender= null;d.initialized=!1;g(e).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");l.storage&&l.storage(e,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(e,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();z(e,parseInt(b,10)||10,d);u(e,d);r(e,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);k(e,d);r(e,d,!1)});c=[d.cssFirst, d.cssPrev,d.cssNext,d.cssLast];f=[I,K,J,D];n.find(c.join(",")).unbind("click.pager").bind("click.pager",function(a){var b=g(this),h=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;aa.filteredRows,a.startRow=h?1:0===a.filteredRows?0:a.size*a.page+1,a.page=h?0:a.page,a.endRow=Math.min(a.filteredRows, a.totalRows,a.size*(a.page+1)),f=a.$container.find(a.cssPageDisplay),h=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(b,c){return a.page+(c?parseInt(c,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var c=b.split(":"),d=a.ajaxData;return 1"+f+"";a.$goto.html(h).val(a.page+1)}x(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&l.storage&&l.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=function(b,a){var c,f=b.config,e=f.$tbodies.eq(0);a.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),c=g.data(b,"pagerSavedHeight"))&&(c-=e.height(),5'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();g.data(b,"pagerSavedHeight",c.height());t(b,a);g.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,f=b.config,e=f.$tbodies.eq(0).children(),h=e.length,d=a.page*a.size,g=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",m=0;for(c=0;c=d&& m'+(0===f.status?"Not connected, verify Network":404===f.status?"Requested page not found [404]":500===f.status?"Internal Server Error [500]":"parsererror"===e?"Requested JSON parse failed":"timeout"===e?"Time out error":"abort"===e?"Ajax Request aborted":"Uncaught error: "+f.statusText+" ["+f.status+"]")+"").click(function(){g(this).remove()}).appendTo(p.find("thead:first")),k.$tbodies.eq(0).empty();else{g.isArray(h)?(f=isNaN(h[0])&& !isNaN(h[1]),e=h[f?1:0],c.totalRows=isNaN(e)?c.totalRows||0:e,f=h[f?0:1]||[],m=h[2]):(c.ajaxData=h,c.totalRows=h.total,m=h.headers,f=h.rows);v=f.length;if(f instanceof jQuery)k.$tbodies.eq(0).empty().append(f);else if(v){if(0";for(e=0;e"+f[h][e]+"";q+=""}k.$tbodies.eq(0).html(q)}m&&m.length===b&&(n=(d=p.hasClass("hasStickyHeaders"))?k.$sticky.children("thead:first").children().children():"",s=p.find("tfoot tr:first").children(),k.$headers.filter("th").each(function(a){var b= g(this),c;b.find("."+l.css.icon).length?(c=b.find("."+l.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(m[a]).append(c),d&&n.length&&(c=n.eq(a).find("."+l.css.icon).clone(!0),n.eq(a).find(".tablesorter-header-inner").html(m[a]).append(c))):(b.find(".tablesorter-header-inner").html(m[a]),d&&n.length&&n.eq(a).find(".tablesorter-header-inner").html(m[a]));s.eq(a).html(m[a])}))}k.showProcessing&&l.isProcessing(a);c.totalPages=Math.ceil(c.totalRows/(c.size||10));r(a,c);t(a,c);c.initialized? (p.trigger("pagerChange",c),p.trigger("updateComplete")):p.trigger("update")}c.initialized||(c.initialized=!0,g(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),f=g(document),e=b.config;""!==c&&(e.showProcessing&&l.isProcessing(b,!0),f.bind("ajaxError.pager",function(c,d,e,g){C(null,b,a,d,g);f.unbind("ajaxError.pager")}),a.ajaxObject.url=c,a.ajaxObject.success=function(c){C(c,b,a);f.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},g.ajax(a.ajaxObject))}, G=function(b,a){var c=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(c,b){return a.page+(b?parseInt(b,10):0)}).replace(/\{size\}/g,a.size):"",f=b.config.sortList,e=a.currentFilters||[],h=c.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),d=c.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),k=[];h&&(h=h[1],g.each(f,function(a,b){k.push(h+"["+b[0]+"]="+b[1])}),c=c.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"):h),k=[]);d&&(d=d[1],g.each(e,function(a,b){b&&k.push(d+"["+a+"]="+ encodeURIComponent(b))}),c=c.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"):d));"function"===typeof a.customAjaxUrl&&(c=a.customAjaxUrl(b,c));return c},y=function(b,a,c){var f,e;f=c.page*c.size;var h=f+c.size;if(!(1>(a&&a.length||0))){c.page>=c.totalPages&&D(b,c);c.isDisabled=!1;c.initialized&&g(b).trigger("pagerChange",c);if(c.removeRows){h>a.length&&(h=a.length);l.clearTableBody(b);for(e=l.processTbody(b,b.config.$tbodies.eq(0),!0);fa.page&&(a.page=0);a.page>e-1&&0!==e&&(a.page=e-1);if(f.page!==a.page||f.size!==a.size||f.total!==a.totalPages||f.filters!==a.currentFilters)a.last={page:a.page,size:a.size,totalPages:a.totalPages,currentFilters:a.currentFilters},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),g.data(b,"pagerLastPage",a.page),g.data(b,"pagerUpdateTriggered",!0),a.initialized&&!1!==c&&g(b).trigger("pageMoved",a)}},z=function(b,a,c){c.size=a;c.$size.val(a);g.data(b,"pagerLastPage",c.page);g.data(b,"pagerLastSize", c.size);c.totalPages=Math.ceil(c.totalRows/(c.size||10));k(b,c)},I=function(b,a){a.page=0;k(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;k(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);k(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);k(b,a)},F=function(b,a,c){var f=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled= !1;a.page=g.data(b,"pagerLastPage")||a.page||0;a.size=g.data(b,"pagerLastSize")||parseInt(f.find("option[selected]").val(),10)||a.size;f.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/(a.size||10));c&&(g(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a))};w.appender=function(b,a){var c=b.config.pager;c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=g.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/(c.size||10)),y(b,a,c))};w.construct=function(b){return this.each(function(){if(this.config&& this.hasInitialized){var a,c,f,e=this,h=e.config,d=h.pager=g.extend({},g.tablesorterPager.defaults,b),s=h.$table,n=d.$container=g(d.container).addClass("tablesorter-pager").show();d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;h.appender=w.appender;d.savePages&&l.storage&&(a=l.storage(e,"tablesorter-pager")||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10);s.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager").bind("filterStart.pager", function(a,b){g.data(e,"pagerUpdateTriggered",!1);d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(a){g.data(e,"pagerUpdateTriggered")?g.data(e,"pagerUpdateTriggered",!1):(("filterEnd"===a.type||"sortEnd"===a.type&&h.serverSideSorting)&&k(e,d,!1),r(e,d,!1),t(e,d))}).bind("disable.pager",function(a){a.stopPropagation();E(e,d)}).bind("enable.pager",function(a){a.stopPropagation();F(e,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(e,d);d.$container.hide();e.config.appender= null;d.initialized=!1;g(e).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");l.storage&&l.storage(e,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(e,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();z(e,parseInt(b,10)||10,d);u(e,d);r(e,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);k(e,d);r(e,d,!1)});c=[d.cssFirst, d.cssPrev,d.cssNext,d.cssLast];f=[I,K,J,D];n.find(c.join(",")).unbind("click.pager").bind("click.pager",function(a){var b=g(this),h=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;a=1.2.6" } diff --git a/docs/example-widget-grouping.html b/docs/example-widget-grouping.html index abae7bbf..ebab58d8 100644 --- a/docs/example-widget-grouping.html +++ b/docs/example-widget-grouping.html @@ -137,7 +137,7 @@
  • This widget will only work in tablesorter version 2.8+ and jQuery version 1.7+.
  • Please do not use this widget in very large tables (it might be really slow) or when your table includes multiple tbodies.
  • -
  • In v2.12.1, added group_separator option & group-separator-# header class name.
  • +
  • In v2.13, added group_separator option & group-separator-# header class name.
  • In v2.12, added group_callback & group_complete options. See options section below for details.
  • In v2.11: diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 669b41ee..f4def7a2 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /**! -* TableSorter 2.12.0 - Client-side table sorting with ease! +* TableSorter 2.13.0 - 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.12.0"; + ts.version = "2.13.0"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 46b747eb..3c33bc99 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.12.0 min - Client-side table sorting with ease! +* TableSorter 2.13.0 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!(function(g){g.extend({tablesorter:new function(){function c(a){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(a):alert(a)}function l(a,b){c(a+" ("+((new Date).getTime()-b.getTime())+"ms)")}function m(a){for(var b in a)return!1;return!0}function p(a,b,d){if(!b)return"";var h=a.config,c=h.textExtraction,f="",f="simple"===c?h.supportsTextContent?b.textContent:g(b).text():"function"===typeof c?c(b,a,d):"object"===typeof c&&c.hasOwnProperty(d)?c[d](b,a,d):h.supportsTextContent? b.textContent:g(b).text();return g.trim(f)}function x(a){var b=a.config,d=b.$tbodies=b.$table.children("tbody:not(."+b.cssInfoBlock+")"),h,y,f,k,r,g,n="";if(0===d.length)return b.debug?c("*Empty table!* Not building a parser cache"):"";d=d[0].rows;if(d[0])for(h=[],y=d[0].cells.length,f=0;f':"";n.$headers=g(a).find(n.selectorHeaders).each(function(a){h=g(this);d=n.headers[a];n.headerContent[a]=g(this).html();k=n.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,f);n.onRenderTemplate&&(y=n.onRenderTemplate.apply(h,[a,k]))&&"string"===typeof y&&(k=y);g(this).html('
    '+k+"
    ");n.onRenderHeader&&n.onRenderHeader.apply(h,[a]); this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];var c=e.getData(h,d,"sortInitialOrder")||n.sortInitialOrder;this.order=/^d/i.test(c)||1===c?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;r=e.getData(h,d,"lockedOrder")||!1;"undefined"!==typeof r&&!1!==r&&(this.order=this.lockedOrder=/^d/i.test(r)||1===r?[1,1,1]:[0,0,0]);h.addClass(e.css.header+" "+n.cssHeader);n.headerList[a]=this;h.parent().addClass(e.css.headerRow+" "+n.cssHeaderRow);h.attr("tabindex",0)});D(a);n.debug&&(l("Built headers:", q),c(n.$headers))}function F(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();x(a);z(a);G(h.$table,b,d)}function D(a){var b,d=a.config;d.$headers.each(function(a,c){b="false"===e.getData(c,d.headers[a],"sorter");c.sortDisabled=b;g(c)[b?"addClass":"removeClass"]("sorter-false")})}function H(a){var b,d,h,c=a.config,f=c.sortList,k=[e.css.sortAsc+" "+c.cssAsc,e.css.sortDesc+" "+c.cssDesc],r=g(a).find("tfoot tr").children().removeClass(k.join(" "));c.$headers.removeClass(k.join(" "));h=f.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,c,f=a.config,e=b||f.sortList;f.sortList=[];g.each(e,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(c=f.headerList[d[0]])f.sortList.push(d),h=g.inArray(d[1],c.order),c.count=0<=h?h:d[1]%(f.sortReset?3:2)})}function N(a,b,d){var h,c,f=a.config,k=!d[f.sortMultiSortKey],r=g(a);r.trigger("sortStart",a);b.count=d[f.sortResetKey]?2:(b.count+1)%(f.sortReset?3:2);f.sortRestart&&(c=b,f.$headers.each(function(){this===c||!k&&g(this).is("."+ e.css.sortDesc+",."+e.css.sortAsc)||(this.count=-1)}));c=b.column;if(k){f.sortList=[];if(null!==f.sortForce)for(h=f.sortForce,d=0;dh&&(f.sortList.push([c,h]),1h&&(f.sortList.push([c,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.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"}; e.log=c;e.benchmark=l;e.construct=function(a){return this.each(function(){var b=g.extend(!0,{},e.defaults,a);!this.hasInitialized&&e.buildTable&&"TABLE"!==this.tagName&&e.buildTable(this,b);e.setup(this,b)})};e.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),l=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};e.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};e.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])})}; e.destroy=function(a,b,d){a=g(a)[0];if(a.hasInitialized){e.refreshWidgets(a,!0,!0);var c=g(a),l=a.config,f=c.find("thead:first"),k=f.find("tr."+e.css.headerRow).removeClass(e.css.headerRow+" "+l.cssHeaderRow),m=c.find("tfoot:first > tr").children("th, td");f.find("tr").not(k).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 ")); l.$headers.add(m).removeClass([e.css.header,l.cssHeader,l.cssAsc,l.cssDesc,e.css.sortAsc,e.css.sortDesc].join(" ")).removeAttr("data-column");k.find(l.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter");e.restoreHeaders(a);!1!==b&&c.removeClass(e.css.table+" "+l.tableClass+" tablesorter-"+l.theme);a.hasInitialized=!1;"function"===typeof d&&d(a)}};e.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,hex:/^0x[0-9a-f]+$/i};e.sortNatural= function(a,b){if(a===b)return 0;var d,c,g,f,k,l;c=e.regex;if(g=parseInt(b.match(c.hex),16)){d=parseInt(a.match(c.hex),16);if(dg)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");l=Math.max(d.length,c.length);for(k=0;kf)return 1}return 0};e.sortText=function(a,b){return a>b?1:ag.inArray(k[h].id,f))&&(l.debug&&c("Refeshing widgets: Removing "+k[h].id),k[h].hasOwnProperty("remove")&&(k[h].remove(a,l,l.widgetOptions),l.widgetInit[k[h].id]=!1));!0!==d&&e.applyWidget(a,b)};e.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)};e.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*\(/, "-").replace(/\)/,""));c=parseFloat(a);return isNaN(c)?g.trim(a):c};e.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,l){var m=l.config;c&&(c=g.trim(m.ignoreCase?c.toLocaleLowerCase():c),c=m.sortLocaleCompare?p.replaceAccents(c):c);return c},type:"text"});p.addParser({id:"digit",is:function(c){return p.isDigit(c)},format:function(c, l){var m=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),l);return c&&"number"===typeof m?m:c?g.trim(c&&l.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,l){var m=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),l);return c&&"number"===typeof m?m:c?g.trim(c&&l.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 m,u=c?c.split("."):"",x="",z=u.length;for(m=0;mc.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,m,u){if(c){m=g.config;var x=m.headerList[u];u=x.dateFormat||p.getData(x,m.headers[u],"dateFormat")||m.dateFormat;c=c.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===u&&(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,l,m){c=l.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return g(m).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c,l,m){var u,x,z,B,E,C,F=RegExp(l.cssChildRow,"i"),D=l.$tbodies;l.debug&&(E=new Date);for(c=0;c':"";n.$headers=g(a).find(n.selectorHeaders).each(function(a){h=g(this);d=n.headers[a];n.headerContent[a]=g(this).html();l=n.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,f);n.onRenderTemplate&&(y=n.onRenderTemplate.apply(h,[a,l]))&&"string"===typeof y&&(l=y);g(this).html('
    '+l+"
    ");n.onRenderHeader&&n.onRenderHeader.apply(h,[a]); this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];var c=e.getData(h,d,"sortInitialOrder")||n.sortInitialOrder;this.order=/^d/i.test(c)||1===c?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;r=e.getData(h,d,"lockedOrder")||!1;"undefined"!==typeof r&&!1!==r&&(this.order=this.lockedOrder=/^d/i.test(r)||1===r?[1,1,1]:[0,0,0]);h.addClass(e.css.header+" "+n.cssHeader);n.headerList[a]=this;h.parent().addClass(e.css.headerRow+" "+n.cssHeaderRow);h.attr("tabindex",0)});D(a);n.debug&&(k("Built headers:", q),c(n.$headers))}function F(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();x(a);z(a);G(h.$table,b,d)}function D(a){var b,d=a.config;d.$headers.each(function(a,c){b="false"===e.getData(c,d.headers[a],"sorter");c.sortDisabled=b;g(c)[b?"addClass":"removeClass"]("sorter-false")})}function H(a){var b,d,h,c=a.config,f=c.sortList,l=[e.css.sortAsc+" "+c.cssAsc,e.css.sortDesc+" "+c.cssDesc],r=g(a).find("tfoot tr").children().removeClass(l.join(" "));c.$headers.removeClass(l.join(" "));h=f.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,c,f=a.config,e=b||f.sortList;f.sortList=[];g.each(e,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(c=f.headerList[d[0]])f.sortList.push(d),h=g.inArray(d[1],c.order),c.count=0<=h?h:d[1]%(f.sortReset?3:2)})}function N(a,b,d){var h,c,f=a.config,l=!d[f.sortMultiSortKey],r=g(a);r.trigger("sortStart",a);b.count=d[f.sortResetKey]?2:(b.count+1)%(f.sortReset?3:2);f.sortRestart&&(c=b,f.$headers.each(function(){this===c||!l&&g(this).is("."+ e.css.sortDesc+",."+e.css.sortAsc)||(this.count=-1)}));c=b.column;if(l){f.sortList=[];if(null!==f.sortForce)for(h=f.sortForce,d=0;dh&&(f.sortList.push([c,h]),1h&&(f.sortList.push([c,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.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"}; e.log=c;e.benchmark=k;e.construct=function(a){return this.each(function(){var b=g.extend(!0,{},e.defaults,a);!this.hasInitialized&&e.buildTable&&"TABLE"!==this.tagName&&e.buildTable(this,b);e.setup(this,b)})};e.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),k=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};e.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};e.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])})}; e.destroy=function(a,b,d){a=g(a)[0];if(a.hasInitialized){e.refreshWidgets(a,!0,!0);var c=g(a),k=a.config,f=c.find("thead:first"),l=f.find("tr."+e.css.headerRow).removeClass(e.css.headerRow+" "+k.cssHeaderRow),m=c.find("tfoot:first > tr").children("th, td");f.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 ")); k.$headers.add(m).removeClass([e.css.header,k.cssHeader,k.cssAsc,k.cssDesc,e.css.sortAsc,e.css.sortDesc].join(" ")).removeAttr("data-column");l.find(k.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter");e.restoreHeaders(a);!1!==b&&c.removeClass(e.css.table+" "+k.tableClass+" tablesorter-"+k.theme);a.hasInitialized=!1;"function"===typeof d&&d(a)}};e.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,hex:/^0x[0-9a-f]+$/i};e.sortNatural= function(a,b){if(a===b)return 0;var d,c,g,f,l,k;c=e.regex;if(c.hex.test(b)){d=parseInt(a.match(c.hex),16);g=parseInt(b.match(c.hex),16);if(dg)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;lf)return 1}return 0};e.sortText=function(a,b){return a>b?1:ag.inArray(l[h].id,f))&&(k.debug&&c("Refeshing widgets: Removing "+l[h].id),l[h].hasOwnProperty("remove")&&(l[h].remove(a,k,k.widgetOptions),k.widgetInit[l[h].id]=!1));!0!==d&&e.applyWidget(a,b)};e.getData=function(a,b,c){var e="";a=g(a);var k,f;if(!a.length)return"";k=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)|| "undefined"!==typeof a.data(c.toLowerCase())?e+=a.data(c)||a.data(c.toLowerCase()):k&&"undefined"!==typeof k[c]?e+=k[c]:b&&"undefined"!==typeof b[c]?e+=b[c]:" "!==f&&f.match(" "+c+"-")&&(e=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(e)};e.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};e.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,k){var m=k.config;c&&(c=g.trim(m.ignoreCase?c.toLocaleLowerCase():c),c=m.sortLocaleCompare?p.replaceAccents(c):c);return c},type:"text"});p.addParser({id:"digit",is:function(c){return p.isDigit(c)},format:function(c,k){var m= p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),k);return c&&"number"===typeof m?m:c?g.trim(c&&k.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,k){var m=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),k);return c&&"number"===typeof m?m:c?g.trim(c&&k.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 m,u=c?c.split("."):"",x="",z=u.length;for(m=0;mc.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,m,u){if(c){m=g.config;var x=m.headerList[u];u=x.dateFormat||p.getData(x,m.headers[u],"dateFormat")||m.dateFormat;c=c.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===u&&(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,k,m){c=k.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return g(m).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c,k,m){var u,x,z,B,E,C,F=RegExp(k.cssChildRow,"i"),D=k.$tbodies;k.debug&&(E=new Date);for(c=0;c').appendTo($cell), // test if HTML5 number is supported - from Modernizr numberSupported = o.skipTest || $number.attr('type') === 'number' && $number.val() !== 'test', - t, l, $shcell = [], + l, $shcell = [], c = $cell.closest('table')[0].config, updateCompare = function(v) { diff --git a/js/jquery.tablesorter.widgets-filter-formatter.min.js b/js/jquery.tablesorter.widgets-filter-formatter.min.js index 1238a869..4e52c211 100644 --- a/js/jquery.tablesorter.widgets-filter-formatter.min.js +++ b/js/jquery.tablesorter.widgets-filter-formatter.min.js @@ -1,4 +1,4 @@ -/*! Filter widget formatter functions - updated 10/10/2013 +/*! Filter widget formatter functions - updated 10/30/2013 * requires: tableSorter 2.7.7+ and jQuery 1.4.3+ * jQuery UI spinner, silder, range slider & datepicker (range) * HTML5 number (spinner), range slider & color selector diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 281c8d79..b63d7578 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -1,4 +1,4 @@ -/*! tableSorter 2.8+ widgets - updated 10/18/2013 +/*! tableSorter 2.8+ widgets - updated 10/30/2013 * * Column Styles * Column Filters diff --git a/js/jquery.tablesorter.widgets.min.js b/js/jquery.tablesorter.widgets.min.js index e9f5287f..8326e4f9 100644 --- a/js/jquery.tablesorter.widgets.min.js +++ b/js/jquery.tablesorter.widgets.min.js @@ -1,16 +1,16 @@ -/*! tableSorter 2.8+ widgets - updated 10/18/2013 */ +/*! tableSorter 2.8+ widgets - updated 10/30/2013 */ ;(function(g){ var d=g.tablesorter=g.tablesorter||{}; d.themes={bootstrap:{table:"table table-bordered table-striped",header:"bootstrap-header",footerRow:"",footerCells:"",icons:"",sortNone:"bootstrap-icon-unsorted",sortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",sortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",active:"",hover:"",filterRow:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",header:"ui-widget-header ui-corner-all ui-state-default",footerRow:"", footerCells:"",icons:"ui-icon",sortNone:"ui-icon-carat-2-n-s",sortAsc:"ui-icon-carat-1-n",sortDesc:"ui-icon-carat-1-s",active:"ui-state-active",hover:"ui-state-hover",filterRow:"",even:"ui-widget-content",odd:"ui-state-default"}}; d.storage=function(f,c,b,a){var e,d=!1;e={};var k=f.config,m=a&&a.id||g(f).attr(a&&a.group||"data-table-group")||f.id||g(".tablesorter").index(g(f));a=a&&a.url||g(f).attr(a&&a.page||"data-table-page")||k&&k.fixedUrl||window.location.pathname;if("localStorage"in window)try{window.localStorage.setItem("_tmptest", "temp"),d=!0,window.localStorage.removeItem("_tmptest")}catch(q){}g.parseJSON&&(d?e=g.parseJSON(localStorage[c]||"{}"):(e=document.cookie.split(/[;\s|=]/),f=g.inArray(c,e)+1,e=0!==f?g.parseJSON(e[f]||"{}"):{}));if((b||""===b)&&window.JSON&&JSON.hasOwnProperty("stringify"))e[a]||(e[a]={}),e[a][m]=b,d?localStorage[c]=JSON.stringify(e):(f=new Date,f.setTime(f.getTime()+31536E6),document.cookie=c+"="+JSON.stringify(e).replace(/\"/g,'"')+"; expires="+f.toGMTString()+"; path=/");else return e&&e[a]?e[a][m]: {}}; -d.addHeaderResizeEvent=function(f,c,b){b=g.extend({},{timer:250},b);var a=f.config,e=a.widgetOptions,d,k=function(){e.resize_flag=!0;d=[];a.$headers.each(function(){var a=g.data(this,"savedSizes"),b=this.offsetWidth,c=this.offsetHeight;if(b!==a[0]||c!==a[1])g.data(this,"savedSizes",[b,c]),d.push(this)});d.length&&a.$table.trigger("resize",[d]);e.resize_flag=!1};clearInterval(e.resize_timer);if(c)return e.resize_flag=!1;a.$headers.each(function(){g.data(this,"savedSizes",[this.offsetWidth,this.offsetHeight])}); e.resize_timer=setInterval(function(){e.resize_flag||k()},b.timer)}; -d.addWidget({id:"uitheme",priority:10,options:{uitheme:"jui"},format:function(f,c,b){var a,e,l,k,m=d.themes,q=c.$table,u="default"!==c.theme?c.theme:b.uitheme||"jui",h=m[m[u]?u:m[b.uitheme]?b.uitheme:"jui"],p=c.$headers,B="tr."+(b.stickyHeaders||"tablesorter-stickyHeader"),v=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;c.debug&&(a=new Date);q.hasClass("tablesorter-"+u)&&c.theme!==u&&f.hasInitialized||(""!==h.even&&(b.zebra[0]+=" "+h.even), ""!==h.odd&&(b.zebra[1]+=" "+h.odd),m=q.removeClass(""===c.theme?"":"tablesorter-"+c.theme).addClass("tablesorter-"+u+" "+h.table).find("tfoot"),m.length&&m.find("tr").addClass(h.footerRow).children("th, td").addClass(h.footerCells),p.addClass(h.header).filter(":not(.sorter-false)").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(a){g(this)["mouseenter"===a.type?"addClass":"removeClass"](h.hover)}),p.find(".tablesorter-wrapper").length||p.wrapInner('
    '), c.cssIcon&&p.find("."+d.css.icon).addClass(h.icons),q.hasClass("hasFilters")&&p.find(".tablesorter-filter-row").addClass(h.filterRow));g.each(p,function(a){l=g(this);k=d.css.icon?l.find("."+d.css.icon):l;this.sortDisabled?(l.removeClass(v),k.removeClass(v+" tablesorter-icon "+h.icons)):(m=q.hasClass("hasStickyHeaders")?q.find(B).find("th").eq(a).add(l):l,e=l.hasClass(d.css.sortAsc)?h.sortAsc:l.hasClass(d.css.sortDesc)?h.sortDesc:l.hasClass(d.css.header)?h.sortNone:"",l[e===h.sortNone?"removeClass": "addClass"](h.active),k.removeClass(v).addClass(e))});c.debug&&d.benchmark("Applying "+u+" theme",a)},remove:function(f,c,b){f=c.$table;c="object"===typeof b.uitheme?"jui":b.uitheme||"jui";b="object"===typeof b.uitheme?b.uitheme:d.themes[d.themes.hasOwnProperty(c)?c:"jui"];var a=f.children("thead").children(),e=b.sortNone+" "+b.sortDesc+" "+b.sortAsc;f.removeClass("tablesorter-"+c+" "+b.table).find(d.css.header).removeClass(b.header);a.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(b.hover+ " "+e+" "+b.active).find(".tablesorter-filter-row").removeClass(b.filterRow);a.find(".tablesorter-icon").removeClass(b.icons)}}); +d.addHeaderResizeEvent=function(f,c,b){b=g.extend({},{timer:250},b);var a=f.config,e=a.widgetOptions,d,k=function(){e.resize_flag=!0;d=[];a.$headers.each(function(){var a=g.data(this,"savedSizes")||[0,0],b=this.offsetWidth,c=this.offsetHeight;if(b!==a[0]||c!==a[1])g.data(this,"savedSizes",[b,c]),d.push(this)});d.length&&a.$table.trigger("resize",[d]);e.resize_flag=!1};a.$headers.each(function(){g.data(this,"savedSizes",[this.offsetWidth,this.offsetHeight])});clearInterval(e.resize_timer);if(c)return e.resize_flag= !1;e.resize_timer=setInterval(function(){e.resize_flag||k()},b.timer)}; +d.addWidget({id:"uitheme",priority:10,options:{uitheme:"jui"},format:function(f,c,b){var a,e,l,k,m=d.themes,q=c.$table,u="default"!==c.theme?c.theme:b.uitheme||"jui",h=m[m[u]?u:m[b.uitheme]?b.uitheme:"jui"],p=c.$headers,B="tr."+(b.stickyHeaders||"tablesorter-stickyHeader"),v=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;c.debug&&(a=new Date);q.hasClass("tablesorter-"+u)&&c.theme!==u&&f.hasInitialized||(""!==h.even&&(b.zebra[0]+=" "+ h.even),""!==h.odd&&(b.zebra[1]+=" "+h.odd),m=q.removeClass(""===c.theme?"":"tablesorter-"+c.theme).addClass("tablesorter-"+u+" "+h.table).find("tfoot"),m.length&&m.find("tr").addClass(h.footerRow).children("th, td").addClass(h.footerCells),p.addClass(h.header).filter(":not(.sorter-false)").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(a){g(this)["mouseenter"===a.type?"addClass":"removeClass"](h.hover)}),p.find(".tablesorter-wrapper").length||p.wrapInner('
    '), c.cssIcon&&p.find("."+d.css.icon).addClass(h.icons),q.hasClass("hasFilters")&&p.find(".tablesorter-filter-row").addClass(h.filterRow));g.each(p,function(a){l=g(this);k=d.css.icon?l.find("."+d.css.icon):l;this.sortDisabled?(l.removeClass(v),k.removeClass(v+" tablesorter-icon "+h.icons)):(m=q.hasClass("hasStickyHeaders")?q.find(B).find("th").eq(a).add(l):l,e=l.hasClass(d.css.sortAsc)?h.sortAsc:l.hasClass(d.css.sortDesc)?h.sortDesc:l.hasClass(d.css.header)?h.sortNone:"",l[e===h.sortNone?"removeClass": "addClass"](h.active),k.removeClass(v).addClass(e))});c.debug&&d.benchmark("Applying "+u+" theme",a)},remove:function(f,c,b){f=c.$table;c="object"===typeof b.uitheme?"jui":b.uitheme||"jui";b="object"===typeof b.uitheme?b.uitheme:d.themes[d.themes.hasOwnProperty(c)?c:"jui"];var a=f.children("thead").children(),e=b.sortNone+" "+b.sortDesc+" "+b.sortAsc;f.removeClass("tablesorter-"+c+" "+b.table).find(d.css.header).removeClass(b.header);a.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(b.hover+ " "+e+" "+b.active).find(".tablesorter-filter-row").removeClass(b.filterRow);a.find(".tablesorter-icon").removeClass(b.icons)}}); d.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(f,c,b){var a,e,l,k,m,q,u,h,p,B=c.$table,v=c.$tbodies,t=c.sortList,x=t.length,r=c.widgetColumns&&c.widgetColumns.hasOwnProperty("css")?c.widgetColumns.css||r:b&&b.hasOwnProperty("columns")?b.columns||r:r;q=r.length-1;u=r.join(" ");c.debug&&(m=new Date);for(p=0;p=]/g}},format:function(f, c,b){if(!c.$table.hasClass("hasFilters")&&(c.parsers||!c.parsers&&b.filter_serversideFiltering)){var a,e,l,k,m,q,u,h,p,B,v,t,x,r,w,s,n,E,A,F=d.formatFloat,N="",C=c.$headers,y=c.$table.addClass("hasFilters"),I=c.$tbodies,J=c.columns||c.$headers.filter("th").length,G,O,P,H=function(a){var e=g.isArray(a),s=e?a:d.getFilters(f),l=(s||[]).join("");e&&d.setFilters(y,s);b.filter_hideFilters&&y.find(".tablesorter-filter-row").trigger(""===l?"mouseleave":"mouseenter");if(N!==l||!1===a)if(y.trigger("filterStart", [s]),c.showProcessing)setTimeout(function(){Q(a,s,l);return!1},30);else return Q(a,s,l),!1},Q=function(K,k,q){var p,t,v,r,x,z,B,D,A,E;c.debug&&(B=new Date);for(l=0;l]=?/.test(m)){s=F(m.replace(b.filter_regex.nondigit,"").replace(b.filter_regex.operators,""),f);if(G[a]||"numeric"===c.parsers[a].type)w=c.parsers[a].format(""+m.replace(b.filter_regex.operators,""),f, C.eq(a),a),s=""===w||isNaN(w)?s:w;w=!G[a]&&"numeric"!==c.parsers[a].type||isNaN(s)||!c.cache[l].normalized[e]?isNaN(h)?F(h.replace(b.filter_regex.nondigit,""),f):F(h,f):c.cache[l].normalized[e][a];/>/.test(m)&&(z=/>=/.test(m)?w>=s:w>s);/A&&(z=D,D=A,A=z);z=w>=D&&w<=A||""===D||""===A?!0:!1}else/[\?|\*]/.test(m)||/\s+OR\s+/.test(k[a])? (s=m.replace(/\s+OR\s+/gi,"|"),!C.filter('[data-column="'+a+'"]:last').hasClass("filter-match")&&/\|/.test(s)&&(s="^("+s+")$"),z=RegExp(s.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(h)):(u=(h+n).indexOf(m),z=!b.filter_startsWith&&0<=u||b.filter_startsWith&&0===u);r=z?r?!0:!1:!1}p[e].style.display=r?"":"none";p.eq(e)[r?"removeClass":"addClass"](b.filter_filteredRow);if(v.length)v[r?"show":"hide"]()}d.processTbody(f,K,!1)}N=q;y.data("lastSearch",k);c.debug&&d.benchmark("Completed filter widget search", B);y.trigger("applyWidgets");y.trigger("filterEnd")},R=function(a,f,s){var m,h,n=[];a=parseInt(a,10);h=C.filter('[data-column="'+a+'"]:last');m='";for(l=0;l"+n[l]+"":"";y.find("thead").find('select.tablesorter-filter[data-column="'+a+'"]')[f?"html":"append"](m)},L=function(c){for(a=0;a';for(a=0;a";c.$filters=g(n+="").appendTo(y.find("thead").eq(0)).find("td");for(a=0;a").appendTo(c.$filters.eq(a)):(b.filter_formatter&&g.isFunction(b.filter_formatter[a])?((n=b.filter_formatter[a](c.$filters.eq(a),a))&&0===n.length&&(n=c.$filters.eq(a).children("input")),n&&(0===n.parent().length||n.parent().length&&n.parent()[0]!==c.$filters[a])&&c.$filters.eq(a).append(n)):n=g('').appendTo(c.$filters.eq(a)),n&&n.attr("placeholder",r.data("placeholder")||r.attr("data-placeholder")||"")),n&&(n.addClass("tablesorter-filter "+ b.filter_cssFilter).attr("data-column",a),E&&(n.addClass("disabled")[0].disabled=!0))}y.bind("addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(".tsfilter "),function(a,b){/(search|filterReset|filterEnd)/.test(a.type)||(a.stopPropagation(),L(!0));"filterReset"===a.type&&M([]);"filterEnd"===a.type?L(!0):(b="search"===a.type?b:"updateComplete"===a.type?y.data("lastSearch"):"",M(b));return!1}).find("input.tablesorter-filter").bind("keyup search", function(a,c){if(27===a.which)this.value="";else if("number"===typeof b.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===b.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===b.filter_liveSearch))return;M(c)});G=C.map(function(a){return d.getData?"parsed"===d.getData(C.filter('[data-column="'+a+'"]:last'),c.headers[a],"filter"):g(this).hasClass("filter-parsed")}).get();b.filter_reset&&g(document).delegate(b.filter_reset, "click.tsfilter",function(){y.trigger("filterReset")});if(b.filter_functions)for(A in b.filter_functions)if(b.filter_functions.hasOwnProperty(A)&&"string"===typeof A)if(n=C.filter('[data-column="'+A+'"]:last'),q="",!0===b.filter_functions[A]&&!n.hasClass("filter-false"))R(A);else if("string"===typeof A&&!n.hasClass("filter-false")){for(v in b.filter_functions[A])"string"===typeof v&&(q+=""===q?'":"",q+='");y.find("thead").find('select.tablesorter-filter[data-column="'+A+'"]').append(q)}L(!0);y.find("select.tablesorter-filter").bind("change search",function(a,b){H(b)});b.filter_hideFilters&&y.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var b;t=g(this);clearTimeout(p);p=setTimeout(function(){/enter|over/.test(a.type)?t.removeClass("hideme"):g(document.activeElement).closest("tr")[0]!==t[0]&&(b=y.find(".tablesorter-filter").map(function(){return g(this).val()|| ""}).get().join(""),""===b&&t.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){x=g(this).closest("tr");clearTimeout(p);p=setTimeout(function(){if(""===y.find(".tablesorter-filter").map(function(){return g(this).val()||""}).get().join(""))x["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});c.showProcessing&&y.bind("filterStart.tsfilter filterEnd.tsfilter",function(a,b){var c=b?y.find("."+d.css.header).filter("[data-column]").filter(function(){return""!==b[g(this).data("column")]}): "";d.isProcessing(y[0],"filterStart"===a.type,b?c:"")});c.debug&&d.benchmark("Applying Filter widget",O);y.bind("tablesorter-initialized",function(){if(q=d.getFilters(f)){for(a=0;a=]/g}},format:function(f, c,b){if(!c.$table.hasClass("hasFilters")&&(c.parsers||!c.parsers&&b.filter_serversideFiltering)){var a,e,l,k,m,q,u,h,p,B,v,t,x,r,w,s,n,E,A,F=d.formatFloat,N="",C=c.$headers,y=c.$table.addClass("hasFilters"),I=c.$tbodies,J=c.columns||c.$headers.filter("th").length,G,O,P,H=function(a){var e=g.isArray(a),s=e?a:d.getFilters(f),l=(s||[]).join("");e&&d.setFilters(y,s);b.filter_hideFilters&&y.find(".tablesorter-filter-row").trigger(""===l?"mouseleave":"mouseenter");if(N!==l||!1===a)if(y.trigger("filterStart", [s]),c.showProcessing)setTimeout(function(){Q(a,s,l);return!1},30);else return Q(a,s,l),!1},Q=function(K,k,q){var p,t,v,r,x,z,B,D,A,E;c.debug&&(B=new Date);for(l=0;l]=?/.test(m)){s=F(m.replace(b.filter_regex.nondigit,"").replace(b.filter_regex.operators,""),f);if(G[a]||"numeric"===c.parsers[a].type)w=c.parsers[a].format(""+m.replace(b.filter_regex.operators,""),f, C.eq(a),a),s=""===w||isNaN(w)?s:w;w=!G[a]&&"numeric"!==c.parsers[a].type||isNaN(s)||!c.cache[l].normalized[e]?isNaN(h)?F(h.replace(b.filter_regex.nondigit,""),f):F(h,f):c.cache[l].normalized[e][a];/>/.test(m)&&(z=/>=/.test(m)?w>=s:w>s);/A&&(z=D,D=A,A=z);z=w>=D&&w<=A||""===D||""===A?!0:!1}else/[\?|\*]/.test(m)||/\s+OR\s+/.test(k[a])? (s=m.replace(/\s+OR\s+/gi,"|"),!C.filter('[data-column="'+a+'"]:last').hasClass("filter-match")&&/\|/.test(s)&&(s="^("+s+")$"),z=RegExp(s.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(h)):(u=(h+n).indexOf(m),z=!b.filter_startsWith&&0<=u||b.filter_startsWith&&0===u);r=z?r?!0:!1:!1}p[e].style.display=r?"":"none";p.eq(e)[r?"removeClass":"addClass"](b.filter_filteredRow);if(v.length)v[r?"show":"hide"]()}d.processTbody(f,K,!1)}N=q;y.data("lastSearch",k);c.debug&&d.benchmark("Completed filter widget search", B);y.trigger("applyWidgets");y.trigger("filterEnd")},R=function(a,f,s){var m,h,n=[];a=parseInt(a,10);h=C.filter('[data-column="'+a+'"]:last');m='";for(l=0;l"+n[l]+"":"";y.find("thead").find('select.tablesorter-filter[data-column="'+a+'"]')[f?"html":"append"](m)},L=function(c){for(a=0;a';for(a=0;a";c.$filters=g(n+="").appendTo(y.find("thead").eq(0)).find("td");for(a=0;a").appendTo(c.$filters.eq(a)):(b.filter_formatter&&g.isFunction(b.filter_formatter[a])?((n=b.filter_formatter[a](c.$filters.eq(a),a))&&0===n.length&&(n=c.$filters.eq(a).children("input")),n&&(0===n.parent().length||n.parent().length&&n.parent()[0]!==c.$filters[a])&&c.$filters.eq(a).append(n)):n=g('').appendTo(c.$filters.eq(a)),n&&n.attr("placeholder",r.data("placeholder")||r.attr("data-placeholder")||"")),n&&(n.addClass("tablesorter-filter "+ b.filter_cssFilter).attr("data-column",a),E&&(n.addClass("disabled")[0].disabled=!0))}y.bind("addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(".tsfilter "),function(a,b){/(search|filterReset|filterEnd)/.test(a.type)||(a.stopPropagation(),L(!0));"filterReset"===a.type&&M([]);"filterEnd"===a.type?L(!0):(b="search"===a.type?b:"updateComplete"===a.type?y.data("lastSearch"):"",M(b));return!1}).find("input.tablesorter-filter").bind("keyup search", function(a,c){if(27===a.which)this.value="";else if("number"===typeof b.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===b.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===b.filter_liveSearch))return;M(c)});G=C.map(function(a){return d.getData?"parsed"===d.getData(C.filter('[data-column="'+a+'"]:last'),c.headers[a],"filter"):g(this).hasClass("filter-parsed")}).get();b.filter_reset&&g(document).delegate(b.filter_reset, "click.tsfilter",function(){y.trigger("filterReset")});if(b.filter_functions)for(A in b.filter_functions)if(b.filter_functions.hasOwnProperty(A)&&"string"===typeof A)if(n=C.filter('[data-column="'+A+'"]:last'),q="",!0===b.filter_functions[A]&&!n.hasClass("filter-false"))R(A);else if("string"===typeof A&&!n.hasClass("filter-false")){for(v in b.filter_functions[A])"string"===typeof v&&(q+=""===q?'":"",q+='");y.find("thead").find('select.tablesorter-filter[data-column="'+A+'"]').append(q)}L(!0);y.find("select.tablesorter-filter").bind("change search",function(a,b){H(b)});b.filter_hideFilters&&y.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var b;t=g(this);clearTimeout(p);p=setTimeout(function(){/enter|over/.test(a.type)?t.removeClass("hideme"):g(document.activeElement).closest("tr")[0]!==t[0]&&(b=y.find(".tablesorter-filter").map(function(){return g(this).val()|| ""}).get().join(""),""===b&&t.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){x=g(this).closest("tr");clearTimeout(p);p=setTimeout(function(){if(""===y.find(".tablesorter-filter").map(function(){return g(this).val()||""}).get().join(""))x["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});c.showProcessing&&y.bind("filterStart.tsfilter filterEnd.tsfilter",function(a,b){var c=b?y.find("."+d.css.header).filter("[data-column]").filter(function(){return""!==b[g(this).data("column")]}): "";d.isProcessing(y[0],"filterStart"===a.type,b?c:"")});c.debug&&d.benchmark("Applying Filter widget",O);y.bind("tablesorter-initialized",function(){if(q=d.getFilters(f)){for(a=0;ad.top&&fa.which&&8!==a.which||37<=a.which&&40>=a.which)){r=!0;a=g(this);var d=a.attr("data-column");c.$filters.find(".tablesorter-filter").eq(d).val(a.val()).trigger("search");setTimeout(function(){r=!1},b.filter_searchDelay)}});a.trigger("stickyHeadersInit")}},remove:function(f,c,b){c.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find(".tablesorter-stickyHeader").remove();b.$sticky&&b.$sticky.length&& b.$sticky.remove();g(".hasStickyHeaders").length||g(window).unbind("scroll.tsSticky resize.tsSticky");d.addHeaderResizeEvent(f,!1)}}); d.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(f,c,b){if(!c.$table.hasClass("hasResizable")){c.$table.addClass("hasResizable");var a,e,l,k,m={},q,u,h,p,B=c.$table,v=0,t=null,x=null,r=20>Math.abs(B.parent().width()-B.width()),w=function(){d.storage&&t&&(m[t.index()]=t.width(),m[x.index()]=x.width(),t.width(m[t.index()]), x.width(m[x.index()]),!1!==b.resizable&&d.storage(f,"tablesorter-resizable",m));v=0;t=x=null;g(window).trigger("resize")};if(m=d.storage&&!1!==b.resizable?d.storage(f,"tablesorter-resizable"):{})for(k in m)!isNaN(k)&&k');b.resizable_addLastColumn||(q=q.slice(0,-1));u=u?u.add(q):q});u.each(function(){a=g(this);k=parseInt(a.css("padding-right"),10)+10;e='
    ';a.find(".tablesorter-wrapper").append(e)}).bind("mousemove.tsresize", function(a){0!==v&&t&&(h=a.pageX-v,p=t.width(),t.width(p+h),t.width()!==p&&r&&x.width(x.width()-h),v=a.pageX)}).bind("mouseup.tsresize",function(){w()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown",function(a){t=g(a.target).closest("th");e=c.$headers.filter('[data-column="'+t.attr("data-column")+'"]');1