From 44abae9814328fdf81dc855ad2458800335c2a3d Mon Sep 17 00:00:00 2001 From: Mottie Date: Thu, 3 Apr 2014 10:22:19 -0500 Subject: [PATCH] version bump --- README.md | 105 +++------------------------ 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 | 10 +-- package.json | 2 +- tablesorter.jquery.json | 2 +- 8 files changed, 24 insertions(+), 107 deletions(-) diff --git a/README.md b/README.md index 6b1cde1b..7e4531b1 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,17 @@ 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.15.13 (4/3/2014) + +* Core: + * Fix widgets not being applied after an update. + * Ignore child row class name if it is the first table row +* Filter widget ignores info tbodies again. Fixes [issue #568](https://github.com/Mottie/tablesorter/issues/568) +* Docs: show resizable widget update +* Bootstrap theme: + * Fix zebra highlighting for child rows + * Thanks to [ilyai](https://github.com/ilyai) - [PR #567](https://github.com/Mottie/tablesorter/pull/567) + #### Version 2.15.12 (3/31/2014) * Replaced references to `cell.cellIndex` with `$(cell).index()` @@ -80,97 +91,3 @@ View the [complete listing here](https://github.com/Mottie/tablesorter/wiki/Chan #### Version 2.15.9 (3/12/2014) * jQuery UI Filter formatter scripts work again (broken since adding unique namespaces in v2.15.7). - -#### Version 2.15.8 (3/12/2014) - -* Filter widget - * Search delay is no longer ignored. - * Fixes issues [#544](https://github.com/Mottie/tablesorter/issues/544) & [#545](https://github.com/Mottie/tablesorter/pull/545) - * Thanks to [@dturkenk](https://github.com/dturkenk) for this contribution! - -* Align Character widget (beta) - * Added this widget to help align cell content on a character (space, decimal, etc). - * Check out [the demo](http://mottie.github.io/tablesorter/docs/example-widget-align-character.html)! - -#### Version 2.15.7 (3/9/2014) - -* Core - * Minor natural sort algorithm optimization - * Added `namespace` which should contain a unique namespace for each table; it is used when binding to event listeners. - -* Build table widget - * Removed inappropriate empty table console message when initializing. - * [build table widget](http://mottie.github.io/tablesorter/docs/example-widget-build-table.html) documentation update (includes `` scripts & css) - * Fixed nested accordions - -* Column selector widget - * Setting the `columnSelector_saveColumns` option to `true` now saves the "auto" state. Fixes [issue #517](https://github.com/Mottie/tablesorter/issues/517). - -* Filter widget - * Use the new `namespace` option to use with event listeners. Fixes [issue #535](https://github.com/Mottie/tablesorter/issues/535). - -* headerTitles widget - * Sorry for all of these breaking changes, I should have left this widget in beta. - * The `headerTitle_prefix`, `headerTitle_text`, `headerTitle_numeric` options has been replaced, in lieu of the new ouput options; sorry for no deprecation notice. - * Added `headerTitle_useAria`, `headerTitle_tooltip`, `headerTitle_output_sorted`, `headerTitle_output_unsorted`, `headerTitle_output_nosort`, `headerTitle_cur_text`, `headerTitle_cur_numeric`, `headerTitle_nxt_text`, `headerTitle_nxt_numeric`, `headerTitle_type` & `headerTitle_callback` options. See the [headerTitles widget demo](http://mottie.github.io/tablesorter/docs/example-widget-header-titles.html) for more details. - * Added `"refreshHeaderTitle"` method to force the widget to update. - -#### Version 2.15.6 (3/7/2014) - -* Doc - * Added docs for `$.tablesorter.language` which contains the text used in the `aria-label` for the header - * Update `isValueInArray` & `sortAppend` docs. - -* Core - * Destroy now unbinds the `updateCache` method properly - * Update `$.tablesorter.isValueInArray` function & `sortAppend` option. Fixes [issue #523](https://github.com/Mottie/tablesorter/issues/523). - * All test dates are now time zone & DST independent. Fixes [issue #516](https://github.com/Mottie/tablesorter/issues/516). - * Added tests for `sortForce`, `sortAppend`, `sortMultiSortKey` and `sortResetKey`. - * Cache natural sort regex. - * Date parsers now return the original cell text instead of an empty string when encountering invalid dates. Sort of fixes [issue #531](https://github.com/Mottie/tablesorter/issues/531). - * Event fixes: - * Sort events will now only show when the table is being sorted; previously when updating an unsorted table, sort events would fire. - * The `updateComplete` event now fires after every triggered update (`update`, `updateRows`, `updateAll`, `updateCell` & `addRows`) - * Updated pager to correctly trigger the `updateComplete` event when using ajax. - * Added unit tests to ensure these events fire on an empty table. - * Fixes [issue #532](https://github.com/Mottie/tablesorter/issues/532) - -* ColumnSelector widget - * Make column disable, visible & invisible methods consistent. Fixes [issue #519](https://github.com/Mottie/tablesorter/issues/519) - -* Filter widget - * Preset filter searches (set by `data-value` on the header) work again. Fixes issues [#511](https://github.com/Mottie/tablesorter/issues/511) & [#525](https://github.com/Mottie/tablesorter/issues/525). - * Add note to docs about adding a placeholder. Fixes [issue #522](https://github.com/Mottie/tablesorter/issues/522). - * Filter build select function no longer causes a javascript error on empty tables. Fixes [issue #528](https://github.com/Mottie/tablesorter/issues/528). - -* Grouping widget - * The `collapsed` option once again shows the group headers. Fixes issues [#514](https://github.com/Mottie/tablesorter/issues/514) & [533](https://github.com/Mottie/tablesorter/issues/533) - * Add `group_saveGroups` & `group_saveReset` options: - * The `group_saveGroups` option (`true` by default) saves the group name of any collapsed groups (requires `group_collapsible` to be `true`) - * The `group_saveReset` option (`null` by default) contains a jQuery selector string or jQuery object pointing to an element to be used to clear the saved groups. - * Both of these options require the storage utility script contained within the `jquery.tablesorter.widgets.js` file. - * Fullfils feature request of [issue #514](https://github.com/Mottie/tablesorter/issues/514). - * Added details about using regular expressions within the `group_separator` option. - -* Header Titles widget (headerTitles) - * New widget which adds the current sort to the header title attribute. - * It distinguishes between a text and numeric sort and includes the current sort direction - * A prefix can be included. - * By default, an ascending sort shows either "A - Z" or "0 - 9", or "Z - A" or "9 - 0" for descending sorts. - * Note that date columns will show as numeric - * Fixes [issue #529](https://github.com/Mottie/tablesorter/issues/529). - -* Pager (addon & widget) - * Ensure empty array `[]` and array of empty strings `['', '', '']` evaluate as the same when checking if the filters have changed. Fixes [issue #202](https://github.com/Mottie/tablesorter/issues/202) (again). - * Compare `totalRows` vs. `totalPages` when preventing an ajax call. - * Changes to make the `updateComplete` event fire, but because of the asynchronous nature of ajax, it fires before any `sortEnd` events. It may take some more work to resolve this, if it becomes a concern. - * Attempted to fix pager row count issue. See [issue #455](https://github.com/Mottie/tablesorter/issues/455). - -* Miscellaneous - * Pager custom controls (beta) now shows no pages on a single page. Fixes [issue #518](https://github.com/Mottie/tablesorter/issues/518) - * Increase Bootstrap 3 theme css specificity. See [issue #515](https://github.com/Mottie/tablesorter/issues/515) - * Checkbox parser no longer causes a js error when a checkbox doesn't exist. - -#### Version 2.15.5 (2/23/2014) - -* Pager widget now initializes properly when using ajax. Fixes [issue #510](https://github.com/Mottie/tablesorter/issues/510). diff --git a/bower.json b/bower.json index 826fde5d..f5a633b4 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "tablesorter", - "version": "2.15.12", + "version": "2.15.13", "dependencies": { "jquery": ">=1.2.6" } diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 9b9f2752..7a9bdd66 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /**! -* TableSorter 2.15.12 - Client-side table sorting with ease! +* TableSorter 2.15.13 - 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.15.12"; + ts.version = "2.15.13"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 1a3f0843..a50ba350 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.15.12 min - Client-side table sorting with ease! +* TableSorter 2.15.13 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(g){g.extend({tablesorter:new function(){function d(){var a=arguments[0],b=1':"";l.$headers=g(a).find(l.selectorHeaders).each(function(a){c=g(this);b=l.headers[a];l.headerContent[a]=g(this).html();u=l.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,e);l.onRenderTemplate&&(k= l.onRenderTemplate.apply(c,[a,u]))&&"string"===typeof k&&(u=k);g(this).html('
'+u+"
");l.onRenderHeader&&l.onRenderHeader.apply(c,[a]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,b,"sortInitialOrder")||l.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;h=f.getData(c,b,"lockedOrder")||!1;"undefined"!==typeof h&&!1!==h&&(this.order=this.lockedOrder=C(h)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+l.cssHeader); l.headerList[a]=this;c.parent().addClass(f.css.headerRow+" "+l.cssHeaderRow).attr("role","row");l.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});G(a);l.debug&&(v("Built headers:",p),d(l.$headers))}function B(a,b,c){var k=a.config;k.$table.find(k.selectorRemove).remove();r(a);w(a);H(k.$table,b,c)}function G(a){var b,c,k=a.config;k.$headers.each(function(e,d){c=g(d);b="false"===f.getData(d,k.headers[e],"sorter");d.sortDisabled=b;c[b?"addClass":"removeClass"]("sorter-false").attr("aria-disabled", ""+b);a.id&&(b?c.removeAttr("aria-controls"):c.attr("aria-controls",a.id))})}function F(a){var b,c,k,e=a.config,d=e.sortList,h=f.css.sortNone+" "+e.cssNone,p=[f.css.sortAsc+" "+e.cssAsc,f.css.sortDesc+" "+e.cssDesc],l=["ascending","descending"],q=g(a).find("tfoot tr").children().removeClass(p.join(" "));e.$headers.removeClass(p.join(" ")).addClass(h).attr("aria-sort","none");k=d.length;for(b=0;b"),c=g(a).width();g(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(a).prepend(b)}}function M(a,b){var c,k,e,d=a.config,f=b||d.sortList;d.sortList=[];g.each(f,function(a,b){c=[parseInt(b[0],10),parseInt(b[1],10)];if(e=d.$headers[c[0]])d.sortList.push(c),k=g.inArray(c[1],e.order),e.count=0<=k?k:c[1]%(d.sortReset? 3:2)})}function N(a,b){return a&&a[b]?a[b].type||"":""}function O(a,b,c){var k,e,d,h=a.config,p=!c[h.sortMultiSortKey],l=h.$table;l.trigger("sortStart",a);b.count=c[h.sortResetKey]?2:(b.count+1)%(h.sortReset?3:2);h.sortRestart&&(e=b,h.$headers.each(function(){this===e||!p&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=b.column;if(p){h.sortList=[];if(null!==h.sortForce)for(k=h.sortForce,c=0;ck&&(h.sortList.push([e, k]),1k&&(h.sortList.push([e,k]),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(a){return this.each(function(){var b=g.extend(!0,{},f.defaults,a);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,b):f.setup(this,b)})};f.setup=function(a,b){if(!a||!a.tHead||0===a.tBodies.length|| !0===a.hasInitialized)return b.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",k=g(a),e=g.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;g.data(a,"tablesorter",b);b.debug&&g.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===g("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=g.fn.detach?b.detach():b.remove();c=g(a).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove();a.isProcessing=!1};f.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};f.bindEvents=function(a,b){a=g(a)[0];var c,d=a.config;b.find(d.selectorSort).add(b.filter(d.selectorSort)).unbind(["mousedown", "mouseup","sort","keyup",""].join(d.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(d.namespace+" "),function(e,f){var h;h=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup/.test(h)||"keyup"===h&&13!==e.which||"mouseup"===h&&!0!==f&&250<(new Date).getTime()-c)){if("mousedown"===h)return c=(new Date).getTime(),"INPUT"===e.target.tagName?"":!d.cancelSelection;d.delayInit&&m(d.cache)&&w(a);h=/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];h=d.$headers[b.index(h)];h.sortDisabled|| O(a,h,e)}});d.cancelSelection&&b.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(a){var b=g(a)[0].config;b.$table.find(b.selectorHeaders).each(function(a){g(this).find("."+f.css.headerIn).length&&g(this).html(b.headerContent[a])})};f.destroy=function(a,b,c){a=g(a)[0];if(a.hasInitialized){f.refreshWidgets(a,!0,!0);var d=g(a),e=a.config,u=d.find("thead:first"),h=u.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+ e.cssHeaderRow),m=d.find("tfoot:first > tr").children("th, td");u.find("tr").not(h).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(m).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column"); h.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(a);!1!==b&&d.removeClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme);a.hasInitialized=!1;"function"===typeof c&&c(a)}};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(a,b){if(a===b)return 0;var c,d,e,g,h,m;d=f.regex;if(d.hex.test(b)){c=parseInt(a.match(d.hex),16);e=parseInt(b.match(d.hex), 16);if(ce)return 1}c=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");m=Math.max(c.length,d.length);for(h=0;hg)return 1}return 0};f.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo]; return""===a&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===b&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(a,b)};f.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===b&&0!==c?"boolean"===typeof c?c?1:-1:-c||-1:f.sortNatural(b,a)};f.sortText=function(a,b){return a>b?1:ag.inArray(h[k].id,m))&&(e.debug&&d('Refeshing widgets: Removing "'+h[k].id+'"'),h[k].hasOwnProperty("remove")&& e.widgetInit[h[k].id]&&(h[k].remove(a,e,e.widgetOptions),e.widgetInit[h[k].id]=!1));!0!==c&&f.applyWidget(a,b)};f.getData=function(a,b,c){var d="";a=g(a);var e,f;if(!a.length)return"";e=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)||"undefined"!==typeof a.data(c.toLowerCase())?d+=a.data(c)||a.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:b&&"undefined"!==typeof b[c]?d+=b[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]|| "");return g.trim(d)};f.formatFloat=function(a,b){if("string"!==typeof a||""===a)return a;var c;a=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?a.replace(/,/g,""):a.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(a)&&(a=a.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(a);return isNaN(c)?g.trim(a):c};f.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var n=g.tablesorter;g.fn.extend({tablesorter:n.construct}); n.addParser({id:"text",is:function(){return!0},format:function(d,v){var m=v.config;d&&(d=g.trim(m.ignoreCase?d.toLocaleLowerCase():d),d=m.sortLocaleCompare?n.replaceAccents(d):d);return d},type:"text"});n.addParser({id:"digit",is:function(d){return n.isDigit(d)},format:function(d,v){var m=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof m?m:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d|| "").replace(/[+\-,. ]/g,""))},format:function(d,v){var m=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof m?m:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var m,t=d?d.split("."):"",r="",w=t.length;for(m=0;md.length},format:function(d,g){return d?n.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});n.addParser({id:"usLongDate", is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,m,t){if(d){m=g.config; var r=m.$headers.filter("[data-column="+t+"]:last");t=r.length&&r[0].dateFormat||n.getData(r,m.headers[t],"dateFormat")||m.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===t&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?n.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"});n.addParser({id:"time", is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"metadata",is:function(){return!1},format:function(d,n,m){d=n.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(m).metadata()[d]},type:"numeric"});n.addWidget({id:"zebra",priority:90,format:function(d,v,m){var t,r,w,z,D,C,E=RegExp(v.cssChildRow, "i"),B=v.$tbodies;v.debug&&(D=new Date);for(d=0;d':"";l.$headers=g(a).find(l.selectorHeaders).each(function(a){c=g(this);b=l.headers[a];l.headerContent[a]=g(this).html();u=l.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,e);l.onRenderTemplate&&(k= l.onRenderTemplate.apply(c,[a,u]))&&"string"===typeof k&&(u=k);g(this).html('
'+u+"
");l.onRenderHeader&&l.onRenderHeader.apply(c,[a]);this.column=parseInt(g(this).attr("data-column"),10);this.order=C(f.getData(c,b,"sortInitialOrder")||l.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;h=f.getData(c,b,"lockedOrder")||!1;"undefined"!==typeof h&&!1!==h&&(this.order=this.lockedOrder=C(h)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+l.cssHeader); l.headerList[a]=this;c.parent().addClass(f.css.headerRow+" "+l.cssHeaderRow).attr("role","row");l.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});G(a);l.debug&&(v("Built headers:",p),d(l.$headers))}function B(a,b,c){var k=a.config;k.$table.find(k.selectorRemove).remove();r(a);w(a);H(k.$table,b,c)}function G(a){var b,c,k=a.config;k.$headers.each(function(e,d){c=g(d);b="false"===f.getData(d,k.headers[e],"sorter");d.sortDisabled=b;c[b?"addClass":"removeClass"]("sorter-false").attr("aria-disabled", ""+b);a.id&&(b?c.removeAttr("aria-controls"):c.attr("aria-controls",a.id))})}function F(a){var b,c,k,e=a.config,d=e.sortList,h=f.css.sortNone+" "+e.cssNone,p=[f.css.sortAsc+" "+e.cssAsc,f.css.sortDesc+" "+e.cssDesc],l=["ascending","descending"],q=g(a).find("tfoot tr").children().removeClass(p.join(" "));e.$headers.removeClass(p.join(" ")).addClass(h).attr("aria-sort","none");k=d.length;for(b=0;b"),c=g(a).width();g(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(g("").css("width",parseInt(g(this).width()/c*1E3,10)/10+"%"))});g(a).prepend(b)}}function M(a,b){var c,k,e,d=a.config,f=b||d.sortList;d.sortList=[];g.each(f,function(a,b){c=[parseInt(b[0],10),parseInt(b[1],10)];if(e=d.$headers[c[0]])d.sortList.push(c),k=g.inArray(c[1],e.order),e.count=0<=k?k:c[1]%(d.sortReset? 3:2)})}function N(a,b){return a&&a[b]?a[b].type||"":""}function O(a,b,c){var k,e,d,h=a.config,p=!c[h.sortMultiSortKey],l=h.$table;l.trigger("sortStart",a);b.count=c[h.sortResetKey]?2:(b.count+1)%(h.sortReset?3:2);h.sortRestart&&(e=b,h.$headers.each(function(){this===e||!p&&g(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=b.column;if(p){h.sortList=[];if(null!==h.sortForce)for(k=h.sortForce,c=0;ck&&(h.sortList.push([e, k]),1k&&(h.sortList.push([e,k]),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(a){return this.each(function(){var b=g.extend(!0,{},f.defaults,a);!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,b):f.setup(this,b)})};f.setup= function(a,b){if(!a||!a.tHead||0===a.tBodies.length||!0===a.hasInitialized)return b.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var c="",k=g(a),e=g.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;g.data(a,"tablesorter",b);b.debug&&g.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===g("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=g.fn.detach?b.detach():b.remove();c=g(a).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove();a.isProcessing=!1};f.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};f.bindEvents=function(a,b){a=g(a)[0];var c,d=a.config;b.find(d.selectorSort).add(b.filter(d.selectorSort)).unbind(["mousedown", "mouseup","sort","keyup",""].join(d.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(d.namespace+" "),function(e,f){var h;h=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup/.test(h)||"keyup"===h&&13!==e.which||"mouseup"===h&&!0!==f&&250<(new Date).getTime()-c)){if("mousedown"===h)return c=(new Date).getTime(),"INPUT"===e.target.tagName?"":!d.cancelSelection;d.delayInit&&m(d.cache)&&w(a);h=/TH|TD/.test(this.tagName)?this:g(this).parents("th, td")[0];h=d.$headers[b.index(h)];h.sortDisabled|| O(a,h,e)}});d.cancelSelection&&b.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(a){var b=g(a)[0].config;b.$table.find(b.selectorHeaders).each(function(a){g(this).find("."+f.css.headerIn).length&&g(this).html(b.headerContent[a])})};f.destroy=function(a,b,c){a=g(a)[0];if(a.hasInitialized){f.refreshWidgets(a,!0,!0);var d=g(a),e=a.config,u=d.find("thead:first"),h=u.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+ e.cssHeaderRow),m=d.find("tfoot:first > tr").children("th, td");u.find("tr").not(h).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(m).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column"); h.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(a);!1!==b&&d.removeClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme);a.hasInitialized=!1;"function"===typeof c&&c(a)}};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(a,b){if(a===b)return 0;var c,d,e,g,h,m;d=f.regex;if(d.hex.test(b)){c=parseInt(a.match(d.hex),16);e=parseInt(b.match(d.hex), 16);if(ce)return 1}c=a.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");d=b.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0");m=Math.max(c.length,d.length);for(h=0;hg)return 1}return 0};f.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo]; return""===a&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===b&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(a,b)};f.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===b&&0!==c?"boolean"===typeof c?c?1:-1:-c||-1:f.sortNatural(b,a)};f.sortText=function(a,b){return a>b?1:ag.inArray(h[k].id,m))&&(e.debug&&d('Refeshing widgets: Removing "'+h[k].id+'"'),h[k].hasOwnProperty("remove")&& e.widgetInit[h[k].id]&&(h[k].remove(a,e,e.widgetOptions),e.widgetInit[h[k].id]=!1));!0!==c&&f.applyWidget(a,b)};f.getData=function(a,b,c){var d="";a=g(a);var e,f;if(!a.length)return"";e=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)||"undefined"!==typeof a.data(c.toLowerCase())?d+=a.data(c)||a.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:b&&"undefined"!==typeof b[c]?d+=b[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]|| "");return g.trim(d)};f.formatFloat=function(a,b){if("string"!==typeof a||""===a)return a;var c;a=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?a.replace(/,/g,""):a.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(a)&&(a=a.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(a);return isNaN(c)?g.trim(a):c};f.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var n=g.tablesorter;g.fn.extend({tablesorter:n.construct}); n.addParser({id:"text",is:function(){return!0},format:function(d,v){var m=v.config;d&&(d=g.trim(m.ignoreCase?d.toLocaleLowerCase():d),d=m.sortLocaleCompare?n.replaceAccents(d):d);return d},type:"text"});n.addParser({id:"digit",is:function(d){return n.isDigit(d)},format:function(d,v){var m=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof m?m:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"currency",is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d|| "").replace(/[+\-,. ]/g,""))},format:function(d,v){var m=n.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),v);return d&&"number"===typeof m?m:d?g.trim(d&&v.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});n.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,g){var m,t=d?d.split("."):"",r="",w=t.length;for(m=0;md.length},format:function(d,g){return d?n.formatFloat(d.replace(/%/g,""),g):d},type:"numeric"});n.addParser({id:"usLongDate", is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,g,m,t){if(d){m=g.config; var r=m.$headers.filter("[data-column="+t+"]:last");t=r.length&&r[0].dateFormat||n.getData(r,m.headers[t],"dateFormat")||m.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===t?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===t&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return d?n.formatFloat((new Date(d)).getTime()||d,g):d},type:"numeric"});n.addParser({id:"time", is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,g){return d?n.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,g):d},type:"numeric"});n.addParser({id:"metadata",is:function(){return!1},format:function(d,n,m){d=n.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return g(m).metadata()[d]},type:"numeric"});n.addWidget({id:"zebra",priority:90,format:function(d,v,m){var t,r,w,z,D,C,E=RegExp(v.cssChildRow, "i"),B=v.$tbodies;v.debug&&(D=new Date);for(d=0;d'),a.cssIcon&&n.find("."+c.css.icon).addClass(m.icons),q.hasClass("hasFilters")&&n.find("."+c.css.filterRow).addClass(m.filterRow));l.each(n,function(){g=l(this);h=c.css.icon?g.find("."+c.css.icon):g;this.sortDisabled?(g.removeClass(v),h.removeClass(v+" "+m.icons)):(d=g.hasClass(c.css.sortAsc)?m.sortAsc:g.hasClass(c.css.sortDesc)? m.sortDesc:g.hasClass(c.css.header)?m.sortNone:"",g[d===m.sortNone?"removeClass":"addClass"](m.active),h.removeClass(v).addClass(d))});a.debug&&c.benchmark("Applying "+p+" theme",f)},remove:function(b,a,e){b=a.$table;a=a.theme||"jui";e=c.themes[a]||c.themes.jui;var f=b.children("thead").children(),d=e.sortNone+" "+e.sortDesc+" "+e.sortAsc;b.removeClass("tablesorter-"+a+" "+e.table).find(c.css.header).removeClass(e.header);f.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(e.hover+" "+ d+" "+e.active).find("."+c.css.filterRow).removeClass(e.filterRow);f.find("."+c.css.icon).removeClass(e.icons)}}); c.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(b,a,e){var f,d,g,h,k,q,n,p,m=a.$table,v=a.$tbodies,s=a.sortList,u=s.length,w=e&&e.columns||["primary","secondary","tertiary"],x=w.length-1;n=w.join(" ");a.debug&&(f=new Date);for(g=0;g=]/g},types:{regex:function(b,a,e,f){if(c.filter.regex.regex.test(a)){var d; b=c.filter.regex.regex.exec(a);try{d=RegExp(b[1],b[2]).test(f)}catch(g){d=!1}return d}return null},operators:function(b,a,e,f,d,g,h,k,l){if(/^[<>]=?/.test(a)){var n,p;n=h.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),h);e=n.parsers[g];k=b;if(l[g]||"numeric"===e.type)n=e.format(""+a.replace(c.filter.regex.operators,""),h,n.$headers.eq(g),g),b="number"!==typeof b||""===n||isNaN(n)?b:n;n=!l[g]&&"numeric"!==e.type||isNaN(b)||!d?isNaN(f)?c.formatFloat(f.replace(c.filter.regex.nondigit, ""),h):c.formatFloat(f,h):d;/>/.test(a)&&(p=/>=/.test(a)?n>=b:n>b);/k&&(f=e,e=k,k=f);return a>=e&&a<=k||""===e||""===k}return null},wild:function(b,a,c,f,d,g,h,k,q,n){return/[\?|\*]/.test(a)||/\s+OR\s+/i.test(b)?(b=h.config,a=a.replace(/\s+OR\s+/gi,"|"),!b.$headers.filter('[data-column="'+g+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=l.isArray(n)?"("+a+")":"^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g, "\\S*")).test(f)):null},fuzzy:function(b,a,c,f){if(/^~/.test(a)){b=0;c=f.length;var d=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||"")+"":"",f+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+h+'"]').append(f)}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",q);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 f,d=c.getFilters(b)||[];e.filter_saveFilters&&c.storage&&(f=c.storage(b,"tablesorter-filters")||[],(b=l.isArray(f))&&""===f.join("")||!b||(d=f));if(""===d.join(""))for(b=0;b';for(b=0;b";a.$filters=l(d+"").appendTo(a.$table.children("thead").eq(0)).find("td"); for(b=0;b").appendTo(a.$filters.eq(b)):(e.filter_formatter&&l.isFunction(e.filter_formatter[b])?((d=e.filter_formatter[b](a.$filters.eq(b),b))&&0=== d.length&&(d=a.$filters.eq(b).children("input")),d&&(0===d.parent().length||d.parent().length&&d.parent()[0]!==a.$filters[b])&&a.$filters.eq(b).append(d)):d=l('').appendTo(a.$filters.eq(b)),d&&d.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||"")),d&&(f=(l.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[b]?e.filter_cssFilter[b]||"":"":e.filter_cssFilter)||"",d.addClass(c.css.filter+" "+f).attr("data-column",b),g&&(d.addClass("disabled")[0].disabled= !0))},bindSearch:function(b,a,e){b=l(b)[0];a=l(a);if(a.length){var f=b.config,d=f.widgetOptions,g=d.filter_$externalFilters;!0!==e&&(d.filter_$anyMatch=a.filter('[data-column="all"]'),d.filter_$externalFilters=g&&g.length?d.filter_$externalFilters.add(a):a,c.setFilters(b,f.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keyup","search","change",""].join(f.namespace+"filter ")).bind(["keyup","search","change",""].join(f.namespace+"filter "),function(a, e){l(this).attr("data-lastSearchTime",(new Date).getTime());if(27===a.which)this.value="";else if("number"===typeof d.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===d.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===d.filter_liveSearch))return;c.filter.searching(b,!0,!0)});f.$table.bind("filterReset",function(){a.val("")})}},checkFilters:function(b,a,e){var f=b.config,d=f.widgetOptions,g=l.isArray(a), h=g?a:c.getFilters(b,!0),k=(h||[]).join("");g&&c.setFilters(b,h,!1,!0!==e);d.filter_hideFilters&&f.$table.find("."+c.css.filterRow).trigger(""===k?"mouseleave":"mouseenter");if(f.lastCombinedFilter!==k||!1===a)if(!1===a&&(f.lastCombinedFilter=null),f.$table.trigger("filterStart",[h]),f.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,f,d;a.$table.find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave", function(b){e=l(this);clearTimeout(d);d=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(a){f=l(this).closest("tr");clearTimeout(d);d=setTimeout(function(){if(""===c.getFilters(b).join(""))f["focus"===a.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var f,d, g,h,k,q,n,p,m,v,s,u,w,x,A,z,y,D,B,C,L,E,G,H,I,J,M,r=b.config,t=r.widgetOptions,N=r.columns,K=r.$tbodies,O=["range","notMatch","operators"],F=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"):l(this).hasClass("filter-parsed"))}).get();r.debug&&(L=new Date);for(q=0;ql.inArray(a,O)&&(z=c(E,G,I,J,M,N,b,t,F,H),null!==z))return B=z,!1}),C=null!==B?B:0<=(J+s).indexOf(G));for(m=0;m'+(p.data("placeholder")||p.attr("data-placeholder")||"")+"";for(g=0;g"+n[f]+"":"";k=(k.$filters?k.$filters:k.$table.children("thead")).find("."+c.css.filter);b.filter_$externalFilters&&(k=k&&k.length?k.add(b.filter_$externalFilters): b.filter_$externalFilters);k.filter('select[data-column="'+a+'"]')[e?"html":"append"](m)}},buildDefault:function(b,a){var e,f,d=b.config,g=d.widgetOptions,h=d.columns;for(e=0;eb.top&&c=]/g},types:{regex:function(b,a,e,f){if(c.filter.regex.regex.test(a)){var d; b=c.filter.regex.regex.exec(a);try{d=RegExp(b[1],b[2]).test(f)}catch(g){d=!1}return d}return null},operators:function(b,a,e,f,d,g,h,k,l){if(/^[<>]=?/.test(a)){var n,p;n=h.config;b=c.formatFloat(a.replace(c.filter.regex.operators,""),h);e=n.parsers[g];k=b;if(l[g]||"numeric"===e.type)n=e.format(""+a.replace(c.filter.regex.operators,""),h,n.$headers.eq(g),g),b="number"!==typeof b||""===n||isNaN(n)?b:n;n=!l[g]&&"numeric"!==e.type||isNaN(b)||!d?isNaN(f)?c.formatFloat(f.replace(c.filter.regex.nondigit, ""),h):c.formatFloat(f,h):d;/>/.test(a)&&(p=/>=/.test(a)?n>=b:n>b);/k&&(f=e,e=k,k=f);return a>=e&&a<=k||""===e||""===k}return null},wild:function(b,a,c,f,d,g,h,k,q,n){return/[\?|\*]/.test(a)||/\s+OR\s+/i.test(b)?(b=h.config,a=a.replace(/\s+OR\s+/gi,"|"),!b.$headers.filter('[data-column="'+g+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a=l.isArray(n)?"("+a+")":"^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g, "\\S*")).test(f)):null},fuzzy:function(b,a,c,f){if(/^~/.test(a)){b=0;c=f.length;var d=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||"")+"":"",f+='");a.$table.find("thead").find("select."+c.css.filter+'[data-column="'+h+'"]').append(f)}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",q);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 f,d=c.getFilters(b)||[];e.filter_saveFilters&&c.storage&&(f=c.storage(b,"tablesorter-filters")||[],(b=l.isArray(f))&&""===f.join("")||!b||(d=f));if(""===d.join(""))for(b=0;b';for(b=0;b";a.$filters=l(d+"").appendTo(a.$table.children("thead").eq(0)).find("td"); for(b=0;b").appendTo(a.$filters.eq(b)):(e.filter_formatter&&l.isFunction(e.filter_formatter[b])?((d=e.filter_formatter[b](a.$filters.eq(b),b))&&0=== d.length&&(d=a.$filters.eq(b).children("input")),d&&(0===d.parent().length||d.parent().length&&d.parent()[0]!==a.$filters[b])&&a.$filters.eq(b).append(d)):d=l('').appendTo(a.$filters.eq(b)),d&&d.attr("placeholder",f.data("placeholder")||f.attr("data-placeholder")||"")),d&&(f=(l.isArray(e.filter_cssFilter)?"undefined"!==typeof e.filter_cssFilter[b]?e.filter_cssFilter[b]||"":"":e.filter_cssFilter)||"",d.addClass(c.css.filter+" "+f).attr("data-column",b),g&&(d.addClass("disabled")[0].disabled= !0))},bindSearch:function(b,a,e){b=l(b)[0];a=l(a);if(a.length){var f=b.config,d=f.widgetOptions,g=d.filter_$externalFilters;!0!==e&&(d.filter_$anyMatch=a.filter('[data-column="all"]'),d.filter_$externalFilters=g&&g.length?d.filter_$externalFilters.add(a):a,c.setFilters(b,f.$table.data("lastSearch")||[],!1===e));a.attr("data-lastSearchTime",(new Date).getTime()).unbind(["keyup","search","change",""].join(f.namespace+"filter ")).bind(["keyup","search","change",""].join(f.namespace+"filter "),function(a, e){l(this).attr("data-lastSearchTime",(new Date).getTime());if(27===a.which)this.value="";else if("number"===typeof d.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===d.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===d.filter_liveSearch))return;c.filter.searching(b,!0,!0)});f.$table.bind("filterReset",function(){a.val("")})}},checkFilters:function(b,a,e){var f=b.config,d=f.widgetOptions,g=l.isArray(a), h=g?a:c.getFilters(b,!0),k=(h||[]).join("");g&&c.setFilters(b,h,!1,!0!==e);d.filter_hideFilters&&f.$table.find("."+c.css.filterRow).trigger(""===k?"mouseleave":"mouseenter");if(f.lastCombinedFilter!==k||!1===a)if(!1===a&&(f.lastCombinedFilter=null),f.$table.trigger("filterStart",[h]),f.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,f,d;a.$table.find("."+c.css.filterRow).addClass("hideme").bind("mouseenter mouseleave", function(b){e=l(this);clearTimeout(d);d=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(a){f=l(this).closest("tr");clearTimeout(d);d=setTimeout(function(){if(""===c.getFilters(b).join(""))f["focus"===a.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,e){if(b.config.lastCombinedFilter!==e){var f,d, g,h,k,q,n,p,m,v,s,u,w,x,A,z,y,D,B,C,L,E,G,H,I,J,M,r=b.config,t=r.widgetOptions,N=r.columns,K=r.$table.children("tbody"),O=["range","notMatch","operators"],F=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"):l(this).hasClass("filter-parsed"))}).get();r.debug&&(L=new Date);for(q=0;ql.inArray(a,O)&&(z=c(E,G,I,J,M,N,b,t,F,H),null!==z))return B=z,!1}),C=null!==B?B:0<=(J+s).indexOf(G));for(m=0;m'+(p.data("placeholder")||p.attr("data-placeholder")||"")+"";for(g=0;g"+n[f]+"":"";k=(k.$filters?k.$filters:k.$table.children("thead")).find("."+c.css.filter);b.filter_$externalFilters&& (k=k&&k.length?k.add(b.filter_$externalFilters):b.filter_$externalFilters);k.filter('select[data-column="'+a+'"]')[e?"html":"append"](m)}},buildDefault:function(b,a){var e,f,d=b.config,g=d.widgetOptions,h=d.columns;for(e=0;eb.top&&cMath.abs(q.parent().width()-q.width()), s=function(){c.storage&&p&&m&&(k={},k[p.index()]=p.width(),k[m.index()]=m.width(),p.width(k[p.index()]),m.width(k[m.index()]),!1!==e.resizable&&c.storage(b,"tablesorter-resizable",a.$headers.map(function(){return l(this).width()}).get()));n=0;p=m=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));d=d?d.add(g):g});d.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!==n&&p){var b=a.pageX-n,c=p.width();p.width(c+b);p.width()!==c&&v&&m.width(m.width()-b);n=a.pageX}}).bind("mouseup.tsresize",function(){s()}).find("."+c.css.resizer+",."+c.css.grip).bind("mousedown",function(b){p=l(b.target).closest("th");var c=a.$headers.filter('[data-column="'+ p.attr("data-column")+'"]');1