From 6eb36a653278526e47097969165d6167800b812a Mon Sep 17 00:00:00 2001 From: Mottie Date: Fri, 4 Jan 2013 12:10:17 -0600 Subject: [PATCH] Fixed pager + filter problems reported in issue #207. --- README.md | 47 +++++++------------- addons/pager/jquery.tablesorter.pager.js | 16 ++++--- addons/pager/jquery.tablesorter.pager.min.js | 4 +- js/jquery.tablesorter.js | 6 +-- js/jquery.tablesorter.min.js | 4 +- js/jquery.tablesorter.widgets.js | 2 +- js/jquery.tablesorter.widgets.min.js | 21 +++++---- package.json | 2 +- 8 files changed, 44 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 0ac9a841..fcbb98cf 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,21 @@ 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.7.1 (1/4/2013) + +* Added two internal parameters to always make sure we're targeting the correct elements. + * Added `table.config.$table` which is a jQuery object of the table. + * Added `table.config.$tbodies` which is a jQuery object of sortable tbodies; the ones without the class name in the `cssInfoBlock` option. +* Fixed removal methods: + * Tablesorter destroy will now properly restore the header and remove all bindings. + * Widgets should now again be removed properly. + * Updated the storage utility to allow setting a property to an empty string, previously it was just ignored. +* Fixed pager issues: + * Pager status will now update properly while filtering rows. + * Pager status will also update properly after sorting filtered rows. + * The above issues were fixes for [issue #207](https://github.com/Mottie/tablesorter/issues/207). + * Fixed the pager's `fixedHeight` option to again properly pad the table to maintain the height. + #### Version 2.7 (12/26/2012) * Added `headerTemplate` option: @@ -113,35 +128,3 @@ View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Chan * Added `footerRow` and `footerCells` to the tablesorter themes (`$.tablesorter.themes`): * This allows styling of the footer in the bootstrap and jQuery UI themes. * Used by the `uitheme` widget. - -#### Version 2.5.2 (11/27/2012) - -* Fixed an issue with the pager making recursive ajax calls. Fixes [issue #182](https://github.com/Mottie/tablesorter/issues/182). - -#### Version 2.5.1 (11/26/2012) - -* Fixed a serious bug which occurrs in IE: - * This bug is related to the multi-column sorting changes made in v2.5 - I swear I'll add unit testing soon! - * This problem appeared to occur in all versions of IE. - * See [issue #181](https://github.com/Mottie/tablesorter/issues/181) for details. -* Updated the grey and bootstrap themes: - * The w3c recommendations for linear gradients are now being followed ([ref](http://dev.w3.org/csswg/css3-images/#linear-gradients)) - added a "to" to the position. - * Fixed the older IE filter for gradients. Apparently `startColorstr='#555'` is a different color than `startColorstr='#555555'`. - -#### Version 2.5 (11/22/2012) - -* Improved multi-column sorting - * Huge thanks to [Nick Craver](https://github.com/NickCraver) for making multicolumn sorting no longer uses an `eval()` during the sort! - * This change improves performance of the sort across all browsers. - * It also allows use of numerous minifier scripts. - * See [pull request #177](https://github.com/Mottie/tablesorter/pull/177) for more details. -* Fixed using `addRows` on an empty table, [issue #179](https://github.com/Mottie/tablesorter/issues/179). -* Fixed inconsistencies in the usage of sort up (ascending) and sort down (descending) in the javascript and css. - * Updated the `cssAsc` default value to `tablesorter-headerAsc`. - * Updated the `cssDesc` default value to `tablesorter-headerDesc`. - * All css themes now include these new class names. References to older class names were not removed, but they will be removed in version 3. - * Renamed image files and switched data URIs to match these changes. - * This fixes [issue #173](https://github.com/Mottie/tablesorter/issues/173). Thanks [bitti](https://github.com/bitti)! -* Updated all theme css files to use image data URIs instead of the images. - * The images are all still contained in the `css/images` directory. - * References to the image files have been commented out instead of removed. diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 45077a2f..f7a05546 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 12/26/2012 + * updated 1/4/2013 */ /*jshint browser:true, jquery:true, unused:false */ ;(function($) { @@ -94,7 +94,7 @@ updatePageDisplay = function(table, c) { var i, p, s, t, out, f = $(table).hasClass('hasFilters') && !c.ajaxUrl; - c.filteredRows = (f) ? $(table).find('tbody tr:not(.filtered)').length : c.totalRows; + c.filteredRows = (f) ? table.config.$tbodies.children('tr:not(.filtered,.remove-me)').length : c.totalRows; c.filteredPages = (f) ? Math.ceil( c.filteredRows / c.size ) : c.totalPages; if ( Math.min( c.totalPages, c.filteredPages ) > 0 ) { t = (c.size * c.page > c.filteredRows); @@ -138,7 +138,7 @@ if (h) { d = h - $b.height(); if ( d > 5 && $.data(table, 'pagerLastSize') === c.size && $b.children('tr:visible').length < c.size ) { - $b.append(''); + $b.append(''); } } } @@ -188,9 +188,9 @@ var i, j, hsh, $f, $sh, $t = $(table), tc = table.config, - $b = $(table.tBodies).filter(':not(.' + tc.cssInfoBlock + ')'), + $b = c.$tbodies, hl = $t.find('thead th').length, tds = '', - err = '' + + err = '' + (exception ? exception.message + ' (' + exception.name + ')' : 'No rows found') + '', result = c.ajaxProcessing(data) || [ 0, [] ], d = result[1] || [], @@ -302,6 +302,7 @@ }, renderTable = function(table, rows, c) { + c.isDisabled = false; // needed because sorting will change the page and re-enable the pager var i, j, o, f = document.createDocumentFragment(), l = rows.length, @@ -454,6 +455,7 @@ $t .unbind('filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager') .bind('filterStart.pager', function(e, filters) { + $.data(table, 'pagerUpdateTriggered', false); c.currentFilters = filters; }) // update pager after filter widget completes @@ -466,7 +468,7 @@ if (e.type === 'filterEnd') { c.page = 0; } updatePageDisplay(table, c); moveToPage(table, c); - changeHeight(table, c); + fixHeight(table, c); }) .bind('disable.pager', function(){ showAllRows(table, c); @@ -544,6 +546,8 @@ hideRowsSetup(table, c); } + changeHeight(table, c); + // pager initialized if (!c.ajax) { c.initialized = true; diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index 0afdd05a..6249b976 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 12/26/2012 */ -;(function(d){d.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,ajaxProcessing:function(){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,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}; var p=this,s=function(b,a){var c=b.cssDisabled,f=!!a,h=Math.min(b.totalPages,b.filteredPages);b.updateArrows&&(d(b.cssFirst+","+b.cssPrev,b.container)[f||0===b.page?"addClass":"removeClass"](c),d(b.cssNext+","+b.cssLast,b.container)[f||b.page===h-1?"addClass":"removeClass"](c))},t=function(b,a){var c,f,h;c=d(b).hasClass("hasFilters")&&!a.ajaxUrl;a.filteredRows=c?d(b).find("tbody tr:not(.filtered)").length:a.totalRows;a.filteredPages=c?Math.ceil(a.filteredRows/a.size):a.totalPages;if(0a.filteredRows,a.startRow=h?1: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=d(a.cssPageDisplay,a.container),c=a.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(b){return{"{page}":a.page+1,"{filteredRows}":a.filteredRows,"{filteredPages}":a.filteredPages,"{totalPages}":a.totalPages,"{startRow}":a.startRow,"{endRow}":a.endRow,"{totalRows}":a.totalRows}[b]}), f[0]&&(f["INPUT"===f[0].tagName?"val":"html"](c),d(a.cssGoto,a.container).length))){h="";f=Math.min(a.totalPages,a.filteredPages);for(c=1;c<=f;c++)h+="";d(a.cssGoto,a.container).html(h).val(a.page+1)}s(a);a.initialized&&d(b).trigger("pagerComplete",a)},u=function(b,a){var c,f=d(b.tBodies[0]);if(a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=d.data(b,"pagerSavedHeight")))c-=f.height(),5')},w=function(b,a){var c=d(b.tBodies[0]);c.find("tr.pagerSavedHeightSpacer").remove();d.data(b,"pagerSavedHeight",c.height());u(b,a);d.data(b,"pagerLastSize",a.size)},n=function(b,a){if(!a.ajaxUrl){var c,f=d(b.tBodies).children("tr:not(."+b.config.cssChildRow+")"),h=f.length,e=a.page*a.size,g=e+a.size,k=0;for(c=0;c=e&&k'+(f?f.message+ " ("+f.name+")":"No rows found")+"",n=c.ajaxProcessing(b)||[0,[]],p=n[1]||[],s=p.length,r=n[2];if(0";for(h=0;h"+p[b][h]+"";q+=""}r&&r.length===y&&(e=j.hasClass("hasStickyHeaders"),k=j.find("."+(l.widgetOptions&&l.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),g=j.find("tfoot tr:first").children(),j.find("th."+l.cssHeader).each(function(a){var b=d(this),c;b.find("."+l.cssIcon).length?(c=b.find("."+l.cssIcon).clone(!0), b.find(".tablesorter-header-inner").html(r[a]).append(c),e&&k.length&&(c=k.find("th").eq(a).find("."+l.cssIcon).clone(!0),k.find("th").eq(a).find(".tablesorter-header-inner").html(r[a]).append(c))):(b.find(".tablesorter-header-inner").html(r[a]),k.find("th").eq(a).find(".tablesorter-header-inner").html(r[a]));g.eq(a).html(r[a])}));j.find("thead tr."+c.cssErrorRow).remove();f?j.find("thead").append(m):E.html(q);l.showProcessing&&d.tablesorter.isProcessing(a);j.trigger("update");c.totalRows=n[0]||0; c.totalPages=Math.ceil(c.totalRows/c.size);t(a,c);u(a,c);c.initialized&&j.trigger("pagerChange",c)}c.initialized||(c.initialized=!0,d(a).trigger("pagerInitialized",c))},v=function(b,a,c){var f,h,e,g=document.createDocumentFragment(),k=a.length;f=c.page*c.size;var j=f+c.size;if(!(1>k)){c.initialized&&d(b).trigger("pagerChange",c);if(c.removeRows){j>a.length&&(j=a.length);d(b.tBodies[0]).addClass("tablesorter-hidden");for(d.tablesorter.clearTableBody(b);f=c.totalPages&&A(b,c);t(b,c);c.isDisabled||u(b,c);d(b).trigger("applyWidgets")}},B=function(b,a){a.ajax?s(a,!0):(a.isDisabled=!0,d.data(b,"pagerLastPage",a.page),d.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,d("tr.pagerSavedHeightSpacer",b.tBodies[0]).remove(),v(b,b.config.rowsCopy,a));d(a.container).find(a.cssPageSize+","+a.cssGoto).each(function(){d(this).addClass(a.cssDisabled)[0].disabled=!0})}, m=function(b,a){if(!a.isDisabled){var c=Math.min(a.totalPages,a.filteredPages);if(0>a.page||a.page>c-1)a.page=0;if(a.ajax){var f,c=a.ajaxUrl?a.ajaxUrl.replace(/\{page\}/g,a.page).replace(/\{size\}/g,a.size):"",h=b.config.sortList,e=a.currentFilters||[],g=c.match(/\{sortList[\s+]?:[\s+]?([^}]*)\}/),k=c.match(/\{filterList[\s+]?:[\s+]?([^}]*)\}/),j=[];g&&(g=g[1],d.each(h,function(a,b){j.push(g+"["+b[0]+"]="+b[1])}),c=c.replace(/\{sortList[\s+]?:[\s+]?([^\}]*)\}/g,j.length?j.join("&"):g));k&&(k=k[1], d.each(e,function(a,b){b&&j.push(k+"["+a+"]="+encodeURIComponent(b))}),c=c.replace(/\{filterList[\s+]?:[\s+]?([^\}]*)\}/g,j.length?j.join("&"):k));f=c;c=b.config;""!==f&&(c.showProcessing&&d.tablesorter.isProcessing(b,!0),d(document).bind("ajaxError.pager",function(c,e,g,h){g.url===f&&(z(null,b,a,h),d(document).unbind("ajaxError.pager"))}),d.getJSON(f,function(c){z(c,b,a);d(document).unbind("ajaxError.pager")}))}else a.ajax||v(b,b.config.rowsCopy,a);d.data(b,"pagerLastPage",a.page);d.data(b,"pagerUpdateTriggered", !0);a.initialized&&d(b).trigger("pageMoved",a)}},C=function(b,a,c){c.size=a;d.data(b,"pagerLastPage",c.page);d.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);m(b,c)},F=function(b,a){a.page=0;m(b,a)},A=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;m(b,a)},G=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);m(b,a)},H=function(b,a){a.page--;0>=a.page&&(a.page=0);m(b,a)},D=function(b,a, c){var f=d(a.cssPageSize,a.container).removeClass(a.cssDisabled).removeAttr("disabled");d(a.container).find(a.cssGoto).removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=d.data(b,"pagerLastPage")||a.page||0;a.size=d.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);c&&(d(b).trigger("update"),C(b,a.size,a),x(b,a),u(b,a))};p.appender=function(b,a){var c=b.config.pager; c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=d.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/c.size),v(b,a,c))};p.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,f,h=this.config,e=h.pager=d.extend({},d.tablesorterPager.defaults,b),g=this,k=g.config,j=d(g),l=d(e.container).addClass("tablesorter-pager").show();h.appender=p.appender;j.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager").bind("filterStart.pager", function(a,b){e.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(a){d.data(g,"pagerUpdateTriggered")?d.data(g,"pagerUpdateTriggered",!1):("filterEnd"===a.type&&(e.page=0),t(g,e),m(g,e),w(g,e))}).bind("disable.pager",function(){B(g,e)}).bind("enable.pager",function(){D(g,e,!0)}).bind("destroy.pager",function(){B(g,e);d(e.container).hide();g.config.appender=null;d(g).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager",function(){n(g, e)});c=[e.cssFirst,e.cssPrev,e.cssNext,e.cssLast];f=[F,H,G,A];l.find(c.join(",")).unbind("click.pager").bind("click.pager",function(){var a,b=d(this),h=c.length;if(!b.hasClass(e.cssDisabled))for(a=0;aa.filteredRows,a.startRow=h?1: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=d(a.cssPageDisplay,a.container),c=a.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(b){return{"{page}":a.page+1,"{filteredRows}":a.filteredRows,"{filteredPages}":a.filteredPages,"{totalPages}":a.totalPages,"{startRow}":a.startRow,"{endRow}":a.endRow,"{totalRows}":a.totalRows}[b]}), f[0]&&(f["INPUT"===f[0].tagName?"val":"html"](c),d(a.cssGoto,a.container).length))){h="";f=Math.min(a.totalPages,a.filteredPages);for(c=1;c<=f;c++)h+="";d(a.cssGoto,a.container).html(h).val(a.page+1)}s(a);a.initialized&&d(b).trigger("pagerComplete",a)},t=function(b,a){var c,f=d(b.tBodies[0]);if(a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=d.data(b,"pagerSavedHeight")))c-=f.height(),5')},w=function(b,a){var c=d(b.tBodies[0]);c.find("tr.pagerSavedHeightSpacer").remove();d.data(b,"pagerSavedHeight",c.height());t(b,a);d.data(b,"pagerLastSize",a.size)},n=function(b,a){if(!a.ajaxUrl){var c,f=d(b.tBodies).children("tr:not(."+b.config.cssChildRow+")"),h=f.length,e=a.page*a.size,g=e+a.size,k=0;for(c=0;c=e&& k'+(f?f.message+" ("+f.name+")":"No rows found")+"",n=c.ajaxProcessing(b)||[0,[]],p=n[1]||[],s=p.length,r=n[2];if(0";for(h=0;h"+p[b][h]+"";q+=""}r&&r.length===y&&(e=j.hasClass("hasStickyHeaders"),k=j.find("."+(l.widgetOptions&&l.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),g=j.find("tfoot tr:first").children(),j.find("th."+l.cssHeader).each(function(a){var b=d(this),c;b.find("."+l.cssIcon).length?(c=b.find("."+ l.cssIcon).clone(!0),b.find(".tablesorter-header-inner").html(r[a]).append(c),e&&k.length&&(c=k.find("th").eq(a).find("."+l.cssIcon).clone(!0),k.find("th").eq(a).find(".tablesorter-header-inner").html(r[a]).append(c))):(b.find(".tablesorter-header-inner").html(r[a]),k.find("th").eq(a).find(".tablesorter-header-inner").html(r[a]));g.eq(a).html(r[a])}));j.find("thead tr."+c.cssErrorRow).remove();f?j.find("thead").append(m):E.html(q);l.showProcessing&&d.tablesorter.isProcessing(a);j.trigger("update"); c.totalRows=n[0]||0;c.totalPages=Math.ceil(c.totalRows/c.size);u(a,c);t(a,c);c.initialized&&j.trigger("pagerChange",c)}c.initialized||(c.initialized=!0,d(a).trigger("pagerInitialized",c))},v=function(b,a,c){c.isDisabled=!1;var f,h,e,g=document.createDocumentFragment(),k=a.length;f=c.page*c.size;var j=f+c.size;if(!(1>k)){c.initialized&&d(b).trigger("pagerChange",c);if(c.removeRows){j>a.length&&(j=a.length);d(b.tBodies[0]).addClass("tablesorter-hidden");for(d.tablesorter.clearTableBody(b);f=c.totalPages&&A(b,c);u(b,c);c.isDisabled||t(b,c);d(b).trigger("applyWidgets")}},B=function(b,a){a.ajax?s(a,!0):(a.isDisabled=!0,d.data(b,"pagerLastPage",a.page),d.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,d("tr.pagerSavedHeightSpacer",b.tBodies[0]).remove(),v(b,b.config.rowsCopy,a));d(a.container).find(a.cssPageSize+","+ a.cssGoto).each(function(){d(this).addClass(a.cssDisabled)[0].disabled=!0})},m=function(b,a){if(!a.isDisabled){var c=Math.min(a.totalPages,a.filteredPages);if(0>a.page||a.page>c-1)a.page=0;if(a.ajax){var f,c=a.ajaxUrl?a.ajaxUrl.replace(/\{page\}/g,a.page).replace(/\{size\}/g,a.size):"",h=b.config.sortList,e=a.currentFilters||[],g=c.match(/\{sortList[\s+]?:[\s+]?([^}]*)\}/),k=c.match(/\{filterList[\s+]?:[\s+]?([^}]*)\}/),j=[];g&&(g=g[1],d.each(h,function(a,b){j.push(g+"["+b[0]+"]="+b[1])}),c=c.replace(/\{sortList[\s+]?:[\s+]?([^\}]*)\}/g, j.length?j.join("&"):g));k&&(k=k[1],d.each(e,function(a,b){b&&j.push(k+"["+a+"]="+encodeURIComponent(b))}),c=c.replace(/\{filterList[\s+]?:[\s+]?([^\}]*)\}/g,j.length?j.join("&"):k));f=c;c=b.config;""!==f&&(c.showProcessing&&d.tablesorter.isProcessing(b,!0),d(document).bind("ajaxError.pager",function(c,e,g,h){g.url===f&&(z(null,b,a,h),d(document).unbind("ajaxError.pager"))}),d.getJSON(f,function(c){z(c,b,a);d(document).unbind("ajaxError.pager")}))}else a.ajax||v(b,b.config.rowsCopy,a);d.data(b,"pagerLastPage", a.page);d.data(b,"pagerUpdateTriggered",!0);a.initialized&&d(b).trigger("pageMoved",a)}},C=function(b,a,c){c.size=a;d.data(b,"pagerLastPage",c.page);d.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);m(b,c)},F=function(b,a){a.page=0;m(b,a)},A=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;m(b,a)},G=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);m(b,a)},H=function(b,a){a.page--;0>=a.page&& (a.page=0);m(b,a)},D=function(b,a,c){var f=d(a.cssPageSize,a.container).removeClass(a.cssDisabled).removeAttr("disabled");d(a.container).find(a.cssGoto).removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=d.data(b,"pagerLastPage")||a.page||0;a.size=d.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);c&&(d(b).trigger("update"),C(b,a.size,a),x(b,a),t(b,a))};p.appender= function(b,a){var c=b.config.pager;c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=d.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/c.size),v(b,a,c))};p.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,f,h=this.config,e=h.pager=d.extend({},d.tablesorterPager.defaults,b),g=this,k=g.config,j=d(g),l=d(e.container).addClass("tablesorter-pager").show();h.appender=p.appender;j.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager").bind("filterStart.pager", function(a,b){d.data(g,"pagerUpdateTriggered",!1);e.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(a){d.data(g,"pagerUpdateTriggered")?d.data(g,"pagerUpdateTriggered",!1):("filterEnd"===a.type&&(e.page=0),u(g,e),m(g,e),t(g,e))}).bind("disable.pager",function(){B(g,e)}).bind("enable.pager",function(){D(g,e,!0)}).bind("destroy.pager",function(){B(g,e);d(e.container).hide();g.config.appender=null;d(g).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager", function(){n(g,e)});c=[e.cssFirst,e.cssPrev,e.cssNext,e.cssLast];f=[F,H,G,A];l.find(c.join(",")).unbind("click.pager").bind("click.pager",function(){var a,b=d(this),h=c.length;if(!b.hasClass(e.cssDisabled))for(a=0;a thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.benchmark=v;e.construct=function(c){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=g(this),a,f,h,s="",j,m,l,n,D=g.metadata;this.hasInitialized= !1;this.config={};a=g.extend(!0,this.config,e.defaults,c);g.data(this,"tablesorter",a);a.debug&&g.data(this,"startoveralltimer",new Date);a.supportsTextContent="x"===g("x")[0].textContent;a.supportsDataObject=1.4<=parseFloat(g.fn.jquery);a.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(s=""!==a.theme?" tablesorter-"+a.theme:"");b.addClass(a.tableClass+s);var r=[],P={},y=g(this).find("thead:eq(0), tfoot").children("tr"), I,J,x,z,N,B,K,Q,R,G;for(I=0;I':"";r=g(this).find(w.selectorHeaders).each(function(a){A=g(this);L=w.headers[a];w.headerContent[a]=this.innerHTML;M=w.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,S);w.onRenderTemplate&&(O=w.onRenderTemplate.apply(A,[a,M]))&&"string"===typeof O&&(M=O);this.innerHTML='
'+M+"
";w.onRenderHeader&&w.onRenderHeader.apply(A,[a]);this.column=P[this.parentNode.rowIndex+"-"+this.cellIndex];var b=e.getData(A,L,"sortInitialOrder")|| w.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;"false"===e.getData(A,L,"sorter")?(this.sortDisabled=!0,A.addClass("sorter-false")):A.removeClass("sorter-false");this.lockedOrder=!1;H=e.getData(A,L,"lockedOrder")||!1;"undefined"!==typeof H&&!1!==H&&(this.order=this.lockedOrder=/^d/i.test(H)||1===H?[1,1,1]:[0,0,0]);A.addClass((this.sortDisabled?"sorter-false ":" ")+w.cssHeader);w.headerList[a]=this;A.parent().addClass(w.cssHeaderRow)});this.config.debug&&(v("Built headers:", T),d(r));a.$headers=r;a.parsers=k(this);a.delayInit||q(this);a.$headers.find("*").andSelf().filter(a.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(c,d){var k=(this.tagName.match("TH|TD")?g(this):g(this).parents("th, td").filter(":last"))[0];if(1!==(c.which||c.button))return!1;if("mousedown"===c.type)return n=(new Date).getTime(),"INPUT"===c.target.tagName?"":!a.cancelSelection;if(!0!==d&&250<(new Date).getTime()-n)return!1; a.delayInit&&!a.cache&&q(b[0]);if(!k.sortDisabled){b.trigger("sortStart",b[0]);s=!c[a.sortMultiSortKey];k.count=c[a.sortResetKey]?2:(k.count+1)%(a.sortReset?3:2);a.sortRestart&&(f=k,a.$headers.each(function(){if(this!==f&&(s||!g(this).is("."+a.cssDesc+",."+a.cssAsc)))this.count=-1}));f=k.column;if(s){a.sortList=[];if(null!==a.sortForce){j=a.sortForce;for(h=0;hl&&(a.sortList.push([f,l]),1l&&(a.sortList.push([f,l]),1"),V=g(this).width();g("tr:first td",this.tBodies[0]).each(function(){U.append(g("").css("width",parseInt(1E3*(g(this).width()/V),10)/10+"%"))});g(this).prepend(U)}a.showProcessing&&b.unbind("sortBegin sortEnd").bind("sortBegin sortEnd", function(a){e.isProcessing(b[0],"sortBegin"===a.type)});this.hasInitialized=!0;a.debug&&e.benchmark("Overall initialization time",g.data(this,"startoveralltimer"));b.trigger("tablesorter-initialized",this);"function"===typeof a.initialized&&a.initialized(this)})};e.isProcessing=function(c,b,a){var f=c.config;c=a||g(c).find("."+f.cssHeader);b?(0'),c=g.fn.detach?b.detach():b.remove();c=g(c).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove()};e.clearTableBody=function(c){g(c.tBodies).filter(":not(."+c.config.cssInfoBlock+")").empty()};e.destroy=function(c,b,a){var f=g(c),h=c.config,d=f.find("thead:first");c.hasInitialized=!1;d.find("tr:not(."+h.cssHeaderRow+")").remove();d.find(".tablesorter-resizer").remove(); e.refreshWidgets(c,!0,!0);f.removeData("tablesorter").unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+h.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(h.cssHeader+" "+h.cssAsc+" "+h.cssDesc).find(".tablesorter-header-inner").each(function(){""!==h.cssIcon&&g(this).find("."+h.cssIcon).remove();g(this).replaceWith(g(this).contents())});!1!==b&&f.removeClass(h.tableClass);"function"===typeof a&& a(c)};e.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];e.sortText=function(c,b,a,f){if(b===a)return 0;var h=c.config,d=h.string[h.empties[f]||h.emptyTo],j=e.regex;if(""===b&&0!==d)return"boolean"===typeof d?d?-1:1:-d||-1;if(""===a&&0!==d)return"boolean"===typeof d?d?1:-1:d||1;if("function"===typeof h.textSorter)return h.textSorter(b,a,c,f);c=b.replace(j[0], "\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");f=a.replace(j[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(j[2]),16)||1!==c.length&&b.match(j[1])&&Date.parse(b);if(a=parseInt(a.match(j[2]),16)||b&&a.match(j[1])&&Date.parse(a)||null){if(ba)return 1}h=Math.max(c.length,f.length);for(b=0;bj)return 1}return 0};e.sortTextDesc=function(c,b,a,f){if(b===a)return 0;var d=c.config,g=d.string[d.empties[f]||d.emptyTo];return""===b&&0!==g?"boolean"===typeof g?g?-1:1:g||1:""===a&&0!==g?"boolean"===typeof g?g?1:-1:-g||-1:"function"===typeof d.textSorter?d.textSorter(a,b,c,f):e.sortText(c,a,b)};e.getTextValue=function(c,b,a){if(b){var f=c.length,d=b+a;for(b=0;bg.inArray(j[f].id,k)))h.debug&&d("Refeshing widgets: Removing "+j[f].id),j[f].hasOwnProperty("remove")&&j[f].remove(c,h,h.widgetOptions);!0!==a&&e.applyWidget(c,b)};e.getData=function(c,b,a){var d="";c=g(c);var e,k;if(!c.length)return"";e=g.metadata?c.metadata():!1;k=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):e&&"undefined"!==typeof e[a]?d+=e[a]:b&&"undefined"!== typeof b[a]?d+=b[a]:" "!==k&&k.match(" "+a+"-")&&(d=k.match(RegExp(" "+a+"-(\\w+)"))[1]||"");return g.trim(d)};e.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?g.trim(c):a};e.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g, "")):!0}}});var k=g.tablesorter;g.fn.extend({tablesorter:k.construct});k.addParser({id:"text",is:function(){return!0},format:function(d,v){var p=v.config;d=g.trim(p.ignoreCase?d.toLocaleLowerCase():d);return p.sortLocaleCompare?k.replaceAccents(d):d},type:"text"});k.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test(d)},format:function(d,g){return k.formatFloat(d.replace(/[^\w,. \-()]/g,""),g)},type:"numeric"}); k.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var p,u=d.split("."),q="",t=u.length;for(p=0;p thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=u;g.construct=function(c){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config.debug?e("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var d=j(this),a=this,b,q,f,l="",v,n,k,C,x=j.metadata;a.hasInitialized= !1;a.config={};b=j.extend(!0,a.config,g.defaults,c);j.data(a,"tablesorter",b);b.debug&&j.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===j("x")[0].textContent;b.supportsDataObject=1.4<=parseFloat(j.fn.jquery);b.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(d.attr("class"))||(l=""!==b.theme?" tablesorter-"+b.theme:"");b.$table=d.addClass(b.tableClass+l);b.$tbodies=d.children("tbody:not(."+b.cssInfoBlock+")");var t= [],y={},Q=j(a).find("thead:eq(0), tfoot").children("tr"),K,E,z,A,O,D,L,R,S,I;for(K=0;K':"";t=j(a).find(w.selectorHeaders).each(function(a){B=j(this);M=w.headers[a];w.headerContent[a]=this.innerHTML;N=w.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,T);w.onRenderTemplate&&(P=w.onRenderTemplate.apply(B,[a,N]))&&"string"===typeof P&&(N=P);this.innerHTML='
'+N+"
";w.onRenderHeader&&w.onRenderHeader.apply(B,[a]);this.column=y[this.parentNode.rowIndex+"-"+ this.cellIndex];var b=g.getData(B,M,"sortInitialOrder")||w.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;"false"===g.getData(B,M,"sorter")?(this.sortDisabled=!0,B.addClass("sorter-false")):B.removeClass("sorter-false");this.lockedOrder=!1;J=g.getData(B,M,"lockedOrder")||!1;"undefined"!==typeof J&&!1!==J&&(this.order=this.lockedOrder=/^d/i.test(J)||1===J?[1,1,1]:[0,0,0]);B.addClass((this.sortDisabled?"sorter-false ":" ")+w.cssHeader);w.headerList[a]=this;B.parent().addClass(w.cssHeaderRow)}); a.config.debug&&(u("Built headers:",U),e(t));b.$headers=t;b.parsers=h(a);b.delayInit||s(a);b.$headers.find("*").andSelf().filter(b.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(c,e){var h=(this.tagName.match("TH|TD")?j(this):j(this).parents("th, td").filter(":last"))[0];if(1!==(c.which||c.button))return!1;if("mousedown"===c.type)return C=(new Date).getTime(),"INPUT"===c.target.tagName?"":!b.cancelSelection;if(!0!==e&&250< (new Date).getTime()-C)return!1;b.delayInit&&!b.cache&&s(a);if(!h.sortDisabled){d.trigger("sortStart",a);l=!c[b.sortMultiSortKey];h.count=c[b.sortResetKey]?2:(h.count+1)%(b.sortReset?3:2);b.sortRestart&&(q=h,b.$headers.each(function(){if(this!==q&&(l||!j(this).is("."+b.cssDesc+",."+b.cssAsc)))this.count=-1}));q=h.column;if(l){b.sortList=[];if(null!==b.sortForce){v=b.sortForce;for(f=0;fk&&(b.sortList.push([q,k]),1k&&(b.sortList.push([q,k]),1"),W=j(a).width();j("tr:first td",a.tBodies[0]).each(function(){V.append(j("").css("width",parseInt(1E3*(j(this).width()/W),10)/10+"%"))});j(a).prepend(V)}b.showProcessing&&d.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(b){g.isProcessing(a,"sortBegin"=== b.type)});a.hasInitialized=!0;b.debug&&g.benchmark("Overall initialization time",j.data(a,"startoveralltimer"));d.trigger("tablesorter-initialized",a);"function"===typeof b.initialized&&b.initialized(a)})};g.isProcessing=function(c,d,a){var b=c.config;c=a||j(c).find("."+b.cssHeader);d?(0'),c=j.fn.detach?d.detach():d.remove();c=j(c).find("span.tablesorter-savemyplace");d.insertAfter(c);c.remove()};g.clearTableBody=function(c){c.config.$tbodies.empty()};g.destroy=function(c,d,a){if(c.hasInitialized){g.refreshWidgets(c,!0,!0);var b=j(c),e=c.config,f=b.find("thead:first"),h=f.find("tr."+e.cssHeaderRow).removeClass(e.cssHeaderRow),u=b.find("tfoot:first > tr").children("th, td");f.find("tr").not(h).remove();b.removeData("tablesorter").unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave"); e.$headers.add(u).removeClass(e.cssHeader+" "+e.cssAsc+" "+e.cssDesc).removeAttr("data-column");h.find(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");h.children().each(function(a){j(this).html(e.headerContent[a])});!1!==d&&b.removeClass(e.tableClass+" tablesorter-"+e.theme);c.hasInitialized=!1;"function"===typeof a&&a(c)}};g.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/, /^0x[0-9a-f]+$/i];g.sortText=function(c,d,a,b){if(d===a)return 0;var e=c.config,f=e.string[e.empties[b]||e.emptyTo],h=g.regex;if(""===d&&0!==f)return"boolean"===typeof f?f?-1:1:-f||-1;if(""===a&&0!==f)return"boolean"===typeof f?f?1:-1:f||1;if("function"===typeof e.textSorter)return e.textSorter(d,a,c,b);c=d.replace(h[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=a.replace(h[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");d=parseInt(d.match(h[2]),16)||1!==c.length&& d.match(h[1])&&Date.parse(d);if(a=parseInt(a.match(h[2]),16)||d&&a.match(h[1])&&Date.parse(a)||null){if(da)return 1}e=Math.max(c.length,b.length);for(d=0;dh)return 1}return 0};g.sortTextDesc=function(c,d,a,b){if(d===a)return 0;var e=c.config,f=e.string[e.empties[b]||e.emptyTo];return""===d&& 0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof e.textSorter?e.textSorter(a,d,c,b):g.sortText(c,a,d)};g.getTextValue=function(c,d,a){if(d){var b=c.length,e=d+a;for(d=0;dj.inArray(l[b].id,f)))h.debug&&e("Refeshing widgets: Removing "+l[b].id),l[b].hasOwnProperty("remove")&&l[b].remove(c,h,h.widgetOptions);!0!==a&&g.applyWidget(c,d)};g.getData=function(c,d,a){var b="";c=j(c); var e,f;if(!c.length)return"";e=j.metadata?c.metadata():!1;f=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?b+=c.data(a)||c.data(a.toLowerCase()):e&&"undefined"!==typeof e[a]?b+=e[a]:d&&"undefined"!==typeof d[a]?b+=d[a]:" "!==f&&f.match(" "+a+"-")&&(b=f.match(RegExp(" "+a+"-(\\w+)"))[1]||"");return j.trim(b)};g.formatFloat=function(c,d){if("string"!==typeof c||""===c)return c;var a;c=(d&&d.config?!1!==d.config.usNumberFormat:"undefined"!==typeof d? d:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?j.trim(c):a};g.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}});var h=j.tablesorter;j.fn.extend({tablesorter:h.construct});h.addParser({id:"text",is:function(){return!0},format:function(e,u){var p=u.config;e=j.trim(p.ignoreCase?e.toLocaleLowerCase():e);return p.sortLocaleCompare? h.replaceAccents(e):e},type:"text"});h.addParser({id:"currency",is:function(e){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test(e)},format:function(e,j){return h.formatFloat(e.replace(/[^\w,. \-()]/g,""),j)},type:"numeric"});h.addParser({id:"ipAddress",is:function(e){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(e)},format:function(e,j){var p,r=e.split("."),s="",m=r.length;for(p=0;p'),n.cssIcon&&m.find("."+n.cssIcon).addClass(g.icons),h.hasClass("hasFilters")&&m.find(".tablesorter-filter-row").addClass(g.filterRow);a.each(m,function(c){b=a(this);j=n.cssIcon?b.find("."+n.cssIcon):b;this.sortDisabled?(b.removeClass(s),j.removeClass(s+" tablesorter-icon "+g.icons)):(f=h.hasClass("hasStickyHeaders")? h.find(r).find("th").eq(c).add(b):b,d=b.hasClass(n.cssAsc)?g.sortAsc:b.hasClass(n.cssDesc)?g.sortDesc:b.hasClass(n.cssHeader)?g.sortNone:"",b[d===g.sortNone?"removeClass":"addClass"](g.active),j.removeClass(s).addClass(d))});n.debug&&a.tablesorter.benchmark("Applying "+q+" theme",c)},remove:function(e,c,d){e=a(e);var b="object"===typeof d.uitheme?"jui":d.uitheme||"jui";d="object"===typeof d.uitheme?d.uitheme:a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(b)?b:"jui"];var j=e.children("thead").children(), f=d.sortNone+" "+d.sortDesc+" "+d.sortAsc;e.removeClass("tablesorter-"+b+" "+d.table).find(c.cssHeader).removeClass(d.header);j.unbind("mouseenter mouseleave").removeClass(d.hover+" "+f+" "+d.active).find(".tablesorter-filter-row").removeClass(d.filterRow);j.find(".tablesorter-icon").removeClass(d.icons)}}); -a.tablesorter.addWidget({id:"columns",format:function(e){var c,d,b,j,f,h,n,p,q,g=a(e),m=e.config,r=m.widgetOptions,s=g.children("tbody:not(."+m.cssInfoBlock+")"),v=m.sortList,w=v.length,l=["primary", "secondary","tertiary"],l=m.widgetColumns&&m.widgetColumns.hasOwnProperty("css")?m.widgetColumns.css||l:r&&r.hasOwnProperty("columns")?r.columns||l:l;h=l.length-1;n=l.join(" ");m.debug&&(f=new Date);for(q=0;q=]/g],M=B.map(function(b){return A.getData?"parsed"===A.getData(B.filter('[data-column="'+b+'"]:last'),t.headers[b],"filter"):a(this).hasClass("filter-parsed")}).get(),H,I,D=function(b){var c=a.isArray(b),e=u.find("thead").eq(0).children("tr").find("select."+z+", input."+z),d=c?b:e.map(function(){return a(this).val()||""}).get(),f=(d|| []).join("");c&&e.each(function(c,d){a(d).val(b[c]||"")});!0===k.filter_hideFilters&&u.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(G===f&&!1!==b))if(u.trigger("filterStart",[d]),t.showProcessing)setTimeout(function(){J(b,d,f);return!1},30);else return J(b,d,f),!1},J=function(j,g,h){var m,q,s,r,y,x,z;t.debug&&(z=new Date);for(b=0;b]=?/.test(f)?(v=isNaN(p)?a.tablesorter.formatFloat(p.replace(C[5],""),e):a.tablesorter.formatFloat(p,e),w=a.tablesorter.formatFloat(f.replace(C[5],"").replace(C[6],""),e),/>/.test(f)&&(x=/>=/.test(f)?v>=w:v>w),/'+(B.filter('[data-column="'+c+'"]:last').attr("data-placeholder")||"")+"";for(b=0;b'+h[b]+"";u.find("thead").find("select."+z+'[data-column="'+c+'"]')[f?"html":"append"](g)},L=function(a){for(c=0;c';for(c=0;c":">")+ "";u.find("thead").eq(0).append(l+="")}u.bind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter "),function(a,b){"search"!==a.type&&L(!0);D("search"===a.type?b:"");return!1}).find("input."+z).bind("keyup search",function(a,b){if(!(32>a.which&&8!==a.which||37<=a.which&&40>=a.which)){if("undefined"!==typeof b)return D(b),!1;clearTimeout(I);I=setTimeout(function(){D()},k.filter_searchDelay||300)}});k.filter_reset&&a(k.filter_reset).length&&a(k.filter_reset).bind("click", function(){u.find("."+z).val("");D();return!1});if(k.filter_functions)for(y in k.filter_functions)if(k.filter_functions.hasOwnProperty(y)&&"string"===typeof y)if(l=B.filter('[data-column="'+y+'"]:last'),h="",!0===k.filter_functions[y]&&!l.hasClass("filter-false"))K(y);else if("string"===typeof y&&!l.hasClass("filter-false")){for(g in k.filter_functions[y])"string"===typeof g&&(h+=""===h?'":"",h+='"); u.find("thead").find("select."+z+'[data-column="'+y+'"]').append(h)}L();u.find("select."+z).bind("change search",function(){D()});!0===k.filter_hideFilters&&u.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(b){var c;m=a(this);clearTimeout(q);q=setTimeout(function(){/enter|over/.test(b.type)?m.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==m[0]&&(c=u.find("."+(k.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()|| ""}).get().join(""),""===c&&m.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(b){r=a(this).closest("tr");clearTimeout(q);q=setTimeout(function(){if(""===u.find("."+(k.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""))r["focus"===b.type?"removeClass":"addClass"]("hideme")},200)});t.showProcessing&&u.bind("filterStart filterEnd",function(b,c){var d=c?u.find("."+t.cssHeader).filter("[data-column]").filter(function(){return""!== c[a(this).data("column")]}):"";A.isProcessing(u[0],"filterStart"===b.type,c?d:"")});t.debug&&A.benchmark("Applying Filter widget",H);u.trigger("filterInit")}},remove:function(e,c,d){var b,j;b=a(e);c=b.children("tbody:not(."+c.cssInfoBlock+")");b.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(b=0;ba.top&&b');j=j.slice(0,-1);f=f?f.add(j):j});f.each(function(){c=a(this);d=parseInt(c.css("padding-right"),10)+8;c.find(".tablesorter-wrapper").append('
')}).bind("mousemove.tsresize",function(a){if(0!==q&&g){var b=a.pageX-q;g.width(g.width()+b);m.width(m.width()-b);q=a.pageX}}).bind("mouseup.tsresize",function(){a.tablesorter.storage&&g&&(b[g.index()]=g.width(),b[m.index()]=m.width(),!1!==p.resizable&&a.tablesorter.storage(e,"tablesorter-resizable",b));r()}).find(".tablesorter-resizer").bind("mousedown",function(b){g=a(b.target).parents("th:last");m=g.next();q=b.pageX});h.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize", function(){r()}).bind("contextmenu.tsresize",function(){a.tablesorter.resizableReset(e);var c=a.isEmptyObject?a.isEmptyObject(b):b==={};b={};return c})}},remove:function(e){a(e).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){a(this).find(".tablesorter-resizer").remove();a(this).replaceWith(a(this).contents())});a.tablesorter.resizableReset(e)}}); a.tablesorter.resizableReset=function(e){a(e.config.headerList).width("auto");a.tablesorter.storage(e,"tablesorter-resizable",{})}; -a.tablesorter.addWidget({id:"saveSort",init:function(a,c){c.format(a,!0)},format:function(e,c){var d,b,j=e.config;d=!1!==j.widgetOptions.saveSort;var f={sortList:j.sortList};j.debug&&(b=new Date);a(e).hasClass("hasSaveSort")?d&&(e.hasInitialized&&a.tablesorter.storage)&&(a.tablesorter.storage(e,"tablesorter-savesort",f),j.debug&&a.tablesorter.benchmark("saveSort widget: Saving last sort: "+ j.sortList,b)):(a(e).addClass("hasSaveSort"),f="",a.tablesorter.storage&&(f=(d=a.tablesorter.storage(e,"tablesorter-savesort"))&&d.hasOwnProperty("sortList")&&a.isArray(d.sortList)?d.sortList:"",j.debug&&a.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',b)),c&&f&&0'),n.cssIcon&&m.find("."+n.cssIcon).addClass(g.icons),h.hasClass("hasFilters")&&m.find(".tablesorter-filter-row").addClass(g.filterRow);b.each(m,function(a){c=b(this);j=n.cssIcon?c.find("."+n.cssIcon):c;this.sortDisabled?(c.removeClass(s),j.removeClass(s+" tablesorter-icon "+g.icons)):(f=h.hasClass("hasStickyHeaders")?h.find(r).find("th").eq(a).add(c):c,e=c.hasClass(n.cssAsc)? g.sortAsc:c.hasClass(n.cssDesc)?g.sortDesc:c.hasClass(n.cssHeader)?g.sortNone:"",c[e===g.sortNone?"removeClass":"addClass"](g.active),j.removeClass(s).addClass(e))});n.debug&&b.tablesorter.benchmark("Applying "+q+" theme",a)},remove:function(d,a,e){d=b(d);var c="object"===typeof e.uitheme?"jui":e.uitheme||"jui";e="object"===typeof e.uitheme?e.uitheme:b.tablesorter.themes[b.tablesorter.themes.hasOwnProperty(c)?c:"jui"];var j=d.children("thead").children(),f=e.sortNone+" "+e.sortDesc+" "+e.sortAsc; d.removeClass("tablesorter-"+c+" "+e.table).find(a.cssHeader).removeClass(e.header);j.unbind("mouseenter mouseleave").removeClass(e.hover+" "+f+" "+e.active).find(".tablesorter-filter-row").removeClass(e.filterRow);j.find(".tablesorter-icon").removeClass(e.icons)}}); +b.tablesorter.addWidget({id:"columns",format:function(d){var a,e,c,j,f,h,n,p,q,g=b(d),m=d.config,r=m.widgetOptions,s=m.$tbodies,u=m.sortList,w=u.length,l=["primary","secondary","tertiary"],l=m.widgetColumns&&m.widgetColumns.hasOwnProperty("css")? m.widgetColumns.css||l:r&&r.hasOwnProperty("columns")?r.columns||l:l;h=l.length-1;n=l.join(" ");m.debug&&(f=new Date);for(q=0;q=]/g],M=B.map(function(a){return A.getData?"parsed"===A.getData(B.filter('[data-column="'+a+'"]:last'),t.headers[a],"filter"):b(this).hasClass("filter-parsed")}).get(),H,I,D=function(a){var c=b.isArray(a),e=v.find("thead").eq(0).children("tr").find("select."+z+", input."+z),d=c?a:e.map(function(){return b(this).val()||""}).get(),f=(d||[]).join("");c&&e.each(function(c,d){b(d).val(a[c]||"")});!0===k.filter_hideFilters&& v.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(G===f&&!1!==a))if(v.trigger("filterStart",[d]),t.showProcessing)setTimeout(function(){J(a,d,f);return!1},30);else return J(a,d,f),!1},J=function(j,g,h){var m,q,s,r,y,x,z;t.debug&&(z=new Date);for(c=0;c]=?/.test(f)?(u=isNaN(p)?b.tablesorter.formatFloat(p.replace(C[5],""),d):b.tablesorter.formatFloat(p,d),w=b.tablesorter.formatFloat(f.replace(C[5],"").replace(C[6],""),d),/>/.test(f)&&(x=/>=/.test(f)?u>=w:u>w),/'+(B.filter('[data-column="'+a+'"]:last').attr("data-placeholder")||"")+"";for(c=0;c'+h[c]+"";v.find("thead").find("select."+z+'[data-column="'+a+'"]')[f?"html":"append"](g)},L=function(b){for(a=0;a';for(a=0;a":">")+"";v.find("thead").eq(0).append(l+="")}v.bind(["addRows", "updateCell","update","appendCache","search"].join(".tsfilter "),function(b,a){"search"!==b.type&&L(!0);D("search"===b.type?a:"");return!1}).find("input."+z).bind("keyup search",function(b,a){if(!(32>b.which&&8!==b.which||37<=b.which&&40>=b.which)){if("undefined"!==typeof a)return D(a),!1;clearTimeout(I);I=setTimeout(function(){D()},k.filter_searchDelay||300)}});k.filter_reset&&b(k.filter_reset).length&&b(k.filter_reset).bind("click",function(){v.find("."+z).val("");D();return!1});if(k.filter_functions)for(y in k.filter_functions)if(k.filter_functions.hasOwnProperty(y)&& "string"===typeof y)if(l=B.filter('[data-column="'+y+'"]:last'),h="",!0===k.filter_functions[y]&&!l.hasClass("filter-false"))K(y);else if("string"===typeof y&&!l.hasClass("filter-false")){for(g in k.filter_functions[y])"string"===typeof g&&(h+=""===h?'":"",h+='");v.find("thead").find("select."+z+'[data-column="'+y+'"]').append(h)}L();v.find("select."+z).bind("change search",function(){D()});!0===k.filter_hideFilters&& v.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var c;m=b(this);clearTimeout(q);q=setTimeout(function(){/enter|over/.test(a.type)?m.removeClass("hideme"):b(document.activeElement).closest("tr")[0]!==m[0]&&(c=v.find("."+(k.filter_cssFilter||"tablesorter-filter")).map(function(){return b(this).val()||""}).get().join(""),""===c&&m.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){r=b(this).closest("tr");clearTimeout(q);q=setTimeout(function(){if(""=== v.find("."+(k.filter_cssFilter||"tablesorter-filter")).map(function(){return b(this).val()||""}).get().join(""))r["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});t.showProcessing&&v.bind("filterStart filterEnd",function(a,c){var d=c?v.find("."+t.cssHeader).filter("[data-column]").filter(function(){return""!==c[b(this).data("column")]}):"";A.isProcessing(v[0],"filterStart"===a.type,c?d:"")});t.debug&&A.benchmark("Applying Filter widget",H);v.trigger("filterInit")}},remove:function(d,a, e){var c,j;c=b(d);a=a.$tbodies;c.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(c=0;cb.top&&c');j=j.slice(0,-1);f=f?f.add(j):j});f.each(function(){a=b(this);e=parseInt(a.css("padding-right"),10)+8;a.find(".tablesorter-wrapper").append('
')}).bind("mousemove.tsresize",function(a){if(0!==q&&g){var b=a.pageX-q;g.width(g.width()+b);m.width(m.width()-b);q=a.pageX}}).bind("mouseup.tsresize", function(){b.tablesorter.storage&&g&&(c[g.index()]=g.width(),c[m.index()]=m.width(),!1!==p.resizable&&b.tablesorter.storage(d,"tablesorter-resizable",c));r()}).find(".tablesorter-resizer").bind("mousedown",function(a){g=b(a.target).parents("th:last");m=g.next();q=a.pageX});h.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize",function(){r()}).bind("contextmenu.tsresize",function(){b.tablesorter.resizableReset(d);var a=b.isEmptyObject?b.isEmptyObject(c):c==={};c={};return a})}},remove:function(d){b(d).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){b(this).find(".tablesorter-resizer").remove(); b(this).replaceWith(b(this).contents())});b.tablesorter.resizableReset(d)}});b.tablesorter.resizableReset=function(d){b(d.config.headerList).width("auto");b.tablesorter.storage(d,"tablesorter-resizable",{})}; +b.tablesorter.addWidget({id:"saveSort",init:function(b,a){a.format(b,!0)},format:function(d,a){var e,c,j=d.config;e=!1!==j.widgetOptions.saveSort;var f={sortList:j.sortList};j.debug&&(c=new Date);b(d).hasClass("hasSaveSort")?e&&(d.hasInitialized&&b.tablesorter.storage)&&(b.tablesorter.storage(d, "tablesorter-savesort",f),j.debug&&b.tablesorter.benchmark("saveSort widget: Saving last sort: "+j.sortList,c)):(b(d).addClass("hasSaveSort"),f="",b.tablesorter.storage&&(f=(e=b.tablesorter.storage(d,"tablesorter-savesort"))&&e.hasOwnProperty("sortList")&&b.isArray(e.sortList)?e.sortList:"",j.debug&&b.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',c)),a&&f&&0