From c82280e598ec3b45ac136a0f5a241727ca024e7a Mon Sep 17 00:00:00 2001 From: Mottie Date: Wed, 25 Mar 2015 00:52:29 -0500 Subject: [PATCH] Global: removed c.$extraTables & c.$extraHeaders These variables were causing memory leaks --- dist/js/jquery.tablesorter.js | 10 ++-- dist/js/jquery.tablesorter.min.js | 4 +- dist/js/jquery.tablesorter.widgets.js | 20 +++---- dist/js/jquery.tablesorter.widgets.min.js | 6 +- dist/js/widgets/widget-stickyHeaders.min.js | 2 +- dist/js/widgets/widget-uitheme.min.js | 2 +- docs/index.html | 65 ++++++++++++--------- js/jquery.tablesorter.js | 10 ++-- js/jquery.tablesorter.widgets.js | 20 +++---- js/widgets/widget-stickyHeaders.js | 9 +-- js/widgets/widget-uitheme.js | 9 ++- 11 files changed, 79 insertions(+), 78 deletions(-) diff --git a/dist/js/jquery.tablesorter.js b/dist/js/jquery.tablesorter.js index b79ad941..59c47ac9 100644 --- a/dist/js/jquery.tablesorter.js +++ b/dist/js/jquery.tablesorter.js @@ -559,7 +559,9 @@ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ], aria = ['ascending', 'descending'], // find the footer - $t = $(table).find('tfoot tr').children().add(c.$extraHeaders).removeClass(css.join(' ')); + $t = $(table).find('tfoot tr').children() + .add( $( c.namespace + '_extra_headers' ) ) + .removeClass( css.join( ' ' ) ); // remove all header information c.$headers .removeClass(css.join(' ')) @@ -1337,10 +1339,10 @@ var t, downTarget = null, c = table.config; if (core !== true) { - c.$extraHeaders = c.$extraHeaders ? c.$extraHeaders.add($headers) : $headers; + $headers.addClass( c.namespace.slice(1) + '_extra_headers' ); t = $.fn.closest ? $headers.closest('table')[0] : $headers.parents('table')[0]; if (t && t.nodeName === 'TABLE' && t !== table) { - c.$extraTables = c.$extraTables ? c.$extraTables.add(t) : $(t); + $(t).addClass( c.namespace.slice(1) + '_extra_table' ); } } // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc) @@ -2057,7 +2059,7 @@ format: function(table, c, wo) { var $tb, $tv, $tr, row, even, time, k, child = new RegExp(c.cssChildRow, 'i'), - b = c.$tbodies.add( c.$extraTables && c.$extraTables.children( 'tbody' ) ); + b = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody' ) ); if (c.debug) { time = new Date(); } diff --git a/dist/js/jquery.tablesorter.min.js b/dist/js/jquery.tablesorter.min.js index 7097141e..5784373e 100644 --- a/dist/js/jquery.tablesorter.min.js +++ b/dist/js/jquery.tablesorter.min.js @@ -1,3 +1,3 @@ /*! TableSorter (FORK) v2.21.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){"use strict";a.extend({tablesorter:new function(){function b(){var a=arguments[0],b=arguments.length>1?Array.prototype.slice.call(arguments):a;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(a)?"error":/warn/i.test(a)?"warn":"log"](b):alert(b)}function c(a,c){b(a+" ("+((new Date).getTime()-c.getTime())+"ms)")}function d(a){for(var b in a)return!1;return!0}function e(c,d,e,f){for(var g,h,i=c.config,j=u.parsers.length,k=!1,l="",m=!0;""===l&&m;)e++,d[e]?(k=d[e].cells[f],l=u.getElementText(i,k,f),h=a(k),c.config.debug&&b("Checking if value was empty on row "+e+", column: "+f+': "'+l+'"')):m=!1;for(;--j>=0;)if(g=u.parsers[j],g&&"text"!==g.id&&g.is&&g.is(l,c,k,h))return g;return u.getParserById("text")}function f(a){var d,f,g,h,i,j,k,l,m,n,o=a.config,p=o.$tbodies=o.$table.children("tbody:not(."+o.cssInfoBlock+")"),q=0,r="",s=p.length;if(0===s)return o.debug?b("Warning: *Empty table!* Not building a parser cache"):"";for(o.debug&&(n=new Date,b("Detecting parsers for each column")),f={extractors:[],parsers:[]};s>q;){if(d=p[q].rows,d.length)for(g=o.columns,h=0;g>h;h++)i=o.$headerIndexed[h],j=u.getColumnData(a,o.headers,h),m=u.getParserById(u.getData(i,j,"extractor")),l=u.getParserById(u.getData(i,j,"sorter")),k="false"===u.getData(i,j,"parser"),o.empties[h]=(u.getData(i,j,"empty")||o.emptyTo||(o.emptyToBottom?"bottom":"top")).toLowerCase(),o.strings[h]=(u.getData(i,j,"string")||o.stringTo||"max").toLowerCase(),k&&(l=u.getParserById("no-parser")),m||(m=!1),l||(l=e(a,d,-1,h)),o.debug&&(r+="column:"+h+"; extractor:"+m.id+"; parser:"+l.id+"; string:"+o.strings[h]+"; empty: "+o.empties[h]+"\n"),f.parsers[h]=l,f.extractors[h]=m;q+=f.parsers.length?s:1}o.debug&&(b(r?r:"No parsers detected"),c("Completed detecting parsers",n)),o.parsers=f.parsers,o.extractors=f.extractors}function g(d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r=d.config,s=r.$tbodies,t=r.extractors,v=r.parsers;if(r.cache={},r.totalRows=0,!v)return r.debug?b("Warning: *Empty table!* Not building a cache"):"";for(r.debug&&(n=new Date),r.showProcessing&&u.isProcessing(d,!0),k=0;ki;++i)if(p={child:[],raw:[]},l=a(s[k].rows[i]),m=[],l.hasClass(r.cssChildRow)&&0!==i)f=e.normalized.length-1,e.normalized[f][r.columns].$row=e.normalized[f][r.columns].$row.add(l),l.prev().hasClass(r.cssChildRow)||l.prev().addClass(u.css.cssHasChild),p.child[f]=a.trim(l[0].textContent||l.text()||"");else{for(p.$row=l,p.order=i,j=0;ji;i++)o.push(e[i][l.columns].$row),l.appender&&(!l.pager||l.pager.removeRows&&m.pager_removeRows||l.pager.ajax)||h.append(e[i][l.columns].$row);u.processTbody(a,h,!1)}l.appender&&l.appender(a,o),l.debug&&c("Rebuilt table",k),b||l.appender||u.applyWidget(a),a.isUpdating&&l.$table.trigger("updateComplete",a)}function i(a){return/^d/i.test(a)||1===a}function j(d){var e,f,g,h,j,k,m,n,o=d.config;for(o.headerList=[],o.headerContent=[],o.debug&&(m=new Date),o.columns=u.computeColumnIndex(o.$table.children("thead, tfoot").children("tr")),h=o.cssIcon?'':"",o.$headers=a(a.map(a(d).find(o.selectorHeaders),function(b,c){return f=a(b),f.parent().hasClass(o.cssIgnoreRow)?void 0:(e=u.getColumnData(d,o.headers,c,!0),o.headerContent[c]=f.html(),""===o.headerTemplate||f.find("."+u.css.headerIn).length||(j=o.headerTemplate.replace(/\{content\}/g,f.html()).replace(/\{icon\}/g,f.find("."+u.css.icon).length?"":h),o.onRenderTemplate&&(g=o.onRenderTemplate.apply(f,[c,j]),g&&"string"==typeof g&&(j=g)),f.html('
'+j+"
")),o.onRenderHeader&&o.onRenderHeader.apply(f,[c,o,o.$table]),b.column=parseInt(f.attr("data-column"),10),b.order=i(u.getData(f,e,"sortInitialOrder")||o.sortInitialOrder)?[1,0,2]:[0,1,2],b.count=-1,b.lockedOrder=!1,k=u.getData(f,e,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(b.order=b.lockedOrder=i(k)?[1,1,1]:[0,0,0]),f.addClass(u.css.header+" "+o.cssHeader),o.headerList[c]=b,f.parent().addClass(u.css.headerRow+" "+o.cssHeaderRow).attr("role","row"),o.tabIndex&&f.attr("tabindex",0),b)})),o.$headerIndexed=[],n=0;nd;d++)if(2!==g[d][1]&&(c=f.$headers.not(".sorter-false").filter('[data-column="'+g[d][0]+'"]'+(1===h?":last":"")),c.length)){for(e=0;eh;h++)if(k=m[h],d=parseInt(k[0],10),g=l.$headerIndexed[d][0]){switch(e=(""+k[1]).match(/^(1|d|s|o|n)/),e=e?e[0]:""){case"1":case"d":e=1;break;case"s":e=i||0;break;case"o":j=g.order[(i||0)%(l.sortReset?3:2)],e=0===j?1:1===j?0:2;break;case"n":g.count=g.count+1,e=g.order[g.count%(l.sortReset?3:2)];break;default:e=0}i=0===h?e:i,f=[d,parseInt(e,10)||0],l.sortList.push(f),e=a.inArray(f[1],g.order),g.count=e>=0?e:f[1]%(l.sortReset?3:2)}}function o(a,b){return a&&a[b]?a[b].type||"":""}function p(b,c,d){if(b.isUpdating)return setTimeout(function(){p(b,c,d)},50);var e,f,g,i,j,k=b.config,l=!d[k.sortMultiSortKey],n=k.$table;if(n.trigger("sortStart",b),c.count=d[k.sortResetKey]?2:(c.count+1)%(k.sortReset?3:2),k.sortRestart&&(f=c,k.$headers.each(function(){this===f||!l&&a(this).is("."+u.css.sortDesc+",."+u.css.sortAsc)||(this.count=-1)})),f=parseInt(a(c).attr("data-column"),10),l){if(k.sortList=[],null!==k.sortForce)for(e=k.sortForce,g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;g1)for(g=0;g=0&&k.sortList.splice(j,1);if(u.isValueInArray(f,k.sortList)>=0)for(g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;ge;e++)i=q.cache[e].colMax,j=q.cache[e].normalized,j.sort(function(c,d){for(b=0;t>b;b++){if(g=s[b][0],k=s[b][1],p=0===k,q.sortStable&&c[g]===d[g]&&1===t)return c[q.columns].order-d[q.columns].order;if(f=/n/i.test(o(q.parsers,g)),f&&q.strings[g]?(f="boolean"==typeof q.string[q.strings[g]]?(p?1:-1)*(q.string[q.strings[g]]?-1:1):q.strings[g]?q.string[q.strings[g]]||0:0,l=q.numberSorter?q.numberSorter(c[g],d[g],p,i[g],a):u["sortNumeric"+(p?"Asc":"Desc")](c[g],d[g],f,i[g],g,a)):(m=p?c:d,n=p?d:c,l="function"==typeof r?r(m[g],n[g],p,g,a):"object"==typeof r&&r.hasOwnProperty(g)?r[g](m[g],n[g],p,g,a):u["sortNatural"+(p?"Asc":"Desc")](c[g],d[g],g,a,q)),l)return l}return c[q.columns].order-d[q.columns].order});q.debug&&c("Sorting on "+s.toString()+" and dir "+k+" time",h)}}function r(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function s(b,c,d){var e=a.isArray(c)?c:b.sortList,f="undefined"==typeof c?b.resort:c;f===!1||b.serverSideSorting||b.table.isProcessing?(r(b,d),u.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){r(b,d)},!0]):b.$table.trigger("sortReset",[function(){r(b,d),u.applyWidget(b.table,!1)}])}function t(b){var c=b.config,e=c.$table,i="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");e.unbind(i.replace(/\s+/g," ")).bind("sortReset"+c.namespace,function(d,e){d.stopPropagation(),c.sortList=[],m(b),q(b),h(b),a.isFunction(e)&&e(b)}).bind("updateAll"+c.namespace,function(a,d,e){a.stopPropagation(),b.isUpdating=!0,u.refreshWidgets(b,!0,!0),j(b),u.bindEvents(b,c.$headers,!0),t(b),k(b,d,e)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,c,d){a.stopPropagation(),b.isUpdating=!0,l(b),k(b,c,d)}).bind("updateCell"+c.namespace,function(d,f,g,h){d.stopPropagation(),b.isUpdating=!0,e.find(c.selectorRemove).remove();var i,j,k,l,m=c.$tbodies,n=a(f),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");f=n[0],m.length&&o>=0&&(k=m.eq(o).find("tr").index(p),l=n.index(),c.cache[o].normalized[k][c.columns].$row=p,j="undefined"==typeof c.extractors[l].id?u.getElementText(c,f,l):c.extractors[l].format(u.getElementText(c,f,l),b,f,l),i="no-parser"===c.parsers[l].id?"":c.parsers[l].format(j,b,f,l),c.cache[o].normalized[k][l]=c.ignoreCase&&"string"==typeof i?i.toLowerCase():i,"numeric"===(c.parsers[l].type||"").toLowerCase()&&(c.cache[o].colMax[l]=Math.max(Math.abs(i)||0,c.cache[o].colMax[l]||0)),i="undefined"!==g?g:c.resort,i!==!1?s(c,i,h):(a.isFunction(h)&&h(b),c.$table.trigger("updateComplete",c.table)))}).bind("addRows"+c.namespace,function(e,g,h,i){if(e.stopPropagation(),b.isUpdating=!0,d(c.cache))l(b),k(b,h,i);else{g=a(g).attr("role","row");var j,m,n,o,p,q,r,t=g.filter("tr").length,v=c.$tbodies.index(g.parents("tbody").filter(":first"));for(c.parsers&&c.parsers.length||f(b),j=0;t>j;j++){for(n=g[j].cells.length,r=[],q={child:[],$row:g.eq(j),order:c.cache[v].normalized.length},m=0;n>m;m++)o="undefined"==typeof c.extractors[m].id?u.getElementText(c,g[j].cells[m],m):c.extractors[m].format(u.getElementText(c,g[j].cells[m],m),b,g[j].cells[m],m),p="no-parser"===c.parsers[m].id?"":c.parsers[m].format(o,b,g[j].cells[m],m),r[m]=c.ignoreCase&&"string"==typeof p?p.toLowerCase():p,"numeric"===(c.parsers[m].type||"").toLowerCase()&&(c.cache[v].colMax[m]=Math.max(Math.abs(r[m])||0,c.cache[v].colMax[m]||0));r.push(q),c.cache[v].normalized.push(r)}s(c,h,i)}}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(c,f,i,j){var k=b.config;c.stopPropagation(),e.trigger("sortStart",this),n(b,f),m(b),k.delayInit&&d(k.cache)&&g(b),e.trigger("sortBegin",this),q(b),h(b,j),e.trigger("sortEnd",this),u.applyWidget(b),a.isFunction(i)&&i(b)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),h(b,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(d,e){c.parsers&&c.parsers.length||f(b),g(b),a.isFunction(e)&&e(b)}).bind("applyWidgetId"+c.namespace,function(a,d){a.stopPropagation(),u.getWidgetById(d).format(b,c,c.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),u.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),u.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),u.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(){u.removeWidget(b,!0,!1),c=a.extend(!0,u.defaults,c.originalSettings),b.hasInitialized=!1,u.setup(b,c)})}var u=this;u.version="2.21.2",u.parsers=[],u.widgets=[],u.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",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},u.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"},u.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"},u.instanceMethods={},u.log=b,u.benchmark=c,u.getElementText=function(b,c,d){if(!c)return"";var e,f=b.textExtraction||"",g=c.jquery?c:a(c);return a.trim("string"==typeof f?("basic"===f?g.attr(b.textAttribute)||c.textContent:c.textContent)||g.text()||"":"function"==typeof f?f(g[0],b.table,d):"function"==typeof(e=u.getColumnData(b.table,f,d))?e(g[0],b.table,d):g[0].textContent||g.text()||"")},u.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},u.defaults,b,u.instanceMethods);d.originalSettings=b,!c.hasInitialized&&u.buildTable&&"TABLE"!==this.nodeName?u.buildTable(c,d):u.setup(c,d)})},u.setup=function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return d.debug?b("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var e="",h=a(c),i=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&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.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),/tablesorter\-/.test(h.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=h.addClass(u.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=h.find(d.selectorHeaders),d.namespace=d.namespace?"."+d.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=h.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",j(c),u.fixColumnWidth(c),u.applyWidgetOptions(c,d),f(c),d.totalRows=0,d.delayInit||g(c),u.bindEvents(c,d.$headers,!0),t(c),d.supportsDataObject&&"undefined"!=typeof h.data().sortlist?d.sortList=h.data().sortlist:i&&h.metadata()&&h.metadata().sortlist&&(d.sortList=h.metadata().sortlist),u.applyWidget(c,!0),d.sortList.length>0?h.trigger("sorton",[d.sortList,{},!d.initWidgets,!0]):(m(c),d.initWidgets&&u.applyWidget(c,!1)),d.showProcessing&&h.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),u.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){u.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&u.benchmark("Overall initialization time",a.data(c,"startoveralltimer")),h.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},u.fixColumnWidth=function(b){b=a(b)[0];var c,d,e=b.config,f=e.$table.children("colgroup");f.length&&f.hasClass(u.css.colgroup)&&f.remove(),e.widthFixed&&0===e.$table.children("colgroup").length&&(f=a(''),c=e.$table.width(),e.$tbodies.find("tr:first").children(":visible").each(function(){d=parseInt(a(this).width()/c*1e3,10)/10+"%",f.append(a("").css("width",d))}),e.$table.prepend(f))},u.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]}},u.computeColumnIndex=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[],q={};for(c=0;ce;e++)for("undefined"==typeof p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return o.length},u.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+u.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:u.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(u.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(u.css.processing+" "+e.cssProcessing)},u.processTbody=function(b,c,d){b=a(b)[0];var e;return d?(b.isProcessing=!0,c.before(''),e=a.fn.detach?c.detach():c.remove()):(e=a(b).find("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},u.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},u.bindEvents=function(b,c,e){b=a(b)[0];var f,h=null,i=b.config;e!==!0&&(i.$extraHeaders=i.$extraHeaders?i.$extraHeaders.add(c):c,f=a.fn.closest?c.closest("table")[0]:c.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==b&&(i.$extraTables=i.$extraTables?i.$extraTables.add(f):a(f))),c.find(i.selectorSort).add(c.filter(i.selectorSort)).unbind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" ").replace(/\s+/g," ")).bind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" "),function(e,f){var j,k=a(e.target),l=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup|click/.test(l)||"keyup"===l&&13!==e.which||"click"===l&&"undefined"!=typeof e.which||"mouseup"===l&&h!==e.target&&f!==!0)){if("mousedown"===l)return void(h=e.target);if(h=null,/(input|select|button|textarea)/i.test(e.target.nodeName)||k.hasClass(i.cssNoSort)||k.parents("."+i.cssNoSort).length>0||k.parents("button").length>0)return!i.cancelSelection;i.delayInit&&d(i.cache)&&g(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:a(this).parents("th, td")[0],j=i.$headers[c.index(j)],j.sortDisabled||p(b,j,e)}}),i.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},u.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+u.css.headerIn).length&&c.html(d.headerContent[b])})},u.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){u.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+u.css.headerRow).removeClass(u.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).remove(),e="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(g.namespace+" "),f.removeData("tablesorter").unbind(e.replace(/\s+/g," ")),g.$headers.add(j).removeClass([u.css.header,g.cssHeader,g.cssAsc,g.cssDesc,u.css.sortAsc,u.css.sortDesc,u.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),u.restoreHeaders(b),f.toggleClass(u.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},u.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},u.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=u.regex;if(k.hex.test(b)){if(d=parseInt(a.match(k.hex),16),f=parseInt(b.match(k.hex),16),f>d)return-1;if(d>f)return 1}for(c=a.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),e=b.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),j=Math.max(c.length,e.length),i=0;j>i;i++){if(g=isNaN(c[i])?c[i]||0:parseFloat(c[i])||0,h=isNaN(e[i])?e[i]||0:parseFloat(e[i])||0,isNaN(g)!==isNaN(h))return isNaN(g)?1:-1;if(typeof g!=typeof h&&(g+="",h+=""),h>g)return-1;if(g>h)return 1}return 0},u.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:f||1:u.sortNatural(a,b)},u.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:u.sortNatural(b,a)},u.sortText=function(a,b){return a>b?1:b>a?-1:0},u.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},u.sortNumericAsc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),a-b)},u.sortNumericDesc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),b-a)},u.sortNumeric=function(a,b){return a-b},u.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},u.replaceAccents=function(a){var b,c="[",d=u.characterEquivalents;if(!u.characterRegex){u.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],u.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));u.characterRegex=new RegExp(c+"]")}if(u.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(u.characterRegexArray[b],b));return a},u.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},u.addParser=function(a){var b,c=u.parsers.length,d=!0;for(b=0;c>b;b++)u.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&u.parsers.push(a)},u.addInstanceMethods=function(b){a.extend(u.instanceMethods,b)},u.getParserById=function(a){if("false"==a)return!1;var b,c=u.parsers.length;for(b=0;c>b;b++)if(u.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return u.parsers[b];return!1},u.addWidget=function(a){u.widgets.push(a)},u.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},u.getWidgetById=function(a){var b,c,d=u.widgets.length;for(b=0;d>b;b++)if(c=u.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},u.applyWidgetOptions=function(b,c){var d,e,f=c.widgets.length,g=c.widgetOptions;if(f)for(d=0;f>d;d++)e=u.getWidgetById(c.widgets[d]),e&&"options"in e&&(g=b.config.widgetOptions=a.extend(!0,{},e.options,g))},u.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m=b.config,n=m.widgetOptions,o=" "+m.table.className+" ",p=[];if(d===!1||!b.hasInitialized||!b.isApplyingWidgets&&!b.isUpdating){if(m.debug&&(i=new Date),l=new RegExp("\\s"+m.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),o.match(l)&&(k=o.match(l)))for(g=k.length,f=0;g>f;f++)m.widgets.push(k[f].replace(l,"$1"));if(m.widgets.length){for(b.isApplyingWidgets=!0,m.widgets=a.grep(m.widgets,function(b,c){return a.inArray(b,m.widgets)===c}),h=m.widgets||[],g=h.length,f=0;g>f;f++)l=u.getWidgetById(h[f]),l&&l.id&&(l.priority||(l.priority=10),p[f]=l);for(p.sort(function(a,b){return a.priorityf;f++)p[f]&&((d||!m.widgetInit[p[f].id])&&(m.widgetInit[p[f].id]=!0,b.hasInitialized&&u.applyWidgetOptions(b,m),"init"in p[f]&&(m.debug&&(j=new Date),p[f].init(b,p[f],m,n),m.debug&&u.benchmark("Initializing "+p[f].id+" widget",j))),!d&&"format"in p[f]&&(m.debug&&(j=new Date),p[f].format(b,m,n,!1),m.debug&&u.benchmark((d?"Initializing ":"Applying ")+p[f].id+" widget",j)));d||"function"!=typeof e||e(b)}setTimeout(function(){b.isApplyingWidgets=!1,a.data(b,"lastWidgetApplication",new Date)},0),m.debug&&(k=m.widgets.length,c("Completed "+(d===!0?"initializing ":"applying ")+k+" widget"+(1!==k?"s":""),i))}},u.removeWidget=function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=u.widgets.length,h=0;i>h;h++)g=u.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=u.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&"remove"in g&&(j.debug&&h>=0&&b('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)},u.refreshWidgets=function(b,c,d){b=a(b)[0];var e,f=b.config,g=f.widgets,h=u.widgets,i=h.length,j=[],k=function(b){a(b).trigger("refreshComplete")};for(e=0;i>e;e++)h[e]&&h[e].id&&(c||a.inArray(h[e].id,g)<0)&&j.push(h[e].id);u.removeWidget(b,j.join(","),!0),d!==!0?(u.applyWidget(b,c||!1,k),c&&u.applyWidget(b,!1,k)):k(b)},u.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)):""},u.formatFloat=function(b,c){if("string"!=typeof b||""===b)return b;var d,e=c&&c.config?c.config.usNumberFormat!==!1:"undefined"!=typeof c?c:!0;return b=e?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1")),d=parseFloat(b),isNaN(d)?a.trim(b):d},u.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),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.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"currency",is:function(a){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(b){return b?a.trim(b.replace(/(https?|ftp|file):\/\//,"")):b},parsed:!0,type:"text"}),b.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(a)},format:function(a){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"percent",is:function(a){return/(\d\s*?%|%\s*?\d)/.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(/%/g,""),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.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(a)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(a)},format:function(a){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.$headerIndexed[e],j=i.length&&i[0].dateFormat||b.getData(i,b.getColumnData(c,h.headers,e),"dateFormat")||h.dateFormat;return g=a.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===j&&(g=g.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),f=new Date(g),f instanceof Date&&isFinite(f)?f.getTime():a -}return a},type:"numeric"}),b.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.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(c.$extraTables&&c.$extraTables.children("tbody"));for(c.debug&&(j=new Date),k=0;k1?Array.prototype.slice.call(arguments):a;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(a)?"error":/warn/i.test(a)?"warn":"log"](b):alert(b)}function c(a,c){b(a+" ("+((new Date).getTime()-c.getTime())+"ms)")}function d(a){for(var b in a)return!1;return!0}function e(c,d,e,f){for(var g,h,i=c.config,j=u.parsers.length,k=!1,l="",m=!0;""===l&&m;)e++,d[e]?(k=d[e].cells[f],l=u.getElementText(i,k,f),h=a(k),c.config.debug&&b("Checking if value was empty on row "+e+", column: "+f+': "'+l+'"')):m=!1;for(;--j>=0;)if(g=u.parsers[j],g&&"text"!==g.id&&g.is&&g.is(l,c,k,h))return g;return u.getParserById("text")}function f(a){var d,f,g,h,i,j,k,l,m,n,o=a.config,p=o.$tbodies=o.$table.children("tbody:not(."+o.cssInfoBlock+")"),q=0,r="",s=p.length;if(0===s)return o.debug?b("Warning: *Empty table!* Not building a parser cache"):"";for(o.debug&&(n=new Date,b("Detecting parsers for each column")),f={extractors:[],parsers:[]};s>q;){if(d=p[q].rows,d.length)for(g=o.columns,h=0;g>h;h++)i=o.$headerIndexed[h],j=u.getColumnData(a,o.headers,h),m=u.getParserById(u.getData(i,j,"extractor")),l=u.getParserById(u.getData(i,j,"sorter")),k="false"===u.getData(i,j,"parser"),o.empties[h]=(u.getData(i,j,"empty")||o.emptyTo||(o.emptyToBottom?"bottom":"top")).toLowerCase(),o.strings[h]=(u.getData(i,j,"string")||o.stringTo||"max").toLowerCase(),k&&(l=u.getParserById("no-parser")),m||(m=!1),l||(l=e(a,d,-1,h)),o.debug&&(r+="column:"+h+"; extractor:"+m.id+"; parser:"+l.id+"; string:"+o.strings[h]+"; empty: "+o.empties[h]+"\n"),f.parsers[h]=l,f.extractors[h]=m;q+=f.parsers.length?s:1}o.debug&&(b(r?r:"No parsers detected"),c("Completed detecting parsers",n)),o.parsers=f.parsers,o.extractors=f.extractors}function g(d){var e,f,g,h,i,j,k,l,m,n,o,p,q,r=d.config,s=r.$tbodies,t=r.extractors,v=r.parsers;if(r.cache={},r.totalRows=0,!v)return r.debug?b("Warning: *Empty table!* Not building a cache"):"";for(r.debug&&(n=new Date),r.showProcessing&&u.isProcessing(d,!0),k=0;ki;++i)if(p={child:[],raw:[]},l=a(s[k].rows[i]),m=[],l.hasClass(r.cssChildRow)&&0!==i)f=e.normalized.length-1,e.normalized[f][r.columns].$row=e.normalized[f][r.columns].$row.add(l),l.prev().hasClass(r.cssChildRow)||l.prev().addClass(u.css.cssHasChild),p.child[f]=a.trim(l[0].textContent||l.text()||"");else{for(p.$row=l,p.order=i,j=0;ji;i++)o.push(e[i][l.columns].$row),l.appender&&(!l.pager||l.pager.removeRows&&m.pager_removeRows||l.pager.ajax)||h.append(e[i][l.columns].$row);u.processTbody(a,h,!1)}l.appender&&l.appender(a,o),l.debug&&c("Rebuilt table",k),b||l.appender||u.applyWidget(a),a.isUpdating&&l.$table.trigger("updateComplete",a)}function i(a){return/^d/i.test(a)||1===a}function j(d){var e,f,g,h,j,k,m,n,o=d.config;for(o.headerList=[],o.headerContent=[],o.debug&&(m=new Date),o.columns=u.computeColumnIndex(o.$table.children("thead, tfoot").children("tr")),h=o.cssIcon?'':"",o.$headers=a(a.map(a(d).find(o.selectorHeaders),function(b,c){return f=a(b),f.parent().hasClass(o.cssIgnoreRow)?void 0:(e=u.getColumnData(d,o.headers,c,!0),o.headerContent[c]=f.html(),""===o.headerTemplate||f.find("."+u.css.headerIn).length||(j=o.headerTemplate.replace(/\{content\}/g,f.html()).replace(/\{icon\}/g,f.find("."+u.css.icon).length?"":h),o.onRenderTemplate&&(g=o.onRenderTemplate.apply(f,[c,j]),g&&"string"==typeof g&&(j=g)),f.html('
'+j+"
")),o.onRenderHeader&&o.onRenderHeader.apply(f,[c,o,o.$table]),b.column=parseInt(f.attr("data-column"),10),b.order=i(u.getData(f,e,"sortInitialOrder")||o.sortInitialOrder)?[1,0,2]:[0,1,2],b.count=-1,b.lockedOrder=!1,k=u.getData(f,e,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(b.order=b.lockedOrder=i(k)?[1,1,1]:[0,0,0]),f.addClass(u.css.header+" "+o.cssHeader),o.headerList[c]=b,f.parent().addClass(u.css.headerRow+" "+o.cssHeaderRow).attr("role","row"),o.tabIndex&&f.attr("tabindex",0),b)})),o.$headerIndexed=[],n=0;nd;d++)if(2!==g[d][1]&&(c=f.$headers.not(".sorter-false").filter('[data-column="'+g[d][0]+'"]'+(1===h?":last":"")),c.length)){for(e=0;eh;h++)if(k=m[h],d=parseInt(k[0],10),g=l.$headerIndexed[d][0]){switch(e=(""+k[1]).match(/^(1|d|s|o|n)/),e=e?e[0]:""){case"1":case"d":e=1;break;case"s":e=i||0;break;case"o":j=g.order[(i||0)%(l.sortReset?3:2)],e=0===j?1:1===j?0:2;break;case"n":g.count=g.count+1,e=g.order[g.count%(l.sortReset?3:2)];break;default:e=0}i=0===h?e:i,f=[d,parseInt(e,10)||0],l.sortList.push(f),e=a.inArray(f[1],g.order),g.count=e>=0?e:f[1]%(l.sortReset?3:2)}}function o(a,b){return a&&a[b]?a[b].type||"":""}function p(b,c,d){if(b.isUpdating)return setTimeout(function(){p(b,c,d)},50);var e,f,g,i,j,k=b.config,l=!d[k.sortMultiSortKey],n=k.$table;if(n.trigger("sortStart",b),c.count=d[k.sortResetKey]?2:(c.count+1)%(k.sortReset?3:2),k.sortRestart&&(f=c,k.$headers.each(function(){this===f||!l&&a(this).is("."+u.css.sortDesc+",."+u.css.sortAsc)||(this.count=-1)})),f=parseInt(a(c).attr("data-column"),10),l){if(k.sortList=[],null!==k.sortForce)for(e=k.sortForce,g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;g1)for(g=0;g=0&&k.sortList.splice(j,1);if(u.isValueInArray(f,k.sortList)>=0)for(g=0;gi&&(k.sortList.push([f,i]),c.colSpan>1))for(g=1;ge;e++)i=q.cache[e].colMax,j=q.cache[e].normalized,j.sort(function(c,d){for(b=0;t>b;b++){if(g=s[b][0],k=s[b][1],p=0===k,q.sortStable&&c[g]===d[g]&&1===t)return c[q.columns].order-d[q.columns].order;if(f=/n/i.test(o(q.parsers,g)),f&&q.strings[g]?(f="boolean"==typeof q.string[q.strings[g]]?(p?1:-1)*(q.string[q.strings[g]]?-1:1):q.strings[g]?q.string[q.strings[g]]||0:0,l=q.numberSorter?q.numberSorter(c[g],d[g],p,i[g],a):u["sortNumeric"+(p?"Asc":"Desc")](c[g],d[g],f,i[g],g,a)):(m=p?c:d,n=p?d:c,l="function"==typeof r?r(m[g],n[g],p,g,a):"object"==typeof r&&r.hasOwnProperty(g)?r[g](m[g],n[g],p,g,a):u["sortNatural"+(p?"Asc":"Desc")](c[g],d[g],g,a,q)),l)return l}return c[q.columns].order-d[q.columns].order});q.debug&&c("Sorting on "+s.toString()+" and dir "+k+" time",h)}}function r(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function s(b,c,d){var e=a.isArray(c)?c:b.sortList,f="undefined"==typeof c?b.resort:c;f===!1||b.serverSideSorting||b.table.isProcessing?(r(b,d),u.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){r(b,d)},!0]):b.$table.trigger("sortReset",[function(){r(b,d),u.applyWidget(b.table,!1)}])}function t(b){var c=b.config,e=c.$table,i="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");e.unbind(i.replace(/\s+/g," ")).bind("sortReset"+c.namespace,function(d,e){d.stopPropagation(),c.sortList=[],m(b),q(b),h(b),a.isFunction(e)&&e(b)}).bind("updateAll"+c.namespace,function(a,d,e){a.stopPropagation(),b.isUpdating=!0,u.refreshWidgets(b,!0,!0),j(b),u.bindEvents(b,c.$headers,!0),t(b),k(b,d,e)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,c,d){a.stopPropagation(),b.isUpdating=!0,l(b),k(b,c,d)}).bind("updateCell"+c.namespace,function(d,f,g,h){d.stopPropagation(),b.isUpdating=!0,e.find(c.selectorRemove).remove();var i,j,k,l,m=c.$tbodies,n=a(f),o=m.index(a.fn.closest?n.closest("tbody"):n.parents("tbody").filter(":first")),p=a.fn.closest?n.closest("tr"):n.parents("tr").filter(":first");f=n[0],m.length&&o>=0&&(k=m.eq(o).find("tr").index(p),l=n.index(),c.cache[o].normalized[k][c.columns].$row=p,j="undefined"==typeof c.extractors[l].id?u.getElementText(c,f,l):c.extractors[l].format(u.getElementText(c,f,l),b,f,l),i="no-parser"===c.parsers[l].id?"":c.parsers[l].format(j,b,f,l),c.cache[o].normalized[k][l]=c.ignoreCase&&"string"==typeof i?i.toLowerCase():i,"numeric"===(c.parsers[l].type||"").toLowerCase()&&(c.cache[o].colMax[l]=Math.max(Math.abs(i)||0,c.cache[o].colMax[l]||0)),i="undefined"!==g?g:c.resort,i!==!1?s(c,i,h):(a.isFunction(h)&&h(b),c.$table.trigger("updateComplete",c.table)))}).bind("addRows"+c.namespace,function(e,g,h,i){if(e.stopPropagation(),b.isUpdating=!0,d(c.cache))l(b),k(b,h,i);else{g=a(g).attr("role","row");var j,m,n,o,p,q,r,t=g.filter("tr").length,v=c.$tbodies.index(g.parents("tbody").filter(":first"));for(c.parsers&&c.parsers.length||f(b),j=0;t>j;j++){for(n=g[j].cells.length,r=[],q={child:[],$row:g.eq(j),order:c.cache[v].normalized.length},m=0;n>m;m++)o="undefined"==typeof c.extractors[m].id?u.getElementText(c,g[j].cells[m],m):c.extractors[m].format(u.getElementText(c,g[j].cells[m],m),b,g[j].cells[m],m),p="no-parser"===c.parsers[m].id?"":c.parsers[m].format(o,b,g[j].cells[m],m),r[m]=c.ignoreCase&&"string"==typeof p?p.toLowerCase():p,"numeric"===(c.parsers[m].type||"").toLowerCase()&&(c.cache[v].colMax[m]=Math.max(Math.abs(r[m])||0,c.cache[v].colMax[m]||0));r.push(q),c.cache[v].normalized.push(r)}s(c,h,i)}}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(c,f,i,j){var k=b.config;c.stopPropagation(),e.trigger("sortStart",this),n(b,f),m(b),k.delayInit&&d(k.cache)&&g(b),e.trigger("sortBegin",this),q(b),h(b,j),e.trigger("sortEnd",this),u.applyWidget(b),a.isFunction(i)&&i(b)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),h(b,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(d,e){c.parsers&&c.parsers.length||f(b),g(b),a.isFunction(e)&&e(b)}).bind("applyWidgetId"+c.namespace,function(a,d){a.stopPropagation(),u.getWidgetById(d).format(b,c,c.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),u.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),u.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),u.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(){u.removeWidget(b,!0,!1),c=a.extend(!0,u.defaults,c.originalSettings),b.hasInitialized=!1,u.setup(b,c)})}var u=this;u.version="2.21.2",u.parsers=[],u.widgets=[],u.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",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},u.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"},u.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"},u.instanceMethods={},u.log=b,u.benchmark=c,u.getElementText=function(b,c,d){if(!c)return"";var e,f=b.textExtraction||"",g=c.jquery?c:a(c);return a.trim("string"==typeof f?("basic"===f?g.attr(b.textAttribute)||c.textContent:c.textContent)||g.text()||"":"function"==typeof f?f(g[0],b.table,d):"function"==typeof(e=u.getColumnData(b.table,f,d))?e(g[0],b.table,d):g[0].textContent||g.text()||"")},u.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},u.defaults,b,u.instanceMethods);d.originalSettings=b,!c.hasInitialized&&u.buildTable&&"TABLE"!==this.nodeName?u.buildTable(c,d):u.setup(c,d)})},u.setup=function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return d.debug?b("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var e="",h=a(c),i=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&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.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),/tablesorter\-/.test(h.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=h.addClass(u.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=h.find(d.selectorHeaders),d.namespace=d.namespace?"."+d.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=h.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",j(c),u.fixColumnWidth(c),u.applyWidgetOptions(c,d),f(c),d.totalRows=0,d.delayInit||g(c),u.bindEvents(c,d.$headers,!0),t(c),d.supportsDataObject&&"undefined"!=typeof h.data().sortlist?d.sortList=h.data().sortlist:i&&h.metadata()&&h.metadata().sortlist&&(d.sortList=h.metadata().sortlist),u.applyWidget(c,!0),d.sortList.length>0?h.trigger("sorton",[d.sortList,{},!d.initWidgets,!0]):(m(c),d.initWidgets&&u.applyWidget(c,!1)),d.showProcessing&&h.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),u.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){u.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&u.benchmark("Overall initialization time",a.data(c,"startoveralltimer")),h.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},u.fixColumnWidth=function(b){b=a(b)[0];var c,d,e=b.config,f=e.$table.children("colgroup");f.length&&f.hasClass(u.css.colgroup)&&f.remove(),e.widthFixed&&0===e.$table.children("colgroup").length&&(f=a(''),c=e.$table.width(),e.$tbodies.find("tr:first").children(":visible").each(function(){d=parseInt(a(this).width()/c*1e3,10)/10+"%",f.append(a("").css("width",d))}),e.$table.prepend(f))},u.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]}},u.computeColumnIndex=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[],q={};for(c=0;ce;e++)for("undefined"==typeof p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return o.length},u.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+u.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:u.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(u.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(u.css.processing+" "+e.cssProcessing)},u.processTbody=function(b,c,d){b=a(b)[0];var e;return d?(b.isProcessing=!0,c.before(''),e=a.fn.detach?c.detach():c.remove()):(e=a(b).find("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},u.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},u.bindEvents=function(b,c,e){b=a(b)[0];var f,h=null,i=b.config;e!==!0&&(c.addClass(i.namespace.slice(1)+"_extra_headers"),f=a.fn.closest?c.closest("table")[0]:c.parents("table")[0],f&&"TABLE"===f.nodeName&&f!==b&&a(f).addClass(i.namespace.slice(1)+"_extra_table")),c.find(i.selectorSort).add(c.filter(i.selectorSort)).unbind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" ").replace(/\s+/g," ")).bind("mousedown mouseup click sort keyup ".split(" ").join(i.namespace+" "),function(e,f){var j,k=a(e.target),l=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup|click/.test(l)||"keyup"===l&&13!==e.which||"click"===l&&"undefined"!=typeof e.which||"mouseup"===l&&h!==e.target&&f!==!0)){if("mousedown"===l)return void(h=e.target);if(h=null,/(input|select|button|textarea)/i.test(e.target.nodeName)||k.hasClass(i.cssNoSort)||k.parents("."+i.cssNoSort).length>0||k.parents("button").length>0)return!i.cancelSelection;i.delayInit&&d(i.cache)&&g(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.nodeName)?this:a(this).parents("th, td")[0],j=i.$headers[c.index(j)],j.sortDisabled||p(b,j,e)}}),i.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},u.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+u.css.headerIn).length&&c.html(d.headerContent[b])})},u.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){u.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+u.css.headerRow).removeClass(u.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).remove(),e="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(g.namespace+" "),f.removeData("tablesorter").unbind(e.replace(/\s+/g," ")),g.$headers.add(j).removeClass([u.css.header,g.cssHeader,g.cssAsc,g.cssDesc,u.css.sortAsc,u.css.sortDesc,u.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(g.namespace+" ").replace(/\s+/g," ")),u.restoreHeaders(b),f.toggleClass(u.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},u.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},u.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=u.regex;if(k.hex.test(b)){if(d=parseInt(a.match(k.hex),16),f=parseInt(b.match(k.hex),16),f>d)return-1;if(d>f)return 1}for(c=a.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),e=b.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),j=Math.max(c.length,e.length),i=0;j>i;i++){if(g=isNaN(c[i])?c[i]||0:parseFloat(c[i])||0,h=isNaN(e[i])?e[i]||0:parseFloat(e[i])||0,isNaN(g)!==isNaN(h))return isNaN(g)?1:-1;if(typeof g!=typeof h&&(g+="",h+=""),h>g)return-1;if(g>h)return 1}return 0},u.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:f||1:u.sortNatural(a,b)},u.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:u.sortNatural(b,a)},u.sortText=function(a,b){return a>b?1:b>a?-1:0},u.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},u.sortNumericAsc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),a-b)},u.sortNumericDesc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=u.getTextValue(a,c,d)),isNaN(b)&&(b=u.getTextValue(b,c,d)),b-a)},u.sortNumeric=function(a,b){return a-b},u.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},u.replaceAccents=function(a){var b,c="[",d=u.characterEquivalents;if(!u.characterRegex){u.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],u.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));u.characterRegex=new RegExp(c+"]")}if(u.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(u.characterRegexArray[b],b));return a},u.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},u.addParser=function(a){var b,c=u.parsers.length,d=!0;for(b=0;c>b;b++)u.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&u.parsers.push(a)},u.addInstanceMethods=function(b){a.extend(u.instanceMethods,b)},u.getParserById=function(a){if("false"==a)return!1;var b,c=u.parsers.length;for(b=0;c>b;b++)if(u.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return u.parsers[b];return!1},u.addWidget=function(a){u.widgets.push(a)},u.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},u.getWidgetById=function(a){var b,c,d=u.widgets.length;for(b=0;d>b;b++)if(c=u.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},u.applyWidgetOptions=function(b,c){var d,e,f=c.widgets.length,g=c.widgetOptions;if(f)for(d=0;f>d;d++)e=u.getWidgetById(c.widgets[d]),e&&"options"in e&&(g=b.config.widgetOptions=a.extend(!0,{},e.options,g))},u.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j,k,l,m=b.config,n=m.widgetOptions,o=" "+m.table.className+" ",p=[];if(d===!1||!b.hasInitialized||!b.isApplyingWidgets&&!b.isUpdating){if(m.debug&&(i=new Date),l=new RegExp("\\s"+m.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),o.match(l)&&(k=o.match(l)))for(g=k.length,f=0;g>f;f++)m.widgets.push(k[f].replace(l,"$1"));if(m.widgets.length){for(b.isApplyingWidgets=!0,m.widgets=a.grep(m.widgets,function(b,c){return a.inArray(b,m.widgets)===c}),h=m.widgets||[],g=h.length,f=0;g>f;f++)l=u.getWidgetById(h[f]),l&&l.id&&(l.priority||(l.priority=10),p[f]=l);for(p.sort(function(a,b){return a.priorityf;f++)p[f]&&((d||!m.widgetInit[p[f].id])&&(m.widgetInit[p[f].id]=!0,b.hasInitialized&&u.applyWidgetOptions(b,m),"init"in p[f]&&(m.debug&&(j=new Date),p[f].init(b,p[f],m,n),m.debug&&u.benchmark("Initializing "+p[f].id+" widget",j))),!d&&"format"in p[f]&&(m.debug&&(j=new Date),p[f].format(b,m,n,!1),m.debug&&u.benchmark((d?"Initializing ":"Applying ")+p[f].id+" widget",j)));d||"function"!=typeof e||e(b)}setTimeout(function(){b.isApplyingWidgets=!1,a.data(b,"lastWidgetApplication",new Date)},0),m.debug&&(k=m.widgets.length,c("Completed "+(d===!0?"initializing ":"applying ")+k+" widget"+(1!==k?"s":""),i))}},u.removeWidget=function(c,d,e){c=a(c)[0];var f,g,h,i,j=c.config;if(d===!0)for(d=[],i=u.widgets.length,h=0;i>h;h++)g=u.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=u.getWidgetById(d[f]),h=a.inArray(d[f],j.widgets),g&&"remove"in g&&(j.debug&&h>=0&&b('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)},u.refreshWidgets=function(b,c,d){b=a(b)[0];var e,f=b.config,g=f.widgets,h=u.widgets,i=h.length,j=[],k=function(b){a(b).trigger("refreshComplete")};for(e=0;i>e;e++)h[e]&&h[e].id&&(c||a.inArray(h[e].id,g)<0)&&j.push(h[e].id);u.removeWidget(b,j.join(","),!0),d!==!0?(u.applyWidget(b,c||!1,k),c&&u.applyWidget(b,!1,k)):k(b)},u.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)):""},u.formatFloat=function(b,c){if("string"!=typeof b||""===b)return b;var d,e=c&&c.config?c.config.usNumberFormat!==!1:"undefined"!=typeof c?c:!0;return b=e?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1")),d=parseFloat(b),isNaN(d)?a.trim(b):d},u.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),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.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"currency",is:function(a){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(b){return b?a.trim(b.replace(/(https?|ftp|file):\/\//,"")):b},parsed:!0,type:"text"}),b.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(a)},format:function(a){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"percent",is:function(a){return/(\d\s*?%|%\s*?\d)/.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(/%/g,""),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.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(a)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(a)},format:function(a){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.$headerIndexed[e],j=i.length&&i[0].dateFormat||b.getData(i,b.getColumnData(c,h.headers,e),"dateFormat")||h.dateFormat;return g=a.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===j&&(g=g.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),f=new Date(g),f instanceof Date&&isFinite(f)?f.getTime():a +}return a},type:"numeric"}),b.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.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"));for(c.debug&&(j=new Date),k=0;k'), $stickyWrap = $stickyTable.parent() .addClass(ts.css.stickyHide) @@ -1827,13 +1830,6 @@ ts.addWidget({ if ($attach.length && !$attach.css('position')) { $attach.css('position', 'relative'); } - // save stickyTable element to config - // it is also saved to wo.$sticky - if (c.$extraTables && c.$extraTables.length) { - c.$extraTables.add($stickyTable); - } else { - c.$extraTables = $stickyTable; - } // fix clone ID, if it exists - fixes #271 if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } // clear out cloned table, except for sticky header diff --git a/dist/js/jquery.tablesorter.widgets.min.js b/dist/js/jquery.tablesorter.widgets.min.js index d3e97b19..0058d5d4 100644 --- a/dist/js/jquery.tablesorter.widgets.min.js +++ b/dist/js/jquery.tablesorter.widgets.min.js @@ -1,3 +1,3 @@ -/*! tablesorter (FORK) widgets - updated 03-24-2015 (v2.21.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,b,c){"use strict";var d=a.tablesorter=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[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[p]||(l[p]={}),l[p][o]=f,k?localStorage[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[p]?l[p][o]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter=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(d.$extraTables),t=d.$headers.add(d.$extraHeaders),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)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(d,e,f){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var g,h,i,j,k,l,m,n,o,p=b.filter.regex;if(e.$table.addClass("hasFilters"),f.searchTimer=null,f.filter_initTimer=null,f.filter_formatterCount=0,f.filter_formatterInit=[],f.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',f.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',i="\\{"+b.filter.regex.query+"\\}",a.extend(p,{child:new RegExp(e.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(i,"i"),igQuery:new RegExp(i,"ig")}),f.filter_columnFilters!==!1&&e.$headers.filter(".filter-false, .parser-false").length!==e.$headers.length&&b.filter.buildRow(d,e,f),i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter "),e.$table.bind(i,function(g,h){return m=f.filter_hideEmpty&&a.isEmptyObject(e.cache)&&!(e.delayInit&&"appendCache"===g.type),e.$table.find("."+c.filterRow).toggleClass(f.filter_filteredRow,m),/(search|filter)/.test(g.type)||(g.stopPropagation(),b.filter.buildDefault(d,!0)),"filterReset"===g.type?(e.$table.find("."+c.filter).add(f.filter_$externalFilters).val(""),b.filter.searching(d,[])):"filterEnd"===g.type?b.filter.buildDefault(d,!0):(h="search"===g.type?h:"updateComplete"===g.type?e.$table.data("lastSearch"):"",/(update|add)/.test(g.type)&&"updateComplete"!==g.type&&(e.lastCombinedFilter=null,e.lastSearch=[]),b.filter.searching(d,h,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof a?f.filter_reset.click(function(){e.$table.trigger("filterReset")}):a(f.filter_reset).length&&a(document).undelegate(f.filter_reset,"click.tsfilter").delegate(f.filter_reset,"click.tsfilter",function(){e.$table.trigger("filterReset")})),f.filter_functions)for(k=0;k'+(j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.select||"")+"":"",m=h,i=h,h.indexOf(f.filter_selectSourceSeparator)>=0&&(m=h.split(f.filter_selectSourceSeparator),i=m[1],m=m[0]),g+="");e.$table.find("thead").find("select."+c.filter+'[data-column="'+k+'"]').append(g)}b.filter.buildDefault(d,!0),b.filter.bindSearch(d,e.$table.find("."+c.filter),!0),f.filter_external&&b.filter.bindSearch(d,f.filter_external),f.filter_hideFilters&&b.filter.hideFilters(d,e),e.showProcessing&&e.$table.unbind("filterStart filterEnd ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(e.namespace+"filter "),function(f,g){j=g?e.$table.find("."+c.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",b.isProcessing(d,"filterStart"===f.type,g?j:"")}),e.filteredRows=e.totalRows,e.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),function(){var a=this.config.widgetOptions;l=b.filter.setDefaults(d,e,a)||[],l.length&&(e.delayInit&&""===l.join("")||b.setFilters(d,l,!0)),e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(e)},100)}),e.pager&&e.pager.initialized&&!f.filter_initialized&&(e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(e)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;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.filter.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()}},setDefaults:function(c,d,e){var f,g,h,i,j,k=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(k=g)),""===k.join(""))for(j=d.$headers.add(e.filter_$externalFilters).filter("["+e.filter_defaultAttrib+"]"),h=0;h<=d.columns;h++)i=h===d.columns?"all":h,k[h]=j.filter('[data-column="'+i+'"]').attr(e.filter_defaultAttrib)||k[h]||"";return d.$table.data("lastSearch",k),k},parseFilter:function(a,b,c,d,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n=e.columns,o=a.isArray(f.filter_cellFilter),p='';for(h=0;n>h;h++)p+=o?"":"";for(e.$filters=a(p+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;n>h;h++)k=!1,i=e.$headerIndexed[h],m=b.getColumnData(d,f.filter_functions,h),j=f.filter_functions&&m&&"function"!=typeof m||i.hasClass("filter-select"),g=b.getColumnData(d,e.headers,h),k="false"===b.getData(i[0],g,"filter")||"false"===b.getData(i[0],g,"parser"),j?p=a("').appendTo(e.$filters.eq(h)),p&&p.attr("placeholder",i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"")),p&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",p.addClass(c.filter+" "+l).attr("data-column",h),k&&(p.attr("placeholder","").addClass(c.filterDisabled)[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(d,e,f){var g=d.config,h=g.widgetOptions,i=a.isArray(e),j=i?e:b.getFilters(d,!0),k=(j||[]).join("");return a.isEmptyObject(g.cache)?void(g.delayInit&&g.pager&&g.pager.initialized&&g.$table.trigger("updateCache",[function(){b.filter.checkFilters(d,!1,f)}])):(i&&(b.setFilters(d,j,!1,f!==!0),h.filter_initialized||(g.lastCombinedFilter="")),h.filter_hideFilters&&g.$table.find("."+c.filterRow).trigger(""===k?"mouseleave":"mouseenter"),g.lastCombinedFilter!==k||e===!1?(e===!1&&(g.lastCombinedFilter=null,g.lastSearch=[]),h.filter_initialized&&g.$table.trigger("filterStart",[j]),g.showProcessing?void setTimeout(function(){return b.filter.findRows(d,j,k),!1},30):(b.filter.findRows(d,j,k),!1)):void 0)},hideFilters:function(d,e){var f,g,h;a(d).find("."+c.filterRow).addClass(c.filterRowHide).bind("mouseenter mouseleave",function(b){var d=b;f=a(this),clearTimeout(h),h=setTimeout(function(){/enter|over/.test(d.type)?f.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==f[0]&&""===e.lastCombinedFilter&&f.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){g=a(this).closest("tr"),clearTimeout(h);var f=d;h=setTimeout(function(){""===b.getFilters(e.$table).join("")&&g["focus"===f.type?"removeClass":"addClass"](c.filterRowHide)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.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")}):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.filter.getLatestSearch(d).attr("data-column")||"");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&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},buildSelect:function(d,e,f,g,h){if(d=a(d)[0],e=parseInt(e,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var i,j,k,l,m,n,o=d.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+c.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.filter.getOptionSource(d,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("."+c.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,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headerIndexed[d],f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(d,e,f,g){var h,i,j,k,l=!1,m=d?a(d)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters)return a(d).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+c.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this); -"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
'),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[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) widgets - updated 03-25-2015 (v2.21.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,b,c){"use strict";var d=a.tablesorter=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[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[p]||(l[p]={}),l[p][o]=f,k?localStorage[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[p]?l[p][o]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter=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)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index])||"";return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index])||"";return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,"")||"",g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,"")||"",g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f)||"";return!c.$headerIndexed[e].hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index])||"";for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(d,e,f){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var g,h,i,j,k,l,m,n,o,p=b.filter.regex;if(e.$table.addClass("hasFilters"),f.searchTimer=null,f.filter_initTimer=null,f.filter_formatterCount=0,f.filter_formatterInit=[],f.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',f.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',i="\\{"+b.filter.regex.query+"\\}",a.extend(p,{child:new RegExp(e.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(i,"i"),igQuery:new RegExp(i,"ig")}),f.filter_columnFilters!==!1&&e.$headers.filter(".filter-false, .parser-false").length!==e.$headers.length&&b.filter.buildRow(d,e,f),i="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(e.namespace+"filter "),e.$table.bind(i,function(g,h){return m=f.filter_hideEmpty&&a.isEmptyObject(e.cache)&&!(e.delayInit&&"appendCache"===g.type),e.$table.find("."+c.filterRow).toggleClass(f.filter_filteredRow,m),/(search|filter)/.test(g.type)||(g.stopPropagation(),b.filter.buildDefault(d,!0)),"filterReset"===g.type?(e.$table.find("."+c.filter).add(f.filter_$externalFilters).val(""),b.filter.searching(d,[])):"filterEnd"===g.type?b.filter.buildDefault(d,!0):(h="search"===g.type?h:"updateComplete"===g.type?e.$table.data("lastSearch"):"",/(update|add)/.test(g.type)&&"updateComplete"!==g.type&&(e.lastCombinedFilter=null,e.lastSearch=[]),b.filter.searching(d,h,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof a?f.filter_reset.click(function(){e.$table.trigger("filterReset")}):a(f.filter_reset).length&&a(document).undelegate(f.filter_reset,"click.tsfilter").delegate(f.filter_reset,"click.tsfilter",function(){e.$table.trigger("filterReset")})),f.filter_functions)for(k=0;k'+(j.data("placeholder")||j.attr("data-placeholder")||f.filter_placeholder.select||"")+"":"",m=h,i=h,h.indexOf(f.filter_selectSourceSeparator)>=0&&(m=h.split(f.filter_selectSourceSeparator),i=m[1],m=m[0]),g+="");e.$table.find("thead").find("select."+c.filter+'[data-column="'+k+'"]').append(g)}b.filter.buildDefault(d,!0),b.filter.bindSearch(d,e.$table.find("."+c.filter),!0),f.filter_external&&b.filter.bindSearch(d,f.filter_external),f.filter_hideFilters&&b.filter.hideFilters(d,e),e.showProcessing&&e.$table.unbind("filterStart filterEnd ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("filterStart filterEnd ".split(" ").join(e.namespace+"filter "),function(f,g){j=g?e.$table.find("."+c.header).filter("[data-column]").filter(function(){return""!==g[a(this).data("column")]}):"",b.isProcessing(d,"filterStart"===f.type,g?j:"")}),e.filteredRows=e.totalRows,e.$table.unbind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter ").replace(/\s+/g," ")).bind("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(e.namespace+"filter "),function(){var a=this.config.widgetOptions;l=b.filter.setDefaults(d,e,a)||[],l.length&&(e.delayInit&&""===l.join("")||b.setFilters(d,l,!0)),e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(e)},100)}),e.pager&&e.pager.initialized&&!f.filter_initialized&&(e.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(e)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;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.filter.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()}},setDefaults:function(c,d,e){var f,g,h,i,j,k=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(k=g)),""===k.join(""))for(j=d.$headers.add(e.filter_$externalFilters).filter("["+e.filter_defaultAttrib+"]"),h=0;h<=d.columns;h++)i=h===d.columns?"all":h,k[h]=j.filter('[data-column="'+i+'"]').attr(e.filter_defaultAttrib)||k[h]||"";return d.$table.data("lastSearch",k),k},parseFilter:function(a,b,c,d,e){return e||d?a.parsers[c].format(b,a.table,[],c):b},buildRow:function(d,e,f){var g,h,i,j,k,l,m,n=e.columns,o=a.isArray(f.filter_cellFilter),p='';for(h=0;n>h;h++)p+=o?"":"";for(e.$filters=a(p+="").appendTo(e.$table.children("thead").eq(0)).find("td"),h=0;n>h;h++)k=!1,i=e.$headerIndexed[h],m=b.getColumnData(d,f.filter_functions,h),j=f.filter_functions&&m&&"function"!=typeof m||i.hasClass("filter-select"),g=b.getColumnData(d,e.headers,h),k="false"===b.getData(i[0],g,"filter")||"false"===b.getData(i[0],g,"parser"),j?p=a("').appendTo(e.$filters.eq(h)),p&&p.attr("placeholder",i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.search||"")),p&&(l=(a.isArray(f.filter_cssFilter)?"undefined"!=typeof f.filter_cssFilter[h]?f.filter_cssFilter[h]||"":"":f.filter_cssFilter)||"",p.addClass(c.filter+" "+l).attr("data-column",h),k&&(p.attr("placeholder","").addClass(c.filterDisabled)[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind("keypress keyup search change ".split(" ").join(f.namespace+"filter ").replace(/\s+/g," ")).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind("search change keypress ".split(" ").join(f.namespace+"filter "),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(d,e,f){var g=d.config,h=g.widgetOptions,i=a.isArray(e),j=i?e:b.getFilters(d,!0),k=(j||[]).join("");return a.isEmptyObject(g.cache)?void(g.delayInit&&g.pager&&g.pager.initialized&&g.$table.trigger("updateCache",[function(){b.filter.checkFilters(d,!1,f)}])):(i&&(b.setFilters(d,j,!1,f!==!0),h.filter_initialized||(g.lastCombinedFilter="")),h.filter_hideFilters&&g.$table.find("."+c.filterRow).trigger(""===k?"mouseleave":"mouseenter"),g.lastCombinedFilter!==k||e===!1?(e===!1&&(g.lastCombinedFilter=null,g.lastSearch=[]),h.filter_initialized&&g.$table.trigger("filterStart",[j]),g.showProcessing?void setTimeout(function(){return b.filter.findRows(d,j,k),!1},30):(b.filter.findRows(d,j,k),!1)):void 0)},hideFilters:function(d,e){var f,g,h;a(d).find("."+c.filterRow).addClass(c.filterRowHide).bind("mouseenter mouseleave",function(b){var d=b;f=a(this),clearTimeout(h),h=setTimeout(function(){/enter|over/.test(d.type)?f.removeClass(c.filterRowHide):a(document.activeElement).closest("tr")[0]!==f[0]&&""===e.lastCombinedFilter&&f.addClass(c.filterRowHide)},200)}).find("input, select").bind("focus blur",function(d){g=a(this).closest("tr"),clearTimeout(h);var f=d;h=setTimeout(function(){""===b.getFilters(e.$table).join("")&&g["focus"===f.type?"removeClass":"addClass"](c.filterRowHide)},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.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")}):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.filter.getLatestSearch(d).attr("data-column")||"");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&&(G=parseInt(F[0],10)-1,G>=0&&Gw;w++)v=d[w]||"",y||(w=n),y=!(!y||!p.length||0!==v.indexOf(p[w]||"")||H.alreadyFiltered.test(v)||/[=\"\|!]/.test(v)||/(>=?\s*-\d)/.test(v)||/(<=?\s*\d)/.test(v)||""!==v&&I.$filters&&I.$filters.eq(w).find("select").length&&!I.$headerIndexed[w].hasClass("filter-match"));for(x=h.not("."+J.filter_filteredRow).length,y&&0===x&&(y=!1),I.debug&&b.log("Filter: Searching through "+(y&&f>x?x:"all")+" rows"),K.anyMatchFlag&&(I.sortLocaleCompare&&(K.anyMatchFilter=b.replaceAccents(K.anyMatchFilter)),J.filter_defaultFilter&&H.iQuery.test(b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)||"")&&(K.anyMatchFilter=b.filter.defaultFilter(K.anyMatchFilter,b.getColumnData(c,J.filter_defaultFilter,I.columns,!0)),y=!1),K.iAnyMatchFilter=J.filter_ignoreCase&&I.ignoreCase?K.anyMatchFilter.toLocaleLowerCase():K.anyMatchFilter),i=0;f>i;i++)if(K.cacheArray=g[i],o=h[i].className,!(H.child.test(o)||y&&H.filtered.test(o))){if(t=!0,o=h.eq(i).nextUntil("tr:not(."+I.cssChildRow+")"),K.childRowText=o.length&&J.filter_childRows?o.text():"",K.childRowText=J.filter_ignoreCase?K.childRowText.toLocaleLowerCase():K.childRowText,l=h.eq(i).children(),K.anyMatchFlag){if(n=b.filter.multipleColumns(I,J.filter_$anyMatch),K.anyMatch=!0,K.rowArray=l.map(function(c){if(a.inArray(c,n)>-1){var d;return K.parsed[c]?d=K.cacheArray[c]:(d=this?this.getAttribute(I.textAttribute)||this.textContent||a(this).text():"",d=a.trim(J.filter_ignoreCase?d.toLowerCase():d),I.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),K.filter=K.anyMatchFilter,K.iFilter=K.iAnyMatchFilter,K.exact=K.rowArray.join(" "),K.iExact=J.filter_ignoreCase?K.exact.toLowerCase():K.exact,K.cache=K.cacheArray.slice(0,-1).join(" "),z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,L)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z)t=z;else if(J.filter_startsWith)for(t=!1,n=I.columns;!t&&n>0;)n--,t=t||0===K.rowArray[n].indexOf(K.iFilter);else t=(K.iExact+K.childRowText).indexOf(K.iFilter)>=0;K.anyMatch=!1}for(n=0;n=0:K.filter===K.exact:"function"==typeof B?s=B(K.exact,K.cache,K.filter,n,h.eq(i),I):"function"==typeof B[C||K.filter]&&(s=B[C||K.filter](K.exact,K.cache,K.filter,n,h.eq(i),I)):(z=null,a.each(b.filter.types,function(b,c){return a.inArray(b,A)<0&&(r=c(I,K),null!==r)?(z=r,!1):void 0}),null!==z?s=z:(K.exact=(K.iExact+K.childRowText).indexOf(b.filter.parseFilter(I,K.iFilter,n,K.parsed[n])),s=!J.filter_startsWith&&K.exact>=0||J.filter_startsWith&&0===K.exact)),t=s?t:!1);h.eq(i).toggleClass(J.filter_filteredRow,!t)[0].display=t?"":"none",o.length&&o.toggleClass(J.filter_filteredRow,!t)}}I.filteredRows+=h.not("."+J.filter_filteredRow).length,I.totalRows+=h.length,b.processTbody(c,k,!1)}I.lastCombinedFilter=e,I.lastSearch=d,I.$table.data("lastSearch",d),J.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),I.debug&&b.benchmark("Completed filter widget search",u),J.filter_initialized&&I.$table.trigger("filterEnd",I),setTimeout(function(){I.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g,h,i=c.config,j=i.widgetOptions,k=[],l=!1,m=j.filter_selectSource,n=i.$table.data("lastSearch")||[],o=a.isFunction(m)?!0:b.getColumnData(c,m,d);if(e&&""!==n[d]&&(e=!1),o===!0)l=m(c,d,e);else{if(o instanceof a||"string"===a.type(o)&&o.indexOf("")>=0)return o;a.isArray(o)?l=o:"object"===a.type(m)&&o&&(l=o(c,d,e))}if(l===!1&&(l=b.filter.getOptions(c,d,e)),l=a.grep(l,function(b,c){return a.inArray(b,l)===c}),i.$headerIndexed[d].hasClass("filter-select-nosort"))return l;for(h=l.length,g=0;h>g;g++)k.push({t:l[g],p:i.parsers&&i.parsers[d].format(l[g],c,[],d)});for(f=i.textSorter||"",k.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),l=[],h=k.length,g=0;h>g;g++)l.push(k[g].t);return l},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headerIndexed[c].hasClass("filter-parsed")?m.push(""+i.normalized[e][c]):(j=h.cells[c],j&&m.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return m},buildSelect:function(d,e,f,g,h){if(d=a(d)[0],e=parseInt(e,10),d.config.cache&&!a.isEmptyObject(d.config.cache)){var i,j,k,l,m,n,o=d.config,p=o.widgetOptions,q=o.$headerIndexed[e],r='",s=o.$table.find("thead").find("select."+c.filter+'[data-column="'+e+'"]').val();if(("undefined"==typeof f||""===f)&&(f=b.filter.getOptionSource(d,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("."+c.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,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headerIndexed[d],f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(d,e,f,g){var h,i,j,k,l=!1,m=d?a(d)[0].config:"",n=m?m.widgetOptions:"";if(e!==!0&&n&&!n.filter_columnFilters)return a(d).data("lastSearch");if(m&&(m.$filters&&(i=m.$filters.find("."+c.filter)),n.filter_$externalFilters&&(i=i&&i.length?i.add(n.filter_$externalFilters):n.filter_$externalFilters),i&&i.length))for(l=f||[],h=0;h=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this); +"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
'),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[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/widgets/widget-stickyHeaders.min.js b/dist/js/widgets/widget-stickyHeaders.min.js index b60f2157..47151466 100644 --- a/dist/js/widgets/widget-stickyHeaders.min.js +++ b/dist/js/widgets/widget-stickyHeaders.min.js @@ -1,2 +1,2 @@ /*! Widget: stickyHeaders - updated 3/5/2015 (v2.21.0) */ -!function(a,b){"use strict";var c=a.tablesorter=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){b=a(b)[0];var e,f={timer:250},g=a.extend({},f,d),h=b.config,i=h.widgetOptions,j=function(b){i.resize_flag=!0,e=[],h.$headers.each(function(){var b=a(this),c=b.data("savedSizes")||[0,0],d=this.offsetWidth,f=this.offsetHeight;(d!==c[0]||f!==c[1])&&(b.data("savedSizes",[d,f]),e.push(this))}),e.length&&b!==!1&&h.$table.trigger("resize",[e]),i.resize_flag=!1};return j(!1),clearInterval(i.resize_timer),c?(i.resize_flag=!1,!1):void(i.resize_timer=setInterval(function(){i.resize_flag||j()},g.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=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this);"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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); \ No newline at end of file +!function(a,b){"use strict";var c=a.tablesorter=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){b=a(b)[0];var e,f={timer:250},g=a.extend({},f,d),h=b.config,i=h.widgetOptions,j=function(b){i.resize_flag=!0,e=[],h.$headers.each(function(){var b=a(this),c=b.data("savedSizes")||[0,0],d=this.offsetWidth,f=this.offsetHeight;(d!==c[0]||f!==c[1])&&(b.data("savedSizes",[d,f]),e.push(this))}),e.length&&b!==!1&&h.$table.trigger("resize",[e]),i.resize_flag=!1};return j(!1),clearInterval(i.resize_timer),c?(i.resize_flag=!1,!1):void(i.resize_timer=setInterval(function(){i.resize_flag||j()},g.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=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders+" "+e.namespace.slice(1)+"_extra_table").wrap('
'),u=t.parent().addClass(c.css.stickyHide).css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this);"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,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({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};i.length&&!i.css("position")&&i.css("position","relative"),t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+j,function(){z()}),c.bindEvents(d,v.children().children("."+c.css.header)),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind("scroll resize ".split(" ").join(j).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(j),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind("pagerComplete filterEnd ".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); \ No newline at end of file diff --git a/dist/js/widgets/widget-uitheme.min.js b/dist/js/widgets/widget-uitheme.min.js index f02ba745..9a866616 100644 --- a/dist/js/widgets/widget-uitheme.min.js +++ b/dist/js/widgets/widget-uitheme.min.js @@ -1,2 +1,2 @@ /*! Widget: uitheme */ -!function(a){"use strict";var b=a.tablesorter=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(d.$extraTables),t=d.$headers.add(d.$extraHeaders),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;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;f - - - jQuery Object - Internal list of all extra table header cells (v2.16.2) -
-
- When the bindEvents function is used, the extra (external) header cells are added to this variable, and automatically updated with the table headers (config.$headers).
-
- So, when writing a custom widget that clones the table header, there is no longer a need to update the header class names, it's all done automatically. -
- - - - - - - jQuery Object - Internal list of all extra (cloned) table elements (v2.19.0) -
-
- Some widgets need to duplicate parts of the original table to provide functionality (e.g. stickyHeaders, scroller). This saved variable will either not exist or contain a jQuery object pointing to the cloned table elements.
-
- This variable was added for the uitheme widget to allow dynamic updating of themes to the original table as well as all cloned parts. -
- - - - Array @@ -5983,6 +5955,43 @@ $.each( p.cacheIndex, function(i, v) { + + + Removed Variables + + + + + + + jQuery Object + Internal list of all extra table header cells (v2.16.2; removed v2.21.3) +
+

This variable was removed due to it causing memory leak issues. To now find extra headers use config.namespace as follows:

+
$( config.namespace + '_extra_headers' )
+

When the bindEvents function is used, the extra (external) header cells are added to this variable, and automatically updated with the table headers (config.$headers).

+

So, when writing a custom widget that clones the table header, there is no longer a need to update the header class names, it's all done automatically.

+
+ + + + + + + jQuery Object + Internal list of all extra (cloned) table elements (v2.19.0; removed v2.21.3) +
+

This variable was removed due to it causing memory leak issues. To find extra tables use config.namespace as follows:

+
$( config.namespace + '_extra_table' )
+

Some widgets need to duplicate parts of the original table to provide functionality (e.g. stickyHeaders, scroller). This saved variable will either not exist or contain a jQuery object pointing to the cloned table elements.

+

This variable was added for the uitheme widget to allow dynamic updating of themes to the original table as well as all cloned parts.

+
+ + + + + +
diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index b79ad941..59c47ac9 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -559,7 +559,9 @@ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ], aria = ['ascending', 'descending'], // find the footer - $t = $(table).find('tfoot tr').children().add(c.$extraHeaders).removeClass(css.join(' ')); + $t = $(table).find('tfoot tr').children() + .add( $( c.namespace + '_extra_headers' ) ) + .removeClass( css.join( ' ' ) ); // remove all header information c.$headers .removeClass(css.join(' ')) @@ -1337,10 +1339,10 @@ var t, downTarget = null, c = table.config; if (core !== true) { - c.$extraHeaders = c.$extraHeaders ? c.$extraHeaders.add($headers) : $headers; + $headers.addClass( c.namespace.slice(1) + '_extra_headers' ); t = $.fn.closest ? $headers.closest('table')[0] : $headers.parents('table')[0]; if (t && t.nodeName === 'TABLE' && t !== table) { - c.$extraTables = c.$extraTables ? c.$extraTables.add(t) : $(t); + $(t).addClass( c.namespace.slice(1) + '_extra_table' ); } } // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc) @@ -2057,7 +2059,7 @@ format: function(table, c, wo) { var $tb, $tv, $tr, row, even, time, k, child = new RegExp(c.cssChildRow, 'i'), - b = c.$tbodies.add( c.$extraTables && c.$extraTables.children( 'tbody' ) ); + b = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody' ) ); if (c.debug) { time = new Date(); } diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index 6b62bcd7..53e1d9c2 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -4,7 +4,7 @@ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██ █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀ */ -/*! tablesorter (FORK) widgets - updated 03-24-2015 (v2.21.2)*/ +/*! tablesorter (FORK) widgets - updated 03-25-2015 (v2.21.2)*/ /* Includes: storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort */ (function(factory) { if (typeof define === 'function' && define.amd) { @@ -153,8 +153,8 @@ ts.addWidget({ format: function(table, c, wo) { var i, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme, themesAll = ts.themes, - $table = c.$table.add( c.$extraTables ), - $headers = c.$headers.add( c.$extraHeaders ), + $table = c.$table.add( $( c.namespace + '_extra_table' ) ), + $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ), theme = c.theme || 'jui', themes = themesAll[theme] || {}, remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), @@ -225,7 +225,10 @@ ts.addWidget({ } } for (i = 0; i < c.columns; i++) { - $header = c.$headers.add(c.$extraHeaders).not('.sorter-false').filter('[data-column="' + i + '"]'); + $header = c.$headers + .add($(c.namespace + '_extra_headers')) + .not('.sorter-false') + .filter('[data-column="' + i + '"]'); $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $(); $h = $headers.not('.sorter-false').filter('[data-column="' + i + '"]:last'); if ($h.length) { @@ -1775,7 +1778,7 @@ ts.addWidget({ nestedStickyTop = $nestedSticky.length ? $nestedSticky.height() : 0, // clone table, then wrap to make sticky header $stickyTable = wo.$sticky = $table.clone() - .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders) + .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders + ' ' + c.namespace.slice(1) + '_extra_table' ) .wrap('
'), $stickyWrap = $stickyTable.parent() .addClass(ts.css.stickyHide) @@ -1833,13 +1836,6 @@ ts.addWidget({ if ($attach.length && !$attach.css('position')) { $attach.css('position', 'relative'); } - // save stickyTable element to config - // it is also saved to wo.$sticky - if (c.$extraTables && c.$extraTables.length) { - c.$extraTables.add($stickyTable); - } else { - c.$extraTables = $stickyTable; - } // fix clone ID, if it exists - fixes #271 if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } // clear out cloned table, except for sticky header diff --git a/js/widgets/widget-stickyHeaders.js b/js/widgets/widget-stickyHeaders.js index d16a3947..7bfa28fc 100644 --- a/js/widgets/widget-stickyHeaders.js +++ b/js/widgets/widget-stickyHeaders.js @@ -95,7 +95,7 @@ ts.addWidget({ nestedStickyTop = $nestedSticky.length ? $nestedSticky.height() : 0, // clone table, then wrap to make sticky header $stickyTable = wo.$sticky = $table.clone() - .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders) + .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders + ' ' + c.namespace.slice(1) + '_extra_table' ) .wrap('
'), $stickyWrap = $stickyTable.parent() .addClass(ts.css.stickyHide) @@ -153,13 +153,6 @@ ts.addWidget({ if ($attach.length && !$attach.css('position')) { $attach.css('position', 'relative'); } - // save stickyTable element to config - // it is also saved to wo.$sticky - if (c.$extraTables && c.$extraTables.length) { - c.$extraTables.add($stickyTable); - } else { - c.$extraTables = $stickyTable; - } // fix clone ID, if it exists - fixes #271 if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } // clear out cloned table, except for sticky header diff --git a/js/widgets/widget-uitheme.js b/js/widgets/widget-uitheme.js index 1b2d4c8d..f3fad792 100644 --- a/js/widgets/widget-uitheme.js +++ b/js/widgets/widget-uitheme.js @@ -58,8 +58,8 @@ ts.addWidget({ format: function(table, c, wo) { var i, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme, themesAll = ts.themes, - $table = c.$table.add( c.$extraTables ), - $headers = c.$headers.add( c.$extraHeaders ), + $table = c.$table.add( $( c.namespace + '_extra_table' ) ), + $headers = c.$headers.add( $( c.namespace + '_extra_headers' ) ), theme = c.theme || 'jui', themes = themesAll[theme] || {}, remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), @@ -130,7 +130,10 @@ ts.addWidget({ } } for (i = 0; i < c.columns; i++) { - $header = c.$headers.add(c.$extraHeaders).not('.sorter-false').filter('[data-column="' + i + '"]'); + $header = c.$headers + .add($(c.namespace + '_extra_headers')) + .not('.sorter-false') + .filter('[data-column="' + i + '"]'); $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $(); $h = $headers.not('.sorter-false').filter('[data-column="' + i + '"]:last'); if ($h.length) {