From fcebad5a0fa6be5a3ab8bf87d1dfc07e50d8d834 Mon Sep 17 00:00:00 2001 From: Mottie Date: Thu, 22 May 2014 07:51:24 -0500 Subject: [PATCH] version bump --- README.md | 141 +++++++++++++++---- addons/pager/jquery.tablesorter.pager.js | 2 +- addons/pager/jquery.tablesorter.pager.min.js | 4 +- bower.json | 2 +- js/jquery.tablesorter.js | 4 +- js/jquery.tablesorter.min.js | 4 +- js/jquery.tablesorter.widgets.js | 2 +- js/jquery.tablesorter.widgets.min.js | 32 ++--- js/widgets/widget-columnSelector.js | 2 +- js/widgets/widget-math.js | 2 +- js/widgets/widget-output.js | 2 +- js/widgets/widget-pager.js | 2 +- js/widgets/widget-print.js | 2 +- js/widgets/widget-scroller.js | 2 +- package.json | 2 +- tablesorter.jquery.json | 2 +- 16 files changed, 150 insertions(+), 57 deletions(-) diff --git a/README.md b/README.md index cf16c8a1..19d41c73 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,123 @@ tablesorter can successfully parse and sort many types of data including linked View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Change). +#### Version 2.17.0 (5/22/2014) + +* Overall + * You can now target a column using a jQuery selector targeting the header cell (e.g. a class name, id or column index, as before). + * This works with the core options: `headers`, `textExtraction`. + * This also works with the widgets: `filter_formatter`, `filter_functions`, `filter_selectSource` and the `headers` options for `filter` & `resizable`. + * This change has *not yet been implemented* to the following options: `textSorter`, `sortList`, `sortForce`, `sortAppend` and `numberSorter` (will modify this option to target columns soon). + * What **won't work** is if you try to target the header using a filtering selector that uses an index, e.g. `"th:eq()"`, `":gt()"`, `":lt()"`, `":first"`, `":last"`, `":even"` or `":odd"`, `":first-child"`, `":last-child"`, `":nth-child()"`, `":nth-last-child()"`, etc. + +* Docs + * Switch from using CDN versions of jQuery, jQuery UI, Bootstrap, Sugar and Select2 instead of using [protocol-relative URLs](http://www.paulirish.com/2010/the-protocol-relative-url/) because they are a pain to use locally. + * Change style of "Update" tags to be slightly lighter than "New" tags. + * Updated [reflow widget demo](http://mottie.github.io/tablesorter/docs/example-widget-reflow.html) with demo tables in a resizable iframe, so the browser window no longer needs to be resized. + * Miscellaneous updates including correcting some version numbers, fixing links & other issues with the demos. + +* Themes + * Fix green theme to properly include a background with the css3 sticky headers widget. + +* Core + * Instead of using empty or clearing rows from the table, the rows are now detached. This also applies to the pager. + * Added `resetToLoadState` method + * Using this method will clear out any settings that have changed since the table was initialized (refreshes the entire table); so any sorting or modified widget options will be cleared. + * However, it will not clear any values that were saved to storage. This method is basically like reloading the page. + * Refer to columns in the `headers` and/or `textExtraction` option by class name, ID, or column index (as before). + + ```js + headers : { + '.first-name' : { sorter: 'text' }, + '.disabled' : { sorter: false } + }, + textExtraction : { + '.styled' : function(node, table, cellIndex) { + return $(node).find('strong').text(); + } + } + ``` + + * Added new "sorton" method values: "a" (ascending), "d" (descending), "n" (next), "s" (same) & "o" (opposite). + + ```js + // column 0: desc sort, column 1: asc sort + $("#table1").trigger("sorton", [ [[0,"d"],[1,"a"]] ]); + // column 0: next sort, column 1: opposite of column 0, column 2: same as column 0 + $("#table2").trigger("sorton", [ [[0,"n"],[1,"o"],[2,"s"]] ]); + ``` + + Please refer to the [Sort table using a link outside the table](http://mottie.github.io/tablesorter/docs/example-trigger-sort.html) demo for more details. + + +* ColumnSelector widget + * Added a method to refresh the selected columns using `$('table').trigger('refreshColumnSelector');`. + * Fix a js error when removing the widget. + +* Filter widget + * Fix child row filtering. + * Fix `filter-match` searches. + * Set filter parser or disable a filter in the `headers` option by referring to the header class name, ID, or column index (as before) + + ```js + headers : { + '.first-name' : { filter : false }, + '.last-name' : { filter : 'parsed' } + } + ``` + + * Refer to `filter_functions`, `filter_formatter` and `filter_selectSource` columns by class name, ID, or column index (as before) + + ```js + filter_functions : { + ".col-date" : { + "< 2004" : function (e, n, f, i) { + return n < Date.UTC(2004, 0, 1); // < Jan 1 2004 + }, + ... + } + }, + filter_formatter : { + ".col-value" : function($cell, indx){ + return $.tablesorter.filterFormatter.uiSpinner( $cell, indx, { + ... + } + }, + filter_selectSource : { + ".model-number" : [ "abc", "def", "ghi", "xyz" ] + } + ``` + +* Math widget + * Now works properly with the pager. Fixes [issue #621](https://github.com/Mottie/tablesorter/issues/621). + +* Output widget + * Add `output_ignoreColumns` option. Set the zero-based index of the columns to ignore in this array. Fixes [issue #607](https://github.com/Mottie/tablesorter/issues/607) + * Add `config` parameter to `output_callback` function. NOTE: this parameter is added before the data parameter, so it may break any already existing custom callback functions. + * Add `output_duplicateSpans` option. Setting this option to `false` adds blank entries instead of duplicating the colspan or rowspan content. Fixes [issue #619](https://github.com/Mottie/tablesorter/issues/619). + +* Pager (addon & widget) + * Use detach instead of empty on tbody rows. This should save any data associated with the rows. + * Fix pager updating not showing correct totals. + +* Print widget + * Add `print_callback` option allowing manipulation of the table & stylesheet before printing. + * Corrected the `print_columns` settings comments. + +* Resizable widget + * Disable a resizable header within the `headers` option by referring to the column class name, ID, or column index (as before) + + ```js + headers : { + '.first-name' : { resizable: false } + } + ``` + + * Added note about using box-sizing & jQuery versions older than 1.8. + +* Scroller widget + * Filter widget works with this widget again. Fixes [issue #620](https://github.com/Mottie/tablesorter/issues/620). + #### Version 2.16.4 (5/5/2014) * Docs @@ -164,27 +281,3 @@ View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Chan * Core: * Fixed an issue where ajax loaded data would cause a javascript error because of improper ignoring of data. * Ajax loaded data will now be parsed and cached - so stuff like the grouping widget will work properly. - -#### Version 2.16.0 (4/23/2014) - -* Docs - * Add notice to readme about upgrading to v2.16. - * Add question section to readme about where to ask questions, including the new IRC channel. - * Update jQuery UI accordion code to reapply widgets to tables within the section, when open. - -* Build widget - * Now works with HTML in the data - * Add zebra widget to demos. - -* Core - * Check more than the first tbody when detecting parsers. Fixes [issue #589](https://github.com/Mottie/tablesorter/issues/589). - * Apply widgets on table initialization after a short delay. - -* Filter widget: - * Fix search already filtered rows - * Fix `filteredRows` count & cleanup. - * SetFilters now behaves more like a triggered search. Fixes [issue #588](https://github.com/Mottie/tablesorter/issues/588). - * Filterformatter - Fix both datepicker scripts to work properly with non-U.S. formats. Fixes [issue #587](https://github.com/Mottie/tablesorter/issues/587). - -* Pager: Now stays on the same page after updating. Fixes [issue #590](https://github.com/Mottie/tablesorter/issues/590). -* Testing: Add some preliminary tests for the filter widget. diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 27bd6efa..ef9c16d2 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 4/23/2014 (v2.16.0) + * updated 5/22/2014 (v2.17.0) */ /*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 a8ada9d6..ee89694b 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,2 +1,2 @@ -/* tablesorter pager plugin updated 4/23/2014 (v2.16.0) */ -;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(c,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(c){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(c,a){var b=c.cssDisabled,d=!!a,f=d||0===c.page,g=Math.min(c.totalPages,c.filteredPages),d=d||c.page===g-1||0===c.totalPages;c.updateArrows&&(c.$container.find(c.cssFirst+","+c.cssPrev)[f?"addClass":"removeClass"](b).attr("aria-disabled", f),c.$container.find(c.cssNext+","+c.cssLast)[d?"addClass":"removeClass"](b).attr("aria-disabled",d))},t=function(c,a,b){var d,f,g,l=c.config;d=l.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=[];f=a.size||10;g=[l.widgetOptions&&l.widgetOptions.filter_filteredRow||"filtered",l.selectorRemove];a.countChildRows&&g.push(l.cssChildRow);g.join("|");a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=d?0:a.totalRows;a.filteredPages=a.totalPages;d&&(h.each(l.cache[0].normalized,function(e,c){a.filteredRows+= a.regexRows.test(c[l.columns].$row[0].className)?0:1}),a.filteredPages=Math.ceil(a.filteredRows/f)||0);if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),d=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(c,b){return a.totalPages?a.page+(b?parseInt(b, 10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(c){c=c.replace(/[{}\s]/g,"");var b=c.split(":"),d=a.ajaxData,f=/(rows?|pages?)$/i.test(c)?0:"";return 1"+d+"";a.$goto.html(g).val(a.page+1)}p(a);a.initialized&&!1!==b&&(l.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(c, a.storageKey,{page:a.page,size:a.size}))},u=function(c,a){var b,d=c.config,f=d.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),b=h.data(c,"pagerSavedHeight"))&&(b-=f.height(),5'))},z=function(c,a){var b=c.config.$tbodies.eq(0);b.find("tr.pagerSavedHeightSpacer").remove();h.data(c, "pagerSavedHeight",b.height());u(c,a);h.data(c,"pagerLastSize",a.size)},v=function(c,a){if(!a.ajaxUrl){var b,d=0,f=c.config,g=f.$tbodies.eq(0).children(),h=g.length,e=a.page*a.size,m=e+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",r=0;for(b=0;b=e&&r";for(f=0;f"+d[g][f]+"";p+=""}b.processAjaxOnInit&&s.$tbodies.eq(0).html(p)}b.processAjaxOnInit=!0;n&&n.length===c&&(m=(l=q.hasClass("hasStickyHeaders"))?s.widgetOptions.$sticky.children("thead:first").children().children(): "",e=q.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(a){var c=h(this),b;c.find("."+k.css.icon).length?(b=c.find("."+k.css.icon).clone(!0),c.find(".tablesorter-header-inner").html(n[a]).append(b),l&&m.length&&(b=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(b))):(c.find(".tablesorter-header-inner").html(n[a]),l&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));e.eq(a).html(n[a])}))}s.showProcessing&&k.isProcessing(a); b.totalPages=Math.ceil(b.totalRows/(b.size||10));b.last.totalRows=b.totalRows;b.last.currentFilters=b.currentFilters;b.last.sortList=(s.sortList||[]).join(",");t(a,b);u(a,b);q.trigger("updateCache",[function(){b.initialized&&q.trigger("applyWidgets").trigger("pagerChange",b)}])}b.initialized||(b.initialized=!0,h(a).trigger("applyWidgets").trigger("pagerInitialized",b))},G=function(c,a){var b=F(c,a),d=h(document),f,g=c.config;""!==b&&(g.showProcessing&&k.isProcessing(c,!0),d.bind("ajaxError.pager", function(b,e,f,g){B(null,c,a,e,g);d.unbind("ajaxError.pager")}),f=++a.ajaxCounter,a.ajaxObject.url=b,a.ajaxObject.success=function(b){f(a&&a.length||0))){b.page>=b.totalPages&&C(c,b);b.isDisabled=!1;b.initialized&&e.trigger("pagerChange",b);if(b.removeRows){k.clearTableBody(c);d=k.processTbody(c,d.$tbodies.eq(0),!0);f=m?0:n;g=m?0:n;for(l=0;ln&&l<=r&&(l++,d.append(a[f]))),f++;k.processTbody(c,d,!1)}else v(c, b);t(c,b);b.isDisabled||u(c,b);e.trigger("applyWidgets");c.isUpdating&&e.trigger("updateComplete",c)}},D=function(c,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(c,"pagerLastPage",a.page),h.data(c,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),x(c,c.config.rowsCopy,a),c.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).each(function(){h(this).attr("aria-disabled","true").addClass(a.cssDisabled)[0].disabled= !0})},q=function(c,a,b){if(!a.isDisabled){var d=c.config,f=h(c),g=a.last,l=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>l-1&&0!==l&&(a.page=l-1);g.currentFilters=""===(g.currentFilters||[]).join("")?[]:g.currentFilters;a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters;if(g.page!==a.page||g.size!==a.size||g.totalRows!==a.totalRows||(g.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||g.sortList!==(d.sortList||[]).join(","))d.debug&&k.log("Pager changing to page "+ a.page),a.last={page:a.page,size:a.size,sortList:(d.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[]},a.ajax?G(c,a):a.ajax||x(c,d.rowsCopy,a),h.data(c,"pagerLastPage",a.page),a.initialized&&!1!==b&&(f.trigger("pageMoved",a).trigger("applyWidgets"),c.isUpdating&&f.trigger("updateComplete"))}},y=function(c,a,b){b.size=a||b.size||10;b.$size.val(b.size);h.data(c,"pagerLastPage",b.page);h.data(c,"pagerLastSize",b.size);b.totalPages=Math.ceil(b.totalRows/b.size);b.filteredPages= Math.ceil(b.filteredRows/b.size);q(c,b)},H=function(c,a){a.page=0;q(c,a)},C=function(c,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;q(c,a)},I=function(c,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);q(c,a)},J=function(c,a){a.page--;0>=a.page&&(a.page=0);q(c,a)},E=function(c,a,b){var d,f=c.config;a.$size.add(a.$goto).removeClass(a.cssDisabled).removeAttr("disabled").attr("aria-disabled","false");a.isDisabled=!1;a.page=h.data(c, "pagerLastPage")||a.page||0;a.size=h.data(c,"pagerLastSize")||parseInt(a.$size.find("option[selected]").val(),10)||a.size||10;a.$size.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalRows,a.filteredRows)/a.size);c.id&&(d=c.id+"_pager_info",a.$container.find(a.cssPageDisplay).attr("id",d),f.$table.attr("aria-describedby",d));b&&(f.$table.trigger("updateRows"),y(c,a.size,a),A(c,a),u(c,a),f.debug&&k.log("pager enabled"))};w.appender=function(c,a){var b=c.config,d=b.pager;d.ajax||(b.rowsCopy=a,d.totalRows= d.countChildRows?b.$tbodies.eq(0).children().length:a.length,d.size=h.data(c,"pagerLastSize")||d.size||10,d.totalPages=Math.ceil(d.totalRows/d.size),x(c,a,d),t(c,d,!1))};w.construct=function(c){return this.each(function(){if(this.config&&this.hasInitialized){var a,b,d,f=this,g=f.config,l=g.widgetOptions,e=g.pager=h.extend(!0,{},h.tablesorterPager.defaults,c),m=g.$table,n=e.$container=h(e.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");e.oldAjaxSuccess=e.oldAjaxSuccess|| e.ajaxObject.success;g.appender=w.appender;k.filter&&0<=h.inArray("filter",g.widgets)&&(e.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,e.currentFilters,!1));e.savePages&&k.storage&&(a=k.storage(f,e.storageKey)||{},e.page=isNaN(a.page)?e.page:a.page,e.size=(isNaN(a.size)?e.size:a.size)||10,h.data(f,"pagerLastSize",e.size));e.regexRows=RegExp("("+(l.filter_filteredRow||"filtered")+"|"+g.selectorRemove.substring(1)+"|"+g.cssChildRow+")");m.unbind("filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize ".split(" ").join(".pager ")).bind("filterStart.pager", function(a,b){e.currentFilters=b;!1!==e.pageReset&&(g.lastCombinedFilter||"")!==(b||[]).join("")&&(e.page=e.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){e.initialized&&(t(f,e,!1),q(f,e,!1),u(f,e))}).bind("disable.pager",function(a){a.stopPropagation();D(f,e)}).bind("enable.pager",function(a){a.stopPropagation();E(f,e,!0)}).bind("destroy.pager",function(a){a.stopPropagation();D(f,e);e.$container.hide();f.config.appender=null;e.initialized=!1;delete f.config.rowsCopy;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager"); k.storage&&k.storage(f,e.storageKey,"")}).bind("update.pager updateRows.pager updateAll.pager addRows.pager ",function(a){a.stopPropagation();v(f,e)}).bind("pageSize.pager",function(a,b){a.stopPropagation();y(f,parseInt(b,10)||10,e);v(f,e);t(f,e,!1);e.$size.length&&e.$size.val(e.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();e.page=(parseInt(b,10)||1)-1;e.$goto.length&&e.$goto.val(e.size);q(f,e);t(f,e,!1)});b=[e.cssFirst,e.cssPrev,e.cssNext,e.cssLast];d=[H,J,I,C];n.find(b.join(",")).attr("tabindex", 0).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var c=h(this),g=b.length;if(!c.hasClass(e.cssDisabled))for(a=0;a/.test(p)?h(p):h(''+p+"")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^[.#]/,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery); +/* tablesorter pager plugin updated 5/22/2014 (v2.17.0) */ +;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(b,a){var c=b.cssDisabled,e=!!a,f=e||0===b.page,g=Math.min(b.totalPages,b.filteredPages),e=e||b.page===g-1||0===b.totalPages;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f?"addClass":"removeClass"](c).attr("aria-disabled", f),b.$container.find(b.cssNext+","+b.cssLast)[e?"addClass":"removeClass"](c).attr("aria-disabled",e))},t=function(b,a,c){var e,f,g,l=b.config;e=l.$table.hasClass("hasFilters")&&!a.ajaxUrl;g=[];f=a.size||10;g=[l.widgetOptions&&l.widgetOptions.filter_filteredRow||"filtered",l.selectorRemove];a.countChildRows&&g.push(l.cssChildRow);g.join("|");a.totalPages=Math.ceil(a.totalRows/f);a.filteredRows=e?0:a.totalRows;a.filteredPages=a.totalPages;e&&(h.each(l.cache[0].normalized,function(d,b){a.filteredRows+= a.regexRows.test(b[l.columns].$row[0].className)?0:1}),a.filteredPages=Math.ceil(a.filteredRows/f)||0);if(0<=Math.min(a.totalPages,a.filteredPages)&&(g=a.size*a.page>a.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),e=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(d,b){return a.totalPages?a.page+(b?parseInt(b, 10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(d){d=d.replace(/[{}\s]/g,"");var b=d.split(":"),c=a.ajaxData,e=/(rows?|pages?)$/i.test(d)?0:"";return 1"+e+"";a.$goto.html(g).val(a.page+1)}p(a);a.initialized&&!1!==c&&(l.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b, a.storageKey,{page:a.page,size:a.size}))},u=function(b,a){var c,e=b.config,f=e.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=h.data(b,"pagerSavedHeight"))&&(c-=f.height(),5'))},z=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b, "pagerSavedHeight",c.height());u(b,a);h.data(b,"pagerLastSize",a.size)},v=function(b,a){if(!a.ajaxUrl){var c,e=0,f=b.config,g=f.$tbodies.eq(0).children(),h=g.length,d=a.page*a.size,m=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",r=0;for(c=0;c=d&&r";for(f=0;f"+e[g][f]+"";p+=""}c.processAjaxOnInit&&s.$tbodies.eq(0).html(p)}c.processAjaxOnInit=!0;n&&n.length===b&&(m=(l=q.hasClass("hasStickyHeaders"))?s.widgetOptions.$sticky.children("thead:first").children().children(): "",d=q.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(a){var b=h(this),c;b.find("."+k.css.icon).length?(c=b.find("."+k.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(n[a]).append(c),l&&m.length&&(c=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(c))):(b.find(".tablesorter-header-inner").html(n[a]),l&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));d.eq(a).html(n[a])}))}s.showProcessing&&k.isProcessing(a); c.totalPages=Math.ceil(c.totalRows/(c.size||10));c.last.totalRows=c.totalRows;c.last.currentFilters=c.currentFilters;c.last.sortList=(s.sortList||[]).join(",");t(a,c);u(a,c);q.trigger("updateCache",[function(){c.initialized&&q.trigger("applyWidgets").trigger("pagerChange",c)}])}c.initialized||(c.initialized=!0,h(a).trigger("applyWidgets").trigger("pagerInitialized",c))},G=function(b,a){var c=F(b,a),e=h(document),f,g=b.config;""!==c&&(g.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager", function(c,d,f,g){B(null,b,a,d,g);e.unbind("ajaxError.pager")}),f=++a.ajaxCounter,a.ajaxObject.url=c,a.ajaxObject.success=function(c){f(a&&a.length||0))){c.page>=c.totalPages&&C(b,c);c.isDisabled=!1;c.initialized&&d.trigger("pagerChange",c);if(c.removeRows){k.clearTableBody(b);e=k.processTbody(b,e.$tbodies.eq(0),!0);f=m?0:n;g=m?0:n;for(l=0;ln&&l<=r&&(l++,e.append(a[f]))),f++;k.processTbody(b,e,!1)}else v(b, c);t(b,c);c.isDisabled||u(b,c);d.trigger("applyWidgets");b.isUpdating&&d.trigger("updateComplete",b)}},D=function(b,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(b,"pagerLastPage",a.page),h.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),x(b,b.config.rowsCopy,a),b.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).each(function(){h(this).attr("aria-disabled","true").addClass(a.cssDisabled)[0].disabled= !0})},q=function(b,a,c){if(!a.isDisabled){var e=b.config,f=h(b),g=a.last,l=Math.min(a.totalPages,a.filteredPages);0>a.page&&(a.page=0);a.page>l-1&&0!==l&&(a.page=l-1);g.currentFilters=""===(g.currentFilters||[]).join("")?[]:g.currentFilters;a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters;if(g.page!==a.page||g.size!==a.size||g.totalRows!==a.totalRows||(g.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||g.sortList!==(e.sortList||[]).join(","))e.debug&&k.log("Pager changing to page "+ a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[]},a.ajax?G(b,a):a.ajax||x(b,e.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(f.trigger("pageMoved",a).trigger("applyWidgets"),b.isUpdating&&f.trigger("updateComplete"))}},y=function(b,a,c){c.size=a||c.size||10;c.$size.val(c.size);h.data(b,"pagerLastPage",c.page);h.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);c.filteredPages= Math.ceil(c.filteredRows/c.size);q(b,c)},H=function(b,a){a.page=0;q(b,a)},C=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;q(b,a)},I=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);q(b,a)},J=function(b,a){a.page--;0>=a.page&&(a.page=0);q(b,a)},E=function(b,a,c){var e,f=b.config;a.$size.add(a.$goto).removeClass(a.cssDisabled).removeAttr("disabled").attr("aria-disabled","false");a.isDisabled=!1;a.page=h.data(b, "pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")||parseInt(a.$size.find("option[selected]").val(),10)||a.size||10;a.$size.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalRows,a.filteredRows)/a.size);b.id&&(e=b.id+"_pager_info",a.$container.find(a.cssPageDisplay).attr("id",e),f.$table.attr("aria-describedby",e));c&&(f.$table.trigger("updateRows"),y(b,a.size,a),A(b,a),u(b,a),f.debug&&k.log("pager enabled"))};w.appender=function(b,a){var c=b.config,e=c.pager;e.ajax||(c.rowsCopy=a,e.totalRows= e.countChildRows?c.$tbodies.eq(0).children().length:a.length,e.size=h.data(b,"pagerLastSize")||e.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),x(b,a,e),t(b,e,!1))};w.construct=function(b){return this.each(function(){if(this.config&&this.hasInitialized){var a,c,e,f=this,g=f.config,l=g.widgetOptions,d=g.pager=h.extend(!0,{},h.tablesorterPager.defaults,b),m=g.$table,n=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess|| d.ajaxObject.success;g.appender=w.appender;k.filter&&0<=h.inArray("filter",g.widgets)&&(d.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,d.currentFilters,!1));d.savePages&&k.storage&&(a=k.storage(f,d.storageKey)||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10,h.data(f,"pagerLastSize",d.size));d.regexRows=new RegExp("("+(l.filter_filteredRow||"filtered")+"|"+g.selectorRemove.substring(1)+"|"+g.cssChildRow+")"); m.unbind("filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b;!1!==d.pageReset&&(g.lastCombinedFilter||"")!==(b||[]).join("")&&(d.page=d.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){d.initialized&&(t(f,d,!1),q(f,d,!1),u(f,d))}).bind("disable.pager",function(a){a.stopPropagation();D(f,d)}).bind("enable.pager",function(a){a.stopPropagation();E(f,d,!0)}).bind("destroy.pager", function(a){a.stopPropagation();D(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;delete f.config.rowsCopy;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,d.storageKey,"")}).bind("update.pager updateRows.pager updateAll.pager addRows.pager ",function(a){a.stopPropagation();u(f,d);a=g.$tbodies.eq(0).children();d.totalRows=a.length-(d.countChildRows?0:a.filter("."+g.cssChildRow).length);d.totalPages=Math.ceil(d.totalRows/ d.size);t(f,d);v(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();y(f,parseInt(b,10)||10,d);v(f,d);t(f,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);q(f,d);t(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[H,J,I,C];n.find(c.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var b=h(this),g=c.length;if(!b.hasClass(d.cssDisabled))for(a= 0;a/.test(p)?h(p):h(''+p+"")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^[.#]/,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery); diff --git a/bower.json b/bower.json index 62781804..0045f761 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tablesorter", - "version": "2.16.4", + "version": "2.17.0", "dependencies": { "jquery": ">=1.2.6" }, diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index a7e570f5..c58d1105 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /**! -* TableSorter 2.16.4 - Client-side table sorting with ease! +* TableSorter 2.17.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.16.4"; + ts.version = "2.17.0"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 7276380e..163a773b 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.16.4 min - Client-side table sorting with ease! +* TableSorter 2.17.0 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(g){g.extend({tablesorter:new function(){function d(){var b=arguments[0],a=1':"";m.$headers=g(b).find(m.selectorHeaders).each(function(b){c= g(this);a=m.headers[b];m.headerContent[b]=g(this).html();t=m.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,e);m.onRenderTemplate&&(h=m.onRenderTemplate.apply(c,[b,t]))&&"string"===typeof h&&(t=h);g(this).html('
'+t+"
");m.onRenderHeader&&m.onRenderHeader.apply(c,[b]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,a,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1; k=f.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof k&&!1!==k&&(this.order=this.lockedOrder=C(k)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+m.cssHeader);m.headerList[b]=this;c.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow).attr("role","row");m.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});B(b);m.debug&&(u("Built headers:",l),d(m.$headers))}function E(b,a,c){var h=b.config;h.$table.find(h.selectorRemove).remove();s(b);x(b);H(h.$table,a,c)}function B(b){var a, c,h=b.config;h.$headers.each(function(e,t){c=g(t);a="false"===f.getData(t,h.headers[e],"sorter");t.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function G(b){var a,c,h=b.config,e=h.sortList,t=e.length,d=f.css.sortNone+" "+h.cssNone,l=[f.css.sortAsc+" "+h.cssAsc,f.css.sortDesc+" "+h.cssDesc],m=["ascending","descending"],n=g(b).find("tfoot tr").children().add(h.$extraHeaders).removeClass(l.join(" ")); h.$headers.removeClass(l.join(" ")).addClass(d).attr("aria-sort","none");for(a=0;a"),c=g(b).width();g(b.tBodies[0]).find("tr:first").children("td:visible").each(function(){a.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(b).prepend(a)}}function M(b,a,c){var h,e, f,d=b.config;b=a||d.sortList;d.sortList=[];g.each(b,function(b,a){h=[parseInt(a[0],10),parseInt(a[1],10)];if(f=d.$headers.filter('[data-column="'+h[0]+'"]:last')[0])d.sortList.push(h),e=g.inArray(h[1],f.order),c&&(f.count+=1),f.count=0<=e?e:h[1]%(d.sortReset?3:2)})}function N(b,a){return b&&b[a]?b[a].type||"":""}function O(b,a,c){var h,e,d,k=b.config,l=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this=== e||!l&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=a.column;if(l){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,c=0;ch&&(k.sortList.push([e,h]),1h&&(k.sortList.push([e,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header", headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};f.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"}; f.log=d;f.benchmark=u;f.construct=function(b){return this.each(function(){var a=g.extend(!0,{},f.defaults,b);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,a):f.setup(this,a)})};f.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",h=g(b),e=g.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;g.data(b,"tablesorter", a);a.debug&&g.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'), c=g.fn.detach?a.detach():a.remove();c=g(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};f.clearTableBody=function(b){g(b)[0].config.$tbodies.empty()};f.bindEvents=function(b,a,c){b=g(b)[0];var d,e=b.config;!0!==c&&(e.$extraHeaders=e.$extraHeaders?e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+ " "),function(c,f){var l;l=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==c.which||"mouseup"===l&&!0!==f&&250<(new Date).getTime()-d)){if("mousedown"===l)return d=(new Date).getTime(),"INPUT"===c.target.tagName?"":!e.cancelSelection;e.delayInit&&n(e.cache)&&x(b);l=g.fn.closest?g(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];l=e.$headers[a.index(l)];l.sortDisabled||O(b,l,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart", !1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(b){var a=g(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){g(this).find("."+f.css.headerIn).length&&g(this).html(a.headerContent[b])})};f.destroy=function(b,a,c){b=g(b)[0];if(b.hasInitialized){f.refreshWidgets(b,!0,!0);var d=g(b),e=b.config,t=d.find("thead:first"),k=t.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),l=d.find("tfoot:first > tr").children("th, td");!1===a&&0<=g.inArray("uitheme", e.widgets)&&(d.trigger("applyWidgetId",["uitheme"]),d.trigger("applyWidgetId",["zebra"]));t.find("tr").not(k).remove();d.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(e.namespace+" "));e.$headers.add(l).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled", "true");k.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(b);d.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(b,a){if(b===a)return 0;var c,d,e,g,k,l;d=f.regex;if(d.hex.test(a)){c=parseInt(b.match(d.hex), 16);e=parseInt(a.match(d.hex),16);if(ce)return 1}c=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");l=Math.max(c.length,d.length);for(k=0;kg)return 1}return 0};f.sortNaturalAsc=function(b,a,c,d,e){if(b===a)return 0; c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(b,a)};f.sortNaturalDesc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:-c||-1:f.sortNatural(a,b)};f.sortText=function(b,a){return b>a?1:bg.inArray(k[h].id,n))&&(e.debug&&d('Refeshing widgets: Removing "'+k[h].id+'"'),k[h].hasOwnProperty("remove")&&e.widgetInit[k[h].id]&&(k[h].remove(b,e,e.widgetOptions),e.widgetInit[k[h].id]=!1));!0!==c&&f.applyWidget(b,a)};f.getData=function(b,a,c){var d="";b=g(b);var e,f;if(!b.length)return"";e=g.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())? d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(d)};f.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)? g.trim(b):c};f.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=g.tablesorter;g.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(d,u){var n=u.config;d&&(d=g.trim(n.ignoreCase?d.toLocaleLowerCase():d),d=n.sortLocaleCompare?p.replaceAccents(d):d);return d},type:"text"});p.addParser({id:"digit",is:function(d){return p.isDigit(d)},format:function(d,u){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g, ""),u);return d&&"number"===typeof n?n:d?g.trim(d&&u.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d,u){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),u);return d&&"number"===typeof n?n:d?g.trim(d&&u.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"ipAddress", is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var n,v=d?d.split("."):"",s="",x=v.length;for(n=0;nd.length},format:function(d,g){return d?p.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});p.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i, "$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,n,v){if(d){n=g.config;var s=n.$headers.filter("[data-column="+v+"]:last");v=s.length&&s[0].dateFormat||p.getData(s,n.headers[v],"dateFormat")||n.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===v?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===v?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===v&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?p.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"});p.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"metadata", is:function(){return!1},format:function(d,p,n){d=p.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(n).metadata()[d]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(d,u,n){var v,s,x,y,C,D,E=RegExp(u.cssChildRow,"i"),B=u.$tbodies;u.debug&&(C=new Date);for(d=0;d':"";m.$headers.each(function(d){c=g(this);a=f.getColumnData(b,m.headers,d,!0);m.headerContent[d]=g(this).html();s=m.headerTemplate.replace(/\{content\}/g, g(this).html()).replace(/\{icon\}/g,e);m.onRenderTemplate&&(h=m.onRenderTemplate.apply(c,[d,s]))&&"string"===typeof h&&(s=h);g(this).html('
'+s+"
");m.onRenderHeader&&m.onRenderHeader.apply(c,[d]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,a,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;k=f.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof k&&!1!==k&&(this.order=this.lockedOrder=C(k)? [1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+m.cssHeader);m.headerList[d]=this;c.parent().addClass(f.css.headerRow+" "+m.cssHeaderRow).attr("role","row");m.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});B(b);m.debug&&(v("Built headers:",l),d(m.$headers))}function E(b,a,c){var h=b.config;h.$table.find(h.selectorRemove).remove();u(b);y(b);H(h.$table,a,c)}function B(b){var a,c,h=b.config;h.$headers.each(function(e,s){c=g(s);a="false"===f.getData(s,f.getColumnData(b,h.headers, e,!0),"sorter");s.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function G(b){var a,c,h=b.config,e=h.sortList,s=e.length,d=f.css.sortNone+" "+h.cssNone,l=[f.css.sortAsc+" "+h.cssAsc,f.css.sortDesc+" "+h.cssDesc],m=["ascending","descending"],r=g(b).find("tfoot tr").children().add(h.$extraHeaders).removeClass(l.join(" "));h.$headers.removeClass(l.join(" ")).addClass(d).attr("aria-sort","none"); for(a=0;a"),c=g(b).width();g(b.tBodies[0]).find("tr:first").children("td:visible").each(function(){a.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(b).prepend(a)}}function M(b,a){var c,h,e,f,d,l=b.config,m=a||l.sortList;l.sortList=[];g.each(m,function(b,a){f= parseInt(a[0],10);if(e=l.$headers.filter('[data-column="'+f+'"]:last')[0]){h=(h=(""+a[1]).match(/^(1|d|s|o|n)/))?h[0]:"";switch(h){case "1":case "d":h=1;break;case "s":h=d||0;break;case "o":c=e.order[(d||0)%(l.sortReset?3:2)];h=0===c?1:1===c?0:2;break;case "n":e.count+=1;h=e.order[e.count%(l.sortReset?3:2)];break;default:h=0}d=0===b?h:d;c=[f,parseInt(h,10)||0];l.sortList.push(c);h=g.inArray(c[1],e.order);e.count=0<=h?h:c[1]%(l.sortReset?3:2)}})}function N(b,a){return b&&b[a]?b[a].type||"":""}function O(b, a,c){var h,e,d,k=b.config,l=!c[k.sortMultiSortKey],m=k.$table;m.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=a,k.$headers.each(function(){this===e||!l&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=a.column;if(l){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,c=0;ch&&(k.sortList.push([e,h]),1h&&(k.sortList.push([e,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc", sortNone:"tablesorter-headerUnSorted"};f.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"};f.log=d;f.benchmark=v;f.construct=function(b){return this.each(function(){var a=g.extend(!0,{},f.defaults,b);a.originalSettings=b;!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,a):f.setup(this, a)})};f.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",h=g(b),e=g.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;g.data(b,"tablesorter",a);a.debug&&g.data(b,"startoveralltimer",new Date);a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=g.fn.detach?a.detach():a.remove();c=g(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};f.clearTableBody=function(b){g(b)[0].config.$tbodies.detach()};f.bindEvents=function(b,a,c){b=g(b)[0];var d,e=b.config;!0!==c&&(e.$extraHeaders= e.$extraHeaders?e.$extraHeaders.add(a):a);a.find(e.selectorSort).add(a.filter(e.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" "),function(c,f){var l;l=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(l)||"keyup"===l&&13!==c.which||"mouseup"===l&&!0!==f&&250<(new Date).getTime()-d)){if("mousedown"===l)return d=(new Date).getTime(),"INPUT"===c.target.tagName?"":!e.cancelSelection;e.delayInit&& n(e.cache)&&y(b);l=g.fn.closest?g(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];l=e.$headers[a.index(l)];l.sortDisabled||O(b,l,c)}});e.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(b){var a=g(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){g(this).find("."+f.css.headerIn).length&&g(this).html(a.headerContent[b])})};f.destroy=function(b,a,c){b=g(b)[0]; if(b.hasInitialized){f.refreshWidgets(b,!0,!0);var d=g(b),e=b.config,s=d.find("thead:first"),k=s.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),l=d.find("tfoot:first > tr").children("th, td");!1===a&&0<=g.inArray("uitheme",e.widgets)&&(d.trigger("applyWidgetId",["uitheme"]),d.trigger("applyWidgetId",["zebra"]));s.find("tr").not(k).remove();d.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(e.namespace+ " "));e.$headers.add(l).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");k.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(b);d.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(b)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(b,a){if(b===a)return 0;var c,d,e,g,k,l;d=f.regex;if(d.hex.test(a)){c=parseInt(b.match(d.hex),16);e=parseInt(a.match(d.hex),16);if(ce)return 1}c=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");l=Math.max(c.length,d.length);for(k=0;kg)return 1}return 0};f.sortNaturalAsc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(b,a)};f.sortNaturalDesc=function(b,a,c,d,e){if(b===a)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:f.sortNatural(a,b)};f.sortText=function(b,a){return b>a?1:bg.inArray(k[h].id,n))&&(e.debug&&d('Refeshing widgets: Removing "'+k[h].id+'"'),k[h].hasOwnProperty("remove")&&e.widgetInit[k[h].id]&&(k[h].remove(b,e,e.widgetOptions),e.widgetInit[k[h].id]=!1));!0!==c&&f.applyWidget(b,a)};f.getData=function(b,a,c){var d= "";b=g(b);var e,f;if(!b.length)return"";e=g.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())?d+=b.data(c)||b.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:a&&"undefined"!==typeof a[c]?d+=a[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(d)};f.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;b=(a&&a.config?!1!==a.config.usNumberFormat: "undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(b);return isNaN(c)?g.trim(b):c};f.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=g.tablesorter;g.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(d,v){var n=v.config;d&&(d=g.trim(n.ignoreCase?d.toLocaleLowerCase():d), d=n.sortLocaleCompare?p.replaceAccents(d):d);return d},type:"text"});p.addParser({id:"digit",is:function(d){return p.isDigit(d)},format:function(d,v){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof n?n:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d, v){var n=p.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof n?n:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});p.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var n,w=d?d.split("."):"",u="",y=w.length;for(n=0;nd.length},format:function(d,g){return d?p.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});p.addParser({id:"usLongDate", is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,n,w){if(d){n=g.config; var u=n.$headers.filter("[data-column="+w+"]:last");w=u.length&&u[0].dateFormat||p.getData(u,p.getColumnData(g,n.headers,w),"dateFormat")||n.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===w?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===w&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?p.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"}); p.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?p.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});p.addParser({id:"metadata",is:function(){return!1},format:function(d,p,n){d=p.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(n).metadata()[d]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(d,v,n){var w,u, y,z,C,D,E=new RegExp(v.cssChildRow,"i"),B=v.$tbodies;v.debug&&(C=new Date);for(d=0;d'),a.cssIcon&&h.find("."+c.css.icon).addClass(n.icons),d.hasClass("hasFilters")&&h.find("."+c.css.filterRow).addClass(n.filterRow));for(d=0;d=]/g},types:{regex:function(b,a,e,d){if(c.filter.regex.regex.test(a)){var f;b=c.filter.regex.regex.exec(a);try{f=RegExp(b[1],b[2]).test(d)}catch(h){f=!1}return f}return null},operators:function(b,a,e,d,f,h,g,l,n){if(/^[<>]=?/.test(a)){var p;e=g.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),g);l=e.parsers[h];e=b;if(n[h]||"numeric"===l.type)p= l.format(k.trim(""+a.replace(c.filter.regex.operators,"")),g,[],h),b="number"!==typeof p||""===p||isNaN(p)?b:p;d=!n[h]&&"numeric"!==l.type||isNaN(b)||"undefined"===typeof f?isNaN(d)?c.formatFloat(d.replace(c.filter.regex.nondigit,""),g):c.formatFloat(d,g):f;/>/.test(a)&&(p=/>=/.test(a)?d>=b:d>b);/l&&(d=e,e=l,l=d);return a>=e&&a<=l||""===e||""===l}return null},wild:function(b,a,e,d,f,h,g,l,n,p){return/[\?|\*]/.test(a)|| c.filter.regex.orReplace.test(b)?(b=g.config,a=a.replace(c.filter.regex.orReplace,"|"),!b.$headers.filter('[data-column="'+h+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=k.isArray(p)?"("+a+")":"^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d)):null},fuzzy:function(b,a,c,d){if(/^~/.test(a)){b=0;c=d.length;var f=a.slice(1);for(a=0;a'+(h.data("placeholder")||h.attr("data-placeholder")|| e.filter_placeholder.select||"")+"":"",d+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+g+'"]').append(d)}c.filter.buildDefault(b,!0);c.filter.bindSearch(b,a.$table.find("."+c.css.filter),!0);e.filter_external&&c.filter.bindSearch(b,e.filter_external);e.filter_hideFilters&&c.filter.hideFilters(b,a);a.showProcessing&&a.$table.bind("filterStart"+a.namespace+"filter filterEnd"+a.namespace+"filter",function(d,e){h=e?a.$table.find("."+ c.css.header).filter("[data-column]").filter(function(){return""!==e[k(this).data("column")]}):"";c.isProcessing(b,"filterStart"===d.type,e?h:"")});a.debug&&c.benchmark("Applying Filter widget",n);a.$table.bind("tablesorter-initialized pagerInitialized",function(){l=c.filter.setDefaults(b,a,e)||[];l.length&&c.setFilters(b,l,!0);a.$table.trigger("filterFomatterUpdate");c.filter.checkFilters(b,l)});e.filter_initialized=!0;a.$table.trigger("filterInit")},setDefaults:function(b,a,e){var d,f=c.getFilters(b)|| [];e.filter_saveFilters&&c.storage&&(d=c.storage(b,"tablesorter-filters")||[],(b=k.isArray(d))&&""===d.join("")||!b||(f=d));if(""===f.join(""))for(b=0;b';for(b=0;b";a.$filters=k(f+"").appendTo(a.$table.children("thead").eq(0)).find("td");for(b=0;b").appendTo(a.$filters.eq(b)):(e.filter_formatter&&k.isFunction(e.filter_formatter[b])?((f=e.filter_formatter[b](a.$filters.eq(b),b))&&0===f.length&&(f=a.$filters.eq(b).children("input")), f&&(0===f.parent().length||f.parent().length&&f.parent()[0]!==a.$filters[b])&&a.$filters.eq(b).append(f)):f=k('').appendTo(a.$filters.eq(b)),f&&f.attr("placeholder",d.data("placeholder")||d.attr("data-placeholder")||e.filter_placeholder.search||"")),f&&(d=(k.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[b]?e.filter_cssFilter[b]||"":"":e.filter_cssFilter)||"",f.addClass(c.css.filter+" "+d).attr("data-column",b),h&&(f.attr("placeholder","").addClass("disabled")[0].disabled= !0))},bindSearch:function(b,a,e){b=k(b)[0];a=k(a);if(a.length){var d=b.config,f=d.widgetOptions,h=f.filter_$externalFilters;!0!==e&&(f.filter_$anyMatch=a.filter('[data-column="all"]'),f.filter_$externalFilters=h&&h.length?f.filter_$externalFilters.add(a):a,c.setFilters(b,d.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keypress","keyup","search","change",""].join(d.namespace+"filter ")).bind(["keyup","search","change",""].join(d.namespace+"filter "), function(a){k(this).attr("data-lastSearchTime",(new Date).getTime());if(27===a.which)this.value="";else if("number"===typeof f.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===f.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===f.filter_liveSearch))return;c.filter.searching(b,!0,!0)}).bind("keypress."+d.namespace+"filter",function(a){13===a.which&&(a.preventDefault(),k(this).blur())});d.$table.bind("filterReset", function(){a.val("")})}},checkFilters:function(b,a,e){var d=b.config,f=d.widgetOptions,h=k.isArray(a),g=h?a:c.getFilters(b,!0),l=(g||[]).join("");if(!k.isEmptyObject(d.cache)&&(h&&c.setFilters(b,g,!1,!0!==e),f.filter_hideFilters&&d.$table.find("."+c.css.filterRow).trigger(""===l?"mouseleave":"mouseenter"),d.lastCombinedFilter!==l||!1===a))if(!1===a&&(d.lastCombinedFilter=null,d.lastSearch=[]),d.$table.trigger("filterStart",[g]),d.showProcessing)setTimeout(function(){c.filter.findRows(b,g,l);return!1}, 30);else return c.filter.findRows(b,g,l),!1},hideFilters:function(b,a){var e,d,f;k(b).find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){e=k(this);clearTimeout(f);f=setTimeout(function(){/enter|over/.test(b.type)?e.removeClass("hideme"):k(document.activeElement).closest("tr")[0]!==e[0]&&""===a.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(b){d=k(this).closest("tr");clearTimeout(f);f=setTimeout(function(){if(""=== c.getFilters(a.$table).join(""))d["focus"===b.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var d,f,h,g,l,n,p,m,s,q,u,x,v,w,z,y,A,B,K,C,F,G,H,I,L,D=c.filter.regex,r=b.config,t=r.widgetOptions,M=r.columns,J=r.$table.children("tbody"),N=["range","notMatch","operators"],E=r.$headers.map(function(a){return r.parsers&&r.parsers[a]&&r.parsers[a].parsed||c.getData&&"parsed"===c.getData(r.$headers.filter('[data-column="'+a+'"]:last'),r.headers[a], "filter")||k(this).hasClass("filter-parsed")}).get();r.debug&&(K=new Date);for(l=0;l=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s))&&!(""!==s&&t.filter_functions&&!0===t.filter_functions[q]&&!r.$headers.filter('[data-column="'+q+'"]:last').hasClass("filter-match"));p=h.not("."+t.filter_filteredRow).length;y&&0===p&&(y=!1);r.debug&&c.log("Searching through "+(y&&pk.inArray(a,N)&&(w=c(C,F,H,I,L,M,b,t,E,G),null!==w))return A=w,!1}),B=null!==A?A:0<=(I+q).indexOf(F));for(m=0;m'+(g.data("placeholder")||g.attr("data-placeholder")||h.filter_placeholder.select||"")+"",l=c.filter.getOptionSource(b,a,d),n=f.$table.find("thead").find("select."+ c.css.filter+'[data-column="'+a+'"]').val();for(b=0;b"+l[b]+"":"";f=(f.$filters?f.$filters:f.$table.children("thead")).find("."+c.css.filter);h.filter_$externalFilters&&(f=f&&f.length?f.add(h.filter_$externalFilters):h.filter_$externalFilters);f.filter('select[data-column="'+a+'"]')[e?"html":"append"](g)}},buildDefault:function(b,a){var e,d,f=b.config,h=f.widgetOptions,g= f.columns;for(e=0;eb.top&&cMath.abs(n.parent().width()-n.width()),u=function(){c.storage&&m&&s&&(l={},l[m.index()]=m.width(),l[s.index()]=s.width(),m.width(l[m.index()]),s.width(l[s.index()]),!1!==e.resizable&&c.storage(b,"tablesorter-resizable",a.$headers.map(function(){return k(this).width()}).get()));p=0;m=s=null;k(window).trigger("resize")};if(l=c.storage&&!1!==e.resizable?c.storage(b,"tablesorter-resizable"):{})for(g in l)!isNaN(g)&&g');e.resizable_addLastColumn|| (h=h.slice(0,-1));f=f?f.add(h):h});f.each(function(){var a=k(this),b=parseInt(a.css("padding-right"),10)+10;a.find("."+c.css.wrapper).append('
')}).bind("mousemove.tsresize",function(a){if(0!==p&&m){var b=a.pageX-p,c=m.width();m.width(c+b);m.width()!==c&&q&&s.width(s.width()-b);p=a.pageX}}).bind("mouseup.tsresize",function(){u()}).find("."+c.css.resizer+",."+c.css.grip).bind("mousedown", function(b){m=k(b.target).closest("th");var c=a.$headers.filter('[data-column="'+m.attr("data-column")+'"]');1'),a.cssIcon&&g.find("."+c.css.icon).addClass(n.icons),d.hasClass("hasFilters")&&g.find("."+c.css.filterRow).addClass(n.filterRow));for(d=0;d=]/g},types:{regex:function(b,a,e,d){if(c.filter.regex.regex.test(a)){var f;b=c.filter.regex.regex.exec(a);try{f=(new RegExp(b[1],b[2])).test(d)}catch(g){f=!1}return f}return null},operators:function(b,a,e,d,f,g,h,k,n){if(/^[<>]=?/.test(a)){var p;e=h.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),h);k=e.parsers[g];e=b;if(n[g]||"numeric"=== k.type)p=k.format(l.trim(""+a.replace(c.filter.regex.operators,"")),h,[],g),b="number"!==typeof p||""===p||isNaN(p)?b:p;d=!n[g]&&"numeric"!==k.type||isNaN(b)||"undefined"===typeof f?isNaN(d)?c.formatFloat(d.replace(c.filter.regex.nondigit,""),h):c.formatFloat(d,h):f;/>/.test(a)&&(p=/>=/.test(a)?d>=b:d>b);/k&&(d=e,e=k,k=d);return a>=e&&a<=k||""===e||""===k}return null},wild:function(b,a,e,d,f,g,h,k,n,p){return/[\?|\*]/.test(a)|| c.filter.regex.orReplace.test(b)?(b=h.config,a=a.replace(c.filter.regex.orReplace,"|"),!b.$headers.filter('[data-column="'+g+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=l.isArray(p)?"("+a+")":"^("+a+")$"),(new RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*"))).test(d)):null},fuzzy:function(b,a,c,d){if(/^~/.test(a)){b=0;c=d.length;var f=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||e.filter_placeholder.select|| "")+"":"",d+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+h+'"]').append(d)}c.filter.buildDefault(b,!0);c.filter.bindSearch(b,a.$table.find("."+c.css.filter),!0);e.filter_external&&c.filter.bindSearch(b,e.filter_external);e.filter_hideFilters&&c.filter.hideFilters(b,a);a.showProcessing&&a.$table.bind("filterStart"+a.namespace+"filter filterEnd"+a.namespace+"filter",function(d,e){g=e?a.$table.find("."+c.css.header).filter("[data-column]").filter(function(){return""!== e[l(this).data("column")]}):"";c.isProcessing(b,"filterStart"===d.type,e?g:"")});a.debug&&c.benchmark("Applying Filter widget",n);a.$table.bind("tablesorter-initialized pagerInitialized",function(){k=c.filter.setDefaults(b,a,e)||[];k.length&&c.setFilters(b,k,!0);a.$table.trigger("filterFomatterUpdate");c.filter.checkFilters(b,k)});e.filter_initialized=!0;a.$table.trigger("filterInit")},setDefaults:function(b,a,e){var d,f=c.getFilters(b)||[];e.filter_saveFilters&&c.storage&&(d=c.storage(b,"tablesorter-filters")|| [],(b=l.isArray(d))&&""===d.join("")||!b||(f=d));if(""===f.join(""))for(b=0;b';for(d=0;d";a.$filters=l(g+"").appendTo(a.$table.children("thead").eq(0)).find("td");for(d=0;d").appendTo(a.$filters.eq(d)):((g=c.getColumnData(b,e.filter_formatter,d))?((g=g(a.$filters.eq(d),d))&&0===g.length&&(g=a.$filters.eq(d).children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==a.$filters[d])&&a.$filters.eq(d).append(g)):g=l('').appendTo(a.$filters.eq(d)),g&& g.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||e.filter_placeholder.search||"")),g&&(f=(l.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[d]?e.filter_cssFilter[d]||"":"":e.filter_cssFilter)||"",g.addClass(c.css.filter+" "+f).attr("data-column",d),h&&(g.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a,e){b=l(b)[0];a=l(a);if(a.length){var d=b.config,f=d.widgetOptions,g=f.filter_$externalFilters;!0!==e&&(f.filter_$anyMatch= a.filter('[data-column="all"]'),f.filter_$externalFilters=g&&g.length?f.filter_$externalFilters.add(a):a,c.setFilters(b,d.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keypress","keyup","search","change",""].join(d.namespace+"filter ")).bind(["keyup","search","change",""].join(d.namespace+"filter "),function(a){l(this).attr("data-lastSearchTime",(new Date).getTime());if(27===a.which)this.value="";else if("number"===typeof f.filter_liveSearch&&this.value.length< f.filter_liveSearch&&""!==this.value||"keyup"===a.type&&(32>a.which&&8!==a.which&&!0===f.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===f.filter_liveSearch))return;c.filter.searching(b,"change"!==a.type,!0)}).bind("keypress."+d.namespace+"filter",function(a){13===a.which&&(a.preventDefault(),l(this).blur())});d.$table.bind("filterReset",function(){a.val("")})}},checkFilters:function(b,a,e){var d=b.config,f=d.widgetOptions,g=l.isArray(a),h=g?a:c.getFilters(b,!0),k=(h|| []).join("");if(!l.isEmptyObject(d.cache)&&(g&&c.setFilters(b,h,!1,!0!==e),f.filter_hideFilters&&d.$table.find("."+c.css.filterRow).trigger(""===k?"mouseleave":"mouseenter"),d.lastCombinedFilter!==k||!1===a))if(!1===a&&(d.lastCombinedFilter=null,d.lastSearch=[]),d.$table.trigger("filterStart",[h]),d.showProcessing)setTimeout(function(){c.filter.findRows(b,h,k);return!1},30);else return c.filter.findRows(b,h,k),!1},hideFilters:function(b,a){var e,d,f;l(b).find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave", function(b){e=l(this);clearTimeout(f);f=setTimeout(function(){/enter|over/.test(b.type)?e.removeClass("hideme"):l(document.activeElement).closest("tr")[0]!==e[0]&&""===a.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(b){d=l(this).closest("tr");clearTimeout(f);f=setTimeout(function(){if(""===c.getFilters(a.$table).join(""))d["focus"===b.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var d, f,g,h,k,n,p,m,s,r,t,x,v,w,z,y,A,B,L,C,G,H,I,J,M,D,E=c.filter.regex,q=b.config,u=q.widgetOptions,N=q.columns,K=q.$table.children("tbody"),O=["range","notMatch","operators"],F=q.$headers.map(function(a){return q.parsers&&q.parsers[a]&&q.parsers[a].parsed||c.getData&&"parsed"===c.getData(q.$headers.filter('[data-column="'+a+'"]:last'),c.getColumnData(b,q.headers,a),"filter")||l(this).hasClass("filter-parsed")}).get();q.debug&&(L=new Date);for(k=0;k=?\s*-\d)/.test(s)||/(<=?\s*\d)/.test(s))&&!(""!==s&&q.$filters&& q.$filters.eq(r).find("select").length&&!q.$headers.filter('[data-column="'+r+'"]:last').hasClass("filter-match"));p=g.not("."+u.filter_filteredRow).length;y&&0===p&&(y=!1);q.debug&&c.log("Searching through "+(y&&pl.inArray(a,O)&&(w=d(C, G,I,J,M,N,b,u,F,H),null!==w))return A=w,!1}),B=null!==A?A:0<=(J+r).indexOf(G));for(m=0;m'+(h.data("placeholder")||h.attr("data-placeholder")||g.filter_placeholder.select||"")+"",k=c.filter.getOptionSource(b,a,d),n=f.$table.find("thead").find("select."+c.css.filter+'[data-column="'+a+'"]').val();for(b=0;b"+k[b]+"":"";f=(f.$filters? f.$filters:f.$table.children("thead")).find("."+c.css.filter);g.filter_$externalFilters&&(f=f&&f.length?f.add(g.filter_$externalFilters):g.filter_$externalFilters);f.filter('select[data-column="'+a+'"]')[e?"html":"append"](h);g.filter_functions||(g.filter_functions={});g.filter_functions[a]=!0}},buildDefault:function(b,a){var e,d,f=b.config,g=f.widgetOptions,h=f.columns;for(e=0;eb.top&&cMath.abs(n.parent().width()-n.width()),t=function(){c.storage&&m&&s&&(k={},k[m.index()]= m.width(),k[s.index()]=s.width(),m.width(k[m.index()]),s.width(k[s.index()]),!1!==e.resizable&&c.storage(b,"tablesorter-resizable",a.$headers.map(function(){return l(this).width()}).get()));p=0;m=s=null;l(window).trigger("resize")};if(k=c.storage&&!1!==e.resizable?c.storage(b,"tablesorter-resizable"):{})for(h in k)!isNaN(h)&&h');e.resizable_addLastColumn||(g=g.slice(0,-1));f=f?f.add(g):g});f.each(function(){var a=l(this),b=parseInt(a.css("padding-right"),10)+10;a.find("."+ c.css.wrapper).append('
')}).bind("mousemove.tsresize",function(a){if(0!==p&&m){var b=a.pageX-p,c=m.width();m.width(c+b);m.width()!==c&&r&&s.width(s.width()-b);p=a.pageX}}).bind("mouseup.tsresize",function(){t()}).find("."+c.css.resizer+",."+c.css.grip).bind("mousedown",function(b){m=l(b.target).closest("th");var c=a.$headers.filter('[data-column="'+m.attr("data-column")+ '"]');1