diff --git a/README.md b/README.md index 47787870..42b7efd6 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,39 @@ If you would like to contribute, please... View the [complete change log here](//github.com/Mottie/tablesorter/wiki/Changes). +#### Version 2.24.4 (11/10/2015) + +* Core + * `sortRestart` works again with multi-row headers. Fixes [issue #1074](https://github.com/Mottie/tablesorter/issues/1074). + * Add `sortDisabled` language setting; used in aria-labels. +* Docs + * Update `group_formatter` docs. See [issue #1077](https://github.com/Mottie/tablesorter/issues/1077). + * Add clarification & missing possible values. See [issue #1070](https://github.com/Mottie/tablesorter/issues/1070). + * Fixed mixed content issue, broken links (beta-testing demos) & other stuff. + * Add [filter + jQuery UI Selectmenu demo](http://mottie.github.io/tablesorter/docs/example-widget-filter-selectmenu.html). See [issue #1060](https://github.com/Mottie/tablesorter/issues/1060) + * Misc updates. +* Filter + * Convert filters to strings using conventional methods. + * Prevent "OR" filter type from splitting up regex string. See [issue #1070]https://github.com/Mottie/tablesorter/issues/1070). + * `filter_selectSource` option now accepts an array of objects ([demo](http://mottie.github.io/tablesorter/docs/example-widget-filter-selectmenu.html)). +* Group + * Include group & row data parameters in `group_formatter`. Fixes [issue #1077](https://github.com/Mottie/tablesorter/issues/1077). +* HeaderTitles + * Update aria-label usage. +* Math + * Avoid nested table math cells. See [Stackoverflow](http://stackoverflow.com/q/33631298/145346). +* Pager + * Clear `tbody` prior to calling `ajaxProcessing`. This again allows the developer to add the HTML to the table instead of needing to return it. +* Sort2Hash + * Make widget functions accessible. + * Add 2 utility functions to simplify hash processing. +* Toggle + * Add new widget to enable/disable sort & filter. See [issue #1075](https://github.com/Mottie/tablesorter/issues/1075). +* Parser + * Add "file-extension" parser. +* Misc + * Grunt: Fix uglify comment removal & update dist folder. + #### Version 2.24.3 (11/4/2015) * Core @@ -109,104 +142,3 @@ View the [complete change log here](//github.com/Mottie/tablesorter/wiki/Changes * Misc * Restory empty bower.json ignore setting... bower is installing an empty dist folder. - -#### Version 2.24.1 (11/2/2015) - -* Core - * Cache "shortDate" parser & time parser now extracts the time. -* Group - * Add optimizations from [pull #830](https://github.com/Mottie/tablesorter/pull/830); thanks to [VorontsovIE](https://github.com/VorontsovIE)! - * Update [demo](http://mottie.github.io/tablesorter/docs/example-widget-grouping.html) to use new "weekday-index" parser when "group-date-week" is set, and updated "time" parser when "group-date-time" is set. -* Print - * Rows option now accepts custom css selectors. -* Sort2Hash - * Remove history push state as it ignored other tables on the page. -* Parsers - * Globalization parser now caches the `Globalize` object in a same named option. - * Convert month & weekday parsers to utilize globalization data. - * Add "weekday-index" parser - this parser ignores the actual date but saves the weekday from a date object -* Misc - * Revert bower.json changes in [pull #1063](https://github.com/Mottie/tablesorter/pull/1063); Fixes [issue #1068](https://github.com/Mottie/tablesorter/issues/1068). - -#### Version 2.24.0 (10/31/2015) - -* Docs - * Fix mixed content using GitHub buttons on main page. See [pull #1029](https://github.com/Mottie/tablesorter/pull/1029); thanks [OmgImAlexis](https://github.com/OmgImAlexis)! - * Clarify use of pager `ajaxUrl` option. - * Add theme class to tables to prevent FOUC. - * Fix left menu push. The body no longer squeezes the content. - * Update stickyHeaders after menu close. - * Include horizontal scroll while jumping to search result. - * Add some examples (`filter_cssFilter`). -* Global - * Call internal functions directly; stop using triggered events. -* Core - * Use plain javascript to set index attribute & remove unused variable. See [issue #1048](https://github.com/Mottie/tablesorter/issues/1048). - * Add "entire column `colspan`" support. See issues [#485](https://github.com/Mottie/tablesorter/issues/485), [#746](https://github.com/Mottie/tablesorter/issues/746) & [#1047](https://github.com/Mottie/tablesorter/issues/1047). - * Fix parser detect & sortVars on columns that don't exist due to colspan. See issues [#485](https://github.com/Mottie/tablesorter/issues/485), [#746](https://github.com/Mottie/tablesorter/issues/746) & [#1047](https://github.com/Mottie/tablesorter/issues/1047). - * Reformat structure & expand variable names. - * Add `rowFilter` parameter to `getColumnText` function. - * Fix multisort indicators. Fixes [issue #1005](https://github.com/Mottie/tablesorter/issues/1005), again. - * `sortAppend` now accepts an object of column references; see [Stackoverflow](http://stackoverflow.com/q/33177910/145346). - * Internalize sort counter & fix spanned sorts. - * Add `"tablesorter-ready"` event. - * Add widget from class before adding widget options. - * Maintaining support for IE7-8 until 1/12/16. -* Chart - * Fix `chart_layout` column indexing. -* ColumnSelector - * Add `mediaqueryHidden` option. Resolves [issue #964](https://github.com/Mottie/tablesorter/issues/964). - * Extra rows & colspans now supported in `thead` & `tfoot`. Fixes [issue #501](https://github.com/Mottie/tablesorter/issues/501). - * Fix jscs reported issues. -* Filter - * Encode/decode filters in case they end up in cookies. See [issue #1026](https://github.com/Mottie/tablesorter/issues/1026). - * Add "entire column `colspan`" support. See issues [#485](https://github.com/Mottie/tablesorter/issues/485), [#746](https://github.com/Mottie/tablesorter/issues/746) & [#1047](https://github.com/Mottie/tablesorter/issues/1047). - * `hideFilters` applies to stickyHeaders again. Fixes [issue #1050](https://github.com/Mottie/tablesorter/issues/1050). - * Prevent error in `formatterUpdated`. Fixes [issue #1056](https://github.com/Mottie/tablesorter/issues/1056). -* Grouping - * Prevent error if `group_forceColumn` is improperly defined. See [issue #1030](https://github.com/Mottie/tablesorter/issues/1030). - * Improve compatibility with [jQuery Globalize](https://github.com/jquery/globalize); Find [more details here](http://mottie.github.io/tablesorter/docs/example-widget-grouping.html#globalization). - * Update header in pager with `removeRows:true`. Fixes [issue #1035](https://github.com/Mottie/tablesorter/issues/1035). -* HeaderTitles - * Switch to use internalized sort counter. -* Lazyload - * Add new widget. [Demo](http://mottie.github.io/tablesorter/docs/example-widget-lazyload.html) -* Math - * Created new calculation type "below". It works just like "above" except in other direction starting from top to bottom. See [pull #1027](https://github.com/Mottie/tablesorter/pull/1027); thanks [LvLynx](https://github.com/LvLynx)! - * Tweak changes & more tweaks for better compression. - * Detach table prior to indexing all cells. See [issue #1048](https://github.com/Mottie/tablesorter/issues/1048). - * Add `math_none` option. - * Include `config` parameter in math equations - needed for `math_none` option. -* Output - * Correct `formatContent` function comment (missing widgetOptions variable) - * Do not include nested table headers with parent. Fixes [issue #1040](https://github.com/Mottie/tablesorter/issues/1040). -* Pager - * Clear tbody if no data returned by ajax. See [issue #1032](https://github.com/Mottie/tablesorter/issues/1032). - * Add "all" setting for page size methods; includes select option & all methods. See [issue #1055](https://github.com/Mottie/tablesorter/issues/1055). - * Fix pager widget demo destroy method. - * destroyPager again reveals all rows. Fixes [issue #1055](https://github.com/Mottie/tablesorter/issues/1055). - * Parse page numbers to prevent user seeing `NaN`. - * Parse page size updates. -* Print - * Internal variable tweaks. - * Include css to hide filter rows. Fixes [issue #1046](https://github.com/Mottie/tablesorter/issues/1046). - * Add print delay; allows browsers to render print preview. -* Scroller - * Fix `scroller_barWidth` issue in iOS. See [pull #1062](https://github.com/Mottie/tablesorter/pull/1062); thanks [fire-wally](https://github.com/fire-wally)! -* Sort2Hash - * Update to include pager (page & size) and filter parameters. -* SortTbodies - * Moved config string defaults to `$.tablesorter.strings` to match core reformatting. -* StickyHeaders - * `hideFilters` applies to stickyHeaders again. Fixes [issue #1050](https://github.com/Mottie/tablesorter/issues/1050). -* View - * Add new widget. [Demo](http://mottie.github.io/tablesorter/docs/example-widget-view.html). - * Fix jscs reported issues. -* Parsers - * Globalize parser now allows a different language per column. - * Fix jscs reported issues. -* Misc - * Bower: use correct theme name. Fixes [issue #1028](https://github.com/Mottie/tablesorter/issues/1028). - * Readme: Add link to [UserFrosting](https://github.com/alexweissman/UserFrosting) by [alexweissman](https://github.com/alexweissman) - * Updated build dependencies x2. - * Added development files & directories to bower ignore. See [pull #1063](https://github.com/Mottie/tablesorter/pull/1063); thanks [jdufresne](https://github.com/jdufresne)! diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index 0545571d..7f9ed052 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter (FORK) pager plugin - * updated 10/31/2015 (v2.24.0) + * updated 11/10/2015 (v2.24.4) */ /*jshint browser:true, jquery:true, unused:false */ ;(function($) { diff --git a/dist/css/theme.blue.nested.min.css b/dist/css/theme.blue.nested.min.css new file mode 100644 index 00000000..4083373c --- /dev/null +++ b/dist/css/theme.blue.nested.min.css @@ -0,0 +1 @@ +.tablesorter-blue{width:100%;background-color:#fff;margin:10px 0 15px;text-align:left;border-spacing:0;border:1px solid #cdcdcd;border-width:1px 0 0 1px}.tablesorter-blue>*>tr>td,.tablesorter-blue>*>tr>th{border:1px solid #cdcdcd;border-width:0 1px 1px 0}.tablesorter-blue>*>tr>th,.tablesorter-blue>tfoot>tr>td,.tablesorter-blue>thead>tr>td{font:12px/18px Arial,Sans-serif;font-weight:700;color:#000;background-color:#99bfe6;border-collapse:collapse;padding:4px;text-shadow:0 1px 0 rgba(204,204,204,.7)}.tablesorter-blue>tbody>tr>td,.tablesorter-blue>tfoot>tr>td,.tablesorter-blue>tfoot>tr>th{padding:4px;vertical-align:top}.tablesorter-blue>thead>tr>.tablesorter-header{background-repeat:no-repeat;background-position:center right;padding:4px 18px 4px 4px;white-space:normal;cursor:pointer}.tablesorter-blue>thead>tr>.tablesorter-headerUnSorted{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==)}.tablesorter-blue>tfoot>tr>.tablesorter-headerAsc,.tablesorter-blue>thead>tr>.tablesorter-headerAsc{background-color:#9fbfdf;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7)}.tablesorter-blue>tfoot>tr>.tablesorter-headerDesc,.tablesorter-blue>thead>tr>.tablesorter-headerDesc{background-color:#8cb3d9;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-blue>thead>tr>.sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-blue>tfoot>tr>.tablesorter-headerAsc,.tablesorter-blue>tfoot>tr>.tablesorter-headerDesc{background-image:none}.tablesorter-blue>tbody>tr>td{color:#3d3d3d;background-color:#fff;padding:4px;vertical-align:top}.tablesorter-blue>tbody>tr.even.hover>td,.tablesorter-blue>tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr.even:hover>td,.tablesorter-blue>tbody>tr.hover>td,.tablesorter-blue>tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr:hover>td{background-color:#d9d9d9}.tablesorter-blue>tbody>tr.odd.hover>td,.tablesorter-blue>tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-blue>tbody>tr.odd:hover>td{background-color:#bfbfbf}.tablesorter-blue>thead>tr>.tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-blue>tbody tr.odd>td{background-color:#ebf2fa}.tablesorter-blue>tbody tr.even>td{background-color:#fff}.tablesorter-blue>tbody>tr.odd td.primary,.tablesorter-blue>tbody>tr>td.primary{background-color:#99b3e6}.tablesorter-blue>tbody>td.secondary,.tablesorter-blue>tbody>tr.even td.primary,.tablesorter-blue>tbody>tr.odd td.secondary{background-color:#c2d1f0}.tablesorter-blue>tbody>td.tertiary,.tablesorter-blue>tbody>tr.even td.secondary,.tablesorter-blue>tbody>tr.odd td.tertiary{background-color:#d6e0f5}.tablesorter-blue>tbody>tr.even td.tertiary{background-color:#ebf0fa}.tablesorter-blue>caption{background-color:#fff}.tablesorter-blue>thead>.tablesorter-filter-row{background-color:#eee}.tablesorter-blue>thead>.tablesorter-filter-row>td{background-color:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-blue .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-blue .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-blue .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-blue input.tablesorter-filter,.tablesorter-blue select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/js/extras/jquery.tablesorter.pager.min.js b/dist/js/extras/jquery.tablesorter.pager.min.js index b9c73c50..292c433d 100644 --- a/dist/js/extras/jquery.tablesorter.pager.min.js +++ b/dist/js/extras/jquery.tablesorter.pager.min.js @@ -1,5 +1,5 @@ /*! * tablesorter (FORK) pager plugin - * updated 10/31/2015 (v2.24.0) + * updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b=a.tablesorter;a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(a,b){return b},ajaxError:null,ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(a){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,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 c="filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete ",d=this,e=function(a,b){var c="addClass",d="removeClass",e=a.cssDisabled,f=!!b,g=f||0===a.page,h=Math.min(a.totalPages,a.filteredPages),i=f||a.page===h-1||0===h;a.updateArrows&&(a.$container.find(a.cssFirst+","+a.cssPrev)[g?c:d](e).attr("aria-disabled",g),a.$container.find(a.cssNext+","+a.cssLast)[i?c:d](e).attr("aria-disabled",i))},f=function(a,c){var d,e,f,g=a.config,h=g.$table.hasClass("hasFilters");if(h&&!c.ajaxUrl)if(b.isEmptyObject(g.cache))c.filteredRows=c.totalRows=g.$tbodies.eq(0).children("tr").not(c.countChildRows?"":"."+g.cssChildRow).length;else for(c.filteredRows=0,d=g.cache[0].normalized,f=d.length,e=0;f>e;e++)c.filteredRows+=c.regexRows.test(d[e][g.columns].$row[0].className)?0:1;else h||(c.filteredRows=c.totalRows)},g=function(c,d,g){if(!d.initializing){var j,k,l,m,n,o,p=c.config,q=p.namespace+"pager",r=t(d,d.size,"get");if(d.countChildRows&&k.push(p.cssChildRow),d.totalPages=Math.ceil(d.totalRows/r),p.totalRows=d.totalRows,u(d),f(c,d),p.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/r)||0,Math.min(d.totalPages,d.filteredPages)>=0){if(k=d.size*d.page>d.filteredRows&&g,d.page=k?d.pageReset||0:d.page,d.startRow=k?d.size*d.page+1:0===d.filteredRows?0:d.size*d.page+1,d.endRow=Math.min(d.filteredRows,d.totalRows,d.size*(d.page+1)),l=d.$container.find(d.cssPageDisplay),j=(d.ajaxData&&d.ajaxData.output?d.ajaxData.output||d.output:d.output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return d.totalPages?d.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,e=a.replace(/[{}\s]/g,""),f=e.split(":"),g=d.ajaxData,h=/(rows?|pages?)$/i.test(e)?0:"";return/(startRow|page)/.test(f[0])&&"input"===f[1]?(b=(""+("page"===f[0]?d.totalPages:d.totalRows)).length,c="page"===f[0]?d.page+1:d.startRow,''):f.length>1&&g&&g[f[0]]?g[f[0]][f[1]]:d[e]||(g?g[e]:h)||h}),d.$goto.length){for(k="",o=h(d),n=o.length,m=0;n>m;m++)k+='";d.$goto.html(k).val(d.page+1)}l.length&&(l["INPUT"===l[0].nodeName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change"+q).bind("change"+q,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;p.$table.trigger("pageSet"+q,[c])}))}e(d),i(c,d),d.initialized&&g!==!1&&(p.debug&&console.log("Pager: Triggering pagerComplete"),p.$table.trigger("pagerComplete",d),d.savePages&&b.storage&&b.storage(c,d.storageKey,{page:d.page,size:d.size}))}},h=function(b){var c,d,e,f,g,h,i=Math.min(b.totalPages,b.filteredPages)||1,j=5*Math.ceil(i/b.maxOptionSize/5),k=i>b.maxOptionSize,l=b.page+1,m=j,n=i-j,o=[1],p=k?j:1;for(c=p;i>=c;)o.push(c),c+=k?j:1;if(o.push(i),k){for(e=[],d=Math.max(Math.floor(b.maxOptionSize/j)-1,5),m=l-d,1>m&&(m=1),n=l+d,n>i&&(n=i),c=m;n>=c;c++)e.push(c);o=a.grep(o,function(b,c){return a.inArray(b,o)===c}),g=o.length,h=e.length,g-h>j/2&&g+h>b.maxOptionSize&&(f=Math.floor(g/2)-Math.floor(h/2),Array.prototype.splice.apply(o,[f,h])),o=o.concat(e)}return o=a.grep(o,function(b,c){return a.inArray(b,o)===c}).sort(function(a,b){return a-b})},i=function(b,c){var d,e,f=b.config,g=f.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),c.fixedHeight&&!c.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-g.height(),d>5&&a.data(b,"pagerLastSize")===c.size&&g.children("tr:visible").length')))},j=function(b,c){var d,e=b.config,f=e.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),d=f.children("tr").eq(0).height()*c.size,a.data(b,"pagerSavedHeight",d),i(b,c),a.data(b,"pagerLastSize",c.size)},k=function(a,c){if(!c.ajaxUrl){var d,e=0,f=a.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,i=c.page*c.size,j=i+c.size,k=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",l=0,m=0;for(c.cacheIndex=[],d=0;h>d;d++)g[d].className.match(k)||(m===i&&g[d].className.match(f.cssChildRow)?g[d].style.display="none":(g[d].style.display=m>=i&&j>m?"":"none",l!==m&&m>=i&&j>m&&(c.cacheIndex.push(d),l=m),m+=g[d].className.match(f.cssChildRow+"|"+f.selectorRemove.slice(1))&&!c.countChildRows?0:1,m===j&&"none"!==g[d].style.display&&g[d].className.match(b.css.cssHasChild)&&(e=d)));if(e>0&&g[e].className.match(b.css.cssHasChild))for(;++e> Ajax Error",f,h,i),b.showError(d,f,h,i),y.$tbodies.eq(0).children("tr").detach(),e.totalRows=0;else{if(a.isArray(B)?(l=isNaN(B[0])&&!isNaN(B[1]),w=B[l?1:0],e.totalRows=isNaN(w)?e.totalRows||0:w,y.totalRows=y.filteredRows=e.filteredRows=e.totalRows,u=0===e.totalRows?[]:B[l?0:1]||[],s=B[2]):(e.ajaxData=B,y.totalRows=e.totalRows=B.total,y.filteredRows=e.filteredRows="undefined"!=typeof B.filteredRows?B.filteredRows:B.total,s=B.headers,u=B.rows||[]),v=u&&u.length,u instanceof jQuery)e.processAjaxOnInit&&(y.$tbodies.eq(0).empty(),y.$tbodies.eq(0).append(u));else if(v){for(j=0;v>j;j++){for(A+="",k=0;k"+u[j][k]+"";A+=""}e.processAjaxOnInit&&y.$tbodies.eq(0).html(A)}if(e.processAjaxOnInit=!0,s&&s.length===C)for(m=z.hasClass("hasStickyHeaders"),o=m?y.widgetOptions.$sticky.children("thead:first").children("tr").children():"",n=z.find("tfoot tr:first").children(),p=y.$headers.filter("th "),x=p.length,k=0;x>k;k++)q=p.eq(k),q.find("."+b.css.icon).length?(r=q.find("."+b.css.icon).clone(!0),q.find(".tablesorter-header-inner").html(s[k]).append(r),m&&o.length&&(r=o.eq(k).find("."+b.css.icon).clone(!0),o.eq(k).find(".tablesorter-header-inner").html(s[k]).append(r))):(q.find(".tablesorter-header-inner").html(s[k]),m&&o.length&&o.eq(k).find(".tablesorter-header-inner").html(s[k])),n.eq(k).html(s[k])}y.showProcessing&&b.isProcessing(d),e.totalPages=Math.ceil(e.totalRows/t(e,e.size,"get")),e.last.totalRows=e.totalRows,e.last.currentFilters=e.currentFilters,e.last.sortList=(y.sortList||[]).join(","),g(d,e,!1),b.updateCache(y,function(){e.initialized&&setTimeout(function(){y.debug&&console.log("Pager: Triggering pagerChange"),z.trigger("pagerChange",e),b.applyWidget(d),g(d,e,!0)},0)})}e.initialized||(e.initialized=!0,e.initializing=!1,d.config.debug&&console.log("Pager: Triggering pagerInitialized"),a(d).trigger("pagerInitialized",e),b.applyWidget(d),g(d,e))},n=function(c,d){var e,f=o(c,d),g=a(document),h=c.config,i=h.namespace+"pager";""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError"+i,function(a,b,e,f){m(null,c,d,b,e,f),g.unbind("ajaxError"+i)}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){ed;d++)l.push(j+"["+h[d][0]+"]="+h[d][1]);g=g.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):j),l=[]}if(k){for(k=k[1],e=i.length,d=0;e>d;d++)i[d]&&l.push(k+"["+d+"]="+encodeURIComponent(i[d]));g=g.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,l.length?l.join("&"):k),c.currentFilters=i}return"function"==typeof c.customAjaxUrl&&(g=c.customAjaxUrl(b,g)),f.debug&&console.log("Pager: Ajax url = "+g),g},p=function(c,d,e){var f,h,i,j,l=a(c),m=c.config,n=m.$table.hasClass("hasFilters"),o=d&&d.length||0,p=e.page*e.size,q=e.size;if(1>o)return void(m.debug&&console.warn("Pager: >> No rows for pager to render"));if(e.page>=e.totalPages&&x(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&(m.debug&&console.log("Pager: Triggering pagerChange"),l.trigger("pagerChange",e)),e.removeRows){for(b.clearTableBody(c),f=b.processTbody(c,m.$tbodies.eq(0),!0),h=n?0:p,i=n?0:p,j=0;q>j&&hp&&q>=j&&(j++,e.cacheIndex.push(h),f.append(d[h]))),h++;b.processTbody(c,f,!1)}else k(c,e);g(c,e),c.isUpdating&&(m.debug&&console.log("Pager: Triggering updateComplete"),l.trigger("updateComplete",[c,!0]))},q=function(c,d){var f,g,h;for(d.ajax?e(d,!0):(a.data(c,"pagerLastPage",d.page),a.data(c,"pagerLastSize",d.size),d.page=0,d.size=d.totalRows,d.totalPages=1,a(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(c,c.config.rowsCopy,d),d.isDisabled=!0,b.applyWidget(c),c.config.debug&&console.log("Pager: Disabled")),g=d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")),h=g.length,f=0;h>f;f++)g.eq(f).attr("aria-disabled","true").addClass(d.cssDisabled)[0].disabled=!0},r=function(a){var c=a.config,d=c.pager;b.updateCache(c,function(){var b,e=[],f=a.config.cache[0].normalized;for(d.totalRows=f.length,b=0;bb&&0!==a.page&&(a.page=b),a.page},v=function(b,c,d){d.size=t(d,c,"get"),d.$size.val(t(d,d.size,"set")),a.data(b,"pagerLastPage",u(d)),a.data(b,"pagerLastSize",d.size),d.totalPages=Math.ceil(d.totalRows/d.size),d.filteredPages=Math.ceil(d.filteredRows/d.size),s(b,d)},w=function(a,b){b.page=0,s(a,b)},x=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1,s(a,b)},y=function(a,b){b.page++,b.page>=Math.min(b.totalPages,b.filteredPages)-1&&(b.page=Math.min(b.totalPages,b.filteredPages)-1),s(a,b)},z=function(a,b){b.page--,b.page<=0&&(b.page=0),s(a,b)},A=function(a,c){var d=a.config,e=d.namespace+"pager",f=[c.cssFirst,c.cssPrev,c.cssNext,c.cssLast,c.cssGoto,c.cssPageSize].join(",");q(a,c),c.$container.hide().find(f).unbind(e),d.appender=null,d.$table.unbind(e),b.storage&&b.storage(a,c.storageKey,""),delete d.pager,delete d.rowsCopy},B=function(c,d,e){var f,g,h=c.config;d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).removeClass(d.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),d.isDisabled=!1,d.page=a.data(c,"pagerLastPage")||d.page||0,g=d.$size.find("option[selected]").val(),d.size=a.data(c,"pagerLastSize")||t(d,d.size,"get"),d.$size.val(t(d,d.size,"set")),d.totalPages=Math.ceil(Math.min(d.totalRows,d.filteredRows)/d.size),c.id&&(f=c.id+"_pager_info",d.$container.find(d.cssPageDisplay).attr("id",f),h.$table.attr("aria-describedby",f)),j(c,d),e&&(b.update(h),v(c,d.size,d),l(c,d),h.debug&&console.log("Pager: Enabled"))};d.appender=function(b,c){var d=b.config,e=d.pager;e.ajax||(d.rowsCopy=c,e.totalRows=e.countChildRows?d.$tbodies.eq(0).children("tr").length:c.length,e.size=a.data(b,"pagerLastSize")||e.size||e.settings.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),p(b,c,e),g(b,e,!1))},d.construct=function(e){return this.each(function(){if(this.config&&this.hasInitialized){var f,h,i,m=this,n=m.config,o=n.widgetOptions,p=n.pager=a.extend(!0,{},a.tablesorterPager.defaults,e),u=n.$table,C=n.namespace+"pager",D=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&console.log("Pager: Initializing"),p.oldAjaxSuccess=p.oldAjaxSuccess||p.ajaxObject.success,n.appender=d.appender,p.initializing=!0,p.savePages&&b.storage&&(f=b.storage(m,p.storageKey)||{},p.page=isNaN(f.page)?p.page:f.page,p.size=(isNaN(f.size)?p.size:f.size)||p.settings.size||10,a.data(m,"pagerLastSize",p.size)),p.regexRows=new RegExp("("+(o.filter_filteredRow||"filtered")+"|"+n.selectorRemove.slice(1)+"|"+n.cssChildRow+")"),u.unbind(c.split(" ").join(C+" ").replace(/\s+/g," ")).bind("filterInit filterStart ".split(" ").join(C+" "),function(b,c){p.currentFilters=a.isArray(c)?c:n.$table.data("lastSearch"),"filterStart"===b.type&&p.pageReset!==!1&&(n.lastCombinedFilter||"")!==(p.currentFilters||[]).join("")&&(p.page=p.pageReset)}).bind("filterEnd sortEnd ".split(" ").join(C+" "),function(){p.currentFilters=n.$table.data("lastSearch"),(p.initialized||p.initializing)&&(n.delayInit&&n.rowsCopy&&0===n.rowsCopy.length&&r(m),g(m,p,!1),s(m,p,!1),b.applyWidget(m))}).bind("disablePager"+C,function(a){a.stopPropagation(),q(m,p)}).bind("enablePager"+C,function(a){a.stopPropagation(),B(m,p,!0)}).bind("destroyPager"+C,function(a){a.stopPropagation(),A(m,p)}).bind("updateComplete"+C,function(a,b,c){if(a.stopPropagation(),b&&!c&&!p.ajax){var d=n.$tbodies.eq(0).children("tr").not(n.selectorRemove);p.totalRows=d.length-(p.countChildRows?0:d.filter("."+n.cssChildRow).length),p.totalPages=Math.ceil(p.totalRows/p.size),d.length&&n.rowsCopy&&0===n.rowsCopy.length&&r(b),p.page>=p.totalPages&&x(b,p),k(b,p),j(b,p),g(b,p,!0)}}).bind("pageSize refreshComplete ".split(" ").join(C+" "),function(a,b){a.stopPropagation(),v(m,t(p,b,"get"),p),k(m,p),g(m,p,!1)}).bind("pageSet pagerUpdate ".split(" ").join(C+" "),function(a,b){a.stopPropagation(),"pagerUpdate"===a.type&&(b="undefined"==typeof b?p.page+1:b,p.last.page=!0),p.page=(parseInt(b,10)||1)-1,s(m,p,!0),g(m,p,!1)}).bind("pageAndSize"+C,function(a,b,c){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,v(m,t(p,c,"get"),p),s(m,p,!0),k(m,p),g(m,p,!1)}),h=[p.cssFirst,p.cssPrev,p.cssNext,p.cssLast],i=[w,z,y,x],n.debug&&!D.length&&console.warn("Pager: >> Container not found"),D.find(h.join(",")).attr("tabindex",0).unbind("click"+C).bind("click"+C,function(b){b.stopPropagation();var c,d=a(this),e=h.length;if(!d.hasClass(p.cssDisabled))for(c=0;e>c;c++)if(d.is(h[c])){i[c](m,p);break}}),p.$goto=D.find(p.cssGoto),p.$goto.length?p.$goto.unbind("change"+C).bind("change"+C,function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}):n.debug&&console.warn("Pager: >> Goto selector not found"),p.$size=D.find(p.cssPageSize),p.$size.length?(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change"+C).bind("change"+C,function(){if(!a(this).hasClass(p.cssDisabled)){var b=a(this).val();p.$size.val(b),v(m,b,p),j(m,p)}return!1})):n.debug&&console.warn("Pager: >> Size selector not found"),p.initialized=!1,u.trigger("pagerBeforeInitialized",p),B(m,p,!1),"string"==typeof p.ajaxUrl?(p.ajax=!0,n.widgetOptions.filter_serversideFiltering=!0,n.serverSideSorting=!0,s(m,p)):(p.ajax=!1,b.appendCache(n,!0),l(m,p)),p.ajax||p.initialized||(p.initializing=!1,p.initialized=!0,s(m,p),n.debug&&console.log("Pager: Triggering pagerInitialized"),n.$table.trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1)),n.widgetInit.pager=!0}})}}}),b.showError=function(b,c,d,e){var f,g=a(b),h=g[0].config,i=h&&h.widgetOptions,j=h.pager&&h.pager.cssErrorRow||i&&i.pager_css&&i.pager_css.errorRow||"tablesorter-errorRow",k=typeof c,l=!0,m="",n=function(){h.$table.find("thead").find("."+j).remove()};if(!g.length)return void console.error("tablesorter showError: no table parameter passed");if("function"==typeof h.pager.ajaxError){if(l=h.pager.ajaxError(h,c,d,e),l===!1)return n();m=l}else if("function"==typeof i.pager_ajaxError){if(l=i.pager_ajaxError(h,c,d,e),l===!1)return n();m=l}if(""===m)if("object"===k)m=0===c.status?"Not connected, verify Network":404===c.status?"Requested page not found [404]":500===c.status?"Internal Server Error [500]":"parsererror"===e?"Requested JSON parse failed":"timeout"===e?"Time out error":"abort"===e?"Ajax Request aborted":"Uncaught error: "+c.statusText+" ["+c.status+"]";else{if("string"!==k)return n();m=c}f=a(/tr\>/.test(m)?m:''+m+"").click(function(){a(this).remove()}).appendTo(h.$table.find("thead:first")).addClass(j+" "+h.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"})},a.fn.extend({tablesorterPager:a.tablesorterPager.construct})}(jQuery); \ No newline at end of file diff --git a/dist/js/jquery.tablesorter.combined.js b/dist/js/jquery.tablesorter.combined.js index 4a043445..7cf24e8e 100644 --- a/dist/js/jquery.tablesorter.combined.js +++ b/dist/js/jquery.tablesorter.combined.js @@ -1,4 +1,4 @@ -/*! tablesorter (FORK) - updated 11-06-2015 (v2.24.3)*/ +/*! tablesorter (FORK) - updated 11-10-2015 (v2.24.4)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { @@ -10,7 +10,7 @@ } }(function($) { -/*! TableSorter (FORK) v2.24.3 *//* +/*! TableSorter (FORK) v2.24.4 *//* * Client-side table sorting with ease! * @requires jQuery v1.2.6+ * @@ -33,7 +33,7 @@ 'use strict'; var ts = $.tablesorter = { - version : '2.24.3', + version : '2.24.4', parsers : [], widgets : [], @@ -151,12 +151,13 @@ // labels applied to sortable headers for accessibility (aria) support 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' + sortAsc : 'Ascending sort applied, ', + sortDesc : 'Descending sort applied, ', + sortNone : 'No sort applied, ', + sortDisabled : 'sorting is disabled', + nextAsc : 'activate to apply an ascending sort', + nextDesc : 'activate to apply a descending sort', + nextNone : 'activate to remove the sort' }, regex : { @@ -1005,7 +1006,7 @@ ▀████▀ ██ █████▀ ██ ██ ██ ██████ */ setHeadersCss : function( c ) { - var $sorted, header, indx, column, $header, nextSort, txt, tmp, + var $sorted, indx, column, list = c.sortList, len = list.length, none = ts.css.sortNone + ' ' + c.cssNone, @@ -1073,50 +1074,62 @@ } // add verbose aria labels len = c.$headers.length; - $headers = c.$headers.not( '.sorter-false' ); for ( indx = 0; indx < len; indx++ ) { - $header = $headers.eq( indx ); - if ( $header.length ) { - header = $headers[ indx ]; - column = parseInt( $header.attr( 'data-column' ), 10 ); - nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + ts.setColumnAriaLabel( c, c.$headers.eq( indx ) ); + } + }, + + // nextSort (optional), lets you disable next sort text + setColumnAriaLabel : function( c, $header, nextSort ) { + if ( $header.length ) { + var column = parseInt( $header.attr( 'data-column' ), 10 ), tmp = $header.hasClass( ts.css.sortAsc ) ? 'sortAsc' : - $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone'; - txt = $.trim( $header.text() ) + ': ' + - ts.language[ tmp ] + - ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; - $header.attr( 'aria-label', txt ); + $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone', + txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ]; + if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) { + txt += ts.language.sortDisabled; + } else { + nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + // if nextSort + txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; } + $header.attr( 'aria-label', txt ); } }, updateHeader : function( c ) { - var index, isDisabled, $th, col, + var index, isDisabled, $header, col, table = c.table, len = c.$headers.length; for ( index = 0; index < len; index++ ) { - $th = c.$headers.eq( index ); + $header = c.$headers.eq( index ); col = ts.getColumnData( table, c.headers, index, true ); // add 'sorter-false' class if 'parser-false' is set - isDisabled = ts.getData( $th, col, 'sorter' ) === 'false' || ts.getData( $th, col, 'parser' ) === 'false'; - $th[ 0 ].sortDisabled = isDisabled; - $th[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ).attr( 'aria-disabled', '' + isDisabled ); - // disable tab index on disabled cells - if ( c.tabIndex ) { - if ( isDisabled ) { - $th.removeAttr( 'tabindex' ); - } else { - $th.attr( 'tabindex', '0' ); - } + isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false'; + ts.setColumnSort( c, $header, isDisabled ); + } + }, + + setColumnSort : function( c, $header, isDisabled ) { + var id = c.table.id; + $header[ 0 ].sortDisabled = isDisabled; + $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ) + .attr( 'aria-disabled', '' + isDisabled ); + // disable tab index on disabled cells + if ( c.tabIndex ) { + if ( isDisabled ) { + $header.removeAttr( 'tabindex' ); + } else { + $header.attr( 'tabindex', '0' ); } - // aria-controls - requires table ID - if ( table.id ) { - if ( isDisabled ) { - $th.removeAttr( 'aria-controls' ); - } else { - $th.attr( 'aria-controls', table.id ); - } + } + // aria-controls - requires table ID + if ( id ) { + if ( isDisabled ) { + $header.removeAttr( 'aria-controls' ); + } else { + $header.attr( 'aria-controls', id ); } } }, @@ -2178,14 +2191,14 @@ // *** Process table *** // add processing indicator - isProcessing : function( $table, toggle, $ths ) { + isProcessing : function( $table, toggle, $headers ) { $table = $( $table ); var c = $table[ 0 ].config, // default to all headers - $header = $ths || $table.find( '.' + ts.css.header ); + $header = $headers || $table.find( '.' + ts.css.header ); if ( toggle ) { - // don't use sortList if custom $ths used - if ( typeof $ths !== 'undefined' && c.sortList.length > 0 ) { + // don't use sortList if custom $headers used + if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) { // get headers from the sortList $header = $header.filter( function() { // get data-column from attr to keep compatibility with jQuery 1.2.6 @@ -2977,13 +2990,13 @@ })(jQuery); -/*! Widget: filter - updated 11/4/2015 (v2.24.3) *//* +/*! Widget: filter - updated 11/10/2015 (v2.24.4) *//* * Requires tablesorter v2.8+ and jQuery 1.7+ * by Rob Garrison */ ;( function ( $ ) { 'use strict'; - var tsf, + var tsf, tsfRegex, ts = $.tablesorter || {}, tscss = ts.css; @@ -3089,20 +3102,21 @@ // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class ) types: { or : function( c, data, vars ) { - if ( tsf.regex.orTest.test( data.iFilter ) || tsf.regex.orSplit.test( data.filter ) ) { + // look for "|", but not if it is inside of a regular expression + if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) && + // this test for regex has potential to slow down the overall search + !tsfRegex.regex.test( data.filter ) ) { var indx, filterMatched, query, regex, // duplicate data but split filter data2 = $.extend( {}, data ), - index = data.index, - parsed = data.parsed[ index ], - filter = data.filter.split( tsf.regex.orSplit ), - iFilter = data.iFilter.split( tsf.regex.orSplit ), + filter = data.filter.split( tsfRegex.orSplit ), + iFilter = data.iFilter.split( tsfRegex.orSplit ), len = filter.length; for ( indx = 0; indx < len; indx++ ) { data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], index, parsed ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], index, parsed ) || '' ); - query = '(' + ( tsf.parseFilter( c, data2.filter, index, parsed ) || '' ) + ')'; + data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); + data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); + query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')'; try { // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search, // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group @@ -3124,22 +3138,20 @@ }, // Look for an AND or && operator ( logical and ) and : function( c, data, vars ) { - if ( tsf.regex.andTest.test( data.filter ) ) { + if ( tsfRegex.andTest.test( data.filter ) ) { var indx, filterMatched, result, query, regex, // duplicate data but split filter data2 = $.extend( {}, data ), - index = data.index, - parsed = data.parsed[ index ], - filter = data.filter.split( tsf.regex.andSplit ), - iFilter = data.iFilter.split( tsf.regex.andSplit ), + filter = data.filter.split( tsfRegex.andSplit ), + iFilter = data.iFilter.split( tsfRegex.andSplit ), len = filter.length; for ( indx = 0; indx < len; indx++ ) { data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], index, parsed ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], index, parsed ) || '' ); - query = ( '(' + ( tsf.parseFilter( c, data2.filter, index, parsed ) || '' ) + ')' ) + data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); + data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); + query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' ) // replace wild cards since /(a*)/i will match anything - .replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ); + .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ); try { // use try/catch just in case RegExp is invalid regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' ); @@ -3161,10 +3173,10 @@ }, // Look for regex regex: function( c, data ) { - if ( tsf.regex.regex.test( data.filter ) ) { + if ( tsfRegex.regex.test( data.filter ) ) { var matches, // cache regex per column for optimal speed - regex = data.filter_regexCache[ data.index ] || tsf.regex.regex.exec( data.filter ), + regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ), isRegex = regex instanceof RegExp; try { if ( !isRegex ) { @@ -3183,18 +3195,17 @@ // Look for operators >, >=, < or <= operators: function( c, data ) { // ignore empty strings... because '' < 10 is true - if ( tsf.regex.operTest.test( data.iFilter ) && data.iExact !== '' ) { + if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) { var cachedValue, result, txt, table = c.table, - index = data.index, - parsed = data.parsed[index], - query = ts.formatFloat( data.iFilter.replace( tsf.regex.operators, '' ), table ), - parser = c.parsers[index], + parsed = data.parsed[ data.index ], + query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ), + parser = c.parsers[ data.index ], savedSearch = query; // parse filter value in case we're comparing numbers ( dates ) if ( parsed || parser.type === 'numeric' ) { - txt = $.trim( '' + data.iFilter.replace( tsf.regex.operators, '' ) ); - result = tsf.parseFilter( c, txt, index, true ); + txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) ); + result = tsf.parseFilter( c, txt, data, true ); query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query; } // iExact may be numeric - see issue #149; @@ -3206,10 +3217,10 @@ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact; cachedValue = ts.formatFloat( txt, table ); } - if ( tsf.regex.gtTest.test( data.iFilter ) ) { - result = tsf.regex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; - } else if ( tsf.regex.ltTest.test( data.iFilter ) ) { - result = tsf.regex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; + if ( tsfRegex.gtTest.test( data.iFilter ) ) { + result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; + } else if ( tsfRegex.ltTest.test( data.iFilter ) ) { + result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; } // keep showing all rows if nothing follows the operator if ( !result && savedSearch === '' ) { @@ -3221,13 +3232,13 @@ }, // Look for a not match notMatch: function( c, data ) { - if ( tsf.regex.notTest.test( data.iFilter ) ) { + if ( tsfRegex.notTest.test( data.iFilter ) ) { var indx, txt = data.iFilter.replace( '!', '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; - if ( tsf.regex.exact.test( filter ) ) { + filter = tsf.parseFilter( c, txt, data ) || ''; + if ( tsfRegex.exact.test( filter ) ) { // look for exact not matches - see #628 - filter = filter.replace( tsf.regex.exact, '' ); + filter = filter.replace( tsfRegex.exact, '' ); return filter === '' ? true : $.trim( filter ) !== data.iExact; } else { indx = data.iExact.search( $.trim( filter ) ); @@ -3239,29 +3250,29 @@ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric exact: function( c, data ) { /*jshint eqeqeq:false */ - if ( tsf.regex.exact.test( data.iFilter ) ) { - var txt = data.iFilter.replace( tsf.regex.exact, '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + if ( tsfRegex.exact.test( data.iFilter ) ) { + var txt = data.iFilter.replace( tsfRegex.exact, '' ), + filter = tsf.parseFilter( c, txt, data ) || ''; return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; } return null; }, // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu! range : function( c, data ) { - if ( tsf.regex.toTest.test( data.iFilter ) ) { + if ( tsfRegex.toTest.test( data.iFilter ) ) { var result, tmp, range1, range2, table = c.table, index = data.index, parsed = data.parsed[index], // make sure the dash is for a range and not indicating a negative number - query = data.iFilter.split( tsf.regex.toSplit ); + query = data.iFilter.split( tsfRegex.toSplit ); tmp = query[0].replace( ts.regex.nondigit, '' ) || ''; - range1 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); tmp = query[1].replace( ts.regex.nondigit, '' ) || ''; - range2 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); // parse filter value in case we're comparing numbers ( dates ) - if ( parsed || c.parsers[index].type === 'numeric' ) { + if ( parsed || c.parsers[ index ].type === 'numeric' ) { result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index ); range1 = ( result !== '' && !isNaN( result ) ) ? result : range1; result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index ); @@ -3282,18 +3293,16 @@ }, // Look for wild card: ? = single, * = multiple, or | = logical OR wild : function( c, data ) { - if ( tsf.regex.wildOrTest.test( data.iFilter ) ) { - var index = data.index, - parsed = data.parsed[ index ], - query = '' + ( tsf.parseFilter( c, data.iFilter, index, parsed ) || '' ); + if ( tsfRegex.wildOrTest.test( data.iFilter ) ) { + var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' ); // look for an exact match with the 'or' unless the 'filter-match' class is found - if ( !tsf.regex.wildTest.test( query ) && data.nestedFilters ) { + if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) { query = data.isMatch ? query : '^(' + query + ')$'; } // parsing the filter may not work properly when using wildcards =/ try { return new RegExp( - query.replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ), + query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ), c.widgetOptions.filter_ignoreCase ? 'i' : '' ) .test( data.exact ); @@ -3305,21 +3314,18 @@ }, // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license ) fuzzy: function( c, data ) { - if ( tsf.regex.fuzzyTest.test( data.iFilter ) ) { + if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) { var indx, patternIndx = 0, len = data.iExact.length, txt = data.iFilter.slice( 1 ), - pattern = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + pattern = tsf.parseFilter( c, txt, data ) || ''; for ( indx = 0; indx < len; indx++ ) { if ( data.iExact[ indx ] === pattern[ patternIndx ] ) { patternIndx += 1; } } - if ( patternIndx === pattern.length ) { - return true; - } - return false; + return patternIndx === pattern.length; } return null; } @@ -3332,8 +3338,7 @@ and : 'and' }, ts.language ); - var options, string, txt, $header, column, filters, val, fxn, noSelect, - regex = tsf.regex; + var options, string, txt, $header, column, filters, val, fxn, noSelect; c.$table.addClass( 'hasFilters' ); // define timers so using clearTimeout won't cause an undefined error @@ -3344,8 +3349,8 @@ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]'; wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]'; - val = '\\{' + tsf.regex.query + '\\}'; - $.extend( regex, { + val = '\\{' + tsfRegex.query + '\\}'; + $.extend( tsfRegex, { child : new RegExp( c.cssChildRow ), filtered : new RegExp( wo.filter_filteredRow ), alreadyFiltered : new RegExp( '(\\s+(' + ts.language.or + '|-|' + ts.language.to + ')\\s+)', 'i' ), @@ -3623,8 +3628,10 @@ c.$table.data( 'lastSearch', filters ); return filters; }, - parseFilter: function( c, filter, column, parsed ) { - return parsed ? c.parsers[column].format( filter, c.table, [], column ) : filter; + parseFilter: function( c, filter, data, parsed ) { + return parsed || data.parsed[ data.index ] ? + c.parsers[ data.index ].format( filter, c.table, [], data.index ) : + filter; }, buildRow: function( table, c, wo ) { var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp, @@ -3876,8 +3883,8 @@ }, defaultFilter: function( filter, mask ) { if ( filter === '' ) { return filter; } - var regex = tsf.regex.iQuery, - maskLen = mask.match( tsf.regex.igQuery ).length, + var regex = tsfRegex.iQuery, + maskLen = mask.match( tsfRegex.igQuery ).length, query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ], len = query.length - 1, indx = 0, @@ -3974,9 +3981,8 @@ return filterMatched; }, processRow: function( c, data, vars ) { - var hasSelect, result, val, filterMatched, + var result, filterMatched, fxn, ffxn, txt, - regex = tsf.regex, wo = c.widgetOptions, showRow = true, @@ -4055,7 +4061,7 @@ result = data.rawArray[ columnIndex ] || ''; data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405 } - data.iExact = !regex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? + data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact; data.isMatch = c.$headerIndexed[ data.index ].hasClass( 'filter-match' ); @@ -4073,21 +4079,13 @@ data.filter = ts.replaceAccents( data.filter ); } - val = true; - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) { - data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] ); - // val is used to indicate that a filter select is using a default filter; - // so we override the exact & partial matches - val = false; - } // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ), // data.filter = case sensitive data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter; fxn = vars.functions[ columnIndex ]; - hasSelect = c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' ); filterMatched = null; - if ( fxn || ( hasSelect && val ) ) { - if ( fxn === true || hasSelect ) { + if ( fxn ) { + if ( fxn === true ) { // default selector uses exact match unless 'filter-match' class is found filterMatched = data.isMatch ? // data.iExact may be a number @@ -4113,7 +4111,7 @@ // Look for match, and add child row data for matching } else { txt = ( data.iExact + data.childRowText ) - .indexOf( tsf.parseFilter( c, data.iFilter, columnIndex, data.parsed[ columnIndex ] ) ); + .indexOf( tsf.parseFilter( c, data.iFilter, data ) ); result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) ); } } else { @@ -4133,7 +4131,6 @@ isChild, childRow, lastSearch, showRow, showParent, time, val, indx, notFiltered, searchFiltered, query, injected, res, id, txt, storedFilters = $.extend( [], filters ), - regex = tsf.regex, c = table.config, wo = c.widgetOptions, // data object passed to filters; anyMatch is a flag for the filters @@ -4215,7 +4212,7 @@ ); if ( wo.filter_columnAnyMatch ) { // specific columns search - query = data.anyMatchFilter.split( regex.andSplit ); + query = data.anyMatchFilter.split( tsfRegex.andSplit ); injected = false; for ( indx = 0; indx < query.length; indx++ ) { res = query[ indx ].split( ':' ); @@ -4250,12 +4247,12 @@ // there are no changes from beginning of filter val.indexOf( lastSearch[indx] || '' ) === 0 && // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string - !regex.alreadyFiltered.test( val ) && + !tsfRegex.alreadyFiltered.test( val ) && // if we are not doing exact matches, using '|' ( logical or ) or not '!' - !regex.exactTest.test( val ) && + !tsfRegex.exactTest.test( val ) && // don't search only filtered if the value is negative // ( '> -10' => '> -100' will ignore hidden rows ) - !( regex.isNeg1.test( val ) || regex.isNeg2.test( val ) ) && + !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) && // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593 !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length && !c.$headerIndexed[indx].hasClass( 'filter-match' ) ); @@ -4273,7 +4270,7 @@ // replace accents data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter ); } - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultAnyFilter ) ) { + if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) { data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter ); // clear search filtered flag because default filters are not saved to the last search searchFiltered = false; @@ -4290,9 +4287,9 @@ txt = $rows[ rowIndex ].className; // the first row can never be a child row - isChild = rowIndex && regex.child.test( txt ); + isChild = rowIndex && tsfRegex.child.test( txt ); // skip child rows & already filtered rows - if ( isChild || ( searchFiltered && regex.filtered.test( txt ) ) ) { + if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) { continue; } @@ -4402,7 +4399,6 @@ // custom select source function for a SPECIFIC COLUMN arry = fxn( table, column, onlyAvail ); } - if ( arry === false ) { // fall back to original method arry = tsf.getOptions( table, column, onlyAvail ); @@ -4416,18 +4412,19 @@ return false; } table = $( table )[0]; - var cts, txt, indx, len, + var cts, txt, indx, len, parsedTxt, str, c = table.config, validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns, parsed = []; - // get unique elements and sort the list // if $.tablesorter.sortText exists ( not in the original tablesorter ), // then natural sort the list otherwise use a basic sort arry = $.grep( arry, function( value, indx ) { + if ( value.text ) { + return true; + } return $.inArray( value, arry ) === indx; }); - if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) { // unsorted select options return arry; @@ -4436,22 +4433,30 @@ // parse select option values for ( indx = 0; indx < len; indx++ ) { txt = arry[ indx ]; + // check for object + str = txt.text ? txt.text : txt; + // sortNatural breaks if you don't pass it strings + parsedTxt = ( validColumn && c.parsers && c.parsers.length && + c.parsers[ column ].format( str, table, [], column ) || str ).toString(); + parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt; // parse array data using set column parser; this DOES NOT pass the original // table cell to the parser format function - parsed.push({ - t : txt, - // check parser length - fixes #934 - p : validColumn && c.parsers && c.parsers.length && - c.parsers[ column ].format( txt, table, [], column ) || txt - }); + if ( txt.text ) { + txt.parsed = parsedTxt; + parsed.push( txt ); + } else { + parsed.push({ + text : txt, + // check parser length - fixes #934 + parsed : parsedTxt + }); + } } - // sort parsed select options cts = c.textSorter || ''; parsed.sort( function( a, b ) { - // sortNatural breaks if you don't pass it strings - var x = a.p.toString(), - y = b.p.toString(); + var x = a.parsed, + y = b.parsed; if ( validColumn && typeof cts === 'function' ) { // custom OVERALL text sorter return cts( x, y, true, column, table ); @@ -4469,7 +4474,7 @@ arry = []; len = parsed.length; for ( indx = 0; indx < len; indx++ ) { - arry.push( parsed[indx].t ); + arry.push( parsed[indx] ); } return arry; } @@ -4529,7 +4534,7 @@ return; } - var indx, val, txt, t, $filters, $filter, + var indx, val, txt, t, $filters, $filter, option, c = table.config, wo = c.widgetOptions, node = c.$headerIndexed[ column ], @@ -4554,23 +4559,45 @@ if ( $.isArray( arry ) ) { // build option list for ( indx = 0; indx < arry.length; indx++ ) { - txt = arry[indx] = ( '' + arry[indx] ).replace( tsf.regex.quote, '"' ); - val = txt; - // allow including a symbol in the selectSource array - // 'a-z|A through Z' so that 'a-z' becomes the option value - // and 'A through Z' becomes the option text - if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) { - t = txt.split( wo.filter_selectSourceSeparator ); - val = t[0]; - txt = t[1]; + option = arry[ indx ]; + if ( option.text ) { + // OBJECT!! add data-function-name in case the value is set in filter_functions + option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value; + + // support jQuery < v1.8, otherwise the below code could be shortened to + // options += $( '":"",n=i,j=i,i.indexOf(g.filter_selectSourceSeparator)>=0&&(n=i.split(g.filter_selectSourceSeparator),j=n[1],n=n[0]),h+="");f.$table.find("thead").find("select."+d.filter+'[data-column="'+l+'"]').append(h),j=g.filter_selectSource,o="function"==typeof j?!0:c.getColumnData(e,j,l),o&&b.buildSelect(f.table,l,"",!0,k.hasClass(g.filter_onlyAvail))}b.buildDefault(e,!0),b.bindSearch(e,f.$table.find("."+d.filter),!0),g.filter_external&&b.bindSearch(e,g.filter_external),g.filter_hideFilters&&b.hideFilters(f),f.showProcessing&&(j="filterStart filterEnd ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(b,g){k=g?f.$table.find("."+d.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",c.isProcessing(e,"filterStart"===b.type,g?k:"")})),f.filteredRows=f.totalRows,j="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(){var a=this.config.widgetOptions;m=b.setDefaults(e,f,a)||[],m.length&&(f.delayInit&&""===m.join("")||c.setFilters(e,m,!0)),f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(f)},100)}),f.pager&&f.pager.initialized&&!g.filter_initialized&&(f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(f)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(d,e,f){var g,h,i,j,k,l=c.getFilters(d)||[];if(f.filter_saveFilters&&c.storage&&(h=c.storage(d,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(b,e,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=e.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)e.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(e.$filters=a(s+="").appendTo(e.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=e.$headerIndexed[i],j&&j.length&&(g=e.$filters.filter('[data-column="'+i+'"]'),n=c.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=c.getColumnData(b,e.headers,i),l="false"===c.getData(j[0],h,"filter")||"false"===c.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(d.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(d.filterDisabled)[0].disabled=!0)))},bindSearch:function(d,e,f){if(d=a(d)[0],e=a(e),e.length){var g,h=d.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,c.setFilters(d,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(c.regex.spaces," ")).bind("keyup"+j,function(c){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===c.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&c.which<=40)))return}b.searching(d,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(c){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===c.which||"search"===c.type||"change"===c.type&&this.value!==h.lastSearch[e])&&(c.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(d,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(e,f,g){var h=e.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:c.getFilters(e,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&c.updateCache(h,function(){b.checkFilters(e,!1,g)})):(j&&(c.setFilters(e,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+d.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(e,k,l),!1},30):(b.findRows(e,k,l),!1)):void 0)},hideFilters:function(b,e){var f,g=(e||b.$table).find("."+d.filterRow).addClass(d.filterRowHide);g.bind("mouseenter mouseleave",function(c){var e=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(e.type)?g.removeClass(d.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(d.filterRowHide)},200)}).find("input, select").bind("focus blur",function(e){var g=e,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===c.getFilters(b.$table).join("")&&h.toggleClass(d.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.regex.iQuery,f=d.match(b.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(e.anyMatch=!0,e.isMatch=!0,e.rowArray=e.$cells.map(function(b){return a.inArray(b,q)>-1?(e.parsed[b]?m=e.cacheArray[b]:(m=e.rawArray[b],m=a.trim(o.filter_ignoreCase?m.toLowerCase():m),d.sortLocaleCompare&&(m=c.replaceAccents(m))),m):void 0}).get(),e.filter=e.anyMatchFilter,e.iFilter=e.iAnyMatchFilter,e.exact=e.rowArray.join(" "),e.iExact=o.filter_ignoreCase?e.exact.toLowerCase():e.exact,e.cache=e.cacheArray.slice(0,-1).join(" "),f.excludeMatch=f.noAnyMatch,j=b.processTypes(d,e,f),null!==j)p=j;else if(o.filter_startsWith)for(p=!1,q=Math.min(d.columns,e.rowArray.length);!p&&q>0;)q--,p=p||0===e.rowArray[q].indexOf(e.iFilter);else p=(e.iExact+e.childRowText).indexOf(e.iFilter)>=0;if(e.anyMatch=!1,e.filters.join("")===e.filter)return p}for(q=0;q=0:e.filter===e.exact:"function"==typeof k?j=k(e.exact,e.cache,e.filter,q,e.$row,d,e):"function"==typeof k[l||e.filter]&&(m=l||e.filter,j=k[m](e.exact,e.cache,e.filter,q,e.$row,d,e))),null===j?(j=b.processTypes(d,e,f),null!==j?h=j:(m=(e.iExact+e.childRowText).indexOf(b.parseFilter(d,e.iFilter,q,e.parsed[q])),h=!o.filter_startsWith&&m>=0||o.filter_startsWith&&0===m)):h=j,p=h?p:!1);return p},findRows:function(d,e,f){if(d.config.lastCombinedFilter!==f&&d.config.widgetOptions.filter_initialized){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=a.extend([],e),F=b.regex,G=d.config,H=G.widgetOptions,I={anyMatch:!1,filters:e,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:c.getColumnData(d,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||c.getData&&"parsed"===c.getData(G.$headerIndexed[b],c.getColumnData(d,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),o=0;o1&&(C=parseInt(B[0],10)-1,C>=0&&Cw;w++)v=e[w]||"",y||(w=o),y=y&&r.length&&0===v.indexOf(r[w]||"")&&!F.alreadyFiltered.test(v)&&!F.exactTest.test(v)&&!(F.isNeg1.test(v)||F.isNeg2.test(v))&&!(""!==v&&G.$filters&&G.$filters.filter('[data-column="'+w+'"]').find("select").length&&!G.$headerIndexed[w].hasClass("filter-match"));for(x=j.not("."+H.filter_filteredRow).length,y&&0===x&&(y=!1),G.debug&&console.log("Filter: Searching through "+(y&&g>x?x:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=c.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&F.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),y=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),l=0;g>l;l++)if(D=j[l].className,p=l&&F.child.test(D),!(p||y&&F.filtered.test(D))){if(I.$row=j.eq(l),I.cacheArray=h[l],i=I.cacheArray[G.columns],I.rawArray=i.raw,I.childRowText="",!H.filter_childByColumn){for(D="",q=i.child,w=0;w")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(d,e,f))}return i===!1&&(i=b.getOptions(d,e,f)),b.processOptions(d,e,i)},processOptions:function(b,d,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j=b.config,k="undefined"!=typeof d&&null!==d&&d>=0&&dh;h++)g=e[h],l.push({t:g,p:k&&j.parsers&&j.parsers.length&&j.parsers[d].format(g,b,[],d)||g});for(f=j.textSorter||"",l.sort(function(a,e){var g=a.p.toString(),h=e.p.toString();return k&&"function"==typeof f?f(g,h,!0,d,b):k&&"object"==typeof f&&f.hasOwnProperty(d)?f[d](g,h,!0,d,b):c.sortNatural?c.sortNatural(g,h):!0}),e=[],i=l.length,h=0;i>h;h++)e.push(l[h].t);return e},getOptions:function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[d].parsed||n.$headerIndexed[d].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][d])}else if(p.push(j.normalized[f][n.columns].raw[d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(d),p.push(""+c.getElementText(n,l,d));return p},buildSelect:function(c,e,f,g,h){if(c=a(c)[0],e=parseInt(e,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var i,j,k,l,m,n,o=c.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+d.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.getOptionSource(c,e,h)),a.isArray(f)){for(i=0;i=0&&(l=k.split(p.filter_selectSourceSeparator),j=l[0],k=l[1]),r+=""!==f[i]?"":"";f=[]}m=(o.$filters?o.$filters:o.$table.children("thead")).find("."+d.filter),p.filter_$externalFilters&&(m=m&&m.length?m.add(p.filter_$externalFilters):p.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](r),a.isArray(f)||n.append(f).val(s),n.val(s))}},buildDefault:function(a,d){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||c.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",d,f.hasClass(i.filter_onlyAvail))}},c.getFilters=function(c,e,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+d.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},c.setFilters=function(d,e,f,g){var h=d?a(d)[0].config:"",i=c.getFilters(d,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(e,w)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);c.resizable.setHandlePosition(b,d),c.resizable.bindings(b,d)}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d,e){var f=b.namespace+"tsresize";d.resizable_vars.disabled=e,a("body").toggleClass(c.css.resizableNoSelect,e),e?a("body").attr("unselectable","on").bind("selectstart"+f,!1):a("body").removeAttr("unselectable").unbind("selectstart"+f)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,e,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,e,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&b.sortOn(d,k))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file +/*! tablesorter (FORK) - updated 11-10-2015 (v2.24.4)*/ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a){"use strict";var b=a.tablesorter={version:"2.24.4",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},instanceMethods:{},setup:function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return void(d.debug&&(c.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody")));var e="",f=a(c),g=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&(console[console.group?"group":"log"]("Initializing tablesorter"),a.data(c,"startoveralltimer",new Date)),d.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")),d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),d.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(f.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=f.addClass(b.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=f.find(d.selectorHeaders),d.namespace?d.namespace="."+d.namespace.replace(b.regex.nonWord,""):d.namespace=".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=f.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",b.buildHeaders(d),b.fixColumnWidth(c),b.addWidgetFromClass(c),b.applyWidgetOptions(c),b.setupParsers(d),d.totalRows=0,d.delayInit||b.buildCache(d),b.bindEvents(c,d.$headers,!0),b.bindMethods(d),d.supportsDataObject&&"undefined"!=typeof f.data().sortlist?d.sortList=f.data().sortlist:g&&f.metadata()&&f.metadata().sortlist&&(d.sortList=f.metadata().sortlist),b.applyWidget(c,!0),d.sortList.length>0?b.sortOn(d,d.sortList,{},!d.initWidgets):(b.setHeadersCss(d),d.initWidgets&&b.applyWidget(c,!1)),d.showProcessing&&f.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),b.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){b.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&(console.log("Overall initialization time: "+b.benchmark(a.data(c,"startoveralltimer"))),d.debug&&console.groupEnd&&console.groupEnd()),f.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},bindMethods:function(c){var d=c.$table,e=c.namespace,f="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(e+" ");d.unbind(f.replace(b.regex.spaces," ")).bind("sortReset"+e,function(a,c){a.stopPropagation(),b.sortReset(this.config,c)}).bind("updateAll"+e,function(a,c,d){a.stopPropagation(),b.updateAll(this.config,c,d)}).bind("update"+e+" updateRows"+e,function(a,c,d){a.stopPropagation(),b.update(this.config,c,d)}).bind("updateHeaders"+e,function(a,c){a.stopPropagation(),b.updateHeaders(this.config,c)}).bind("updateCell"+e,function(a,c,d,e){a.stopPropagation(),b.updateCell(this.config,c,d,e)}).bind("addRows"+e,function(a,c,d,e){a.stopPropagation(),b.addRows(this.config,c,d,e)}).bind("updateComplete"+e,function(){this.isUpdating=!1}).bind("sorton"+e,function(a,c,d,e){a.stopPropagation(),b.sortOn(this.config,c,d,e)}).bind("appendCache"+e,function(c,d,e){c.stopPropagation(),b.appendCache(this.config,e),a.isFunction(d)&&d(this)}).bind("updateCache"+e,function(a,c,d){a.stopPropagation(),b.updateCache(this.config,c,d)}).bind("applyWidgetId"+e,function(a,c){a.stopPropagation(),b.getWidgetById(c).format(this,this.config,this.config.widgetOptions)}).bind("applyWidgets"+e,function(a,c){a.stopPropagation(),b.applyWidget(this,c)}).bind("refreshWidgets"+e,function(a,c,d){a.stopPropagation(),b.refreshWidgets(this,c,d)}).bind("destroy"+e,function(a,c,d){a.stopPropagation(),b.destroy(this,c,d)}).bind("resetToLoadState"+e,function(d){d.stopPropagation(),b.removeWidget(this,!0,!1),c=a.extend(!0,b.defaults,c.originalSettings),this.hasInitialized=!1,b.setup(this,c)})},bindEvents:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.namespace,i=null;e!==!0&&(d.addClass(h.slice(1)+"_extra_headers"),f=a.fn.closest?d.closest("table")[0]:d.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==c&&a(f).addClass(h.slice(1)+"_extra_table")),f=(g.pointerDown+" "+g.pointerUp+" "+g.pointerClick+" sort keyup ").replace(b.regex.spaces," ").split(" ").join(h+" "),d.find(g.selectorSort).add(d.filter(g.selectorSort)).unbind(f).bind(f,function(c,e){var f,h,j,k=a(c.target),l=" "+c.type+" ";if(!(1!==(c.which||c.button)&&!l.match(" "+g.pointerClick+" | sort | keyup ")||" keyup "===l&&13!==c.which||l.match(" "+g.pointerClick+" ")&&"undefined"!=typeof c.which||l.match(" "+g.pointerUp+" ")&&i!==c.target&&e!==!0)){if(l.match(" "+g.pointerDown+" "))return i=c.target,j=k.jquery.split("."),void("1"===j[0]&&j[1]<4&&c.preventDefault());if(i=null,b.regex.formElements.test(c.target.nodeName)||k.hasClass(g.cssNoSort)||k.parents("."+g.cssNoSort).length>0||k.parents("button").length>0)return!g.cancelSelection;g.delayInit&&b.isEmptyObject(g.cache)&&b.buildCache(g),f=a.fn.closest?a(this).closest("th, td"):/TH|TD/.test(this.nodeName)?a(this):a(this).parents("th, td"),j=d.index(f),g.last.clickedIndex=0>j?f.attr("data-column"):j,h=g.$headers[g.last.clickedIndex],h&&!h.sortDisabled&&b.initSort(g,h,c)}}),g.cancelSelection&&d.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(c){var d,e,f,g;for(c.headerList=[],c.headerContent=[],c.sortVars=[],c.debug&&(f=new Date),c.columns=b.computeColumnIndex(c.$table.children("thead, tfoot").children("tr")),e=c.cssIcon?'':"",c.$headers=a(a.map(c.$table.find(c.selectorHeaders),function(d,f){var g,h,i,j,k,l=a(d);if(!l.parent().hasClass(c.cssIgnoreRow))return g=b.getColumnData(c.table,c.headers,f,!0),c.headerContent[f]=l.html(),""===c.headerTemplate||l.find("."+b.css.headerIn).length||(j=c.headerTemplate.replace(b.regex.templateContent,l.html()).replace(b.regex.templateIcon,l.find("."+b.css.icon).length?"":e),c.onRenderTemplate&&(h=c.onRenderTemplate.apply(l,[f,j]),h&&"string"==typeof h&&(j=h)),l.html('
'+j+"
")),c.onRenderHeader&&c.onRenderHeader.apply(l,[f,c,c.$table]),i=parseInt(l.attr("data-column"),10),d.column=i,k=b.getData(l,g,"sortInitialOrder")||c.sortInitialOrder,c.sortVars[i]={count:-1,order:b.formatSortingOrder(k)?[1,0,2]:[0,1,2],lockedOrder:!1},k=b.getData(l,g,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(c.sortVars[i].lockedOrder=!0,c.sortVars[i].order=b.formatSortingOrder(k)?[1,1,1]:[0,0,0]),c.headerList[f]=d,l.addClass(b.css.header+" "+c.cssHeader).parent().addClass(b.css.headerRow+" "+c.cssHeaderRow).attr("role","row"),c.tabIndex&&l.attr("tabindex",0),d})),c.$headerIndexed=[],g=0;gs;){if(d=p[s].rows,d.length)for(h=0,g=a.columns,i=0;g>i;i++)j=a.$headerIndexed[h],j&&j.length&&(k=b.getColumnData(r,a.headers,h),n=b.getParserById(b.getData(j,k,"extractor")),m=b.getParserById(b.getData(j,k,"sorter")),l="false"===b.getData(j,k,"parser"),a.empties[h]=(b.getData(j,k,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top")).toLowerCase(),a.strings[h]=(b.getData(j,k,"string")||a.stringTo||"max").toLowerCase(),l&&(m=b.getParserById("no-parser")),n||(n=!1),m||(m=b.detectParserForColumn(a,d,-1,h)),a.debug&&(t["("+h+") "+j.text()]={parser:m.id,extractor:n?n.id:"none",string:a.strings[h],empty:a.empties[h]}),e.parsers[h]=m,e.extractors[h]=n,f=j[0].colSpan-1,f>0&&(h+=f,g+=f)),h++;s+=e.parsers.length?q:1}a.debug&&(b.isEmptyObject(t)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](t),console.log("Completed detecting parsers"+b.benchmark(o)),console.groupEnd&&console.groupEnd()),a.parsers=e.parsers,a.extractors=e.extractors},addParser:function(a){var c,d=b.parsers.length,e=!0;for(c=0;d>c;c++)b.parsers[c].id.toLowerCase()===a.id.toLowerCase()&&(e=!1);e&&b.parsers.push(a)},getParserById:function(a){if("false"==a)return!1;var c,d=b.parsers.length;for(c=0;d>c;c++)if(b.parsers[c].id.toLowerCase()===a.toString().toLowerCase())return b.parsers[c];return!1},detectParserForColumn:function(c,d,e,f){for(var g,h,i=b.parsers.length,j=!1,k="",l=!0;""===k&&l;)e++,d[e]?(j=d[e].cells[f],k=b.getElementText(c,j,f),h=a(j),c.debug&&console.log("Checking if value was empty on row "+e+", column: "+f+': "'+k+'"')):l=!1;for(;--i>=0;)if(g=b.parsers[i],g&&"text"!==g.id&&g.is&&g.is(k,c.table,j,h))return g;return b.getParserById("text")},getElementText:function(c,d,e){if(!d)return"";var f,g=c.textExtraction||"",h=d.jquery?d:a(d);return"string"==typeof g?"basic"===g&&"undefined"!=typeof(f=h.attr(c.textAttribute))?a.trim(f):a.trim(d.textContent||h.text()):"function"==typeof g?a.trim(g(h[0],c.table,e)):"function"==typeof(f=b.getColumnData(c.table,g,e))?a.trim(f(h[0],c.table,e)):a.trim(h[0].textContent||h.text())},getParsedText:function(a,c,d,e){"undefined"==typeof e&&(e=b.getElementText(a,c,d));var f=""+e,g=a.parsers[d],h=a.extractors[d];return g&&(h&&"function"==typeof h.format&&(e=h.format(e,a.table,c,d)),f="no-parser"===g.id?"":g.format(""+e,a.table,c,d),a.ignoreCase&&"string"==typeof f&&(f=f.toLowerCase())),f},buildCache:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=c.table,A=c.parsers;if(c.$tbodies=c.$table.children("tbody:not(."+c.cssInfoBlock+")"),l="undefined"==typeof e?c.$tbodies:e,c.cache={},c.totalRows=0,!A)return c.debug?console.warn("Warning: *Empty table!* Not building a cache"):"";for(c.debug&&(q=new Date),c.showProcessing&&b.isProcessing(z,!0),k=0;ki;++i)if(s={child:[],raw:[]},m=a(l[k].rows[i]),n=[],m.hasClass(c.cssChildRow)&&0!==i)for(y=f.normalized.length-1,t=f.normalized[y][c.columns],t.$row=t.$row.add(m),m.prev().hasClass(c.cssChildRow)||m.prev().addClass(b.css.cssHasChild),o=m.children("th, td"),y=t.child.length,t.child[y]=[],w=0,x=c.columns,j=0;x>j;j++)p=o[j],p&&(t.child[y][j]=b.getParsedText(c,p,j),v=o[j].colSpan-1,v>0&&(w+=v,x+=v)),w++;else{for(s.$row=m,s.order=i,w=0,x=c.columns,j=0;x>j;++j)p=m[0].cells[j],"undefined"==typeof A[w]?c.debug&&console.warn("No parser found for column "+j+"; cell:",p,"does it have a header?"):p&&(g=b.getElementText(c,p,w),s.raw[w]=g,h=b.getParsedText(c,p,w,g),n[w]=h,"numeric"===(A[w].type||"").toLowerCase()&&(u[w]=Math.max(Math.abs(h)||0,u[w]||0)),v=p.colSpan-1,v>0&&(w+=v,x+=v)),w++;n[c.columns]=s,f.normalized.push(n)}f.colMax=u,c.totalRows+=f.normalized.length}c.showProcessing&&b.isProcessing(z),c.debug&&console.log("Building cache for "+r+" rows"+b.benchmark(q)),a.isFunction(d)&&d(z)},getColumnText:function(c,d,e,f){c=a(c)[0];var g,h,i,j,k,l,m,n,o,p,q="function"==typeof e,r="all"===d,s={raw:[],parsed:[],$cell:[]},t=c.config;if(!b.isEmptyObject(t)){for(k=t.$tbodies.length,g=0;k>g;g++)for(i=t.cache[g].normalized,l=i.length,h=0;l>h;h++)j=i[h],(!f||j[t.columns].$row.is(f))&&(p=!0,n=r?j.slice(0,t.columns):j[d],j=j[t.columns],m=r?j.raw:j.raw[d],o=r?j.$row.children():j.$row.children().eq(d),q&&(p=e({tbodyIndex:g,rowIndex:h,parsed:n,raw:m,$row:j.$row,$cell:o})),p!==!1&&(s.parsed.push(n),s.raw.push(m),s.$cell.push(o)));return s}t.debug&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(c){var d,e,f,g=c.sortList,h=g.length,i=b.css.sortNone+" "+c.cssNone,j=[b.css.sortAsc+" "+c.cssAsc,b.css.sortDesc+" "+c.cssDesc],k=[c.cssIconAsc,c.cssIconDesc,c.cssIconNone],l=["ascending","descending"],m=c.$table.find("tfoot tr").children().add(a(c.namespace+"_extra_headers")).removeClass(j.join(" "));for(c.$headers.removeClass(j.join(" ")).addClass(i).attr("aria-sort","none").find("."+b.css.icon).removeClass(k.join(" ")).addClass(k[2]),e=0;h>e;e++)if(2!==g[e][1]&&(d=c.$headers.filter(function(a){for(var d=!0,e=c.$headers.eq(a),f=parseInt(e.attr("data-column"),10),g=f+c.$headers[a].colSpan;g>f;f++)d=d?b.isValueInArray(f,c.sortList)>-1:!1;return d}),d=d.not(".sorter-false").filter('[data-column="'+g[e][0]+'"]'+(1===h?":last":"")),d.length)){for(f=0;fe;e++)b.setColumnAriaLabel(c,c.$headers.eq(e))},setColumnAriaLabel:function(c,d,e){if(d.length){var f=parseInt(d.attr("data-column"),10),g=d.hasClass(b.css.sortAsc)?"sortAsc":d.hasClass(b.css.sortDesc)?"sortDesc":"sortNone",h=a.trim(d.text())+": "+b.language[g];d.hasClass("sorter-false")||e===!1?h+=b.language.sortDisabled:(e=c.sortVars[f].order[(c.sortVars[f].count+1)%(c.sortReset?3:2)],h+=b.language[0===e?"nextAsc":1===e?"nextDesc":"nextNone"]),d.attr("aria-label",h)}},updateHeader:function(a){var c,d,e,f,g=a.table,h=a.$headers.length;for(c=0;h>c;c++)e=a.$headers.eq(c),f=b.getColumnData(g,a.headers,c,!0),d="false"===b.getData(e,f,"sorter")||"false"===b.getData(e,f,"parser"),b.setColumnSort(a,e,d)},setColumnSort:function(a,b,c){var d=a.table.id;b[0].sortDisabled=c,b[c?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+c),a.tabIndex&&(c?b.removeAttr("tabindex"):b.attr("tabindex","0")),d&&(c?b.removeAttr("aria-controls"):b.attr("aria-controls",d))},updateHeaderSortCount:function(b,c){var d,e,f,g,h,i,j,k,l=c||b.sortList,m=l.length;for(b.sortList=[],g=0;m>g;g++)if(j=l[g],d=parseInt(j[0],10),d=0?e:f[1]%(b.sortReset?3:2)}},updateAll:function(a,c,d){var e=a.table;e.isUpdating=!0,b.refreshWidgets(e,!0,!0),b.buildHeaders(a),b.bindEvents(e,a.$headers,!0),b.bindMethods(a),b.commonUpdate(a,c,d)},update:function(a,c,d){var e=a.table;e.isUpdating=!0,b.updateHeader(a),b.commonUpdate(a,c,d)},updateHeaders:function(a,c){a.table.isUpdating=!0,b.buildHeaders(a),b.bindEvents(a.table,a.$headers,!0),b.resortComplete(a,c)},updateCell:function(c,d,e,f){c.table.isUpdating=!0,c.$table.find(c.selectorRemove).remove();var g,h,i,j,k,l,m=c.$tbodies,n=a(d),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=c.cache[o],q=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");if(d=n[0],m.length&&o>=0){if(i=m.eq(o).find("tr").index(q),k=p.normalized[i],l=q[0].cells.length,l!==c.columns)for(j=0,g=!1,h=0;l>h;h++)g||q[0].cells[h]===d?g=!0:j+=q[0].cells[h].colSpan;else j=n.index();g=b.getElementText(c,d,j),k[c.columns].raw[j]=g,g=b.getParsedText(c,d,j,g),k[j]=g,k[c.columns].$row=q,"numeric"===(c.parsers[j].type||"").toLowerCase()&&(p.colMax[j]=Math.max(Math.abs(g)||0,p.colMax[j]||0)),g="undefined"!==e?e:c.resort,g!==!1?b.checkResort(c,g,f):b.resortComplete(c,f)}},addRows:function(c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s="string"==typeof d&&1===c.$tbodies.length&&/j;j++){for(n=0,m=d[j].cells.length,p=[],o={child:[],raw:[],$row:d.eq(j),order:c.cache[i].normalized.length},l=0;m>l;l++)q=d[j].cells[l],g=b.getElementText(c,q,n),o.raw[n]=g,h=b.getParsedText(c,q,n,g),p[n]=h,"numeric"===(c.parsers[n].type||"").toLowerCase()&&(c.cache[i].colMax[n]=Math.max(Math.abs(h)||0,c.cache[i].colMax[n]||0)),r=q.colSpan-1,r>0&&(n+=r),n++;p[c.columns]=o,c.cache[i].normalized.push(p)}b.checkResort(c,e,f)}},updateCache:function(a,c,d){a.parsers&&a.parsers.length||b.setupParsers(a,d),b.buildCache(a,c,d)},appendCache:function(a,c){var d,e,f,g,h,i,j,k=a.table,l=a.widgetOptions,m=a.$tbodies,n=[],o=a.cache;if(b.isEmptyObject(o))return a.appender?a.appender(k,n):k.isUpdating?a.$table.trigger("updateComplete",k):"";for(a.debug&&(j=new Date),i=0;ih;h++)n.push(d[h][a.columns].$row),a.appender&&(!a.pager||a.pager.removeRows&&l.pager_removeRows||a.pager.ajax)||g.append(d[h][a.columns].$row);b.processTbody(k,g,!1)}a.appender&&a.appender(k,n),a.debug&&console.log("Rebuilt table"+b.benchmark(j)),c||a.appender||b.applyWidget(k),k.isUpdating&&a.$table.trigger("updateComplete",k)},commonUpdate:function(a,c,d){a.$table.find(a.selectorRemove).remove(),b.setupParsers(a),b.buildCache(a),b.checkResort(a,c,d)},initSort:function(c,d,e){if(c.table.isUpdating)return setTimeout(function(){b.initSort(c,d,e)},50);var f,g,h,i,j,k,l,m=!e[c.sortMultiSortKey],n=c.table,o=c.$headers.length,p=parseInt(a(d).attr("data-column"),10),q=c.sortVars[p].order;if(c.$table.trigger("sortStart",n),c.sortVars[p].count=e[c.sortResetKey]?2:(c.sortVars[p].count+1)%(c.sortReset?3:2),c.sortRestart)for(h=0;o>h;h++)l=c.$headers.eq(h),k=parseInt(l.attr("data-column"),10),p!==k&&(m||l.hasClass(b.css.sortNone))&&(c.sortVars[k].count=-1);if(m){if(c.sortList=[],c.last.sortList=[],null!==c.sortForce)for(f=c.sortForce,g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;g=0)for(g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;gc;c++)e=a.cache[c].colMax,f=a.cache[c].normalized,f.sort(function(c,d){var f,l,m,n,o,p,q;for(f=0;k>f;f++){if(m=j[f][0],n=j[f][1],h=0===n,a.sortStable&&c[m]===d[m]&&1===k)return c[a.columns].order-d[a.columns].order;if(l=/n/i.test(b.getSortType(a.parsers,m)),l&&a.strings[m]?(l="boolean"==typeof b.string[a.strings[m]]?(h?1:-1)*(b.string[a.strings[m]]?-1:1):a.strings[m]?b.string[a.strings[m]]||0:0,o=a.numberSorter?a.numberSorter(c[m],d[m],h,e[m],g):b["sortNumeric"+(h?"Asc":"Desc")](c[m],d[m],l,e[m],m,a)):(p=h?c:d,q=h?d:c,o="function"==typeof i?i(p[m],q[m],h,m,g):"object"==typeof i&&i.hasOwnProperty(m)?i[m](p[m],q[m],h,m,g):b["sortNatural"+(h?"Asc":"Desc")](c[m],d[m],m,a)),o)return o}return c[a.columns].order-d[a.columns].order});a.debug&&console.log("Applying sort "+j.toString()+b.benchmark(d))}},resortComplete:function(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)},checkResort:function(c,d,e){var f=a.isArray(d)?d:c.sortList,g="undefined"==typeof d?c.resort:d;g===!1||c.serverSideSorting||c.table.isProcessing?(b.resortComplete(c,e),b.applyWidget(c.table,!1)):f.length?b.sortOn(c,f,function(){b.resortComplete(c,e)},!0):b.sortReset(c,function(){b.resortComplete(c,e),b.applyWidget(c.table,!1)})},sortOn:function(c,d,e,f){var g=c.table;c.$table.trigger("sortStart",g),b.updateHeaderSortCount(c,d),b.setHeadersCss(c),c.delayInit&&b.isEmptyObject(c.cache)&&b.buildCache(c),c.$table.trigger("sortBegin",g),b.multisort(c),b.appendCache(c,f),c.$table.trigger("sortEnd",g),b.applyWidget(g),a.isFunction(e)&&e(g)},sortReset:function(c,d){c.sortList=[],b.setHeadersCss(c),b.multisort(c),b.appendCache(c),a.isFunction(d)&&d(c.table)},getSortType:function(a,b){return a&&a[b]?a[b].type||"":""},formatSortingOrder:function(a){return/^d/i.test(a)||1===a},sortNatural:function(a,c){if(a===c)return 0;var d,e,f,g,h,i,j=b.regex;if(j.hex.test(c)){if(d=parseInt(a.match(j.hex),16),e=parseInt(c.match(j.hex),16),e>d)return-1;if(d>e)return 1}for(d=a.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),e=c.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),i=Math.max(d.length,e.length),h=0;i>h;h++){if(f=isNaN(d[h])?d[h]||0:parseFloat(d[h])||0,g=isNaN(e[h])?e[h]||0:parseFloat(e[h])||0,isNaN(f)!==isNaN(g))return isNaN(f)?1:-1;if(typeof f!=typeof g&&(f+="",g+=""),g>f)return-1;if(f>g)return 1}return 0},sortNaturalAsc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:f||1:b.sortNatural(a,c)},sortNaturalDesc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:b.sortNatural(c,a)},sortText:function(a,b){return a>b?1:b>a?-1:0},getTextValue:function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},sortNumericAsc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),a-c)},sortNumericDesc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),c-a)},sortNumeric:function(a,b){return a-b},addWidget:function(a){b.widgets.push(a)},hasWidget:function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},getWidgetById:function(a){var c,d,e=b.widgets.length;for(c=0;e>c;c++)if(d=b.widgets[c],d&&d.id&&d.id.toLowerCase()===a.toLowerCase())return d},applyWidgetOptions:function(c){var d,e,f=c.config,g=f.widgets.length;if(g)for(d=0;g>d;d++)e=b.getWidgetById(f.widgets[d]),e&&e.options&&(f.widgetOptions=a.extend(!0,{},e.options,f.widgetOptions))},addWidgetFromClass:function(a){var c,d,e=a.config,f="\\s"+e.widgetClass.replace(b.regex.templateName,"([\\w-]+)")+"\\s",g=new RegExp(f,"g"),h=(" "+e.table.className+" ").match(g);if(h)for(c=h.length,d=0;c>d;d++)e.widgets.push(h[d].replace(g,"$1"))},applyWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j,k,l,m,n=c.config,o=[];if(d===!1||!c.hasInitialized||!c.isApplyingWidgets&&!c.isUpdating){if(n.debug&&(l=new Date),b.addWidgetFromClass(c),n.widgets.length){for(c.isApplyingWidgets=!0,n.widgets=a.grep(n.widgets,function(b,c){return a.inArray(b,n.widgets)===c}),h=n.widgets||[],g=h.length,f=0;g>f;f++)i=b.getWidgetById(h[f]),i&&i.id&&(i.priority||(i.priority=10),o[f]=i);for(o.sort(function(a,b){return a.priorityf;f++)i=o[f],i&&(j=i.id,k=!1,n.debug&&(m=new Date),(d||!n.widgetInit[j])&&(n.widgetInit[j]=!0,c.hasInitialized&&b.applyWidgetOptions(c),"function"==typeof i.init&&(k=!0,n.debug&&console[console.group?"group":"log"]("Initializing "+j+" widget"),i.init(c,i,c.config,c.config.widgetOptions))),d||"function"!=typeof i.format||(k=!0,n.debug&&console[console.group?"group":"log"]("Updating "+j+" widget"),i.format(c,c.config,c.config.widgetOptions,!1)),n.debug&&k&&(console.log("Completed "+(d?"initializing ":"applying ")+j+" widget"+b.benchmark(m)),console.groupEnd&&console.groupEnd()));n.debug&&console.groupEnd&&console.groupEnd(),d||"function"!=typeof e||e(c)}setTimeout(function(){c.isApplyingWidgets=!1,a.data(c,"lastWidgetApplication",new Date),n.$table.trigger("tablesorter-ready")},0),n.debug&&(i=n.widgets.length,console.log("Completed "+(d===!0?"initializing ":"applying ")+i+" widget"+(1!==i?"s":"")+b.benchmark(l)))}},removeWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=b.widgets.length,h=0;i>h;h++)g=b.widgets[h],g&&g.id&&d.push(g.id);else d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;f++)g=b.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&g.remove&&(j.debug&&console.log((e?"Refreshing":"Removing")+' "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},refreshWidgets:function(c,d,e){c=a(c)[0];var f,g,h=c.config,i=h.widgets,j=b.widgets,k=j.length,l=[],m=function(b){a(b).trigger("refreshComplete")};for(f=0;k>f;f++)g=j[f],g&&g.id&&(d||a.inArray(g.id,i)<0)&&l.push(g.id);b.removeWidget(c,l.join(","),!0),e!==!0?(b.applyWidget(c,d||!1,m),d&&b.applyWidget(c,!1,m)):m(c)},benchmark:function(a){return" ( "+((new Date).getTime()-a.getTime())+"ms )"},log:function(){console.log(arguments)},isEmptyObject:function(a){for(var b in a)return!1;return!0},isValueInArray:function(a,b){var c,d=b&&b.length||0;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},formatFloat:function(c,d){if("string"!=typeof c||""===c)return c;var e,f=d&&d.config?d.config.usNumberFormat!==!1:"undefined"!=typeof d?d:!0;return c=f?c.replace(b.regex.comma,""):c.replace(b.regex.digitNonUS,"").replace(b.regex.comma,"."),b.regex.digitNegativeTest.test(c)&&(c=c.replace(b.regex.digitNegativeReplace,"-$1")),e=parseFloat(c),isNaN(e)?a.trim(c):e},isDigit:function(a){return isNaN(a)?b.regex.digitTest.test(a.toString().replace(b.regex.digitReplace,"")):""!==a},computeColumnIndex:function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[];for(c=0;ce;e++)for("undefined"==typeof o[e]&&(o[e]=[]),p=o[e],f=n;n+m>f;f++)p[f]="x"}return p.length},fixColumnWidth:function(c){c=a(c)[0];var d,e,f,g,h,i=c.config,j=i.$table.children("colgroup");if(j.length&&j.hasClass(b.css.colgroup)&&j.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(j=a(''),d=i.$table.width(),f=i.$tbodies.find("tr:first").children(":visible"),g=f.length,h=0;g>h;h++)e=parseInt(f.eq(h).width()/d*1e3,10)/10+"%",j.append(a("").css("width",e));i.$table.prepend(j)}},getData:function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},getColumnData:function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers,k=i.$headerIndexed&&i.$headerIndexed[d]||j.filter('[data-column="'+d+'"]:last');if(c[d])return e?c[d]:c[j.index(k)];for(h in c)if("string"==typeof h&&(g=k.filter(h).add(k.find(h)),g.length))return c[h]}},isProcessing:function(c,d,e){c=a(c);var f=c[0].config,g=e||c.find("."+b.css.header);d?("undefined"!=typeof e&&f.sortList.length>0&&(g=g.filter(function(){ +return this.sortDisabled?!1:b.isValueInArray(parseFloat(a(this).attr("data-column")),f.sortList)>=0})),c.add(g).addClass(b.css.processing+" "+f.cssProcessing)):c.add(g).removeClass(b.css.processing+" "+f.cssProcessing)},processTbody:function(b,c,d){if(b=a(b)[0],d)return b.isProcessing=!0,c.before(''),a.fn.detach?c.detach():c.remove();var e=a(b).find("colgroup.tablesorter-savemyplace");c.insertAfter(e),e.remove(),b.isProcessing=!1},clearTableBody:function(b){a(b)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(a){var c,d="[",e=b.characterEquivalents;if(!b.characterRegex){b.characterRegexArray={};for(c in e)"string"==typeof c&&(d+=e[c],b.characterRegexArray[c]=new RegExp("["+e[c]+"]","g"));b.characterRegex=new RegExp(d+"]")}if(b.characterRegex.test(a))for(c in e)"string"==typeof c&&(a=a.replace(b.characterRegexArray[c],c));return a},restoreHeaders:function(c){var d,e,f=a(c)[0].config,g=f.$table.find(f.selectorHeaders),h=g.length;for(d=0;h>d;d++)e=g.eq(d),e.find("."+b.css.headerIn).length&&e.html(f.headerContent[d])},destroy:function(c,d,e){if(c=a(c)[0],c.hasInitialized){b.removeWidget(c,!0,!1);var f,g=a(c),h=c.config,i=h.debug,j=g.find("thead:first"),k=j.find("tr."+b.css.headerRow).removeClass(b.css.headerRow+" "+h.cssHeaderRow),l=g.find("tfoot:first > tr").children("th, td");d===!1&&a.inArray("uitheme",h.widgets)>=0&&(g.trigger("applyWidgetId",["uitheme"]),g.trigger("applyWidgetId",["zebra"])),j.find("tr").not(k).remove(),f="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress "+"sortBegin sortEnd resetToLoadState ".split(" ").join(h.namespace+" "),g.removeData("tablesorter").unbind(f.replace(b.regex.spaces," ")),h.$headers.add(l).removeClass([b.css.header,h.cssHeader,h.cssAsc,h.cssDesc,b.css.sortAsc,b.css.sortDesc,b.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),k.find(h.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(h.namespace+" ").replace(b.regex.spaces," ")),b.restoreHeaders(c),g.toggleClass(b.css.table+" "+h.tableClass+" tablesorter-"+h.theme,d===!1),c.hasInitialized=!1,delete c.config.cache,"function"==typeof e&&e(c),i&&console.log("tablesorter has been removed")}}};a.fn.tablesorter=function(c){return this.each(function(){var d=this,e=a.extend(!0,{},b.defaults,c,b.instanceMethods);e.originalSettings=c,!d.hasInitialized&&b.buildTable&&"TABLE"!==this.nodeName?b.buildTable(d,e):b.setup(d,e)})},window.console&&window.console.log||(b.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var a=arguments.length>1?arguments:arguments[0];b.logs.push({date:Date.now(),log:a})}),b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.regex.nondigit=/[^\w,. \-()]/g,b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.currencyReplace=/[+\-,. ]/g,b.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,b.addParser({id:"currency",is:function(a){return a=(a||"").replace(b.regex.currencyReplace,""),b.regex.currencyTest.test(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,b.regex.urlProtocolReplace=/(https?|ftp|file):\/\//,b.addParser({id:"url",is:function(a){return b.regex.urlProtocolTest.test(a)},format:function(c){return c?a.trim(c.replace(b.regex.urlProtocolReplace,"")):c},parsed:!0,type:"text"}),b.regex.dash=/-/g,b.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,b.addParser({id:"isoDate",is:function(a){return b.regex.isoDate.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dash,"/")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.percent=/%/g,b.regex.percentTest=/(\d\s*?%|%\s*?\d)/,b.addParser({id:"percent",is:function(a){return b.regex.percentTest.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(b.regex.percent,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.regex.dateReplace=/(\S)([AP]M)$/i,b.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,b.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,b.addParser({id:"usLongDate",is:function(a){return b.regex.usLongDateTest1.test(a)||b.regex.usLongDateTest2.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dateReplace,"$1 $2")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,b.regex.shortDateReplace=/[\-.,]/g,b.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,b.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,b.convertFormat=function(a,c){a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),"mmddyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===c&&(a=a.replace(b.regex.shortDateYMD,"$1/$2/$3"));var d=new Date(a);return d instanceof Date&&isFinite(d)?d.getTime():""},b.addParser({id:"shortDate",is:function(a){return a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),b.regex.shortDateTest.test(a)},format:function(a,c,d,e){if(a){var f=c.config,g=f.$headerIndexed[e],h=g.length&&g.data("dateFormat")||b.getData(g,b.getColumnData(c,f.headers,e),"dateFormat")||f.dateFormat;return g.length&&g.data("dateFormat",h),b.convertFormat(a,h)||a}return a},type:"numeric"}),b.regex.timeTest=/^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)$/i,b.regex.timeMatch=/([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,b.addParser({id:"time",is:function(a){return b.regex.timeTest.test(a)},format:function(a,c){var d,e=(a||"").match(b.regex.timeMatch),f=new Date(a),g=a&&(null!==e?e[0]:"00:00 AM"),h=g?new Date("2000/01/01 "+g.replace(b.regex.dateReplace,"$1 $2")):g;return h instanceof Date&&isFinite(h)?(d=f instanceof Date&&isFinite(f)?f.getTime():0,d?parseFloat(h.getTime()+"."+f.getTime()):h.getTime()):a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies.add(a(c.namespace+"_extra_table").children("tbody:not(."+c.cssInfoBlock+")"));for(i=0;ij;j++)f=e.eq(j),l.test(f[0].className)||g++,h=g%2===0,f.removeClass(d.zebra[h?1:0]).addClass(d.zebra[h?0:1])},remove:function(a,c,d,e){if(!e){var f,g,h=c.$tbodies,i=(d.zebra||["even","odd"]).join(" ");for(f=0;f
')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(d,e,f){if((c.orTest.test(e.iFilter)||c.orSplit.test(e.filter))&&!c.regex.test(e.filter)){var g,h,i,j,k=a.extend({},e),l=e.filter.split(c.orSplit),m=e.iFilter.split(c.orSplit),n=l.length;for(g=0;n>g;g++){k.nestedFilters=!0,k.filter=""+(b.parseFilter(d,l[g],e)||""),k.iFilter=""+(b.parseFilter(d,m[g],e)||""),i="("+(b.parseFilter(d,k.filter,e)||"")+")";try{if(j=new RegExp(e.isMatch?i:"^"+i+"$",d.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.processTypes(d,k,f))return h}catch(o){return null}}return h||!1}return null},and:function(d,e,f){if(c.andTest.test(e.filter)){var g,h,i,j,k,l=a.extend({},e),m=e.filter.split(c.andSplit),n=e.iFilter.split(c.andSplit),o=m.length;for(g=0;o>g;g++){l.nestedFilters=!0,l.filter=""+(b.parseFilter(d,m[g],e)||""),l.iFilter=""+(b.parseFilter(d,n[g],e)||""),j=("("+(b.parseFilter(d,l.filter,e)||"")+")").replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*");try{k=new RegExp(e.isMatch?j:"^"+j+"$",d.widgetOptions.filter_ignoreCase?"i":""),i=k.test(l.exact)||b.processTypes(d,l,f),h=0===g?i:h&&i}catch(p){return null}}return h||!1}return null},regex:function(a,b){if(c.regex.test(b.filter)){var d,e=b.filter_regexCache[b.index]||c.regex.exec(b.filter),f=e instanceof RegExp;try{f||(b.filter_regexCache[b.index]=e=new RegExp(e[1],e[2])),d=e.test(b.exact)}catch(g){d=!1}return d}return null},operators:function(e,f){if(c.operTest.test(f.iFilter)&&""!==f.iExact){var g,h,i,j=e.table,k=f.parsed[f.index],l=d.formatFloat(f.iFilter.replace(c.operators,""),j),m=e.parsers[f.index],n=l;return(k||"numeric"===m.type)&&(i=a.trim(""+f.iFilter.replace(c.operators,"")),h=b.parseFilter(e,i,f,!0),l="number"!=typeof h||""===h||isNaN(h)?l:h),!k&&"numeric"!==m.type||isNaN(l)||"undefined"==typeof f.cache?(i=isNaN(f.iExact)?f.iExact.replace(d.regex.nondigit,""):f.iExact,g=d.formatFloat(i,j)):g=f.cache,c.gtTest.test(f.iFilter)?h=c.gteTest.test(f.iFilter)?g>=l:g>l:c.ltTest.test(f.iFilter)&&(h=c.lteTest.test(f.iFilter)?l>=g:l>g),h||""!==n||(h=!0),h}return null},notMatch:function(d,e){if(c.notTest.test(e.iFilter)){var f,g=e.iFilter.replace("!",""),h=b.parseFilter(d,g,e)||"";return c.exact.test(h)?(h=h.replace(c.exact,""),""===h?!0:a.trim(h)!==e.iExact):(f=e.iExact.search(a.trim(h)),""===h?!0:!(d.widgetOptions.filter_startsWith?0===f:f>=0))}return null},exact:function(d,e){if(c.exact.test(e.iFilter)){var f=e.iFilter.replace(c.exact,""),g=b.parseFilter(d,f,e)||"";return e.anyMatch?a.inArray(g,e.rowArray)>=0:g==e.iExact}return null},range:function(a,e){if(c.toTest.test(e.iFilter)){var f,g,h,i,j=a.table,k=e.index,l=e.parsed[k],m=e.iFilter.split(c.toSplit);return g=m[0].replace(d.regex.nondigit,"")||"",h=d.formatFloat(b.parseFilter(a,g,e),j),g=m[1].replace(d.regex.nondigit,"")||"",i=d.formatFloat(b.parseFilter(a,g,e),j),(l||"numeric"===a.parsers[k].type)&&(f=a.parsers[k].format(""+m[0],j,a.$headers.eq(k),k),h=""===f||isNaN(f)?h:f,f=a.parsers[k].format(""+m[1],j,a.$headers.eq(k),k),i=""===f||isNaN(f)?i:f),!l&&"numeric"!==a.parsers[k].type||isNaN(h)||isNaN(i)?(g=isNaN(e.iExact)?e.iExact.replace(d.regex.nondigit,""):e.iExact,f=d.formatFloat(g,j)):f=e.cache,h>i&&(g=h,h=i,i=g),f>=h&&i>=f||""===h||""===i}return null},wild:function(a,d){if(c.wildOrTest.test(d.iFilter)){var e=""+(b.parseFilter(a,d.iFilter,d)||"");!c.wildTest.test(e)&&d.nestedFilters&&(e=d.isMatch?e:"^("+e+")$");try{return new RegExp(e.replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(d.exact)}catch(f){return null}}return null},fuzzy:function(a,d){if(c.fuzzyTest.test(d.iFilter)){var e,f=0,g=d.iExact.length,h=d.iFilter.slice(1),i=b.parseFilter(a,h,d)||"";for(e=0;g>e;e++)d.iExact[e]===i[f]&&(f+=1);return f===i.length}return null}},init:function(f,g,h){d.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},d.language);var i,j,k,l,m,n,o,p,q;if(g.$table.addClass("hasFilters"),h.filter_searchTimer=null,h.filter_initTimer=null,h.filter_formatterCount=0,h.filter_formatterInit=[],h.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',h.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',o="\\{"+c.query+"\\}",a.extend(c,{child:new RegExp(g.cssChildRow),filtered:new RegExp(h.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+d.language.or+"|-|"+d.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+d.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+d.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+d.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+d.language.and+"|&&)\\s+)","gi"),orTest:/\|/,orSplit:new RegExp("(?:\\s+(?:"+d.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(o,"i"),igQuery:new RegExp(o,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/'+(l.data("placeholder")||l.attr("data-placeholder")||h.filter_placeholder.select||"")+"":"",o=j,k=j,j.indexOf(h.filter_selectSourceSeparator)>=0&&(o=j.split(h.filter_selectSourceSeparator),k=o[1],o=o[0]),i+="");g.$table.find("thead").find("select."+e.filter+'[data-column="'+m+'"]').append(i),k=h.filter_selectSource,p="function"==typeof k?!0:d.getColumnData(f,k,m),p&&b.buildSelect(g.table,m,"",!0,l.hasClass(h.filter_onlyAvail))}b.buildDefault(f,!0),b.bindSearch(f,g.$table.find("."+e.filter),!0),h.filter_external&&b.bindSearch(f,h.filter_external),h.filter_hideFilters&&b.hideFilters(g),g.showProcessing&&(k="filterStart filterEnd ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(b,c){l=c?g.$table.find("."+e.header).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"",d.isProcessing(f,"filterStart"===b.type,c?l:"")})),g.filteredRows=g.totalRows,k="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(){var a=this.config.widgetOptions;n=b.setDefaults(f,g,a)||[],n.length&&(g.delayInit&&""===n.join("")||d.setFilters(f,n,!0)),g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(g)},100)}),g.pager&&g.pager.initialized&&!h.filter_initialized&&(g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(g)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(c,e,f){var g,h,i,j,k,l=d.getFilters(c)||[];if(f.filter_saveFilters&&d.storage&&(h=d.storage(c,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d||c.parsed[c.index]?a.parsers[c.index].format(b,a.table,[],c.index):b},buildRow:function(b,c,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=c.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)c.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(c.$filters=a(s+="").appendTo(c.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=c.$headerIndexed[i],j&&j.length&&(g=c.$filters.filter('[data-column="'+i+'"]'),n=d.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=d.getColumnData(b,c.headers,i),l="false"===d.getData(j[0],h,"filter")||"false"===d.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(e.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(e.filterDisabled)[0].disabled=!0)))},bindSearch:function(c,e,f){if(c=a(c)[0],e=a(e),e.length){var g,h=c.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,d.setFilters(c,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(d.regex.spaces," ")).bind("keyup"+j,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(d){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===d.which||"search"===d.type||"change"===d.type&&this.value!==h.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(c,f,g){var h=c.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:d.getFilters(c,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&d.updateCache(h,function(){b.checkFilters(c,!1,g)})):(j&&(d.setFilters(c,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+e.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(c,k,l),!1},30):(b.findRows(c,k,l),!1)):void 0)},hideFilters:function(b,c){var f,g=(c||b.$table).find("."+e.filterRow).addClass(e.filterRowHide);g.bind("mouseenter mouseleave",function(c){var d=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(d.type)?g.removeClass(e.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(e.filterRowHide)},200)}).find("input, select").bind("focus blur",function(c){var g=c,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===d.getFilters(b.$table).join("")&&h.toggleClass(e.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(b,d){if(""===b)return b;var e=c.iQuery,f=d.match(c.igQuery).length,g=f>1?a.trim(b).split(/\s/):[a.trim(b)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(f.anyMatch=!0,f.isMatch=!0,f.rowArray=f.$cells.map(function(b){return a.inArray(b,o)>-1?(f.parsed[b]?l=f.cacheArray[b]:(l=f.rawArray[b],l=a.trim(m.filter_ignoreCase?l.toLowerCase():l),e.sortLocaleCompare&&(l=d.replaceAccents(l))),l):void 0}).get(),f.filter=f.anyMatchFilter,f.iFilter=f.iAnyMatchFilter,f.exact=f.rowArray.join(" "),f.iExact=m.filter_ignoreCase?f.exact.toLowerCase():f.exact,f.cache=f.cacheArray.slice(0,-1).join(" "),g.excludeMatch=g.noAnyMatch,i=b.processTypes(e,f,g),null!==i)n=i;else if(m.filter_startsWith)for(n=!1,o=Math.min(e.columns,f.rowArray.length);!n&&o>0;)o--,n=n||0===f.rowArray[o].indexOf(f.iFilter);else n=(f.iExact+f.childRowText).indexOf(f.iFilter)>=0;if(f.anyMatch=!1,f.filters.join("")===f.filter)return n}for(o=0;o=0:f.filter===f.exact:"function"==typeof j?i=j(f.exact,f.cache,f.filter,o,f.$row,e,f):"function"==typeof j[k||f.filter]&&(l=k||f.filter,i=j[l](f.exact,f.cache,f.filter,o,f.$row,e,f))),null===i?(i=b.processTypes(e,f,g),null!==i?h=i:(l=(f.iExact+f.childRowText).indexOf(b.parseFilter(e,f.iFilter,f)),h=!m.filter_startsWith&&l>=0||m.filter_startsWith&&0===l)):h=i,n=h?n:!1);return n},findRows:function(e,f,g){if(e.config.lastCombinedFilter!==g&&e.config.widgetOptions.filter_initialized){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a.extend([],f),G=e.config,H=G.widgetOptions,I={anyMatch:!1,filters:f,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:d.getColumnData(e,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||d.getData&&"parsed"===d.getData(G.$headerIndexed[b],d.getColumnData(e,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),p=0;p1&&(D=parseInt(C[0],10)-1,D>=0&&Dx;x++)w=f[x]||"",z||(x=p),z=z&&s.length&&0===w.indexOf(s[x]||"")&&!c.alreadyFiltered.test(w)&&!c.exactTest.test(w)&&!(c.isNeg1.test(w)||c.isNeg2.test(w))&&!(""!==w&&G.$filters&&G.$filters.filter('[data-column="'+x+'"]').find("select").length&&!G.$headerIndexed[x].hasClass("filter-match"));for(y=k.not("."+H.filter_filteredRow).length,z&&0===y&&(z=!1),G.debug&&console.log("Filter: Searching through "+(z&&h>y?y:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=d.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&c.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),z=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),m=0;h>m;m++)if(E=k[m].className,q=m&&c.child.test(E),!(q||z&&c.filtered.test(E))){if(I.$row=k.eq(m),I.cacheArray=i[m],j=I.cacheArray[G.columns],I.rawArray=j.raw,I.childRowText="",!H.filter_childByColumn){for(E="",r=j.child,x=0;x")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(c,e,f))}return i===!1&&(i=b.getOptions(c,e,f)),b.processOptions(c,e,i)},processOptions:function(b,c,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j,k,l=b.config,m="undefined"!=typeof c&&null!==c&&c>=0&&ch;h++)g=e[h],k=g.text?g.text:g,j=(m&&l.parsers&&l.parsers.length&&l.parsers[c].format(k,b,[],c)||k).toString(),j=l.widgetOptions.filter_ignoreCase?j.toLowerCase():j,g.text?(g.parsed=j,n.push(g)):n.push({text:g,parsed:j});for(f=l.textSorter||"",n.sort(function(a,e){var g=a.parsed,h=e.parsed;return m&&"function"==typeof f?f(g,h,!0,c,b):m&&"object"==typeof f&&f.hasOwnProperty(c)?f[c](g,h,!0,c,b):d.sortNatural?d.sortNatural(g,h):!0}),e=[],i=n.length,h=0;i>h;h++)e.push(n[h]);return e},getOptions:function(b,c,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[c].parsed||n.$headerIndexed[c].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][c])}else if(p.push(j.normalized[f][n.columns].raw[c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(c),p.push(""+d.getElementText(n,l,c));return p},buildSelect:function(d,f,g,h,i){if(d=a(d)[0],f=parseInt(f,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var j,k,l,m,n,o,p,q=d.config,r=q.widgetOptions,s=q.$headerIndexed[f],t='",u=q.$table.find("thead").find("select."+e.filter+'[data-column="'+f+'"]').val();if(("undefined"==typeof g||""===g)&&(g=b.getOptionSource(d,f,i)),a.isArray(g)){for(j=0;j"}else""+p!="[object Object]"&&(l=p=(""+p).replace(c.quote,"""),k=l,l.indexOf(r.filter_selectSourceSeparator)>=0&&(m=l.split(r.filter_selectSourceSeparator),k=m[0],l=m[1]),t+=""!==p?"":"");g=[]}n=(q.$filters?q.$filters:q.$table.children("thead")).find("."+e.filter),r.filter_$externalFilters&&(n=n&&n.length?n.add(r.filter_$externalFilters):r.filter_$externalFilters),o=n.filter('select[data-column="'+f+'"]'),o.length&&(o[h?"html":"append"](t),a.isArray(g)||o.append(g).val(u),o.val(u))}},buildDefault:function(a,c){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||d.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",c,f.hasClass(i.filter_onlyAvail))}},c=b.regex,d.getFilters=function(c,d,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(d!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+e.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},d.setFilters=function(c,e,f,g){var h=c?a(c)[0].config:"",i=d.getFilters(c,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(e,w)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);c.resizable.setHandlePosition(b,d),c.resizable.bindings(b,d)}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d,e){var f=b.namespace+"tsresize";d.resizable_vars.disabled=e,a("body").toggleClass(c.css.resizableNoSelect,e),e?a("body").attr("unselectable","on").bind("selectstart"+f,!1):a("body").removeAttr("unselectable").unbind("selectstart"+f)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,e,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,e,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&b.sortOn(d,k))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file diff --git a/dist/js/jquery.tablesorter.js b/dist/js/jquery.tablesorter.js index cfad692e..642ae4e0 100644 --- a/dist/js/jquery.tablesorter.js +++ b/dist/js/jquery.tablesorter.js @@ -8,7 +8,7 @@ } }(function($) { -/*! TableSorter (FORK) v2.24.3 *//* +/*! TableSorter (FORK) v2.24.4 *//* * Client-side table sorting with ease! * @requires jQuery v1.2.6+ * @@ -31,7 +31,7 @@ 'use strict'; var ts = $.tablesorter = { - version : '2.24.3', + version : '2.24.4', parsers : [], widgets : [], @@ -149,12 +149,13 @@ // labels applied to sortable headers for accessibility (aria) support 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' + sortAsc : 'Ascending sort applied, ', + sortDesc : 'Descending sort applied, ', + sortNone : 'No sort applied, ', + sortDisabled : 'sorting is disabled', + nextAsc : 'activate to apply an ascending sort', + nextDesc : 'activate to apply a descending sort', + nextNone : 'activate to remove the sort' }, regex : { @@ -1003,7 +1004,7 @@ ▀████▀ ██ █████▀ ██ ██ ██ ██████ */ setHeadersCss : function( c ) { - var $sorted, header, indx, column, $header, nextSort, txt, tmp, + var $sorted, indx, column, list = c.sortList, len = list.length, none = ts.css.sortNone + ' ' + c.cssNone, @@ -1071,50 +1072,62 @@ } // add verbose aria labels len = c.$headers.length; - $headers = c.$headers.not( '.sorter-false' ); for ( indx = 0; indx < len; indx++ ) { - $header = $headers.eq( indx ); - if ( $header.length ) { - header = $headers[ indx ]; - column = parseInt( $header.attr( 'data-column' ), 10 ); - nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + ts.setColumnAriaLabel( c, c.$headers.eq( indx ) ); + } + }, + + // nextSort (optional), lets you disable next sort text + setColumnAriaLabel : function( c, $header, nextSort ) { + if ( $header.length ) { + var column = parseInt( $header.attr( 'data-column' ), 10 ), tmp = $header.hasClass( ts.css.sortAsc ) ? 'sortAsc' : - $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone'; - txt = $.trim( $header.text() ) + ': ' + - ts.language[ tmp ] + - ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; - $header.attr( 'aria-label', txt ); + $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone', + txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ]; + if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) { + txt += ts.language.sortDisabled; + } else { + nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + // if nextSort + txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; } + $header.attr( 'aria-label', txt ); } }, updateHeader : function( c ) { - var index, isDisabled, $th, col, + var index, isDisabled, $header, col, table = c.table, len = c.$headers.length; for ( index = 0; index < len; index++ ) { - $th = c.$headers.eq( index ); + $header = c.$headers.eq( index ); col = ts.getColumnData( table, c.headers, index, true ); // add 'sorter-false' class if 'parser-false' is set - isDisabled = ts.getData( $th, col, 'sorter' ) === 'false' || ts.getData( $th, col, 'parser' ) === 'false'; - $th[ 0 ].sortDisabled = isDisabled; - $th[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ).attr( 'aria-disabled', '' + isDisabled ); - // disable tab index on disabled cells - if ( c.tabIndex ) { - if ( isDisabled ) { - $th.removeAttr( 'tabindex' ); - } else { - $th.attr( 'tabindex', '0' ); - } + isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false'; + ts.setColumnSort( c, $header, isDisabled ); + } + }, + + setColumnSort : function( c, $header, isDisabled ) { + var id = c.table.id; + $header[ 0 ].sortDisabled = isDisabled; + $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ) + .attr( 'aria-disabled', '' + isDisabled ); + // disable tab index on disabled cells + if ( c.tabIndex ) { + if ( isDisabled ) { + $header.removeAttr( 'tabindex' ); + } else { + $header.attr( 'tabindex', '0' ); } - // aria-controls - requires table ID - if ( table.id ) { - if ( isDisabled ) { - $th.removeAttr( 'aria-controls' ); - } else { - $th.attr( 'aria-controls', table.id ); - } + } + // aria-controls - requires table ID + if ( id ) { + if ( isDisabled ) { + $header.removeAttr( 'aria-controls' ); + } else { + $header.attr( 'aria-controls', id ); } } }, @@ -2176,14 +2189,14 @@ // *** Process table *** // add processing indicator - isProcessing : function( $table, toggle, $ths ) { + isProcessing : function( $table, toggle, $headers ) { $table = $( $table ); var c = $table[ 0 ].config, // default to all headers - $header = $ths || $table.find( '.' + ts.css.header ); + $header = $headers || $table.find( '.' + ts.css.header ); if ( toggle ) { - // don't use sortList if custom $ths used - if ( typeof $ths !== 'undefined' && c.sortList.length > 0 ) { + // don't use sortList if custom $headers used + if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) { // get headers from the sortList $header = $header.filter( function() { // get data-column from attr to keep compatibility with jQuery 1.2.6 diff --git a/dist/js/jquery.tablesorter.min.js b/dist/js/jquery.tablesorter.min.js index 2039f75d..8b17d8fa 100644 --- a/dist/js/jquery.tablesorter.min.js +++ b/dist/js/jquery.tablesorter.min.js @@ -1,2 +1,2 @@ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a){"use strict";var b=a.tablesorter={version:"2.24.3",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},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"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},instanceMethods:{},setup:function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return void(d.debug&&(c.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody")));var e="",f=a(c),g=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&(console[console.group?"group":"log"]("Initializing tablesorter"),a.data(c,"startoveralltimer",new Date)),d.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")),d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),d.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(f.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=f.addClass(b.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=f.find(d.selectorHeaders),d.namespace?d.namespace="."+d.namespace.replace(b.regex.nonWord,""):d.namespace=".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=f.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",b.buildHeaders(d),b.fixColumnWidth(c),b.addWidgetFromClass(c),b.applyWidgetOptions(c),b.setupParsers(d),d.totalRows=0,d.delayInit||b.buildCache(d),b.bindEvents(c,d.$headers,!0),b.bindMethods(d),d.supportsDataObject&&"undefined"!=typeof f.data().sortlist?d.sortList=f.data().sortlist:g&&f.metadata()&&f.metadata().sortlist&&(d.sortList=f.metadata().sortlist),b.applyWidget(c,!0),d.sortList.length>0?b.sortOn(d,d.sortList,{},!d.initWidgets):(b.setHeadersCss(d),d.initWidgets&&b.applyWidget(c,!1)),d.showProcessing&&f.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),b.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){b.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&(console.log("Overall initialization time: "+b.benchmark(a.data(c,"startoveralltimer"))),d.debug&&console.groupEnd&&console.groupEnd()),f.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},bindMethods:function(c){var d=c.$table,e=c.namespace,f="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(e+" ");d.unbind(f.replace(b.regex.spaces," ")).bind("sortReset"+e,function(a,c){a.stopPropagation(),b.sortReset(this.config,c)}).bind("updateAll"+e,function(a,c,d){a.stopPropagation(),b.updateAll(this.config,c,d)}).bind("update"+e+" updateRows"+e,function(a,c,d){a.stopPropagation(),b.update(this.config,c,d)}).bind("updateHeaders"+e,function(a,c){a.stopPropagation(),b.updateHeaders(this.config,c)}).bind("updateCell"+e,function(a,c,d,e){a.stopPropagation(),b.updateCell(this.config,c,d,e)}).bind("addRows"+e,function(a,c,d,e){a.stopPropagation(),b.addRows(this.config,c,d,e)}).bind("updateComplete"+e,function(){this.isUpdating=!1}).bind("sorton"+e,function(a,c,d,e){a.stopPropagation(),b.sortOn(this.config,c,d,e)}).bind("appendCache"+e,function(c,d,e){c.stopPropagation(),b.appendCache(this.config,e),a.isFunction(d)&&d(this)}).bind("updateCache"+e,function(a,c,d){a.stopPropagation(),b.updateCache(this.config,c,d)}).bind("applyWidgetId"+e,function(a,c){a.stopPropagation(),b.getWidgetById(c).format(this,this.config,this.config.widgetOptions)}).bind("applyWidgets"+e,function(a,c){a.stopPropagation(),b.applyWidget(this,c)}).bind("refreshWidgets"+e,function(a,c,d){a.stopPropagation(),b.refreshWidgets(this,c,d)}).bind("destroy"+e,function(a,c,d){a.stopPropagation(),b.destroy(this,c,d)}).bind("resetToLoadState"+e,function(d){d.stopPropagation(),b.removeWidget(this,!0,!1),c=a.extend(!0,b.defaults,c.originalSettings),this.hasInitialized=!1,b.setup(this,c)})},bindEvents:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.namespace,i=null;e!==!0&&(d.addClass(h.slice(1)+"_extra_headers"),f=a.fn.closest?d.closest("table")[0]:d.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==c&&a(f).addClass(h.slice(1)+"_extra_table")),f=(g.pointerDown+" "+g.pointerUp+" "+g.pointerClick+" sort keyup ").replace(b.regex.spaces," ").split(" ").join(h+" "),d.find(g.selectorSort).add(d.filter(g.selectorSort)).unbind(f).bind(f,function(c,e){var f,h,j,k=a(c.target),l=" "+c.type+" ";if(!(1!==(c.which||c.button)&&!l.match(" "+g.pointerClick+" | sort | keyup ")||" keyup "===l&&13!==c.which||l.match(" "+g.pointerClick+" ")&&"undefined"!=typeof c.which||l.match(" "+g.pointerUp+" ")&&i!==c.target&&e!==!0)){if(l.match(" "+g.pointerDown+" "))return i=c.target,j=k.jquery.split("."),void("1"===j[0]&&j[1]<4&&c.preventDefault());if(i=null,b.regex.formElements.test(c.target.nodeName)||k.hasClass(g.cssNoSort)||k.parents("."+g.cssNoSort).length>0||k.parents("button").length>0)return!g.cancelSelection;g.delayInit&&b.isEmptyObject(g.cache)&&b.buildCache(g),f=a.fn.closest?a(this).closest("th, td"):/TH|TD/.test(this.nodeName)?a(this):a(this).parents("th, td"),j=d.index(f),g.last.clickedIndex=0>j?f.attr("data-column"):j,h=g.$headers[g.last.clickedIndex],h&&!h.sortDisabled&&b.initSort(g,h,c)}}),g.cancelSelection&&d.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(c){var d,e,f,g;for(c.headerList=[],c.headerContent=[],c.sortVars=[],c.debug&&(f=new Date),c.columns=b.computeColumnIndex(c.$table.children("thead, tfoot").children("tr")),e=c.cssIcon?'':"",c.$headers=a(a.map(c.$table.find(c.selectorHeaders),function(d,f){var g,h,i,j,k,l=a(d);if(!l.parent().hasClass(c.cssIgnoreRow))return g=b.getColumnData(c.table,c.headers,f,!0),c.headerContent[f]=l.html(),""===c.headerTemplate||l.find("."+b.css.headerIn).length||(j=c.headerTemplate.replace(b.regex.templateContent,l.html()).replace(b.regex.templateIcon,l.find("."+b.css.icon).length?"":e),c.onRenderTemplate&&(h=c.onRenderTemplate.apply(l,[f,j]),h&&"string"==typeof h&&(j=h)),l.html('
'+j+"
")),c.onRenderHeader&&c.onRenderHeader.apply(l,[f,c,c.$table]),i=parseInt(l.attr("data-column"),10),d.column=i,k=b.getData(l,g,"sortInitialOrder")||c.sortInitialOrder,c.sortVars[i]={count:-1,order:b.formatSortingOrder(k)?[1,0,2]:[0,1,2],lockedOrder:!1},k=b.getData(l,g,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(c.sortVars[i].lockedOrder=!0,c.sortVars[i].order=b.formatSortingOrder(k)?[1,1,1]:[0,0,0]),c.headerList[f]=d,l.addClass(b.css.header+" "+c.cssHeader).parent().addClass(b.css.headerRow+" "+c.cssHeaderRow).attr("role","row"),c.tabIndex&&l.attr("tabindex",0),d})),c.$headerIndexed=[],g=0;gs;){if(d=p[s].rows,d.length)for(h=0,g=a.columns,i=0;g>i;i++)j=a.$headerIndexed[h],j&&j.length&&(k=b.getColumnData(r,a.headers,h),n=b.getParserById(b.getData(j,k,"extractor")),m=b.getParserById(b.getData(j,k,"sorter")),l="false"===b.getData(j,k,"parser"),a.empties[h]=(b.getData(j,k,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top")).toLowerCase(),a.strings[h]=(b.getData(j,k,"string")||a.stringTo||"max").toLowerCase(),l&&(m=b.getParserById("no-parser")),n||(n=!1),m||(m=b.detectParserForColumn(a,d,-1,h)),a.debug&&(t["("+h+") "+j.text()]={parser:m.id,extractor:n?n.id:"none",string:a.strings[h],empty:a.empties[h]}),e.parsers[h]=m,e.extractors[h]=n,f=j[0].colSpan-1,f>0&&(h+=f,g+=f)),h++;s+=e.parsers.length?q:1}a.debug&&(b.isEmptyObject(t)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](t),console.log("Completed detecting parsers"+b.benchmark(o)),console.groupEnd&&console.groupEnd()),a.parsers=e.parsers,a.extractors=e.extractors},addParser:function(a){var c,d=b.parsers.length,e=!0;for(c=0;d>c;c++)b.parsers[c].id.toLowerCase()===a.id.toLowerCase()&&(e=!1);e&&b.parsers.push(a)},getParserById:function(a){if("false"==a)return!1;var c,d=b.parsers.length;for(c=0;d>c;c++)if(b.parsers[c].id.toLowerCase()===a.toString().toLowerCase())return b.parsers[c];return!1},detectParserForColumn:function(c,d,e,f){for(var g,h,i=b.parsers.length,j=!1,k="",l=!0;""===k&&l;)e++,d[e]?(j=d[e].cells[f],k=b.getElementText(c,j,f),h=a(j),c.debug&&console.log("Checking if value was empty on row "+e+", column: "+f+': "'+k+'"')):l=!1;for(;--i>=0;)if(g=b.parsers[i],g&&"text"!==g.id&&g.is&&g.is(k,c.table,j,h))return g;return b.getParserById("text")},getElementText:function(c,d,e){if(!d)return"";var f,g=c.textExtraction||"",h=d.jquery?d:a(d);return"string"==typeof g?"basic"===g&&"undefined"!=typeof(f=h.attr(c.textAttribute))?a.trim(f):a.trim(d.textContent||h.text()):"function"==typeof g?a.trim(g(h[0],c.table,e)):"function"==typeof(f=b.getColumnData(c.table,g,e))?a.trim(f(h[0],c.table,e)):a.trim(h[0].textContent||h.text())},getParsedText:function(a,c,d,e){"undefined"==typeof e&&(e=b.getElementText(a,c,d));var f=""+e,g=a.parsers[d],h=a.extractors[d];return g&&(h&&"function"==typeof h.format&&(e=h.format(e,a.table,c,d)),f="no-parser"===g.id?"":g.format(""+e,a.table,c,d),a.ignoreCase&&"string"==typeof f&&(f=f.toLowerCase())),f},buildCache:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=c.table,A=c.parsers;if(c.$tbodies=c.$table.children("tbody:not(."+c.cssInfoBlock+")"),l="undefined"==typeof e?c.$tbodies:e,c.cache={},c.totalRows=0,!A)return c.debug?console.warn("Warning: *Empty table!* Not building a cache"):"";for(c.debug&&(q=new Date),c.showProcessing&&b.isProcessing(z,!0),k=0;ki;++i)if(s={child:[],raw:[]},m=a(l[k].rows[i]),n=[],m.hasClass(c.cssChildRow)&&0!==i)for(y=f.normalized.length-1,t=f.normalized[y][c.columns],t.$row=t.$row.add(m),m.prev().hasClass(c.cssChildRow)||m.prev().addClass(b.css.cssHasChild),o=m.children("th, td"),y=t.child.length,t.child[y]=[],w=0,x=c.columns,j=0;x>j;j++)p=o[j],p&&(t.child[y][j]=b.getParsedText(c,p,j),v=o[j].colSpan-1,v>0&&(w+=v,x+=v)),w++;else{for(s.$row=m,s.order=i,w=0,x=c.columns,j=0;x>j;++j)p=m[0].cells[j],"undefined"==typeof A[w]?c.debug&&console.warn("No parser found for column "+j+"; cell:",p,"does it have a header?"):p&&(g=b.getElementText(c,p,w),s.raw[w]=g,h=b.getParsedText(c,p,w,g),n[w]=h,"numeric"===(A[w].type||"").toLowerCase()&&(u[w]=Math.max(Math.abs(h)||0,u[w]||0)),v=p.colSpan-1,v>0&&(w+=v,x+=v)),w++;n[c.columns]=s,f.normalized.push(n)}f.colMax=u,c.totalRows+=f.normalized.length}c.showProcessing&&b.isProcessing(z),c.debug&&console.log("Building cache for "+r+" rows"+b.benchmark(q)),a.isFunction(d)&&d(z)},getColumnText:function(c,d,e,f){c=a(c)[0];var g,h,i,j,k,l,m,n,o,p,q="function"==typeof e,r="all"===d,s={raw:[],parsed:[],$cell:[]},t=c.config;if(!b.isEmptyObject(t)){for(k=t.$tbodies.length,g=0;k>g;g++)for(i=t.cache[g].normalized,l=i.length,h=0;l>h;h++)j=i[h],(!f||j[t.columns].$row.is(f))&&(p=!0,n=r?j.slice(0,t.columns):j[d],j=j[t.columns],m=r?j.raw:j.raw[d],o=r?j.$row.children():j.$row.children().eq(d),q&&(p=e({tbodyIndex:g,rowIndex:h,parsed:n,raw:m,$row:j.$row,$cell:o})),p!==!1&&(s.parsed.push(n),s.raw.push(m),s.$cell.push(o)));return s}t.debug&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(c){var d,e,f,g,h,i,j,k,l=c.sortList,m=l.length,n=b.css.sortNone+" "+c.cssNone,o=[b.css.sortAsc+" "+c.cssAsc,b.css.sortDesc+" "+c.cssDesc],p=[c.cssIconAsc,c.cssIconDesc,c.cssIconNone],q=["ascending","descending"],r=c.$table.find("tfoot tr").children().add(a(c.namespace+"_extra_headers")).removeClass(o.join(" "));for(c.$headers.removeClass(o.join(" ")).addClass(n).attr("aria-sort","none").find("."+b.css.icon).removeClass(p.join(" ")).addClass(p[2]),f=0;m>f;f++)if(2!==l[f][1]&&(d=c.$headers.filter(function(a){for(var d=!0,e=c.$headers.eq(a),f=parseInt(e.attr("data-column"),10),g=f+c.$headers[a].colSpan;g>f;f++)d=d?b.isValueInArray(f,c.sortList)>-1:!1;return d}),d=d.not(".sorter-false").filter('[data-column="'+l[f][0]+'"]'+(1===m?":last":"")),d.length)){for(g=0;gf;f++)h=r.eq(f),h.length&&(e=r[f],g=parseInt(h.attr("data-column"),10),i=c.sortVars[g].order[(c.sortVars[g].count+1)%(c.sortReset?3:2)],k=h.hasClass(b.css.sortAsc)?"sortAsc":h.hasClass(b.css.sortDesc)?"sortDesc":"sortNone",j=a.trim(h.text())+": "+b.language[k]+b.language[0===i?"nextAsc":1===i?"nextDesc":"nextNone"],h.attr("aria-label",j))},updateHeader:function(a){var c,d,e,f,g=a.table,h=a.$headers.length;for(c=0;h>c;c++)e=a.$headers.eq(c),f=b.getColumnData(g,a.headers,c,!0),d="false"===b.getData(e,f,"sorter")||"false"===b.getData(e,f,"parser"),e[0].sortDisabled=d,e[d?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+d),a.tabIndex&&(d?e.removeAttr("tabindex"):e.attr("tabindex","0")),g.id&&(d?e.removeAttr("aria-controls"):e.attr("aria-controls",g.id))},updateHeaderSortCount:function(b,c){var d,e,f,g,h,i,j,k,l=c||b.sortList,m=l.length;for(b.sortList=[],g=0;m>g;g++)if(j=l[g],d=parseInt(j[0],10),d=0?e:f[1]%(b.sortReset?3:2)}},updateAll:function(a,c,d){var e=a.table;e.isUpdating=!0,b.refreshWidgets(e,!0,!0),b.buildHeaders(a),b.bindEvents(e,a.$headers,!0),b.bindMethods(a),b.commonUpdate(a,c,d)},update:function(a,c,d){var e=a.table;e.isUpdating=!0,b.updateHeader(a),b.commonUpdate(a,c,d)},updateHeaders:function(a,c){a.table.isUpdating=!0,b.buildHeaders(a),b.bindEvents(a.table,a.$headers,!0),b.resortComplete(a,c)},updateCell:function(c,d,e,f){c.table.isUpdating=!0,c.$table.find(c.selectorRemove).remove();var g,h,i,j,k,l,m=c.$tbodies,n=a(d),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=c.cache[o],q=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");if(d=n[0],m.length&&o>=0){if(i=m.eq(o).find("tr").index(q),k=p.normalized[i],l=q[0].cells.length,l!==c.columns)for(j=0,g=!1,h=0;l>h;h++)g||q[0].cells[h]===d?g=!0:j+=q[0].cells[h].colSpan;else j=n.index();g=b.getElementText(c,d,j),k[c.columns].raw[j]=g,g=b.getParsedText(c,d,j,g),k[j]=g,k[c.columns].$row=q,"numeric"===(c.parsers[j].type||"").toLowerCase()&&(p.colMax[j]=Math.max(Math.abs(g)||0,p.colMax[j]||0)),g="undefined"!==e?e:c.resort,g!==!1?b.checkResort(c,g,f):b.resortComplete(c,f)}},addRows:function(c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s="string"==typeof d&&1===c.$tbodies.length&&/j;j++){for(n=0,m=d[j].cells.length,p=[],o={child:[],raw:[],$row:d.eq(j),order:c.cache[i].normalized.length},l=0;m>l;l++)q=d[j].cells[l],g=b.getElementText(c,q,n),o.raw[n]=g,h=b.getParsedText(c,q,n,g),p[n]=h,"numeric"===(c.parsers[n].type||"").toLowerCase()&&(c.cache[i].colMax[n]=Math.max(Math.abs(h)||0,c.cache[i].colMax[n]||0)),r=q.colSpan-1,r>0&&(n+=r),n++;p[c.columns]=o,c.cache[i].normalized.push(p)}b.checkResort(c,e,f)}},updateCache:function(a,c,d){a.parsers&&a.parsers.length||b.setupParsers(a,d),b.buildCache(a,c,d)},appendCache:function(a,c){var d,e,f,g,h,i,j,k=a.table,l=a.widgetOptions,m=a.$tbodies,n=[],o=a.cache;if(b.isEmptyObject(o))return a.appender?a.appender(k,n):k.isUpdating?a.$table.trigger("updateComplete",k):"";for(a.debug&&(j=new Date),i=0;ih;h++)n.push(d[h][a.columns].$row),a.appender&&(!a.pager||a.pager.removeRows&&l.pager_removeRows||a.pager.ajax)||g.append(d[h][a.columns].$row);b.processTbody(k,g,!1)}a.appender&&a.appender(k,n),a.debug&&console.log("Rebuilt table"+b.benchmark(j)),c||a.appender||b.applyWidget(k),k.isUpdating&&a.$table.trigger("updateComplete",k)},commonUpdate:function(a,c,d){a.$table.find(a.selectorRemove).remove(),b.setupParsers(a),b.buildCache(a),b.checkResort(a,c,d)},initSort:function(c,d,e){if(c.table.isUpdating)return setTimeout(function(){b.initSort(c,d,e)},50);var f,g,h,i,j,k,l,m=!e[c.sortMultiSortKey],n=c.table,o=c.$headers.length,p=parseInt(a(d).attr("data-column"),10),q=c.sortVars[p].order;if(c.$table.trigger("sortStart",n),c.sortVars[p].count=e[c.sortResetKey]?2:(c.sortVars[p].count+1)%(c.sortReset?3:2),c.sortRestart)for(h=0;o>h;h++)l=c.$headers.eq(h),k=parseInt(l.attr("data-column"),10),p!==k&&(m||l.hasClass(b.css.sortNone))&&(c.sortVars[k].count=-1);if(m){if(c.sortList=[],c.last.sortList=[],null!==c.sortForce)for(f=c.sortForce,g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;g=0)for(g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;gc;c++)e=a.cache[c].colMax,f=a.cache[c].normalized,f.sort(function(c,d){var f,l,m,n,o,p,q;for(f=0;k>f;f++){if(m=j[f][0],n=j[f][1],h=0===n,a.sortStable&&c[m]===d[m]&&1===k)return c[a.columns].order-d[a.columns].order;if(l=/n/i.test(b.getSortType(a.parsers,m)),l&&a.strings[m]?(l="boolean"==typeof b.string[a.strings[m]]?(h?1:-1)*(b.string[a.strings[m]]?-1:1):a.strings[m]?b.string[a.strings[m]]||0:0,o=a.numberSorter?a.numberSorter(c[m],d[m],h,e[m],g):b["sortNumeric"+(h?"Asc":"Desc")](c[m],d[m],l,e[m],m,a)):(p=h?c:d,q=h?d:c,o="function"==typeof i?i(p[m],q[m],h,m,g):"object"==typeof i&&i.hasOwnProperty(m)?i[m](p[m],q[m],h,m,g):b["sortNatural"+(h?"Asc":"Desc")](c[m],d[m],m,a)),o)return o}return c[a.columns].order-d[a.columns].order});a.debug&&console.log("Applying sort "+j.toString()+b.benchmark(d))}},resortComplete:function(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)},checkResort:function(c,d,e){var f=a.isArray(d)?d:c.sortList,g="undefined"==typeof d?c.resort:d;g===!1||c.serverSideSorting||c.table.isProcessing?(b.resortComplete(c,e),b.applyWidget(c.table,!1)):f.length?b.sortOn(c,f,function(){b.resortComplete(c,e)},!0):b.sortReset(c,function(){b.resortComplete(c,e),b.applyWidget(c.table,!1)})},sortOn:function(c,d,e,f){var g=c.table;c.$table.trigger("sortStart",g),b.updateHeaderSortCount(c,d),b.setHeadersCss(c),c.delayInit&&b.isEmptyObject(c.cache)&&b.buildCache(c),c.$table.trigger("sortBegin",g),b.multisort(c),b.appendCache(c,f),c.$table.trigger("sortEnd",g),b.applyWidget(g),a.isFunction(e)&&e(g)},sortReset:function(c,d){c.sortList=[],b.setHeadersCss(c),b.multisort(c),b.appendCache(c),a.isFunction(d)&&d(c.table)},getSortType:function(a,b){return a&&a[b]?a[b].type||"":""},formatSortingOrder:function(a){return/^d/i.test(a)||1===a},sortNatural:function(a,c){if(a===c)return 0;var d,e,f,g,h,i,j=b.regex;if(j.hex.test(c)){if(d=parseInt(a.match(j.hex),16),e=parseInt(c.match(j.hex),16),e>d)return-1;if(d>e)return 1}for(d=a.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),e=c.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),i=Math.max(d.length,e.length),h=0;i>h;h++){if(f=isNaN(d[h])?d[h]||0:parseFloat(d[h])||0,g=isNaN(e[h])?e[h]||0:parseFloat(e[h])||0,isNaN(f)!==isNaN(g))return isNaN(f)?1:-1;if(typeof f!=typeof g&&(f+="",g+=""),g>f)return-1;if(f>g)return 1}return 0},sortNaturalAsc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:f||1:b.sortNatural(a,c)},sortNaturalDesc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:b.sortNatural(c,a)},sortText:function(a,b){return a>b?1:b>a?-1:0},getTextValue:function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},sortNumericAsc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),a-c)},sortNumericDesc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),c-a)},sortNumeric:function(a,b){return a-b},addWidget:function(a){b.widgets.push(a)},hasWidget:function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},getWidgetById:function(a){var c,d,e=b.widgets.length;for(c=0;e>c;c++)if(d=b.widgets[c],d&&d.id&&d.id.toLowerCase()===a.toLowerCase())return d},applyWidgetOptions:function(c){var d,e,f=c.config,g=f.widgets.length;if(g)for(d=0;g>d;d++)e=b.getWidgetById(f.widgets[d]),e&&e.options&&(f.widgetOptions=a.extend(!0,{},e.options,f.widgetOptions))},addWidgetFromClass:function(a){var c,d,e=a.config,f="\\s"+e.widgetClass.replace(b.regex.templateName,"([\\w-]+)")+"\\s",g=new RegExp(f,"g"),h=(" "+e.table.className+" ").match(g);if(h)for(c=h.length,d=0;c>d;d++)e.widgets.push(h[d].replace(g,"$1"))},applyWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j,k,l,m,n=c.config,o=[];if(d===!1||!c.hasInitialized||!c.isApplyingWidgets&&!c.isUpdating){if(n.debug&&(l=new Date),b.addWidgetFromClass(c),n.widgets.length){for(c.isApplyingWidgets=!0,n.widgets=a.grep(n.widgets,function(b,c){return a.inArray(b,n.widgets)===c}),h=n.widgets||[],g=h.length,f=0;g>f;f++)i=b.getWidgetById(h[f]),i&&i.id&&(i.priority||(i.priority=10),o[f]=i);for(o.sort(function(a,b){return a.priorityf;f++)i=o[f],i&&(j=i.id,k=!1,n.debug&&(m=new Date),(d||!n.widgetInit[j])&&(n.widgetInit[j]=!0,c.hasInitialized&&b.applyWidgetOptions(c),"function"==typeof i.init&&(k=!0,n.debug&&console[console.group?"group":"log"]("Initializing "+j+" widget"),i.init(c,i,c.config,c.config.widgetOptions))),d||"function"!=typeof i.format||(k=!0,n.debug&&console[console.group?"group":"log"]("Updating "+j+" widget"),i.format(c,c.config,c.config.widgetOptions,!1)),n.debug&&k&&(console.log("Completed "+(d?"initializing ":"applying ")+j+" widget"+b.benchmark(m)),console.groupEnd&&console.groupEnd()));n.debug&&console.groupEnd&&console.groupEnd(),d||"function"!=typeof e||e(c)}setTimeout(function(){c.isApplyingWidgets=!1,a.data(c,"lastWidgetApplication",new Date),n.$table.trigger("tablesorter-ready")},0),n.debug&&(i=n.widgets.length,console.log("Completed "+(d===!0?"initializing ":"applying ")+i+" widget"+(1!==i?"s":"")+b.benchmark(l)))}},removeWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=b.widgets.length,h=0;i>h;h++)g=b.widgets[h],g&&g.id&&d.push(g.id);else d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;f++)g=b.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&g.remove&&(j.debug&&console.log((e?"Refreshing":"Removing")+' "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},refreshWidgets:function(c,d,e){c=a(c)[0];var f,g,h=c.config,i=h.widgets,j=b.widgets,k=j.length,l=[],m=function(b){a(b).trigger("refreshComplete")};for(f=0;k>f;f++)g=j[f],g&&g.id&&(d||a.inArray(g.id,i)<0)&&l.push(g.id);b.removeWidget(c,l.join(","),!0),e!==!0?(b.applyWidget(c,d||!1,m),d&&b.applyWidget(c,!1,m)):m(c)},benchmark:function(a){return" ( "+((new Date).getTime()-a.getTime())+"ms )"},log:function(){console.log(arguments)},isEmptyObject:function(a){for(var b in a)return!1;return!0},isValueInArray:function(a,b){var c,d=b&&b.length||0;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},formatFloat:function(c,d){if("string"!=typeof c||""===c)return c;var e,f=d&&d.config?d.config.usNumberFormat!==!1:"undefined"!=typeof d?d:!0;return c=f?c.replace(b.regex.comma,""):c.replace(b.regex.digitNonUS,"").replace(b.regex.comma,"."),b.regex.digitNegativeTest.test(c)&&(c=c.replace(b.regex.digitNegativeReplace,"-$1")),e=parseFloat(c),isNaN(e)?a.trim(c):e},isDigit:function(a){return isNaN(a)?b.regex.digitTest.test(a.toString().replace(b.regex.digitReplace,"")):""!==a},computeColumnIndex:function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[];for(c=0;ce;e++)for("undefined"==typeof o[e]&&(o[e]=[]),p=o[e],f=n;n+m>f;f++)p[f]="x"}return p.length},fixColumnWidth:function(c){c=a(c)[0];var d,e,f,g,h,i=c.config,j=i.$table.children("colgroup");if(j.length&&j.hasClass(b.css.colgroup)&&j.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(j=a(''),d=i.$table.width(),f=i.$tbodies.find("tr:first").children(":visible"),g=f.length,h=0;g>h;h++)e=parseInt(f.eq(h).width()/d*1e3,10)/10+"%",j.append(a("").css("width",e));i.$table.prepend(j)}},getData:function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},getColumnData:function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers,k=i.$headerIndexed&&i.$headerIndexed[d]||j.filter('[data-column="'+d+'"]:last');if(c[d])return e?c[d]:c[j.index(k)];for(h in c)if("string"==typeof h&&(g=k.filter(h).add(k.find(h)),g.length))return c[h]}},isProcessing:function(c,d,e){c=a(c);var f=c[0].config,g=e||c.find("."+b.css.header);d?("undefined"!=typeof e&&f.sortList.length>0&&(g=g.filter(function(){return this.sortDisabled?!1:b.isValueInArray(parseFloat(a(this).attr("data-column")),f.sortList)>=0})),c.add(g).addClass(b.css.processing+" "+f.cssProcessing)):c.add(g).removeClass(b.css.processing+" "+f.cssProcessing); -},processTbody:function(b,c,d){if(b=a(b)[0],d)return b.isProcessing=!0,c.before(''),a.fn.detach?c.detach():c.remove();var e=a(b).find("colgroup.tablesorter-savemyplace");c.insertAfter(e),e.remove(),b.isProcessing=!1},clearTableBody:function(b){a(b)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(a){var c,d="[",e=b.characterEquivalents;if(!b.characterRegex){b.characterRegexArray={};for(c in e)"string"==typeof c&&(d+=e[c],b.characterRegexArray[c]=new RegExp("["+e[c]+"]","g"));b.characterRegex=new RegExp(d+"]")}if(b.characterRegex.test(a))for(c in e)"string"==typeof c&&(a=a.replace(b.characterRegexArray[c],c));return a},restoreHeaders:function(c){var d,e,f=a(c)[0].config,g=f.$table.find(f.selectorHeaders),h=g.length;for(d=0;h>d;d++)e=g.eq(d),e.find("."+b.css.headerIn).length&&e.html(f.headerContent[d])},destroy:function(c,d,e){if(c=a(c)[0],c.hasInitialized){b.removeWidget(c,!0,!1);var f,g=a(c),h=c.config,i=h.debug,j=g.find("thead:first"),k=j.find("tr."+b.css.headerRow).removeClass(b.css.headerRow+" "+h.cssHeaderRow),l=g.find("tfoot:first > tr").children("th, td");d===!1&&a.inArray("uitheme",h.widgets)>=0&&(g.trigger("applyWidgetId",["uitheme"]),g.trigger("applyWidgetId",["zebra"])),j.find("tr").not(k).remove(),f="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress "+"sortBegin sortEnd resetToLoadState ".split(" ").join(h.namespace+" "),g.removeData("tablesorter").unbind(f.replace(b.regex.spaces," ")),h.$headers.add(l).removeClass([b.css.header,h.cssHeader,h.cssAsc,h.cssDesc,b.css.sortAsc,b.css.sortDesc,b.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),k.find(h.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(h.namespace+" ").replace(b.regex.spaces," ")),b.restoreHeaders(c),g.toggleClass(b.css.table+" "+h.tableClass+" tablesorter-"+h.theme,d===!1),c.hasInitialized=!1,delete c.config.cache,"function"==typeof e&&e(c),i&&console.log("tablesorter has been removed")}}};a.fn.tablesorter=function(c){return this.each(function(){var d=this,e=a.extend(!0,{},b.defaults,c,b.instanceMethods);e.originalSettings=c,!d.hasInitialized&&b.buildTable&&"TABLE"!==this.nodeName?b.buildTable(d,e):b.setup(d,e)})},window.console&&window.console.log||(b.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var a=arguments.length>1?arguments:arguments[0];b.logs.push({date:Date.now(),log:a})}),b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.regex.nondigit=/[^\w,. \-()]/g,b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.currencyReplace=/[+\-,. ]/g,b.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,b.addParser({id:"currency",is:function(a){return a=(a||"").replace(b.regex.currencyReplace,""),b.regex.currencyTest.test(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,b.regex.urlProtocolReplace=/(https?|ftp|file):\/\//,b.addParser({id:"url",is:function(a){return b.regex.urlProtocolTest.test(a)},format:function(c){return c?a.trim(c.replace(b.regex.urlProtocolReplace,"")):c},parsed:!0,type:"text"}),b.regex.dash=/-/g,b.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,b.addParser({id:"isoDate",is:function(a){return b.regex.isoDate.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dash,"/")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.percent=/%/g,b.regex.percentTest=/(\d\s*?%|%\s*?\d)/,b.addParser({id:"percent",is:function(a){return b.regex.percentTest.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(b.regex.percent,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.regex.dateReplace=/(\S)([AP]M)$/i,b.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,b.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,b.addParser({id:"usLongDate",is:function(a){return b.regex.usLongDateTest1.test(a)||b.regex.usLongDateTest2.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dateReplace,"$1 $2")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,b.regex.shortDateReplace=/[\-.,]/g,b.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,b.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,b.convertFormat=function(a,c){a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),"mmddyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===c&&(a=a.replace(b.regex.shortDateYMD,"$1/$2/$3"));var d=new Date(a);return d instanceof Date&&isFinite(d)?d.getTime():""},b.addParser({id:"shortDate",is:function(a){return a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),b.regex.shortDateTest.test(a)},format:function(a,c,d,e){if(a){var f=c.config,g=f.$headerIndexed[e],h=g.length&&g.data("dateFormat")||b.getData(g,b.getColumnData(c,f.headers,e),"dateFormat")||f.dateFormat;return g.length&&g.data("dateFormat",h),b.convertFormat(a,h)||a}return a},type:"numeric"}),b.regex.timeTest=/^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)$/i,b.regex.timeMatch=/([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,b.addParser({id:"time",is:function(a){return b.regex.timeTest.test(a)},format:function(a,c){var d,e=(a||"").match(b.regex.timeMatch),f=new Date(a),g=a&&(null!==e?e[0]:"00:00 AM"),h=g?new Date("2000/01/01 "+g.replace(b.regex.dateReplace,"$1 $2")):g;return h instanceof Date&&isFinite(h)?(d=f instanceof Date&&isFinite(f)?f.getTime():0,d?parseFloat(h.getTime()+"."+f.getTime()):h.getTime()):a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies.add(a(c.namespace+"_extra_table").children("tbody:not(."+c.cssInfoBlock+")"));for(i=0;ij;j++)f=e.eq(j),l.test(f[0].className)||g++,h=g%2===0,f.removeClass(d.zebra[h?1:0]).addClass(d.zebra[h?0:1])},remove:function(a,c,d,e){if(!e){var f,g,h=c.$tbodies,i=(d.zebra||["even","odd"]).join(" ");for(f=0;f thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},instanceMethods:{},setup:function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return void(d.debug&&(c.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody")));var e="",f=a(c),g=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&(console[console.group?"group":"log"]("Initializing tablesorter"),a.data(c,"startoveralltimer",new Date)),d.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")),d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),d.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(f.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=f.addClass(b.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=f.find(d.selectorHeaders),d.namespace?d.namespace="."+d.namespace.replace(b.regex.nonWord,""):d.namespace=".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=f.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",b.buildHeaders(d),b.fixColumnWidth(c),b.addWidgetFromClass(c),b.applyWidgetOptions(c),b.setupParsers(d),d.totalRows=0,d.delayInit||b.buildCache(d),b.bindEvents(c,d.$headers,!0),b.bindMethods(d),d.supportsDataObject&&"undefined"!=typeof f.data().sortlist?d.sortList=f.data().sortlist:g&&f.metadata()&&f.metadata().sortlist&&(d.sortList=f.metadata().sortlist),b.applyWidget(c,!0),d.sortList.length>0?b.sortOn(d,d.sortList,{},!d.initWidgets):(b.setHeadersCss(d),d.initWidgets&&b.applyWidget(c,!1)),d.showProcessing&&f.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),b.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){b.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&(console.log("Overall initialization time: "+b.benchmark(a.data(c,"startoveralltimer"))),d.debug&&console.groupEnd&&console.groupEnd()),f.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},bindMethods:function(c){var d=c.$table,e=c.namespace,f="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(e+" ");d.unbind(f.replace(b.regex.spaces," ")).bind("sortReset"+e,function(a,c){a.stopPropagation(),b.sortReset(this.config,c)}).bind("updateAll"+e,function(a,c,d){a.stopPropagation(),b.updateAll(this.config,c,d)}).bind("update"+e+" updateRows"+e,function(a,c,d){a.stopPropagation(),b.update(this.config,c,d)}).bind("updateHeaders"+e,function(a,c){a.stopPropagation(),b.updateHeaders(this.config,c)}).bind("updateCell"+e,function(a,c,d,e){a.stopPropagation(),b.updateCell(this.config,c,d,e)}).bind("addRows"+e,function(a,c,d,e){a.stopPropagation(),b.addRows(this.config,c,d,e)}).bind("updateComplete"+e,function(){this.isUpdating=!1}).bind("sorton"+e,function(a,c,d,e){a.stopPropagation(),b.sortOn(this.config,c,d,e)}).bind("appendCache"+e,function(c,d,e){c.stopPropagation(),b.appendCache(this.config,e),a.isFunction(d)&&d(this)}).bind("updateCache"+e,function(a,c,d){a.stopPropagation(),b.updateCache(this.config,c,d)}).bind("applyWidgetId"+e,function(a,c){a.stopPropagation(),b.getWidgetById(c).format(this,this.config,this.config.widgetOptions)}).bind("applyWidgets"+e,function(a,c){a.stopPropagation(),b.applyWidget(this,c)}).bind("refreshWidgets"+e,function(a,c,d){a.stopPropagation(),b.refreshWidgets(this,c,d)}).bind("destroy"+e,function(a,c,d){a.stopPropagation(),b.destroy(this,c,d)}).bind("resetToLoadState"+e,function(d){d.stopPropagation(),b.removeWidget(this,!0,!1),c=a.extend(!0,b.defaults,c.originalSettings),this.hasInitialized=!1,b.setup(this,c)})},bindEvents:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.namespace,i=null;e!==!0&&(d.addClass(h.slice(1)+"_extra_headers"),f=a.fn.closest?d.closest("table")[0]:d.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==c&&a(f).addClass(h.slice(1)+"_extra_table")),f=(g.pointerDown+" "+g.pointerUp+" "+g.pointerClick+" sort keyup ").replace(b.regex.spaces," ").split(" ").join(h+" "),d.find(g.selectorSort).add(d.filter(g.selectorSort)).unbind(f).bind(f,function(c,e){var f,h,j,k=a(c.target),l=" "+c.type+" ";if(!(1!==(c.which||c.button)&&!l.match(" "+g.pointerClick+" | sort | keyup ")||" keyup "===l&&13!==c.which||l.match(" "+g.pointerClick+" ")&&"undefined"!=typeof c.which||l.match(" "+g.pointerUp+" ")&&i!==c.target&&e!==!0)){if(l.match(" "+g.pointerDown+" "))return i=c.target,j=k.jquery.split("."),void("1"===j[0]&&j[1]<4&&c.preventDefault());if(i=null,b.regex.formElements.test(c.target.nodeName)||k.hasClass(g.cssNoSort)||k.parents("."+g.cssNoSort).length>0||k.parents("button").length>0)return!g.cancelSelection;g.delayInit&&b.isEmptyObject(g.cache)&&b.buildCache(g),f=a.fn.closest?a(this).closest("th, td"):/TH|TD/.test(this.nodeName)?a(this):a(this).parents("th, td"),j=d.index(f),g.last.clickedIndex=0>j?f.attr("data-column"):j,h=g.$headers[g.last.clickedIndex],h&&!h.sortDisabled&&b.initSort(g,h,c)}}),g.cancelSelection&&d.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(c){var d,e,f,g;for(c.headerList=[],c.headerContent=[],c.sortVars=[],c.debug&&(f=new Date),c.columns=b.computeColumnIndex(c.$table.children("thead, tfoot").children("tr")),e=c.cssIcon?'':"",c.$headers=a(a.map(c.$table.find(c.selectorHeaders),function(d,f){var g,h,i,j,k,l=a(d);if(!l.parent().hasClass(c.cssIgnoreRow))return g=b.getColumnData(c.table,c.headers,f,!0),c.headerContent[f]=l.html(),""===c.headerTemplate||l.find("."+b.css.headerIn).length||(j=c.headerTemplate.replace(b.regex.templateContent,l.html()).replace(b.regex.templateIcon,l.find("."+b.css.icon).length?"":e),c.onRenderTemplate&&(h=c.onRenderTemplate.apply(l,[f,j]),h&&"string"==typeof h&&(j=h)),l.html('
'+j+"
")),c.onRenderHeader&&c.onRenderHeader.apply(l,[f,c,c.$table]),i=parseInt(l.attr("data-column"),10),d.column=i,k=b.getData(l,g,"sortInitialOrder")||c.sortInitialOrder,c.sortVars[i]={count:-1,order:b.formatSortingOrder(k)?[1,0,2]:[0,1,2],lockedOrder:!1},k=b.getData(l,g,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(c.sortVars[i].lockedOrder=!0,c.sortVars[i].order=b.formatSortingOrder(k)?[1,1,1]:[0,0,0]),c.headerList[f]=d,l.addClass(b.css.header+" "+c.cssHeader).parent().addClass(b.css.headerRow+" "+c.cssHeaderRow).attr("role","row"),c.tabIndex&&l.attr("tabindex",0),d})),c.$headerIndexed=[],g=0;gs;){if(d=p[s].rows,d.length)for(h=0,g=a.columns,i=0;g>i;i++)j=a.$headerIndexed[h],j&&j.length&&(k=b.getColumnData(r,a.headers,h),n=b.getParserById(b.getData(j,k,"extractor")),m=b.getParserById(b.getData(j,k,"sorter")),l="false"===b.getData(j,k,"parser"),a.empties[h]=(b.getData(j,k,"empty")||a.emptyTo||(a.emptyToBottom?"bottom":"top")).toLowerCase(),a.strings[h]=(b.getData(j,k,"string")||a.stringTo||"max").toLowerCase(),l&&(m=b.getParserById("no-parser")),n||(n=!1),m||(m=b.detectParserForColumn(a,d,-1,h)),a.debug&&(t["("+h+") "+j.text()]={parser:m.id,extractor:n?n.id:"none",string:a.strings[h],empty:a.empties[h]}),e.parsers[h]=m,e.extractors[h]=n,f=j[0].colSpan-1,f>0&&(h+=f,g+=f)),h++;s+=e.parsers.length?q:1}a.debug&&(b.isEmptyObject(t)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](t),console.log("Completed detecting parsers"+b.benchmark(o)),console.groupEnd&&console.groupEnd()),a.parsers=e.parsers,a.extractors=e.extractors},addParser:function(a){var c,d=b.parsers.length,e=!0;for(c=0;d>c;c++)b.parsers[c].id.toLowerCase()===a.id.toLowerCase()&&(e=!1);e&&b.parsers.push(a)},getParserById:function(a){if("false"==a)return!1;var c,d=b.parsers.length;for(c=0;d>c;c++)if(b.parsers[c].id.toLowerCase()===a.toString().toLowerCase())return b.parsers[c];return!1},detectParserForColumn:function(c,d,e,f){for(var g,h,i=b.parsers.length,j=!1,k="",l=!0;""===k&&l;)e++,d[e]?(j=d[e].cells[f],k=b.getElementText(c,j,f),h=a(j),c.debug&&console.log("Checking if value was empty on row "+e+", column: "+f+': "'+k+'"')):l=!1;for(;--i>=0;)if(g=b.parsers[i],g&&"text"!==g.id&&g.is&&g.is(k,c.table,j,h))return g;return b.getParserById("text")},getElementText:function(c,d,e){if(!d)return"";var f,g=c.textExtraction||"",h=d.jquery?d:a(d);return"string"==typeof g?"basic"===g&&"undefined"!=typeof(f=h.attr(c.textAttribute))?a.trim(f):a.trim(d.textContent||h.text()):"function"==typeof g?a.trim(g(h[0],c.table,e)):"function"==typeof(f=b.getColumnData(c.table,g,e))?a.trim(f(h[0],c.table,e)):a.trim(h[0].textContent||h.text())},getParsedText:function(a,c,d,e){"undefined"==typeof e&&(e=b.getElementText(a,c,d));var f=""+e,g=a.parsers[d],h=a.extractors[d];return g&&(h&&"function"==typeof h.format&&(e=h.format(e,a.table,c,d)),f="no-parser"===g.id?"":g.format(""+e,a.table,c,d),a.ignoreCase&&"string"==typeof f&&(f=f.toLowerCase())),f},buildCache:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=c.table,A=c.parsers;if(c.$tbodies=c.$table.children("tbody:not(."+c.cssInfoBlock+")"),l="undefined"==typeof e?c.$tbodies:e,c.cache={},c.totalRows=0,!A)return c.debug?console.warn("Warning: *Empty table!* Not building a cache"):"";for(c.debug&&(q=new Date),c.showProcessing&&b.isProcessing(z,!0),k=0;ki;++i)if(s={child:[],raw:[]},m=a(l[k].rows[i]),n=[],m.hasClass(c.cssChildRow)&&0!==i)for(y=f.normalized.length-1,t=f.normalized[y][c.columns],t.$row=t.$row.add(m),m.prev().hasClass(c.cssChildRow)||m.prev().addClass(b.css.cssHasChild),o=m.children("th, td"),y=t.child.length,t.child[y]=[],w=0,x=c.columns,j=0;x>j;j++)p=o[j],p&&(t.child[y][j]=b.getParsedText(c,p,j),v=o[j].colSpan-1,v>0&&(w+=v,x+=v)),w++;else{for(s.$row=m,s.order=i,w=0,x=c.columns,j=0;x>j;++j)p=m[0].cells[j],"undefined"==typeof A[w]?c.debug&&console.warn("No parser found for column "+j+"; cell:",p,"does it have a header?"):p&&(g=b.getElementText(c,p,w),s.raw[w]=g,h=b.getParsedText(c,p,w,g),n[w]=h,"numeric"===(A[w].type||"").toLowerCase()&&(u[w]=Math.max(Math.abs(h)||0,u[w]||0)),v=p.colSpan-1,v>0&&(w+=v,x+=v)),w++;n[c.columns]=s,f.normalized.push(n)}f.colMax=u,c.totalRows+=f.normalized.length}c.showProcessing&&b.isProcessing(z),c.debug&&console.log("Building cache for "+r+" rows"+b.benchmark(q)),a.isFunction(d)&&d(z)},getColumnText:function(c,d,e,f){c=a(c)[0];var g,h,i,j,k,l,m,n,o,p,q="function"==typeof e,r="all"===d,s={raw:[],parsed:[],$cell:[]},t=c.config;if(!b.isEmptyObject(t)){for(k=t.$tbodies.length,g=0;k>g;g++)for(i=t.cache[g].normalized,l=i.length,h=0;l>h;h++)j=i[h],(!f||j[t.columns].$row.is(f))&&(p=!0,n=r?j.slice(0,t.columns):j[d],j=j[t.columns],m=r?j.raw:j.raw[d],o=r?j.$row.children():j.$row.children().eq(d),q&&(p=e({tbodyIndex:g,rowIndex:h,parsed:n,raw:m,$row:j.$row,$cell:o})),p!==!1&&(s.parsed.push(n),s.raw.push(m),s.$cell.push(o)));return s}t.debug&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(c){var d,e,f,g=c.sortList,h=g.length,i=b.css.sortNone+" "+c.cssNone,j=[b.css.sortAsc+" "+c.cssAsc,b.css.sortDesc+" "+c.cssDesc],k=[c.cssIconAsc,c.cssIconDesc,c.cssIconNone],l=["ascending","descending"],m=c.$table.find("tfoot tr").children().add(a(c.namespace+"_extra_headers")).removeClass(j.join(" "));for(c.$headers.removeClass(j.join(" ")).addClass(i).attr("aria-sort","none").find("."+b.css.icon).removeClass(k.join(" ")).addClass(k[2]),e=0;h>e;e++)if(2!==g[e][1]&&(d=c.$headers.filter(function(a){for(var d=!0,e=c.$headers.eq(a),f=parseInt(e.attr("data-column"),10),g=f+c.$headers[a].colSpan;g>f;f++)d=d?b.isValueInArray(f,c.sortList)>-1:!1;return d}),d=d.not(".sorter-false").filter('[data-column="'+g[e][0]+'"]'+(1===h?":last":"")),d.length)){for(f=0;fe;e++)b.setColumnAriaLabel(c,c.$headers.eq(e))},setColumnAriaLabel:function(c,d,e){if(d.length){var f=parseInt(d.attr("data-column"),10),g=d.hasClass(b.css.sortAsc)?"sortAsc":d.hasClass(b.css.sortDesc)?"sortDesc":"sortNone",h=a.trim(d.text())+": "+b.language[g];d.hasClass("sorter-false")||e===!1?h+=b.language.sortDisabled:(e=c.sortVars[f].order[(c.sortVars[f].count+1)%(c.sortReset?3:2)],h+=b.language[0===e?"nextAsc":1===e?"nextDesc":"nextNone"]),d.attr("aria-label",h)}},updateHeader:function(a){var c,d,e,f,g=a.table,h=a.$headers.length;for(c=0;h>c;c++)e=a.$headers.eq(c),f=b.getColumnData(g,a.headers,c,!0),d="false"===b.getData(e,f,"sorter")||"false"===b.getData(e,f,"parser"),b.setColumnSort(a,e,d)},setColumnSort:function(a,b,c){var d=a.table.id;b[0].sortDisabled=c,b[c?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+c),a.tabIndex&&(c?b.removeAttr("tabindex"):b.attr("tabindex","0")),d&&(c?b.removeAttr("aria-controls"):b.attr("aria-controls",d))},updateHeaderSortCount:function(b,c){var d,e,f,g,h,i,j,k,l=c||b.sortList,m=l.length;for(b.sortList=[],g=0;m>g;g++)if(j=l[g],d=parseInt(j[0],10),d=0?e:f[1]%(b.sortReset?3:2)}},updateAll:function(a,c,d){var e=a.table;e.isUpdating=!0,b.refreshWidgets(e,!0,!0),b.buildHeaders(a),b.bindEvents(e,a.$headers,!0),b.bindMethods(a),b.commonUpdate(a,c,d)},update:function(a,c,d){var e=a.table;e.isUpdating=!0,b.updateHeader(a),b.commonUpdate(a,c,d)},updateHeaders:function(a,c){a.table.isUpdating=!0,b.buildHeaders(a),b.bindEvents(a.table,a.$headers,!0),b.resortComplete(a,c)},updateCell:function(c,d,e,f){c.table.isUpdating=!0,c.$table.find(c.selectorRemove).remove();var g,h,i,j,k,l,m=c.$tbodies,n=a(d),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=c.cache[o],q=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");if(d=n[0],m.length&&o>=0){if(i=m.eq(o).find("tr").index(q),k=p.normalized[i],l=q[0].cells.length,l!==c.columns)for(j=0,g=!1,h=0;l>h;h++)g||q[0].cells[h]===d?g=!0:j+=q[0].cells[h].colSpan;else j=n.index();g=b.getElementText(c,d,j),k[c.columns].raw[j]=g,g=b.getParsedText(c,d,j,g),k[j]=g,k[c.columns].$row=q,"numeric"===(c.parsers[j].type||"").toLowerCase()&&(p.colMax[j]=Math.max(Math.abs(g)||0,p.colMax[j]||0)),g="undefined"!==e?e:c.resort,g!==!1?b.checkResort(c,g,f):b.resortComplete(c,f)}},addRows:function(c,d,e,f){var g,h,i,j,k,l,m,n,o,p,q,r,s="string"==typeof d&&1===c.$tbodies.length&&/j;j++){for(n=0,m=d[j].cells.length,p=[],o={child:[],raw:[],$row:d.eq(j),order:c.cache[i].normalized.length},l=0;m>l;l++)q=d[j].cells[l],g=b.getElementText(c,q,n),o.raw[n]=g,h=b.getParsedText(c,q,n,g),p[n]=h,"numeric"===(c.parsers[n].type||"").toLowerCase()&&(c.cache[i].colMax[n]=Math.max(Math.abs(h)||0,c.cache[i].colMax[n]||0)),r=q.colSpan-1,r>0&&(n+=r),n++;p[c.columns]=o,c.cache[i].normalized.push(p)}b.checkResort(c,e,f)}},updateCache:function(a,c,d){a.parsers&&a.parsers.length||b.setupParsers(a,d),b.buildCache(a,c,d)},appendCache:function(a,c){var d,e,f,g,h,i,j,k=a.table,l=a.widgetOptions,m=a.$tbodies,n=[],o=a.cache;if(b.isEmptyObject(o))return a.appender?a.appender(k,n):k.isUpdating?a.$table.trigger("updateComplete",k):"";for(a.debug&&(j=new Date),i=0;ih;h++)n.push(d[h][a.columns].$row),a.appender&&(!a.pager||a.pager.removeRows&&l.pager_removeRows||a.pager.ajax)||g.append(d[h][a.columns].$row);b.processTbody(k,g,!1)}a.appender&&a.appender(k,n),a.debug&&console.log("Rebuilt table"+b.benchmark(j)),c||a.appender||b.applyWidget(k),k.isUpdating&&a.$table.trigger("updateComplete",k)},commonUpdate:function(a,c,d){a.$table.find(a.selectorRemove).remove(),b.setupParsers(a),b.buildCache(a),b.checkResort(a,c,d)},initSort:function(c,d,e){if(c.table.isUpdating)return setTimeout(function(){b.initSort(c,d,e)},50);var f,g,h,i,j,k,l,m=!e[c.sortMultiSortKey],n=c.table,o=c.$headers.length,p=parseInt(a(d).attr("data-column"),10),q=c.sortVars[p].order;if(c.$table.trigger("sortStart",n),c.sortVars[p].count=e[c.sortResetKey]?2:(c.sortVars[p].count+1)%(c.sortReset?3:2),c.sortRestart)for(h=0;o>h;h++)l=c.$headers.eq(h),k=parseInt(l.attr("data-column"),10),p!==k&&(m||l.hasClass(b.css.sortNone))&&(c.sortVars[k].count=-1);if(m){if(c.sortList=[],c.last.sortList=[],null!==c.sortForce)for(f=c.sortForce,g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;g=0)for(g=0;gi&&(c.sortList.push([p,i]),d.colSpan>1))for(g=1;gc;c++)e=a.cache[c].colMax,f=a.cache[c].normalized,f.sort(function(c,d){var f,l,m,n,o,p,q;for(f=0;k>f;f++){if(m=j[f][0],n=j[f][1],h=0===n,a.sortStable&&c[m]===d[m]&&1===k)return c[a.columns].order-d[a.columns].order;if(l=/n/i.test(b.getSortType(a.parsers,m)),l&&a.strings[m]?(l="boolean"==typeof b.string[a.strings[m]]?(h?1:-1)*(b.string[a.strings[m]]?-1:1):a.strings[m]?b.string[a.strings[m]]||0:0,o=a.numberSorter?a.numberSorter(c[m],d[m],h,e[m],g):b["sortNumeric"+(h?"Asc":"Desc")](c[m],d[m],l,e[m],m,a)):(p=h?c:d,q=h?d:c,o="function"==typeof i?i(p[m],q[m],h,m,g):"object"==typeof i&&i.hasOwnProperty(m)?i[m](p[m],q[m],h,m,g):b["sortNatural"+(h?"Asc":"Desc")](c[m],d[m],m,a)),o)return o}return c[a.columns].order-d[a.columns].order});a.debug&&console.log("Applying sort "+j.toString()+b.benchmark(d))}},resortComplete:function(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)},checkResort:function(c,d,e){var f=a.isArray(d)?d:c.sortList,g="undefined"==typeof d?c.resort:d;g===!1||c.serverSideSorting||c.table.isProcessing?(b.resortComplete(c,e),b.applyWidget(c.table,!1)):f.length?b.sortOn(c,f,function(){b.resortComplete(c,e)},!0):b.sortReset(c,function(){b.resortComplete(c,e),b.applyWidget(c.table,!1)})},sortOn:function(c,d,e,f){var g=c.table;c.$table.trigger("sortStart",g),b.updateHeaderSortCount(c,d),b.setHeadersCss(c),c.delayInit&&b.isEmptyObject(c.cache)&&b.buildCache(c),c.$table.trigger("sortBegin",g),b.multisort(c),b.appendCache(c,f),c.$table.trigger("sortEnd",g),b.applyWidget(g),a.isFunction(e)&&e(g)},sortReset:function(c,d){c.sortList=[],b.setHeadersCss(c),b.multisort(c),b.appendCache(c),a.isFunction(d)&&d(c.table)},getSortType:function(a,b){return a&&a[b]?a[b].type||"":""},formatSortingOrder:function(a){return/^d/i.test(a)||1===a},sortNatural:function(a,c){if(a===c)return 0;var d,e,f,g,h,i,j=b.regex;if(j.hex.test(c)){if(d=parseInt(a.match(j.hex),16),e=parseInt(c.match(j.hex),16),e>d)return-1;if(d>e)return 1}for(d=a.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),e=c.replace(j.chunk,"\\0$1\\0").replace(j.chunks,"").split("\\0"),i=Math.max(d.length,e.length),h=0;i>h;h++){if(f=isNaN(d[h])?d[h]||0:parseFloat(d[h])||0,g=isNaN(e[h])?e[h]||0:parseFloat(e[h])||0,isNaN(f)!==isNaN(g))return isNaN(f)?1:-1;if(typeof f!=typeof g&&(f+="",g+=""),g>f)return-1;if(f>g)return 1}return 0},sortNaturalAsc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:f||1:b.sortNatural(a,c)},sortNaturalDesc:function(a,c,d,e){if(a===c)return 0;var f=b.string[e.empties[d]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===c&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:b.sortNatural(c,a)},sortText:function(a,b){return a>b?1:b>a?-1:0},getTextValue:function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},sortNumericAsc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),a-c)},sortNumericDesc:function(a,c,d,e,f,g){if(a===c)return 0;var h=b.string[g.empties[f]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===c&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=b.getTextValue(a,d,e)),isNaN(c)&&(c=b.getTextValue(c,d,e)),c-a)},sortNumeric:function(a,b){return a-b},addWidget:function(a){b.widgets.push(a)},hasWidget:function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},getWidgetById:function(a){var c,d,e=b.widgets.length;for(c=0;e>c;c++)if(d=b.widgets[c],d&&d.id&&d.id.toLowerCase()===a.toLowerCase())return d},applyWidgetOptions:function(c){var d,e,f=c.config,g=f.widgets.length;if(g)for(d=0;g>d;d++)e=b.getWidgetById(f.widgets[d]),e&&e.options&&(f.widgetOptions=a.extend(!0,{},e.options,f.widgetOptions))},addWidgetFromClass:function(a){var c,d,e=a.config,f="\\s"+e.widgetClass.replace(b.regex.templateName,"([\\w-]+)")+"\\s",g=new RegExp(f,"g"),h=(" "+e.table.className+" ").match(g);if(h)for(c=h.length,d=0;c>d;d++)e.widgets.push(h[d].replace(g,"$1"))},applyWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j,k,l,m,n=c.config,o=[];if(d===!1||!c.hasInitialized||!c.isApplyingWidgets&&!c.isUpdating){if(n.debug&&(l=new Date),b.addWidgetFromClass(c),n.widgets.length){for(c.isApplyingWidgets=!0,n.widgets=a.grep(n.widgets,function(b,c){return a.inArray(b,n.widgets)===c}),h=n.widgets||[],g=h.length,f=0;g>f;f++)i=b.getWidgetById(h[f]),i&&i.id&&(i.priority||(i.priority=10),o[f]=i);for(o.sort(function(a,b){return a.priorityf;f++)i=o[f],i&&(j=i.id,k=!1,n.debug&&(m=new Date),(d||!n.widgetInit[j])&&(n.widgetInit[j]=!0,c.hasInitialized&&b.applyWidgetOptions(c),"function"==typeof i.init&&(k=!0,n.debug&&console[console.group?"group":"log"]("Initializing "+j+" widget"),i.init(c,i,c.config,c.config.widgetOptions))),d||"function"!=typeof i.format||(k=!0,n.debug&&console[console.group?"group":"log"]("Updating "+j+" widget"),i.format(c,c.config,c.config.widgetOptions,!1)),n.debug&&k&&(console.log("Completed "+(d?"initializing ":"applying ")+j+" widget"+b.benchmark(m)),console.groupEnd&&console.groupEnd()));n.debug&&console.groupEnd&&console.groupEnd(),d||"function"!=typeof e||e(c)}setTimeout(function(){c.isApplyingWidgets=!1,a.data(c,"lastWidgetApplication",new Date),n.$table.trigger("tablesorter-ready")},0),n.debug&&(i=n.widgets.length,console.log("Completed "+(d===!0?"initializing ":"applying ")+i+" widget"+(1!==i?"s":"")+b.benchmark(l)))}},removeWidget:function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=b.widgets.length,h=0;i>h;h++)g=b.widgets[h],g&&g.id&&d.push(g.id);else d=(a.isArray(d)?d.join(","):d||"").toLowerCase().split(/[\s,]+/);for(i=d.length,f=0;i>f;f++)g=b.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&g.remove&&(j.debug&&console.log((e?"Refreshing":"Removing")+' "'+d[f]+'" widget'),g.remove(c,j,j.widgetOptions,e),j.widgetInit[d[f]]=!1),h>=0&&e!==!0&&j.widgets.splice(h,1)},refreshWidgets:function(c,d,e){c=a(c)[0];var f,g,h=c.config,i=h.widgets,j=b.widgets,k=j.length,l=[],m=function(b){a(b).trigger("refreshComplete")};for(f=0;k>f;f++)g=j[f],g&&g.id&&(d||a.inArray(g.id,i)<0)&&l.push(g.id);b.removeWidget(c,l.join(","),!0),e!==!0?(b.applyWidget(c,d||!1,m),d&&b.applyWidget(c,!1,m)):m(c)},benchmark:function(a){return" ( "+((new Date).getTime()-a.getTime())+"ms )"},log:function(){console.log(arguments)},isEmptyObject:function(a){for(var b in a)return!1;return!0},isValueInArray:function(a,b){var c,d=b&&b.length||0;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},formatFloat:function(c,d){if("string"!=typeof c||""===c)return c;var e,f=d&&d.config?d.config.usNumberFormat!==!1:"undefined"!=typeof d?d:!0;return c=f?c.replace(b.regex.comma,""):c.replace(b.regex.digitNonUS,"").replace(b.regex.comma,"."),b.regex.digitNegativeTest.test(c)&&(c=c.replace(b.regex.digitNegativeReplace,"-$1")),e=parseFloat(c),isNaN(e)?a.trim(c):e},isDigit:function(a){return isNaN(a)?b.regex.digitTest.test(a.toString().replace(b.regex.digitReplace,"")):""!==a},computeColumnIndex:function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o=[],p=[];for(c=0;ce;e++)for("undefined"==typeof o[e]&&(o[e]=[]),p=o[e],f=n;n+m>f;f++)p[f]="x"}return p.length},fixColumnWidth:function(c){c=a(c)[0];var d,e,f,g,h,i=c.config,j=i.$table.children("colgroup");if(j.length&&j.hasClass(b.css.colgroup)&&j.remove(),i.widthFixed&&0===i.$table.children("colgroup").length){for(j=a(''),d=i.$table.width(),f=i.$tbodies.find("tr:first").children(":visible"),g=f.length,h=0;g>h;h++)e=parseInt(f.eq(h).width()/d*1e3,10)/10+"%",j.append(a("").css("width",e));i.$table.prepend(j)}},getData:function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},getColumnData:function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers,k=i.$headerIndexed&&i.$headerIndexed[d]||j.filter('[data-column="'+d+'"]:last');if(c[d])return e?c[d]:c[j.index(k)];for(h in c)if("string"==typeof h&&(g=k.filter(h).add(k.find(h)),g.length))return c[h]}},isProcessing:function(c,d,e){c=a(c);var f=c[0].config,g=e||c.find("."+b.css.header);d?("undefined"!=typeof e&&f.sortList.length>0&&(g=g.filter(function(){ +return this.sortDisabled?!1:b.isValueInArray(parseFloat(a(this).attr("data-column")),f.sortList)>=0})),c.add(g).addClass(b.css.processing+" "+f.cssProcessing)):c.add(g).removeClass(b.css.processing+" "+f.cssProcessing)},processTbody:function(b,c,d){if(b=a(b)[0],d)return b.isProcessing=!0,c.before(''),a.fn.detach?c.detach():c.remove();var e=a(b).find("colgroup.tablesorter-savemyplace");c.insertAfter(e),e.remove(),b.isProcessing=!1},clearTableBody:function(b){a(b)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(a){var c,d="[",e=b.characterEquivalents;if(!b.characterRegex){b.characterRegexArray={};for(c in e)"string"==typeof c&&(d+=e[c],b.characterRegexArray[c]=new RegExp("["+e[c]+"]","g"));b.characterRegex=new RegExp(d+"]")}if(b.characterRegex.test(a))for(c in e)"string"==typeof c&&(a=a.replace(b.characterRegexArray[c],c));return a},restoreHeaders:function(c){var d,e,f=a(c)[0].config,g=f.$table.find(f.selectorHeaders),h=g.length;for(d=0;h>d;d++)e=g.eq(d),e.find("."+b.css.headerIn).length&&e.html(f.headerContent[d])},destroy:function(c,d,e){if(c=a(c)[0],c.hasInitialized){b.removeWidget(c,!0,!1);var f,g=a(c),h=c.config,i=h.debug,j=g.find("thead:first"),k=j.find("tr."+b.css.headerRow).removeClass(b.css.headerRow+" "+h.cssHeaderRow),l=g.find("tfoot:first > tr").children("th, td");d===!1&&a.inArray("uitheme",h.widgets)>=0&&(g.trigger("applyWidgetId",["uitheme"]),g.trigger("applyWidgetId",["zebra"])),j.find("tr").not(k).remove(),f="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress "+"sortBegin sortEnd resetToLoadState ".split(" ").join(h.namespace+" "),g.removeData("tablesorter").unbind(f.replace(b.regex.spaces," ")),h.$headers.add(l).removeClass([b.css.header,h.cssHeader,h.cssAsc,h.cssDesc,b.css.sortAsc,b.css.sortDesc,b.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),k.find(h.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(h.namespace+" ").replace(b.regex.spaces," ")),b.restoreHeaders(c),g.toggleClass(b.css.table+" "+h.tableClass+" tablesorter-"+h.theme,d===!1),c.hasInitialized=!1,delete c.config.cache,"function"==typeof e&&e(c),i&&console.log("tablesorter has been removed")}}};a.fn.tablesorter=function(c){return this.each(function(){var d=this,e=a.extend(!0,{},b.defaults,c,b.instanceMethods);e.originalSettings=c,!d.hasInitialized&&b.buildTable&&"TABLE"!==this.nodeName?b.buildTable(d,e):b.setup(d,e)})},window.console&&window.console.log||(b.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var a=arguments.length>1?arguments:arguments[0];b.logs.push({date:Date.now(),log:a})}),b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.regex.nondigit=/[^\w,. \-()]/g,b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.currencyReplace=/[+\-,. ]/g,b.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,b.addParser({id:"currency",is:function(a){return a=(a||"").replace(b.regex.currencyReplace,""),b.regex.currencyTest.test(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(b.regex.nondigit,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,b.regex.urlProtocolReplace=/(https?|ftp|file):\/\//,b.addParser({id:"url",is:function(a){return b.regex.urlProtocolTest.test(a)},format:function(c){return c?a.trim(c.replace(b.regex.urlProtocolReplace,"")):c},parsed:!0,type:"text"}),b.regex.dash=/-/g,b.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,b.addParser({id:"isoDate",is:function(a){return b.regex.isoDate.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dash,"/")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.percent=/%/g,b.regex.percentTest=/(\d\s*?%|%\s*?\d)/,b.addParser({id:"percent",is:function(a){return b.regex.percentTest.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(b.regex.percent,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.regex.dateReplace=/(\S)([AP]M)$/i,b.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,b.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,b.addParser({id:"usLongDate",is:function(a){return b.regex.usLongDateTest1.test(a)||b.regex.usLongDateTest2.test(a)},format:function(a,c){var d=a?new Date(a.replace(b.regex.dateReplace,"$1 $2")):a;return d instanceof Date&&isFinite(d)?d.getTime():a},type:"numeric"}),b.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,b.regex.shortDateReplace=/[\-.,]/g,b.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,b.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,b.convertFormat=function(a,c){a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),"mmddyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===c?a=a.replace(b.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===c&&(a=a.replace(b.regex.shortDateYMD,"$1/$2/$3"));var d=new Date(a);return d instanceof Date&&isFinite(d)?d.getTime():""},b.addParser({id:"shortDate",is:function(a){return a=(a||"").replace(b.regex.spaces," ").replace(b.regex.shortDateReplace,"/"),b.regex.shortDateTest.test(a)},format:function(a,c,d,e){if(a){var f=c.config,g=f.$headerIndexed[e],h=g.length&&g.data("dateFormat")||b.getData(g,b.getColumnData(c,f.headers,e),"dateFormat")||f.dateFormat;return g.length&&g.data("dateFormat",h),b.convertFormat(a,h)||a}return a},type:"numeric"}),b.regex.timeTest=/^([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)$/i,b.regex.timeMatch=/([1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,b.addParser({id:"time",is:function(a){return b.regex.timeTest.test(a)},format:function(a,c){var d,e=(a||"").match(b.regex.timeMatch),f=new Date(a),g=a&&(null!==e?e[0]:"00:00 AM"),h=g?new Date("2000/01/01 "+g.replace(b.regex.dateReplace,"$1 $2")):g;return h instanceof Date&&isFinite(h)?(d=f instanceof Date&&isFinite(f)?f.getTime():0,d?parseFloat(h.getTime()+"."+f.getTime()):h.getTime()):a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue";return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies.add(a(c.namespace+"_extra_table").children("tbody:not(."+c.cssInfoBlock+")"));for(i=0;ij;j++)f=e.eq(j),l.test(f[0].className)||g++,h=g%2===0,f.removeClass(d.zebra[h?1:0]).addClass(d.zebra[h?0:1])},remove:function(a,c,d,e){if(!e){var f,g,h=c.$tbodies,i=(d.zebra||["even","odd"]).join(" ");for(f=0;f Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group @@ -513,22 +514,20 @@ }, // Look for an AND or && operator ( logical and ) and : function( c, data, vars ) { - if ( tsf.regex.andTest.test( data.filter ) ) { + if ( tsfRegex.andTest.test( data.filter ) ) { var indx, filterMatched, result, query, regex, // duplicate data but split filter data2 = $.extend( {}, data ), - index = data.index, - parsed = data.parsed[ index ], - filter = data.filter.split( tsf.regex.andSplit ), - iFilter = data.iFilter.split( tsf.regex.andSplit ), + filter = data.filter.split( tsfRegex.andSplit ), + iFilter = data.iFilter.split( tsfRegex.andSplit ), len = filter.length; for ( indx = 0; indx < len; indx++ ) { data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], index, parsed ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], index, parsed ) || '' ); - query = ( '(' + ( tsf.parseFilter( c, data2.filter, index, parsed ) || '' ) + ')' ) + data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); + data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); + query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' ) // replace wild cards since /(a*)/i will match anything - .replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ); + .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ); try { // use try/catch just in case RegExp is invalid regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' ); @@ -550,10 +549,10 @@ }, // Look for regex regex: function( c, data ) { - if ( tsf.regex.regex.test( data.filter ) ) { + if ( tsfRegex.regex.test( data.filter ) ) { var matches, // cache regex per column for optimal speed - regex = data.filter_regexCache[ data.index ] || tsf.regex.regex.exec( data.filter ), + regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ), isRegex = regex instanceof RegExp; try { if ( !isRegex ) { @@ -572,18 +571,17 @@ // Look for operators >, >=, < or <= operators: function( c, data ) { // ignore empty strings... because '' < 10 is true - if ( tsf.regex.operTest.test( data.iFilter ) && data.iExact !== '' ) { + if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) { var cachedValue, result, txt, table = c.table, - index = data.index, - parsed = data.parsed[index], - query = ts.formatFloat( data.iFilter.replace( tsf.regex.operators, '' ), table ), - parser = c.parsers[index], + parsed = data.parsed[ data.index ], + query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ), + parser = c.parsers[ data.index ], savedSearch = query; // parse filter value in case we're comparing numbers ( dates ) if ( parsed || parser.type === 'numeric' ) { - txt = $.trim( '' + data.iFilter.replace( tsf.regex.operators, '' ) ); - result = tsf.parseFilter( c, txt, index, true ); + txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) ); + result = tsf.parseFilter( c, txt, data, true ); query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query; } // iExact may be numeric - see issue #149; @@ -595,10 +593,10 @@ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact; cachedValue = ts.formatFloat( txt, table ); } - if ( tsf.regex.gtTest.test( data.iFilter ) ) { - result = tsf.regex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; - } else if ( tsf.regex.ltTest.test( data.iFilter ) ) { - result = tsf.regex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; + if ( tsfRegex.gtTest.test( data.iFilter ) ) { + result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; + } else if ( tsfRegex.ltTest.test( data.iFilter ) ) { + result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; } // keep showing all rows if nothing follows the operator if ( !result && savedSearch === '' ) { @@ -610,13 +608,13 @@ }, // Look for a not match notMatch: function( c, data ) { - if ( tsf.regex.notTest.test( data.iFilter ) ) { + if ( tsfRegex.notTest.test( data.iFilter ) ) { var indx, txt = data.iFilter.replace( '!', '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; - if ( tsf.regex.exact.test( filter ) ) { + filter = tsf.parseFilter( c, txt, data ) || ''; + if ( tsfRegex.exact.test( filter ) ) { // look for exact not matches - see #628 - filter = filter.replace( tsf.regex.exact, '' ); + filter = filter.replace( tsfRegex.exact, '' ); return filter === '' ? true : $.trim( filter ) !== data.iExact; } else { indx = data.iExact.search( $.trim( filter ) ); @@ -628,29 +626,29 @@ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric exact: function( c, data ) { /*jshint eqeqeq:false */ - if ( tsf.regex.exact.test( data.iFilter ) ) { - var txt = data.iFilter.replace( tsf.regex.exact, '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + if ( tsfRegex.exact.test( data.iFilter ) ) { + var txt = data.iFilter.replace( tsfRegex.exact, '' ), + filter = tsf.parseFilter( c, txt, data ) || ''; return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; } return null; }, // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu! range : function( c, data ) { - if ( tsf.regex.toTest.test( data.iFilter ) ) { + if ( tsfRegex.toTest.test( data.iFilter ) ) { var result, tmp, range1, range2, table = c.table, index = data.index, parsed = data.parsed[index], // make sure the dash is for a range and not indicating a negative number - query = data.iFilter.split( tsf.regex.toSplit ); + query = data.iFilter.split( tsfRegex.toSplit ); tmp = query[0].replace( ts.regex.nondigit, '' ) || ''; - range1 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); tmp = query[1].replace( ts.regex.nondigit, '' ) || ''; - range2 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); // parse filter value in case we're comparing numbers ( dates ) - if ( parsed || c.parsers[index].type === 'numeric' ) { + if ( parsed || c.parsers[ index ].type === 'numeric' ) { result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index ); range1 = ( result !== '' && !isNaN( result ) ) ? result : range1; result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index ); @@ -671,18 +669,16 @@ }, // Look for wild card: ? = single, * = multiple, or | = logical OR wild : function( c, data ) { - if ( tsf.regex.wildOrTest.test( data.iFilter ) ) { - var index = data.index, - parsed = data.parsed[ index ], - query = '' + ( tsf.parseFilter( c, data.iFilter, index, parsed ) || '' ); + if ( tsfRegex.wildOrTest.test( data.iFilter ) ) { + var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' ); // look for an exact match with the 'or' unless the 'filter-match' class is found - if ( !tsf.regex.wildTest.test( query ) && data.nestedFilters ) { + if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) { query = data.isMatch ? query : '^(' + query + ')$'; } // parsing the filter may not work properly when using wildcards =/ try { return new RegExp( - query.replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ), + query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ), c.widgetOptions.filter_ignoreCase ? 'i' : '' ) .test( data.exact ); @@ -694,21 +690,18 @@ }, // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license ) fuzzy: function( c, data ) { - if ( tsf.regex.fuzzyTest.test( data.iFilter ) ) { + if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) { var indx, patternIndx = 0, len = data.iExact.length, txt = data.iFilter.slice( 1 ), - pattern = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + pattern = tsf.parseFilter( c, txt, data ) || ''; for ( indx = 0; indx < len; indx++ ) { if ( data.iExact[ indx ] === pattern[ patternIndx ] ) { patternIndx += 1; } } - if ( patternIndx === pattern.length ) { - return true; - } - return false; + return patternIndx === pattern.length; } return null; } @@ -721,8 +714,7 @@ and : 'and' }, ts.language ); - var options, string, txt, $header, column, filters, val, fxn, noSelect, - regex = tsf.regex; + var options, string, txt, $header, column, filters, val, fxn, noSelect; c.$table.addClass( 'hasFilters' ); // define timers so using clearTimeout won't cause an undefined error @@ -733,8 +725,8 @@ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]'; wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]'; - val = '\\{' + tsf.regex.query + '\\}'; - $.extend( regex, { + val = '\\{' + tsfRegex.query + '\\}'; + $.extend( tsfRegex, { child : new RegExp( c.cssChildRow ), filtered : new RegExp( wo.filter_filteredRow ), alreadyFiltered : new RegExp( '(\\s+(' + ts.language.or + '|-|' + ts.language.to + ')\\s+)', 'i' ), @@ -1012,8 +1004,10 @@ c.$table.data( 'lastSearch', filters ); return filters; }, - parseFilter: function( c, filter, column, parsed ) { - return parsed ? c.parsers[column].format( filter, c.table, [], column ) : filter; + parseFilter: function( c, filter, data, parsed ) { + return parsed || data.parsed[ data.index ] ? + c.parsers[ data.index ].format( filter, c.table, [], data.index ) : + filter; }, buildRow: function( table, c, wo ) { var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp, @@ -1265,8 +1259,8 @@ }, defaultFilter: function( filter, mask ) { if ( filter === '' ) { return filter; } - var regex = tsf.regex.iQuery, - maskLen = mask.match( tsf.regex.igQuery ).length, + var regex = tsfRegex.iQuery, + maskLen = mask.match( tsfRegex.igQuery ).length, query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ], len = query.length - 1, indx = 0, @@ -1363,9 +1357,8 @@ return filterMatched; }, processRow: function( c, data, vars ) { - var hasSelect, result, val, filterMatched, + var result, filterMatched, fxn, ffxn, txt, - regex = tsf.regex, wo = c.widgetOptions, showRow = true, @@ -1444,7 +1437,7 @@ result = data.rawArray[ columnIndex ] || ''; data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405 } - data.iExact = !regex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? + data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact; data.isMatch = c.$headerIndexed[ data.index ].hasClass( 'filter-match' ); @@ -1462,21 +1455,13 @@ data.filter = ts.replaceAccents( data.filter ); } - val = true; - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) { - data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] ); - // val is used to indicate that a filter select is using a default filter; - // so we override the exact & partial matches - val = false; - } // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ), // data.filter = case sensitive data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter; fxn = vars.functions[ columnIndex ]; - hasSelect = c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' ); filterMatched = null; - if ( fxn || ( hasSelect && val ) ) { - if ( fxn === true || hasSelect ) { + if ( fxn ) { + if ( fxn === true ) { // default selector uses exact match unless 'filter-match' class is found filterMatched = data.isMatch ? // data.iExact may be a number @@ -1502,7 +1487,7 @@ // Look for match, and add child row data for matching } else { txt = ( data.iExact + data.childRowText ) - .indexOf( tsf.parseFilter( c, data.iFilter, columnIndex, data.parsed[ columnIndex ] ) ); + .indexOf( tsf.parseFilter( c, data.iFilter, data ) ); result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) ); } } else { @@ -1522,7 +1507,6 @@ isChild, childRow, lastSearch, showRow, showParent, time, val, indx, notFiltered, searchFiltered, query, injected, res, id, txt, storedFilters = $.extend( [], filters ), - regex = tsf.regex, c = table.config, wo = c.widgetOptions, // data object passed to filters; anyMatch is a flag for the filters @@ -1604,7 +1588,7 @@ ); if ( wo.filter_columnAnyMatch ) { // specific columns search - query = data.anyMatchFilter.split( regex.andSplit ); + query = data.anyMatchFilter.split( tsfRegex.andSplit ); injected = false; for ( indx = 0; indx < query.length; indx++ ) { res = query[ indx ].split( ':' ); @@ -1639,12 +1623,12 @@ // there are no changes from beginning of filter val.indexOf( lastSearch[indx] || '' ) === 0 && // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string - !regex.alreadyFiltered.test( val ) && + !tsfRegex.alreadyFiltered.test( val ) && // if we are not doing exact matches, using '|' ( logical or ) or not '!' - !regex.exactTest.test( val ) && + !tsfRegex.exactTest.test( val ) && // don't search only filtered if the value is negative // ( '> -10' => '> -100' will ignore hidden rows ) - !( regex.isNeg1.test( val ) || regex.isNeg2.test( val ) ) && + !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) && // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593 !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length && !c.$headerIndexed[indx].hasClass( 'filter-match' ) ); @@ -1662,7 +1646,7 @@ // replace accents data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter ); } - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultAnyFilter ) ) { + if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) { data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter ); // clear search filtered flag because default filters are not saved to the last search searchFiltered = false; @@ -1679,9 +1663,9 @@ txt = $rows[ rowIndex ].className; // the first row can never be a child row - isChild = rowIndex && regex.child.test( txt ); + isChild = rowIndex && tsfRegex.child.test( txt ); // skip child rows & already filtered rows - if ( isChild || ( searchFiltered && regex.filtered.test( txt ) ) ) { + if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) { continue; } @@ -1791,7 +1775,6 @@ // custom select source function for a SPECIFIC COLUMN arry = fxn( table, column, onlyAvail ); } - if ( arry === false ) { // fall back to original method arry = tsf.getOptions( table, column, onlyAvail ); @@ -1805,18 +1788,19 @@ return false; } table = $( table )[0]; - var cts, txt, indx, len, + var cts, txt, indx, len, parsedTxt, str, c = table.config, validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns, parsed = []; - // get unique elements and sort the list // if $.tablesorter.sortText exists ( not in the original tablesorter ), // then natural sort the list otherwise use a basic sort arry = $.grep( arry, function( value, indx ) { + if ( value.text ) { + return true; + } return $.inArray( value, arry ) === indx; }); - if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) { // unsorted select options return arry; @@ -1825,22 +1809,30 @@ // parse select option values for ( indx = 0; indx < len; indx++ ) { txt = arry[ indx ]; + // check for object + str = txt.text ? txt.text : txt; + // sortNatural breaks if you don't pass it strings + parsedTxt = ( validColumn && c.parsers && c.parsers.length && + c.parsers[ column ].format( str, table, [], column ) || str ).toString(); + parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt; // parse array data using set column parser; this DOES NOT pass the original // table cell to the parser format function - parsed.push({ - t : txt, - // check parser length - fixes #934 - p : validColumn && c.parsers && c.parsers.length && - c.parsers[ column ].format( txt, table, [], column ) || txt - }); + if ( txt.text ) { + txt.parsed = parsedTxt; + parsed.push( txt ); + } else { + parsed.push({ + text : txt, + // check parser length - fixes #934 + parsed : parsedTxt + }); + } } - // sort parsed select options cts = c.textSorter || ''; parsed.sort( function( a, b ) { - // sortNatural breaks if you don't pass it strings - var x = a.p.toString(), - y = b.p.toString(); + var x = a.parsed, + y = b.parsed; if ( validColumn && typeof cts === 'function' ) { // custom OVERALL text sorter return cts( x, y, true, column, table ); @@ -1858,7 +1850,7 @@ arry = []; len = parsed.length; for ( indx = 0; indx < len; indx++ ) { - arry.push( parsed[indx].t ); + arry.push( parsed[indx] ); } return arry; } @@ -1918,7 +1910,7 @@ return; } - var indx, val, txt, t, $filters, $filter, + var indx, val, txt, t, $filters, $filter, option, c = table.config, wo = c.widgetOptions, node = c.$headerIndexed[ column ], @@ -1943,23 +1935,45 @@ if ( $.isArray( arry ) ) { // build option list for ( indx = 0; indx < arry.length; indx++ ) { - txt = arry[indx] = ( '' + arry[indx] ).replace( tsf.regex.quote, '"' ); - val = txt; - // allow including a symbol in the selectSource array - // 'a-z|A through Z' so that 'a-z' becomes the option value - // and 'A through Z' becomes the option text - if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) { - t = txt.split( wo.filter_selectSourceSeparator ); - val = t[0]; - txt = t[1]; + option = arry[ indx ]; + if ( option.text ) { + // OBJECT!! add data-function-name in case the value is set in filter_functions + option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value; + + // support jQuery < v1.8, otherwise the below code could be shortened to + // options += $( '":"",n=i,j=i,i.indexOf(g.filter_selectSourceSeparator)>=0&&(n=i.split(g.filter_selectSourceSeparator),j=n[1],n=n[0]),h+="");f.$table.find("thead").find("select."+d.filter+'[data-column="'+l+'"]').append(h),j=g.filter_selectSource,o="function"==typeof j?!0:c.getColumnData(e,j,l),o&&b.buildSelect(f.table,l,"",!0,k.hasClass(g.filter_onlyAvail))}b.buildDefault(e,!0),b.bindSearch(e,f.$table.find("."+d.filter),!0),g.filter_external&&b.bindSearch(e,g.filter_external),g.filter_hideFilters&&b.hideFilters(f),f.showProcessing&&(j="filterStart filterEnd ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(b,g){k=g?f.$table.find("."+d.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",c.isProcessing(e,"filterStart"===b.type,g?k:"")})),f.filteredRows=f.totalRows,j="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(){var a=this.config.widgetOptions;m=b.setDefaults(e,f,a)||[],m.length&&(f.delayInit&&""===m.join("")||c.setFilters(e,m,!0)),f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(f)},100)}),f.pager&&f.pager.initialized&&!g.filter_initialized&&(f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(f)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(d,e,f){var g,h,i,j,k,l=c.getFilters(d)||[];if(f.filter_saveFilters&&c.storage&&(h=c.storage(d,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(b,e,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=e.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)e.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(e.$filters=a(s+="").appendTo(e.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=e.$headerIndexed[i],j&&j.length&&(g=e.$filters.filter('[data-column="'+i+'"]'),n=c.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=c.getColumnData(b,e.headers,i),l="false"===c.getData(j[0],h,"filter")||"false"===c.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(d.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(d.filterDisabled)[0].disabled=!0)))},bindSearch:function(d,e,f){if(d=a(d)[0],e=a(e),e.length){var g,h=d.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,c.setFilters(d,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(c.regex.spaces," ")).bind("keyup"+j,function(c){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===c.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&c.which<=40)))return}b.searching(d,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(c){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===c.which||"search"===c.type||"change"===c.type&&this.value!==h.lastSearch[e])&&(c.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(d,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(e,f,g){var h=e.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:c.getFilters(e,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&c.updateCache(h,function(){b.checkFilters(e,!1,g)})):(j&&(c.setFilters(e,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+d.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(e,k,l),!1},30):(b.findRows(e,k,l),!1)):void 0)},hideFilters:function(b,e){var f,g=(e||b.$table).find("."+d.filterRow).addClass(d.filterRowHide);g.bind("mouseenter mouseleave",function(c){var e=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(e.type)?g.removeClass(d.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(d.filterRowHide)},200)}).find("input, select").bind("focus blur",function(e){var g=e,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===c.getFilters(b.$table).join("")&&h.toggleClass(d.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.regex.iQuery,f=d.match(b.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(e.anyMatch=!0,e.isMatch=!0,e.rowArray=e.$cells.map(function(b){return a.inArray(b,q)>-1?(e.parsed[b]?m=e.cacheArray[b]:(m=e.rawArray[b],m=a.trim(o.filter_ignoreCase?m.toLowerCase():m),d.sortLocaleCompare&&(m=c.replaceAccents(m))),m):void 0}).get(),e.filter=e.anyMatchFilter,e.iFilter=e.iAnyMatchFilter,e.exact=e.rowArray.join(" "),e.iExact=o.filter_ignoreCase?e.exact.toLowerCase():e.exact,e.cache=e.cacheArray.slice(0,-1).join(" "),f.excludeMatch=f.noAnyMatch,j=b.processTypes(d,e,f),null!==j)p=j;else if(o.filter_startsWith)for(p=!1,q=Math.min(d.columns,e.rowArray.length);!p&&q>0;)q--,p=p||0===e.rowArray[q].indexOf(e.iFilter);else p=(e.iExact+e.childRowText).indexOf(e.iFilter)>=0;if(e.anyMatch=!1,e.filters.join("")===e.filter)return p}for(q=0;q=0:e.filter===e.exact:"function"==typeof k?j=k(e.exact,e.cache,e.filter,q,e.$row,d,e):"function"==typeof k[l||e.filter]&&(m=l||e.filter,j=k[m](e.exact,e.cache,e.filter,q,e.$row,d,e))),null===j?(j=b.processTypes(d,e,f),null!==j?h=j:(m=(e.iExact+e.childRowText).indexOf(b.parseFilter(d,e.iFilter,q,e.parsed[q])),h=!o.filter_startsWith&&m>=0||o.filter_startsWith&&0===m)):h=j,p=h?p:!1);return p},findRows:function(d,e,f){if(d.config.lastCombinedFilter!==f&&d.config.widgetOptions.filter_initialized){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=a.extend([],e),F=b.regex,G=d.config,H=G.widgetOptions,I={anyMatch:!1,filters:e,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:c.getColumnData(d,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||c.getData&&"parsed"===c.getData(G.$headerIndexed[b],c.getColumnData(d,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),o=0;o1&&(C=parseInt(B[0],10)-1,C>=0&&Cw;w++)v=e[w]||"",y||(w=o),y=y&&r.length&&0===v.indexOf(r[w]||"")&&!F.alreadyFiltered.test(v)&&!F.exactTest.test(v)&&!(F.isNeg1.test(v)||F.isNeg2.test(v))&&!(""!==v&&G.$filters&&G.$filters.filter('[data-column="'+w+'"]').find("select").length&&!G.$headerIndexed[w].hasClass("filter-match"));for(x=j.not("."+H.filter_filteredRow).length,y&&0===x&&(y=!1),G.debug&&console.log("Filter: Searching through "+(y&&g>x?x:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=c.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&F.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),y=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),l=0;g>l;l++)if(D=j[l].className,p=l&&F.child.test(D),!(p||y&&F.filtered.test(D))){if(I.$row=j.eq(l),I.cacheArray=h[l],i=I.cacheArray[G.columns],I.rawArray=i.raw,I.childRowText="",!H.filter_childByColumn){for(D="",q=i.child,w=0;w")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(d,e,f))}return i===!1&&(i=b.getOptions(d,e,f)),b.processOptions(d,e,i)},processOptions:function(b,d,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j=b.config,k="undefined"!=typeof d&&null!==d&&d>=0&&dh;h++)g=e[h],l.push({t:g,p:k&&j.parsers&&j.parsers.length&&j.parsers[d].format(g,b,[],d)||g});for(f=j.textSorter||"",l.sort(function(a,e){var g=a.p.toString(),h=e.p.toString();return k&&"function"==typeof f?f(g,h,!0,d,b):k&&"object"==typeof f&&f.hasOwnProperty(d)?f[d](g,h,!0,d,b):c.sortNatural?c.sortNatural(g,h):!0}),e=[],i=l.length,h=0;i>h;h++)e.push(l[h].t);return e},getOptions:function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[d].parsed||n.$headerIndexed[d].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][d])}else if(p.push(j.normalized[f][n.columns].raw[d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(d),p.push(""+c.getElementText(n,l,d));return p},buildSelect:function(c,e,f,g,h){if(c=a(c)[0],e=parseInt(e,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var i,j,k,l,m,n,o=c.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+d.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.getOptionSource(c,e,h)),a.isArray(f)){for(i=0;i=0&&(l=k.split(p.filter_selectSourceSeparator),j=l[0],k=l[1]),r+=""!==f[i]?"":"";f=[]}m=(o.$filters?o.$filters:o.$table.children("thead")).find("."+d.filter),p.filter_$externalFilters&&(m=m&&m.length?m.add(p.filter_$externalFilters):p.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](r),a.isArray(f)||n.append(f).val(s),n.val(s))}},buildDefault:function(a,d){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||c.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",d,f.hasClass(i.filter_onlyAvail))}},c.getFilters=function(c,e,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+d.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},c.setFilters=function(d,e,f,g){var h=d?a(d)[0].config:"",i=c.getFilters(d,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(e,w)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);c.resizable.setHandlePosition(b,d),c.resizable.bindings(b,d)}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d,e){var f=b.namespace+"tsresize";d.resizable_vars.disabled=e,a("body").toggleClass(c.css.resizableNoSelect,e),e?a("body").attr("unselectable","on").bind("selectstart"+f,!1):a("body").removeAttr("unselectable").unbind("selectstart"+f)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,e,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,e,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&b.sortOn(d,k))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file +/*! tablesorter (FORK) - updated 11-10-2015 (v2.24.4)*/ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){return function(a,b,c){"use strict";var d=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=m&&m.widgetOptions,o=g&&g.useSessionStorage||n&&n.storage_useSessionStorage?"sessionStorage":"localStorage",p=a(d),q=g&&g.id||p.attr(g&&g.group||n&&n.storage_group||"data-table-group")||n&&n.storage_tableId||d.id||a(".tablesorter").index(p),r=g&&g.url||p.attr(g&&g.page||n&&n.storage_page||"data-table-page")||n&&n.storage_fixedUrl||m&&m.fixedUrl||b.location.pathname;if(o in b)try{b[o].setItem("_tmptest","temp"),k=!0,b[o].removeItem("_tmptest")}catch(s){m&&m.debug&&console.warn(o+" is not supported in this browser")}return a.parseJSON&&(k?l=a.parseJSON(b[o][e]||"null")||{}:(i=c.cookie.split(/[;\s|=]/),h=a.inArray(e,i)+1,l=0!==h?a.parseJSON(i[h]||"null")||{}:{})),(f||""===f)&&b.JSON&&JSON.hasOwnProperty("stringify")?(l[r]||(l[r]={}),l[r][q]=f,k?b[o][e]=JSON.stringify(l):(j=new Date,j.setTime(j.getTime()+31536e6),c.cookie=e+"="+JSON.stringify(l).replace(/\"/g,'"')+"; expires="+j.toGMTString()+"; path=/"),void 0):l&&l[r]?l[r][q]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter||{};b.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},a.extend(b.css,{wrapper:"tablesorter-wrapper"}),b.addWidget({id:"uitheme",priority:10,format:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r=b.themes,s=d.$table.add(a(d.namespace+"_extra_table")),t=d.$headers.add(a(d.namespace+"_extra_headers")),u=d.theme||"jui",v=r[u]||{},w=a.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=a.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" "));for(d.debug&&(i=new Date),s.hasClass("tablesorter-"+u)&&d.theme===d.appliedTheme&&e.uitheme_applied||(e.uitheme_applied=!0,n=r[d.appliedTheme]||{},q=!a.isEmptyObject(n),o=q?[n.sortNone,n.sortDesc,n.sortAsc,n.active].join(" "):"",p=q?[n.iconSortNone,n.iconSortDesc,n.iconSortAsc].join(" "):"",q&&(e.zebra[0]=a.trim(" "+e.zebra[0].replace(" "+n.even,"")),e.zebra[1]=a.trim(" "+e.zebra[1].replace(" "+n.odd,"")),d.$tbodies.children().removeClass([n.even,n.odd].join(" "))),v.even&&(e.zebra[0]+=" "+v.even),v.odd&&(e.zebra[1]+=" "+v.odd),s.children("caption").removeClass(n.caption||"").addClass(v.caption),l=s.removeClass((d.appliedTheme?"tablesorter-"+(d.appliedTheme||""):"")+" "+(n.table||"")).addClass("tablesorter-"+u+" "+(v.table||"")).children("tfoot"),d.appliedTheme=d.theme,l.length&&l.children("tr").removeClass(n.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(n.footerCells||"").addClass(v.footerCells),t.removeClass((q?[n.header,n.hover,o].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(b){a(this)["mouseenter"===b.type?"addClass":"removeClass"](v.hover||"")}),t.each(function(){var c=a(this);c.find("."+b.css.wrapper).length||c.wrapInner('
')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(d,e,f){if((c.orTest.test(e.iFilter)||c.orSplit.test(e.filter))&&!c.regex.test(e.filter)){var g,h,i,j,k=a.extend({},e),l=e.filter.split(c.orSplit),m=e.iFilter.split(c.orSplit),n=l.length;for(g=0;n>g;g++){k.nestedFilters=!0,k.filter=""+(b.parseFilter(d,l[g],e)||""),k.iFilter=""+(b.parseFilter(d,m[g],e)||""),i="("+(b.parseFilter(d,k.filter,e)||"")+")";try{if(j=new RegExp(e.isMatch?i:"^"+i+"$",d.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.processTypes(d,k,f))return h}catch(o){return null}}return h||!1}return null},and:function(d,e,f){if(c.andTest.test(e.filter)){var g,h,i,j,k,l=a.extend({},e),m=e.filter.split(c.andSplit),n=e.iFilter.split(c.andSplit),o=m.length;for(g=0;o>g;g++){l.nestedFilters=!0,l.filter=""+(b.parseFilter(d,m[g],e)||""),l.iFilter=""+(b.parseFilter(d,n[g],e)||""),j=("("+(b.parseFilter(d,l.filter,e)||"")+")").replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*");try{k=new RegExp(e.isMatch?j:"^"+j+"$",d.widgetOptions.filter_ignoreCase?"i":""),i=k.test(l.exact)||b.processTypes(d,l,f),h=0===g?i:h&&i}catch(p){return null}}return h||!1}return null},regex:function(a,b){if(c.regex.test(b.filter)){var d,e=b.filter_regexCache[b.index]||c.regex.exec(b.filter),f=e instanceof RegExp;try{f||(b.filter_regexCache[b.index]=e=new RegExp(e[1],e[2])),d=e.test(b.exact)}catch(g){d=!1}return d}return null},operators:function(e,f){if(c.operTest.test(f.iFilter)&&""!==f.iExact){var g,h,i,j=e.table,k=f.parsed[f.index],l=d.formatFloat(f.iFilter.replace(c.operators,""),j),m=e.parsers[f.index],n=l;return(k||"numeric"===m.type)&&(i=a.trim(""+f.iFilter.replace(c.operators,"")),h=b.parseFilter(e,i,f,!0),l="number"!=typeof h||""===h||isNaN(h)?l:h),!k&&"numeric"!==m.type||isNaN(l)||"undefined"==typeof f.cache?(i=isNaN(f.iExact)?f.iExact.replace(d.regex.nondigit,""):f.iExact,g=d.formatFloat(i,j)):g=f.cache,c.gtTest.test(f.iFilter)?h=c.gteTest.test(f.iFilter)?g>=l:g>l:c.ltTest.test(f.iFilter)&&(h=c.lteTest.test(f.iFilter)?l>=g:l>g),h||""!==n||(h=!0),h}return null},notMatch:function(d,e){if(c.notTest.test(e.iFilter)){var f,g=e.iFilter.replace("!",""),h=b.parseFilter(d,g,e)||"";return c.exact.test(h)?(h=h.replace(c.exact,""),""===h?!0:a.trim(h)!==e.iExact):(f=e.iExact.search(a.trim(h)),""===h?!0:!(d.widgetOptions.filter_startsWith?0===f:f>=0))}return null},exact:function(d,e){if(c.exact.test(e.iFilter)){var f=e.iFilter.replace(c.exact,""),g=b.parseFilter(d,f,e)||"";return e.anyMatch?a.inArray(g,e.rowArray)>=0:g==e.iExact}return null},range:function(a,e){if(c.toTest.test(e.iFilter)){var f,g,h,i,j=a.table,k=e.index,l=e.parsed[k],m=e.iFilter.split(c.toSplit);return g=m[0].replace(d.regex.nondigit,"")||"",h=d.formatFloat(b.parseFilter(a,g,e),j),g=m[1].replace(d.regex.nondigit,"")||"",i=d.formatFloat(b.parseFilter(a,g,e),j),(l||"numeric"===a.parsers[k].type)&&(f=a.parsers[k].format(""+m[0],j,a.$headers.eq(k),k),h=""===f||isNaN(f)?h:f,f=a.parsers[k].format(""+m[1],j,a.$headers.eq(k),k),i=""===f||isNaN(f)?i:f),!l&&"numeric"!==a.parsers[k].type||isNaN(h)||isNaN(i)?(g=isNaN(e.iExact)?e.iExact.replace(d.regex.nondigit,""):e.iExact,f=d.formatFloat(g,j)):f=e.cache,h>i&&(g=h,h=i,i=g),f>=h&&i>=f||""===h||""===i}return null},wild:function(a,d){if(c.wildOrTest.test(d.iFilter)){var e=""+(b.parseFilter(a,d.iFilter,d)||"");!c.wildTest.test(e)&&d.nestedFilters&&(e=d.isMatch?e:"^("+e+")$");try{return new RegExp(e.replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(d.exact)}catch(f){return null}}return null},fuzzy:function(a,d){if(c.fuzzyTest.test(d.iFilter)){var e,f=0,g=d.iExact.length,h=d.iFilter.slice(1),i=b.parseFilter(a,h,d)||"";for(e=0;g>e;e++)d.iExact[e]===i[f]&&(f+=1);return f===i.length}return null}},init:function(f,g,h){d.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},d.language);var i,j,k,l,m,n,o,p,q;if(g.$table.addClass("hasFilters"),h.filter_searchTimer=null,h.filter_initTimer=null,h.filter_formatterCount=0,h.filter_formatterInit=[],h.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',h.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',o="\\{"+c.query+"\\}",a.extend(c,{child:new RegExp(g.cssChildRow),filtered:new RegExp(h.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+d.language.or+"|-|"+d.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+d.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+d.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+d.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+d.language.and+"|&&)\\s+)","gi"),orTest:/\|/,orSplit:new RegExp("(?:\\s+(?:"+d.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(o,"i"),igQuery:new RegExp(o,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/'+(l.data("placeholder")||l.attr("data-placeholder")||h.filter_placeholder.select||"")+"":"",o=j,k=j,j.indexOf(h.filter_selectSourceSeparator)>=0&&(o=j.split(h.filter_selectSourceSeparator),k=o[1],o=o[0]),i+="");g.$table.find("thead").find("select."+e.filter+'[data-column="'+m+'"]').append(i),k=h.filter_selectSource,p="function"==typeof k?!0:d.getColumnData(f,k,m),p&&b.buildSelect(g.table,m,"",!0,l.hasClass(h.filter_onlyAvail))}b.buildDefault(f,!0),b.bindSearch(f,g.$table.find("."+e.filter),!0),h.filter_external&&b.bindSearch(f,h.filter_external),h.filter_hideFilters&&b.hideFilters(g),g.showProcessing&&(k="filterStart filterEnd ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(b,c){l=c?g.$table.find("."+e.header).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"",d.isProcessing(f,"filterStart"===b.type,c?l:"")})),g.filteredRows=g.totalRows,k="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(){var a=this.config.widgetOptions;n=b.setDefaults(f,g,a)||[],n.length&&(g.delayInit&&""===n.join("")||d.setFilters(f,n,!0)),g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(g)},100)}),g.pager&&g.pager.initialized&&!h.filter_initialized&&(g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(g)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(c,e,f){var g,h,i,j,k,l=d.getFilters(c)||[];if(f.filter_saveFilters&&d.storage&&(h=d.storage(c,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d||c.parsed[c.index]?a.parsers[c.index].format(b,a.table,[],c.index):b},buildRow:function(b,c,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=c.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)c.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(c.$filters=a(s+="").appendTo(c.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=c.$headerIndexed[i],j&&j.length&&(g=c.$filters.filter('[data-column="'+i+'"]'),n=d.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=d.getColumnData(b,c.headers,i),l="false"===d.getData(j[0],h,"filter")||"false"===d.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(e.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(e.filterDisabled)[0].disabled=!0)))},bindSearch:function(c,e,f){if(c=a(c)[0],e=a(e),e.length){var g,h=c.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,d.setFilters(c,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(d.regex.spaces," ")).bind("keyup"+j,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(d){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===d.which||"search"===d.type||"change"===d.type&&this.value!==h.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(c,f,g){var h=c.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:d.getFilters(c,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&d.updateCache(h,function(){b.checkFilters(c,!1,g)})):(j&&(d.setFilters(c,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+e.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(c,k,l),!1},30):(b.findRows(c,k,l),!1)):void 0)},hideFilters:function(b,c){var f,g=(c||b.$table).find("."+e.filterRow).addClass(e.filterRowHide);g.bind("mouseenter mouseleave",function(c){var d=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(d.type)?g.removeClass(e.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(e.filterRowHide)},200)}).find("input, select").bind("focus blur",function(c){var g=c,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===d.getFilters(b.$table).join("")&&h.toggleClass(e.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(b,d){if(""===b)return b;var e=c.iQuery,f=d.match(c.igQuery).length,g=f>1?a.trim(b).split(/\s/):[a.trim(b)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(f.anyMatch=!0,f.isMatch=!0,f.rowArray=f.$cells.map(function(b){return a.inArray(b,o)>-1?(f.parsed[b]?l=f.cacheArray[b]:(l=f.rawArray[b],l=a.trim(m.filter_ignoreCase?l.toLowerCase():l),e.sortLocaleCompare&&(l=d.replaceAccents(l))),l):void 0}).get(),f.filter=f.anyMatchFilter,f.iFilter=f.iAnyMatchFilter,f.exact=f.rowArray.join(" "),f.iExact=m.filter_ignoreCase?f.exact.toLowerCase():f.exact,f.cache=f.cacheArray.slice(0,-1).join(" "),g.excludeMatch=g.noAnyMatch,i=b.processTypes(e,f,g),null!==i)n=i;else if(m.filter_startsWith)for(n=!1,o=Math.min(e.columns,f.rowArray.length);!n&&o>0;)o--,n=n||0===f.rowArray[o].indexOf(f.iFilter);else n=(f.iExact+f.childRowText).indexOf(f.iFilter)>=0;if(f.anyMatch=!1,f.filters.join("")===f.filter)return n}for(o=0;o=0:f.filter===f.exact:"function"==typeof j?i=j(f.exact,f.cache,f.filter,o,f.$row,e,f):"function"==typeof j[k||f.filter]&&(l=k||f.filter,i=j[l](f.exact,f.cache,f.filter,o,f.$row,e,f))),null===i?(i=b.processTypes(e,f,g),null!==i?h=i:(l=(f.iExact+f.childRowText).indexOf(b.parseFilter(e,f.iFilter,f)),h=!m.filter_startsWith&&l>=0||m.filter_startsWith&&0===l)):h=i,n=h?n:!1);return n},findRows:function(e,f,g){if(e.config.lastCombinedFilter!==g&&e.config.widgetOptions.filter_initialized){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a.extend([],f),G=e.config,H=G.widgetOptions,I={anyMatch:!1,filters:f,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:d.getColumnData(e,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||d.getData&&"parsed"===d.getData(G.$headerIndexed[b],d.getColumnData(e,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),p=0;p1&&(D=parseInt(C[0],10)-1,D>=0&&Dx;x++)w=f[x]||"",z||(x=p),z=z&&s.length&&0===w.indexOf(s[x]||"")&&!c.alreadyFiltered.test(w)&&!c.exactTest.test(w)&&!(c.isNeg1.test(w)||c.isNeg2.test(w))&&!(""!==w&&G.$filters&&G.$filters.filter('[data-column="'+x+'"]').find("select").length&&!G.$headerIndexed[x].hasClass("filter-match"));for(y=k.not("."+H.filter_filteredRow).length,z&&0===y&&(z=!1),G.debug&&console.log("Filter: Searching through "+(z&&h>y?y:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=d.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&c.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),z=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),m=0;h>m;m++)if(E=k[m].className,q=m&&c.child.test(E),!(q||z&&c.filtered.test(E))){if(I.$row=k.eq(m),I.cacheArray=i[m],j=I.cacheArray[G.columns],I.rawArray=j.raw,I.childRowText="",!H.filter_childByColumn){for(E="",r=j.child,x=0;x")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(c,e,f))}return i===!1&&(i=b.getOptions(c,e,f)),b.processOptions(c,e,i)},processOptions:function(b,c,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j,k,l=b.config,m="undefined"!=typeof c&&null!==c&&c>=0&&ch;h++)g=e[h],k=g.text?g.text:g,j=(m&&l.parsers&&l.parsers.length&&l.parsers[c].format(k,b,[],c)||k).toString(),j=l.widgetOptions.filter_ignoreCase?j.toLowerCase():j,g.text?(g.parsed=j,n.push(g)):n.push({text:g,parsed:j});for(f=l.textSorter||"",n.sort(function(a,e){var g=a.parsed,h=e.parsed;return m&&"function"==typeof f?f(g,h,!0,c,b):m&&"object"==typeof f&&f.hasOwnProperty(c)?f[c](g,h,!0,c,b):d.sortNatural?d.sortNatural(g,h):!0}),e=[],i=n.length,h=0;i>h;h++)e.push(n[h]);return e},getOptions:function(b,c,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[c].parsed||n.$headerIndexed[c].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][c])}else if(p.push(j.normalized[f][n.columns].raw[c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(c),p.push(""+d.getElementText(n,l,c));return p},buildSelect:function(d,f,g,h,i){if(d=a(d)[0],f=parseInt(f,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var j,k,l,m,n,o,p,q=d.config,r=q.widgetOptions,s=q.$headerIndexed[f],t='",u=q.$table.find("thead").find("select."+e.filter+'[data-column="'+f+'"]').val();if(("undefined"==typeof g||""===g)&&(g=b.getOptionSource(d,f,i)),a.isArray(g)){for(j=0;j"}else""+p!="[object Object]"&&(l=p=(""+p).replace(c.quote,"""),k=l,l.indexOf(r.filter_selectSourceSeparator)>=0&&(m=l.split(r.filter_selectSourceSeparator),k=m[0],l=m[1]), +t+=""!==p?"":"");g=[]}n=(q.$filters?q.$filters:q.$table.children("thead")).find("."+e.filter),r.filter_$externalFilters&&(n=n&&n.length?n.add(r.filter_$externalFilters):r.filter_$externalFilters),o=n.filter('select[data-column="'+f+'"]'),o.length&&(o[h?"html":"append"](t),a.isArray(g)||o.append(g).val(u),o.val(u))}},buildDefault:function(a,c){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||d.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",c,f.hasClass(i.filter_onlyAvail))}},c=b.regex,d.getFilters=function(c,d,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(d!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+e.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},d.setFilters=function(c,e,f,g){var h=c?a(c)[0].config:"",i=d.getFilters(c,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){if(b=a(b)[0],b.config){var e={timer:250},f=a.extend({},e,d),g=b.config,h=g.widgetOptions,i=function(a){var b,c,d,e,f,i,j=g.$headers.length;for(h.resize_flag=!0,c=[],b=0;j>b;b++)d=g.$headers.eq(b),e=d.data("savedSizes")||[0,0],f=d[0].offsetWidth,i=d[0].offsetHeight,(f!==e[0]||i!==e[1])&&(d.data("savedSizes",[f,i]),c.push(d[0]));c.length&&a!==!1&&g.$table.trigger("resize",[c]),h.resize_flag=!1};return i(!1),clearInterval(h.resize_timer),c?(h.resize_flag=!1,!1):void(h.resize_timer=setInterval(function(){h.resize_flag||i()},f.timer))}},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h,i,j,k=e.$table,l=a(f.stickyHeaders_attachTo),m=e.namespace+"stickyheaders ",n=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),o=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),p=k.children("thead:first"),q=p.children("tr").not(".sticky-false").children(),r=k.children("tfoot"),s=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,u=k.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=u.length?u.height():0,w=f.$sticky=k.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),x=w.parent().addClass(c.css.stickyHide).css({position:l.length?"absolute":"fixed",padding:parseInt(w.parent().parent().css("padding-left"),10),top:t+v,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),y=w.children("thead:first"),z="",A=0,B=function(a,c){var d,e,f,g,h,i=a.filter(":visible"),j=i.length;for(d=0;j>d;d++)g=c.filter(":visible").eq(d),h=i.eq(d),"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(h[0],null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({width:e,"min-width":e,"max-width":e})},C=function(){t=s.length?s.height()||0:parseInt(f.stickyHeaders_offset,10)||0,A=0,x.css({left:l.length?parseInt(l.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-o.scrollLeft()-A,width:k.outerWidth()}),B(k,w),B(q,j)},D=function(b){if(k.is(":visible")){v=u.length?u.offset().top-n.scrollTop()+u.height():0;var d=k.offset(),e=a.isWindow(n[0]),f=a.isWindow(o[0]),g=(l.length?e?n.scrollTop():n.offset().top:n.scrollTop())+t+v,h=k.height()-(x.height()+(r.height()||0)),i=g>d.top&&gg;g++)e.onRenderHeader.apply(i.eq(g),[g,e,w]);o.add(n).unbind("scroll resize ".split(" ").join(m).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(m),function(a){D("resize"===a.type)}),e.$table.unbind("stickyHeadersUpdate"+m).bind("stickyHeadersUpdate"+m,function(){D(!0)}),f.stickyHeaders_addResizeEvent&&c.addHeaderResizeEvent(d),k.hasClass("hasFilters")&&f.filter_columnFilters&&(k.bind("filterEnd"+m,function(){var d=a(document.activeElement).closest("td"),g=d.parent().children().index(d);x.hasClass(c.css.stickyVis)&&f.stickyHeaders_filteredToTop&&(b.scrollTo(0,k.position().top),g>=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(k,j.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(e,w)),k.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd stickyHeadersUpdate ".split(" ").join(g).replace(/\s+/g," ")).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(g).replace(/\s+/g," ")),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter||{};a.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),a(function(){var b="";a(b).appendTo("body")}),c.resizable={init:function(b,d){if(!b.$table.hasClass("hasResizable")){b.$table.addClass("hasResizable");var e,f,g,h,i,j=b.$table,k=j.parent(),l=parseInt(j.css("margin-top"),10),m=d.resizable_vars={useStorage:c.storage&&d.resizable!==!1,$wrap:k,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===k.css("overflow")||"scroll"===k.css("overflow")||"auto"===k.css("overflow-x")||"scroll"===k.css("overflow-x"),storedSizes:[]};for(c.resizableReset(b.table,!0),m.tableWidth=j.width(),m.fullWidth=Math.abs(k.width()-m.tableWidth)<20,m.useStorage&&m.overflow&&(c.storage(b.table,"tablesorter-table-original-css-width",m.tableWidth),i=c.storage(b.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(j,i,!0)),d.resizable_vars.storedSizes=h=(m.useStorage?c.storage(b.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(b,d,h),c.resizable.updateStoredSizes(b,d),d.$resizable_container=a('
').css({top:l}).insertBefore(j),g=0;g').appendTo(d.$resizable_container).attr({"data-column":g,unselectable:"on"}).data("header",f).bind("selectstart",!1);c.resizable.setHandlePosition(b,d),c.resizable.bindings(b,d)}},updateStoredSizes:function(a,b){var c,d,e=a.columns,f=b.resizable_vars;for(f.storedSizes=[],c=0;e>c;c++)d=a.$headerIndexed[c],f.storedSizes[c]=d.is(":visible")?d.width():0},setWidth:function(a,b,c){a.css({width:b,"min-width":c?b:"","max-width":c?b:""})},setWidths:function(b,d,e){var f,g,h=d.resizable_vars,i=a(b.namespace+"_extra_headers"),j=b.$table.children("colgroup").children("col");if(e=e||h.storedSizes||[],e.length){for(f=0;ff||f===h&&d.resizable_addLastColumn)&&c.css({display:"inline-block",height:g,left:j.position().left-e+j.outerWidth()-i}):c.hide())})},toggleTextSelection:function(b,d,e){var f=b.namespace+"tsresize";d.resizable_vars.disabled=e,a("body").toggleClass(c.css.resizableNoSelect,e),e?a("body").attr("unselectable","on").bind("selectstart"+f,!1):a("body").removeAttr("unselectable").unbind("selectstart"+f)},bindings:function(d,e){var f=d.namespace+"tsresize";e.$resizable_container.children().bind("mousedown",function(b){var f,g=e.resizable_vars,h=a(d.namespace+"_extra_headers"),i=a(b.target).data("header");f=parseInt(i.attr("data-column"),10),g.$target=i=i.add(h.filter('[data-column="'+f+'"]')),g.target=f,g.$next=b.shiftKey||e.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),f=parseInt(g.$next.attr("data-column"),10),g.$next=g.$next.add(h.filter('[data-column="'+f+'"]')),g.next=f,g.mouseXPosition=b.pageX,c.resizable.updateStoredSizes(d,e),c.resizable.toggleTextSelection(d,e,!0)}),a(document).bind("mousemove"+f,function(a){var b=e.resizable_vars;b.disabled&&0!==b.mouseXPosition&&b.$target&&(e.resizable_throttle?(clearTimeout(b.timer),b.timer=setTimeout(function(){c.resizable.mouseMove(d,e,a)},isNaN(e.resizable_throttle)?5:e.resizable_throttle)):c.resizable.mouseMove(d,e,a))}).bind("mouseup"+f,function(){e.resizable_vars.disabled&&(c.resizable.toggleTextSelection(d,e,!1),c.resizable.stopResize(d,e),c.resizable.setHandlePosition(d,e))}),a(b).bind("resize"+f+" resizeEnd"+f,function(){c.resizable.setHandlePosition(d,e)}),d.$table.bind("columnUpdate"+f,function(){c.resizable.setHandlePosition(d,e)}).find("thead:first").add(a(d.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+f,function(){var a=0===e.resizable_vars.storedSizes.length;return c.resizableReset(d.table),c.resizable.setHandlePosition(d,e),e.resizable_vars.storedSizes=[],a})},mouseMove:function(b,d,e){if(0!==d.resizable_vars.mouseXPosition&&d.resizable_vars.$target){var f,g=0,h=d.resizable_vars,i=h.$next,j=h.storedSizes[h.target],k=e.pageX-h.mouseXPosition;if(h.overflow){if(j+k>0){for(h.storedSizes[h.target]+=k,c.resizable.setWidth(h.$target,h.storedSizes[h.target],!0),f=0;f0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&b.sortOn(d,k))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery),a.tablesorter}); \ No newline at end of file diff --git a/dist/js/parsers/parser-file-type.min.js b/dist/js/parsers/parser-file-type.min.js index a8fdb063..1a3b8db4 100644 --- a/dist/js/parsers/parser-file-type.min.js +++ b/dist/js/parsers/parser-file-type.min.js @@ -1,2 +1,2 @@ -/*! Parser: filetype */ +/*! Parser: filetype - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";a.tablesorter.fileTypes={separator:"|",equivalents:{"3D Image":"3dm|3ds|dwg|max|obj",Audio:"aif|aac|ape|flac|la|m4a|mid|midi|mp2|mp3|ogg|ra|raw|rm|wav|wma",Compressed:"7z|bin|cab|cbr|gz|gzip|iso|lha|lz|rar|tar|tgz|zip|zipx|zoo",Database:"csv|dat|db|dbf|json|ldb|mdb|myd|pdb|sql|tsv|wdb|wmdb|xlr|xls|xlsx|xml",Development:"asm|c|class|cls|cpp|cc|cs|cxx|cbp|cs|dba|fla|h|java|lua|pl|py|pyc|pyo|sh|sln|r|rb|vb",Document:"doc|docx|odt|ott|pages|pdf|rtf|tex|wpd|wps|wrd|wri",Executable:"apk|app|com|exe|gadget|lnk|msi",Fonts:"eot|fnt|fon|otf|ttf|woff",Icons:"ani|cur|icns|ico",Images:"bmp|gif|jpg|jpeg|jpe|jp2|pic|png|psd|tga|tif|tiff|wmf|webp",Presentation:"pps|ppt",Published:"chp|epub|lit|pub|ppp|fm|mobi",Script:"as|bat|cgi|cmd|jar|js|lua|scpt|scptd|sh|vbs|vb|wsf",Styles:"css|less|sass",Text:"info|log|md|markdown|nfo|tex|text|txt",Vectors:"awg|ai|eps|cdr|ps|svg",Video:"asf|avi|flv|m4v|mkv|mov|mp4|mpe|mpeg|mpg|ogg|rm|rv|swf|vob|wmv",Web:"asp|aspx|cer|cfm|htm|html|php|url|xhtml"}},a.tablesorter.addParser({id:"filetype",is:function(){return!1},format:function(b,c){var d,e=c.config,f=e.widgetOptions,g=f.group_separator||"-",h=b.lastIndexOf("."),i=a.tablesorter.fileTypes.separator,j=a.tablesorter.fileTypes.matching,k=a.tablesorter.fileTypes.equivalents;if(j||(d=[],a.each(k,function(a,b){d.push(b)}),j=a.tablesorter.fileTypes.matching=i+d.join(i)+i),h>=0&&(d=i+b.substring(h+1,b.length)+i,j.indexOf(d)>=0))for(h in k)if((i+k[h]+i).indexOf(d)>=0)return h+("/"!==g.toString().charAt(0)?f.group_separator:"-")+b;return b},type:"text"}),a.tablesorter.addParser({id:"file-extension",is:function(){return!1},format:function(a){var b,c=a.split(".");return c.length?(b=c.pop(),c.unshift(b),c.join(".")):a},type:"text"})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter.min.js b/dist/js/widgets/widget-filter.min.js index 78043f93..01e29058 100644 --- a/dist/js/widgets/widget-filter.min.js +++ b/dist/js/widgets/widget-filter.min.js @@ -1,2 +1,2 @@ -/*! Widget: filter - updated 11/4/2015 (v2.24.3) */ -!function(a){"use strict";var b,c=a.tablesorter||{},d=c.css;a.extend(d,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),c.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(a,c,d){c.$table.hasClass("hasFilters")||b.init(a,c,d)},remove:function(b,e,f,g){var h,i,j=e.$table,k=e.$tbodies,l="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter ");if(j.removeClass("hasFilters").unbind(l.replace(c.regex.spaces," ")).find("."+d.filterRow).remove(),!g){for(h=0;h=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(c,d,e){if((b.regex.orTest.test(d.iFilter)||b.regex.orSplit.test(d.filter))&&!b.regex.regex.test(d.filter)){var f,g,h,i,j=a.extend({},d),k=d.index,l=d.parsed[k],m=d.filter.split(b.regex.orSplit),n=d.iFilter.split(b.regex.orSplit),o=m.length;for(f=0;o>f;f++){j.nestedFilters=!0,j.filter=""+(b.parseFilter(c,m[f],k,l)||""),j.iFilter=""+(b.parseFilter(c,n[f],k,l)||""),h="("+(b.parseFilter(c,j.filter,k,l)||"")+")";try{if(i=new RegExp(d.isMatch?h:"^"+h+"$",c.widgetOptions.filter_ignoreCase?"i":""),g=i.test(j.exact)||b.processTypes(c,j,e))return g}catch(p){return null}}return g||!1}return null},and:function(c,d,e){if(b.regex.andTest.test(d.filter)){var f,g,h,i,j,k=a.extend({},d),l=d.index,m=d.parsed[l],n=d.filter.split(b.regex.andSplit),o=d.iFilter.split(b.regex.andSplit),p=n.length;for(f=0;p>f;f++){k.nestedFilters=!0,k.filter=""+(b.parseFilter(c,n[f],l,m)||""),k.iFilter=""+(b.parseFilter(c,o[f],l,m)||""),i=("("+(b.parseFilter(c,k.filter,l,m)||"")+")").replace(b.regex.wild01,"\\S{1}").replace(b.regex.wild0More,"\\S*");try{j=new RegExp(d.isMatch?i:"^"+i+"$",c.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.processTypes(c,k,e),g=0===f?h:g&&h}catch(q){return null}}return g||!1}return null},regex:function(a,c){if(b.regex.regex.test(c.filter)){var d,e=c.filter_regexCache[c.index]||b.regex.regex.exec(c.filter),f=e instanceof RegExp;try{f||(c.filter_regexCache[c.index]=e=new RegExp(e[1],e[2])),d=e.test(c.exact)}catch(g){d=!1}return d}return null},operators:function(d,e){if(b.regex.operTest.test(e.iFilter)&&""!==e.iExact){var f,g,h,i=d.table,j=e.index,k=e.parsed[j],l=c.formatFloat(e.iFilter.replace(b.regex.operators,""),i),m=d.parsers[j],n=l;return(k||"numeric"===m.type)&&(h=a.trim(""+e.iFilter.replace(b.regex.operators,"")),g=b.parseFilter(d,h,j,!0),l="number"!=typeof g||""===g||isNaN(g)?l:g),!k&&"numeric"!==m.type||isNaN(l)||"undefined"==typeof e.cache?(h=isNaN(e.iExact)?e.iExact.replace(c.regex.nondigit,""):e.iExact,f=c.formatFloat(h,i)):f=e.cache,b.regex.gtTest.test(e.iFilter)?g=b.regex.gteTest.test(e.iFilter)?f>=l:f>l:b.regex.ltTest.test(e.iFilter)&&(g=b.regex.lteTest.test(e.iFilter)?l>=f:l>f),g||""!==n||(g=!0),g}return null},notMatch:function(c,d){if(b.regex.notTest.test(d.iFilter)){var e,f=d.iFilter.replace("!",""),g=b.parseFilter(c,f,d.index,d.parsed[d.index])||"";return b.regex.exact.test(g)?(g=g.replace(b.regex.exact,""),""===g?!0:a.trim(g)!==d.iExact):(e=d.iExact.search(a.trim(g)),""===g?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.regex.exact.test(d.iFilter)){var e=d.iFilter.replace(b.regex.exact,""),f=b.parseFilter(c,e,d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(f,d.rowArray)>=0:f==d.iExact}return null},range:function(a,d){if(b.regex.toTest.test(d.iFilter)){var e,f,g,h,i=a.table,j=d.index,k=d.parsed[j],l=d.iFilter.split(b.regex.toSplit);return f=l[0].replace(c.regex.nondigit,"")||"",g=c.formatFloat(b.parseFilter(a,f,j,k),i),f=l[1].replace(c.regex.nondigit,"")||"",h=c.formatFloat(b.parseFilter(a,f,j,k),i),(k||"numeric"===a.parsers[j].type)&&(e=a.parsers[j].format(""+l[0],i,a.$headers.eq(j),j),g=""===e||isNaN(e)?g:e,e=a.parsers[j].format(""+l[1],i,a.$headers.eq(j),j),h=""===e||isNaN(e)?h:e),!k&&"numeric"!==a.parsers[j].type||isNaN(g)||isNaN(h)?(f=isNaN(d.iExact)?d.iExact.replace(c.regex.nondigit,""):d.iExact,e=c.formatFloat(f,i)):e=d.cache,g>h&&(f=g,g=h,h=f),e>=g&&h>=e||""===g||""===h}return null},wild:function(a,c){if(b.regex.wildOrTest.test(c.iFilter)){var d=c.index,e=c.parsed[d],f=""+(b.parseFilter(a,c.iFilter,d,e)||"");!b.regex.wildTest.test(f)&&c.nestedFilters&&(f=c.isMatch?f:"^("+f+")$");try{return new RegExp(f.replace(b.regex.wild01,"\\S{1}").replace(b.regex.wild0More,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(c.exact)}catch(g){return null}}return null},fuzzy:function(a,c){if(b.regex.fuzzyTest.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=c.iFilter.slice(1),h=b.parseFilter(a,g,c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===h[e]&&(e+=1);return e===h.length?!0:!1}return null}},init:function(e,f,g){c.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},c.language);var h,i,j,k,l,m,n,o,p,q=b.regex;if(f.$table.addClass("hasFilters"),g.filter_searchTimer=null,g.filter_initTimer=null,g.filter_formatterCount=0,g.filter_formatterInit=[],g.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',g.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',n="\\{"+b.regex.query+"\\}",a.extend(q,{child:new RegExp(f.cssChildRow),filtered:new RegExp(g.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+c.language.or+"|-|"+c.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+c.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+c.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+c.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+c.language.and+"|&&)\\s+)","gi"),orTest:/\|/,orSplit:new RegExp("(?:\\s+(?:"+c.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(n,"i"),igQuery:new RegExp(n,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/'+(k.data("placeholder")||k.attr("data-placeholder")||g.filter_placeholder.select||"")+"":"",n=i,j=i,i.indexOf(g.filter_selectSourceSeparator)>=0&&(n=i.split(g.filter_selectSourceSeparator),j=n[1],n=n[0]),h+="");f.$table.find("thead").find("select."+d.filter+'[data-column="'+l+'"]').append(h),j=g.filter_selectSource,o="function"==typeof j?!0:c.getColumnData(e,j,l),o&&b.buildSelect(f.table,l,"",!0,k.hasClass(g.filter_onlyAvail))}b.buildDefault(e,!0),b.bindSearch(e,f.$table.find("."+d.filter),!0),g.filter_external&&b.bindSearch(e,g.filter_external),g.filter_hideFilters&&b.hideFilters(f),f.showProcessing&&(j="filterStart filterEnd ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(b,g){k=g?f.$table.find("."+d.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",c.isProcessing(e,"filterStart"===b.type,g?k:"")})),f.filteredRows=f.totalRows,j="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(f.namespace+"filter "),f.$table.unbind(j.replace(c.regex.spaces," ")).bind(j,function(){var a=this.config.widgetOptions;m=b.setDefaults(e,f,a)||[],m.length&&(f.delayInit&&""===m.join("")||c.setFilters(e,m,!0)),f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(f)},100)}),f.pager&&f.pager.initialized&&!g.filter_initialized&&(f.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(f)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(d,e,f){var g,h,i,j,k,l=c.getFilters(d)||[];if(f.filter_saveFilters&&c.storage&&(h=c.storage(d,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(b,e,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=e.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)e.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(e.$filters=a(s+="").appendTo(e.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=e.$headerIndexed[i],j&&j.length&&(g=e.$filters.filter('[data-column="'+i+'"]'),n=c.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=c.getColumnData(b,e.headers,i),l="false"===c.getData(j[0],h,"filter")||"false"===c.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(d.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(d.filterDisabled)[0].disabled=!0)))},bindSearch:function(d,e,f){if(d=a(d)[0],e=a(e),e.length){var g,h=d.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,c.setFilters(d,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(c.regex.spaces," ")).bind("keyup"+j,function(c){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===c.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&c.which<=40)))return}b.searching(d,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(c){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===c.which||"search"===c.type||"change"===c.type&&this.value!==h.lastSearch[e])&&(c.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(d,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(e,f,g){var h=e.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:c.getFilters(e,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&c.updateCache(h,function(){b.checkFilters(e,!1,g)})):(j&&(c.setFilters(e,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+d.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(e,k,l),!1},30):(b.findRows(e,k,l),!1)):void 0)},hideFilters:function(b,e){var f,g=(e||b.$table).find("."+d.filterRow).addClass(d.filterRowHide);g.bind("mouseenter mouseleave",function(c){var e=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(e.type)?g.removeClass(d.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(d.filterRowHide)},200)}).find("input, select").bind("focus blur",function(e){var g=e,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===c.getFilters(b.$table).join("")&&h.toggleClass(d.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.regex.iQuery,f=d.match(b.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(e.anyMatch=!0,e.isMatch=!0,e.rowArray=e.$cells.map(function(b){return a.inArray(b,o)>-1?(e.parsed[b]?k=e.cacheArray[b]:(k=e.rawArray[b],k=a.trim(m.filter_ignoreCase?k.toLowerCase():k),d.sortLocaleCompare&&(k=c.replaceAccents(k))),k):void 0}).get(),e.filter=e.anyMatchFilter,e.iFilter=e.iAnyMatchFilter,e.exact=e.rowArray.join(" "),e.iExact=m.filter_ignoreCase?e.exact.toLowerCase():e.exact,e.cache=e.cacheArray.slice(0,-1).join(" "),f.excludeMatch=f.noAnyMatch,h=b.processTypes(d,e,f),null!==h)n=h;else if(m.filter_startsWith)for(n=!1,o=Math.min(d.columns,e.rowArray.length);!n&&o>0;)o--,n=n||0===e.rowArray[o].indexOf(e.iFilter);else n=(e.iExact+e.childRowText).indexOf(e.iFilter)>=0;if(e.anyMatch=!1,e.filters.join("")===e.filter)return n}for(o=0;o=0:e.filter===e.exact:"function"==typeof i?h=i(e.exact,e.cache,e.filter,o,e.$row,d,e):"function"==typeof i[j||e.filter]&&(k=j||e.filter,h=i[k](e.exact,e.cache,e.filter,o,e.$row,d,e))),null===h?(h=b.processTypes(d,e,f),null!==h?g=h:(k=(e.iExact+e.childRowText).indexOf(b.parseFilter(d,e.iFilter,o,e.parsed[o])),g=!m.filter_startsWith&&k>=0||m.filter_startsWith&&0===k)):g=h,n=g?n:!1);return n},findRows:function(d,e,f){if(d.config.lastCombinedFilter!==f&&d.config.widgetOptions.filter_initialized){var g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E=a.extend([],e),F=b.regex,G=d.config,H=G.widgetOptions,I={anyMatch:!1,filters:e,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:c.getColumnData(d,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||c.getData&&"parsed"===c.getData(G.$headerIndexed[b],c.getColumnData(d,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),o=0;o1&&(C=parseInt(B[0],10)-1,C>=0&&Cw;w++)v=e[w]||"",y||(w=o),y=y&&r.length&&0===v.indexOf(r[w]||"")&&!F.alreadyFiltered.test(v)&&!F.exactTest.test(v)&&!(F.isNeg1.test(v)||F.isNeg2.test(v))&&!(""!==v&&G.$filters&&G.$filters.filter('[data-column="'+w+'"]').find("select").length&&!G.$headerIndexed[w].hasClass("filter-match"));for(x=j.not("."+H.filter_filteredRow).length,y&&0===x&&(y=!1),G.debug&&console.log("Filter: Searching through "+(y&&g>x?x:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=c.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&F.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),y=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),l=0;g>l;l++)if(D=j[l].className,p=l&&F.child.test(D),!(p||y&&F.filtered.test(D))){if(I.$row=j.eq(l),I.cacheArray=h[l],i=I.cacheArray[G.columns],I.rawArray=i.raw,I.childRowText="",!H.filter_childByColumn){for(D="",q=i.child,w=0;w")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(d,e,f))}return i===!1&&(i=b.getOptions(d,e,f)),b.processOptions(d,e,i)},processOptions:function(b,d,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j,k,l=b.config,m="undefined"!=typeof d&&null!==d&&d>=0&&dh;h++)g=e[h],k=g.text?g.text:g,j=(m&&l.parsers&&l.parsers.length&&l.parsers[d].format(k,b,[],d)||k).toString(),j=l.widgetOptions.filter_ignoreCase?j.toLowerCase():j,g.text?(g.parsed=j,n.push(g)):n.push({text:g,parsed:j});for(f=l.textSorter||"",n.sort(function(a,e){var g=a.parsed,h=e.parsed;return m&&"function"==typeof f?f(g,h,!0,d,b):m&&"object"==typeof f&&f.hasOwnProperty(d)?f[d](g,h,!0,d,b):c.sortNatural?c.sortNatural(g,h):!0}),e=[],i=n.length,h=0;i>h;h++)e.push(n[h]);return e},getOptions:function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[d].parsed||n.$headerIndexed[d].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][d])}else if(p.push(j.normalized[f][n.columns].raw[d]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(d),p.push(""+c.getElementText(n,l,d));return p},buildSelect:function(c,e,f,g,h){if(c=a(c)[0],e=parseInt(e,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var i,j,k,l,m,n,o,p=c.config,q=p.widgetOptions,r=p.$headerIndexed[e],s='",t=p.$table.find("thead").find("select."+d.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.getOptionSource(c,e,h)),a.isArray(f)){for(i=0;i"}else""+o!="[object Object]"&&(k=o=(""+o).replace(b.regex.quote,"""),j=k,k.indexOf(q.filter_selectSourceSeparator)>=0&&(l=k.split(q.filter_selectSourceSeparator),j=l[0],k=l[1]),s+=""!==o?"":"");f=[]}m=(p.$filters?p.$filters:p.$table.children("thead")).find("."+d.filter),q.filter_$externalFilters&&(m=m&&m.length?m.add(q.filter_$externalFilters):q.filter_$externalFilters),n=m.filter('select[data-column="'+e+'"]'),n.length&&(n[g?"html":"append"](s),a.isArray(f)||n.append(f).val(t),n.val(t))}},buildDefault:function(a,d){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||c.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",d,f.hasClass(i.filter_onlyAvail))}},c.getFilters=function(c,e,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+d.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},c.setFilters=function(d,e,f,g){var h=d?a(d)[0].config:"",i=c.getFilters(d,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery); \ No newline at end of file +/*! Widget: filter - updated 11/10/2015 (v2.24.4) */ +!function(a){"use strict";var b,c,d=a.tablesorter||{},e=d.css;a.extend(e,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),d.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnFilters:!0,filter_columnAnyMatch:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(a,c,d){c.$table.hasClass("hasFilters")||b.init(a,c,d)},remove:function(b,c,f,g){var h,i,j=c.$table,k=c.$tbodies,l="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(c.namespace+"filter ");if(j.removeClass("hasFilters").unbind(l.replace(d.regex.spaces," ")).find("."+e.filterRow).remove(),!g){for(h=0;h=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(d,e,f){if((c.orTest.test(e.iFilter)||c.orSplit.test(e.filter))&&!c.regex.test(e.filter)){var g,h,i,j,k=a.extend({},e),l=e.filter.split(c.orSplit),m=e.iFilter.split(c.orSplit),n=l.length;for(g=0;n>g;g++){k.nestedFilters=!0,k.filter=""+(b.parseFilter(d,l[g],e)||""),k.iFilter=""+(b.parseFilter(d,m[g],e)||""),i="("+(b.parseFilter(d,k.filter,e)||"")+")";try{if(j=new RegExp(e.isMatch?i:"^"+i+"$",d.widgetOptions.filter_ignoreCase?"i":""),h=j.test(k.exact)||b.processTypes(d,k,f))return h}catch(o){return null}}return h||!1}return null},and:function(d,e,f){if(c.andTest.test(e.filter)){var g,h,i,j,k,l=a.extend({},e),m=e.filter.split(c.andSplit),n=e.iFilter.split(c.andSplit),o=m.length;for(g=0;o>g;g++){l.nestedFilters=!0,l.filter=""+(b.parseFilter(d,m[g],e)||""),l.iFilter=""+(b.parseFilter(d,n[g],e)||""),j=("("+(b.parseFilter(d,l.filter,e)||"")+")").replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*");try{k=new RegExp(e.isMatch?j:"^"+j+"$",d.widgetOptions.filter_ignoreCase?"i":""),i=k.test(l.exact)||b.processTypes(d,l,f),h=0===g?i:h&&i}catch(p){return null}}return h||!1}return null},regex:function(a,b){if(c.regex.test(b.filter)){var d,e=b.filter_regexCache[b.index]||c.regex.exec(b.filter),f=e instanceof RegExp;try{f||(b.filter_regexCache[b.index]=e=new RegExp(e[1],e[2])),d=e.test(b.exact)}catch(g){d=!1}return d}return null},operators:function(e,f){if(c.operTest.test(f.iFilter)&&""!==f.iExact){var g,h,i,j=e.table,k=f.parsed[f.index],l=d.formatFloat(f.iFilter.replace(c.operators,""),j),m=e.parsers[f.index],n=l;return(k||"numeric"===m.type)&&(i=a.trim(""+f.iFilter.replace(c.operators,"")),h=b.parseFilter(e,i,f,!0),l="number"!=typeof h||""===h||isNaN(h)?l:h),!k&&"numeric"!==m.type||isNaN(l)||"undefined"==typeof f.cache?(i=isNaN(f.iExact)?f.iExact.replace(d.regex.nondigit,""):f.iExact,g=d.formatFloat(i,j)):g=f.cache,c.gtTest.test(f.iFilter)?h=c.gteTest.test(f.iFilter)?g>=l:g>l:c.ltTest.test(f.iFilter)&&(h=c.lteTest.test(f.iFilter)?l>=g:l>g),h||""!==n||(h=!0),h}return null},notMatch:function(d,e){if(c.notTest.test(e.iFilter)){var f,g=e.iFilter.replace("!",""),h=b.parseFilter(d,g,e)||"";return c.exact.test(h)?(h=h.replace(c.exact,""),""===h?!0:a.trim(h)!==e.iExact):(f=e.iExact.search(a.trim(h)),""===h?!0:!(d.widgetOptions.filter_startsWith?0===f:f>=0))}return null},exact:function(d,e){if(c.exact.test(e.iFilter)){var f=e.iFilter.replace(c.exact,""),g=b.parseFilter(d,f,e)||"";return e.anyMatch?a.inArray(g,e.rowArray)>=0:g==e.iExact}return null},range:function(a,e){if(c.toTest.test(e.iFilter)){var f,g,h,i,j=a.table,k=e.index,l=e.parsed[k],m=e.iFilter.split(c.toSplit);return g=m[0].replace(d.regex.nondigit,"")||"",h=d.formatFloat(b.parseFilter(a,g,e),j),g=m[1].replace(d.regex.nondigit,"")||"",i=d.formatFloat(b.parseFilter(a,g,e),j),(l||"numeric"===a.parsers[k].type)&&(f=a.parsers[k].format(""+m[0],j,a.$headers.eq(k),k),h=""===f||isNaN(f)?h:f,f=a.parsers[k].format(""+m[1],j,a.$headers.eq(k),k),i=""===f||isNaN(f)?i:f),!l&&"numeric"!==a.parsers[k].type||isNaN(h)||isNaN(i)?(g=isNaN(e.iExact)?e.iExact.replace(d.regex.nondigit,""):e.iExact,f=d.formatFloat(g,j)):f=e.cache,h>i&&(g=h,h=i,i=g),f>=h&&i>=f||""===h||""===i}return null},wild:function(a,d){if(c.wildOrTest.test(d.iFilter)){var e=""+(b.parseFilter(a,d.iFilter,d)||"");!c.wildTest.test(e)&&d.nestedFilters&&(e=d.isMatch?e:"^("+e+")$");try{return new RegExp(e.replace(c.wild01,"\\S{1}").replace(c.wild0More,"\\S*"),a.widgetOptions.filter_ignoreCase?"i":"").test(d.exact)}catch(f){return null}}return null},fuzzy:function(a,d){if(c.fuzzyTest.test(d.iFilter)){var e,f=0,g=d.iExact.length,h=d.iFilter.slice(1),i=b.parseFilter(a,h,d)||"";for(e=0;g>e;e++)d.iExact[e]===i[f]&&(f+=1);return f===i.length}return null}},init:function(f,g,h){d.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},d.language);var i,j,k,l,m,n,o,p,q;if(g.$table.addClass("hasFilters"),h.filter_searchTimer=null,h.filter_initTimer=null,h.filter_formatterCount=0,h.filter_formatterInit=[],h.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',h.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',o="\\{"+c.query+"\\}",a.extend(c,{child:new RegExp(g.cssChildRow),filtered:new RegExp(h.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+d.language.or+"|-|"+d.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+d.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+d.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+d.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+d.language.and+"|&&)\\s+)","gi"),orTest:/\|/,orSplit:new RegExp("(?:\\s+(?:"+d.language.or+")\\s+|\\|)","gi"),iQuery:new RegExp(o,"i"),igQuery:new RegExp(o,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/'+(l.data("placeholder")||l.attr("data-placeholder")||h.filter_placeholder.select||"")+"":"",o=j,k=j,j.indexOf(h.filter_selectSourceSeparator)>=0&&(o=j.split(h.filter_selectSourceSeparator),k=o[1],o=o[0]),i+="");g.$table.find("thead").find("select."+e.filter+'[data-column="'+m+'"]').append(i),k=h.filter_selectSource,p="function"==typeof k?!0:d.getColumnData(f,k,m),p&&b.buildSelect(g.table,m,"",!0,l.hasClass(h.filter_onlyAvail))}b.buildDefault(f,!0),b.bindSearch(f,g.$table.find("."+e.filter),!0),h.filter_external&&b.bindSearch(f,h.filter_external),h.filter_hideFilters&&b.hideFilters(g),g.showProcessing&&(k="filterStart filterEnd ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(b,c){l=c?g.$table.find("."+e.header).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"",d.isProcessing(f,"filterStart"===b.type,c?l:"")})),g.filteredRows=g.totalRows,k="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(g.namespace+"filter "),g.$table.unbind(k.replace(d.regex.spaces," ")).bind(k,function(){var a=this.config.widgetOptions;n=b.setDefaults(f,g,a)||[],n.length&&(g.delayInit&&""===n.join("")||d.setFilters(f,n,!0)),g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filterInitComplete(g)},100)}),g.pager&&g.pager.initialized&&!h.filter_initialized&&(g.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filterInitComplete(g)},100))},formatterUpdated:function(a,b){var c=a&&a.closest("table")[0].config.widgetOptions;c&&!c.filter_initialized&&(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d,e,f=c.widgetOptions,g=0,h=function(){f.filter_initialized=!0,c.$table.trigger("filterInit",c),b.findRows(c.table,c.$table.data("lastSearch")||[])};if(a.isEmptyObject(f.filter_formatter))h();else{for(e=f.filter_formatterInit.length,d=0;e>d;d++)1===f.filter_formatterInit[d]&&g++;clearTimeout(f.filter_initTimer),f.filter_initialized||g!==f.filter_formatterCount?f.filter_initialized||(f.filter_initTimer=setTimeout(function(){h()},500)):h()}},processFilters:function(a,b){var c,d=b?encodeURIComponent:decodeURIComponent,e=a.length;for(c=0;e>c;c++)a[c]=d(a[c]);return a},setDefaults:function(c,e,f){var g,h,i,j,k,l=d.getFilters(c)||[];if(f.filter_saveFilters&&d.storage&&(h=d.storage(c,"tablesorter-filters")||[],g=a.isArray(h),g&&""===h.join("")||!g||(l=b.processFilters(h))),""===l.join(""))for(k=e.$headers.add(f.filter_$externalFilters).filter("["+f.filter_defaultAttrib+"]"),i=0;i<=e.columns;i++)j=i===e.columns?"all":i,l[i]=k.filter('[data-column="'+j+'"]').attr(f.filter_defaultAttrib)||l[i]||"";return e.$table.data("lastSearch",l),l},parseFilter:function(a,b,c,d){return d||c.parsed[c.index]?a.parsers[c.index].format(b,a.table,[],c.index):b},buildRow:function(b,c,f){var g,h,i,j,k,l,m,n,o,p=f.filter_cellFilter,q=c.columns,r=a.isArray(p),s='';for(i=0;q>i;i++)c.$headerIndexed[i].length&&(s+='1&&(s+=' colspan="'+o+'"'),s+=r?p[i]?' class="'+p[i]+'"':"":""!==p?' class="'+p+'"':"",s+=">");for(c.$filters=a(s+="").appendTo(c.$table.children("thead").eq(0)).children("td"),i=0;q>i;i++)l=!1,j=c.$headerIndexed[i],j&&j.length&&(g=c.$filters.filter('[data-column="'+i+'"]'),n=d.getColumnData(b,f.filter_functions,i),k=f.filter_functions&&n&&"function"!=typeof n||j.hasClass("filter-select"),h=d.getColumnData(b,c.headers,i),l="false"===d.getData(j[0],h,"filter")||"false"===d.getData(j[0],h,"parser"),k?s=a("').appendTo(g),s&&(o=j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.search||"",s.attr("placeholder",o))),s&&(m=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[i]?f.filter_cssFilter[i]||"":"":f.filter_cssFilter)||"",s.addClass(e.filter+" "+m).attr("data-column",i),l&&(s.attr("placeholder","").addClass(e.filterDisabled)[0].disabled=!0)))},bindSearch:function(c,e,f){if(c=a(c)[0],e=a(e),e.length){var g,h=c.config,i=h.widgetOptions,j=h.namespace+"filter",k=i.filter_$externalFilters;f!==!0&&(g=i.filter_anyColumnSelector+","+i.filter_multipleColumnSelector,i.filter_$anyMatch=e.filter(g),k&&k.length?i.filter_$externalFilters=i.filter_$externalFilters.add(e):i.filter_$externalFilters=e,d.setFilters(c,h.$table.data("lastSearch")||[],f===!1)),g="keypress keyup search change ".split(" ").join(j+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(g.replace(d.regex.spaces," ")).bind("keyup"+j,function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(i.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof i.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(j+" "),function(d){var e=parseInt(a(this).attr("data-column"),10);i.filter_initialized&&(13===d.which||"search"===d.type||"change"===d.type&&this.value!==h.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.filter_searchTimer),"undefined"==typeof c||c===!0?e.filter_searchTimer=setTimeout(function(){b.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.checkFilters(a,c,d)},checkFilters:function(c,f,g){var h=c.config,i=h.widgetOptions,j=a.isArray(f),k=j?f:d.getFilters(c,!0),l=(k||[]).join("");return a.isEmptyObject(h.cache)?void(h.delayInit&&h.pager&&h.pager.initialized&&d.updateCache(h,function(){b.checkFilters(c,!1,g)})):(j&&(d.setFilters(c,k,!1,g!==!0),i.filter_initialized||(h.lastCombinedFilter="")),i.filter_hideFilters&&h.$table.find("."+e.filterRow).trigger(""===l?"mouseleave":"mouseenter"),h.lastCombinedFilter!==l||f===!1?(f===!1&&(h.lastCombinedFilter=null,h.lastSearch=[]),k=Array.prototype.map?k.map(String):k.join("\x00").split("\x00"),i.filter_initialized&&h.$table.trigger("filterStart",[k]),h.showProcessing?void setTimeout(function(){return b.findRows(c,k,l),!1},30):(b.findRows(c,k,l),!1)):void 0)},hideFilters:function(b,c){var f,g=(c||b.$table).find("."+e.filterRow).addClass(e.filterRowHide);g.bind("mouseenter mouseleave",function(c){var d=c,g=a(this);clearTimeout(f),f=setTimeout(function(){/enter|over/.test(d.type)?g.removeClass(e.filterRowHide):a(document.activeElement).closest("tr")[0]!==g[0]&&""===b.lastCombinedFilter&&g.addClass(e.filterRowHide)},200)}).find("input, select").bind("focus blur",function(c){var g=c,h=a(this).closest("tr");clearTimeout(f),f=setTimeout(function(){clearTimeout(f),""===d.getFilters(b.$table).join("")&&h.toggleClass(e.filterRowHide,"focus"!==g.type)},200)})},defaultFilter:function(b,d){if(""===b)return b;var e=c.iQuery,f=d.match(c.igQuery).length,g=f>1?a.trim(b).split(/\s/):[a.trim(b)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b?b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")}):b||a()},multipleColumns:function(c,d){var e,f,g,h,i,j,k,l,m,n=c.widgetOptions,o=n.filter_initialized||!d.filter(n.filter_anyColumnSelector).length,p=[],q=a.trim(b.getLatestSearch(d).attr("data-column")||"");if(/^[0-9]+$/.test(q))return parseInt(q,10);if(o&&/-/.test(q))for(f=q.match(/(\d+)\s*-\s*(\d+)/g),m=f.length,l=0;m>l;l++){for(g=f[l].split(/\s*-\s*/),h=parseInt(g[0],10)||0,i=parseInt(g[1],10)||c.columns-1,h>i&&(e=h,h=i,i=e),i>=c.columns&&(i=c.columns-1);i>=h;h++)p.push(h);q=q.replace(f[l],"")}if(o&&/,/.test(q))for(j=q.split(/\s*,\s*/),m=j.length,k=0;m>k;k++)""!==j[k]&&(l=parseInt(j[k],10),l1){if(f.anyMatch=!0,f.isMatch=!0,f.rowArray=f.$cells.map(function(b){return a.inArray(b,o)>-1?(f.parsed[b]?l=f.cacheArray[b]:(l=f.rawArray[b],l=a.trim(m.filter_ignoreCase?l.toLowerCase():l),e.sortLocaleCompare&&(l=d.replaceAccents(l))),l):void 0}).get(),f.filter=f.anyMatchFilter,f.iFilter=f.iAnyMatchFilter,f.exact=f.rowArray.join(" "),f.iExact=m.filter_ignoreCase?f.exact.toLowerCase():f.exact,f.cache=f.cacheArray.slice(0,-1).join(" "),g.excludeMatch=g.noAnyMatch,i=b.processTypes(e,f,g),null!==i)n=i;else if(m.filter_startsWith)for(n=!1,o=Math.min(e.columns,f.rowArray.length);!n&&o>0;)o--,n=n||0===f.rowArray[o].indexOf(f.iFilter);else n=(f.iExact+f.childRowText).indexOf(f.iFilter)>=0;if(f.anyMatch=!1,f.filters.join("")===f.filter)return n}for(o=0;o=0:f.filter===f.exact:"function"==typeof j?i=j(f.exact,f.cache,f.filter,o,f.$row,e,f):"function"==typeof j[k||f.filter]&&(l=k||f.filter,i=j[l](f.exact,f.cache,f.filter,o,f.$row,e,f))),null===i?(i=b.processTypes(e,f,g),null!==i?h=i:(l=(f.iExact+f.childRowText).indexOf(b.parseFilter(e,f.iFilter,f)),h=!m.filter_startsWith&&l>=0||m.filter_startsWith&&0===l)):h=i,n=h?n:!1);return n},findRows:function(e,f,g){if(e.config.lastCombinedFilter!==g&&e.config.widgetOptions.filter_initialized){var h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F=a.extend([],f),G=e.config,H=G.widgetOptions,I={anyMatch:!1,filters:f,filter_regexCache:[]},J={noAnyMatch:["range","notMatch","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:d.getColumnData(e,H.filter_defaultFilter,G.columns,!0)||""};for(I.parsed=G.$headers.map(function(b){return G.parsers&&G.parsers[b]&&G.parsers[b].parsed||d.getData&&"parsed"===d.getData(G.$headerIndexed[b],d.getColumnData(e,G.headers,b),"filter")||a(this).hasClass("filter-parsed")}).get(),p=0;p1&&(D=parseInt(C[0],10)-1,D>=0&&Dx;x++)w=f[x]||"",z||(x=p),z=z&&s.length&&0===w.indexOf(s[x]||"")&&!c.alreadyFiltered.test(w)&&!c.exactTest.test(w)&&!(c.isNeg1.test(w)||c.isNeg2.test(w))&&!(""!==w&&G.$filters&&G.$filters.filter('[data-column="'+x+'"]').find("select").length&&!G.$headerIndexed[x].hasClass("filter-match"));for(y=k.not("."+H.filter_filteredRow).length,z&&0===y&&(z=!1),G.debug&&console.log("Filter: Searching through "+(z&&h>y?y:"all")+" rows"),I.anyMatchFlag&&(G.sortLocaleCompare&&(I.anyMatchFilter=d.replaceAccents(I.anyMatchFilter)),H.filter_defaultFilter&&c.iQuery.test(J.defaultAnyFilter)&&(I.anyMatchFilter=b.defaultFilter(I.anyMatchFilter,J.defaultAnyFilter),z=!1),I.iAnyMatchFilter=H.filter_ignoreCase&&G.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),m=0;h>m;m++)if(E=k[m].className,q=m&&c.child.test(E),!(q||z&&c.filtered.test(E))){if(I.$row=k.eq(m),I.cacheArray=i[m],j=I.cacheArray[G.columns],I.rawArray=j.raw,I.childRowText="",!H.filter_childByColumn){for(E="",r=j.child,x=0;x")>=0)return l;a.isArray(l)?i=l:"object"===a.type(j)&&l&&(i=l(c,e,f))}return i===!1&&(i=b.getOptions(c,e,f)),b.processOptions(c,e,i)},processOptions:function(b,c,e){if(!a.isArray(e))return!1;b=a(b)[0];var f,g,h,i,j,k,l=b.config,m="undefined"!=typeof c&&null!==c&&c>=0&&ch;h++)g=e[h],k=g.text?g.text:g,j=(m&&l.parsers&&l.parsers.length&&l.parsers[c].format(k,b,[],c)||k).toString(),j=l.widgetOptions.filter_ignoreCase?j.toLowerCase():j,g.text?(g.parsed=j,n.push(g)):n.push({text:g,parsed:j});for(f=l.textSorter||"",n.sort(function(a,e){var g=a.parsed,h=e.parsed;return m&&"function"==typeof f?f(g,h,!0,c,b):m&&"object"==typeof f&&f.hasOwnProperty(c)?f[c](g,h,!0,c,b):d.sortNatural?d.sortNatural(g,h):!0}),e=[],i=n.length,h=0;i>h;h++)e.push(n[h]);return e},getOptions:function(b,c,e){b=a(b)[0];var f,g,h,i,j,k,l,m,n=b.config,o=n.widgetOptions,p=[];for(g=0;gf;f++)if(i=j.row?j.row[f]:j.normalized[f][n.columns].$row[0],!e||!i.className.match(o.filter_filteredRow))if(o.filter_useParsedData||n.parsers[c].parsed||n.$headerIndexed[c].hasClass("filter-parsed")){if(p.push(""+j.normalized[f][c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length-1,k=0;m>k;k++)p.push(""+j.normalized[f][n.columns].child[k][c])}else if(p.push(j.normalized[f][n.columns].raw[c]),o.filter_childRows&&o.filter_childByColumn)for(m=j.normalized[f][n.columns].$row.length,k=1;m>k;k++)l=j.normalized[f][n.columns].$row.eq(k).children().eq(c),p.push(""+d.getElementText(n,l,c));return p},buildSelect:function(d,f,g,h,i){if(d=a(d)[0],f=parseInt(f,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var j,k,l,m,n,o,p,q=d.config,r=q.widgetOptions,s=q.$headerIndexed[f],t='",u=q.$table.find("thead").find("select."+e.filter+'[data-column="'+f+'"]').val();if(("undefined"==typeof g||""===g)&&(g=b.getOptionSource(d,f,i)),a.isArray(g)){for(j=0;j"}else""+p!="[object Object]"&&(l=p=(""+p).replace(c.quote,"""),k=l,l.indexOf(r.filter_selectSourceSeparator)>=0&&(m=l.split(r.filter_selectSourceSeparator),k=m[0],l=m[1]),t+=""!==p?"":"");g=[]}n=(q.$filters?q.$filters:q.$table.children("thead")).find("."+e.filter),r.filter_$externalFilters&&(n=n&&n.length?n.add(r.filter_$externalFilters):r.filter_$externalFilters),o=n.filter('select[data-column="'+f+'"]'),o.length&&(o[h?"html":"append"](t),a.isArray(g)||o.append(g).val(u),o.val(u))}},buildDefault:function(a,c){var e,f,g,h=a.config,i=h.widgetOptions,j=h.columns;for(e=0;j>e;e++)f=h.$headerIndexed[e],g=!(f.hasClass("filter-false")||f.hasClass("parser-false")),(f.hasClass("filter-select")||d.getColumnData(a,i.filter_functions,e)===!0)&&g&&b.buildSelect(a,e,"",c,f.hasClass(i.filter_onlyAvail))}},c=b.regex,d.getFilters=function(c,d,f,g){var h,i,j,k,l=!1,m=c?a(c)[0].config:"",n=m?m.widgetOptions:"";if(d!==!0&&n&&!n.filter_columnFilters||a.isArray(f)&&f.join("")===m.lastCombinedFilter)return a(c).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+e.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h1&&(j=j.slice(1)),h===m.columns&&(k=j.filter(n.filter_anyColumnSelector),j=k.length?k:j),j.val(f[h]).trigger("change"+m.namespace)):(l[h]=j.val()||"",h===m.columns?j.slice(1).filter('[data-column*="'+j.attr("data-column")+'"]').val(l[h]):j.slice(1).val(l[h])),h===m.columns&&j.length&&(n.filter_$anyMatch=j));return 0===l.length&&(l=!1),l},d.setFilters=function(c,e,f,g){var h=c?a(c)[0].config:"",i=d.getFilters(c,!0,e,g);return"undefined"==typeof f&&(f=!0),h&&f&&(h.lastCombinedFilter=null,h.lastSearch=[],b.searching(h.table,e,g),h.$table.trigger("filterFomatterUpdate")),!!i}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-grouping.min.js b/dist/js/widgets/widget-grouping.min.js index b0a562e1..f72d768f 100644 --- a/dist/js/widgets/widget-grouping.min.js +++ b/dist/js/widgets/widget-grouping.min.js @@ -1,2 +1,2 @@ -/*! Widget: grouping - updated 11/2/2015 (v2.24.1) */ +/*! Widget: grouping - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b=a.tablesorter,c=b.grouping={types:{number:function(a,c,d,e){var f,g=c.hasClass(b.css.sortAsc);return e>1&&""!==d?(f=g?Math.floor(parseFloat(d)/e)*e:Math.ceil(parseFloat(d)/e)*e,f+=" - "+(f+(e-1)*(g?1:-1))):f=parseFloat(d)||d,f},separator:function(b,c,d,e){var f=(d+"").split(b.widgetOptions.group_separator);return a.trim(f[e-1]||"")},text:function(a,b,c){return c},word:function(a,b,c,d){var e=(c+" ").match(/\w+/g)||[];return e[d-1]||""},letter:function(a,b,c,d){return c?(c+" ").substring(0,d):""},date:function(a,b,d,e,f){var g,h,i=a.widgetOptions,j=new Date(d||"");return j instanceof Date&&isFinite(j)?(g=j.getFullYear(),h=c.findMonth(i,j.getMonth()),"year"===e?g:"month"===e?h:"monthyear"===e?h+" "+g:"day"===e?h+" "+j.getDate():"week"===e?c.findWeek(i,j.getDay()):"time"===e?c.findTime(i,j):i.group_dateString(j,a,b)):i.group_dateInvalid}},findMonth:function(a,b){return a.group_months[b+(""===(a.group_months[0]||"")?1:0)]},findWeek:function(b,c){if(a.isArray(b.group_week))return b.group_week[c];if(!a.isEmptyObject(b.group_week)){var d=["sun","mon","tue","wed","thu","fri","sat"];return b.group_week[d[c]]}},findTime:function(a,b){var c,d=a.group_time.am&&a.group_time.pm,e=b.getHours(),f=e>=12?1:0,g=a.group_time24Hour&&e>12?e-12:a.group_time24Hour&&0===e?e+12:e,h=("00"+g).slice(-2),i=("00"+b.getMinutes()).slice(-2);return c=a.group_time[d?["am","pm"][f]:f],h+":"+i+(a.group_time24Hour?"":" "+(c||""))},update:function(b,d,e){if(!a.isEmptyObject(d.cache)){var f="undefined"!=typeof d.sortList[0],g={},h=a.isArray(e.group_forceColumn)&&"undefined"!=typeof e.group_forceColumn[0]?e.group_enforceSort&&!f?-1:e.group_forceColumn[0]:f?d.sortList[0][0]:-1;d.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove(),e.group_collapsible&&d.$table.data("pagerSavedHeight",0),h>=0&&he;e++)j=k.eq(e),i=j.nextUntil("tr.group-header").filter(":visible"),(c.group_count||a.isFunction(c.group_callback))&&(g=j.find(".group-count"),g.length&&(c.group_count&&g.html(c.group_count.replace(/\{num\}/g,i.length)),a.isFunction(c.group_callback)&&c.group_callback(j.find("td"),i,d.column,b.table))),c.group_saveGroups&&!a.isEmptyObject(c.group_collapsedGroups)&&c.group_collapsedGroups[c.group_collapsedGroup].length?(h=j.find(".group-name").text().toLowerCase()+j.attr("data-group-index"),f=a.inArray(h,c.group_collapsedGroups[c.group_collapsedGroup])>-1,j.toggleClass("collapsed",f),i.toggleClass("group-hidden",f)):c.group_collapsed&&c.group_collapsible&&(j.addClass("collapsed"),i.addClass("group-hidden"))},groupHeaderHTML:function(a,b,c){return''+(b.group_collapsible?"":"")+''+c.currentGroup+''},saveCurrentGrouping:function(a,c,d){var e,f,g=!1;return c.group_collapsible&&c.group_saveGroups&&b.storage&&(c.group_collapsedGroups=b.storage(a.table,"tablesorter-groups")||{},f="dir"+a.sortList[0][1],e=c.group_collapsedGroup=""+a.sortList[0][0]+f+d.grouping.join(""),c.group_collapsedGroups[e]?g=!0:c.group_collapsedGroups[e]=[]),g},findColumnGroups:function(a,d,e){var f,g,h,i,j=b.hasWidget(a.table,"pager");for(e.groupIndex=0,f=0;fh;h++)e.rowData=g[h],e.$row=e.rowData[a.columns].$row,e.$row.is(":visible")&&c.types[e.grouping[1]]&&c.insertGroupHeader(a,d,e)},insertGroupHeader:function(b,d,e){var f=b.$headerIndexed[e.column],g=e.rowData[e.column],h=/date/.test(e.groupClass)?e.grouping[2]:parseInt(e.grouping[2]||1,10)||1;e.currentGroup=e.rowData?c.types[e.grouping[1]](b,f,g,h,e.group):e.currentGroup,e.group!==e.currentGroup&&(e.group=e.currentGroup,a.isFunction(d.group_formatter)&&(e.currentGroup=d.group_formatter((e.group||"").toString(),e.column,b.table,b,d,e)||e.group),e.$row.before(c.groupHeaderHTML(b,d,e)),d.group_saveGroups&&!e.savedGroup&&d.group_collapsed&&d.group_collapsible&&d.group_collapsedGroups[d.group_collapsedGroup].push(e.currentGroup))},bindEvents:function(d,e,f){f.group_collapsible&&(f.group_collapsedGroups=[],e.$table.on("click toggleGroup keyup","tr.group-header",function(c){if(c.stopPropagation(),"keyup"!==c.type||13===c.which){var g,h,i,j=a(this),k=j.find(".group-name").text().toLowerCase()+j.attr("data-group-index");!c.shiftKey||"click"!==c.type&&"keyup"!==c.type||j.siblings(".group-header").trigger("toggleGroup"),j.toggleClass("collapsed"),j.nextUntil("tr.group-header").toggleClass("group-hidden",j.hasClass("collapsed")),f.group_saveGroups&&b.storage&&(h=e.$table.find(".group-header"),g=j.hasClass("collapsed"),f.group_collapsedGroups[f.group_collapsedGroup]||(f.group_collapsedGroups[f.group_collapsedGroup]=[]),g&&f.group_collapsedGroup?f.group_collapsedGroups[f.group_collapsedGroup].push(k):f.group_collapsedGroup&&(i=a.inArray(k,f.group_collapsedGroups[f.group_collapsedGroup]),i>-1&&f.group_collapsedGroups[f.group_collapsedGroup].splice(i,1)),b.storage(d,"tablesorter-groups",f.group_collapsedGroups))}})),a(f.group_saveReset).on("click",function(){c.clearSavedGroups(d)}),e.$table.on("pagerChange.tsgrouping",function(){c.update(d,e,f)})},clearSavedGroups:function(a){a&&b.storage&&(b.storage(a,"tablesorter-groups",""),c.update(a,a.config,a.config.widgetOptions))}};b.addWidget({id:"group",priority:100,options:{group_collapsible:!0,group_collapsed:!1,group_saveGroups:!0,group_saveReset:null,group_count:" ({num})",group_separator:"-",group_formatter:null,group_callback:null,group_complete:"groupingComplete",group_forceColumn:[],group_enforceSort:!0,group_checkbox:["checked","unchecked"],group_months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],group_week:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],group_time:["AM","PM"],group_time24Hour:!1,group_dateInvalid:"Invalid Date",group_dateString:function(a){return a.toLocaleString()}},init:function(a,b,d,e){c.bindEvents(a,d,e)},format:function(a,b,d){c.update(a,b,d)},remove:function(a,b,c){b.$table.off("click","tr.group-header").off("pagerChange.tsgrouping").find(".group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove()}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-headerTitles.min.js b/dist/js/widgets/widget-headerTitles.min.js index 20107047..80a5572b 100644 --- a/dist/js/widgets/widget-headerTitles.min.js +++ b/dist/js/widgets/widget-headerTitles.min.js @@ -1,2 +1,2 @@ -/*! Widget: headerTitles - updated 11/8/2015 (v2.24.4) */ +/*! Widget: headerTitles - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b=a.tablesorter;b.addWidget({id:"headerTitles",options:{headerTitle_useAria:!1,headerTitle_tooltip:"",headerTitle_cur_text:[" sort: A - Z"," sort: Z - A","ly unsorted"],headerTitle_cur_numeric:[" sort: 0 - 9"," sort: 9 - 0","ly unsorted"],headerTitle_nxt_text:[" sort: A - Z"," sort: Z - A","remove sort"],headerTitle_nxt_numeric:[" sort: 0 - 9"," sort: 9 - 0","remove sort"],headerTitle_output_sorted:"current{current}; activate to {next}",headerTitle_output_unsorted:"current{current}; activate to {next} ",headerTitle_output_nosort:"No sort available",headerTitle_type:[],headerTitle_callback:null},init:function(b,c,d,e){d.$table.on("refreshHeaderTitle",function(){c.format(b,d,e)}),a.isArray(e.headerTitle_tooltip)?d.$headers.each(function(){a(this).addClass(e.headerTitle_tooltip[this.column]||"")}):""!==e.headerTitle_tooltip&&d.$headers.addClass(e.headerTitle_tooltip)},format:function(c,d,e){var f;d.$headers.each(function(){var c=a(this),g=parseInt(c.attr("data-column"),10),h=e.headerTitle_type[g]||d.parsers[g].type||"text",i=c.hasClass(b.css.sortAsc)?0:c.hasClass(b.css.sortDesc)?1:2,j=d.sortVars[g].order[(d.sortVars[g].count+1)%(d.sortReset?3:2)];e.headerTitle_useAria?f=c.attr("aria-label")||e.headerTitle_output_nosort||"":(f=(e.headerTitle_prefix||"")+(c.hasClass("sorter-false")?e.headerTitle_output_nosort:b.isValueInArray(g,d.sortList)>=0?e.headerTitle_output_sorted:e.headerTitle_output_unsorted),f=f.replace(/\{(current|next|name)\}/gi,function(a){return{"{name}":c.text(),"{current}":e["headerTitle_cur_"+h][i]||"","{next}":e["headerTitle_nxt_"+h][j]||""}[a.toLowerCase()]})),c.attr("title",a.isFunction(e.headerTitle_callback)?e.headerTitle_callback(c,f):f)})},remove:function(b,c,d){c.$headers.attr("title",""),c.$table.off("refreshHeaderTitle"),a.isArray(d.headerTitle_tooltip)?c.$headers.each(function(){a(this).removeClass(d.headerTitle_tooltip[this.column]||"")}):""!==d.headerTitle_tooltip&&c.$headers.removeClass(d.headerTitle_tooltip)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-math.min.js b/dist/js/widgets/widget-math.min.js index aa6c360b..d4b8d1a2 100644 --- a/dist/js/widgets/widget-math.min.js +++ b/dist/js/widgets/widget-math.min.js @@ -1,2 +1,2 @@ -/*! Widget: math - updated 10/31/2015 (v2.24.0) */ +/*! Widget: math - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b=a.tablesorter,c={error:{0:"Infinity result: Divide by zero",1:"Need more than one element to make this calculation",undef:"No elements found"},invalid:function(a,b,d){return console.log(b,c.error[d]),a&&a.widgetOptions.math_none||"none"},events:"tablesorter-initialized update updateAll updateRows addRows updateCell filterReset filterEnd ".split(" ").join(".tsmath "),processText:function(a,c){var d=c.attr(a.textAttribute);return"undefined"==typeof d&&(d=c[0].textContent||c.text()),d=b.formatFloat(d.replace(/[^\w,. \-()]/g,""),a.table)||0,isNaN(d)?0:d},getRow:function(b,d){var e=b.widgetOptions,f=[],g=d.closest("tr"),h=g.children().not("["+e.math_dataAttrib+"=ignore]");return g.hasClass(e.filter_filteredRow||"filtered")||(e.math_ignore.length&&(h=h.not("[data-column="+e.math_ignore.join("],[data-column=")+"]")),f=h.not(d).map(function(){return c.processText(b,a(this))}).get()),f},getColumn:function(a,b,d){var e,f,g,h,i,j=[],k=a.widgetOptions,l=k.math_dataAttrib,m=k.filter_filteredRow||"filtered",n=parseInt(b.attr("data-column"),10),o=a.$table.children("tbody").children(),p=b.closest("tr");if("above"===d)for(g=o.index(p),e=g;e>=0;)f=o.eq(e).children().filter("[data-column="+n+"]"),i=f.filter("["+l+"^=above]").length,(!o.eq(e).hasClass(m)&&o.eq(e).not("["+l+"=ignore]").length&&e!==g||i&&e!==g)&&(i?e=0:f.length&&j.push(c.processText(a,f))),e--;else if("below"===d)for(g=o.length,e=o.index(p)+1;g>e&&(f=o.eq(e).children().filter("[data-column="+n+"]"),!f.filter("["+l+"^=below]").length);e++)!o.eq(e).hasClass(m)&&o.eq(e).not("["+l+"=ignore]").length&&f.length&&j.push(c.processText(a,f));else for(h=o.not("["+l+"=ignore]"),g=h.length,e=0;g>e;e++)f=h.eq(e).children().filter("[data-column="+n+"]"),h.eq(e).hasClass(m)||!f.not("["+l+"^=above],["+l+"^=below],["+l+"^=col]").length||f.is(b)||j.push(c.processText(a,f));return j},getAll:function(b){var d,e,f,g,h,i,j,k,l=[],m=b.widgetOptions,n=m.math_dataAttrib,o=m.filter_filteredRow||"filtered",p=b.$table.children("tbody").children().not("["+n+"=ignore]");for(h=p.length,g=0;h>g;g++)if(f=p.eq(g),!f.hasClass(o))for(i=f.children().not("["+n+"=ignore]"),k=i.length,j=0;k>j;j++)d=i.eq(j),e=parseInt(d.attr("data-column"),10),!d.filter("["+n+"]").length&&a.inArray(e,m.math_ignore)<0&&l.push(c.processText(b,d));return l},setColumnIndexes:function(c){c.$table.after('
');var d=c.$table.detach();b.computeColumnIndex(d.children("tbody").children()),a("#_tablesorter_table_placeholder").after(d).remove()},recalculate:function(a,d,e){if(a&&(!d.math_isUpdating||e)){var f,g,h;a.debug&&(f=new Date),e&&c.setColumnIndexes(a),d.math_dataAttrib="data-"+(d.math_data||"math"),g=d.math_dataAttrib,h=a.$tbodies.children("tr").children("["+g+"]"),c.mathType(a,h,d.math_priority),h=a.$table.children("."+a.cssInfoBlock+", tfoot").children("tr").children("["+g+"]"),c.mathType(a,h,d.math_priority),h=a.$table.children().children("tr").children("["+g+"^=all]"),c.mathType(a,h,["all"]),d.math_isUpdating=!0,a.debug&&console[console.group?"group":"log"]("Math widget triggering an update after recalculation"),b.update(a),a.debug&&console.log("Math widget update completed"+b.benchmark(f))}},mathType:function(d,e,f){if(e.length){var g,h,i,j,k,l,m,n,o=d.widgetOptions,p=o.math_dataAttrib,q=b.equations;"all"===f[0]&&(k=c.getAll(d)),d.debug&&console[console.group?"group":"log"]("Tablesorter Math widget recalculation"),a.each(f,function(a,b){if(l=e.filter("["+p+"^="+b+"]"),n=l.length){for(d.debug&&console[console.group?"group":"log"](b),m=0;n>m;m++)i=l.eq(m),i.parent().hasClass(o.filter_filteredRow||"filtered")||(g=(i.attr(p)||"").replace(b+"-",""),j="row"===b?c.getRow(d,i):"all"===b?k:c.getColumn(d,i,b),q[g]&&(j.length?(h=q[g](j,d),d.debug&&console.log(i.attr(p),j,"=",h)):h=c.invalid(d,g,"mean"===g?0:"undef"),c.output(i,o,h,j)));d.debug&&console.groupEnd&&console.groupEnd()}}),d.debug&&console.groupEnd&&console.groupEnd()}},output:function(a,c,d,e){var f=a.attr("data-"+c.math_data+"-mask")||c.math_mask,g=b.formatMask(f,d,c.math_wrapPrefix,c.math_wrapSuffix);"function"==typeof c.math_complete&&(g=c.math_complete(a,c,g,d,e)),g!==!1&&a.html(g)}};b.formatMask=function(a,b,c,d){if(!a||isNaN(+b))return b;var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t="",u=a.length,v=a.search(/[0-9\-\+#]/),w=v>0?a.substring(0,v):"",x=w;if(v>0&&c&&(x=/\{content\}/.test(c||"")?(c||"").replace(/\{content\}/g,w||""):(c||"")+w),s=a.split("").reverse().join(""),r=s.search(/[0-9\-\+#]/),q=u-r,q+="."===a.substring(q,q+1)?1:0,w=r>0?a.substring(q,u):"",t=w,""!==w&&d&&(t=/\{content\}/.test(d||"")?(d||"").replace(/\{content\}/g,w||""):w+(d||"")),a=a.substring(v,q),b="-"==a.charAt(0)?-b:+b,e=0>b?b=-b:0,f=a.match(/[^\d\-\+#]/g),g=f&&f[f.length-1]||".",h=f&&f[1]&&f[0]||",",a=a.split(g),b=b.toFixed(a[1]&&a[1].length),b=+b+"",j=a[1]&&a[1].lastIndexOf("0"),l=b.split("."),(!l[1]||l[1]&&l[1].length<=j)&&(b=(+b).toFixed(j+1)),m=a[0].split(h),a[0]=m.join(""),i=a[0]&&a[0].indexOf("0"),i>-1)for(;l[0].lengthq;q++)o+=n.charAt(q),!((q-p+1)%k)&&u-k>q&&(o+=h);b[0]=o}return b[1]=a[1]&&b[1]?g+b[1]:"",x+((e?"-":"")+b[0]+b[1])+t},b.equations={count:function(a){return a.length},sum:function(a){var b,c=a.length,d=0;for(b=0;c>b;b++)d+=a[b];return d},mean:function(a){var c=b.equations.sum(a);return c/a.length},median:function(a,b){var d,e=a.length;return e>1?(a.sort(function(a,b){return a-b}),d=Math.floor(e/2),e%2?a[d]:(a[d-1]+a[d])/2):c.invalid(b,"median",1)},mode:function(a){var b,c,d,e={},f=1,g=[a[0]];for(b=0;bf?(g=[c],f=d):d===f&&(g.push(c),f=d);return g.sort(function(a,b){return a-b})},max:function(a){return Math.max.apply(Math,a)},min:function(a){return Math.min.apply(Math,a)},range:function(a){var b=a.sort(function(a,b){return a-b});return b[a.length-1]-b[0]},variance:function(a,d,e){for(var f,g=b.equations.mean(a),h=0,i=a.length;i--;)h+=Math.pow(a[i]-g,2);return f=a.length-(d?0:1),0===f?c.invalid(e,"variance",0):h/=f},varp:function(a,c){return b.equations.variance(a,!0,c)},vars:function(a,c){return b.equations.variance(a,!1,c)},stdevs:function(a,c){var d=b.equations.variance(a,!1,c);return Math.sqrt(d)},stdevp:function(a,c){var d=b.equations.variance(a,!0,c);return Math.sqrt(d)}},b.addWidget({id:"math",priority:100,options:{math_data:"math",math_ignore:[],math_mask:"#,##0.00",math_complete:null,math_priority:["row","above","below","col"],math_prefix:"",math_suffix:"",math_none:"N/A",math_event:"recalculate"},init:function(a,d,e,f){var g=b.hasWidget(a,"filter")?"filterEnd":"updateComplete";e.$table.off((c.events+" updateComplete.tsmath "+f.math_event).replace(/\s+/g," ")).on(c.events+" "+f.math_event,function(a){var b="tablesorter-initialized"===a.type;(!f.math_isUpdating||b)&&(/filter/.test(a.type)||c.setColumnIndexes(e),c.recalculate(e,f,b))}).on(g+".tsmath",function(){setTimeout(function(){f.math_isUpdating&&e.debug&&console.groupEnd&&console.groupEnd(),f.math_isUpdating=!1},40)}),f.math_isUpdating=!1,a.hasInitialized&&c.recalculate(e,f,!0)},remove:function(a,b,d,e){e||b.$table.off((c.events+" updateComplete.tsmath "+d.math_event).replace(/\s+/g," ")).children().children("tr").children("[data-"+d.math_data+"]").empty()}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-pager.min.js b/dist/js/widgets/widget-pager.min.js index 35e65bbc..c922905e 100644 --- a/dist/js/widgets/widget-pager.min.js +++ b/dist/js/widgets/widget-pager.min.js @@ -1,2 +1,2 @@ -/*! Widget: Pager - updated 10/31/2015 (v2.24.0) */ +/*! Widget: Pager - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b,c=a.tablesorter;c.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(a,b){return b},pager_ajaxError:null,pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(a){return[0,[],null]},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(a){b.init(a)},format:function(a,c){return c.pager&&c.pager.initialized?void b.moveToPage(a,c.pager,!1):b.initComplete(a,c)},remove:function(a,c,d,e){b.destroyPager(a,c,e)}}),b=c.pager={init:function(d){if(!(d.hasInitialized&&d.config.pager&&d.config.pager.initialized)){var e,f=d.config,g=f.widgetOptions,h=g.pager_selectors,i=f.pager=a.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:g.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:g.pager_size,setPage:g.pager_startPage},f.pager);i.isInitializing||(i.isInitializing=!0,f.debug&&console.log("Pager: Initializing"),i.size=a.data(d,"pagerLastSize")||g.pager_size,i.$container=a(h.container).addClass(g.pager_css.container).show(),i.$goto=i.$container.find(h.gotoPage),i.$size=i.$container.find(h.pageSize),i.totalRows=f.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+f.cssChildRow).length,i.oldAjaxSuccess=i.oldAjaxSuccess||g.pager_ajaxObject.success,f.appender=b.appender,i.initializing=!0,g.pager_savePages&&c.storage&&(e=c.storage(d,g.pager_storageKey)||{},i.page=(isNaN(e.page)?i.page:e.page)||i.setPage||0,i.size=(isNaN(e.size)?i.size:e.size)||i.setSize||10,a.data(d,"pagerLastSize",i.size)),i.regexRows=new RegExp("("+(g.filter_filteredRow||"filtered")+"|"+f.selectorRemove.slice(1)+"|"+f.cssChildRow+")"),i.initialized=!1,f.$table.trigger("pagerBeforeInitialized",f),b.enablePager(d,f,!1),i.ajaxObject=g.pager_ajaxObject,i.ajaxObject.url=g.pager_ajaxUrl,"string"==typeof g.pager_ajaxUrl?(i.ajax=!0,g.filter_serversideFiltering=!0,f.serverSideSorting=!0,b.moveToPage(d,i)):(i.ajax=!1,c.appendCache(f,!0)))}},initComplete:function(a,d){var e=d.pager;b.bindEvents(a,d),b.setPageSize(d,0),e.ajax||b.hideRowsSetup(a,d),e.initialized=!0,e.initializing=!1,e.isInitializing=!1,d.debug&&console.log("Pager: Triggering pagerInitialized"),d.$table.trigger("pagerInitialized",d),d.widgetOptions.filter_initialized&&c.hasWidget(a,"filter")||b.updatePageDisplay(a,d,!e.ajax)},bindEvents:function(d,e){var f,g,h=e.pager,i=e.widgetOptions,j=e.namespace+"pager",k=i.pager_selectors;e.$table.off(j).on("filterInit filterStart ".split(" ").join(j+" "),function(b,c){h.currentFilters=a.isArray(c)?c:e.$table.data("lastSearch"),"filterStart"===b.type&&i.pager_pageReset!==!1&&(e.lastCombinedFilter||"")!==(h.currentFilters||[]).join("")&&(h.page=i.pager_pageReset)}).on("filterEnd sortEnd ".split(" ").join(j+" "),function(){h.currentFilters=e.$table.data("lastSearch"),(h.initialized||h.initializing)&&(e.delayInit&&e.rowsCopy&&0===e.rowsCopy.length&&b.updateCache(d),b.updatePageDisplay(d,e,!1),c.applyWidget(d))}).on("disablePager"+j,function(a){a.stopPropagation(),b.showAllRows(d,e)}).on("enablePager"+j,function(a){a.stopPropagation(),b.enablePager(d,e,!0)}).on("destroyPager"+j,function(a,b){a.stopPropagation(),c.removeWidget(d,"pager",!1)}).on("updateComplete"+j,function(a,d,f){if(a.stopPropagation(),d&&!f&&!h.ajax){var g=e.$tbodies.eq(0).children("tr").not(e.selectorRemove);h.totalRows=g.length-(i.pager_countChildRows?0:g.filter("."+e.cssChildRow).length),h.totalPages=Math.ceil(h.totalRows/h.size),g.length&&e.rowsCopy&&0===e.rowsCopy.length&&b.updateCache(d),h.page>=h.totalPages&&b.moveToLastPage(d,h),b.hideRows(d,e),b.changeHeight(d,e),b.updatePageDisplay(d,e,!1),c.applyWidget(d),b.updatePageDisplay(d,e)}}).on("pageSize refreshComplete ".split(" ").join(j+" "),function(a,c){a.stopPropagation(),b.setPageSize(e,b.parsePageSize(e,c,"get")),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}).on("pageSet pagerUpdate ".split(" ").join(j+" "),function(a,c){a.stopPropagation(),"pagerUpdate"===a.type&&(c="undefined"==typeof c?h.page+1:c,h.last.page=!0),h.page=(parseInt(c,10)||1)-1,b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}).on("pageAndSize"+j,function(a,c,f){a.stopPropagation(),h.page=(parseInt(c,10)||1)-1,b.setPageSize(e,b.parsePageSize(e,f,"get")),b.moveToPage(d,h,!0),b.hideRows(d,e),b.updatePageDisplay(d,e,!1)}),f=[k.first,k.prev,k.next,k.last],g=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],e.debug&&!h.$container.length&&console.warn("Pager: >> Container not found"),h.$container.find(f.join(",")).attr("tabindex",0).off("click"+j).on("click"+j,function(c){c.stopPropagation();var e,j=a(this),k=f.length;if(!j.hasClass(i.pager_css.disabled))for(e=0;k>e;e++)if(j.is(f[e])){b[g[e]](d,h);break}}),h.$goto.length?h.$goto.off("change"+j).on("change"+j,function(){h.page=a(this).val()-1,b.moveToPage(d,h,!0),b.updatePageDisplay(d,e,!1)}):e.debug&&console.warn("Pager: >> Goto selector not found"),h.$size.length?(h.$size.find("option").removeAttr("selected"),h.$size.off("change"+j).on("change"+j,function(){if(!a(this).hasClass(i.pager_css.disabled)){var c=a(this).val();h.$size.val(c),b.setPageSize(e,c),b.changeHeight(d,e)}return!1})):e.debug&&console.warn("Pager: >> Size selector not found")},pagerArrows:function(a,b){var c=a.pager,d=!!b,e=d||0===c.page,f=Math.min(c.totalPages,c.filteredPages),g=d||c.page===f-1||0===f,h=a.widgetOptions,i=h.pager_selectors;h.pager_updateArrows&&(c.$container.find(i.first+","+i.prev).toggleClass(h.pager_css.disabled,e).attr("aria-disabled",e),c.$container.find(i.next+","+i.last).toggleClass(h.pager_css.disabled,g).attr("aria-disabled",g))},calcFilters:function(b,c){var d,e,f,g=c.widgetOptions,h=c.pager,i=c.$table.hasClass("hasFilters");if(i&&!g.pager_ajaxUrl)if(a.isEmptyObject(c.cache))h.filteredRows=h.totalRows=c.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+c.cssChildRow).length;else for(h.filteredRows=0,d=c.cache[0].normalized,f=d.length,e=0;f>e;e++)h.filteredRows+=h.regexRows.test(d[e][c.columns].$row[0].className)?0:1;else i||(h.filteredRows=h.totalRows)},updatePageDisplay:function(d,e,f){if(!e.pager.initializing){var g,h,i,j,k,l,m=e.widgetOptions,n=e.pager,o=e.namespace+"pager",p=b.parsePageSize(e,n.size,"get");if(m.pager_countChildRows&&h.push(e.cssChildRow),n.$size.add(n.$goto).removeClass(m.pager_css.disabled).removeAttr("disabled").attr("aria-disabled","false"),n.totalPages=Math.ceil(n.totalRows/p),e.totalRows=n.totalRows,b.parsePageNumber(n),b.calcFilters(d,e),e.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/p)||0,Math.min(n.totalPages,n.filteredPages)>=0){if(h=n.size*n.page>n.filteredRows&&f,n.page=h?m.pager_pageReset||0:n.page,n.startRow=h?n.size*n.page+1:0===n.filteredRows?0:n.size*n.page+1,n.endRow=Math.min(n.filteredRows,n.totalRows,n.size*(n.page+1)),i=n.$container.find(m.pager_selectors.pageDisplay),g=(n.ajaxData&&n.ajaxData.output?n.ajaxData.output||m.pager_output:m.pager_output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return n.totalPages?n.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,d=a.replace(/[{}\s]/g,""),e=d.split(":"),f=n.ajaxData,g=/(rows?|pages?)$/i.test(d)?0:"";return/(startRow|page)/.test(e[0])&&"input"===e[1]?(b=(""+("page"===e[0]?n.totalPages:n.totalRows)).length,c="page"===e[0]?n.page+1:n.startRow,''):e.length>1&&f&&f[e[0]]?f[e[0]][e[1]]:n[d]||(f?f[d]:g)||g}),n.$goto.length){for(h="",j=b.buildPageSelect(n,e),l=j.length,k=0;l>k;k++)h+='";n.$goto.html(h).val(n.page+1)}i.length&&(i["INPUT"===i[0].nodeName?"val":"html"](g),i.find(".ts-startRow, .ts-page").off("change"+o).on("change"+o,function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/n.size)+1:b;e.$table.trigger("pageSet"+o,[c])}))}b.pagerArrows(e),b.fixHeight(d,e),n.initialized&&f!==!1&&(e.debug&&console.log("Pager: Triggering pagerComplete"),e.$table.trigger("pagerComplete",e),m.pager_savePages&&c.storage&&c.storage(d,m.pager_storageKey,{page:n.page,size:n.size}))}},buildPageSelect:function(b,c){var d,e,f,g,h,i,j=c.widgetOptions,k=Math.min(b.totalPages,b.filteredPages)||1,l=5*Math.ceil(k/j.pager_maxOptionSize/5),m=k>j.pager_maxOptionSize,n=b.page+1,o=l,p=k-l,q=[1],r=m?l:1;for(d=r;k>=d;)q.push(d),d+=m?l:1;if(q.push(k),m){for(f=[],e=Math.max(Math.floor(j.pager_maxOptionSize/l)-1,5),o=n-e,1>o&&(o=1),p=n+e,p>k&&(p=k),d=o;p>=d;d++)f.push(d);q=a.grep(q,function(b,c){return a.inArray(b,q)===c}),h=q.length,i=f.length,h-i>l/2&&h+i>j.pager_maxOptionSize&&(g=Math.floor(h/2)-Math.floor(i/2),Array.prototype.splice.apply(q,[g,i])),q=q.concat(f)}return q=a.grep(q,function(b,c){return a.inArray(b,q)===c}).sort(function(a,b){return a-b})},fixHeight:function(b,c){var d,e,f=c.pager,g=c.widgetOptions,h=c.$tbodies.eq(0);h.find("tr.pagerSavedHeightSpacer").remove(),g.pager_fixedHeight&&!f.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-h.height(),d>5&&a.data(b,"pagerLastSize")===f.size&&h.children("tr:visible").length')))},changeHeight:function(c,d){var e,f=d.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),e=f.children("tr").eq(0).height()*d.pager.size,a.data(c,"pagerSavedHeight",e),b.fixHeight(c,d),a.data(c,"pagerLastSize",d.pager.size)},hideRows:function(a,b){if(!b.widgetOptions.pager_ajaxUrl){var d,e,f,g,h,i=b.pager,j=b.widgetOptions,k=b.$tbodies.length,l=i.page*i.size,m=l+i.size,n=j&&j.filter_filteredRow||"filtered",o=0,p=0;for(i.cacheIndex=[],d=0;k>d;d++){for(f=b.$tbodies.eq(d).children("tr"),g=f.length,h=0,o=0,p=0,e=0;g>e;e++)f[e].className.match(n)||(p===l&&f[e].className.match(b.cssChildRow)?f[e].style.display="none":(f[e].style.display=p>=l&&m>p?"":"none",o!==p&&p>=l&&m>p&&(i.cacheIndex.push(e),o=p),p+=f[e].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!j.pager_countChildRows?0:1,p===m&&"none"!==f[e].style.display&&f[e].className.match(c.css.cssHasChild)&&(h=e)));if(h>0&&f[h].className.match(c.css.cssHasChild))for(;++h> Ajax Error",g,h,i),c.showError(e,g,h,i),f.$tbodies.eq(0).children("tr").detach(),j.totalRows=0;else{if(a.isArray(B)?(n=isNaN(B[0])&&!isNaN(B[1]),x=B[n?1:0],j.totalRows=isNaN(x)?j.totalRows||0:x,f.totalRows=f.filteredRows=j.filteredRows=j.totalRows,v=0===j.totalRows?[]:B[n?0:1]||[],u=B[2]):(j.ajaxData=B,f.totalRows=j.totalRows=B.total,f.filteredRows=j.filteredRows="undefined"!=typeof B.filteredRows?B.filteredRows:B.total,u=B.headers,v=B.rows||[]),w=v&&v.length,v instanceof jQuery)k.pager_processAjaxOnInit&&(f.$tbodies.eq(0).empty(),f.$tbodies.eq(0).append(v));else if(w){for(l=0;w>l;l++){for(A+="",m=0;m"+v[l][m]+"";A+=""}k.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(A)}if(k.pager_processAjaxOnInit=!0,u&&u.length===C)for(o=z.hasClass("hasStickyHeaders"),q=o?k.$sticky.children("thead:first").children("tr").children():"",p=z.find("tfoot tr:first").children(),r=f.$headers.filter("th "),y=r.length,m=0;y>m;m++)s=r.eq(m),s.find("."+c.css.icon).length?(t=s.find("."+c.css.icon).clone(!0),s.find(".tablesorter-header-inner").html(u[m]).append(t),o&&q.length&&(t=q.eq(m).find("."+c.css.icon).clone(!0),q.eq(m).find(".tablesorter-header-inner").html(u[m]).append(t))):(s.find(".tablesorter-header-inner").html(u[m]),o&&q.length&&q.eq(m).find(".tablesorter-header-inner").html(u[m])),p.eq(m).html(u[m])}f.showProcessing&&c.isProcessing(e),j.totalPages=Math.ceil(j.totalRows/b.parsePageSize(f,j.size,"get")),j.last.totalRows=j.totalRows,j.last.currentFilters=j.currentFilters,j.last.sortList=(f.sortList||[]).join(","),j.initializing=!1,b.updatePageDisplay(e,f,!1),c.updateCache(f,function(){j.initialized&&setTimeout(function(){f.debug&&console.log("Pager: Triggering pagerChange"),z.trigger("pagerChange",j),c.applyWidget(e),b.updatePageDisplay(e,f)},0)})}j.initialized||c.applyWidget(e)},getAjax:function(d,e){var f,g=b.getAjaxUrl(d,e),h=a(document),i=e.namespace+"pager",j=e.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError"+i,function(a,c,f,g){b.renderAjax(null,d,e,c,f,g),h.off("ajaxError"+i)}),f=++j.ajaxCounter,j.last.ajaxUrl=g,j.ajaxObject.url=g,j.ajaxObject.success=function(a,c,g){fd;d++)m.push(k+"["+i[d][0]+"]="+i[d][1]);h=h.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):k),m=[]}if(l){for(l=l[1],e=j.length,d=0;e>d;d++)j[d]&&m.push(l+"["+d+"]="+encodeURIComponent(j[d]));h=h.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),f.currentFilters=j}return a.isFunction(g.pager_customAjaxUrl)&&(h=g.pager_customAjaxUrl(b,h)),c.debug&&console.log("Pager: Ajax url = "+h),h},renderTable:function(a,d){var e,f,g,h,i=a.config,j=i.pager,k=i.widgetOptions,l=i.$table.hasClass("hasFilters"),m=d&&d.length||0,n=j.page*j.size,o=j.size;if(1>m)return void(i.debug&&console.warn("Pager: >> No rows for pager to render"));if(j.page>=j.totalPages)return b.moveToLastPage(a,j);if(j.cacheIndex=[],j.isDisabled=!1,j.initialized&&(i.debug&&console.log("Pager: Triggering pagerChange"),i.$table.trigger("pagerChange",i)),k.pager_removeRows){for(c.clearTableBody(a),e=c.processTbody(a,i.$tbodies.eq(0),!0),f=l?0:n,g=l?0:n,h=0;o>h&&fn&&o>=h&&(h++,j.cacheIndex.push(f),e.append(d[f]))),f++;c.processTbody(a,e,!1)}else b.hideRows(a,i);b.updatePageDisplay(a,i),k.pager_startPage=j.page,k.pager_size=j.size,a.isUpdating&&(i.debug&&console.log("Pager: Triggering updateComplete"),i.$table.trigger("updateComplete",[a,!0]))},showAllRows:function(d,e){var f,g,h,i=e.pager,j=e.widgetOptions;for(i.ajax?b.pagerArrows(e,!0):(a.data(d,"pagerLastPage",i.page),a.data(d,"pagerLastSize",i.size),i.page=0,i.size=i.totalRows,i.totalPages=1,e.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(d,e.rowsCopy),i.isDisabled=!0,c.applyWidget(d),e.debug&&console.log("Pager: Disabled")),g=i.$size.add(i.$goto).add(i.$container.find(".ts-startRow, .ts-page ")),h=g.length,f=0;h>f;f++)g.eq(f).attr("aria-disabled","true").addClass(j.pager_css.disabled)[0].disabled=!0},updateCache:function(d){var e=d.config,f=e.pager;c.updateCache(e,function(){if(!a.isEmptyObject(d.config.cache)){var c,g=[],h=d.config.cache[0].normalized;for(f.totalRows=h.length,c=0;cb&&0!==a.page&&(a.page=b),a.page},setPageSize:function(c,d){var e=c.pager,f=c.table;e.size=b.parsePageSize(c,d,"get"),e.$size.val(b.parsePageSize(c,e.size,"set")),a.data(f,"pagerLastPage",b.parsePageNumber(e)),a.data(f,"pagerLastSize",e.size),e.totalPages=Math.ceil(e.totalRows/e.size),e.filteredPages=Math.ceil(e.filteredRows/e.size),b.moveToPage(f,e,!0)},moveToFirstPage:function(a,c){c.page=0,b.moveToPage(a,c,!0)},moveToLastPage:function(a,c){c.page=Math.min(c.totalPages,c.filteredPages)-1,b.moveToPage(a,c,!0)},moveToNextPage:function(a,c){c.page++,c.page>=Math.min(c.totalPages,c.filteredPages)-1&&(c.page=Math.min(c.totalPages,c.filteredPages)-1),b.moveToPage(a,c,!0)},moveToPrevPage:function(a,c){c.page--,c.page<=0&&(c.page=0),b.moveToPage(a,c,!0)},destroyPager:function(a,d,e){var f=d.pager,g=d.widgetOptions.pager_selectors,h=[g.first,g.prev,g.next,g.last,g.gotoPage,g.pageSize].join(","),i=d.namespace+"pager";f.initialized=!1,d.$table.off(i),f.$container.hide().find(h).off(i),e||(b.showAllRows(a,d),d.appender=null,c.storage&&c.storage(a,d.widgetOptions.pager_storageKey,""),delete a.config.pager,delete a.config.rowsCopy)},enablePager:function(d,e,f){var g,h,i=e.pager;i.isDisabled=!1,i.page=a.data(d,"pagerLastPage")||i.page||0,h=i.$size.find("option[selected]").val(),i.size=a.data(d,"pagerLastSize")||b.parsePageSize(e,h,"get"),i.$size.val(b.parsePageSize(e,i.size,"set")),i.totalPages=Math.ceil(Math.min(i.totalRows,i.filteredRows)/i.size),e.$table.removeClass("pagerDisabled"),d.id&&(g=d.id+"_pager_info",i.$container.find(e.widgetOptions.pager_selectors.pageDisplay).attr("id",g),e.$table.attr("aria-describedby",g)),b.changeHeight(d,e),f&&(c.update(e),b.setPageSize(e,i.size),b.hideRowsSetup(d,e),e.debug&&console.log("Pager: Enabled"))},appender:function(c,d){var e=c.config,f=e.widgetOptions,g=e.pager;g.ajax?b.moveToPage(c,g,!0):(e.rowsCopy=d,g.totalRows=f.pager_countChildRows?e.$tbodies.eq(0).children("tr").length:d.length,g.size=a.data(c,"pagerLastSize")||g.size||f.pager_size||g.setSize||10,g.totalPages=Math.ceil(g.totalRows/g.size),b.moveToPage(c,g),b.updatePageDisplay(c,e,!1))}},c.showError=function(b,c,d,e){var f,g=a(b),h=g[0].config,i=h&&h.widgetOptions,j=h.pager&&h.pager.cssErrorRow||i&&i.pager_css&&i.pager_css.errorRow||"tablesorter-errorRow",k=typeof c,l=!0,m="",n=function(){h.$table.find("thead").find("."+j).remove()};if(!g.length)return void console.error("tablesorter showError: no table parameter passed");if("function"==typeof h.pager.ajaxError){if(l=h.pager.ajaxError(h,c,d,e),l===!1)return n();m=l}else if("function"==typeof i.pager_ajaxError){if(l=i.pager_ajaxError(h,c,d,e),l===!1)return n();m=l}if(""===m)if("object"===k)m=0===c.status?"Not connected, verify Network":404===c.status?"Requested page not found [404]":500===c.status?"Internal Server Error [500]":"parsererror"===e?"Requested JSON parse failed":"timeout"===e?"Time out error":"abort"===e?"Ajax Request aborted":"Uncaught error: "+c.statusText+" ["+c.status+"]";else{if("string"!==k)return n();m=c}f=a(/tr\>/.test(m)?m:''+m+"").click(function(){a(this).remove()}).appendTo(h.$table.find("thead:first")).addClass(j+" "+h.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"})}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-sort2Hash.min.js b/dist/js/widgets/widget-sort2Hash.min.js index 490c59f5..01a66f63 100644 --- a/dist/js/widgets/widget-sort2Hash.min.js +++ b/dist/js/widgets/widget-sort2Hash.min.js @@ -1,2 +1,2 @@ -/*! Widget: sort2Hash (BETA) - updated 11/8/2015 (v2.24.4) */ +/*! Widget: sort2Hash (BETA) - updated 11/10/2015 (v2.24.4) */ !function(a){"use strict";var b=a.tablesorter||{},c=b.sort2Hash={init:function(d,e){var f,g,h,i,j=d.table,k=d.pager,l=b.hasWidget(j,"saveSort"),m=c.decodeHash(d,e,"sort");(m&&!l||m&&l&&e.sort2Hash_overrideSaveSort)&&c.convertString2Sort(d,e,m),b.hasWidget(d.table,"pager")&&(g=parseInt(c.decodeHash(d,e,"page"),10),h=k.page=0>g?0:g>k.totalPages?k.totalPages-1:g,i=k.size=parseInt(c.decodeHash(d,e,"size"),10)),b.hasWidget(j,"filter")&&(f=c.decodeHash(d,e,"filter"),f&&(f=f.split(e.sort2Hash_separator),d.$table.one("tablesorter-ready",function(){setTimeout(function(){d.$table.one("filterEnd",function(){a(this).trigger("pageAndSize",[h,i])}),a.tablesorter.setFilters(j,f,!0)},100)}))),f||d.$table.one("tablesorter-ready",function(){d.$table.trigger("pageAndSize",[h,i])}),d.$table.on("sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash",function(){this.hasInitialized&&c.setHash(this.config,this.config.widgetOptions)})},getTableId:function(b,c){return c.sort2Hash_tableId||b.table.id||"table"+a("table").index(b.$table)},regexEscape:function(a){return a.replace(/([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g,"\\$1")},convertString2Sort:function(a,b,d){for(var e,f,g,h,i,j,k=d.split(b.sort2Hash_separator),l=0,m=k.length,n=[];m>l;){if(f=k[l++],h=parseInt(f,10),isNaN(h)||h>a.columns)for(e=new RegExp("("+c.regexEscape(f)+")","i"),i=0;i-1?1:0),n.push([f,g]))}n.length&&(a.sortList=n)},convertSort2String:function(b,c){var d,e,f,g,h=[],i=b.sortList||[],j=i.length;for(d=0;j>d;d++)f=i[d][0],e=a.trim(b.$headerIndexed[f].attr(c.sort2Hash_headerTextAttr)),h.push(""!==e?encodeURIComponent(e):f),g=c.sort2Hash_directionText[i[d][1]],h.push(g);return h.join(c.sort2Hash_separator)},convertFilter2String:function(b,c){var d,e,f,g,h=[],i=b.sortList||[],j=i.length;for(d=0;j>d;d++)f=i[d][0],e=a.trim(b.$headerIndexed[f].attr(c.sort2Hash_headerTextAttr)),f="undefined"!=typeof e?encodeURIComponent(e):f,h.push(f),g=c.sort2Hash_directionText[i[d][1]],h.push(g);return h.join(c.sort2Hash_separator)},getParam:function(a,b,d){b||(b=window.location.hash);var e=new RegExp("[\\?&]"+c.regexEscape(a)+"=([^&#]*)"),f=e.exec(b);return d?e:null===f?"":decodeURIComponent(f[1])},removeParam:function(a,b){b||(b=window.location.hash);var d,e=c.getParam(a,b,!0),f=[],g=b.split("&"),h=g.length;for(d=0;h>d;d++)e.test("&"+g[d])||f.push(g[d]);return f.length?f.join("&"):""},encodeHash:function(a,b,d,e,f){var g=!1,h=c.getTableId(a,b);return"function"==typeof b.sort2Hash_encodeHash&&(g=b.sort2Hash_encodeHash(a,h,d,e,f||e)),g===!1&&(g="&"+d+"["+h+"]="+e),g},decodeHash:function(a,b,d){var e=!1,f=c.getTableId(a,b);return"function"==typeof b.sort2Hash_decodeHash&&(e=b.sort2Hash_decodeHash(a,f,d)),e===!1&&(e=c.getParam(d+"["+f+"]")),e||""},cleanHash:function(a,b,d,e){var f=!1,g=c.getTableId(a,b);return"function"==typeof b.sort2Hash_cleanHash&&(f=b.sort2Hash_cleanHash(a,g,d,e)),f===!1&&(f=c.removeParam(d+"["+g+"]",e)),f||""},setHash:function(d,e){var f="",g=window.location.hash,h=b.hasWidget(d.table,"pager"),i=b.hasWidget(d.table,"filter"),j=c.convertSort2String(d,e),k=i&&""!==d.lastSearch.join("")?d.lastSearch:[],l=encodeURIComponent(k.join(d.widgetOptions.sort2Hash_separator)),m={sort:j?c.encodeHash(d,e,"sort",j,d.sortList):"",page:h?c.encodeHash(d,e,"page",d.pager.page+1):"",size:h?c.encodeHash(d,e,"size",d.pager.size):"",filter:l?c.encodeHash(d,e,"filter",l,k):""};a.each(m,function(a,b){g=c.cleanHash(d,e,a,g),f+=b}),window.location.hash=((window.location.hash||"").replace("#","").length?g:e.sort2Hash_hash)+f}};b.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!1},init:function(a,b,d,e){c.init(d,e)},remove:function(a,b){b.$table.off(".sort2hash")}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-toggle.min.js b/dist/js/widgets/widget-toggle.min.js index e7e64344..99aba5e6 100644 --- a/dist/js/widgets/widget-toggle.min.js +++ b/dist/js/widgets/widget-toggle.min.js @@ -1,4 +1,4 @@ -/*! tablesorter enable/disable sort & filter (BETA) - 11/8/2015 (v2.24.4) +/*! tablesorter enable/disable sort & filter (BETA) - 11/10/2015 (v2.24.4) * Requires tablesorter v2.24.4+ & jQuery 1.7+ * by Rob Garrison */ diff --git a/docs/index.html b/docs/index.html index 923d7e3e..5f1a1066 100644 --- a/docs/index.html +++ b/docs/index.html @@ -457,7 +457,7 @@
  • Column selector widget (v2.15; v2.24.0).
  • Content editable widget (v2.9; v2.24.0).
  • Beta Dragtable mod - (jQuery UI widget for column reordering [ref]; v2.24.0).
  • -
  • Filter widget (v2.24.3): +
  • Filter widget (v2.24.4):
    • basic (v2.0.18; v2.23.5).
    • external option (match any column) (v2.13.3; v2.22.0).
    • @@ -474,13 +474,13 @@
    • Beta Formatter widget (v2.19.1).
    • Grouping rows widget:
    • Header titles widget (v2.15.6; v2.24.4).
    • Beta Lazyload widget (v2.24.0).
    • -
    • Math widget (v2.16; v2.24.0).
    • +
    • Math widget (v2.16; v2.24.4).
    • Output widget (v2.16; v2.24.0).

      diff --git a/js/jquery.tablesorter.combined.js b/js/jquery.tablesorter.combined.js index d30cd7dc..1759f4fb 100644 --- a/js/jquery.tablesorter.combined.js +++ b/js/jquery.tablesorter.combined.js @@ -4,7 +4,7 @@ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██ █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀ */ -/*! tablesorter (FORK) - updated 11-06-2015 (v2.24.3)*/ +/*! tablesorter (FORK) - updated 11-10-2015 (v2.24.4)*/ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ (function(factory) { if (typeof define === 'function' && define.amd) { @@ -16,7 +16,7 @@ } }(function($) { -/*! TableSorter (FORK) v2.24.3 *//* +/*! TableSorter (FORK) v2.24.4 *//* * Client-side table sorting with ease! * @requires jQuery v1.2.6+ * @@ -39,7 +39,7 @@ 'use strict'; var ts = $.tablesorter = { - version : '2.24.3', + version : '2.24.4', parsers : [], widgets : [], @@ -157,12 +157,13 @@ // labels applied to sortable headers for accessibility (aria) support 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' + sortAsc : 'Ascending sort applied, ', + sortDesc : 'Descending sort applied, ', + sortNone : 'No sort applied, ', + sortDisabled : 'sorting is disabled', + nextAsc : 'activate to apply an ascending sort', + nextDesc : 'activate to apply a descending sort', + nextNone : 'activate to remove the sort' }, regex : { @@ -1011,7 +1012,7 @@ ▀████▀ ██ █████▀ ██ ██ ██ ██████ */ setHeadersCss : function( c ) { - var $sorted, header, indx, column, $header, nextSort, txt, tmp, + var $sorted, indx, column, list = c.sortList, len = list.length, none = ts.css.sortNone + ' ' + c.cssNone, @@ -1079,50 +1080,62 @@ } // add verbose aria labels len = c.$headers.length; - $headers = c.$headers.not( '.sorter-false' ); for ( indx = 0; indx < len; indx++ ) { - $header = $headers.eq( indx ); - if ( $header.length ) { - header = $headers[ indx ]; - column = parseInt( $header.attr( 'data-column' ), 10 ); - nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + ts.setColumnAriaLabel( c, c.$headers.eq( indx ) ); + } + }, + + // nextSort (optional), lets you disable next sort text + setColumnAriaLabel : function( c, $header, nextSort ) { + if ( $header.length ) { + var column = parseInt( $header.attr( 'data-column' ), 10 ), tmp = $header.hasClass( ts.css.sortAsc ) ? 'sortAsc' : - $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone'; - txt = $.trim( $header.text() ) + ': ' + - ts.language[ tmp ] + - ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; - $header.attr( 'aria-label', txt ); + $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone', + txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ]; + if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) { + txt += ts.language.sortDisabled; + } else { + nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ]; + // if nextSort + txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; } + $header.attr( 'aria-label', txt ); } }, updateHeader : function( c ) { - var index, isDisabled, $th, col, + var index, isDisabled, $header, col, table = c.table, len = c.$headers.length; for ( index = 0; index < len; index++ ) { - $th = c.$headers.eq( index ); + $header = c.$headers.eq( index ); col = ts.getColumnData( table, c.headers, index, true ); // add 'sorter-false' class if 'parser-false' is set - isDisabled = ts.getData( $th, col, 'sorter' ) === 'false' || ts.getData( $th, col, 'parser' ) === 'false'; - $th[ 0 ].sortDisabled = isDisabled; - $th[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ).attr( 'aria-disabled', '' + isDisabled ); - // disable tab index on disabled cells - if ( c.tabIndex ) { - if ( isDisabled ) { - $th.removeAttr( 'tabindex' ); - } else { - $th.attr( 'tabindex', '0' ); - } + isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false'; + ts.setColumnSort( c, $header, isDisabled ); + } + }, + + setColumnSort : function( c, $header, isDisabled ) { + var id = c.table.id; + $header[ 0 ].sortDisabled = isDisabled; + $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' ) + .attr( 'aria-disabled', '' + isDisabled ); + // disable tab index on disabled cells + if ( c.tabIndex ) { + if ( isDisabled ) { + $header.removeAttr( 'tabindex' ); + } else { + $header.attr( 'tabindex', '0' ); } - // aria-controls - requires table ID - if ( table.id ) { - if ( isDisabled ) { - $th.removeAttr( 'aria-controls' ); - } else { - $th.attr( 'aria-controls', table.id ); - } + } + // aria-controls - requires table ID + if ( id ) { + if ( isDisabled ) { + $header.removeAttr( 'aria-controls' ); + } else { + $header.attr( 'aria-controls', id ); } } }, @@ -2184,14 +2197,14 @@ // *** Process table *** // add processing indicator - isProcessing : function( $table, toggle, $ths ) { + isProcessing : function( $table, toggle, $headers ) { $table = $( $table ); var c = $table[ 0 ].config, // default to all headers - $header = $ths || $table.find( '.' + ts.css.header ); + $header = $headers || $table.find( '.' + ts.css.header ); if ( toggle ) { - // don't use sortList if custom $ths used - if ( typeof $ths !== 'undefined' && c.sortList.length > 0 ) { + // don't use sortList if custom $headers used + if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) { // get headers from the sortList $header = $header.filter( function() { // get data-column from attr to keep compatibility with jQuery 1.2.6 @@ -2983,13 +2996,13 @@ })(jQuery); -/*! Widget: filter - updated 11/4/2015 (v2.24.3) *//* +/*! Widget: filter - updated 11/10/2015 (v2.24.4) *//* * Requires tablesorter v2.8+ and jQuery 1.7+ * by Rob Garrison */ ;( function ( $ ) { 'use strict'; - var tsf, + var tsf, tsfRegex, ts = $.tablesorter || {}, tscss = ts.css; @@ -3095,20 +3108,21 @@ // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class ) types: { or : function( c, data, vars ) { - if ( tsf.regex.orTest.test( data.iFilter ) || tsf.regex.orSplit.test( data.filter ) ) { + // look for "|", but not if it is inside of a regular expression + if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) && + // this test for regex has potential to slow down the overall search + !tsfRegex.regex.test( data.filter ) ) { var indx, filterMatched, query, regex, // duplicate data but split filter data2 = $.extend( {}, data ), - index = data.index, - parsed = data.parsed[ index ], - filter = data.filter.split( tsf.regex.orSplit ), - iFilter = data.iFilter.split( tsf.regex.orSplit ), + filter = data.filter.split( tsfRegex.orSplit ), + iFilter = data.iFilter.split( tsfRegex.orSplit ), len = filter.length; for ( indx = 0; indx < len; indx++ ) { data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], index, parsed ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], index, parsed ) || '' ); - query = '(' + ( tsf.parseFilter( c, data2.filter, index, parsed ) || '' ) + ')'; + data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); + data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); + query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')'; try { // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search, // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group @@ -3130,22 +3144,20 @@ }, // Look for an AND or && operator ( logical and ) and : function( c, data, vars ) { - if ( tsf.regex.andTest.test( data.filter ) ) { + if ( tsfRegex.andTest.test( data.filter ) ) { var indx, filterMatched, result, query, regex, // duplicate data but split filter data2 = $.extend( {}, data ), - index = data.index, - parsed = data.parsed[ index ], - filter = data.filter.split( tsf.regex.andSplit ), - iFilter = data.iFilter.split( tsf.regex.andSplit ), + filter = data.filter.split( tsfRegex.andSplit ), + iFilter = data.iFilter.split( tsfRegex.andSplit ), len = filter.length; for ( indx = 0; indx < len; indx++ ) { data2.nestedFilters = true; - data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], index, parsed ) || '' ); - data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], index, parsed ) || '' ); - query = ( '(' + ( tsf.parseFilter( c, data2.filter, index, parsed ) || '' ) + ')' ) + data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' ); + data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' ); + query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' ) // replace wild cards since /(a*)/i will match anything - .replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ); + .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ); try { // use try/catch just in case RegExp is invalid regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' ); @@ -3167,10 +3179,10 @@ }, // Look for regex regex: function( c, data ) { - if ( tsf.regex.regex.test( data.filter ) ) { + if ( tsfRegex.regex.test( data.filter ) ) { var matches, // cache regex per column for optimal speed - regex = data.filter_regexCache[ data.index ] || tsf.regex.regex.exec( data.filter ), + regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ), isRegex = regex instanceof RegExp; try { if ( !isRegex ) { @@ -3189,18 +3201,17 @@ // Look for operators >, >=, < or <= operators: function( c, data ) { // ignore empty strings... because '' < 10 is true - if ( tsf.regex.operTest.test( data.iFilter ) && data.iExact !== '' ) { + if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) { var cachedValue, result, txt, table = c.table, - index = data.index, - parsed = data.parsed[index], - query = ts.formatFloat( data.iFilter.replace( tsf.regex.operators, '' ), table ), - parser = c.parsers[index], + parsed = data.parsed[ data.index ], + query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ), + parser = c.parsers[ data.index ], savedSearch = query; // parse filter value in case we're comparing numbers ( dates ) if ( parsed || parser.type === 'numeric' ) { - txt = $.trim( '' + data.iFilter.replace( tsf.regex.operators, '' ) ); - result = tsf.parseFilter( c, txt, index, true ); + txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) ); + result = tsf.parseFilter( c, txt, data, true ); query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query; } // iExact may be numeric - see issue #149; @@ -3212,10 +3223,10 @@ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact; cachedValue = ts.formatFloat( txt, table ); } - if ( tsf.regex.gtTest.test( data.iFilter ) ) { - result = tsf.regex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; - } else if ( tsf.regex.ltTest.test( data.iFilter ) ) { - result = tsf.regex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; + if ( tsfRegex.gtTest.test( data.iFilter ) ) { + result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query; + } else if ( tsfRegex.ltTest.test( data.iFilter ) ) { + result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query; } // keep showing all rows if nothing follows the operator if ( !result && savedSearch === '' ) { @@ -3227,13 +3238,13 @@ }, // Look for a not match notMatch: function( c, data ) { - if ( tsf.regex.notTest.test( data.iFilter ) ) { + if ( tsfRegex.notTest.test( data.iFilter ) ) { var indx, txt = data.iFilter.replace( '!', '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; - if ( tsf.regex.exact.test( filter ) ) { + filter = tsf.parseFilter( c, txt, data ) || ''; + if ( tsfRegex.exact.test( filter ) ) { // look for exact not matches - see #628 - filter = filter.replace( tsf.regex.exact, '' ); + filter = filter.replace( tsfRegex.exact, '' ); return filter === '' ? true : $.trim( filter ) !== data.iExact; } else { indx = data.iExact.search( $.trim( filter ) ); @@ -3245,29 +3256,29 @@ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric exact: function( c, data ) { /*jshint eqeqeq:false */ - if ( tsf.regex.exact.test( data.iFilter ) ) { - var txt = data.iFilter.replace( tsf.regex.exact, '' ), - filter = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + if ( tsfRegex.exact.test( data.iFilter ) ) { + var txt = data.iFilter.replace( tsfRegex.exact, '' ), + filter = tsf.parseFilter( c, txt, data ) || ''; return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; } return null; }, // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu! range : function( c, data ) { - if ( tsf.regex.toTest.test( data.iFilter ) ) { + if ( tsfRegex.toTest.test( data.iFilter ) ) { var result, tmp, range1, range2, table = c.table, index = data.index, parsed = data.parsed[index], // make sure the dash is for a range and not indicating a negative number - query = data.iFilter.split( tsf.regex.toSplit ); + query = data.iFilter.split( tsfRegex.toSplit ); tmp = query[0].replace( ts.regex.nondigit, '' ) || ''; - range1 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); tmp = query[1].replace( ts.regex.nondigit, '' ) || ''; - range2 = ts.formatFloat( tsf.parseFilter( c, tmp, index, parsed ), table ); + range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table ); // parse filter value in case we're comparing numbers ( dates ) - if ( parsed || c.parsers[index].type === 'numeric' ) { + if ( parsed || c.parsers[ index ].type === 'numeric' ) { result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index ); range1 = ( result !== '' && !isNaN( result ) ) ? result : range1; result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index ); @@ -3288,18 +3299,16 @@ }, // Look for wild card: ? = single, * = multiple, or | = logical OR wild : function( c, data ) { - if ( tsf.regex.wildOrTest.test( data.iFilter ) ) { - var index = data.index, - parsed = data.parsed[ index ], - query = '' + ( tsf.parseFilter( c, data.iFilter, index, parsed ) || '' ); + if ( tsfRegex.wildOrTest.test( data.iFilter ) ) { + var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' ); // look for an exact match with the 'or' unless the 'filter-match' class is found - if ( !tsf.regex.wildTest.test( query ) && data.nestedFilters ) { + if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) { query = data.isMatch ? query : '^(' + query + ')$'; } // parsing the filter may not work properly when using wildcards =/ try { return new RegExp( - query.replace( tsf.regex.wild01, '\\S{1}' ).replace( tsf.regex.wild0More, '\\S*' ), + query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ), c.widgetOptions.filter_ignoreCase ? 'i' : '' ) .test( data.exact ); @@ -3311,21 +3320,18 @@ }, // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license ) fuzzy: function( c, data ) { - if ( tsf.regex.fuzzyTest.test( data.iFilter ) ) { + if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) { var indx, patternIndx = 0, len = data.iExact.length, txt = data.iFilter.slice( 1 ), - pattern = tsf.parseFilter( c, txt, data.index, data.parsed[data.index] ) || ''; + pattern = tsf.parseFilter( c, txt, data ) || ''; for ( indx = 0; indx < len; indx++ ) { if ( data.iExact[ indx ] === pattern[ patternIndx ] ) { patternIndx += 1; } } - if ( patternIndx === pattern.length ) { - return true; - } - return false; + return patternIndx === pattern.length; } return null; } @@ -3338,8 +3344,7 @@ and : 'and' }, ts.language ); - var options, string, txt, $header, column, filters, val, fxn, noSelect, - regex = tsf.regex; + var options, string, txt, $header, column, filters, val, fxn, noSelect; c.$table.addClass( 'hasFilters' ); // define timers so using clearTimeout won't cause an undefined error @@ -3350,8 +3355,8 @@ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]'; wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]'; - val = '\\{' + tsf.regex.query + '\\}'; - $.extend( regex, { + val = '\\{' + tsfRegex.query + '\\}'; + $.extend( tsfRegex, { child : new RegExp( c.cssChildRow ), filtered : new RegExp( wo.filter_filteredRow ), alreadyFiltered : new RegExp( '(\\s+(' + ts.language.or + '|-|' + ts.language.to + ')\\s+)', 'i' ), @@ -3629,8 +3634,10 @@ c.$table.data( 'lastSearch', filters ); return filters; }, - parseFilter: function( c, filter, column, parsed ) { - return parsed ? c.parsers[column].format( filter, c.table, [], column ) : filter; + parseFilter: function( c, filter, data, parsed ) { + return parsed || data.parsed[ data.index ] ? + c.parsers[ data.index ].format( filter, c.table, [], data.index ) : + filter; }, buildRow: function( table, c, wo ) { var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp, @@ -3882,8 +3889,8 @@ }, defaultFilter: function( filter, mask ) { if ( filter === '' ) { return filter; } - var regex = tsf.regex.iQuery, - maskLen = mask.match( tsf.regex.igQuery ).length, + var regex = tsfRegex.iQuery, + maskLen = mask.match( tsfRegex.igQuery ).length, query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ], len = query.length - 1, indx = 0, @@ -3980,9 +3987,8 @@ return filterMatched; }, processRow: function( c, data, vars ) { - var hasSelect, result, val, filterMatched, + var result, filterMatched, fxn, ffxn, txt, - regex = tsf.regex, wo = c.widgetOptions, showRow = true, @@ -4061,7 +4067,7 @@ result = data.rawArray[ columnIndex ] || ''; data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405 } - data.iExact = !regex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? + data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact; data.isMatch = c.$headerIndexed[ data.index ].hasClass( 'filter-match' ); @@ -4079,21 +4085,13 @@ data.filter = ts.replaceAccents( data.filter ); } - val = true; - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) { - data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] ); - // val is used to indicate that a filter select is using a default filter; - // so we override the exact & partial matches - val = false; - } // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ), // data.filter = case sensitive data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter; fxn = vars.functions[ columnIndex ]; - hasSelect = c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' ); filterMatched = null; - if ( fxn || ( hasSelect && val ) ) { - if ( fxn === true || hasSelect ) { + if ( fxn ) { + if ( fxn === true ) { // default selector uses exact match unless 'filter-match' class is found filterMatched = data.isMatch ? // data.iExact may be a number @@ -4119,7 +4117,7 @@ // Look for match, and add child row data for matching } else { txt = ( data.iExact + data.childRowText ) - .indexOf( tsf.parseFilter( c, data.iFilter, columnIndex, data.parsed[ columnIndex ] ) ); + .indexOf( tsf.parseFilter( c, data.iFilter, data ) ); result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) ); } } else { @@ -4139,7 +4137,6 @@ isChild, childRow, lastSearch, showRow, showParent, time, val, indx, notFiltered, searchFiltered, query, injected, res, id, txt, storedFilters = $.extend( [], filters ), - regex = tsf.regex, c = table.config, wo = c.widgetOptions, // data object passed to filters; anyMatch is a flag for the filters @@ -4221,7 +4218,7 @@ ); if ( wo.filter_columnAnyMatch ) { // specific columns search - query = data.anyMatchFilter.split( regex.andSplit ); + query = data.anyMatchFilter.split( tsfRegex.andSplit ); injected = false; for ( indx = 0; indx < query.length; indx++ ) { res = query[ indx ].split( ':' ); @@ -4256,12 +4253,12 @@ // there are no changes from beginning of filter val.indexOf( lastSearch[indx] || '' ) === 0 && // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string - !regex.alreadyFiltered.test( val ) && + !tsfRegex.alreadyFiltered.test( val ) && // if we are not doing exact matches, using '|' ( logical or ) or not '!' - !regex.exactTest.test( val ) && + !tsfRegex.exactTest.test( val ) && // don't search only filtered if the value is negative // ( '> -10' => '> -100' will ignore hidden rows ) - !( regex.isNeg1.test( val ) || regex.isNeg2.test( val ) ) && + !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) && // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593 !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length && !c.$headerIndexed[indx].hasClass( 'filter-match' ) ); @@ -4279,7 +4276,7 @@ // replace accents data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter ); } - if ( wo.filter_defaultFilter && regex.iQuery.test( vars.defaultAnyFilter ) ) { + if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) { data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter ); // clear search filtered flag because default filters are not saved to the last search searchFiltered = false; @@ -4296,9 +4293,9 @@ txt = $rows[ rowIndex ].className; // the first row can never be a child row - isChild = rowIndex && regex.child.test( txt ); + isChild = rowIndex && tsfRegex.child.test( txt ); // skip child rows & already filtered rows - if ( isChild || ( searchFiltered && regex.filtered.test( txt ) ) ) { + if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) { continue; } @@ -4408,7 +4405,6 @@ // custom select source function for a SPECIFIC COLUMN arry = fxn( table, column, onlyAvail ); } - if ( arry === false ) { // fall back to original method arry = tsf.getOptions( table, column, onlyAvail ); @@ -4422,18 +4418,19 @@ return false; } table = $( table )[0]; - var cts, txt, indx, len, + var cts, txt, indx, len, parsedTxt, str, c = table.config, validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns, parsed = []; - // get unique elements and sort the list // if $.tablesorter.sortText exists ( not in the original tablesorter ), // then natural sort the list otherwise use a basic sort arry = $.grep( arry, function( value, indx ) { + if ( value.text ) { + return true; + } return $.inArray( value, arry ) === indx; }); - if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) { // unsorted select options return arry; @@ -4442,22 +4439,30 @@ // parse select option values for ( indx = 0; indx < len; indx++ ) { txt = arry[ indx ]; + // check for object + str = txt.text ? txt.text : txt; + // sortNatural breaks if you don't pass it strings + parsedTxt = ( validColumn && c.parsers && c.parsers.length && + c.parsers[ column ].format( str, table, [], column ) || str ).toString(); + parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt; // parse array data using set column parser; this DOES NOT pass the original // table cell to the parser format function - parsed.push({ - t : txt, - // check parser length - fixes #934 - p : validColumn && c.parsers && c.parsers.length && - c.parsers[ column ].format( txt, table, [], column ) || txt - }); + if ( txt.text ) { + txt.parsed = parsedTxt; + parsed.push( txt ); + } else { + parsed.push({ + text : txt, + // check parser length - fixes #934 + parsed : parsedTxt + }); + } } - // sort parsed select options cts = c.textSorter || ''; parsed.sort( function( a, b ) { - // sortNatural breaks if you don't pass it strings - var x = a.p.toString(), - y = b.p.toString(); + var x = a.parsed, + y = b.parsed; if ( validColumn && typeof cts === 'function' ) { // custom OVERALL text sorter return cts( x, y, true, column, table ); @@ -4475,7 +4480,7 @@ arry = []; len = parsed.length; for ( indx = 0; indx < len; indx++ ) { - arry.push( parsed[indx].t ); + arry.push( parsed[indx] ); } return arry; } @@ -4535,7 +4540,7 @@ return; } - var indx, val, txt, t, $filters, $filter, + var indx, val, txt, t, $filters, $filter, option, c = table.config, wo = c.widgetOptions, node = c.$headerIndexed[ column ], @@ -4560,23 +4565,45 @@ if ( $.isArray( arry ) ) { // build option list for ( indx = 0; indx < arry.length; indx++ ) { - txt = arry[indx] = ( '' + arry[indx] ).replace( tsf.regex.quote, '"' ); - val = txt; - // allow including a symbol in the selectSource array - // 'a-z|A through Z' so that 'a-z' becomes the option value - // and 'A through Z' becomes the option text - if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) { - t = txt.split( wo.filter_selectSourceSeparator ); - val = t[0]; - txt = t[1]; + option = arry[ indx ]; + if ( option.text ) { + // OBJECT!! add data-function-name in case the value is set in filter_functions + option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value; + + // support jQuery < v1.8, otherwise the below code could be shortened to + // options += $( '