summaryrefslogtreecommitdiffstats
path: root/web/_static/tablesorter/js
diff options
context:
space:
mode:
Diffstat (limited to 'web/_static/tablesorter/js')
-rw-r--r--web/_static/tablesorter/js/extras/jquery.dragtable.mod.min.js6
-rw-r--r--web/_static/tablesorter/js/extras/jquery.metadata.min.js3
-rw-r--r--web/_static/tablesorter/js/extras/jquery.tablesorter.pager.min.js7
-rw-r--r--web/_static/tablesorter/js/extras/semver-mod.min.js2
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.combined.js6093
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.combined.min.js4
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.js2916
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.min.js1
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.widgets.js3178
-rw-r--r--web/_static/tablesorter/js/jquery.tablesorter.widgets.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-extract.min.js11
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-iso8601.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-month.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-range.min.js11
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-two-digit-year.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date-weekday.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-date.min.js7
-rw-r--r--web/_static/tablesorter/js/parsers/parser-duration.min.js6
-rw-r--r--web/_static/tablesorter/js/parsers/parser-feet-inch-fraction.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-file-type.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-globalize.min.js7
-rw-r--r--web/_static/tablesorter/js/parsers/parser-huge-numbers.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-ignore-articles.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-image.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-input-select.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-leading-zeros.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-metric.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-named-numbers.min.js4
-rw-r--r--web/_static/tablesorter/js/parsers/parser-network.min.js9
-rw-r--r--web/_static/tablesorter/js/parsers/parser-roman.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-alignChar.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-build-table.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-chart.min.js3
-rw-r--r--web/_static/tablesorter/js/widgets/widget-columnSelector.min.js3
-rw-r--r--web/_static/tablesorter/js/widgets/widget-columns.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-cssStickyHeaders.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-currentSort.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-editable.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-filter-formatter-html5.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-filter-formatter-jui.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-filter-formatter-select2.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-filter-type-insideRange.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-filter.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-formatter.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-grouping.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-headerTitles.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-lazyload.min.js19
-rw-r--r--web/_static/tablesorter/js/widgets/widget-mark.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-math.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-output.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-pager.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-print.min.js3
-rw-r--r--web/_static/tablesorter/js/widgets/widget-reflow.min.js3
-rw-r--r--web/_static/tablesorter/js/widgets/widget-repeatheaders.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-resizable.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-saveSort.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-scroller.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-sort2Hash.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-sortTbodies.min.js8
-rw-r--r--web/_static/tablesorter/js/widgets/widget-staticRow.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-stickyHeaders.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-storage.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-toggle.min.js7
-rw-r--r--web/_static/tablesorter/js/widgets/widget-uitheme.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-vertical-group.min.js4
-rw-r--r--web/_static/tablesorter/js/widgets/widget-view.min.js3
66 files changed, 12482 insertions, 0 deletions
diff --git a/web/_static/tablesorter/js/extras/jquery.dragtable.mod.min.js b/web/_static/tablesorter/js/extras/jquery.dragtable.mod.min.js
new file mode 100644
index 0000000..c1123b5
--- /dev/null
+++ b/web/_static/tablesorter/js/extras/jquery.dragtable.mod.min.js
@@ -0,0 +1,6 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Dragtable Mod for TableSorter - updated 10/31/2015 (v2.24.0) */
+!function(w){"use strict";var p=w.tablesorter;p.dragtable={create:function(t){var a,e=t.originalTable.el,r=t.options.dragHandle.replace(".","");e.children("thead").children().children("th,td").each(function(){var e=w(this);e.find(t.options.dragHandle+",."+r+"-disabled").length||(a=!t.options.dragaccept||e.hasClass(t.options.dragaccept.replace(".","")),e.wrapInner('<div class="'+t.options.sortClass.replace(".","")+'"/>').prepend('<div class="'+r+(a?"":"-disabled")+'"></div>'))})},start:function(e){(e=w(e)[0])&&e.config&&(e.config.widgetOptions.dragtableLast={search:w(e).data("lastSearch"),order:p.dragtable.getOrder(e)})},update:function(e){var t,a,r,i=e.originalTable,n=i.el[0],o=w(n),l=n.config,s=l&&l.widgetOptions,d=i.startIndex-1,c=i.endIndex-1,h=p.dragtable.getOrder(n)||[],b=p.hasWidget(o,"filter")||!1,u=s&&s.dragtableLast||{},g=[];(u.order||[]).join("")!==h.join("")&&(l.sortList.length&&(a=w.extend(!0,[],l.sortList),w.each(h,function(e,t){r=p.isValueInArray(parseInt(t,10),a),t!==u.order[e]&&0<=r&&(l.sortList[r][0]=e)})),b&&w.each(u.search||[],function(e){g[e]=u.search[h[e]]}),(t=!!p.hasWidget(l.$table,"editable")&&s.editable_columnsArray)&&(l.widgetOptions.editable_columnsArray=p.dragtable.reindexArrayItem(t,d,c)),(t=!!p.hasWidget(l.$table,"math")&&s.math_ignore)&&(l.widgetOptions.math_ignore=p.dragtable.reindexArrayItem(t,d,c)),(t=!!p.hasWidget(l.$table,"resizable")&&s.resizable_widths)&&(s.resizable_widths=p.dragtable.moveArrayItem(t,d,c)),p.updateAll(l,!1,function(){b&&setTimeout(function(){l.lastCombinedFilter=null,l.$table.data("lastSearch",g),p.setFilters(o,g),w.isFunction(e.options.tablesorterComplete)&&e.options.tablesorterComplete(l.table)},10)}))},getOrder:function(e){return w(e).children("thead").children("."+p.css.headerRow).children().map(function(){return w(this).attr("data-column")}).get()||[]},startColumnMove:function(e){var t,a=e.el[0].config,r=e.startIndex-1,i=e.endIndex-1,n=a.columns-1,o=i!=n&&i<=r,l=a.$table.children().children("tr");a.debug&&console.log("Inserting column "+r+(o?" before":" after")+" column "+i),l.each(function(){(t=w(this).children()).eq(r)[o?"insertBefore":"insertAfter"](t.eq(i))}),(t=a.$table.children("colgroup").children()).eq(r)[o?"insertBefore":"insertAfter"](t.eq(i))},swapNodes:function(e,t){var a,r,i,n=e.length;for(a=0;a<n;a++)r=e[a].parentNode,i=e[a].nextSibling===t[a]?e[a]:e[a].nextSibling,t[a].parentNode.insertBefore(e[a],t[a]),r.insertBefore(t[a],i)},moveArrayItem:function(e,t,a){var r,i=e.length;if(i<=a)for(r=a-i;1+r--;)e.push(void 0);return e.splice(a,0,e.splice(t,1)[0]),e},reindexArrayItem:function(e,a,r){var t=w.inArray(r,e),i=w.inArray(a,e),n=(Math.max.apply(Math,e),[]);return 0<=t&&0<=i?e:(w.each(e,function(e,t){r<a?r<=t?n.push(t+(t<a?1:0)):n.push(t):a<r&&(t===a?n.push(r):t<r&&a<=t?n.push(t-1):t<=r?n.push(t):a<t&&n.push(t+(t<r?0:1)))}),n.sort())}},
+/*! dragtable v2.0.14 Mod */
+w.widget("akottr.dragtable",{options:{revert:!1,dragHandle:".table-handle",maxMovingRows:40,excludeFooter:!1,onlyHeaderThreshold:100,dragaccept:null,persistState:null,restoreState:null,exact:!0,clickDelay:10,containment:null,cursor:"move",cursorAt:!1,distance:0,tolerance:"pointer",axis:"x",beforeStart:w.noop,beforeMoving:w.noop,beforeReorganize:w.noop,beforeStop:w.noop,tablesorterComplete:null,sortClass:".sorter"},originalTable:{el:null,selectedHandle:null,sortOrder:null,startIndex:0,endIndex:0},sortableTable:{el:w(),selectedHandle:w(),movingRow:w()},persistState:function(){var t=this;this.originalTable.el.find("th").each(function(e){""!==this.id&&(t.originalTable.sortOrder[this.id]=e)}),w.ajax({url:this.options.persistState,data:this.originalTable.sortOrder})},_restoreState:function(e){for(var t in e)t in e&&(this.originalTable.startIndex=w("#"+t).closest("th").prevAll().length+1,this.originalTable.endIndex=parseInt(e[t],10)+1,this._bubbleCols())},_bubbleCols:function(){p.dragtable.startColumnMove(this.originalTable)},_rearrangeTableBackroundProcessing:function(){var e=this;return function(){e._bubbleCols(),e.options.beforeStop(e.originalTable),e.sortableTable.el.remove(),function(){w("#__dragtable_disable_text_selection__").remove(),t?w(document.body).attr("onselectstart",t):w(document.body).removeAttr("onselectstart");a?w(document.body).attr("unselectable",a):w(document.body).removeAttr("unselectable")}(),p.dragtable.update(e),w.isFunction(e.options.persistState)?e.options.persistState(e.originalTable):e.persistState()}},_rearrangeTable:function(){var e=this;return function(){e.originalTable.selectedHandle.removeClass("dragtable-handle-selected"),e.sortableTable.el.sortable("disable"),e.sortableTable.el.addClass("dragtable-disabled"),e.options.beforeReorganize(e.originalTable,e.sortableTable),e.originalTable.endIndex=e.sortableTable.movingRow.prevAll().length+1,setTimeout(e._rearrangeTableBackroundProcessing(),50)}},_generateSortable:function(e){e.cancelBubble?e.cancelBubble=!0:e.stopPropagation();for(var t=this,a=this.originalTable.el[0].attributes,r="",i=0;i<a.length;i++)(a[i].value||a[i].nodeValue)&&"id"!=a[i].nodeName&&"width"!=a[i].nodeName&&(r+=a[i].nodeName+'="'+(a[i].value||a[i].nodeValue)+'" ');var n=[],o=[];t.originalTable.el.children("thead, tbody").children("tr:visible").slice(0,t.options.maxMovingRow).each(function(){for(var e=this.attributes,t="",a=0;a<e.length;a++)(e[a].value||e[a].nodeValue)&&"id"!=e[a].nodeName&&(t+=" "+e[a].nodeName+'="'+(e[a].value||e[a].nodeValue)+'"');n.push(t),o.push(w(this).height())});var l=[],s=0,d=t.originalTable.el.children(),c=d.filter("thead").children("tr:visible"),h=d.filter("tbody").children("tr:visible");if(c.eq(0).children("th, td").filter(":visible").each(function(){var e=w(this).outerWidth();l.push(e),s+=e}),t.options.exact){var b=s-t.originalTable.el.outerWidth();l[0]-=b}s+=2;var u=0;d.filter("caption").each(function(){u+=w(this).outerHeight()});var g,p='<ul class="dragtable-sortable" style="position:absolute; width:'+s+'px;">',f=[],m=c.eq(0).children("th, td").length;for(i=0;i<m;i++){var v=c.children(":nth-child("+(i+1)+")");v.is(":visible")&&(g=0,f[i]='<li style="width:'+v.outerWidth()+'px;"><table '+r+">"+(u?'<caption style="height:'+u+'px;"></caption>':"")+"<thead>",c.each(function(e){f[i]+="<tr "+n[g++]+(o[e]?' style="height:'+o[e]+'px;"':"")+">"+v[e].outerHTML+"</tr>"}),f[i]+="</thead><tbody>",v=h.children(":nth-child("+(i+1)+")"),1<t.options.maxMovingRows&&(v=v.add(h.children(":nth-child("+(i+1)+")").slice(0,t.options.maxMovingRows-1))),v.each(function(e){f[i]+="<tr "+n[g++]+(o[e]?' style="height:'+o[e]+'px;"':"")+">"+this.outerHTML+"</tr>"}),f[i]+="</tbody>",t.options.excludeFooter||(f[i]+="<tfoot><tr "+n[g++]+">"+d.filter("tfoot").children("tr:visible").children()[i].outerHTML+"</tr></tfoot>"),f[i]+="</table></li>")}p+=f.join("")+"</ul>",this.sortableTable.el=this.originalTable.el.before(p).prev(),this.sortableTable.el.find("> li > table").each(function(e){w(this).css("width",l[e]+"px")}),this.sortableTable.selectedHandle=this.sortableTable.el.find("th .dragtable-handle-selected");var T,y=this.options.dragaccept?"li:has("+this.options.dragaccept+")":"li";this.sortableTable.el.sortable({items:y,stop:this._rearrangeTable(),revert:this.options.revert,tolerance:this.options.tolerance,containment:this.options.containment,cursor:this.options.cursor,cursorAt:this.options.cursorAt,distance:this.options.distance,axis:this.options.axis}),this.originalTable.startIndex=w(e.target).closest("th,td").prevAll().length+1,this.options.beforeMoving(this.originalTable,this.sortableTable),this.sortableTable.movingRow=this.sortableTable.el.children("li:nth-child("+this.originalTable.startIndex+")"),T=w('<style id="__dragtable_disable_text_selection__" type="text/css">body { -ms-user-select:none;-moz-user-select:-moz-none;-khtml-user-select:none;-webkit-user-select:none;user-select:none; }</style>'),w(document.head).append(T),w(document.body).attr("onselectstart","return false;").attr("unselectable","on"),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty(),this.sortableTable.movingRow.trigger(w.extend(w.Event(e.type),{which:1,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY}));var x=this.sortableTable.el.find(".ui-sortable-placeholder");0<x.height()&&x.css("height",this.sortableTable.el.find(".ui-sortable-helper").height()),x.html('<div class="outer" style="height:100%;"><div class="inner" style="height:100%;"></div></div>')},bindTo:{},_create:function(){var t=this;t.originalTable={el:t.element,selectedHandle:w(),sortOrder:{},startIndex:0,endIndex:0},p.dragtable.create(t),t.bindTo="> thead > tr > "+(t.options.dragaccept||"th, td"),t.element.find(t.bindTo).find(t.options.dragHandle).length&&(t.bindTo+=" "+t.options.dragHandle),w.isFunction(t.options.restoreState)?t.options.restoreState(t.originalTable):t._restoreState(t.options.restoreState),t.originalTable.el.on("mousedown.dragtable",t.bindTo,function(e){1===e.which&&(p.dragtable.start(t.originalTable.el),!1!==t.options.beforeStart(t.originalTable)&&(clearTimeout(t.downTimer),t.downTimer=setTimeout(function(){t.originalTable.selectedHandle=w(t),t.originalTable.selectedHandle.addClass("dragtable-handle-selected"),t._generateSortable(e)},t.options.clickDelay)))}).on("mouseup.dragtable",t.options.dragHandle,function(){clearTimeout(t.downTimer)})},redraw:function(){this.destroy(),this._create()},destroy:function(){this.originalTable.el.off("mousedown.dragtable mouseup.dragtable",this.bindTo),w.Widget.prototype.destroy.apply(this,arguments)}});var t=w(document.body).attr("onselectstart"),a=w(document.body).attr("unselectable")}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/extras/jquery.metadata.min.js b/web/_static/tablesorter/js/extras/jquery.metadata.min.js
new file mode 100644
index 0000000..915820e
--- /dev/null
+++ b/web/_static/tablesorter/js/extras/jquery.metadata.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/(\{.*\})/,single:"metadata"},setType:function(t,e){this.defaults.type=t,this.defaults.name=e},get:function(elem,opts){var data,m,e,attr,settings=$.extend({},this.defaults,opts);if(settings.single.length||(settings.single="metadata"),data=$.data(elem,settings.single),data)return data;if(data="{}","class"===settings.type)m=settings.cre.exec(elem.className),m&&(data=m[1]);else if("elem"===settings.type){if(!elem.getElementsByTagName)return;e=elem.getElementsByTagName(settings.name),e.length&&(data=$.trim(e[0].innerHTML))}else void 0!==elem.getAttribute&&(attr=elem.getAttribute(settings.name),attr&&(data=attr));return data.indexOf("{")<0&&(data="{"+data+"}"),data=eval("("+data+")"),$.data(elem,settings.single,data),data}}}),$.fn.metadata=function(t){return $.metadata.get(this[0],t)}}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/extras/jquery.tablesorter.pager.min.js b/web/_static/tablesorter/js/extras/jquery.tablesorter.pager.min.js
new file mode 100644
index 0000000..659cd96
--- /dev/null
+++ b/web/_static/tablesorter/js/extras/jquery.tablesorter.pager.min.js
@@ -0,0 +1,7 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*!
+* tablesorter (FORK) pager plugin
+* updated 2020-03-03 (v2.31.3)
+*/
+!function(M){"use strict";var T=M.tablesorter;M.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(e,t){return t},ajaxError:null,ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(e){return e},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};function u(e,t,a){var i,s="addClass",r="removeClass",o=t.cssDisabled,n=!!a,l=n||0===t.page,g=O(e,t),c=n||t.page===g-1||0===g;t.updateArrows&&((i=t.$container.find(t.cssFirst+","+t.cssPrev))[l?s:r](o),i.each(function(){this.ariaDisabled=l}),(i=t.$container.find(t.cssNext+","+t.cssLast))[c?s:r](o),i.each(function(){this.ariaDisabled=c}))}function h(e,t){var a,i,s,r=e.config,o=r.$table.hasClass("hasFilters");if(o&&!t.ajax)if(T.isEmptyObject(r.cache))t.filteredRows=t.totalRows=r.$tbodies.eq(0).children("tr").not(t.countChildRows?"":"."+r.cssChildRow).length;else for(t.filteredRows=0,s=(a=r.cache[0].normalized).length,i=0;i<s;i++)t.filteredRows+=t.regexRows.test(a[i][r.columns].$row[0].className)?0:1;else o||(t.filteredRows=t.totalRows)}function y(e,n,t){if(!n.initializing){var a,i,s,r,o,l,g,c,d=e.config,p=d.namespace+"pager",f=L(n,n.size,"get");if("all"===f&&(f=n.totalRows),n.countChildRows&&(i[i.length]=d.cssChildRow),n.totalPages=Math.ceil(n.totalRows/f),d.totalRows=n.totalRows,E(e,n),h(e,n),d.filteredRows=n.filteredRows,n.filteredPages=Math.ceil(n.filteredRows/f)||0,0<=O(e,n)){if(i=f*n.page>n.filteredRows&&t,n.page=i?n.pageReset||0:n.page,n.startRow=i?f*n.page+1:0===n.filteredRows?0:f*n.page+1,n.endRow=Math.min(n.filteredRows,n.totalRows,f*(n.page+1)),s=n.$container.find(n.cssPageDisplay),a="function"==typeof n.output?n.output(e,n):(c=s.attr("data-pager-output"+(n.filteredRows<n.totalRows?"-filtered":""))||n.output,(n.ajaxData&&n.ajaxData.output&&n.ajaxData.output||c).replace(/\{page([\-+]\d+)?\}/gi,function(e,t){return n.totalPages?n.page+(t?parseInt(t,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(e){var t,a,i=e.replace(/[{}\s]/g,""),s=i.split(":"),r=n.ajaxData,o=/(rows?|pages?)$/i.test(i)?0:"";return/(startRow|page)/.test(s[0])&&"input"===s[1]?(t=(""+("page"===s[0]?n.totalPages:n.totalRows)).length,a="page"===s[0]?n.page+1:n.startRow,'<input type="text" class="ts-'+s[0]+'" style="max-width:'+t+'em" value="'+a+'"/>'):1<s.length&&r&&r[s[0]]?r[s[0]][s[1]]:n[i]||(r?r[i]:o)||o})),(r=n.$container.find(n.cssGoto)).length){for(i="",l=(g=I(e,n)).length,o=0;o<l;o++)i+='<option value="'+g[o]+'">'+g[o]+"</option>";r.html(i).val(n.page+1)}s.length&&(s["INPUT"===s[0].nodeName?"val":"html"](a),s.find(".ts-startRow, .ts-page").unbind("change"+p).bind("change"+p,function(){var e=M(this).val(),t=M(this).hasClass("ts-startRow")?Math.floor(e/f)+1:e;d.$table.triggerHandler("pageSet"+p,[t])}))}u(e,n),N(e,n),n.initialized&&!1!==t&&(T.debug(d,"pager")&&console.log("Pager >> Triggering pagerComplete"),d.$table.triggerHandler("pagerComplete",n),n.savePages&&T.storage&&T.storage(e,n.storageKey,{page:n.page,size:f===n.totalRows?"all":f}))}}function f(e,t){var a,i=e.config,s=i.$tbodies.eq(0);s.find("tr.pagerSavedHeightSpacer").remove(),s.children("tr:visible").length||s.append('<tr class="pagerSavedHeightSpacer '+i.selectorRemove.slice(1)+'"><td>&nbsp</td></tr>'),a=s.children("tr").eq(0).height()*("all"===t.size?t.totalRows:t.size),M.data(e,"pagerSavedHeight",a),N(e,t),M.data(e,"pagerLastSize",t.size)}function w(e,t){if(!t.ajaxUrl){var a,i=0,s=e.config,r=s.$tbodies.eq(0).children("tr"),o=r.length,n="all"===t.size?t.totalRows:t.size,l=t.page*n,g=l+n,c=-1,d=0;for(t.cacheIndex=[],a=0;a<o;a++)t.regexFiltered.test(r[a].className)||(d===l&&r[a].className.match(s.cssChildRow)?r[a].style.display="none":(r[a].style.display=l<=d&&d<g?"":"none",c!==d&&l<=d&&d<g&&(t.cacheIndex[t.cacheIndex.length]=a,c=d),(d+=r[a].className.match(s.cssChildRow+"|"+s.selectorRemove.slice(1))&&!t.countChildRows?0:1)===g&&"none"!==r[a].style.display&&r[a].className.match(T.css.cssHasChild)&&(i=a)));if(0<i&&r[i].className.match(T.css.cssHasChild))for(;++i<o&&r[i].className.match(s.cssChildRow);)r[i].style.display=""}}function b(e,t){t.size=L(t,t.$container.find(t.cssPageSize).val(),"get"),D(e,t.size,t),u(e,t),t.removeRows||(w(e,t),M(e).bind("sortEnd filterEnd ".split(" ").join(e.config.namespace+"pager "),function(){w(e,t)}))}function R(e,t,a,i,s,r){if("function"==typeof a.ajaxProcessing){t.config.$tbodies.eq(0).empty();var o,n,l,g,c,d,p,f,u,h,w,b,R,z,x,j=t.config,P=j.$table,v="",m=a.ajaxProcessing(e,t,i)||[0,[]];if(T.showError(t),r)T.debug(j,"pager")&&console.error("Pager >> Ajax Error",i,s,r),T.showError(t,i,s,r),j.$tbodies.eq(0).children("tr").detach(),a.totalRows=0;else{if(M.isArray(m)?(R=m[(l=isNaN(m[0])&&!isNaN(m[1]))?1:0],a.totalRows=isNaN(R)?a.totalRows||0:R,j.totalRows=j.filteredRows=a.filteredRows=a.totalRows,w=0===a.totalRows?[]:m[l?0:1]||[],h=m[2]):(a.ajaxData=m,j.totalRows=a.totalRows=m.total,j.filteredRows=a.filteredRows=void 0!==m.filteredRows?m.filteredRows:m.total,h=m.headers,w=m.rows||[]),b=w&&w.length,w instanceof M)a.processAjaxOnInit&&(j.$tbodies.eq(0).empty(),j.$tbodies.eq(0).append(w));else if(b){for(o=0;o<b;o++){for(v+="<tr>",n=0;n<w[o].length;n++)v+=/^\s*<td/.test(w[o][n])?M.trim(w[o][n]):"<td>"+w[o][n]+"</td>";v+="</tr>"}a.processAjaxOnInit&&j.$tbodies.eq(0).html(v)}if(a.processAjaxOnInit=!0,h)for(d=(g=P.hasClass("hasStickyHeaders"))?j.widgetOptions.$sticky.children("thead:first").children("tr:not(."+j.cssIgnoreRow+")").children():"",c=P.find("tfoot tr:first").children(),z=(p=j.$headers.filter("th ")).length,n=0;n<z;n++)(f=p.eq(n)).find("."+T.css.icon).length?(u=f.find("."+T.css.icon).clone(!0),f.find("."+T.css.headerIn).html(h[n]).append(u),g&&d.length&&(u=d.eq(n).find("."+T.css.icon).clone(!0),d.eq(n).find("."+T.css.headerIn).html(h[n]).append(u))):(f.find("."+T.css.headerIn).html(h[n]),g&&d.length&&(a.$container=a.$container.add(j.widgetOptions.$sticky),d.eq(n).find("."+T.css.headerIn).html(h[n]))),c.eq(n).html(h[n])}j.showProcessing&&T.isProcessing(t),x=L(a,a.size,"get"),a.totalPages="all"===x?1:Math.ceil(a.totalRows/x),a.last.totalRows=a.totalRows,a.last.currentFilters=a.currentFilters,a.last.sortList=(j.sortList||[]).join(","),y(t,a,!1),T.updateCache(j,function(){a.initialized&&setTimeout(function(){T.debug(j,"pager")&&console.log("Pager >> Triggering pagerChange"),P.triggerHandler("pagerChange",a),T.applyWidget(t),y(t,a,!0)},0)})}a.initialized||U(t,a)}function z(e,t,a){var i,s,r,o,n=M(e),l=e.config,g=T.debug(l,"pager"),c=l.$table.hasClass("hasFilters"),d=t&&t.length||0,p="all"===a.size?a.totalRows:a.size,f=a.page*p;if(d<1)g&&console.warn("Pager >> No rows for pager to render");else{if(a.page>=a.totalPages&&q(e,a),a.cacheIndex=[],a.isDisabled=!1,a.initialized&&(g&&console.log("Pager >> Triggering pagerChange"),n.triggerHandler("pagerChange",a)),a.removeRows){for(T.clearTableBody(e),i=T.processTbody(e,l.$tbodies.eq(0),!0),r=s=c?0:f,o=0;o<p&&s<t.length;)c&&a.regexFiltered.test(t[s][0].className)||f<++r&&o<=p&&(o++,a.cacheIndex[a.cacheIndex.length]=s,i.append(t[s])),s++;T.processTbody(e,i,!1)}else w(e,a);y(e,a),e.isUpdating&&(g&&console.log("Pager >> Triggering updateComplete"),n.triggerHandler("updateComplete",[e,!0]))}}function x(e,t){var a,i,s;for(t.ajax?u(e,t,!0):(M.data(e,"pagerLastPage",t.page),M.data(e,"pagerLastSize",t.size),t.page=0,t.size=t.totalRows,t.totalPages=1,M(e).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),z(e,e.config.rowsCopy,t),t.isDisabled=!0,T.applyWidget(e),T.debug(e.config,"pager")&&console.log("Pager >> Disabled")),s=(i=t.$container.find(t.cssGoto+","+t.cssPageSize+", .ts-startRow, .ts-page")).length,a=0;a<s;a++)i.eq(a).addClass(t.cssDisabled)[0].disabled=!0,i[a].ariaDisabled=!0}function j(i){var s=i.config,r=s.pager;T.updateCache(s,function(){var e,t=[],a=i.config.cache[0].normalized;for(r.totalRows=a.length,e=0;e<r.totalRows;e++)t[t.length]=a[e][s.columns].$row;s.rowsCopy=t,F(i,r,!0)})}function P(e,t){t.page=0,F(e,t)}function v(e,t){t.page++;var a=O(e,t)-1;t.page>=a&&(t.page=a),F(e,t)}function m(e,t){t.page--,t.page<=0&&(t.page=0),F(e,t)}function C(e,t,a){var i,s,r,o=e.config;t.$container.find(t.cssGoto+","+t.cssPageSize+",.ts-startRow, .ts-page").removeClass(t.cssDisabled).removeAttr("disabled").each(function(){this.ariaDisabled=!1}),t.isDisabled=!1,t.page=M.data(e,"pagerLastPage")||t.page||0,s=(r=t.$container.find(t.cssPageSize)).find("option[selected]").val(),t.size=M.data(e,"pagerLastSize")||L(t,s,"get"),t.totalPages="all"===t.size?1:Math.ceil(O(e,t)/t.size),D(e,t.size,t),e.id&&!o.$table.attr("aria-describedby")&&((i=(r=t.$container.find(t.cssPageDisplay)).attr("id"))||(i=e.id+"_pager_info",r.attr("id",i)),o.$table.attr("aria-describedby",i)),f(e,t),a&&(T.update(o),D(e,t.size,t),F(e,t),b(e,t),T.debug(o,"pager")&&console.log("Pager >> Enabled"))}var S="filterInit filterStart filterEnd sortEnd disablePager enablePager destroyPager updateComplete pageSize pageSet pageAndSize pagerUpdate refreshComplete ",$=this,I=function(e,t){var a,i,s,r,o,n,l=O(e,t)||1,g=5*Math.ceil(l/t.maxOptionSize/5),c=l>t.maxOptionSize,d=t.page+1,p=g,f=l-g,u=[1];for(a=c?g:1;a<=l;)u[u.length]=a,a+=c?g:1;if(u[u.length]=l,c){for(s=[],(p=d-(i=Math.max(Math.floor(t.maxOptionSize/g)-1,5)))<1&&(p=1),l<(f=d+i)&&(f=l),a=p;a<=f;a++)s[s.length]=a;g/2<(o=(u=M.grep(u,function(e,t){return M.inArray(e,u)===t})).length)-(n=s.length)&&o+n>t.maxOptionSize&&(r=Math.floor(o/2)-Math.floor(n/2),Array.prototype.splice.apply(u,[r,n])),u=u.concat(s)}return u=M.grep(u,function(e,t){return M.inArray(e,u)===t}).sort(function(e,t){return e-t})},N=function(e,t){var a,i,s,r=e.config,o=r.$tbodies.eq(0);o.find("tr.pagerSavedHeightSpacer").remove(),t.fixedHeight&&!t.isDisabled&&(i=M.data(e,"pagerSavedHeight"))&&(s=0,1<M(e).css("border-spacing").split(" ").length&&(s=M(e).css("border-spacing").split(" ")[1].replace(/[^-\d\.]/g,"")),5<(a=i-o.height()+s*t.size-s)&&M.data(e,"pagerLastSize")===t.size&&o.children("tr:visible").length<("all"===t.size?t.totalRows:t.size)&&o.append('<tr class="pagerSavedHeightSpacer '+r.selectorRemove.slice(1)+'" style="height:'+a+'px;"></tr>'))},A=function(e,a){var t,i,s=e.config,r=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(e,t){return a.page+(t?parseInt(t,10):0)}).replace(/\{size\}/g,a.size):"",o=s.sortList,n=a.currentFilters||M(e).data("lastSearch")||[],l=r.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),g=r.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),c=[];if(l){for(l=l[1],i=o.length,t=0;t<i;t++)c[c.length]=l+"["+o[t][0]+"]="+o[t][1];r=r.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,c.length?c.join("&"):l),c=[]}if(g){for(g=g[1],i=n.length,t=0;t<i;t++)n[t]&&(c[c.length]=g+"["+t+"]="+encodeURIComponent(n[t]));r=r.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,c.length?c.join("&"):g),a.currentFilters=n}return"function"==typeof a.customAjaxUrl&&(r=a.customAjaxUrl(e,r)),T.debug(s,"pager")&&console.log("Pager >> Ajax url = "+r),r},F=function(e,t,a){if(!t.isDisabled){var i,s,r,o,n,l,g,c,d=e.config,p=T.debug(d,"pager"),f=M(e),u=t.last;if(!1!==a&&t.initialized&&T.isEmptyObject(d.cache))return j(e);if(!t.ajax||!T.hasWidget(e,"filter")||d.widgetOptions.filter_initialized)if(E(e,t),h(e,t),u.currentFilters=""===(u.currentFilters||[]).join("")?[]:u.currentFilters,t.currentFilters=""===(t.currentFilters||[]).join("")?[]:t.currentFilters,u.page!==t.page||u.size!==t.size||u.totalRows!==t.totalRows||(u.currentFilters||[]).join(",")!==(t.currentFilters||[]).join(",")||(u.ajaxUrl||"")!==(t.ajaxObject.url||"")||(u.optAjaxUrl||"")!==(t.ajaxUrl||"")||u.sortList!==(d.sortList||[]).join(","))p&&console.log("Pager >> Changing to page "+t.page),t.last={page:t.page,size:t.size,sortList:(d.sortList||[]).join(","),totalRows:t.totalRows,currentFilters:t.currentFilters||[],ajaxUrl:t.ajaxObject.url||"",optAjaxUrl:t.ajaxUrl||""},t.ajax?t.processAjaxOnInit||T.isEmptyObject(t.initialRows)?(n=A(s=e,r=t),l=M(document),g=s.config,c=g.namespace+"pager",""!==n&&(g.showProcessing&&T.isProcessing(s,!0),l.bind("ajaxError"+c,function(e,t,a,i){R(null,s,r,t,a,i),l.unbind("ajaxError"+c)}),o=++r.ajaxCounter,r.last.ajaxUrl=n,r.ajaxObject.url=n,r.ajaxObject.success=function(e,t,a){o<r.ajaxCounter||(R(e,s,r,a),l.unbind("ajaxError"+c),"function"==typeof r.oldAjaxSuccess&&r.oldAjaxSuccess(e))},T.debug(g,"pager")&&console.log("Pager >> Ajax initialized",r.ajaxObject),M.ajax(r.ajaxObject))):(t.processAjaxOnInit=!0,i=t.initialRows,t.totalRows=void 0!==i.total?i.total:p&&console.error("Pager >> No initial total page set!")||0,t.filteredRows=void 0!==i.filtered?i.filtered:p&&console.error("Pager >> No initial filtered page set!")||0,U(e,t)):t.ajax||z(e,d.rowsCopy,t),M.data(e,"pagerLastPage",t.page),t.initialized&&!1!==a&&(p&&console.log("Pager >> Triggering pageMoved"),f.triggerHandler("pageMoved",t),T.applyWidget(e),e.isUpdating&&(p&&console.log("Pager >> Triggering updateComplete"),f.triggerHandler("updateComplete",[e,!0])))}},O=function(e,t){return T.hasWidget(e,"filter")?Math.min(t.totalPages,t.filteredPages):t.totalPages},E=function(e,t){var a=O(e,t)-1;return t.page=parseInt(t.page,10),(t.page<0||isNaN(t.page))&&(t.page=0),t.page>a&&0<=a&&(t.page=a),t.page},L=function(e,t,a){var i=parseInt(t,10)||e.size||e.settings.size||10;return e.initialized&&(/all/i.test(i+" "+t)||i===e.totalRows)?e.$container.find(e.cssPageSize+' option[value="all"]').length?"all":e.totalRows:"get"===a?i:e.size},D=function(e,t,a){a.size=L(a,t,"get"),a.$container.find(a.cssPageSize).val(a.size),M.data(e,"pagerLastPage",E(e,a)),M.data(e,"pagerLastSize",a.size),a.totalPages="all"===a.size?1:Math.ceil(a.totalRows/a.size),a.filteredPages="all"===a.size?1:Math.ceil(a.filteredRows/a.size)},q=function(e,t){t.page=O(e,t)-1,F(e,t)},U=function(e,t){t.initialized=!0,t.initializing=!1,T.debug(e.config,"pager")&&console.log("Pager >> Triggering pagerInitialized"),M(e).triggerHandler("pagerInitialized",t),T.applyWidget(e),y(e,t)},H=function(o,e){var t,s,r,a,n=o.config,i=n.widgetOptions,l=T.debug(n,"pager"),g=n.pager=M.extend(!0,{},M.tablesorterPager.defaults,e),c=n.$table,d=n.namespace+"pager",p=g.$container=M(g.container).addClass("tablesorter-pager").show();g.settings=M.extend(!0,{},M.tablesorterPager.defaults,e),l&&console.log("Pager >> Initializing"),g.oldAjaxSuccess=g.oldAjaxSuccess||g.ajaxObject.success,n.appender=$.appender,g.initializing=!0,g.savePages&&T.storage&&(t=T.storage(o,g.storageKey)||{},g.page=isNaN(t.page)?g.page:t.page,g.size="all"===t.size?t.size:(isNaN(t.size)?g.size:t.size)||g.setSize||10,D(o,g.size,g)),g.regexRows=new RegExp("("+(i.filter_filteredRow||"filtered")+"|"+n.selectorRemove.slice(1)+"|"+n.cssChildRow+")"),g.regexFiltered=new RegExp(i.filter_filteredRow||"filtered"),c.unbind(S.split(" ").join(d+" ").replace(/\s+/g," ")).bind("filterInit filterStart ".split(" ").join(d+" "),function(e,t){var a;if(g.currentFilters=M.isArray(t)?t:n.$table.data("lastSearch"),g.ajax&&"filterInit"===e.type)return F(o,g,!1);a=T.filter.equalFilters?T.filter.equalFilters(n,n.lastSearch,g.currentFilters):(n.lastSearch||[]).join("")!==(g.currentFilters||[]).join(""),"filterStart"!==e.type||!1===g.pageReset||a||(g.page=g.pageReset)}).bind("filterEnd sortEnd ".split(" ").join(d+" "),function(){g.currentFilters=n.$table.data("lastSearch"),(g.initialized||g.initializing)&&(n.delayInit&&n.rowsCopy&&0===n.rowsCopy.length&&j(o),y(o,g,!1),F(o,g,!1),T.applyWidget(o))}).bind("disablePager"+d,function(e){e.stopPropagation(),x(o,g)}).bind("enablePager"+d,function(e){e.stopPropagation(),C(o,g,!0)}).bind("destroyPager"+d,function(e){var t,a,i,s,r;e.stopPropagation(),a=g,i=(t=o).config,s=i.namespace+"pager",r=[a.cssFirst,a.cssPrev,a.cssNext,a.cssLast,a.cssGoto,a.cssPageSize].join(","),x(t,a),a.$container.hide().find(r).unbind(s),i.appender=null,i.$table.unbind(s),T.storage&&T.storage(t,a.storageKey,""),delete i.pager,delete i.rowsCopy}).bind("resetToLoadState"+d,function(e){var t,a;e.stopPropagation(),a=g,(t=o).config.pager=M.extend(!0,{},M.tablesorterPager.defaults,a.settings),H(t,a.settings)}).bind("updateComplete"+d,function(e,t,a){if(e.stopPropagation(),t&&!a&&!g.ajax){var i=n.$tbodies.eq(0).children("tr").not(n.selectorRemove);g.totalRows=i.length-(g.countChildRows?0:i.filter("."+n.cssChildRow).length),g.totalPages="all"===g.size?1:Math.ceil(g.totalRows/g.size),i.length&&n.rowsCopy&&0===n.rowsCopy.length&&j(t),g.page>=g.totalPages&&q(t,g),w(t,g),f(t,g),y(t,g,!0)}}).bind("pageSize refreshComplete ".split(" ").join(d+" "),function(e,t){e.stopPropagation(),D(o,L(g,t,"get"),g),F(o,g),w(o,g),y(o,g,!1)}).bind("pageSet pagerUpdate ".split(" ").join(d+" "),function(e,t){e.stopPropagation(),"pagerUpdate"===e.type&&(t=void 0===t?g.page+1:t,g.last.page=!0),g.page=(parseInt(t,10)||1)-1,F(o,g,!0),y(o,g,!1)}).bind("pageAndSize"+d,function(e,t,a){e.stopPropagation(),g.page=(parseInt(t,10)||1)-1,D(o,L(g,a,"get"),g),F(o,g,!0),w(o,g),y(o,g,!1)}),s=[g.cssFirst,g.cssPrev,g.cssNext,g.cssLast],r=[P,m,v,q],l&&!p.length&&console.warn('Pager >> "container" not found'),p.find(s.join(",")).attr("tabindex",0).unbind("click"+d).bind("click"+d,function(e){e.stopPropagation();var t,a=M(this),i=s.length;if(!a.hasClass(g.cssDisabled))for(t=0;t<i;t++)if(a.is(s[t])){r[t](o,g);break}}),(a=p.find(g.cssGoto)).length?a.unbind("change"+d).bind("change"+d,function(){g.page=M(this).val()-1,F(o,g,!0),y(o,g,!1)}):l&&console.warn('Pager >> "goto" selector not found'),(a=p.find(g.cssPageSize)).length?(a.find("option").removeAttr("selected"),a.unbind("change"+d).bind("change"+d,function(){if(!M(this).hasClass(g.cssDisabled)){var e=M(this).val();D(o,e,g),F(o,g),f(o,g)}return!1})):l&&console.warn('Pager >> "size" selector not found'),g.initialized=!1,c.triggerHandler("pagerBeforeInitialized",g),C(o,g,!1),"string"==typeof g.ajaxUrl?(g.ajax=!0,n.widgetOptions.filter_serversideFiltering=!0,n.serverSideSorting=!0,F(o,g)):(g.ajax=!1,T.appendCache(n,!0),b(o,g)),g.ajax||g.initialized||(g.initializing=!1,g.initialized=!0,D(o,g.size,g),F(o,g),l&&console.log("Pager >> Triggering pagerInitialized"),n.$table.triggerHandler("pagerInitialized",g),n.widgetOptions.filter_initialized&&T.hasWidget(o,"filter")||y(o,g,!1)),n.widgetInit.pager=!0};$.appender=function(e,t){var a=e.config,i=a.pager;i.ajax||(a.rowsCopy=t,i.totalRows=i.countChildRows?a.$tbodies.eq(0).children("tr").length:t.length,i.size=M.data(e,"pagerLastSize")||i.size||i.settings.size||10,i.totalPages="all"===i.size?1:Math.ceil(i.totalRows/i.size),z(e,t,i),y(e,i,!1))},$.construct=function(e){return this.each(function(){this.config&&this.hasInitialized&&H(this,e)})}}}),T.showError=function(e,t,a,i){function s(){o.$table.find("thead").find(o.selectorRemove).remove()}var r=M(e),o=r[0].config,n=o&&o.widgetOptions,l=o.pager&&o.pager.cssErrorRow||n&&n.pager_css&&n.pager_css.errorRow||"tablesorter-errorRow",g=typeof t,c=!0,d="";if(r.length){if("function"==typeof o.pager.ajaxError){if(!1===(c=o.pager.ajaxError(o,t,a,i)))return s();d=c}else if("function"==typeof n.pager_ajaxError){if(!1===(c=n.pager_ajaxError(o,t,a,i)))return s();d=c}if(""===d)if("object"==g)d=0===t.status?"Not connected, verify Network":404===t.status?"Requested page not found [404]":500===t.status?"Internal Server Error [500]":"parsererror"===i?"Requested JSON parse failed":"timeout"===i?"Time out error":"abort"===i?"Ajax Request aborted":"Uncaught error: "+t.statusText+" ["+t.status+"]";else{if("string"!=g)return s();d=t}M(/tr\>/.test(d)?d:'<tr><td colspan="'+o.columns+'">'+d+"</td></tr>").click(function(){M(this).remove()}).appendTo(o.$table.find("thead:first")).addClass(l+" "+o.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"})}else console.error("tablesorter showError: no table parameter passed")},M.fn.extend({tablesorterPager:M.tablesorterPager.construct})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/extras/semver-mod.min.js b/web/_static/tablesorter/js/extras/semver-mod.min.js
new file mode 100644
index 0000000..b930a5c
--- /dev/null
+++ b/web/_static/tablesorter/js/extras/semver-mod.min.js
@@ -0,0 +1,2 @@
+/*! Modified semver.js for node.js (v4.3.3, 3/27/2015) */
+!function(){var u,n={exports:{}}.exports=L;u="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?function(){var r=Array.prototype.slice.call(arguments,0);r.unshift("SEMVER"),console.log.apply(console,r)}:function(){},n.SEMVER_SPEC_VERSION="2.0.0";var i=256,o=Number.MAX_SAFE_INTEGER||9007199254740991,a=n.re=[],r=n.src=[],e=0,t=e++;r[t]="0|[1-9]\\d*";var s=e++;r[s]="[0-9]+";var p=e++;r[p]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var c=e++;r[c]="("+r[t]+")\\.("+r[t]+")\\.("+r[t]+")";var h=e++;r[h]="("+r[s]+")\\.("+r[s]+")\\.("+r[s]+")";var f=e++;r[f]="(?:"+r[t]+"|"+r[p]+")";var l=e++;r[l]="(?:"+r[s]+"|"+r[p]+")";var v=e++;r[v]="(?:-("+r[f]+"(?:\\."+r[f]+")*))";var m=e++;r[m]="(?:-?("+r[l]+"(?:\\."+r[l]+")*))";var g=e++;r[g]="[0-9A-Za-z-]+";var w=e++;r[w]="(?:\\+("+r[g]+"(?:\\."+r[g]+")*))";var y=e++,d="v?"+r[c]+r[v]+"?"+r[w]+"?";r[y]="^"+d+"$";var j="[v=\\s]*"+r[h]+r[m]+"?"+r[w]+"?",E=e++;r[E]="^"+j+"$";var b=e++;r[b]="((?:<|>)?=?)";var $=e++;r[$]=r[s]+"|x|X|\\*";var k=e++;r[k]=r[t]+"|x|X|\\*";var R=e++;r[R]="[v=\\s]*("+r[k]+")(?:\\.("+r[k]+")(?:\\.("+r[k]+")(?:"+r[v]+")?"+r[w]+"?)?)?";var S=e++;r[S]="[v=\\s]*("+r[$]+")(?:\\.("+r[$]+")(?:\\.("+r[$]+")(?:"+r[m]+")?"+r[w]+"?)?)?";var x=e++;r[x]="^"+r[b]+"\\s*"+r[R]+"$";var I=e++;r[I]="^"+r[b]+"\\s*"+r[S]+"$";var T=e++;r[T]="(?:~>?)";var V=e++;r[V]="(\\s*)"+r[T]+"\\s+",a[V]=new RegExp(r[V],"g");var A=e++;r[A]="^"+r[T]+r[R]+"$";var C=e++;r[C]="^"+r[T]+r[S]+"$";var N=e++;r[N]="(?:\\^)";var M=e++;r[M]="(\\s*)"+r[N]+"\\s+",a[M]=new RegExp(r[M],"g");var _=e++;r[_]="^"+r[N]+r[R]+"$";var D=e++;r[D]="^"+r[N]+r[S]+"$";var X=e++;r[X]="^"+r[b]+"\\s*("+j+")$|^$";var z=e++;r[z]="^"+r[b]+"\\s*("+d+")$|^$";var G=e++;r[G]="(\\s*)"+r[b]+"\\s*("+j+"|"+r[R]+")",a[G]=new RegExp(r[G],"g");var O=e++;r[O]="^\\s*("+r[R]+")\\s+-\\s+("+r[R]+")\\s*$";var P=e++;r[P]="^\\s*("+r[S]+")\\s+-\\s+("+r[S]+")\\s*$";var Z=e++;r[Z]="(<|>)?=?\\s*\\*";for(var q=0;q<34;q++)u(q,r[q]),a[q]||(a[q]=new RegExp(r[q]));function B(r,e){if(r instanceof L)return r;if("string"!=typeof r)return null;if(r.length>i)return null;if(!(e?a[E]:a[y]).test(r))return null;try{return new L(r,e)}catch(r){return null}}function L(r,e){if(r instanceof L){if(r.loose===e)return r;r=r.version}else if("string"!=typeof r)throw new TypeError("Invalid Version: "+r);if(r.length>i)throw new TypeError("version is longer than "+i+" characters");if(!(this instanceof L))return new L(r,e);u("SemVer",r,e),this.loose=e;var t=r.trim().match(e?a[E]:a[y]);if(!t)throw new TypeError("Invalid Version: "+r);if(this.raw=r,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>o||this.major<0)throw new TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(function(r){if(/^[0-9]+$/.test(r)){var e=+r;if(0<=e&&e<o)return e}return r}):this.prerelease=[],this.build=t[5]?t[5].split("."):[],this.format()}n.parse=B,n.valid=function(r,e){var t=B(r,e);return t?t.version:null},n.clean=function(r,e){var t=B(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null},window.semver=n.SemVer=L,L.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},L.prototype.inspect=function(){return'<SemVer "'+this+'">'},L.prototype.toString=function(){return this.version},L.prototype.compare=function(r){return u("SemVer.compare",this.version,this.loose,r),r instanceof L||(r=new L(r,this.loose)),this.compareMain(r)||this.comparePre(r)},L.prototype.compareMain=function(r){return r instanceof L||(r=new L(r,this.loose)),F(this.major,r.major)||F(this.minor,r.minor)||F(this.patch,r.patch)},L.prototype.comparePre=function(r){if(r instanceof L||(r=new L(r,this.loose)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;var e=0;do{var t=this.prerelease[e],n=r.prerelease[e];if(u("prerelease compare",e,t,n),void 0===t&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===t)return-1;if(t!==n)return F(t,n)}while(++e)},L.prototype.inc=function(r,e){switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var t=this.prerelease.length;0<=--t;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+r)}return this.format(),this},n.inc=function(r,e,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new L(r,t).inc(e,n).version}catch(r){return null}},n.diff=function(r,e){{if(W(r,e))return null;var t=B(r),n=B(e);if(t.prerelease.length||n.prerelease.length){for(var i in t)if(("major"===i||"minor"===i||"patch"===i)&&t[i]!==n[i])return"pre"+i;return"prerelease"}for(var i in t)if(("major"===i||"minor"===i||"patch"===i)&&t[i]!==n[i])return i}},n.compareIdentifiers=F;var U=/^[0-9]+$/;function F(r,e){var t=U.test(r),n=U.test(e);return t&&n&&(r=+r,e=+e),t&&!n?-1:n&&!t?1:r<e?-1:e<r?1:0}function H(r,e,t){return new L(r,t).compare(e)}function J(r,e,t){return H(e,r,t)}function K(r,e,t){return 0<H(r,e,t)}function Q(r,e,t){return H(r,e,t)<0}function W(r,e,t){return 0===H(r,e,t)}function Y(r,e,t){return 0!==H(r,e,t)}function rr(r,e,t){return 0<=H(r,e,t)}function er(r,e,t){return H(r,e,t)<=0}function tr(r,e,t,n){var i;switch(e){case"===":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r===t;break;case"!==":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r!==t;break;case"":case"=":case"==":i=W(r,t,n);break;case"!=":i=Y(r,t,n);break;case">":i=K(r,t,n);break;case">=":i=rr(r,t,n);break;case"<":i=Q(r,t,n);break;case"<=":i=er(r,t,n);break;default:throw new TypeError("Invalid operator: "+e)}return i}function nr(r,e){if(r instanceof nr){if(r.loose===e)return r;r=r.value}if(!(this instanceof nr))return new nr(r,e);u("comparator",r,e),this.loose=e,this.parse(r),this.semver===ir?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}n.rcompareIdentifiers=function(r,e){return F(e,r)},n.major=function(r,e){return new L(r,e).major},n.minor=function(r,e){return new L(r,e).minor},n.patch=function(r,e){return new L(r,e).patch},n.compare=H,n.compareLoose=function(r,e){return H(r,e,!0)},n.rcompare=J,n.sort=function(r,t){return r.sort(function(r,e){return n.compare(r,e,t)})},n.rsort=function(r,t){return r.sort(function(r,e){return n.rcompare(r,e,t)})},n.gt=K,n.lt=Q,n.eq=W,n.neq=Y,n.gte=rr,n.lte=er,n.cmp=tr,n.Comparator=nr;var ir={};function or(r,e){if(r instanceof or&&r.loose===e)return r;if(!(this instanceof or))return new or(r,e);if(this.loose=e,this.raw=r,this.set=r.split(/\s*\|\|\s*/).map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+r);this.format()}function sr(r){return!r||"x"===r.toLowerCase()||"*"===r}function ar(r,e,t,n,i,o,s,a,p,c,u,h,f){return((e=sr(t)?"":sr(n)?">="+t+".0.0":sr(i)?">="+t+"."+n+".0":">="+e)+" "+(a=sr(p)?"":sr(c)?"<"+(+p+1)+".0.0":sr(u)?"<"+p+"."+(+c+1)+".0":h?"<="+p+"."+c+"."+u+"-"+h:"<="+a)).trim()}function pr(r,e){for(var t=0;t<r.length;t++)if(!r[t].test(e))return!1;if(e.prerelease.length){for(t=0;t<r.length;t++){if(u(r[t].semver),r[t].semver===ir)return!0;if(0<r[t].semver.prerelease.length){var n=r[t].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}}return!1}return!0}function cr(r,e,t){try{e=new or(e,t)}catch(r){return!1}return e.test(r)}function ur(r,e,t,n){var i,o,s,a,p;switch(r=new L(r,n),e=new or(e,n),t){case">":i=K,o=er,s=Q,a=">",p=">=";break;case"<":i=Q,o=rr,s=K,a="<",p="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(cr(r,e,n))return!1;for(var c=0;c<e.set.length;++c){var u=e.set[c],h=null,f=null;if(u.forEach(function(r){h=h||r,f=f||r,i(r.semver,h.semver,n)?h=r:s(r.semver,f.semver,n)&&(f=r)}),h.operator===a||h.operator===p)return!1;if((!f.operator||f.operator===a)&&o(r,f.semver))return!1;if(f.operator===p&&s(r,f.semver))return!1}return!0}nr.prototype.parse=function(r){var e=this.loose?a[X]:a[z],t=r.match(e);if(!t)throw new TypeError("Invalid comparator: "+r);this.operator=t[1],"="===this.operator&&(this.operator=""),t[2]?this.semver=new L(t[2],this.loose):this.semver=ir},nr.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'},nr.prototype.toString=function(){return this.value},nr.prototype.test=function(r){return u("Comparator.test",r,this.loose),this.semver===ir||("string"==typeof r&&(r=new L(r,this.loose)),tr(r,this.operator,this.semver,this.loose))},(n.Range=or).prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'},or.prototype.format=function(){return this.range=this.set.map(function(r){return r.join(" ").trim()}).join("||").trim(),this.range},or.prototype.toString=function(){return this.range},or.prototype.parseRange=function(r){var n=this.loose;r=r.trim(),u("range",r,n);var e=n?a[P]:a[O];r=r.replace(e,ar),u("hyphen replace",r),r=r.replace(a[G],"$1$2$3"),u("comparator trim",r,a[G]),r=(r=(r=r.replace(a[V],"$1~")).replace(a[M],"$1^")).split(/\s+/).join(" ");var t=n?a[X]:a[z],i=r.split(" ").map(function(r){return t=n,u("comp",e=r),e=function(r,e){return r.trim().split(/\s+/).map(function(r){return function(s,r){u("caret",s,r);var e=r?a[D]:a[_];return s.replace(e,function(r,e,t,n,i){var o;return u("caret",s,r,e,t,n,i),o=sr(e)?"":sr(t)?">="+e+".0.0 <"+(+e+1)+".0.0":sr(n)?"0"===e?">="+e+"."+t+".0 <"+e+"."+(+t+1)+".0":">="+e+"."+t+".0 <"+(+e+1)+".0.0":i?(u("replaceCaret pr",i),"-"!==i.charAt(0)&&(i="-"+i),"0"===e?"0"===t?">="+e+"."+t+"."+n+i+" <"+e+"."+t+"."+(+n+1):">="+e+"."+t+"."+n+i+" <"+e+"."+(+t+1)+".0":">="+e+"."+t+"."+n+i+" <"+(+e+1)+".0.0"):(u("no pr"),"0"===e?"0"===t?">="+e+"."+t+"."+n+" <"+e+"."+t+"."+(+n+1):">="+e+"."+t+"."+n+" <"+e+"."+(+t+1)+".0":">="+e+"."+t+"."+n+" <"+(+e+1)+".0.0"),u("caret return",o),o})}(r,e)}).join(" ")}(e,t),u("caret",e),e=function(r,t){return r.trim().split(/\s+/).map(function(r){return s=r,e=t?a[C]:a[A],s.replace(e,function(r,e,t,n,i){var o;return u("tilde",s,r,e,t,n,i),o=sr(e)?"":sr(t)?">="+e+".0.0 <"+(+e+1)+".0.0":sr(n)?">="+e+"."+t+".0 <"+e+"."+(+t+1)+".0":i?(u("replaceTilde pr",i),"-"!==i.charAt(0)&&(i="-"+i),">="+e+"."+t+"."+n+i+" <"+e+"."+(+t+1)+".0"):">="+e+"."+t+"."+n+" <"+e+"."+(+t+1)+".0",u("tilde return",o),o});var s,e}).join(" ")}(e,t),u("tildes",e),e=function(r,e){return u("replaceXRanges",r,e),r.split(/\s+/).map(function(r){return function(c,r){c=c.trim();var e=r?a[I]:a[x];return c.replace(e,function(r,e,t,n,i,o){u("xRange",c,r,e,t,n,i,o);var s=sr(t),a=s||sr(n),p=a||sr(i);return"="===e&&p&&(e=""),s?r=">"===e||"<"===e?"<0.0.0":"*":e&&p?(a&&(n=0),p&&(i=0),">"===e?(e=">=",a?(t=+t+1,i=n=0):p&&(n=+n+1,i=0)):"<="===e&&(e="<",a?t=+t+1:n=+n+1),r=e+t+"."+n+"."+i):a?r=">="+t+".0.0 <"+(+t+1)+".0.0":p&&(r=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"),u("xRange return",r),r})}(r,e)}).join(" ")}(e,t),u("xrange",e),e=function(r,e){return u("replaceStars",r,e),r.trim().replace(a[Z],"")}(e,t),u("stars",e),e;var e,t}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(r){return!!r.match(t)})),i=i.map(function(r){return new nr(r,n)})},n.toComparators=function(r,e){return new or(r,e).set.map(function(r){return r.map(function(r){return r.value}).join(" ").trim().split(" ")})},or.prototype.test=function(r){if(!r)return!1;"string"==typeof r&&(r=new L(r,this.loose));for(var e=0;e<this.set.length;e++)if(pr(this.set[e],r))return!0;return!1},n.satisfies=cr,n.maxSatisfying=function(r,e,t){return r.filter(function(r){return cr(r,e,t)}).sort(function(r,e){return J(r,e,t)})[0]||null},n.validRange=function(r,e){try{return new or(r,e).range||"*"}catch(r){return null}},n.ltr=function(r,e,t){return ur(r,e,"<",t)},n.gtr=function(r,e,t){return ur(r,e,">",t)},n.outside=ur,"function"==typeof define&&define.amd&&define(n)}(); \ No newline at end of file
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.combined.js b/web/_static/tablesorter/js/jquery.tablesorter.combined.js
new file mode 100644
index 0000000..a1a5b71
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.combined.js
@@ -0,0 +1,6093 @@
+/*! tablesorter (FORK) - updated 2020-03-03 (v2.31.3)*/
+/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery) {
+/*! TableSorter (FORK) v2.31.3 *//*
+* Client-side table sorting with ease!
+* @requires jQuery v1.2.6+
+*
+* Copyright (c) 2007 Christian Bach
+* fork maintained by Rob Garrison
+*
+* Examples and original docs at: http://tablesorter.com
+* Dual licensed under the MIT and GPL licenses:
+* http://www.opensource.org/licenses/mit-license.php
+* http://www.gnu.org/licenses/gpl.html
+*
+* @type jQuery
+* @name tablesorter (FORK)
+* @cat Plugins/Tablesorter
+* @author Christian Bach - christian.bach@polyester.se
+* @contributor Rob Garrison - https://github.com/Mottie/tablesorter
+* @docs (fork) - https://mottie.github.io/tablesorter/docs/
+*/
+/*jshint browser:true, jquery:true, unused:false, expr: true */
+;( function( $ ) {
+ 'use strict';
+ var ts = $.tablesorter = {
+
+ version : '2.31.3',
+
+ parsers : [],
+ widgets : [],
+ defaults : {
+
+ // *** appearance
+ theme : 'default', // adds tablesorter-{theme} to the table for styling
+ widthFixed : false, // adds colgroup to fix widths of columns
+ showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
+
+ headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
+ onRenderHeader : null, // function( index ) {}, // nothing to return
+
+ // *** functionality
+ cancelSelection : true, // prevent text selection in the header
+ tabIndex : true, // add tabindex to header for keyboard accessibility
+ dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
+ sortMultiSortKey : 'shiftKey', // key used to select additional columns
+ sortResetKey : 'ctrlKey', // key used to remove sorting on a column
+ usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
+ delayInit : false, // if false, the parsed table contents will not update until the first sort
+ serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
+ resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
+
+ // *** sort options
+ headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
+ ignoreCase : true, // ignore case while sorting
+ sortForce : null, // column(s) first sorted; always applied
+ sortList : [], // Initial sort order; applied initially; updated when manually sorted
+ sortAppend : null, // column(s) sorted last; always applied
+ sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained
+
+ sortInitialOrder : 'asc', // sort direction on first click
+ sortLocaleCompare: false, // replace equivalent character (accented characters)
+ sortReset : false, // third click on the header will reset column to default - unsorted
+ sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
+
+ emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
+ stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
+ duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
+ textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
+ textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
+ numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
+
+ // *** widget options
+ initWidgets : true, // apply widgets on tablesorter initialization
+ widgetClass : 'widget-{name}', // table class name template to match to include a widget
+ widgets : [], // method to add widgets, e.g. widgets: ['zebra']
+ widgetOptions : {
+ zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
+ },
+
+ // *** callbacks
+ initialized : null, // function( table ) {},
+
+ // *** extra css class names
+ tableClass : '',
+ cssAsc : '',
+ cssDesc : '',
+ cssNone : '',
+ cssHeader : '',
+ cssHeaderRow : '',
+ cssProcessing : '', // processing icon applied to header during sort/filter
+
+ cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent
+ cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
+ cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
+ cssIgnoreRow : 'tablesorter-ignoreRow',// header row to ignore; cells within this row will not be added to c.$headers
+
+ cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate
+ cssIconNone : '', // class name added to the icon when there is no column sort
+ cssIconAsc : '', // class name added to the icon when the column has an ascending sort
+ cssIconDesc : '', // class name added to the icon when the column has a descending sort
+ cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
+
+ // *** events
+ pointerClick : 'click',
+ pointerDown : 'mousedown',
+ pointerUp : 'mouseup',
+
+ // *** selectors
+ selectorHeaders : '> thead th, > thead td',
+ selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
+ selectorRemove : '.remove-me',
+
+ // *** advanced
+ debug : false,
+
+ // *** Internal variables
+ headerList: [],
+ empties: {},
+ strings: {},
+ parsers: [],
+
+ // *** parser options for validator; values must be falsy!
+ globalize: 0,
+ imgAttr: 0
+
+ // removed: widgetZebra: { css: ['even', 'odd'] }
+
+ },
+
+ // internal css classes - these will ALWAYS be added to
+ // the table and MUST only contain one class name - fixes #381
+ 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'
+ },
+
+ // labels applied to sortable headers for accessibility (aria) support
+ language : {
+ sortAsc : 'Ascending sort applied, ',
+ sortDesc : 'Descending sort applied, ',
+ sortNone : 'No sort applied, ',
+ sortDisabled : 'sorting is disabled',
+ nextAsc : 'activate to apply an ascending sort',
+ nextDesc : 'activate to apply a descending sort',
+ nextNone : 'activate to remove the sort'
+ },
+
+ regex : {
+ templateContent : /\{content\}/g,
+ templateIcon : /\{icon\}/g,
+ templateName : /\{name\}/i,
+ spaces : /\s+/g,
+ nonWord : /\W/g,
+ formElements : /(input|select|button|textarea)/i,
+
+ // *** sort functions ***
+ // regex used in natural sort
+ // chunk/tokenize numbers & letters
+ chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
+ // replace chunks @ ends
+ chunks : /(^\\0|\\0$)/,
+ hex : /^0x[0-9a-f]+$/i,
+
+ // *** formatFloat ***
+ comma : /,/g,
+ digitNonUS : /[\s|\.]/g,
+ digitNegativeTest : /^\s*\([.\d]+\)/,
+ digitNegativeReplace : /^\s*\(([.\d]+)\)/,
+
+ // *** isDigit ***
+ digitTest : /^[\-+(]?\d+[)]?$/,
+ digitReplace : /[,.'"\s]/g
+
+ },
+
+ // digit sort, text location
+ string : {
+ max : 1,
+ min : -1,
+ emptymin : 1,
+ emptymax : -1,
+ zero : 0,
+ none : 0,
+ 'null' : 0,
+ top : true,
+ bottom : false
+ },
+
+ keyCodes : {
+ enter : 13
+ },
+
+ // placeholder date parser data (globalize)
+ dates : {},
+
+ // These methods can be applied on table.config instance
+ instanceMethods : {},
+
+ /*
+ ▄█████ ██████ ██████ ██ ██ █████▄
+ ▀█▄ ██▄▄ ██ ██ ██ ██▄▄██
+ ▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀
+ █████▀ ██████ ██ ▀████▀ ██
+ */
+
+ setup : function( table, c ) {
+ // if no thead or tbody, or tablesorter is already present, quit
+ if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
+ if ( ts.debug(c, 'core') ) {
+ if ( table.hasInitialized ) {
+ console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
+ } else {
+ console.error( 'Stopping initialization! No table, thead or tbody', table );
+ }
+ }
+ return;
+ }
+
+ var tmp = '',
+ $table = $( table ),
+ meta = $.metadata;
+ // initialization flag
+ table.hasInitialized = false;
+ // table is being processed flag
+ table.isProcessing = true;
+ // make sure to store the config object
+ table.config = c;
+ // save the settings where they read
+ $.data( table, 'tablesorter', c );
+ if ( ts.debug(c, 'core') ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
+ $.data( table, 'startoveralltimer', new Date() );
+ }
+
+ // removing this in version 3 (only supports jQuery 1.7+)
+ c.supportsDataObject = ( function( version ) {
+ version[ 0 ] = parseInt( version[ 0 ], 10 );
+ return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 );
+ })( $.fn.jquery.split( '.' ) );
+ // ensure case insensitivity
+ c.emptyTo = c.emptyTo.toLowerCase();
+ c.stringTo = c.stringTo.toLowerCase();
+ c.last = { sortList : [], clickedIndex : -1 };
+ // add table theme class only if there isn't already one there
+ if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
+ tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
+ }
+
+ // give the table a unique id, which will be used in namespace binding
+ if ( !c.namespace ) {
+ c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 );
+ } else {
+ // make sure namespace starts with a period & doesn't have weird characters
+ c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
+ }
+
+ c.table = table;
+ c.$table = $table
+ // add namespace to table to allow bindings on extra elements to target
+ // the parent table (e.g. parser-input-select)
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
+ .attr( 'role', 'grid' );
+ c.$headers = $table.find( c.selectorHeaders );
+
+ c.$table.children().children( 'tr' ).attr( 'role', 'row' );
+ c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
+ 'aria-live' : 'polite',
+ 'aria-relevant' : 'all'
+ });
+ if ( c.$table.children( 'caption' ).length ) {
+ tmp = c.$table.children( 'caption' )[ 0 ];
+ if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; }
+ c.$table.attr( 'aria-labelledby', tmp.id );
+ }
+ c.widgetInit = {}; // keep a list of initialized widgets
+ // change textExtraction via data-attribute
+ c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic';
+ // build headers
+ ts.buildHeaders( c );
+ // fixate columns if the users supplies the fixedWidth option
+ // do this after theme has been applied
+ ts.fixColumnWidth( table );
+ // add widgets from class name
+ ts.addWidgetFromClass( table );
+ // add widget options before parsing (e.g. grouping widget has parser settings)
+ ts.applyWidgetOptions( table );
+ // try to auto detect column type, and store in tables config
+ ts.setupParsers( c );
+ // start total row count at zero
+ c.totalRows = 0;
+ // only validate options while debugging. See #1528
+ if (c.debug) {
+ ts.validateOptions( c );
+ }
+ // build the cache for the tbody cells
+ // delayInit will delay building the cache until the user starts a sort
+ if ( !c.delayInit ) { ts.buildCache( c ); }
+ // bind all header events and methods
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ // get sort list from jQuery data or metadata
+ // in jQuery < 1.4, an error occurs when calling $table.data()
+ if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) {
+ c.sortList = $table.data().sortlist;
+ } else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) {
+ c.sortList = $table.metadata().sortlist;
+ }
+ // apply widget init code
+ ts.applyWidget( table, true );
+ // if user has supplied a sort list to constructor
+ if ( c.sortList.length > 0 ) {
+ // save sortList before any sortAppend is added
+ c.last.sortList = c.sortList;
+ ts.sortOn( c, c.sortList, {}, !c.initWidgets );
+ } else {
+ ts.setHeadersCss( c );
+ if ( c.initWidgets ) {
+ // apply widget format
+ ts.applyWidget( table, false );
+ }
+ }
+
+ // show processesing icon
+ if ( c.showProcessing ) {
+ $table
+ .unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace )
+ .bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) {
+ clearTimeout( c.timerProcessing );
+ ts.isProcessing( table );
+ if ( e.type === 'sortBegin' ) {
+ c.timerProcessing = setTimeout( function() {
+ ts.isProcessing( table, true );
+ }, 500 );
+ }
+ });
+ }
+
+ // initialized
+ table.hasInitialized = true;
+ table.isProcessing = false;
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
+ }
+ $table.triggerHandler( 'tablesorter-initialized', table );
+ if ( typeof c.initialized === 'function' ) {
+ c.initialized( table );
+ }
+ },
+
+ bindMethods : function( c ) {
+ var $table = c.$table,
+ namespace = c.namespace,
+ events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
+ 'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
+ 'mouseleave ' ).split( ' ' )
+ .join( namespace + ' ' );
+ // apply easy methods that trigger bound events
+ $table
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'sortReset' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // using this.config to ensure functions are getting a non-cached version of the config
+ ts.sortReset( this.config, function( table ) {
+ if (table.isApplyingWidgets) {
+ // multiple triggers in a row... filterReset, then sortReset - see #1361
+ // wait to update widgets
+ setTimeout( function() {
+ ts.applyWidget( table, '', callback );
+ }, 100 );
+ } else {
+ ts.applyWidget( table, '', callback );
+ }
+ });
+ })
+ .bind( 'updateAll' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.updateAll( this.config, resort, callback );
+ })
+ .bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.update( this.config, resort, callback );
+ })
+ .bind( 'updateHeaders' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ ts.updateHeaders( this.config, callback );
+ })
+ .bind( 'updateCell' + namespace, function( e, cell, resort, callback ) {
+ e.stopPropagation();
+ ts.updateCell( this.config, cell, resort, callback );
+ })
+ .bind( 'addRows' + namespace, function( e, $row, resort, callback ) {
+ e.stopPropagation();
+ ts.addRows( this.config, $row, resort, callback );
+ })
+ .bind( 'updateComplete' + namespace, function() {
+ this.isUpdating = false;
+ })
+ .bind( 'sorton' + namespace, function( e, list, callback, init ) {
+ e.stopPropagation();
+ ts.sortOn( this.config, list, callback, init );
+ })
+ .bind( 'appendCache' + namespace, function( e, callback, init ) {
+ e.stopPropagation();
+ ts.appendCache( this.config, init );
+ if ( $.isFunction( callback ) ) {
+ callback( this );
+ }
+ })
+ // $tbodies variable is used by the tbody sorting widget
+ .bind( 'updateCache' + namespace, function( e, callback, $tbodies ) {
+ e.stopPropagation();
+ ts.updateCache( this.config, callback, $tbodies );
+ })
+ .bind( 'applyWidgetId' + namespace, function( e, id ) {
+ e.stopPropagation();
+ ts.applyWidgetId( this, id );
+ })
+ .bind( 'applyWidgets' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // apply widgets (false = not initializing)
+ ts.applyWidget( this, false, callback );
+ })
+ .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
+ e.stopPropagation();
+ ts.refreshWidgets( this, all, dontapply );
+ })
+ .bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
+ e.stopPropagation();
+ ts.removeWidget( this, name, refreshing );
+ })
+ .bind( 'destroy' + namespace, function( e, removeClasses, callback ) {
+ e.stopPropagation();
+ ts.destroy( this, removeClasses, callback );
+ })
+ .bind( 'resetToLoadState' + namespace, function( e ) {
+ e.stopPropagation();
+ // remove all widgets
+ ts.removeWidget( this, true, false );
+ var tmp = $.extend( true, {}, c.originalSettings );
+ // restore original settings; this clears out current settings, but does not clear
+ // values saved to storage.
+ c = $.extend( true, {}, ts.defaults, tmp );
+ c.originalSettings = tmp;
+ this.hasInitialized = false;
+ // setup the entire table again
+ ts.setup( this, c );
+ });
+ },
+
+ bindEvents : function( table, $headers, core ) {
+ table = $( table )[ 0 ];
+ var tmp,
+ c = table.config,
+ namespace = c.namespace,
+ downTarget = null;
+ if ( core !== true ) {
+ $headers.addClass( namespace.slice( 1 ) + '_extra_headers' );
+ tmp = ts.getClosest( $headers, 'table' );
+ if ( tmp.length && tmp[ 0 ].nodeName === 'TABLE' && tmp[ 0 ] !== table ) {
+ $( tmp[ 0 ] ).addClass( namespace.slice( 1 ) + '_extra_table' );
+ }
+ }
+ tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' )
+ .replace( ts.regex.spaces, ' ' )
+ .split( ' ' )
+ .join( namespace + ' ' );
+ // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc)
+ $headers
+ // http://stackoverflow.com/questions/5312849/jquery-find-self;
+ .find( c.selectorSort )
+ .add( $headers.filter( c.selectorSort ) )
+ .unbind( tmp )
+ .bind( tmp, function( e, external ) {
+ var $cell, cell, temp,
+ $target = $( e.target ),
+ // wrap event type in spaces, so the match doesn't trigger on inner words
+ type = ' ' + e.type + ' ';
+ // only recognize left clicks
+ if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
+ // allow pressing enter
+ ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
+ // allow triggering a click event (e.which is undefined) & ignore physical clicks
+ ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
+ return;
+ }
+ // ignore mouseup if mousedown wasn't on the same target
+ if ( type.match( ' ' + c.pointerUp + ' ' ) && downTarget !== e.target && external !== true ) {
+ return;
+ }
+ // set target on mousedown
+ if ( type.match( ' ' + c.pointerDown + ' ' ) ) {
+ downTarget = e.target;
+ // preventDefault needed or jQuery v1.3.2 and older throws an
+ // "Uncaught TypeError: handler.apply is not a function" error
+ temp = $target.jquery.split( '.' );
+ if ( temp[ 0 ] === '1' && temp[ 1 ] < 4 ) { e.preventDefault(); }
+ return;
+ }
+ downTarget = null;
+ $cell = ts.getClosest( $( this ), '.' + ts.css.header );
+ // prevent sort being triggered on form elements
+ if ( ts.regex.formElements.test( e.target.nodeName ) ||
+ // nosort class name, or elements within a nosort container
+ $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
+ // disabled cell directly clicked
+ $cell.hasClass( 'sorter-false' ) ||
+ // elements within a button
+ $target.parents( 'button' ).length > 0 ) {
+ return !c.cancelSelection;
+ }
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ // use column index from data-attribute or index of current row; fixes #1116
+ c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
+ cell = c.$headerIndexed[ c.last.clickedIndex ][0];
+ if ( cell && !cell.sortDisabled ) {
+ ts.initSort( c, cell, e );
+ }
+ });
+ if ( c.cancelSelection ) {
+ // cancel selection
+ $headers
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart', false )
+ .css({
+ 'user-select' : 'none',
+ 'MozUserSelect' : 'none' // not needed for jQuery 1.8+
+ });
+ }
+ },
+
+ buildHeaders : function( c ) {
+ var $temp, icon, timer, indx;
+ c.headerList = [];
+ c.headerContent = [];
+ c.sortVars = [];
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ // children tr in tfoot - see issue #196 & #547
+ // don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
+ c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
+ // add icon if cssIcon option exists
+ icon = c.cssIcon ?
+ '<i class="' + ( c.cssIcon === ts.css.icon ? ts.css.icon : c.cssIcon + ' ' + ts.css.icon ) + '"></i>' :
+ '';
+ // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683
+ c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) {
+ var configHeaders, header, column, template, tmp,
+ $elem = $( elem );
+ // ignore cell (don't add it to c.$headers) if row has ignoreRow class
+ if ( ts.getClosest( $elem, 'tr' ).hasClass( c.cssIgnoreRow ) ) { return; }
+ // transfer data-column to element if not th/td - #1459
+ if ( !/(th|td)/i.test( elem.nodeName ) ) {
+ tmp = ts.getClosest( $elem, 'th, td' );
+ $elem.attr( 'data-column', tmp.attr( 'data-column' ) );
+ }
+ // make sure to get header cell & not column indexed cell
+ configHeaders = ts.getColumnData( c.table, c.headers, index, true );
+ // save original header content
+ c.headerContent[ index ] = $elem.html();
+ // if headerTemplate is empty, don't reformat the header cell
+ if ( c.headerTemplate !== '' && !$elem.find( '.' + ts.css.headerIn ).length ) {
+ // set up header template
+ template = c.headerTemplate
+ .replace( ts.regex.templateContent, $elem.html() )
+ .replace( ts.regex.templateIcon, $elem.find( '.' + ts.css.icon ).length ? '' : icon );
+ if ( c.onRenderTemplate ) {
+ header = c.onRenderTemplate.apply( $elem, [ index, template ] );
+ // only change t if something is returned
+ if ( header && typeof header === 'string' ) {
+ template = header;
+ }
+ }
+ $elem.html( '<div class="' + ts.css.headerIn + '">' + template + '</div>' ); // faster than wrapInner
+ }
+ if ( c.onRenderHeader ) {
+ c.onRenderHeader.apply( $elem, [ index, c, c.$table ] );
+ }
+ column = parseInt( $elem.attr( 'data-column' ), 10 );
+ elem.column = column;
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
+ // this may get updated numerous times if there are multiple rows
+ c.sortVars[ column ] = {
+ count : -1, // set to -1 because clicking on the header automatically adds one
+ order : tmp ?
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
+ lockedOrder : false,
+ sortedBy : ''
+ };
+ tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
+ if ( typeof tmp !== 'undefined' && tmp !== false ) {
+ c.sortVars[ column ].lockedOrder = true;
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
+ }
+ // add cell to headerList
+ c.headerList[ index ] = elem;
+ $elem.addClass( ts.css.header + ' ' + c.cssHeader );
+ // add to parent in case there are multiple rows
+ ts.getClosest( $elem, 'tr' )
+ .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow )
+ .attr( 'role', 'row' );
+ // allow keyboard cursor to focus on element
+ if ( c.tabIndex ) {
+ $elem.attr( 'tabindex', 0 );
+ }
+ return elem;
+ }) );
+ // cache headers per column
+ c.$headerIndexed = [];
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ // colspan in header making a column undefined
+ if ( ts.isEmptyObject( c.sortVars[ indx ] ) ) {
+ c.sortVars[ indx ] = {};
+ }
+ // Use c.$headers.parent() in case selectorHeaders doesn't point to the th/td
+ $temp = c.$headers.filter( '[data-column="' + indx + '"]' );
+ // target sortable column cells, unless there are none, then use non-sortable cells
+ // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6
+ c.$headerIndexed[ indx ] = $temp.length ?
+ $temp.not( '.sorter-false' ).length ?
+ $temp.not( '.sorter-false' ).filter( ':last' ) :
+ $temp.filter( ':last' ) :
+ $();
+ }
+ c.$table.find( c.selectorHeaders ).attr({
+ scope: 'col',
+ role : 'columnheader'
+ });
+ // enable/disable sorting
+ ts.updateHeader( c );
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Built headers:' + ts.benchmark( timer ) );
+ console.log( c.$headers );
+ }
+ },
+
+ // Use it to add a set of methods to table.config which will be available for all tables.
+ // This should be done before table initialization
+ addInstanceMethods : function( methods ) {
+ $.extend( ts.instanceMethods, methods );
+ },
+
+ /*
+ █████▄ ▄████▄ █████▄ ▄█████ ██████ █████▄ ▄█████
+ ██▄▄██ ██▄▄██ ██▄▄██ ▀█▄ ██▄▄ ██▄▄██ ▀█▄
+ ██▀▀▀ ██▀▀██ ██▀██ ▀█▄ ██▀▀ ██▀██ ▀█▄
+ ██ ██ ██ ██ ██ █████▀ ██████ ██ ██ █████▀
+ */
+ setupParsers : function( c, $tbodies ) {
+ var rows, list, span, max, colIndex, indx, header, configHeaders,
+ noParser, parser, extractor, time, tbody, len,
+ table = c.table,
+ tbodyIndex = 0,
+ debug = ts.debug(c, 'core'),
+ debugOutput = {};
+ // update table bodies in case we start with an empty table
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
+ len = tbody.length;
+ if ( len === 0 ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
+ } else if ( debug ) {
+ time = new Date();
+ console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
+ }
+ list = {
+ extractors: [],
+ parsers: []
+ };
+ while ( tbodyIndex < len ) {
+ rows = tbody[ tbodyIndex ].rows;
+ if ( rows.length ) {
+ colIndex = 0;
+ max = c.columns;
+ for ( indx = 0; indx < max; indx++ ) {
+ header = c.$headerIndexed[ colIndex ];
+ if ( header && header.length ) {
+ // get column indexed table cell; adding true parameter fixes #1362 but
+ // it would break backwards compatibility...
+ configHeaders = ts.getColumnData( table, c.headers, colIndex ); // , true );
+ // get column parser/extractor
+ extractor = ts.getParserById( ts.getData( header, configHeaders, 'extractor' ) );
+ parser = ts.getParserById( ts.getData( header, configHeaders, 'sorter' ) );
+ noParser = ts.getData( header, configHeaders, 'parser' ) === 'false';
+ // empty cells behaviour - keeping emptyToBottom for backwards compatibility
+ c.empties[colIndex] = (
+ ts.getData( header, configHeaders, 'empty' ) ||
+ c.emptyTo || ( c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase();
+ // text strings behaviour in numerical sorts
+ c.strings[colIndex] = (
+ ts.getData( header, configHeaders, 'string' ) ||
+ c.stringTo ||
+ 'max' ).toLowerCase();
+ if ( noParser ) {
+ parser = ts.getParserById( 'no-parser' );
+ }
+ if ( !extractor ) {
+ // For now, maybe detect someday
+ extractor = false;
+ }
+ if ( !parser ) {
+ parser = ts.detectParserForColumn( c, rows, -1, colIndex );
+ }
+ if ( debug ) {
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
+ parser : parser.id,
+ extractor : extractor ? extractor.id : 'none',
+ string : c.strings[ colIndex ],
+ empty : c.empties[ colIndex ]
+ };
+ }
+ list.parsers[ colIndex ] = parser;
+ list.extractors[ colIndex ] = extractor;
+ span = header[ 0 ].colSpan - 1;
+ if ( span > 0 ) {
+ colIndex += span;
+ max += span;
+ while ( span + 1 > 0 ) {
+ // set colspan columns to use the same parsers & extractors
+ list.parsers[ colIndex - span ] = parser;
+ list.extractors[ colIndex - span ] = extractor;
+ span--;
+ }
+ }
+ }
+ colIndex++;
+ }
+ }
+ tbodyIndex += ( list.parsers.length ) ? len : 1;
+ }
+ if ( debug ) {
+ if ( !ts.isEmptyObject( debugOutput ) ) {
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
+ } else {
+ console.warn( ' No parsers detected!' );
+ }
+ console.log( 'Completed detecting parsers' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ c.parsers = list.parsers;
+ c.extractors = list.extractors;
+ },
+
+ addParser : function( parser ) {
+ var indx,
+ len = ts.parsers.length,
+ add = true;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === parser.id.toLowerCase() ) {
+ add = false;
+ }
+ }
+ if ( add ) {
+ ts.parsers[ ts.parsers.length ] = parser;
+ }
+ },
+
+ getParserById : function( name ) {
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
+ if ( name == 'false' ) { return false; }
+ var indx,
+ len = ts.parsers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === ( name.toString() ).toLowerCase() ) {
+ return ts.parsers[ indx ];
+ }
+ }
+ return false;
+ },
+
+ detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
+ var cur, $node, row,
+ indx = ts.parsers.length,
+ node = false,
+ nodeValue = '',
+ debug = ts.debug(c, 'core'),
+ keepLooking = true;
+ while ( nodeValue === '' && keepLooking ) {
+ rowIndex++;
+ row = rows[ rowIndex ];
+ // stop looking after 50 empty rows
+ if ( row && rowIndex < 50 ) {
+ if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
+ node = rows[ rowIndex ].cells[ cellIndex ];
+ nodeValue = ts.getElementText( c, node, cellIndex );
+ $node = $( node );
+ if ( debug ) {
+ console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
+ cellIndex + ': "' + nodeValue + '"' );
+ }
+ }
+ } else {
+ keepLooking = false;
+ }
+ }
+ while ( --indx >= 0 ) {
+ cur = ts.parsers[ indx ];
+ // ignore the default text parser because it will always be true
+ if ( cur && cur.id !== 'text' && cur.is && cur.is( nodeValue, c.table, node, $node ) ) {
+ return cur;
+ }
+ }
+ // nothing found, return the generic parser (text)
+ return ts.getParserById( 'text' );
+ },
+
+ getElementText : function( c, node, cellIndex ) {
+ if ( !node ) { return ''; }
+ var tmp,
+ extract = c.textExtraction || '',
+ // node could be a jquery object
+ // http://jsperf.com/jquery-vs-instanceof-jquery/2
+ $node = node.jquery ? node : $( node );
+ if ( typeof extract === 'string' ) {
+ // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow!
+ // http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/
+ if ( extract === 'basic' && typeof ( tmp = $node.attr( c.textAttribute ) ) !== 'undefined' ) {
+ return $.trim( tmp );
+ }
+ return $.trim( node.textContent || $node.text() );
+ } else {
+ if ( typeof extract === 'function' ) {
+ return $.trim( extract( $node[ 0 ], c.table, cellIndex ) );
+ } else if ( typeof ( tmp = ts.getColumnData( c.table, extract, cellIndex ) ) === 'function' ) {
+ return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) );
+ }
+ }
+ // fallback
+ return $.trim( $node[ 0 ].textContent || $node.text() );
+ },
+
+ // centralized function to extract/parse cell contents
+ getParsedText : function( c, cell, colIndex, txt ) {
+ if ( typeof txt === 'undefined' ) {
+ txt = ts.getElementText( c, cell, colIndex );
+ }
+ // if no parser, make sure to return the txt
+ var val = '' + txt,
+ parser = c.parsers[ colIndex ],
+ extractor = c.extractors[ colIndex ];
+ if ( parser ) {
+ // do extract before parsing, if there is one
+ if ( extractor && typeof extractor.format === 'function' ) {
+ txt = extractor.format( txt, c.table, cell, colIndex );
+ }
+ // allow parsing if the string is empty, previously parsing would change it to zero,
+ // in case the parser needs to extract data from the table cell attributes
+ val = parser.id === 'no-parser' ? '' :
+ // make sure txt is a string (extractor may have converted it)
+ parser.format( '' + txt, c.table, cell, colIndex );
+ if ( c.ignoreCase && typeof val === 'string' ) {
+ val = val.toLowerCase();
+ }
+ }
+ return val;
+ },
+
+ /*
+ ▄████▄ ▄████▄ ▄████▄ ██ ██ ██████
+ ██ ▀▀ ██▄▄██ ██ ▀▀ ██▄▄██ ██▄▄
+ ██ ▄▄ ██▀▀██ ██ ▄▄ ██▀▀██ ██▀▀
+ ▀████▀ ██ ██ ▀████▀ ██ ██ ██████
+ */
+ buildCache : function( c, callback, $tbodies ) {
+ var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
+ cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
+ colMax, span, cacheIndex, hasParser, max, len, index,
+ table = c.table,
+ parsers = c.parsers,
+ debug = ts.debug(c, 'core');
+ // update tbody variable
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
+ c.cache = {};
+ c.totalRows = 0;
+ // if no parsers found, return - it's an empty table.
+ if ( !parsers ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
+ }
+ if ( debug ) {
+ cacheTime = new Date();
+ }
+ // processing icon
+ if ( c.showProcessing ) {
+ ts.isProcessing( table, true );
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbody.length; tbodyIndex++ ) {
+ colMax = []; // column max value per tbody
+ cache = c.cache[ tbodyIndex ] = {
+ normalized: [] // array of normalized row data; last entry contains 'rowData' above
+ // colMax: # // added at the end
+ };
+
+ totalRows = ( $tbody[ tbodyIndex ] && $tbody[ tbodyIndex ].rows.length ) || 0;
+ for ( rowIndex = 0; rowIndex < totalRows; ++rowIndex ) {
+ rowData = {
+ // order: original row order #
+ // $row : jQuery Object[]
+ child: [], // child row text (filter widget)
+ raw: [] // original row text
+ };
+ /** Add the table data to main data array */
+ $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
+ cols = [];
+ // ignore "remove-me" rows
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
+ continue;
+ }
+ // if this is a child row, add it to the last row's children and continue to the next row
+ // ignore child row class, if it is the first row
+ if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
+ len = cache.normalized.length - 1;
+ prevRowData = cache.normalized[ len ][ c.columns ];
+ prevRowData.$row = prevRowData.$row.add( $row );
+ // add 'hasChild' class name to parent row
+ if ( !$row.prev().hasClass( c.cssChildRow ) ) {
+ $row.prev().addClass( ts.css.cssHasChild );
+ }
+ // save child row content (un-parsed!)
+ $cells = $row.children( 'th, td' );
+ len = prevRowData.child.length;
+ prevRowData.child[ len ] = [];
+ // child row content does not account for colspans/rowspans; so indexing may be off
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; colIndex++ ) {
+ cell = $cells[ colIndex ];
+ if ( cell ) {
+ prevRowData.child[ len ][ colIndex ] = ts.getParsedText( c, cell, colIndex );
+ span = $cells[ colIndex ].colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // go to the next for loop
+ continue;
+ }
+ rowData.$row = $row;
+ rowData.order = rowIndex; // add original row position to rowCache
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; ++colIndex ) {
+ cell = $row[ 0 ].cells[ colIndex ];
+ if ( cell && cacheIndex < c.columns ) {
+ hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
+ if ( !hasParser && debug ) {
+ console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
+ '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
+ }
+ val = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = val; // save original row text
+ // save raw column text even if there is no parser set
+ txt = ts.getParsedText( c, cell, cacheIndex, val );
+ cols[ cacheIndex ] = txt;
+ if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // determine column max value (ignore sign)
+ colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
+ }
+ // allow colSpan in tbody
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ index = 0;
+ while ( index <= span ) {
+ // duplicate text (or not) to spanned columns
+ // instead of setting duplicate span to empty string, use textExtraction to try to get a value
+ // see http://stackoverflow.com/q/36449711/145346
+ txt = c.duplicateSpan || index === 0 ?
+ txt :
+ typeof c.textExtraction !== 'string' ?
+ ts.getElementText( c, cell, cacheIndex + index ) || '' :
+ '';
+ rowData.raw[ cacheIndex + index ] = txt;
+ cols[ cacheIndex + index ] = txt;
+ index++;
+ }
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // ensure rowData is always in the same location (after the last column)
+ cols[ c.columns ] = rowData;
+ cache.normalized[ cache.normalized.length ] = cols;
+ }
+ cache.colMax = colMax;
+ // total up rows, not including child rows
+ c.totalRows += cache.normalized.length;
+
+ }
+ if ( c.showProcessing ) {
+ ts.isProcessing( table ); // remove processing icon
+ }
+ if ( debug ) {
+ len = Math.min( 5, c.cache[ 0 ].normalized.length );
+ console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
+ ts.benchmark( cacheTime ) );
+ val = {};
+ for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
+ for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
+ if ( !val[ 'row: ' + cacheIndex ] ) {
+ val[ 'row: ' + cacheIndex ] = {};
+ }
+ val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] =
+ c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ];
+ }
+ }
+ console[ console.table ? 'table' : 'log' ]( val );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ getColumnText : function( table, column, callback, rowFilter ) {
+ table = $( table )[0];
+ var tbodyIndex, rowIndex, cache, row, tbodyLen, rowLen, raw, parsed, $cell, result,
+ hasCallback = typeof callback === 'function',
+ allColumns = column === 'all',
+ data = { raw : [], parsed: [], $cell: [] },
+ c = table.config;
+ if ( ts.isEmptyObject( c ) ) {
+ if ( ts.debug(c, 'core') ) {
+ console.warn( 'No cache found - aborting getColumnText function!' );
+ }
+ } else {
+ tbodyLen = c.$tbodies.length;
+ for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
+ cache = c.cache[ tbodyIndex ].normalized;
+ rowLen = cache.length;
+ for ( rowIndex = 0; rowIndex < rowLen; rowIndex++ ) {
+ row = cache[ rowIndex ];
+ if ( rowFilter && !row[ c.columns ].$row.is( rowFilter ) ) {
+ continue;
+ }
+ result = true;
+ parsed = ( allColumns ) ? row.slice( 0, c.columns ) : row[ column ];
+ row = row[ c.columns ];
+ raw = ( allColumns ) ? row.raw : row.raw[ column ];
+ $cell = ( allColumns ) ? row.$row.children() : row.$row.children().eq( column );
+ if ( hasCallback ) {
+ result = callback({
+ tbodyIndex : tbodyIndex,
+ rowIndex : rowIndex,
+ parsed : parsed,
+ raw : raw,
+ $row : row.$row,
+ $cell : $cell
+ });
+ }
+ if ( result !== false ) {
+ data.parsed[ data.parsed.length ] = parsed;
+ data.raw[ data.raw.length ] = raw;
+ data.$cell[ data.$cell.length ] = $cell;
+ }
+ }
+ }
+ // return everything
+ return data;
+ }
+ },
+
+ /*
+ ██ ██ █████▄ █████▄ ▄████▄ ██████ ██████
+ ██ ██ ██▄▄██ ██ ██ ██▄▄██ ██ ██▄▄
+ ██ ██ ██▀▀▀ ██ ██ ██▀▀██ ██ ██▀▀
+ ▀████▀ ██ █████▀ ██ ██ ██ ██████
+ */
+ setHeadersCss : function( c ) {
+ var indx, column,
+ list = c.sortList,
+ len = list.length,
+ none = ts.css.sortNone + ' ' + c.cssNone,
+ css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
+ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
+ aria = [ 'ascending', 'descending' ],
+ updateColumnSort = function($el, index) {
+ $el
+ .removeClass( none )
+ .addClass( css[ index ] )
+ .attr( 'aria-sort', aria[ index ] )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon[ 2 ] )
+ .addClass( cssIcon[ index ] );
+ },
+ // find the footer
+ $extras = c.$table
+ .find( 'tfoot tr' )
+ .children( 'td, th' )
+ .add( $( c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) ),
+ // remove all header information
+ $sorted = c.$headers
+ .add( $( 'thead ' + c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) )
+ .addClass( none )
+ .attr( 'aria-sort', 'none' )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon.join( ' ' ) )
+ .end();
+ // add css none to all sortable headers
+ $sorted
+ .not( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( cssIcon[ 2 ] );
+ // add disabled css icon class
+ if ( c.cssIconDisabled ) {
+ $sorted
+ .filter( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( c.cssIconDisabled );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ // direction = 2 means reset!
+ if ( list[ indx ][ 1 ] !== 2 ) {
+ // multicolumn sorting updating - see #1005
+ // .not(function() {}) needs jQuery 1.4
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
+ $sorted = c.$headers.filter( function( i ) {
+ // only include headers that are in the sortList (this includes colspans)
+ var include = true,
+ $el = c.$headers.eq( i ),
+ col = parseInt( $el.attr( 'data-column' ), 10 ),
+ end = col + ts.getClosest( $el, 'th, td' )[0].colSpan;
+ for ( ; col < end; col++ ) {
+ include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false;
+ }
+ return include;
+ });
+
+ // choose the :last in case there are nested columns
+ $sorted = $sorted
+ .not( '.sorter-false' )
+ .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' + ( len === 1 ? ':last' : '' ) );
+ if ( $sorted.length ) {
+ for ( column = 0; column < $sorted.length; column++ ) {
+ if ( !$sorted[ column ].sortDisabled ) {
+ updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add sorted class to footer & extra headers, if they exist
+ if ( $extras.length ) {
+ updateColumnSort( $extras.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add verbose aria labels
+ len = c.$headers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ ts.setColumnAriaLabel( c, c.$headers.eq( indx ) );
+ }
+ },
+
+ getClosest : function( $el, selector ) {
+ // jQuery v1.2.6 doesn't have closest()
+ if ( $.fn.closest ) {
+ return $el.closest( selector );
+ }
+ return $el.is( selector ) ?
+ $el :
+ $el.parents( selector ).filter( ':first' );
+ },
+
+ // nextSort (optional), lets you disable next sort text
+ setColumnAriaLabel : function( c, $header, nextSort ) {
+ if ( $header.length ) {
+ var column = parseInt( $header.attr( 'data-column' ), 10 ),
+ vars = c.sortVars[ column ],
+ tmp = $header.hasClass( ts.css.sortAsc ) ?
+ 'sortAsc' :
+ $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
+ txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ];
+ if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
+ txt += ts.language.sortDisabled;
+ } else {
+ tmp = ( vars.count + 1 ) % vars.order.length;
+ nextSort = vars.order[ tmp ];
+ // if nextSort
+ txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
+ }
+ $header.attr( 'aria-label', txt );
+ if (vars.sortedBy) {
+ $header.attr( 'data-sortedBy', vars.sortedBy );
+ } else {
+ $header.removeAttr('data-sortedBy');
+ }
+ }
+ },
+
+ updateHeader : function( c ) {
+ var index, isDisabled, $header, col,
+ table = c.table,
+ len = c.$headers.length;
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ col = ts.getColumnData( table, c.headers, index, true );
+ // add 'sorter-false' class if 'parser-false' is set
+ isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false';
+ ts.setColumnSort( c, $header, isDisabled );
+ }
+ },
+
+ setColumnSort : function( c, $header, isDisabled ) {
+ var id = c.table.id;
+ $header[ 0 ].sortDisabled = isDisabled;
+ $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' )
+ .attr( 'aria-disabled', '' + isDisabled );
+ // disable tab index on disabled cells
+ if ( c.tabIndex ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'tabindex' );
+ } else {
+ $header.attr( 'tabindex', '0' );
+ }
+ }
+ // aria-controls - requires table ID
+ if ( id ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'aria-controls' );
+ } else {
+ $header.attr( 'aria-controls', id );
+ }
+ }
+ },
+
+ updateHeaderSortCount : function( c, list ) {
+ var col, dir, group, indx, primary, temp, val, order,
+ sortList = list || c.sortList,
+ len = sortList.length;
+ c.sortList = [];
+ for ( indx = 0; indx < len; indx++ ) {
+ val = sortList[ indx ];
+ // ensure all sortList values are numeric - fixes #127
+ col = parseInt( val[ 0 ], 10 );
+ // prevents error if sorton array is wrong
+ if ( col < c.columns ) {
+
+ // set order if not already defined - due to colspan header without associated header cell
+ // adding this check prevents a javascript error
+ if ( !c.sortVars[ col ].order ) {
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
+ } else {
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
+ }
+ c.sortVars[ col ].order = order;
+ c.sortVars[ col ].count = 0;
+ }
+
+ order = c.sortVars[ col ].order;
+ dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ );
+ dir = dir ? dir[ 0 ] : '';
+ // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext
+ switch ( dir ) {
+ case '1' : case 'd' : // descending
+ dir = 1;
+ break;
+ case 's' : // same direction (as primary column)
+ // if primary sort is set to 's', make it ascending
+ dir = primary || 0;
+ break;
+ case 'o' :
+ temp = order[ ( primary || 0 ) % order.length ];
+ // opposite of primary column; but resets if primary resets
+ dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
+ break;
+ case 'n' :
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
+ break;
+ default : // ascending
+ dir = 0;
+ break;
+ }
+ primary = indx === 0 ? dir : primary;
+ group = [ col, parseInt( dir, 10 ) || 0 ];
+ c.sortList[ c.sortList.length ] = group;
+ dir = $.inArray( group[ 1 ], order ); // fixes issue #167
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
+ }
+ }
+ },
+
+ updateAll : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ ts.refreshWidgets( table, true, true );
+ ts.buildHeaders( c );
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ update : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ // update sorting (if enabled/disabled)
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ // simple header update - see #989
+ updateHeaders : function( c, callback ) {
+ c.table.isUpdating = true;
+ ts.buildHeaders( c );
+ ts.bindEvents( c.table, c.$headers, true );
+ ts.resortComplete( c, callback );
+ },
+
+ updateCell : function( c, cell, resort, callback ) {
+ // updateCell for child rows is a mess - we'll ignore them for now
+ // eventually I'll break out the "update" row cache code to make everything consistent
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
+ return;
+ }
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #1099
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ return;
+ }
+ c.table.isUpdating = true;
+ c.$table.find( c.selectorRemove ).remove();
+ // get position from the dom
+ var tmp, indx, row, icell, cache, len,
+ $tbodies = c.$tbodies,
+ $cell = $( cell ),
+ // update cache - format: function( s, table, cell, cellIndex )
+ // no closest in jQuery v1.2.6
+ tbodyIndex = $tbodies.index( ts.getClosest( $cell, 'tbody' ) ),
+ tbcache = c.cache[ tbodyIndex ],
+ $row = ts.getClosest( $cell, 'tr' );
+ cell = $cell[ 0 ]; // in case cell is a jQuery object
+ // tbody may not exist if update is initialized while tbody is removed for processing
+ if ( $tbodies.length && tbodyIndex >= 0 ) {
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
+ cache = tbcache.normalized[ row ];
+ len = $row[ 0 ].cells.length;
+ if ( len !== c.columns ) {
+ // colspan in here somewhere!
+ icell = 0;
+ tmp = false;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( !tmp && $row[ 0 ].cells[ indx ] !== cell ) {
+ icell += $row[ 0 ].cells[ indx ].colSpan;
+ } else {
+ tmp = true;
+ }
+ }
+ } else {
+ icell = $cell.index();
+ }
+ tmp = ts.getElementText( c, cell, icell ); // raw
+ cache[ c.columns ].raw[ icell ] = tmp;
+ tmp = ts.getParsedText( c, cell, icell, tmp );
+ cache[ icell ] = tmp; // parsed
+ if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
+ }
+ tmp = resort !== 'undefined' ? resort : c.resort;
+ if ( tmp !== false ) {
+ // widgets will be reapplied
+ ts.checkResort( c, tmp, callback );
+ } else {
+ // don't reapply widgets is resort is false, just in case it causes
+ // problems with element focus
+ ts.resortComplete( c, callback );
+ }
+ } else {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
+ }
+ c.table.isUpdating = false;
+ }
+ },
+
+ addRows : function( c, $row, resort, callback ) {
+ var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
+ cacheIndex, rowData, cells, cell, span,
+ // allow passing a row string if only one non-info tbody exists in the table
+ valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
+ table = c.table;
+ if ( valid ) {
+ $row = $( $row );
+ c.$tbodies.append( $row );
+ } else if (
+ !$row ||
+ // row is a jQuery object?
+ !( $row instanceof $ ) ||
+ // row contained in the table?
+ ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
+ ) {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
+ 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
+ }
+ return false;
+ }
+ table.isUpdating = true;
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #450
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ } else {
+ rows = $row.filter( 'tr' ).attr( 'role', 'row' ).length;
+ tbodyIndex = c.$tbodies.index( $row.parents( 'tbody' ).filter( ':first' ) );
+ // fixes adding rows to an empty table - see issue #179
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c );
+ }
+ // add each row
+ for ( rowIndex = 0; rowIndex < rows; rowIndex++ ) {
+ cacheIndex = 0;
+ len = $row[ rowIndex ].cells.length;
+ order = c.cache[ tbodyIndex ].normalized.length;
+ cells = [];
+ rowData = {
+ child : [],
+ raw : [],
+ $row : $row.eq( rowIndex ),
+ order : order
+ };
+ // add each cell
+ for ( cellIndex = 0; cellIndex < len; cellIndex++ ) {
+ cell = $row[ rowIndex ].cells[ cellIndex ];
+ txt = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = txt;
+ val = ts.getParsedText( c, cell, cacheIndex, txt );
+ cells[ cacheIndex ] = val;
+ if ( ( c.parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ c.cache[ tbodyIndex ].colMax[ cacheIndex ] =
+ Math.max( Math.abs( val ) || 0, c.cache[ tbodyIndex ].colMax[ cacheIndex ] || 0 );
+ }
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ }
+ cacheIndex++;
+ }
+ // add the row data to the end
+ cells[ c.columns ] = rowData;
+ // update cache
+ c.cache[ tbodyIndex ].normalized[ order ] = cells;
+ }
+ // resort using current settings
+ ts.checkResort( c, resort, callback );
+ }
+ },
+
+ updateCache : function( c, callback, $tbodies ) {
+ // rebuild parsers
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c, $tbodies );
+ }
+ // rebuild the cache map
+ ts.buildCache( c, callback, $tbodies );
+ },
+
+ // init flag (true) used by pager plugin to prevent widget application
+ // renamed from appendToTable
+ appendCache : function( c, init ) {
+ var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
+ table = c.table,
+ $tbodies = c.$tbodies,
+ rows = [],
+ cache = c.cache;
+ // empty table - fixes #206/#346
+ if ( ts.isEmptyObject( cache ) ) {
+ // run pager appender in case the table was just emptied
+ return c.appender ? c.appender( table, rows ) :
+ table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
+ }
+ if ( ts.debug(c, 'core') ) {
+ appendTime = new Date();
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = $tbodies.eq( tbodyIndex );
+ if ( $tbody.length ) {
+ // detach tbody for manipulation
+ $curTbody = ts.processTbody( table, $tbody, true );
+ parsed = cache[ tbodyIndex ].normalized;
+ totalRows = parsed.length;
+ for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
+ rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
+ // removeRows used by the pager plugin; don't render if using ajax - fixes #411
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
+ $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
+ }
+ }
+ // restore tbody
+ ts.processTbody( table, $curTbody, false );
+ }
+ }
+ if ( c.appender ) {
+ c.appender( table, rows );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
+ }
+ // apply table widgets; but not before ajax completes
+ if ( !init && !c.appender ) {
+ ts.applyWidget( table );
+ }
+ if ( table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', table );
+ }
+ },
+
+ commonUpdate : function( c, resort, callback ) {
+ // remove rows/elements before update
+ c.$table.find( c.selectorRemove ).remove();
+ // rebuild parsers
+ ts.setupParsers( c );
+ // rebuild the cache map
+ ts.buildCache( c );
+ ts.checkResort( c, resort, callback );
+ },
+
+ /*
+ ▄█████ ▄████▄ █████▄ ██████ ██ █████▄ ▄████▄
+ ▀█▄ ██ ██ ██▄▄██ ██ ██ ██ ██ ██ ▄▄▄
+ ▀█▄ ██ ██ ██▀██ ██ ██ ██ ██ ██ ▀██
+ █████▀ ▀████▀ ██ ██ ██ ██ ██ ██ ▀████▀
+ */
+ initSort : function( c, cell, event ) {
+ if ( c.table.isUpdating ) {
+ // let any updates complete before initializing a sort
+ return setTimeout( function() {
+ ts.initSort( c, cell, event );
+ }, 50 );
+ }
+
+ var arry, indx, headerIndx, dir, temp, tmp, $header,
+ notMultiSort = !event[ c.sortMultiSortKey ],
+ table = c.table,
+ len = c.$headers.length,
+ th = ts.getClosest( $( cell ), 'th, td' ),
+ col = parseInt( th.attr( 'data-column' ), 10 ),
+ sortedBy = event.type === 'mouseup' ? 'user' : event.type,
+ order = c.sortVars[ col ].order;
+ th = th[0];
+ // Only call sortStart if sorting is enabled
+ c.$table.triggerHandler( 'sortStart', table );
+ // get current column sort order
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
+ // reset all sorts on non-current column - issue #30
+ if ( c.sortRestart ) {
+ for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
+ $header = c.$headers.eq( headerIndx );
+ tmp = parseInt( $header.attr( 'data-column' ), 10 );
+ // only reset counts on columns that weren't just clicked on and if not included in a multisort
+ if ( col !== tmp && ( notMultiSort || $header.hasClass( ts.css.sortNone ) ) ) {
+ c.sortVars[ tmp ].count = -1;
+ }
+ }
+ }
+ // user only wants to sort on one column
+ if ( notMultiSort ) {
+ $.each( c.sortVars, function( i ) {
+ c.sortVars[ i ].sortedBy = '';
+ });
+ // flush the sort list
+ c.sortList = [];
+ c.last.sortList = [];
+ if ( c.sortForce !== null ) {
+ arry = c.sortForce;
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col ) {
+ c.sortList[ c.sortList.length ] = arry[ indx ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortForce';
+ }
+ }
+ }
+ // add column to sort list
+ dir = order[ c.sortVars[ col ].count ];
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ // multi column sorting
+ } else {
+ // get rid of the sortAppend before adding more - fixes issue #115 & #523
+ c.sortList = $.extend( [], c.last.sortList );
+
+ // the user has clicked on an already sorted column
+ if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
+ // reverse the sorting direction
+ c.sortVars[ col ].sortedBy = sortedBy;
+ for ( indx = 0; indx < c.sortList.length; indx++ ) {
+ tmp = c.sortList[ indx ];
+ if ( tmp[ 0 ] === col ) {
+ // order.count seems to be incorrect when compared to cell.count
+ tmp[ 1 ] = order[ c.sortVars[ col ].count ];
+ if ( tmp[1] === 2 ) {
+ c.sortList.splice( indx, 1 );
+ c.sortVars[ col ].count = -1;
+ }
+ }
+ }
+ } else {
+ // add column to sort list array
+ dir = order[ c.sortVars[ col ].count ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ }
+ }
+ // save sort before applying sortAppend
+ c.last.sortList = $.extend( [], c.sortList );
+ if ( c.sortList.length && c.sortAppend ) {
+ arry = $.isArray( c.sortAppend ) ? c.sortAppend : c.sortAppend[ c.sortList[ 0 ][ 0 ] ];
+ if ( !ts.isEmptyObject( arry ) ) {
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col && ts.isValueInArray( arry[ indx ][ 0 ], c.sortList ) < 0 ) {
+ dir = arry[ indx ][ 1 ];
+ temp = ( '' + dir ).match( /^(a|d|s|o|n)/ );
+ if ( temp ) {
+ tmp = c.sortList[ 0 ][ 1 ];
+ switch ( temp[ 0 ] ) {
+ case 'd' :
+ dir = 1;
+ break;
+ case 's' :
+ dir = tmp;
+ break;
+ case 'o' :
+ dir = tmp === 0 ? 1 : 0;
+ break;
+ case 'n' :
+ dir = ( tmp + 1 ) % order.length;
+ break;
+ default:
+ dir = 0;
+ break;
+ }
+ }
+ c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortAppend';
+ }
+ }
+ }
+ }
+ // sortBegin event triggered immediately before the sort
+ c.$table.triggerHandler( 'sortBegin', table );
+ // setTimeout needed so the processing icon shows up
+ setTimeout( function() {
+ // set css for headers
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ }, 1 );
+ },
+
+ // sort multiple columns
+ multisort : function( c ) { /*jshint loopfunc:true */
+ var tbodyIndex, sortTime, colMax, rows, tmp,
+ table = c.table,
+ sorter = [],
+ dir = 0,
+ textSorter = c.textSorter || '',
+ sortList = c.sortList,
+ sortLen = sortList.length,
+ len = c.$tbodies.length;
+ if ( c.serverSideSorting || ts.isEmptyObject( c.cache ) ) {
+ // empty table - fixes #206/#346
+ return;
+ }
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
+ // cache textSorter to optimize speed
+ if ( typeof textSorter === 'object' ) {
+ colMax = c.columns;
+ while ( colMax-- ) {
+ tmp = ts.getColumnData( table, textSorter, colMax );
+ if ( typeof tmp === 'function' ) {
+ sorter[ colMax ] = tmp;
+ }
+ }
+ }
+ for ( tbodyIndex = 0; tbodyIndex < len; tbodyIndex++ ) {
+ colMax = c.cache[ tbodyIndex ].colMax;
+ rows = c.cache[ tbodyIndex ].normalized;
+
+ rows.sort( function( a, b ) {
+ var sortIndex, num, col, order, sort, x, y;
+ // rows is undefined here in IE, so don't use it!
+ for ( sortIndex = 0; sortIndex < sortLen; sortIndex++ ) {
+ col = sortList[ sortIndex ][ 0 ];
+ order = sortList[ sortIndex ][ 1 ];
+ // sort direction, true = asc, false = desc
+ dir = order === 0;
+
+ if ( c.sortStable && a[ col ] === b[ col ] && sortLen === 1 ) {
+ return a[ c.columns ].order - b[ c.columns ].order;
+ }
+
+ // fallback to natural sort since it is more robust
+ num = /n/i.test( ts.getSortType( c.parsers, col ) );
+ if ( num && c.strings[ col ] ) {
+ // sort strings in numerical columns
+ if ( typeof ( ts.string[ c.strings[ col ] ] ) === 'boolean' ) {
+ num = ( dir ? 1 : -1 ) * ( ts.string[ c.strings[ col ] ] ? -1 : 1 );
+ } else {
+ num = ( c.strings[ col ] ) ? ts.string[ c.strings[ col ] ] || 0 : 0;
+ }
+ // fall back to built-in numeric sort
+ // var sort = $.tablesorter['sort' + s]( a[col], b[col], dir, colMax[col], table );
+ sort = c.numberSorter ? c.numberSorter( a[ col ], b[ col ], dir, colMax[ col ], table ) :
+ ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], num, colMax[ col ], col, c );
+ } else {
+ // set a & b depending on sort direction
+ x = dir ? a : b;
+ y = dir ? b : a;
+ // text sort function
+ if ( typeof textSorter === 'function' ) {
+ // custom OVERALL text sorter
+ sort = textSorter( x[ col ], y[ col ], dir, col, table );
+ } else if ( typeof sorter[ col ] === 'function' ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
+ } else {
+ // fall back to natural sort
+ sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ] || '', b[ col ] || '', col, c );
+ }
+ }
+ if ( sort ) { return sort; }
+ }
+ return a[ c.columns ].order - b[ c.columns ].order;
+ });
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
+ }
+ },
+
+ resortComplete : function( c, callback ) {
+ if ( c.table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', c.table );
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ checkResort : function( c, resort, callback ) {
+ var sortList = $.isArray( resort ) ? resort : c.sortList,
+ // if no resort parameter is passed, fallback to config.resort (true by default)
+ resrt = typeof resort === 'undefined' ? c.resort : resort;
+ // don't try to resort if the table is still processing
+ // this will catch spamming of the updateCell method
+ if ( resrt !== false && !c.serverSideSorting && !c.table.isProcessing ) {
+ if ( sortList.length ) {
+ ts.sortOn( c, sortList, function() {
+ ts.resortComplete( c, callback );
+ }, true );
+ } else {
+ ts.sortReset( c, function() {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ } );
+ }
+ } else {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ }
+ },
+
+ sortOn : function( c, list, callback, init ) {
+ var indx,
+ table = c.table;
+ c.$table.triggerHandler( 'sortStart', table );
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].sortedBy = ts.isValueInArray( indx, list ) > -1 ? 'sorton' : '';
+ }
+ // update header count index
+ ts.updateHeaderSortCount( c, list );
+ // set css for headers
+ ts.setHeadersCss( c );
+ // fixes #346
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ c.$table.triggerHandler( 'sortBegin', table );
+ // sort the table and append it to the dom
+ ts.multisort( c );
+ ts.appendCache( c, init );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ ts.applyWidget( table );
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ sortReset : function( c, callback ) {
+ c.sortList = [];
+ var indx;
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].count = -1;
+ c.sortVars[ indx ].sortedBy = '';
+ }
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ getSortType : function( parsers, column ) {
+ return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : '';
+ },
+
+ getOrder : function( val ) {
+ // look for 'd' in 'desc' order; return true
+ return ( /^d/i.test( val ) || val === 1 );
+ },
+
+ // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
+ sortNatural : function( a, b ) {
+ if ( a === b ) { return 0; }
+ a = ( a || '' ).toString();
+ b = ( b || '' ).toString();
+ var aNum, bNum, aFloat, bFloat, indx, max,
+ regex = ts.regex;
+ // first try and sort Hex codes
+ if ( regex.hex.test( b ) ) {
+ aNum = parseInt( a.match( regex.hex ), 16 );
+ bNum = parseInt( b.match( regex.hex ), 16 );
+ if ( aNum < bNum ) { return -1; }
+ if ( aNum > bNum ) { return 1; }
+ }
+ // chunk/tokenize
+ aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ max = Math.max( aNum.length, bNum.length );
+ // natural sorting through split numeric strings and default strings
+ for ( indx = 0; indx < max; indx++ ) {
+ // find floats not starting with '0', string or 0 if not defined
+ aFloat = isNaN( aNum[ indx ] ) ? aNum[ indx ] || 0 : parseFloat( aNum[ indx ] ) || 0;
+ bFloat = isNaN( bNum[ indx ] ) ? bNum[ indx ] || 0 : parseFloat( bNum[ indx ] ) || 0;
+ // handle numeric vs string comparison - number < string - (Kyle Adams)
+ if ( isNaN( aFloat ) !== isNaN( bFloat ) ) { return isNaN( aFloat ) ? 1 : -1; }
+ // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
+ if ( typeof aFloat !== typeof bFloat ) {
+ aFloat += '';
+ bFloat += '';
+ }
+ if ( aFloat < bFloat ) { return -1; }
+ if ( aFloat > bFloat ) { return 1; }
+ }
+ return 0;
+ },
+
+ sortNaturalAsc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ return ts.sortNatural( a, b );
+ },
+
+ sortNaturalDesc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ return ts.sortNatural( b, a );
+ },
+
+ // basic alphabetical sort
+ sortText : function( a, b ) {
+ return a > b ? 1 : ( a < b ? -1 : 0 );
+ },
+
+ // return text string value by adding up ascii value
+ // so the text is somewhat sorted when using a digital sort
+ // this is NOT an alphanumeric sort
+ getTextValue : function( val, num, max ) {
+ if ( max ) {
+ // make sure the text value is greater than the max numerical value (max)
+ var indx,
+ len = val ? val.length : 0,
+ n = max + num;
+ for ( indx = 0; indx < len; indx++ ) {
+ n += val.charCodeAt( indx );
+ }
+ return num * n;
+ }
+ return 0;
+ },
+
+ sortNumericAsc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return a - b;
+ },
+
+ sortNumericDesc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return b - a;
+ },
+
+ sortNumeric : function( a, b ) {
+ return a - b;
+ },
+
+ /*
+ ██ ██ ██ ██ █████▄ ▄████▄ ██████ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ▄▄▄ ██▄▄ ██ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ▀██ ██▀▀ ██ ▀█▄
+ ███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀
+ */
+ addWidget : function( widget ) {
+ if ( widget.id && !ts.isEmptyObject( ts.getWidgetById( widget.id ) ) ) {
+ console.warn( '"' + widget.id + '" widget was loaded more than once!' );
+ }
+ ts.widgets[ ts.widgets.length ] = widget;
+ },
+
+ hasWidget : function( $table, name ) {
+ $table = $( $table );
+ return $table.length && $table[ 0 ].config && $table[ 0 ].config.widgetInit[ name ] || false;
+ },
+
+ getWidgetById : function( name ) {
+ var indx, widget,
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id && widget.id.toLowerCase() === name.toLowerCase() ) {
+ return widget;
+ }
+ }
+ },
+
+ applyWidgetOptions : function( table ) {
+ var indx, widget, wo,
+ c = table.config,
+ len = c.widgets.length;
+ if ( len ) {
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( c.widgets[ indx ] );
+ if ( widget && widget.options ) {
+ wo = $.extend( true, {}, widget.options );
+ c.widgetOptions = $.extend( true, wo, c.widgetOptions );
+ // add widgetOptions to defaults for option validator
+ $.extend( true, ts.defaults.widgetOptions, widget.options );
+ }
+ }
+ }
+ },
+
+ addWidgetFromClass : function( table ) {
+ var len, indx,
+ c = table.config,
+ // look for widgets to apply from table class
+ // don't match from 'ui-widget-content'; use \S instead of \w to include widgets
+ // with dashes in the name, e.g. "widget-test-2" extracts out "test-2"
+ regex = '^' + c.widgetClass.replace( ts.regex.templateName, '(\\S+)+' ) + '$',
+ widgetClass = new RegExp( regex, 'g' ),
+ // split up table class (widget id's can include dashes) - stop using match
+ // otherwise only one widget gets extracted, see #1109
+ widgets = ( table.className || '' ).split( ts.regex.spaces );
+ if ( widgets.length ) {
+ len = widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( widgets[ indx ].match( widgetClass ) ) {
+ c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' );
+ }
+ }
+ }
+ },
+
+ applyWidgetId : function( table, id, init ) {
+ table = $(table)[0];
+ var applied, time, name,
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'core'),
+ widget = ts.getWidgetById( id );
+ if ( widget ) {
+ name = widget.id;
+ applied = false;
+ // add widget name to option list so it gets reapplied after sorting, filtering, etc
+ if ( $.inArray( name, c.widgets ) < 0 ) {
+ c.widgets[ c.widgets.length ] = name;
+ }
+ if ( debug ) { time = new Date(); }
+
+ if ( init || !( c.widgetInit[ name ] ) ) {
+ // set init flag first to prevent calling init more than once (e.g. pager)
+ c.widgetInit[ name ] = true;
+ if ( table.hasInitialized ) {
+ // don't reapply widget options on tablesorter init
+ ts.applyWidgetOptions( table );
+ }
+ if ( typeof widget.init === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
+ }
+ widget.init( table, widget, c, wo );
+ }
+ }
+ if ( !init && typeof widget.format === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
+ }
+ widget.format( table, c, wo, false );
+ }
+ if ( debug ) {
+ if ( applied ) {
+ console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ }
+ }
+ },
+
+ applyWidget : function( table, init, callback ) {
+ table = $( table )[ 0 ]; // in case this is called externally
+ var indx, len, names, widget, time,
+ c = table.config,
+ debug = ts.debug(c, 'core'),
+ widgets = [];
+ // prevent numerous consecutive widget applications
+ if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
+ return;
+ }
+ if ( debug ) { time = new Date(); }
+ ts.addWidgetFromClass( table );
+ // prevent "tablesorter-ready" from firing multiple times in a row
+ clearTimeout( c.timerReady );
+ if ( c.widgets.length ) {
+ table.isApplyingWidgets = true;
+ // ensure unique widget ids
+ c.widgets = $.grep( c.widgets, function( val, index ) {
+ return $.inArray( val, c.widgets ) === index;
+ });
+ names = c.widgets || [];
+ len = names.length;
+ // build widget array & add priority as needed
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( names[ indx ] );
+ if ( widget && widget.id ) {
+ // set priority to 10 if not defined
+ if ( !widget.priority ) { widget.priority = 10; }
+ widgets[ indx ] = widget;
+ } else if ( debug ) {
+ console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
+ }
+ }
+ // sort widgets by priority
+ widgets.sort( function( a, b ) {
+ return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1;
+ });
+ // add/update selected widgets
+ len = widgets.length;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id ) {
+ ts.applyWidgetId( table, widget.id, init );
+ }
+ }
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
+ }
+ c.timerReady = setTimeout( function() {
+ table.isApplyingWidgets = false;
+ $.data( table, 'lastWidgetApplication', new Date() );
+ c.$table.triggerHandler( 'tablesorter-ready' );
+ // callback executed on init only
+ if ( !init && typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( debug ) {
+ widget = c.widgets.length;
+ console.log( 'Completed ' +
+ ( init === true ? 'initializing ' : 'applying ' ) + widget +
+ ' widget' + ( widget !== 1 ? 's' : '' ) + ts.benchmark( time ) );
+ }
+ }, 10 );
+ },
+
+ removeWidget : function( table, name, refreshing ) {
+ table = $( table )[ 0 ];
+ var index, widget, indx, len,
+ c = table.config;
+ // if name === true, add all widgets from $.tablesorter.widgets
+ if ( name === true ) {
+ name = [];
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id ) {
+ name[ name.length ] = widget.id;
+ }
+ }
+ } else {
+ // name can be either an array of widgets names,
+ // or a space/comma separated list of widget names
+ name = ( $.isArray( name ) ? name.join( ',' ) : name || '' ).toLowerCase().split( /[\s,]+/ );
+ }
+ len = name.length;
+ for ( index = 0; index < len; index++ ) {
+ widget = ts.getWidgetById( name[ index ] );
+ indx = $.inArray( name[ index ], c.widgets );
+ // don't remove the widget from config.widget if refreshing
+ if ( indx >= 0 && refreshing !== true ) {
+ c.widgets.splice( indx, 1 );
+ }
+ if ( widget && widget.remove ) {
+ if ( ts.debug(c, 'core') ) {
+ console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
+ }
+ widget.remove( table, c, c.widgetOptions, refreshing );
+ c.widgetInit[ name[ index ] ] = false;
+ }
+ }
+ c.$table.triggerHandler( 'widgetRemoveEnd', table );
+ },
+
+ refreshWidgets : function( table, doAll, dontapply ) {
+ table = $( table )[ 0 ]; // see issue #243
+ var indx, widget,
+ c = table.config,
+ curWidgets = c.widgets,
+ widgets = ts.widgets,
+ len = widgets.length,
+ list = [],
+ callback = function( table ) {
+ $( table ).triggerHandler( 'refreshComplete' );
+ };
+ // remove widgets not defined in config.widgets, unless doAll is true
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) {
+ list[ list.length ] = widget.id;
+ }
+ }
+ ts.removeWidget( table, list.join( ',' ), true );
+ if ( dontapply !== true ) {
+ // call widget init if
+ ts.applyWidget( table, doAll || false, callback );
+ if ( doAll ) {
+ // apply widget format
+ ts.applyWidget( table, false, callback );
+ }
+ } else {
+ callback( table );
+ }
+ },
+
+ /*
+ ██ ██ ██████ ██ ██ ██ ██████ ██ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀█▄
+ ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
+ */
+ benchmark : function( diff ) {
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
+ },
+ // deprecated ts.log
+ log : function() {
+ console.log( arguments );
+ },
+ debug : function(c, name) {
+ return c && (
+ c.debug === true ||
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
+ );
+ },
+
+ // $.isEmptyObject from jQuery v1.4
+ isEmptyObject : function( obj ) {
+ /*jshint forin: false */
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isValueInArray : function( column, arry ) {
+ var indx,
+ len = arry && arry.length || 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( arry[ indx ][ 0 ] === column ) {
+ return indx;
+ }
+ }
+ return -1;
+ },
+
+ formatFloat : function( str, table ) {
+ if ( typeof str !== 'string' || str === '' ) { return str; }
+ // allow using formatFloat without a table; defaults to US number format
+ var num,
+ usFormat = table && table.config ? table.config.usNumberFormat !== false :
+ typeof table !== 'undefined' ? table : true;
+ if ( usFormat ) {
+ // US Format - 1,234,567.89 -> 1234567.89
+ str = str.replace( ts.regex.comma, '' );
+ } else {
+ // German Format = 1.234.567,89 -> 1234567.89
+ // French Format = 1 234 567,89 -> 1234567.89
+ str = str.replace( ts.regex.digitNonUS, '' ).replace( ts.regex.comma, '.' );
+ }
+ if ( ts.regex.digitNegativeTest.test( str ) ) {
+ // make (#) into a negative number -> (10) = -10
+ str = str.replace( ts.regex.digitNegativeReplace, '-$1' );
+ }
+ num = parseFloat( str );
+ // return the text instead of zero
+ return isNaN( num ) ? $.trim( str ) : num;
+ },
+
+ isDigit : function( str ) {
+ // replace all unwanted chars and match
+ return isNaN( str ) ?
+ ts.regex.digitTest.test( str.toString().replace( ts.regex.digitReplace, '' ) ) :
+ str !== '';
+ },
+
+ // computeTableHeaderCellIndexes from:
+ // http://www.javascripttoolbox.com/lib/table/examples.php
+ // http://www.javascripttoolbox.com/temp/table_cellindex.html
+ computeColumnIndex : function( $rows, c ) {
+ var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol,
+ // total columns has been calculated, use it to set the matrixrow
+ columns = c && c.columns || 0,
+ matrix = [],
+ matrixrow = new Array( columns );
+ for ( i = 0; i < $rows.length; i++ ) {
+ cells = $rows[ i ].cells;
+ for ( j = 0; j < cells.length; j++ ) {
+ cell = cells[ j ];
+ rowIndex = i;
+ rowSpan = cell.rowSpan || 1;
+ colSpan = cell.colSpan || 1;
+ if ( typeof matrix[ rowIndex ] === 'undefined' ) {
+ matrix[ rowIndex ] = [];
+ }
+ // Find first available column in the first row
+ for ( k = 0; k < matrix[ rowIndex ].length + 1; k++ ) {
+ if ( typeof matrix[ rowIndex ][ k ] === 'undefined' ) {
+ firstAvailCol = k;
+ break;
+ }
+ }
+ // jscs:disable disallowEmptyBlocks
+ if ( columns && cell.cellIndex === firstAvailCol ) {
+ // don't to anything
+ } else if ( cell.setAttribute ) {
+ // jscs:enable disallowEmptyBlocks
+ // add data-column (setAttribute = IE8+)
+ cell.setAttribute( 'data-column', firstAvailCol );
+ } else {
+ // remove once we drop support for IE7 - 1/12/2016
+ $( cell ).attr( 'data-column', firstAvailCol );
+ }
+ for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) {
+ if ( typeof matrix[ k ] === 'undefined' ) {
+ matrix[ k ] = [];
+ }
+ matrixrow = matrix[ k ];
+ for ( l = firstAvailCol; l < firstAvailCol + colSpan; l++ ) {
+ matrixrow[ l ] = 'x';
+ }
+ }
+ }
+ }
+ ts.checkColumnCount($rows, matrix, matrixrow.length);
+ return matrixrow.length;
+ },
+
+ checkColumnCount : function($rows, matrix, columns) {
+ // this DOES NOT report any tbody column issues, except for the math and
+ // and column selector widgets
+ var i, len,
+ valid = true,
+ cells = [];
+ for ( i = 0; i < matrix.length; i++ ) {
+ // some matrix entries are undefined when testing the footer because
+ // it is using the rowIndex property
+ if ( matrix[i] ) {
+ len = matrix[i].length;
+ if ( matrix[i].length !== columns ) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ if ( !valid ) {
+ $rows.each( function( indx, el ) {
+ var cell = el.parentElement.nodeName;
+ if ( cells.indexOf( cell ) < 0 ) {
+ cells.push( cell );
+ }
+ });
+ console.error(
+ 'Invalid or incorrect number of columns in the ' +
+ cells.join( ' or ' ) + '; expected ' + columns +
+ ', but found ' + len + ' columns'
+ );
+ }
+ },
+
+ // automatically add a colgroup with col elements set to a percentage width
+ fixColumnWidth : function( table ) {
+ table = $( table )[ 0 ];
+ var overallWidth, percent, $tbodies, len, index,
+ c = table.config,
+ $colgroup = c.$table.children( 'colgroup' );
+ // remove plugin-added colgroup, in case we need to refresh the widths
+ if ( $colgroup.length && $colgroup.hasClass( ts.css.colgroup ) ) {
+ $colgroup.remove();
+ }
+ if ( c.widthFixed && c.$table.children( 'colgroup' ).length === 0 ) {
+ $colgroup = $( '<colgroup class="' + ts.css.colgroup + '">' );
+ overallWidth = c.$table.width();
+ // only add col for visible columns - fixes #371
+ $tbodies = c.$tbodies.find( 'tr:first' ).children( ':visible' );
+ len = $tbodies.length;
+ for ( index = 0; index < len; index++ ) {
+ percent = parseInt( ( $tbodies.eq( index ).width() / overallWidth ) * 1000, 10 ) / 10 + '%';
+ $colgroup.append( $( '<col>' ).css( 'width', percent ) );
+ }
+ c.$table.prepend( $colgroup );
+ }
+ },
+
+ // get sorter, string, empty, etc options for each column from
+ // jQuery data, metadata, header option or header class name ('sorter-false')
+ // priority = jQuery data > meta > headers option > header class name
+ getData : function( header, configHeader, key ) {
+ var meta, cl4ss,
+ val = '',
+ $header = $( header );
+ if ( !$header.length ) { return ''; }
+ meta = $.metadata ? $header.metadata() : false;
+ cl4ss = ' ' + ( $header.attr( 'class' ) || '' );
+ if ( typeof $header.data( key ) !== 'undefined' ||
+ typeof $header.data( key.toLowerCase() ) !== 'undefined' ) {
+ // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder'
+ // 'data-sort-initial-order' is assigned to 'sortInitialOrder'
+ val += $header.data( key ) || $header.data( key.toLowerCase() );
+ } else if ( meta && typeof meta[ key ] !== 'undefined' ) {
+ val += meta[ key ];
+ } else if ( configHeader && typeof configHeader[ key ] !== 'undefined' ) {
+ val += configHeader[ key ];
+ } else if ( cl4ss !== ' ' && cl4ss.match( ' ' + key + '-' ) ) {
+ // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser'
+ val = cl4ss.match( new RegExp( '\\s' + key + '-([\\w-]+)' ) )[ 1 ] || '';
+ }
+ return $.trim( val );
+ },
+
+ getColumnData : function( table, obj, indx, getCell, $headers ) {
+ if ( typeof obj !== 'object' || obj === null ) {
+ return obj;
+ }
+ table = $( table )[ 0 ];
+ var $header, key,
+ c = table.config,
+ $cells = ( $headers || c.$headers ),
+ // c.$headerIndexed is not defined initially
+ $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
+ $cells.find( '[data-column="' + indx + '"]:last' );
+ if ( typeof obj[ indx ] !== 'undefined' ) {
+ return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
+ }
+ for ( key in obj ) {
+ if ( typeof key === 'string' ) {
+ $header = $cell
+ // header cell with class/id
+ .filter( key )
+ // find elements within the header cell with cell/id
+ .add( $cell.find( key ) );
+ if ( $header.length ) {
+ return obj[ key ];
+ }
+ }
+ }
+ return;
+ },
+
+ // *** Process table ***
+ // add processing indicator
+ isProcessing : function( $table, toggle, $headers ) {
+ $table = $( $table );
+ var c = $table[ 0 ].config,
+ // default to all headers
+ $header = $headers || $table.find( '.' + ts.css.header );
+ if ( toggle ) {
+ // don't use sortList if custom $headers used
+ if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) {
+ // get headers from the sortList
+ $header = $header.filter( function() {
+ // get data-column from attr to keep compatibility with jQuery 1.2.6
+ return this.sortDisabled ?
+ false :
+ ts.isValueInArray( parseFloat( $( this ).attr( 'data-column' ) ), c.sortList ) >= 0;
+ });
+ }
+ $table.add( $header ).addClass( ts.css.processing + ' ' + c.cssProcessing );
+ } else {
+ $table.add( $header ).removeClass( ts.css.processing + ' ' + c.cssProcessing );
+ }
+ },
+
+ // detach tbody but save the position
+ // don't use tbody because there are portions that look for a tbody index (updateCell)
+ processTbody : function( table, $tb, getIt ) {
+ table = $( table )[ 0 ];
+ if ( getIt ) {
+ table.isProcessing = true;
+ $tb.before( '<colgroup class="tablesorter-savemyplace"/>' );
+ return $.fn.detach ? $tb.detach() : $tb.remove();
+ }
+ var holdr = $( table ).find( 'colgroup.tablesorter-savemyplace' );
+ $tb.insertAfter( holdr );
+ holdr.remove();
+ table.isProcessing = false;
+ },
+
+ clearTableBody : function( table ) {
+ $( table )[ 0 ].config.$tbodies.children().detach();
+ },
+
+ // used when replacing accented characters during sorting
+ characterEquivalents : {
+ 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå
+ 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ
+ 'c' : '\u00e7\u0107\u010d', // çćč
+ 'C' : '\u00c7\u0106\u010c', // ÇĆČ
+ 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę
+ 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ
+ 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı
+ 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ
+ 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6\u014d', // óòôõöō
+ 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6\u014c', // ÓÒÔÕÖŌ
+ 'ss': '\u00df', // ß (s sharp)
+ 'SS': '\u1e9e', // ẞ (Capital sharp s)
+ 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů
+ 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ
+ },
+
+ replaceAccents : function( str ) {
+ var chr,
+ acc = '[',
+ eq = ts.characterEquivalents;
+ if ( !ts.characterRegex ) {
+ ts.characterRegexArray = {};
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ acc += eq[ chr ];
+ ts.characterRegexArray[ chr ] = new RegExp( '[' + eq[ chr ] + ']', 'g' );
+ }
+ }
+ ts.characterRegex = new RegExp( acc + ']' );
+ }
+ if ( ts.characterRegex.test( str ) ) {
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ str = str.replace( ts.characterRegexArray[ chr ], chr );
+ }
+ }
+ }
+ return str;
+ },
+
+ validateOptions : function( c ) {
+ var setting, setting2, typ, timer,
+ // ignore options containing an array
+ ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
+ orig = c.originalSettings;
+ if ( orig ) {
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ for ( setting in orig ) {
+ typ = typeof ts.defaults[setting];
+ if ( typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
+ } else if ( typ === 'object' ) {
+ for ( setting2 in orig[setting] ) {
+ typ = ts.defaults[setting] && typeof ts.defaults[setting][setting2];
+ if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
+ }
+ }
+ }
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'validate options time:' + ts.benchmark( timer ) );
+ }
+ }
+ },
+
+ // restore headers
+ restoreHeaders : function( table ) {
+ var index, $cell,
+ c = $( table )[ 0 ].config,
+ $headers = c.$table.find( c.selectorHeaders ),
+ len = $headers.length;
+ // don't use c.$headers here in case header cells were swapped
+ for ( index = 0; index < len; index++ ) {
+ $cell = $headers.eq( index );
+ // only restore header cells if it is wrapped
+ // because this is also used by the updateAll method
+ if ( $cell.find( '.' + ts.css.headerIn ).length ) {
+ $cell.html( c.headerContent[ index ] );
+ }
+ }
+ },
+
+ destroy : function( table, removeClasses, callback ) {
+ table = $( table )[ 0 ];
+ if ( !table.hasInitialized ) { return; }
+ // remove all widgets
+ ts.removeWidget( table, true, false );
+ var events,
+ $t = $( table ),
+ c = table.config,
+ $h = $t.find( 'thead:first' ),
+ $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
+ $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
+ if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) {
+ // reapply uitheme classes, in case we want to maintain appearance
+ $t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] );
+ $t.triggerHandler( 'applyWidgetId', [ 'zebra' ] );
+ }
+ // remove widget added rows, just in case
+ $h.find( 'tr' ).not( $r ).remove();
+ // disable tablesorter - not using .unbind( namespace ) because namespacing was
+ // added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/
+ events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' +
+ 'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' +
+ 'keypress sortBegin sortEnd resetToLoadState '.split( ' ' )
+ .join( c.namespace + ' ' );
+ $t
+ .removeData( 'tablesorter' )
+ .unbind( events.replace( ts.regex.spaces, ' ' ) );
+ c.$headers
+ .add( $f )
+ .removeClass( [ ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone ].join( ' ' ) )
+ .removeAttr( 'data-column' )
+ .removeAttr( 'aria-label' )
+ .attr( 'aria-disabled', 'true' );
+ $r
+ .find( c.selectorSort )
+ .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
+ ts.restoreHeaders( table );
+ $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
+ $t.removeClass(c.namespace.slice(1));
+ // clear flag in case the plugin is initialized again
+ table.hasInitialized = false;
+ delete table.config.cache;
+ if ( typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'tablesorter has been removed' );
+ }
+ }
+
+ };
+
+ $.fn.tablesorter = function( settings ) {
+ return this.each( function() {
+ var table = this,
+ // merge & extend config options
+ c = $.extend( true, {}, ts.defaults, settings, ts.instanceMethods );
+ // save initial settings
+ c.originalSettings = settings;
+ // create a table from data (build table widget)
+ if ( !table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE' ) {
+ // return the table (in case the original target is the table's container)
+ ts.buildTable( table, c );
+ } else {
+ ts.setup( table, c );
+ }
+ });
+ };
+
+ // set up debug logs
+ if ( !( window.console && window.console.log ) ) {
+ // access $.tablesorter.logs for browsers that don't have a console...
+ ts.logs = [];
+ /*jshint -W020 */
+ console = {};
+ console.log = console.warn = console.error = console.table = function() {
+ var arg = arguments.length > 1 ? arguments : arguments[0];
+ ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg };
+ };
+ }
+
+ // add default parsers
+ ts.addParser({
+ id : 'no-parser',
+ is : function() {
+ return false;
+ },
+ format : function() {
+ return '';
+ },
+ type : 'text'
+ });
+
+ ts.addParser({
+ id : 'text',
+ is : function() {
+ return true;
+ },
+ format : function( str, table ) {
+ var c = table.config;
+ if ( str ) {
+ str = $.trim( c.ignoreCase ? str.toLocaleLowerCase() : str );
+ str = c.sortLocaleCompare ? ts.replaceAccents( str ) : str;
+ }
+ return str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.nondigit = /[^\w,. \-()]/g;
+ ts.addParser({
+ id : 'digit',
+ is : function( str ) {
+ return ts.isDigit( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.currencyReplace = /[+\-,. ]/g;
+ ts.regex.currencyTest = /^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/;
+ ts.addParser({
+ id : 'currency',
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.currencyReplace, '' );
+ // test for £$€¤¥¢
+ return ts.regex.currencyTest.test( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
+ // now, this regex can be updated before initialization
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
+ ts.addParser({
+ id : 'url',
+ is : function( str ) {
+ return ts.regex.urlProtocolTest.test( str );
+ },
+ format : function( str ) {
+ return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.dash = /-/g;
+ ts.regex.isoDate = /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/;
+ ts.addParser({
+ id : 'isoDate',
+ is : function( str ) {
+ return ts.regex.isoDate.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.percent = /%/g;
+ ts.regex.percentTest = /(\d\s*?%|%\s*?\d)/;
+ ts.addParser({
+ id : 'percent',
+ is : function( str ) {
+ return ts.regex.percentTest.test( str ) && str.length < 15;
+ },
+ format : function( str, table ) {
+ return str ? ts.formatFloat( str.replace( ts.regex.percent, '' ), table ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // added image parser to core v2.17.9
+ ts.addParser({
+ id : 'image',
+ is : function( str, table, node, $node ) {
+ return $node.find( 'img' ).length > 0;
+ },
+ format : function( str, table, cell ) {
+ return $( cell ).find( 'img' ).attr( table.config.imgAttr || 'alt' ) || str;
+ },
+ parsed : true, // filter widget flag
+ type : 'text'
+ });
+
+ ts.regex.dateReplace = /(\S)([AP]M)$/i; // used by usLongDate & time parser
+ ts.regex.usLongDateTest1 = /^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i;
+ ts.regex.usLongDateTest2 = /^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i;
+ ts.addParser({
+ id : 'usLongDate',
+ is : function( str ) {
+ // two digit years are not allowed cross-browser
+ // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
+ return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included
+ ts.regex.shortDateTest = /(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/;
+ // escaped "-" because JSHint in Firefox was showing it as an error
+ ts.regex.shortDateReplace = /[\-.,]/g;
+ // XXY covers MDY & DMY formats
+ ts.regex.shortDateXXY = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/;
+ ts.regex.shortDateYMD = /(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
+ ts.convertFormat = function( dateString, format ) {
+ dateString = ( dateString || '' )
+ .replace( ts.regex.spaces, ' ' )
+ .replace( ts.regex.shortDateReplace, '/' );
+ if ( format === 'mmddyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$1/$2' );
+ } else if ( format === 'ddmmyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$2/$1' );
+ } else if ( format === 'yyyymmdd' ) {
+ dateString = dateString.replace( ts.regex.shortDateYMD, '$1/$2/$3' );
+ }
+ var date = new Date( dateString );
+ return date instanceof Date && isFinite( date ) ? date.getTime() : '';
+ };
+
+ ts.addParser({
+ id : 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd'
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.spaces, ' ' ).replace( ts.regex.shortDateReplace, '/' );
+ return ts.regex.shortDateTest.test( str );
+ },
+ format : function( str, table, cell, cellIndex ) {
+ if ( str ) {
+ var c = table.config,
+ $header = c.$headerIndexed[ cellIndex ],
+ format = $header.length && $header.data( 'dateFormat' ) ||
+ ts.getData( $header, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat' ) ||
+ c.dateFormat;
+ // save format because getData can be slow...
+ if ( $header.length ) {
+ $header.data( 'dateFormat', format );
+ }
+ return ts.convertFormat( str, format ) || str;
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ // match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk
+ ts.regex.timeTest = /^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i;
+ ts.regex.timeMatch = /(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i;
+ ts.addParser({
+ id : 'time',
+ is : function( str ) {
+ return ts.regex.timeTest.test( str );
+ },
+ format : function( str ) {
+ // isolate time... ignore month, day and year
+ var temp,
+ timePart = ( str || '' ).match( ts.regex.timeMatch ),
+ orig = new Date( str ),
+ // no time component? default to 00:00 by leaving it out, but only if str is defined
+ time = str && ( timePart !== null ? timePart[ 0 ] : '00:00 AM' ),
+ date = time ? new Date( '2000/01/01 ' + time.replace( ts.regex.dateReplace, '$1 $2' ) ) : time;
+ if ( date instanceof Date && isFinite( date ) ) {
+ temp = orig instanceof Date && isFinite( orig ) ? orig.getTime() : 0;
+ // if original string was a valid date, add it to the decimal so the column sorts in some kind of order
+ // luckily new Date() ignores the decimals
+ return temp ? parseFloat( date.getTime() + '.' + orig.getTime() ) : date.getTime();
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ ts.addParser({
+ id : 'metadata',
+ is : function() {
+ return false;
+ },
+ format : function( str, table, cell ) {
+ var c = table.config,
+ p = ( !c.parserMetadataName ) ? 'sortValue' : c.parserMetadataName;
+ return $( cell ).metadata()[ p ];
+ },
+ type : 'numeric'
+ });
+
+ /*
+ ██████ ██████ █████▄ █████▄ ▄████▄
+ ▄█▀ ██▄▄ ██▄▄██ ██▄▄██ ██▄▄██
+ ▄█▀ ██▀▀ ██▀▀██ ██▀▀█ ██▀▀██
+ ██████ ██████ █████▀ ██ ██ ██ ██
+ */
+ // add default widgets
+ ts.addWidget({
+ id : 'zebra',
+ priority : 90,
+ format : function( table, c, wo ) {
+ var $visibleRows, $row, count, isEven, tbodyIndex, rowIndex, len,
+ child = new RegExp( c.cssChildRow, 'i' ),
+ $tbodies = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody:not(.' + c.cssInfoBlock + ')' ) );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ // loop through the visible rows
+ count = 0;
+ $visibleRows = $tbodies.eq( tbodyIndex ).children( 'tr:visible' ).not( c.selectorRemove );
+ len = $visibleRows.length;
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ $row = $visibleRows.eq( rowIndex );
+ // style child rows the same way the parent row was styled
+ if ( !child.test( $row[ 0 ].className ) ) { count++; }
+ isEven = ( count % 2 === 0 );
+ $row
+ .removeClass( wo.zebra[ isEven ? 1 : 0 ] )
+ .addClass( wo.zebra[ isEven ? 0 : 1 ] );
+ }
+ }
+ },
+ remove : function( table, c, wo, refreshing ) {
+ if ( refreshing ) { return; }
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( toRemove );
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ }
+ });
+
+})( jQuery );
+
+/*! Widget: storage - updated 2018-03-18 (v2.30.0) */
+/*global JSON:false */
+;(function ($, window, document) {
+ 'use strict';
+
+ var ts = $.tablesorter || {};
+
+ // update defaults for validator; these values must be falsy!
+ $.extend(true, ts.defaults, {
+ fixedUrl: '',
+ widgetOptions: {
+ storage_fixedUrl: '',
+ storage_group: '',
+ storage_page: '',
+ storage_storageType: '',
+ storage_tableId: '',
+ storage_useSessionStorage: ''
+ }
+ });
+
+ // *** Store data in local storage, with a cookie fallback ***
+ /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
+ if you need it, then include https://github.com/douglascrockford/JSON-js
+
+ $.parseJSON is not available is jQuery versions older than 1.4.1, using older
+ versions will only allow storing information for one page at a time
+
+ // *** Save data (JSON format only) ***
+ // val must be valid JSON... use http://jsonlint.com/ to ensure it is valid
+ var val = { "mywidget" : "data1" }; // valid JSON uses double quotes
+ // $.tablesorter.storage(table, key, val);
+ $.tablesorter.storage(table, 'tablesorter-mywidget', val);
+
+ // *** Get data: $.tablesorter.storage(table, key); ***
+ v = $.tablesorter.storage(table, 'tablesorter-mywidget');
+ // val may be empty, so also check for your data
+ val = (v && v.hasOwnProperty('mywidget')) ? v.mywidget : '';
+ alert(val); // 'data1' if saved, or '' if not
+ */
+ ts.storage = function(table, key, value, options) {
+ table = $(table)[0];
+ var cookieIndex, cookies, date,
+ hasStorage = false,
+ values = {},
+ c = table.config,
+ wo = c && c.widgetOptions,
+ debug = ts.debug(c, 'storage'),
+ storageType = (
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
+ ).toString().charAt(0).toLowerCase(),
+ // deprecating "useSessionStorage"; any storageType setting overrides it
+ session = storageType ? '' :
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
+ $table = $(table),
+ // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
+ // (4) table ID, then (5) table index
+ id = options && options.id ||
+ $table.attr( options && options.group || wo && wo.storage_group || 'data-table-group') ||
+ wo && wo.storage_tableId || table.id || $('.tablesorter').index( $table ),
+ // url from (1) options url, (2) table 'data-table-page' attribute, (3) widgetOptions.storage_fixedUrl,
+ // (4) table.config.fixedUrl (deprecated), then (5) window location path
+ url = options && options.url ||
+ $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
+ wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
+
+ // skip if using cookies
+ if (storageType !== 'c') {
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
+ // https://gist.github.com/paulirish/5558557
+ if (storageType in window) {
+ try {
+ window[storageType].setItem('_tmptest', 'temp');
+ hasStorage = true;
+ window[storageType].removeItem('_tmptest');
+ } catch (error) {
+ console.warn( storageType + ' is not supported in this browser' );
+ }
+ }
+ }
+ if (debug) {
+ console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
+ }
+ // *** get value ***
+ if ($.parseJSON) {
+ if (hasStorage) {
+ values = $.parseJSON( window[storageType][key] || 'null' ) || {};
+ } else {
+ // old browser, using cookies
+ cookies = document.cookie.split(/[;\s|=]/);
+ // add one to get from the key to the value
+ cookieIndex = $.inArray(key, cookies) + 1;
+ values = (cookieIndex !== 0) ? $.parseJSON(cookies[cookieIndex] || 'null') || {} : {};
+ }
+ }
+ // allow value to be an empty string too
+ if (typeof value !== 'undefined' && window.JSON && JSON.hasOwnProperty('stringify')) {
+ // add unique identifiers = url pathname > table ID/index on page > data
+ if (!values[url]) {
+ values[url] = {};
+ }
+ values[url][id] = value;
+ // *** set value ***
+ if (hasStorage) {
+ window[storageType][key] = JSON.stringify(values);
+ } else {
+ date = new Date();
+ date.setTime(date.getTime() + (31536e+6)); // 365 days
+ document.cookie = key + '=' + (JSON.stringify(values)).replace(/\"/g, '\"') + '; expires=' + date.toGMTString() + '; path=/';
+ }
+ } else {
+ return values && values[url] ? values[url][id] : '';
+ }
+ };
+
+})(jQuery, window, document);
+
+/*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.themes = {
+ 'bootstrap' : {
+ table : 'table table-bordered table-striped',
+ caption : 'caption',
+ // header class names
+ header : 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css)
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : '', // applied when column is sorted
+ hover : '', // custom css required - a defined bootstrap style may not override other classes
+ // icon class names
+ icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
+ iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
+ iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
+ iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
+ filterRow : '', // filter row class
+ footerRow : '',
+ footerCells : '',
+ even : '', // even row zebra striping
+ odd : '' // odd row zebra striping
+ },
+ 'jui' : {
+ table : 'ui-widget ui-widget-content ui-corner-all', // table classes
+ caption : 'ui-widget-content',
+ // header class names
+ header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : 'ui-state-active', // applied when column is sorted
+ hover : 'ui-state-hover', // hover class
+ // icon class names
+ icons : 'ui-icon', // icon class added to the <i> in the header
+ iconSortNone : 'ui-icon-carat-2-n-s ui-icon-caret-2-n-s', // class name added to icon when column is not sorted
+ iconSortAsc : 'ui-icon-carat-1-n ui-icon-caret-1-n', // class name added to icon when column has ascending sort
+ iconSortDesc : 'ui-icon-carat-1-s ui-icon-caret-1-s', // class name added to icon when column has descending sort
+ filterRow : '',
+ footerRow : '',
+ footerCells : '',
+ even : 'ui-widget-content', // even row zebra striping
+ odd : 'ui-state-default' // odd row zebra striping
+ }
+ };
+
+ $.extend(ts.css, {
+ wrapper : 'tablesorter-wrapper' // ui theme & resizable
+ });
+
+ ts.addWidget({
+ id: 'uitheme',
+ priority: 10,
+ format: function(table, c, wo) {
+ var i, tmp, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
+ themesAll = ts.themes,
+ $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( ' ' ) ),
+ iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
+ debug = ts.debug(c, 'uitheme');
+ if (debug) { time = new Date(); }
+ // initialization code - run once
+ if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
+ wo.uitheme_applied = true;
+ oldtheme = themesAll[c.appliedTheme] || {};
+ hasOldTheme = !$.isEmptyObject(oldtheme);
+ oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '';
+ oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : '';
+ if (hasOldTheme) {
+ wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') );
+ wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') );
+ c.$tbodies.children().removeClass( [ oldtheme.even, oldtheme.odd ].join(' ') );
+ }
+ // update zebra stripes
+ if (themes.even) { wo.zebra[0] += ' ' + themes.even; }
+ if (themes.odd) { wo.zebra[1] += ' ' + themes.odd; }
+ // add caption style
+ $table.children('caption')
+ .removeClass(oldtheme.caption || '')
+ .addClass(themes.caption);
+ // add table/footer class names
+ $tfoot = $table
+ // remove other selected themes
+ .removeClass( (c.appliedTheme ? 'tablesorter-' + (c.appliedTheme || '') : '') + ' ' + (oldtheme.table || '') )
+ .addClass('tablesorter-' + theme + ' ' + (themes.table || '')) // add theme widget class name
+ .children('tfoot');
+ c.appliedTheme = c.theme;
+
+ if ($tfoot.length) {
+ $tfoot
+ // if oldtheme.footerRow or oldtheme.footerCells are undefined, all class names are removed
+ .children('tr').removeClass(oldtheme.footerRow || '').addClass(themes.footerRow)
+ .children('th, td').removeClass(oldtheme.footerCells || '').addClass(themes.footerCells);
+ }
+ // update header classes
+ $headers
+ .removeClass( (hasOldTheme ? [ oldtheme.header, oldtheme.hover, oldremove ].join(' ') : '') || '' )
+ .addClass(themes.header)
+ .not('.sorter-false')
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme')
+ .bind('mouseenter.tsuitheme mouseleave.tsuitheme', function(event) {
+ // toggleClass with switch added in jQuery 1.3
+ $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
+ });
+
+ $headers.each(function() {
+ var $this = $(this);
+ if (!$this.find('.' + ts.css.wrapper).length) {
+ // Firefox needs this inner div to position the icon & resizer correctly
+ $this.wrapInner('<div class="' + ts.css.wrapper + '" style="position:relative;height:100%;width:100%"></div>');
+ }
+ });
+ if (c.cssIcon) {
+ // if c.cssIcon is '', then no <i> is added to the header
+ $headers
+ .find('.' + ts.css.icon)
+ .removeClass(hasOldTheme ? [ oldtheme.icons, oldIconRmv ].join(' ') : '')
+ .addClass(themes.icons || '');
+ }
+ // filter widget initializes after uitheme
+ if (ts.hasWidget( c.table, 'filter' )) {
+ tmp = function() {
+ $table.children('thead').children('.' + ts.css.filterRow)
+ .removeClass(hasOldTheme ? oldtheme.filterRow || '' : '')
+ .addClass(themes.filterRow || '');
+ };
+ if (wo.filter_initialized) {
+ tmp();
+ } else {
+ $table.one('filterInit', function() {
+ tmp();
+ });
+ }
+ }
+ }
+ for (i = 0; i < c.columns; 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) {
+ $header.removeClass(remove);
+ $icon.removeClass(iconRmv);
+ if ($h[0].sortDisabled) {
+ // no sort arrows for disabled columns!
+ $icon.removeClass(themes.icons || '');
+ } else {
+ hdr = themes.sortNone;
+ icon = themes.iconSortNone;
+ if ($h.hasClass(ts.css.sortAsc)) {
+ hdr = [ themes.sortAsc, themes.active ].join(' ');
+ icon = themes.iconSortAsc;
+ } else if ($h.hasClass(ts.css.sortDesc)) {
+ hdr = [ themes.sortDesc, themes.active ].join(' ');
+ icon = themes.iconSortDesc;
+ }
+ $header.addClass(hdr);
+ $icon.addClass(icon || '');
+ }
+ }
+ }
+ if (debug) {
+ console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
+ }
+ },
+ remove: function(table, c, wo, refreshing) {
+ if (!wo.uitheme_applied) { return; }
+ var $table = c.$table,
+ theme = c.appliedTheme || 'jui',
+ themes = ts.themes[ theme ] || ts.themes.jui,
+ $headers = $table.children('thead').children(),
+ remove = themes.sortNone + ' ' + themes.sortDesc + ' ' + themes.sortAsc,
+ iconRmv = themes.iconSortNone + ' ' + themes.iconSortDesc + ' ' + themes.iconSortAsc;
+ $table.removeClass('tablesorter-' + theme + ' ' + themes.table);
+ wo.uitheme_applied = false;
+ if (refreshing) { return; }
+ $table.find(ts.css.header).removeClass(themes.header);
+ $headers
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover
+ .removeClass(themes.hover + ' ' + remove + ' ' + themes.active)
+ .filter('.' + ts.css.filterRow)
+ .removeClass(themes.filterRow);
+ $headers.find('.' + ts.css.icon).removeClass(themes.icons + ' ' + iconRmv);
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.addWidget({
+ id: 'columns',
+ priority: 65,
+ options : {
+ columns : [ 'primary', 'secondary', 'tertiary' ]
+ },
+ format: function(table, c, wo) {
+ var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ sortList = c.sortList,
+ len = sortList.length,
+ // removed c.widgetColumns support
+ css = wo && wo.columns || [ 'primary', 'secondary', 'tertiary' ],
+ last = css.length - 1;
+ remove = css.join(' ');
+ // check if there is a sort (on initialization there may not be one)
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // detach tbody
+ $rows = $tbody.children('tr');
+ // loop through the visible rows
+ $rows.each(function() {
+ $row = $(this);
+ if (this.style.display !== 'none') {
+ // remove all columns class names
+ $cells = $row.children().removeClass(remove);
+ // add appropriate column class names
+ if (sortList && sortList[0]) {
+ // primary sort column class
+ $cells.eq(sortList[0][0]).addClass(css[0]);
+ if (len > 1) {
+ for (indx = 1; indx < len; indx++) {
+ // secondary, tertiary, etc sort column classes
+ $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] );
+ }
+ }
+ }
+ }
+ });
+ ts.processTbody(table, $tbody, false);
+ }
+ // add classes to thead and tfoot
+ rows = wo.columns_thead !== false ? [ 'thead tr' ] : [];
+ if (wo.columns_tfoot !== false) {
+ rows.push('tfoot tr');
+ }
+ if (rows.length) {
+ $rows = $table.find( rows.join(',') ).children().removeClass(remove);
+ if (len) {
+ for (indx = 0; indx < len; indx++) {
+ // add primary. secondary, tertiary, etc sort column classes
+ $rows.filter('[data-column="' + sortList[indx][0] + '"]').addClass(css[indx] || css[last]);
+ }
+ }
+ }
+ },
+ remove: function(table, c, wo) {
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ remove = (wo.columns || [ 'primary', 'secondary', 'tertiary' ]).join(' ');
+ c.$headers.removeClass(remove);
+ c.$table.children('tfoot').children('tr').children('th, td').removeClass(remove);
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody
+ $tbody.children('tr').each(function() {
+ $(this).children().removeClass(remove);
+ });
+ ts.processTbody(table, $tbody, false); // restore tbody
+ }
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.7+
+ * by Rob Garrison
+ */
+;( function ( $ ) {
+ 'use strict';
+ var tsf, tsfRegex,
+ ts = $.tablesorter || {},
+ tscss = ts.css,
+ tskeyCodes = ts.keyCodes;
+
+ $.extend( tscss, {
+ filterRow : 'tablesorter-filter-row',
+ filter : 'tablesorter-filter',
+ filterDisabled : 'disabled',
+ filterRowHide : 'hideme'
+ });
+
+ $.extend( tskeyCodes, {
+ backSpace : 8,
+ escape : 27,
+ space : 32,
+ left : 37,
+ down : 40
+ });
+
+ ts.addWidget({
+ id: 'filter',
+ priority: 50,
+ options : {
+ filter_cellFilter : '', // css class name added to the filter cell ( string or array )
+ filter_childRows : false, // if true, filter includes child row content in the search
+ filter_childByColumn : false, // ( filter_childRows must be true ) if true = search child rows by column; false = search all child row text grouped
+ filter_childWithSibs : true, // if true, include matching child row siblings
+ filter_columnAnyMatch: true, // if true, allows using '#:{query}' in AnyMatch searches ( column:query )
+ filter_columnFilters : true, // if true, a filter will be added to the top of each table column
+ filter_cssFilter : '', // css class name added to the filter row & each input in the row ( tablesorter-filter is ALWAYS added )
+ filter_defaultAttrib : 'data-value', // data attribute in the header cell that contains the default filter value
+ filter_defaultFilter : {}, // add a default column filter type '~{query}' to make fuzzy searches default; '{q1} AND {q2}' to make all searches use a logical AND.
+ filter_excludeFilter : {}, // filters to exclude, per column
+ filter_external : '', // jQuery selector string ( or jQuery object ) of external filters
+ filter_filteredRow : 'filtered', // class added to filtered rows; define in css with "display:none" to hide the filtered-out rows
+ filter_filterLabel : 'Filter "{{label}}" column by...', // Aria-label added to filter input/select; see #1495
+ filter_formatter : null, // add custom filter elements to the filter row
+ filter_functions : null, // add custom filter functions using this option
+ filter_hideEmpty : true, // hide filter row when table is empty
+ filter_hideFilters : false, // collapse filter row when mouse leaves the area
+ filter_ignoreCase : true, // if true, make all searches case-insensitive
+ filter_liveSearch : true, // if true, search column content while the user types ( with a delay )
+ filter_matchType : { 'input': 'exact', 'select': 'exact' }, // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
+ filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available ( visible ) options within the drop down
+ filter_placeholder : { search : '', select : '' }, // default placeholder text ( overridden by any header 'data-placeholder' setting )
+ filter_reset : null, // jQuery selector string of an element used to reset the filters
+ filter_resetOnEsc : true, // Reset filter input when the user presses escape - normalized across browsers
+ filter_saveFilters : false, // Use the $.tablesorter.storage utility to save the most recent filters
+ filter_searchDelay : 300, // typing delay in milliseconds before starting a search
+ filter_searchFiltered: true, // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
+ filter_selectSource : null, // include a function to return an array of values to be added to the column filter select
+ filter_selectSourceSeparator : '|', // filter_selectSource array text left of the separator is added to the option value, right into the option text
+ filter_serversideFiltering : false, // if true, must perform server-side filtering b/c client-side filtering is disabled, but the ui and events will still be used.
+ filter_startsWith : false, // if true, filter start from the beginning of the cell contents
+ filter_useParsedData : false // filter all data using parsed content
+ },
+ format: function( table, c, wo ) {
+ if ( !c.$table.hasClass( 'hasFilters' ) ) {
+ tsf.init( table, c, wo );
+ }
+ },
+ remove: function( table, c, wo, refreshing ) {
+ var tbodyIndex, $tbody,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ events = (
+ 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
+ ).split( ' ' ).join( c.namespace + 'filter ' );
+ $table
+ .removeClass( 'hasFilters' )
+ // add filter namespace to all BUT search
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ // remove the filter row even if refreshing, because the column might have been moved
+ .find( '.' + tscss.filterRow ).remove();
+ wo.filter_initialized = false;
+ if ( refreshing ) { return; }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( wo.filter_filteredRow ).show();
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ if ( wo.filter_reset ) {
+ $( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
+ }
+ }
+ });
+
+ tsf = ts.filter = {
+
+ // regex used in filter 'check' functions - not for general use and not documented
+ regex: {
+ regex : /^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/, // regex to test for regex
+ child : /tablesorter-childRow/, // child row class name; this gets updated in the script
+ filtered : /filtered/, // filtered (hidden) row class name; updated in the script
+ type : /undefined|number/, // check type
+ exact : /(^[\"\'=]+)|([\"\'=]+$)/g, // exact match (allow '==')
+ operators : /[<>=]/g, // replace operators
+ query : '(q|query)', // replace filter queries
+ wild01 : /\?/g, // wild card match 0 or 1
+ wild0More : /\*/g, // wild care match 0 or more
+ quote : /\"/g,
+ isNeg1 : /(>=?\s*-\d)/,
+ isNeg2 : /(<=?\s*\d)/
+ },
+ // function( c, data ) { }
+ // c = table.config
+ // data.$row = jQuery object of the row currently being processed
+ // data.$cells = jQuery object of all cells within the current row
+ // data.filters = array of filters for all columns ( some may be undefined )
+ // data.filter = filter for the current column
+ // data.iFilter = same as data.filter, except lowercase ( if wo.filter_ignoreCase is true )
+ // data.exact = table cell text ( or parsed data if column parser enabled; may be a number & not a string )
+ // data.iExact = same as data.exact, except lowercase ( if wo.filter_ignoreCase is true; may be a number & not a string )
+ // data.cache = table cell text from cache, so it has been parsed ( & in all lower case if c.ignoreCase is true )
+ // data.cacheArray = An array of parsed content from each table cell in the row being processed
+ // data.index = column index; table = table element ( DOM )
+ // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class )
+ types: {
+ or : function( c, data, vars ) {
+ // look for "|", but not if it is inside of a regular expression
+ if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
+ // this test for regex has potential to slow down the overall search
+ !tsfRegex.regex.test( data.filter ) ) {
+ var indx, filterMatched, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.orSplit ),
+ iFilter = data.iFilter.split( tsfRegex.orSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')';
+ try {
+ // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search,
+ // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // filterMatched = data2.filter === '' && indx > 0 ? true
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ filterMatched = regex.test( data2.exact ) || tsf.processTypes( c, data2, vars );
+ if ( filterMatched ) {
+ return filterMatched;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for an AND or && operator ( logical and )
+ and : function( c, data, vars ) {
+ if ( tsfRegex.andTest.test( data.filter ) ) {
+ var indx, filterMatched, result, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.andSplit ),
+ iFilter = data.iFilter.split( tsfRegex.andSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' )
+ // replace wild cards since /(a*)/i will match anything
+ .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' );
+ try {
+ // use try/catch just in case RegExp is invalid
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // look for an exact match with the 'and' unless the 'filter-match' class is found
+ result = ( regex.test( data2.exact ) || tsf.processTypes( c, data2, vars ) );
+ if ( indx === 0 ) {
+ filterMatched = result;
+ } else {
+ filterMatched = filterMatched && result;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for regex
+ regex: function( c, data ) {
+ if ( tsfRegex.regex.test( data.filter ) ) {
+ var matches,
+ // cache regex per column for optimal speed
+ regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ),
+ isRegex = regex instanceof RegExp;
+ try {
+ if ( !isRegex ) {
+ // force case insensitive search if ignoreCase option set?
+ // if ( c.ignoreCase && !regex[2] ) { regex[2] = 'i'; }
+ data.filter_regexCache[ data.index ] = regex = new RegExp( regex[1], regex[2] );
+ }
+ matches = regex.test( data.exact );
+ } catch ( error ) {
+ matches = false;
+ }
+ return matches;
+ }
+ return null;
+ },
+ // Look for operators >, >=, < or <=
+ operators: function( c, data ) {
+ // ignore empty strings... because '' < 10 is true
+ if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) {
+ var cachedValue, result, txt,
+ table = c.table,
+ parsed = data.parsed[ data.index ],
+ query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ),
+ parser = c.parsers[ data.index ] || {},
+ savedSearch = query;
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || parser.type === 'numeric' ) {
+ txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) );
+ result = tsf.parseFilter( c, txt, data, true );
+ query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query;
+ }
+ // iExact may be numeric - see issue #149;
+ // check if cached is defined, because sometimes j goes out of range? ( numeric columns )
+ if ( ( parsed || parser.type === 'numeric' ) && !isNaN( query ) &&
+ typeof data.cache !== 'undefined' ) {
+ cachedValue = data.cache;
+ } else {
+ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ cachedValue = ts.formatFloat( txt, table );
+ }
+ if ( tsfRegex.gtTest.test( data.iFilter ) ) {
+ result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query;
+ } else if ( tsfRegex.ltTest.test( data.iFilter ) ) {
+ result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query;
+ }
+ // keep showing all rows if nothing follows the operator
+ if ( !result && savedSearch === '' ) {
+ result = true;
+ }
+ return result;
+ }
+ return null;
+ },
+ // Look for a not match
+ notMatch: function( c, data ) {
+ if ( tsfRegex.notTest.test( data.iFilter ) ) {
+ var indx,
+ txt = data.iFilter.replace( '!', '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ if ( tsfRegex.exact.test( filter ) ) {
+ // look for exact not matches - see #628
+ filter = filter.replace( tsfRegex.exact, '' );
+ return filter === '' ? true : $.trim( filter ) !== data.iExact;
+ } else {
+ indx = data.iExact.search( $.trim( filter ) );
+ return filter === '' ? true :
+ // return true if not found
+ data.anyMatch ? indx < 0 :
+ // return false if found
+ !( c.widgetOptions.filter_startsWith ? indx === 0 : indx >= 0 );
+ }
+ }
+ return null;
+ },
+ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric
+ exact: function( c, data ) {
+ /*jshint eqeqeq:false */
+ if ( tsfRegex.exact.test( data.iFilter ) ) {
+ var txt = data.iFilter.replace( tsfRegex.exact, '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ // eslint-disable-next-line eqeqeq
+ return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
+ }
+ return null;
+ },
+ // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu!
+ range : function( c, data ) {
+ if ( tsfRegex.toTest.test( data.iFilter ) ) {
+ var result, tmp, range1, range2,
+ table = c.table,
+ index = data.index,
+ parsed = data.parsed[index],
+ // make sure the dash is for a range and not indicating a negative number
+ query = data.iFilter.split( tsfRegex.toSplit );
+
+ tmp = query[0].replace( ts.regex.nondigit, '' ) || '';
+ range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ tmp = query[1].replace( ts.regex.nondigit, '' ) || '';
+ range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || c.parsers[ index ].type === 'numeric' ) {
+ result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index );
+ range1 = ( result !== '' && !isNaN( result ) ) ? result : range1;
+ result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index );
+ range2 = ( result !== '' && !isNaN( result ) ) ? result : range2;
+ }
+ if ( ( parsed || c.parsers[ index ].type === 'numeric' ) && !isNaN( range1 ) && !isNaN( range2 ) ) {
+ result = data.cache;
+ } else {
+ tmp = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ result = ts.formatFloat( tmp, table );
+ }
+ if ( range1 > range2 ) {
+ tmp = range1; range1 = range2; range2 = tmp; // swap
+ }
+ return ( result >= range1 && result <= range2 ) || ( range1 === '' || range2 === '' );
+ }
+ return null;
+ },
+ // Look for wild card: ? = single, * = multiple, or | = logical OR
+ wild : function( c, data ) {
+ if ( tsfRegex.wildOrTest.test( data.iFilter ) ) {
+ var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' );
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) {
+ query = data.isMatch ? query : '^(' + query + ')$';
+ }
+ // parsing the filter may not work properly when using wildcards =/
+ try {
+ return new RegExp(
+ query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ),
+ c.widgetOptions.filter_ignoreCase ? 'i' : ''
+ )
+ .test( data.exact );
+ } catch ( error ) {
+ return null;
+ }
+ }
+ return null;
+ },
+ // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license )
+ fuzzy: function( c, data ) {
+ if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) {
+ var indx,
+ patternIndx = 0,
+ len = data.iExact.length,
+ txt = data.iFilter.slice( 1 ),
+ pattern = tsf.parseFilter( c, txt, data ) || '';
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( data.iExact[ indx ] === pattern[ patternIndx ] ) {
+ patternIndx += 1;
+ }
+ }
+ return patternIndx === pattern.length;
+ }
+ return null;
+ }
+ },
+ init: function( table ) {
+ // filter language options
+ ts.language = $.extend( true, {}, {
+ to : 'to',
+ or : 'or',
+ and : 'and'
+ }, ts.language );
+
+ var options, string, txt, $header, column, val, fxn, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ processStr = function(prefix, str, suffix) {
+ str = str.trim();
+ // don't include prefix/suffix if str is empty
+ return str === '' ? '' : (prefix || '') + str + (suffix || '');
+ };
+ c.$table.addClass( 'hasFilters' );
+ c.lastSearch = [];
+
+ // define timers so using clearTimeout won't cause an undefined error
+ wo.filter_searchTimer = null;
+ wo.filter_initTimer = null;
+ wo.filter_formatterCount = 0;
+ wo.filter_formatterInit = [];
+ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]';
+ wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]';
+
+ val = '\\{' + tsfRegex.query + '\\}';
+ $.extend( tsfRegex, {
+ child : new RegExp( c.cssChildRow ),
+ filtered : new RegExp( wo.filter_filteredRow ),
+ alreadyFiltered : new RegExp( '(\\s+(-' + processStr('|', ts.language.or) + processStr('|', ts.language.to) + ')\\s+)', 'i' ),
+ toTest : new RegExp( '\\s+(-' + processStr('|', ts.language.to) + ')\\s+', 'i' ),
+ toSplit : new RegExp( '(?:\\s+(?:-' + processStr('|', ts.language.to) + ')\\s+)', 'gi' ),
+ andTest : new RegExp( '\\s+(' + processStr('', ts.language.and, '|') + '&&)\\s+', 'i' ),
+ andSplit : new RegExp( '(?:\\s+(?:' + processStr('', ts.language.and, '|') + '&&)\\s+)', 'gi' ),
+ orTest : new RegExp( '(\\|' + processStr('|\\s+', ts.language.or, '\\s+') + ')', 'i' ),
+ orSplit : new RegExp( '(?:\\|' + processStr('|\\s+(?:', ts.language.or, ')\\s+') + ')', 'gi' ),
+ iQuery : new RegExp( val, 'i' ),
+ igQuery : new RegExp( val, 'ig' ),
+ operTest : /^[<>]=?/,
+ gtTest : />/,
+ gteTest : />=/,
+ ltTest : /</,
+ lteTest : /<=/,
+ notTest : /^\!/,
+ wildOrTest : /[\?\*\|]/,
+ wildTest : /\?\*/,
+ fuzzyTest : /^~/,
+ exactTest : /[=\"\|!]/
+ });
+
+ // don't build filter row if columnFilters is false or all columns are set to 'filter-false'
+ // see issue #156
+ val = c.$headers.filter( '.filter-false, .parser-false' ).length;
+ if ( wo.filter_columnFilters !== false && val !== c.$headers.length ) {
+ // build filter row
+ tsf.buildRow( table, c, wo );
+ }
+
+ txt = 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterResetSaved filterEnd search '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table.bind( txt, function( event, filter ) {
+ val = wo.filter_hideEmpty &&
+ $.isEmptyObject( c.cache ) &&
+ !( c.delayInit && event.type === 'appendCache' );
+ // hide filter row using the 'filtered' class name
+ c.$table.find( '.' + tscss.filterRow ).toggleClass( wo.filter_filteredRow, val ); // fixes #450
+ if ( !/(search|filter)/.test( event.type ) ) {
+ event.stopPropagation();
+ tsf.buildDefault( table, true );
+ }
+ // Add filterAndSortReset - see #1361
+ if ( event.type === 'filterReset' || event.type === 'filterAndSortReset' ) {
+ c.$table.find( '.' + tscss.filter ).add( wo.filter_$externalFilters ).val( '' );
+ if ( event.type === 'filterAndSortReset' ) {
+ ts.sortReset( this.config, function() {
+ tsf.searching( table, [] );
+ });
+ } else {
+ tsf.searching( table, [] );
+ }
+ } else if ( event.type === 'filterResetSaved' ) {
+ ts.storage( table, 'tablesorter-filters', '' );
+ } else if ( event.type === 'filterEnd' ) {
+ tsf.buildDefault( table, true );
+ } else {
+ // send false argument to force a new search; otherwise if the filter hasn't changed,
+ // it will return
+ filter = event.type === 'search' ? filter :
+ event.type === 'updateComplete' ? c.$table.data( 'lastSearch' ) : '';
+ if ( /(update|add)/.test( event.type ) && event.type !== 'updateComplete' ) {
+ // force a new search since content has changed
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ // update filterFormatters after update (& small delay) - Fixes #1237
+ setTimeout(function() {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }, 100);
+ }
+ // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
+ // input ensures all inputs are updated when a search is triggered on the table
+ // $( 'table' ).trigger( 'search', [...] );
+ tsf.searching( table, filter, true );
+ }
+ return false;
+ });
+
+ // reset button/link
+ if ( wo.filter_reset ) {
+ if ( wo.filter_reset instanceof $ ) {
+ // reset contains a jQuery object, bind to it
+ wo.filter_reset.click( function() {
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ } else if ( $( wo.filter_reset ).length ) {
+ // reset is a jQuery selector, use event delegation
+ $( document )
+ .undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
+ .delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
+ // trigger a reset event, so other functions ( filter_formatter ) know when to reset
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ }
+ }
+ if ( wo.filter_functions ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ fxn = ts.getColumnData( table, wo.filter_functions, column );
+ if ( fxn ) {
+ // remove 'filter-select' from header otherwise the options added here are replaced with
+ // all options
+ $header = c.$headerIndexed[ column ].removeClass( 'filter-select' );
+ // don't build select if 'filter-false' or 'parser-false' set
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ options = '';
+ if ( fxn === true && noSelect ) {
+ tsf.buildSelect( table, column );
+ } else if ( typeof fxn === 'object' && noSelect ) {
+ // add custom drop down list
+ for ( string in fxn ) {
+ if ( typeof string === 'string' ) {
+ options += options === '' ?
+ '<option value="">' +
+ ( $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select ||
+ ''
+ ) +
+ '</option>' : '';
+ val = string;
+ txt = string;
+ if ( string.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ val = string.split( wo.filter_selectSourceSeparator );
+ txt = val[1];
+ val = val[0];
+ }
+ options += '<option ' +
+ ( txt === val ? '' : 'data-function-name="' + string + '" ' ) +
+ 'value="' + val + '">' + txt + '</option>';
+ }
+ }
+ c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .append( options );
+ txt = wo.filter_selectSource;
+ fxn = typeof txt === 'function' ? true : ts.getColumnData( table, txt, column );
+ if ( fxn ) {
+ // updating so the extra options are appended
+ tsf.buildSelect( c.table, column, '', true, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ }
+ }
+ // not really updating, but if the column has both the 'filter-select' class &
+ // filter_functions set to true, it would append the same options twice.
+ tsf.buildDefault( table, true );
+
+ tsf.bindSearch( table, c.$table.find( '.' + tscss.filter ), true );
+ if ( wo.filter_external ) {
+ tsf.bindSearch( table, wo.filter_external );
+ }
+
+ if ( wo.filter_hideFilters ) {
+ tsf.hideFilters( c );
+ }
+
+ // show processing icon
+ if ( c.showProcessing ) {
+ txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function( event, columns ) {
+ // only add processing to certain columns to all columns
+ $header = ( columns ) ?
+ c.$table
+ .find( '.' + tscss.header )
+ .filter( '[data-column]' )
+ .filter( function() {
+ return columns[ $( this ).data( 'column' ) ] !== '';
+ }) : '';
+ ts.isProcessing( table, event.type === 'filterStart', columns ? $header : '' );
+ });
+ }
+
+ // set filtered rows count ( intially unfiltered )
+ c.filteredRows = c.totalRows;
+
+ // add default values
+ txt = 'tablesorter-initialized pagerBeforeInitialized '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function() {
+ tsf.completeInit( this );
+ });
+ // if filter widget is added after pager has initialized; then set filter init flag
+ if ( c.pager && c.pager.initialized && !wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ setTimeout( function() {
+ tsf.filterInitComplete( c );
+ }, 100 );
+ } else if ( !wo.filter_initialized ) {
+ tsf.completeInit( table );
+ }
+ },
+ completeInit: function( table ) {
+ // redefine 'c' & 'wo' so they update properly inside this callback
+ var c = table.config,
+ wo = c.widgetOptions,
+ filters = tsf.setDefaults( table, c, wo ) || [];
+ if ( filters.length ) {
+ // prevent delayInit from triggering a cache build if filters are empty
+ if ( !( c.delayInit && filters.join( '' ) === '' ) ) {
+ ts.setFilters( table, filters, true );
+ }
+ }
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ // trigger init after setTimeout to prevent multiple filterStart/End/Init triggers
+ setTimeout( function() {
+ if ( !wo.filter_initialized ) {
+ tsf.filterInitComplete( c );
+ }
+ }, 100 );
+ },
+
+ // $cell parameter, but not the config, is passed to the filter_formatters,
+ // so we have to work with it instead
+ formatterUpdated: function( $cell, column ) {
+ // prevent error if $cell is undefined - see #1056
+ var $table = $cell && $cell.closest( 'table' );
+ var config = $table.length && $table[0].config,
+ wo = config && config.widgetOptions;
+ if ( wo && !wo.filter_initialized ) {
+ // add updates by column since this function
+ // may be called numerous times before initialization
+ wo.filter_formatterInit[ column ] = 1;
+ }
+ },
+ filterInitComplete: function( c ) {
+ var indx, len,
+ wo = c.widgetOptions,
+ count = 0,
+ completed = function() {
+ wo.filter_initialized = true;
+ // update lastSearch - it gets cleared often
+ c.lastSearch = c.$table.data( 'lastSearch' );
+ c.$table.triggerHandler( 'filterInit', c );
+ tsf.findRows( c.table, c.lastSearch || [] );
+ if (ts.debug(c, 'filter')) {
+ console.log('Filter >> Widget initialized');
+ }
+ };
+ if ( $.isEmptyObject( wo.filter_formatter ) ) {
+ completed();
+ } else {
+ len = wo.filter_formatterInit.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( wo.filter_formatterInit[ indx ] === 1 ) {
+ count++;
+ }
+ }
+ clearTimeout( wo.filter_initTimer );
+ if ( !wo.filter_initialized && count === wo.filter_formatterCount ) {
+ // filter widget initialized
+ completed();
+ } else if ( !wo.filter_initialized ) {
+ // fall back in case a filter_formatter doesn't call
+ // $.tablesorter.filter.formatterUpdated( $cell, column ), and the count is off
+ wo.filter_initTimer = setTimeout( function() {
+ completed();
+ }, 500 );
+ }
+ }
+ },
+ // encode or decode filters for storage; see #1026
+ processFilters: function( filters, encode ) {
+ var indx,
+ // fixes #1237; previously returning an encoded "filters" value
+ result = [],
+ mode = encode ? encodeURIComponent : decodeURIComponent,
+ len = filters.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( filters[ indx ] ) {
+ result[ indx ] = mode( filters[ indx ] );
+ }
+ }
+ return result;
+ },
+ setDefaults: function( table, c, wo ) {
+ var isArray, saved, indx, col, $filters,
+ // get current ( default ) filters
+ filters = ts.getFilters( table ) || [];
+ if ( wo.filter_saveFilters && ts.storage ) {
+ saved = ts.storage( table, 'tablesorter-filters' ) || [];
+ isArray = $.isArray( saved );
+ // make sure we're not just getting an empty array
+ if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) {
+ filters = tsf.processFilters( saved );
+ }
+ }
+ // if no filters saved, then check default settings
+ if ( filters.join( '' ) === '' ) {
+ // allow adding default setting to external filters
+ $filters = c.$headers.add( wo.filter_$externalFilters )
+ .filter( '[' + wo.filter_defaultAttrib + ']' );
+ for ( indx = 0; indx <= c.columns; indx++ ) {
+ // include data-column='all' external filters
+ col = indx === c.columns ? 'all' : indx;
+ filters[ indx ] = $filters
+ .filter( '[data-column="' + col + '"]' )
+ .attr( wo.filter_defaultAttrib ) || filters[indx] || '';
+ }
+ }
+ c.$table.data( 'lastSearch', filters );
+ return filters;
+ },
+ parseFilter: function( c, filter, data, parsed ) {
+ return parsed || data.parsed[ data.index ] ?
+ c.parsers[ data.index ].format( filter, c.table, [], data.index ) :
+ filter;
+ },
+ buildRow: function( table, c, wo ) {
+ var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp,
+ // c.columns defined in computeThIndexes()
+ cellFilter = wo.filter_cellFilter,
+ columns = c.columns,
+ arry = $.isArray( cellFilter ),
+ buildFilter = '<tr role="search" class="' + tscss.filterRow + ' ' + c.cssIgnoreRow + '">';
+ for ( column = 0; column < columns; column++ ) {
+ if ( c.$headerIndexed[ column ].length ) {
+ // account for entire column set with colspan. See #1047
+ tmp = c.$headerIndexed[ column ] && c.$headerIndexed[ column ][0].colSpan || 0;
+ if ( tmp > 1 ) {
+ buildFilter += '<td data-column="' + column + '-' + ( column + tmp - 1 ) + '" colspan="' + tmp + '"';
+ } else {
+ buildFilter += '<td data-column="' + column + '"';
+ }
+ if ( arry ) {
+ buildFilter += ( cellFilter[ column ] ? ' class="' + cellFilter[ column ] + '"' : '' );
+ } else {
+ buildFilter += ( cellFilter !== '' ? ' class="' + cellFilter + '"' : '' );
+ }
+ buildFilter += '></td>';
+ }
+ }
+ c.$filters = $( buildFilter += '</tr>' )
+ .appendTo( c.$table.children( 'thead' ).eq( 0 ) )
+ .children( 'td' );
+ // build each filter input
+ for ( column = 0; column < columns; column++ ) {
+ disabled = false;
+ // assuming last cell of a column is the main column
+ $header = c.$headerIndexed[ column ];
+ if ( $header && $header.length ) {
+ // $filter = c.$filters.filter( '[data-column="' + column + '"]' );
+ $filter = tsf.getColumnElm( c, c.$filters, column );
+ ffxn = ts.getColumnData( table, wo.filter_functions, column );
+ makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
+ $header.hasClass( 'filter-select' );
+ // get data from jQuery data, metadata, headers option or header class name
+ col = ts.getColumnData( table, c.headers, column );
+ disabled = ts.getData( $header[0], col, 'filter' ) === 'false' ||
+ ts.getData( $header[0], col, 'parser' ) === 'false';
+
+ if ( makeSelect ) {
+ buildFilter = $( '<select>' ).appendTo( $filter );
+ } else {
+ ffxn = ts.getColumnData( table, wo.filter_formatter, column );
+ if ( ffxn ) {
+ wo.filter_formatterCount++;
+ buildFilter = ffxn( $filter, column );
+ // no element returned, so lets go find it
+ if ( buildFilter && buildFilter.length === 0 ) {
+ buildFilter = $filter.children( 'input' );
+ }
+ // element not in DOM, so lets attach it
+ if ( buildFilter && ( buildFilter.parent().length === 0 ||
+ ( buildFilter.parent().length && buildFilter.parent()[0] !== $filter[0] ) ) ) {
+ $filter.append( buildFilter );
+ }
+ } else {
+ buildFilter = $( '<input type="search">' ).appendTo( $filter );
+ }
+ if ( buildFilter ) {
+ tmp = $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.search || '';
+ buildFilter.attr( 'placeholder', tmp );
+ }
+ }
+ if ( buildFilter ) {
+ // add filter class name
+ name = ( $.isArray( wo.filter_cssFilter ) ?
+ ( typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '' ) :
+ wo.filter_cssFilter ) || '';
+ // copy data-column from table cell (it will include colspan)
+ buildFilter.addClass( tscss.filter + ' ' + name );
+ name = wo.filter_filterLabel;
+ tmp = name.match(/{{([^}]+?)}}/g);
+ if (!tmp) {
+ tmp = [ '{{label}}' ];
+ }
+ $.each(tmp, function(indx, attr) {
+ var regex = new RegExp(attr, 'g'),
+ data = $header.attr('data-' + attr.replace(/{{|}}/g, '')),
+ text = typeof data === 'undefined' ? $header.text() : data;
+ name = name.replace( regex, $.trim( text ) );
+ });
+ buildFilter.attr({
+ 'data-column': $filter.attr( 'data-column' ),
+ 'aria-label': name
+ });
+ if ( disabled ) {
+ buildFilter.attr( 'placeholder', '' ).addClass( tscss.filterDisabled )[0].disabled = true;
+ }
+ }
+ }
+ }
+ },
+ bindSearch: function( table, $el, internal ) {
+ table = $( table )[0];
+ $el = $( $el ); // allow passing a selector string
+ if ( !$el.length ) { return; }
+ var tmp,
+ c = table.config,
+ wo = c.widgetOptions,
+ namespace = c.namespace + 'filter',
+ $ext = wo.filter_$externalFilters;
+ if ( internal !== true ) {
+ // save anyMatch element
+ tmp = wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector;
+ wo.filter_$anyMatch = $el.filter( tmp );
+ if ( $ext && $ext.length ) {
+ wo.filter_$externalFilters = wo.filter_$externalFilters.add( $el );
+ } else {
+ wo.filter_$externalFilters = $el;
+ }
+ // update values ( external filters added after table initialization )
+ ts.setFilters( table, c.$table.data( 'lastSearch' ) || [], internal === false );
+ }
+ // unbind events
+ tmp = ( 'keypress keyup keydown search change input '.split( ' ' ).join( namespace + ' ' ) );
+ $el
+ // use data attribute instead of jQuery data since the head is cloned without including
+ // the data/binding
+ .attr( 'data-lastSearchTime', new Date().getTime() )
+ .unbind( tmp.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'keydown' + namespace, function( event ) {
+ if ( event.which === tskeyCodes.escape && !table.config.widgetOptions.filter_resetOnEsc ) {
+ // prevent keypress event
+ return false;
+ }
+ })
+ .bind( 'keyup' + namespace, function( event ) {
+ wo = table.config.widgetOptions; // make sure "wo" isn't cached
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ // emulate what webkit does.... escape clears the filter
+ if ( event.which === tskeyCodes.escape ) {
+ // make sure to restore the last value on escape
+ this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
+ // don't return if the search value is empty ( all rows need to be revealed )
+ } else if ( this.value !== '' && (
+ // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
+ ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
+ // let return & backspace continue on, but ignore arrows & non-valid characters
+ ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
+ ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
+ return;
+ // live search
+ } else if ( liveSearch === false ) {
+ if ( this.value !== '' && event.which !== tskeyCodes.enter ) {
+ return;
+ }
+ }
+ // change event = no delay; last true flag tells getFilters to skip newest timed input
+ tsf.searching( table, true, true, column );
+ })
+ // include change for select - fixes #473
+ .bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) {
+ // don't get cached data, in case data-column changes dynamically
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ eventType = event.type,
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( table.config.widgetOptions.filter_initialized &&
+ // immediate search if user presses enter
+ ( event.which === tskeyCodes.enter ||
+ // immediate search if a "search" or "blur" is triggered on the input
+ ( eventType === 'search' || eventType === 'blur' ) ||
+ // change & input events must be ignored if liveSearch !== true
+ ( eventType === 'change' || eventType === 'input' ) &&
+ // prevent search if liveSearch is a number
+ ( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
+ // don't allow 'change' or 'input' event to process if the input value
+ // is the same - fixes #685
+ this.value !== c.lastSearch[column]
+ )
+ ) {
+ event.preventDefault();
+ // init search with no delay
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ tsf.searching( table, eventType !== 'keypress' || event.which === tskeyCodes.enter, true, column );
+ }
+ });
+ },
+ searching: function( table, filter, skipFirst, column ) {
+ var liveSearch,
+ wo = table.config.widgetOptions;
+ if (typeof column === 'undefined') {
+ // no delay
+ liveSearch = false;
+ } else {
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ // get column setting, or set to fallback value, or default to false
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ }
+ clearTimeout( wo.filter_searchTimer );
+ if ( typeof filter === 'undefined' || filter === true ) {
+ // delay filtering
+ wo.filter_searchTimer = setTimeout( function() {
+ tsf.checkFilters( table, filter, skipFirst );
+ }, liveSearch ? wo.filter_searchDelay : 10 );
+ } else {
+ // skip delay
+ tsf.checkFilters( table, filter, skipFirst );
+ }
+ },
+ equalFilters: function (c, filter1, filter2) {
+ var indx,
+ f1 = [],
+ f2 = [],
+ len = c.columns + 1; // add one to include anyMatch filter
+ filter1 = $.isArray(filter1) ? filter1 : [];
+ filter2 = $.isArray(filter2) ? filter2 : [];
+ for (indx = 0; indx < len; indx++) {
+ f1[indx] = filter1[indx] || '';
+ f2[indx] = filter2[indx] || '';
+ }
+ return f1.join(',') === f2.join(',');
+ },
+ checkFilters: function( table, filter, skipFirst ) {
+ var c = table.config,
+ wo = c.widgetOptions,
+ filterArray = $.isArray( filter ),
+ filters = ( filterArray ) ? filter : ts.getFilters( table, true ),
+ currentFilters = filters || []; // current filter values
+ // prevent errors if delay init is set
+ if ( $.isEmptyObject( c.cache ) ) {
+ // update cache if delayInit set & pager has initialized ( after user initiates a search )
+ if ( c.delayInit && ( !c.pager || c.pager && c.pager.initialized ) ) {
+ ts.updateCache( c, function() {
+ tsf.checkFilters( table, false, skipFirst );
+ });
+ }
+ return;
+ }
+ // add filter array back into inputs
+ if ( filterArray ) {
+ ts.setFilters( table, filters, false, skipFirst !== true );
+ if ( !wo.filter_initialized ) {
+ c.lastSearch = [];
+ c.lastCombinedFilter = '';
+ }
+ }
+ if ( wo.filter_hideFilters ) {
+ // show/hide filter row as needed
+ c.$table
+ .find( '.' + tscss.filterRow )
+ .triggerHandler( tsf.hideFiltersCheck( c ) ? 'mouseleave' : 'mouseenter' );
+ }
+ // return if the last search is the same; but filter === false when updating the search
+ // see example-widget-filter.html filter toggle buttons
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) ) {
+ if ( filter !== false ) {
+ return;
+ } else {
+ // force filter refresh
+ c.lastCombinedFilter = '';
+ c.lastSearch = [];
+ }
+ }
+ // define filter inside it is false
+ filters = filters || [];
+ // convert filters to strings - see #1070
+ filters = Array.prototype.map ?
+ filters.map( String ) :
+ // for IE8 & older browsers - maybe not the best method
+ filters.join( '\ufffd' ).split( '\ufffd' );
+
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterStart', [ filters ] );
+ }
+ if ( c.showProcessing ) {
+ // give it time for the processing icon to kick in
+ setTimeout( function() {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }, 30 );
+ } else {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }
+ },
+ hideFiltersCheck: function( c ) {
+ if (typeof c.widgetOptions.filter_hideFilters === 'function') {
+ var val = c.widgetOptions.filter_hideFilters( c );
+ if (typeof val === 'boolean') {
+ return val;
+ }
+ }
+ return ts.getFilters( c.$table ).join( '' ) === '';
+ },
+ hideFilters: function( c, $table ) {
+ var timer;
+ ( $table || c.$table )
+ .find( '.' + tscss.filterRow )
+ .addClass( tscss.filterRowHide )
+ .bind( 'mouseenter mouseleave', function( e ) {
+ // save event object - http://bugs.jquery.com/ticket/12140
+ var event = e,
+ $row = $( this );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ if ( /enter|over/.test( event.type ) ) {
+ $row.removeClass( tscss.filterRowHide );
+ } else {
+ // don't hide if input has focus
+ // $( ':focus' ) needs jQuery 1.6+
+ if ( $( document.activeElement ).closest( 'tr' )[0] !== $row[0] ) {
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) );
+ }
+ }
+ }, 200 );
+ })
+ .find( 'input, select' ).bind( 'focus blur', function( e ) {
+ var event = e,
+ $row = $( this ).closest( 'tr' );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ clearTimeout( timer );
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) && event.type !== 'focus' );
+ }, 200 );
+ });
+ },
+ defaultFilter: function( filter, mask ) {
+ if ( filter === '' ) { return filter; }
+ var regex = tsfRegex.iQuery,
+ maskLen = mask.match( tsfRegex.igQuery ).length,
+ query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ],
+ len = query.length - 1,
+ indx = 0,
+ val = mask;
+ if ( len < 1 && maskLen > 1 ) {
+ // only one 'word' in query but mask has >1 slots
+ query[1] = query[0];
+ }
+ // replace all {query} with query words...
+ // if query = 'Bob', then convert mask from '!{query}' to '!Bob'
+ // if query = 'Bob Joe Frank', then convert mask '{q} OR {q}' to 'Bob OR Joe OR Frank'
+ while ( regex.test( val ) ) {
+ val = val.replace( regex, query[indx++] || '' );
+ if ( regex.test( val ) && indx < len && ( query[indx] || '' ) !== '' ) {
+ val = mask.replace( regex, val );
+ }
+ }
+ return val;
+ },
+ getLatestSearch: function( $input ) {
+ if ( $input ) {
+ return $input.sort( function( a, b ) {
+ return $( b ).attr( 'data-lastSearchTime' ) - $( a ).attr( 'data-lastSearchTime' );
+ });
+ }
+ return $input || $();
+ },
+ findRange: function( c, val, ignoreRanges ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var temp, ranges, range, start, end, singles, i, indx, len,
+ columns = [];
+ if ( /^[0-9]+$/.test( val ) ) {
+ // always return an array
+ return [ parseInt( val, 10 ) ];
+ }
+ // process column range
+ if ( !ignoreRanges && /-/.test( val ) ) {
+ ranges = val.match( /(\d+)\s*-\s*(\d+)/g );
+ len = ranges ? ranges.length : 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ range = ranges[indx].split( /\s*-\s*/ );
+ start = parseInt( range[0], 10 ) || 0;
+ end = parseInt( range[1], 10 ) || ( c.columns - 1 );
+ if ( start > end ) {
+ temp = start; start = end; end = temp; // swap
+ }
+ if ( end >= c.columns ) {
+ end = c.columns - 1;
+ }
+ for ( ; start <= end; start++ ) {
+ columns[ columns.length ] = start;
+ }
+ // remove processed range from val
+ val = val.replace( ranges[ indx ], '' );
+ }
+ }
+ // process single columns
+ if ( !ignoreRanges && /,/.test( val ) ) {
+ singles = val.split( /\s*,\s*/ );
+ len = singles.length;
+ for ( i = 0; i < len; i++ ) {
+ if ( singles[ i ] !== '' ) {
+ indx = parseInt( singles[ i ], 10 );
+ if ( indx < c.columns ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ }
+ }
+ // return all columns
+ if ( !columns.length ) {
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ return columns;
+ },
+ getColumnElm: function( c, $elements, column ) {
+ // data-column may contain multiple columns '1-3,5-6,8'
+ // replaces: c.$filters.filter( '[data-column="' + column + '"]' );
+ return $elements.filter( function() {
+ var cols = tsf.findRange( c, $( this ).attr( 'data-column' ) );
+ return $.inArray( column, cols ) > -1;
+ });
+ },
+ multipleColumns: function( c, $input ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var wo = c.widgetOptions,
+ // only target 'all' column inputs on initialization
+ // & don't target 'all' column inputs if they don't exist
+ targets = wo.filter_initialized || !$input.filter( wo.filter_anyColumnSelector ).length,
+ val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' );
+ return tsf.findRange( c, val, !targets );
+ },
+ processTypes: function( c, data, vars ) {
+ var ffxn,
+ filterMatched = null,
+ matches = null;
+ for ( ffxn in tsf.types ) {
+ if ( $.inArray( ffxn, vars.excludeMatch ) < 0 && matches === null ) {
+ matches = tsf.types[ffxn]( c, data, vars );
+ if ( matches !== null ) {
+ data.matchedOn = ffxn;
+ filterMatched = matches;
+ }
+ }
+ }
+ return filterMatched;
+ },
+ matchType: function( c, columnIndex ) {
+ var isMatch,
+ wo = c.widgetOptions,
+ $el = c.$headerIndexed[ columnIndex ];
+ // filter-exact > filter-match > filter_matchType for type
+ if ( $el.hasClass( 'filter-exact' ) ) {
+ isMatch = false;
+ } else if ( $el.hasClass( 'filter-match' ) ) {
+ isMatch = true;
+ } else {
+ // filter-select is not applied when filter_functions are used, so look for a select
+ if ( wo.filter_columnFilters ) {
+ $el = c.$filters
+ .find( '.' + tscss.filter )
+ .add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' );
+ } else if ( wo.filter_$externalFilters ) {
+ $el = wo.filter_$externalFilters.filter( '[data-column="' + columnIndex + '"]' );
+ }
+ isMatch = $el.length ?
+ c.widgetOptions.filter_matchType[ ( $el[ 0 ].nodeName || '' ).toLowerCase() ] === 'match' :
+ // default to exact, if no inputs found
+ false;
+ }
+ return isMatch;
+ },
+ processRow: function( c, data, vars ) {
+ var result, filterMatched,
+ fxn, ffxn, txt,
+ wo = c.widgetOptions,
+ showRow = true,
+ hasAnyMatchInput = wo.filter_$anyMatch && wo.filter_$anyMatch.length,
+
+ // if wo.filter_$anyMatch data-column attribute is changed dynamically
+ // we don't want to do an "anyMatch" search on one column using data
+ // for the entire row - see #998
+ columnIndex = wo.filter_$anyMatch && wo.filter_$anyMatch.length ?
+ // look for multiple columns '1-3,4-6,8'
+ tsf.multipleColumns( c, wo.filter_$anyMatch ) :
+ [];
+ data.$cells = data.$row.children();
+ data.matchedOn = null;
+ if ( data.anyMatchFlag && columnIndex.length > 1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ data.anyMatch = true;
+ data.isMatch = true;
+ data.rowArray = data.$cells.map( function( i ) {
+ if ( $.inArray( i, columnIndex ) > -1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ if ( data.parsed[ i ] ) {
+ txt = data.cacheArray[ i ];
+ } else {
+ txt = data.rawArray[ i ];
+ txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
+ if ( c.sortLocaleCompare ) {
+ txt = ts.replaceAccents( txt );
+ }
+ }
+ return txt;
+ }
+ }).get();
+ data.filter = data.anyMatchFilter;
+ data.iFilter = data.iAnyMatchFilter;
+ data.exact = data.rowArray.join( ' ' );
+ data.iExact = wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact;
+ data.cache = data.cacheArray.slice( 0, -1 ).join( ' ' );
+ vars.excludeMatch = vars.noAnyMatch;
+ filterMatched = tsf.processTypes( c, data, vars );
+ if ( filterMatched !== null ) {
+ showRow = filterMatched;
+ } else {
+ if ( wo.filter_startsWith ) {
+ showRow = false;
+ // data.rowArray may not contain all columns
+ columnIndex = Math.min( c.columns, data.rowArray.length );
+ while ( !showRow && columnIndex > 0 ) {
+ columnIndex--;
+ showRow = showRow || data.rowArray[ columnIndex ].indexOf( data.iFilter ) === 0;
+ }
+ } else {
+ showRow = ( data.iExact + data.childRowText ).indexOf( data.iFilter ) >= 0;
+ }
+ }
+ data.anyMatch = false;
+ // no other filters to process
+ if ( data.filters.join( '' ) === data.filter ) {
+ return showRow;
+ }
+ }
+
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.filter = data.filters[ columnIndex ];
+ data.index = columnIndex;
+
+ // filter types to exclude, per column
+ vars.excludeMatch = vars.excludeFilter[ columnIndex ];
+
+ // ignore if filter is empty or disabled
+ if ( data.filter ) {
+ data.cache = data.cacheArray[ columnIndex ];
+ result = data.parsed[ columnIndex ] ? data.cache : data.rawArray[ columnIndex ] || '';
+ data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405
+ data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ?
+ data.exact.toLowerCase() : data.exact;
+ data.isMatch = tsf.matchType( c, columnIndex );
+
+ result = showRow; // if showRow is true, show that row
+
+ // in case select filter option has a different value vs text 'a - z|A through Z'
+ ffxn = wo.filter_columnFilters ?
+ c.$filters.add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' )
+ .find( 'select option:selected' )
+ .attr( 'data-function-name' ) || '' : '';
+ // replace accents - see #357
+ if ( c.sortLocaleCompare ) {
+ data.filter = ts.replaceAccents( data.filter );
+ }
+
+ // replace column specific default filters - see #1088
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
+ data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
+ }
+
+ // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
+ // data.filter = case sensitive
+ data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;
+ fxn = vars.functions[ columnIndex ];
+ filterMatched = null;
+ if ( fxn ) {
+ if ( typeof fxn === 'function' ) {
+ // filter callback( exact cell content, parser normalized content,
+ // filter input value, column index, jQuery row object )
+ filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ } else if ( typeof fxn[ ffxn || data.filter ] === 'function' ) {
+ // selector option function
+ txt = ffxn || data.filter;
+ filterMatched =
+ fxn[ txt ]( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ }
+ }
+ if ( filterMatched === null ) {
+ // cycle through the different filters
+ // filters return a boolean or null if nothing matches
+ filterMatched = tsf.processTypes( c, data, vars );
+ // select with exact match; ignore "and" or "or" within the text; fixes #1486
+ txt = fxn === true && (data.matchedOn === 'and' || data.matchedOn === 'or');
+ if ( filterMatched !== null && !txt) {
+ result = filterMatched;
+ // Look for match, and add child row data for matching
+ } else {
+ // check fxn (filter-select in header) after filter types are checked
+ // without this, the filter + jQuery UI selectmenu demo was breaking
+ if ( fxn === true ) {
+ // default selector uses exact match unless 'filter-match' class is found
+ result = data.isMatch ?
+ // data.iExact may be a number
+ ( '' + data.iExact ).search( data.iFilter ) >= 0 :
+ data.filter === data.exact;
+ } else {
+ txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
+ result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
+ }
+ }
+ } else {
+ result = filterMatched;
+ }
+ showRow = ( result ) ? showRow : false;
+ }
+ }
+ return showRow;
+ },
+ findRows: function( table, filters, currentFilters ) {
+ if (
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
+ !table.config.widgetOptions.filter_initialized
+ ) {
+ return;
+ }
+ var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
+ isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
+ notFiltered, searchFiltered, query, injected, res, id, txt,
+ storedFilters = $.extend( [], filters ),
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'filter'),
+ // data object passed to filters; anyMatch is a flag for the filters
+ data = {
+ anyMatch: false,
+ filters: filters,
+ // regex filter type cache
+ filter_regexCache : []
+ },
+ vars = {
+ // anyMatch really screws up with these types of filters
+ noAnyMatch: [ 'range', 'operators' ],
+ // cache filter variables that use ts.getColumnData in the main loop
+ functions : [],
+ excludeFilter : [],
+ defaultColFilter : [],
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
+ };
+ // parse columns after formatter, in case the class is added at that point
+ data.parsed = [];
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.parsed[ columnIndex ] = wo.filter_useParsedData ||
+ // parser has a "parsed" parameter
+ ( c.parsers && c.parsers[ columnIndex ] && c.parsers[ columnIndex ].parsed ||
+ // getData may not return 'parsed' if other 'filter-' class names exist
+ // ( e.g. <th class="filter-select filter-parsed"> )
+ ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
+ ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) );
+
+ vars.functions[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' );
+ vars.defaultColFilter[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
+ vars.excludeFilter[ columnIndex ] =
+ ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
+ }
+
+ if ( debug ) {
+ console.log( 'Filter >> Starting filter widget search', filters );
+ time = new Date();
+ }
+ // filtered rows count
+ c.filteredRows = 0;
+ c.totalRows = 0;
+ currentFilters = ( storedFilters || [] );
+
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, c.$tbodies.eq( tbodyIndex ), true );
+ // skip child rows & widget added ( removable ) rows - fixes #448 thanks to @hempel!
+ // $rows = $tbody.children( 'tr' ).not( c.selectorRemove );
+ columnIndex = c.columns;
+ // convert stored rows into a jQuery object
+ norm_rows = c.cache[ tbodyIndex ].normalized;
+ $rows = $( $.map( norm_rows, function( el ) {
+ return el[ columnIndex ].$row.get();
+ }) );
+
+ if ( currentFilters.join('') === '' || wo.filter_serversideFiltering ) {
+ $rows
+ .removeClass( wo.filter_filteredRow )
+ .not( '.' + c.cssChildRow )
+ .css( 'display', '' );
+ } else {
+ // filter out child rows
+ $rows = $rows.not( '.' + c.cssChildRow );
+ len = $rows.length;
+
+ if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
+ typeof filters[c.columns] !== 'undefined' ) {
+ data.anyMatchFlag = true;
+ data.anyMatchFilter = '' + (
+ filters[ c.columns ] ||
+ wo.filter_$anyMatch && tsf.getLatestSearch( wo.filter_$anyMatch ).val() ||
+ ''
+ );
+ if ( wo.filter_columnAnyMatch ) {
+ // specific columns search
+ query = data.anyMatchFilter.split( tsfRegex.andSplit );
+ injected = false;
+ for ( indx = 0; indx < query.length; indx++ ) {
+ res = query[ indx ].split( ':' );
+ if ( res.length > 1 ) {
+ // make the column a one-based index ( non-developers start counting from one :P )
+ if ( isNaN( res[0] ) ) {
+ $.each( c.headerContent, function( i, txt ) {
+ // multiple matches are possible
+ if ( txt.toLowerCase().indexOf( res[0] ) > -1 ) {
+ id = i;
+ filters[ id ] = res[1];
+ }
+ });
+ } else {
+ id = parseInt( res[0], 10 ) - 1;
+ }
+ if ( id >= 0 && id < c.columns ) { // if id is an integer
+ filters[ id ] = res[1];
+ query.splice( indx, 1 );
+ indx--;
+ injected = true;
+ }
+ }
+ }
+ if ( injected ) {
+ data.anyMatchFilter = query.join( ' && ' );
+ }
+ }
+ }
+
+ // optimize searching only through already filtered rows - see #313
+ searchFiltered = wo.filter_searchFiltered;
+ lastSearch = c.lastSearch || c.$table.data( 'lastSearch' ) || [];
+ if ( searchFiltered ) {
+ // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
+ for ( indx = 0; indx < columnIndex + 1; indx++ ) {
+ val = filters[indx] || '';
+ // break out of loop if we've already determined not to search filtered rows
+ if ( !searchFiltered ) { indx = columnIndex; }
+ // search already filtered rows if...
+ searchFiltered = searchFiltered && lastSearch.length &&
+ // there are no changes from beginning of filter
+ val.indexOf( lastSearch[indx] || '' ) === 0 &&
+ // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string
+ !tsfRegex.alreadyFiltered.test( val ) &&
+ // if we are not doing exact matches, using '|' ( logical or ) or not '!'
+ !tsfRegex.exactTest.test( val ) &&
+ // don't search only filtered if the value is negative
+ // ( '> -10' => '> -100' will ignore hidden rows )
+ !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) &&
+ // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593
+ !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length &&
+ !tsf.matchType( c, indx ) );
+ }
+ }
+ notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
+ // can't search when all rows are hidden - this happens when looking for exact matches
+ if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
+ if ( debug ) {
+ console.log( 'Filter >> Searching through ' +
+ ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
+ }
+ if ( data.anyMatchFlag ) {
+ if ( c.sortLocaleCompare ) {
+ // replace accents
+ data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter );
+ }
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) {
+ data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter );
+ // clear search filtered flag because default filters are not saved to the last search
+ searchFiltered = false;
+ }
+ // make iAnyMatchFilter lowercase unless both filter widget & core ignoreCase options are true
+ // when c.ignoreCase is true, the cache contains all lower case data
+ data.iAnyMatchFilter = !( wo.filter_ignoreCase && c.ignoreCase ) ?
+ data.anyMatchFilter :
+ data.anyMatchFilter.toLowerCase();
+ }
+
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+
+ txt = $rows[ rowIndex ].className;
+ // the first row can never be a child row
+ isChild = rowIndex && tsfRegex.child.test( txt );
+ // skip child rows & already filtered rows
+ if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) {
+ continue;
+ }
+
+ data.$row = $rows.eq( rowIndex );
+ data.rowIndex = rowIndex;
+ data.cacheArray = norm_rows[ rowIndex ];
+ rowData = data.cacheArray[ c.columns ];
+ data.rawArray = rowData.raw;
+ data.childRowText = '';
+
+ if ( !wo.filter_childByColumn ) {
+ txt = '';
+ // child row cached text
+ childRow = rowData.child;
+ // so, if 'table.config.widgetOptions.filter_childRows' is true and there is
+ // a match anywhere in the child row, then it will make the row visible
+ // checked here so the option can be changed dynamically
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ txt += ' ' + childRow[indx].join( ' ' ) || '';
+ }
+ data.childRowText = wo.filter_childRows ?
+ ( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
+ '';
+ }
+
+ showRow = false;
+ showParent = tsf.processRow( c, data, vars );
+ $row = rowData.$row;
+
+ // don't pass reference to val
+ val = showParent ? true : false;
+ childRow = rowData.$row.filter( ':gt(0)' );
+ if ( wo.filter_childRows && childRow.length ) {
+ if ( wo.filter_childByColumn ) {
+ if ( !wo.filter_childWithSibs ) {
+ // hide all child rows
+ childRow.addClass( wo.filter_filteredRow );
+ // if only showing resulting child row, only include parent
+ $row = $row.eq( 0 );
+ }
+ // cycle through each child row
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ data.$row = childRow.eq( indx );
+ data.cacheArray = rowData.child[ indx ];
+ data.rawArray = data.cacheArray;
+ val = tsf.processRow( c, data, vars );
+ // use OR comparison on child rows
+ showRow = showRow || val;
+ if ( !wo.filter_childWithSibs && val ) {
+ childRow.eq( indx ).removeClass( wo.filter_filteredRow );
+ }
+ }
+ }
+ // keep parent row match even if no child matches... see #1020
+ showRow = showRow || showParent;
+ } else {
+ showRow = val;
+ }
+ $row
+ .toggleClass( wo.filter_filteredRow, !showRow )[0]
+ .display = showRow ? '' : 'none';
+ }
+ }
+ c.filteredRows += $rows.not( '.' + wo.filter_filteredRow ).length;
+ c.totalRows += $rows.length;
+ ts.processTbody( table, $tbody, false );
+ }
+ // lastCombinedFilter is no longer used internally
+ c.lastCombinedFilter = storedFilters.join(''); // save last search
+ // don't save 'filters' directly since it may have altered ( AnyMatch column searches )
+ c.lastSearch = storedFilters;
+ c.$table.data( 'lastSearch', storedFilters );
+ if ( wo.filter_saveFilters && ts.storage ) {
+ ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
+ }
+ if ( debug ) {
+ console.log( 'Filter >> Completed search' + ts.benchmark(time) );
+ }
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterBeforeEnd', c );
+ c.$table.triggerHandler( 'filterEnd', c );
+ }
+ setTimeout( function() {
+ ts.applyWidget( c.table ); // make sure zebra widget is applied
+ }, 0 );
+ },
+ getOptionSource: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var c = table.config,
+ wo = c.widgetOptions,
+ arry = false,
+ source = wo.filter_selectSource,
+ last = c.$table.data( 'lastSearch' ) || [],
+ fxn = typeof source === 'function' ? true : ts.getColumnData( table, source, column );
+
+ if ( onlyAvail && last[column] !== '' ) {
+ onlyAvail = false;
+ }
+
+ // filter select source option
+ if ( fxn === true ) {
+ // OVERALL source
+ arry = source( table, column, onlyAvail );
+ } else if ( fxn instanceof $ || ( $.type( fxn ) === 'string' && fxn.indexOf( '</option>' ) >= 0 ) ) {
+ // selectSource is a jQuery object or string of options
+ return fxn;
+ } else if ( $.isArray( fxn ) ) {
+ arry = fxn;
+ } else if ( $.type( source ) === 'object' && fxn ) {
+ // custom select source function for a SPECIFIC COLUMN
+ arry = fxn( table, column, onlyAvail );
+ // abort - updating the selects from an external method
+ if (arry === null) {
+ return null;
+ }
+ }
+ if ( arry === false ) {
+ // fall back to original method
+ arry = tsf.getOptions( table, column, onlyAvail );
+ }
+
+ return tsf.processOptions( table, column, arry );
+
+ },
+ processOptions: function( table, column, arry ) {
+ if ( !$.isArray( arry ) ) {
+ return false;
+ }
+ table = $( table )[0];
+ var cts, txt, indx, len, parsedTxt, str,
+ c = table.config,
+ validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
+ direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
+ parsed = [];
+ // get unique elements and sort the list
+ // if $.tablesorter.sortText exists ( not in the original tablesorter ),
+ // then natural sort the list otherwise use a basic sort
+ arry = $.grep( arry, function( value, indx ) {
+ if ( value.text ) {
+ return true;
+ }
+ return $.inArray( value, arry ) === indx;
+ });
+ if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) {
+ // unsorted select options
+ return arry;
+ } else {
+ len = arry.length;
+ // parse select option values
+ for ( indx = 0; indx < len; indx++ ) {
+ txt = arry[ indx ];
+ // check for object
+ str = txt.text ? txt.text : txt;
+ // sortNatural breaks if you don't pass it strings
+ parsedTxt = ( validColumn && c.parsers && c.parsers.length &&
+ c.parsers[ column ].format( str, table, [], column ) || str ).toString();
+ parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt;
+ // parse array data using set column parser; this DOES NOT pass the original
+ // table cell to the parser format function
+ if ( txt.text ) {
+ txt.parsed = parsedTxt;
+ parsed[ parsed.length ] = txt;
+ } else {
+ parsed[ parsed.length ] = {
+ text : txt,
+ // check parser length - fixes #934
+ parsed : parsedTxt
+ };
+ }
+ }
+ // sort parsed select options
+ cts = c.textSorter || '';
+ parsed.sort( function( a, b ) {
+ var x = direction ? b.parsed : a.parsed,
+ y = direction ? a.parsed : b.parsed;
+ if ( validColumn && typeof cts === 'function' ) {
+ // custom OVERALL text sorter
+ return cts( x, y, true, column, table );
+ } else if ( validColumn && typeof cts === 'object' && cts.hasOwnProperty( column ) ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ return cts[column]( x, y, true, column, table );
+ } else if ( ts.sortNatural ) {
+ // fall back to natural sort
+ return ts.sortNatural( x, y );
+ }
+ // using an older version! do a basic sort
+ return true;
+ });
+ // rebuild arry from sorted parsed data
+ arry = [];
+ len = parsed.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ arry[ arry.length ] = parsed[indx];
+ }
+ return arry;
+ }
+ },
+ getOptions: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var rowIndex, tbodyIndex, len, row, cache, indx, child, childLen,
+ c = table.config,
+ wo = c.widgetOptions,
+ arry = [];
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ cache = c.cache[tbodyIndex];
+ len = c.cache[tbodyIndex].normalized.length;
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ // get cached row from cache.row ( old ) or row data object
+ // ( new; last item in normalized array )
+ row = cache.row ?
+ cache.row[ rowIndex ] :
+ cache.normalized[ rowIndex ][ c.columns ].$row[0];
+ // check if has class filtered
+ if ( onlyAvail && row.className.match( wo.filter_filteredRow ) ) {
+ continue;
+ }
+ // get non-normalized cell content
+ if ( wo.filter_useParsedData ||
+ c.parsers[column].parsed ||
+ c.$headerIndexed[column].hasClass( 'filter-parsed' ) ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ column ];
+ // child row parsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length - 1;
+ for ( indx = 0; indx < childLen; indx++ ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ c.columns ].child[ indx ][ column ];
+ }
+ }
+ } else {
+ // get raw cached data instead of content directly from the cells
+ arry[ arry.length ] = cache.normalized[ rowIndex ][ c.columns ].raw[ column ];
+ // child row unparsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length;
+ for ( indx = 1; indx < childLen; indx++ ) {
+ child = cache.normalized[ rowIndex ][ c.columns ].$row.eq( indx ).children().eq( column );
+ arry[ arry.length ] = '' + ts.getElementText( c, child, column );
+ }
+ }
+ }
+ }
+ }
+ return arry;
+ },
+ buildSelect: function( table, column, arry, updating, onlyAvail ) {
+ table = $( table )[0];
+ column = parseInt( column, 10 );
+ if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
+ return;
+ }
+
+ var indx, val, txt, t, $filters, $filter, option,
+ c = table.config,
+ wo = c.widgetOptions,
+ node = c.$headerIndexed[ column ],
+ // t.data( 'placeholder' ) won't work in jQuery older than 1.4.3
+ options = '<option value="">' +
+ ( node.data( 'placeholder' ) ||
+ node.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select || ''
+ ) + '</option>',
+ // Get curent filter value
+ currentValue = c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .val();
+
+ // nothing included in arry ( external source ), so get the options from
+ // filter_selectSource or column data
+ if ( typeof arry === 'undefined' || arry === '' ) {
+ arry = tsf.getOptionSource( table, column, onlyAvail );
+ // abort, selects are updated by an external method
+ if (arry === null) {
+ return;
+ }
+ }
+
+ if ( $.isArray( arry ) ) {
+ // build option list
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ option = arry[ indx ];
+ if ( option.text ) {
+ // OBJECT!! add data-function-name in case the value is set in filter_functions
+ option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value;
+
+ // support jQuery < v1.8, otherwise the below code could be shortened to
+ // options += $( '<option>', option )[ 0 ].outerHTML;
+ options += '<option';
+ for ( val in option ) {
+ if ( option.hasOwnProperty( val ) && val !== 'text' ) {
+ options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ }
+ if ( !option.value ) {
+ options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
+ // above code is needed in jQuery < v1.8
+
+ // make sure we don't turn an object into a string (objects without a "text" property)
+ } else if ( '' + option !== '[object Object]' ) {
+ txt = option = ( '' + option ).replace( tsfRegex.quote, '&quot;' );
+ val = txt;
+ // allow including a symbol in the selectSource array
+ // 'a-z|A through Z' so that 'a-z' becomes the option value
+ // and 'A through Z' becomes the option text
+ if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ t = txt.split( wo.filter_selectSourceSeparator );
+ val = t[0];
+ txt = t[1];
+ }
+ // replace quotes - fixes #242 & ignore empty strings
+ // see http://stackoverflow.com/q/14990971/145346
+ options += option !== '' ?
+ '<option ' +
+ ( val === txt ? '' : 'data-function-name="' + option + '" ' ) +
+ 'value="' + val + '">' + txt +
+ '</option>' : '';
+ }
+ }
+ // clear arry so it doesn't get appended twice
+ arry = [];
+ }
+
+ // update all selects in the same column ( clone thead in sticky headers &
+ // any external selects ) - fixes 473
+ $filters = ( c.$filters ? c.$filters : c.$table.children( 'thead' ) )
+ .find( '.' + tscss.filter );
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ $filter = $filters.filter( 'select[data-column="' + column + '"]' );
+
+ // make sure there is a select there!
+ if ( $filter.length ) {
+ $filter[ updating ? 'html' : 'append' ]( options );
+ if ( !$.isArray( arry ) ) {
+ // append options if arry is provided externally as a string or jQuery object
+ // options ( default value ) was already added
+ $filter.append( arry ).val( currentValue );
+ }
+ $filter.val( currentValue );
+ }
+ },
+ buildDefault: function( table, updating ) {
+ var columnIndex, $header, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ columns = c.columns;
+ // build default select dropdown
+ for ( columnIndex = 0; columnIndex < columns; columnIndex++ ) {
+ $header = c.$headerIndexed[columnIndex];
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ // look for the filter-select class; build/update it if found
+ if ( ( $header.hasClass( 'filter-select' ) ||
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) === true ) && noSelect ) {
+ tsf.buildSelect( table, columnIndex, '', updating, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ };
+
+ // filter regex variable
+ tsfRegex = tsf.regex;
+
+ ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
+ var i, $filters, $column, cols,
+ filters = [],
+ c = table ? $( table )[0].config : '',
+ wo = c ? c.widgetOptions : '';
+ if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
+ // setFilters called, but last search is exactly the same as the current
+ // fixes issue #733 & #903 where calling update causes the input values to reset
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
+ ) {
+ return $( table ).data( 'lastSearch' ) || [];
+ }
+ if ( c ) {
+ if ( c.$filters ) {
+ $filters = c.$filters.find( '.' + tscss.filter );
+ }
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ if ( $filters && $filters.length ) {
+ filters = setFilters || [];
+ for ( i = 0; i < c.columns + 1; i++ ) {
+ cols = ( i === c.columns ?
+ // 'all' columns can now include a range or set of columms ( data-column='0-2,4,6-7' )
+ wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector :
+ '[data-column="' + i + '"]' );
+ $column = $filters.filter( cols );
+ if ( $column.length ) {
+ // move the latest search to the first slot in the array
+ $column = tsf.getLatestSearch( $column );
+ if ( $.isArray( setFilters ) ) {
+ // skip first ( latest input ) to maintain cursor position while typing
+ if ( skipFirst && $column.length > 1 ) {
+ $column = $column.slice( 1 );
+ }
+ if ( i === c.columns ) {
+ // prevent data-column='all' from filling data-column='0,1' ( etc )
+ cols = $column.filter( wo.filter_anyColumnSelector );
+ $column = cols.length ? cols : $column;
+ }
+ $column
+ .val( setFilters[ i ] )
+ // must include a namespace here; but not c.namespace + 'filter'?
+ .trigger( 'change' + c.namespace );
+ } else {
+ filters[i] = $column.val() || '';
+ // don't change the first... it will move the cursor
+ if ( i === c.columns ) {
+ // don't update range columns from 'all' setting
+ $column
+ .slice( 1 )
+ .filter( '[data-column*="' + $column.attr( 'data-column' ) + '"]' )
+ .val( filters[ i ] );
+ } else {
+ $column
+ .slice( 1 )
+ .val( filters[ i ] );
+ }
+ }
+ // save any match input dynamically
+ if ( i === c.columns && $column.length ) {
+ wo.filter_$anyMatch = $column;
+ }
+ }
+ }
+ }
+ }
+ return filters;
+ };
+
+ ts.setFilters = function( table, filter, apply, skipFirst ) {
+ var c = table ? $( table )[0].config : '',
+ valid = ts.getFilters( table, true, filter, skipFirst );
+ // default apply to "true"
+ if ( typeof apply === 'undefined' ) {
+ apply = true;
+ }
+ if ( c && apply ) {
+ // ensure new set filters are applied, even if the search is the same
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ tsf.searching( c.table, filter, skipFirst );
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }
+ return valid.length !== 0;
+ };
+
+})( jQuery );
+
+/*! Widget: stickyHeaders - updated 9/27/2017 (v2.29.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.4.3+
+ * by Rob Garrison
+ */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ sticky : 'tablesorter-stickyHeader', // stickyHeader
+ stickyVis : 'tablesorter-sticky-visible',
+ stickyHide: 'tablesorter-sticky-hidden',
+ stickyWrap: 'tablesorter-sticky-wrapper'
+ });
+
+ // Add a resize event to table headers
+ ts.addHeaderResizeEvent = function(table, disable, settings) {
+ table = $(table)[0]; // make sure we're using a dom element
+ if ( !table.config ) { return; }
+ var defaults = {
+ timer : 250
+ },
+ options = $.extend({}, defaults, settings),
+ c = table.config,
+ wo = c.widgetOptions,
+ checkSizes = function( triggerEvent ) {
+ var index, headers, $header, sizes, width, height,
+ len = c.$headers.length;
+ wo.resize_flag = true;
+ headers = [];
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ sizes = $header.data( 'savedSizes' ) || [ 0, 0 ]; // fixes #394
+ width = $header[0].offsetWidth;
+ height = $header[0].offsetHeight;
+ if ( width !== sizes[0] || height !== sizes[1] ) {
+ $header.data( 'savedSizes', [ width, height ] );
+ headers.push( $header[0] );
+ }
+ }
+ if ( headers.length && triggerEvent !== false ) {
+ c.$table.triggerHandler( 'resize', [ headers ] );
+ }
+ wo.resize_flag = false;
+ };
+ clearInterval(wo.resize_timer);
+ if (disable) {
+ wo.resize_flag = false;
+ return false;
+ }
+ checkSizes( false );
+ wo.resize_timer = setInterval(function() {
+ if (wo.resize_flag) { return; }
+ checkSizes();
+ }, options.timer);
+ };
+
+ function getStickyOffset(c, wo) {
+ var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
+ return $el.length ?
+ $el.height() || 0 :
+ parseInt(wo.stickyHeaders_offset, 10) || 0;
+ }
+
+ // Sticky headers based on this awesome article:
+ // http://css-tricks.com/13465-persistent-headers/
+ // and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
+ // **************************
+ ts.addWidget({
+ id: 'stickyHeaders',
+ priority: 54, // sticky widget must be initialized after the filter & before pager widget!
+ options: {
+ stickyHeaders : '', // extra class name added to the sticky header row
+ stickyHeaders_appendTo : null, // jQuery selector or object to phycially attach the sticky headers
+ stickyHeaders_attachTo : null, // jQuery selector or object to attach scroll listener to (overridden by xScroll & yScroll settings)
+ stickyHeaders_xScroll : null, // jQuery selector or object to monitor horizontal scroll position (defaults: xScroll > attachTo > window)
+ stickyHeaders_yScroll : null, // jQuery selector or object to monitor vertical scroll position (defaults: yScroll > attachTo > window)
+ stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
+ stickyHeaders_filteredToTop: true, // scroll table top into view after filtering
+ stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists
+ stickyHeaders_addResizeEvent : true, // trigger 'resize' event on headers
+ stickyHeaders_includeCaption : true, // if false and a caption exist, it won't be included in the sticky header
+ stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs
+ },
+ format: function(table, c, wo) {
+ // filter widget doesn't initialize on an empty table. Fixes #449
+ if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
+ return;
+ }
+ var index, len, $t,
+ $table = c.$table,
+ // add position: relative to attach element, hopefully it won't cause trouble.
+ $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
+ namespace = c.namespace + 'stickyheaders ',
+ // element to watch for the scroll event
+ $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
+ $xScroll = $(wo.stickyHeaders_xScroll || wo.stickyHeaders_attachTo || window),
+ $thead = $table.children('thead:first'),
+ $header = $thead.children('tr').not('.sticky-false').children(),
+ $tfoot = $table.children('tfoot'),
+ stickyOffset = getStickyOffset(c, wo),
+ // is this table nested? If so, find parent sticky header wrapper (div, not table)
+ $nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
+ $table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
+ 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 + ' ' + c.namespace.slice(1) + '_extra_table' )
+ .wrap('<div class="' + ts.css.stickyWrap + '">'),
+ $stickyWrap = $stickyTable.parent()
+ .addClass(ts.css.stickyHide)
+ .css({
+ position : $attach.length ? 'absolute' : 'fixed',
+ padding : parseInt( $stickyTable.parent().parent().css('padding-left'), 10 ),
+ top : stickyOffset + nestedStickyTop,
+ left : 0,
+ visibility : 'hidden',
+ zIndex : wo.stickyHeaders_zIndex || 2
+ }),
+ $stickyThead = $stickyTable.children('thead:first'),
+ $stickyCells,
+ laststate = '',
+ setWidth = function($orig, $clone) {
+ var index, width, border, $cell, $this,
+ $cells = $orig.filter(':visible'),
+ len = $cells.length;
+ for ( index = 0; index < len; index++ ) {
+ $cell = $clone.filter(':visible').eq(index);
+ $this = $cells.eq(index);
+ // code from https://github.com/jmosbech/StickyTableHeaders
+ if ($this.css('box-sizing') === 'border-box') {
+ width = $this.outerWidth();
+ } else {
+ if ($cell.css('border-collapse') === 'collapse') {
+ if (window.getComputedStyle) {
+ width = parseFloat( window.getComputedStyle($this[0], null).width );
+ } else {
+ // ie8 only
+ border = parseFloat( $this.css('border-width') );
+ width = $this.outerWidth() - parseFloat( $this.css('padding-left') ) - parseFloat( $this.css('padding-right') ) - border;
+ }
+ } else {
+ width = $this.width();
+ }
+ }
+ $cell.css({
+ 'width': width,
+ 'min-width': width,
+ 'max-width': width
+ });
+ }
+ },
+ getLeftPosition = function(yWindow) {
+ if (yWindow === false && $nestedSticky.length) {
+ return $table.position().left;
+ }
+ return $attach.length ?
+ parseInt($attach.css('padding-left'), 10) || 0 :
+ $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
+ },
+ resizeHeader = function() {
+ $stickyWrap.css({
+ left : getLeftPosition(),
+ width: $table.outerWidth()
+ });
+ setWidth( $table, $stickyTable );
+ setWidth( $header, $stickyCells );
+ },
+ scrollSticky = function( resizing ) {
+ if (!$table.is(':visible')) { return; } // fixes #278
+ // Detect nested tables - fixes #724
+ nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
+ var tmp,
+ offset = $table.offset(),
+ stickyOffset = getStickyOffset(c, wo),
+ yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
+ yScroll = yWindow ?
+ $yScroll.scrollTop() :
+ // use parent sticky position if nested AND inside of a scrollable element - see #1512
+ $nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
+ attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
+ captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
+ scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
+ tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
+ isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
+ state = isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide,
+ needsUpdating = !$stickyWrap.hasClass( state ),
+ cssSettings = { visibility : isVisible };
+ if ($attach.length) {
+ // attached sticky headers always need updating
+ needsUpdating = true;
+ cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
+ }
+ // adjust when scrolling horizontally - fixes issue #143
+ tmp = getLeftPosition(yWindow);
+ if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
+ needsUpdating = true;
+ cssSettings.left = tmp;
+ }
+ cssSettings.top = ( cssSettings.top || 0 ) +
+ // If nested AND inside of a scrollable element, only add parent sticky height
+ (!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
+ if (needsUpdating) {
+ $stickyWrap
+ .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
+ .addClass( state )
+ .css(cssSettings);
+ }
+ if (isVisible !== laststate || resizing) {
+ // make sure the column widths match
+ resizeHeader();
+ laststate = isVisible;
+ }
+ };
+ // only add a position relative if a position isn't already defined
+ if ($attach.length && !$attach.css('position')) {
+ $attach.css('position', 'relative');
+ }
+ // 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
+ // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
+ $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
+ $stickyTable.find('> tbody, > tfoot').remove();
+ $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
+ // issue #172 - find td/th in sticky header
+ $stickyCells = $stickyThead.children().children();
+ $stickyTable.css({ height:0, width:0, margin: 0 });
+ // remove resizable block
+ $stickyCells.find('.' + ts.css.resizer).remove();
+ // update sticky header class names to match real header after sorting
+ $table
+ .addClass('hasStickyHeaders')
+ .bind('pagerComplete' + namespace, function() {
+ resizeHeader();
+ });
+
+ ts.bindEvents(table, $stickyThead.children().children('.' + ts.css.header));
+
+ if (wo.stickyHeaders_appendTo) {
+ $(wo.stickyHeaders_appendTo).append( $stickyWrap );
+ } else {
+ // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
+ $table.after( $stickyWrap );
+ }
+
+ // onRenderHeader is defined, we need to do something about it (fixes #641)
+ if (c.onRenderHeader) {
+ $t = $stickyThead.children('tr').children();
+ len = $t.length;
+ for ( index = 0; index < len; index++ ) {
+ // send second parameter
+ c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
+ }
+ }
+ // make it sticky!
+ $xScroll.add($yScroll)
+ .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
+ .bind('scroll resize '.split(' ').join( namespace ), function( event ) {
+ scrollSticky( event.type === 'resize' );
+ });
+ c.$table
+ .unbind('stickyHeadersUpdate' + namespace)
+ .bind('stickyHeadersUpdate' + namespace, function() {
+ scrollSticky( true );
+ });
+
+ if (wo.stickyHeaders_addResizeEvent) {
+ ts.addHeaderResizeEvent(table);
+ }
+
+ // look for filter widget
+ if ($table.hasClass('hasFilters') && wo.filter_columnFilters) {
+ // scroll table into view after filtering, if sticky header is active - #482
+ $table.bind('filterEnd' + namespace, function() {
+ // $(':focus') needs jQuery 1.6+
+ var $td = $(document.activeElement).closest('td'),
+ column = $td.parent().children().index($td);
+ // only scroll if sticky header is active
+ if ($stickyWrap.hasClass(ts.css.stickyVis) && wo.stickyHeaders_filteredToTop) {
+ // scroll to original table (not sticky clone)
+ window.scrollTo(0, $table.position().top);
+ // give same input/select focus; check if c.$filters exists; fixes #594
+ if (column >= 0 && c.$filters) {
+ c.$filters.eq(column).find('a, select, input').filter(':visible').focus();
+ }
+ }
+ });
+ ts.filter.bindSearch( $table, $stickyCells.find('.' + ts.css.filter) );
+ // support hideFilters
+ if (wo.filter_hideFilters) {
+ ts.filter.hideFilters(c, $stickyTable);
+ }
+ }
+
+ // resize table (Firefox)
+ if (wo.stickyHeaders_addResizeEvent) {
+ $table.bind('resize' + c.namespace + 'stickyheaders', function() {
+ resizeHeader();
+ });
+ }
+
+ // make sure sticky is visible if page is partially scrolled
+ scrollSticky( true );
+ $table.triggerHandler('stickyHeadersInit');
+
+ },
+ remove: function(table, c, wo) {
+ var namespace = c.namespace + 'stickyheaders ';
+ c.$table
+ .removeClass('hasStickyHeaders')
+ .unbind( ('pagerComplete resize filterEnd stickyHeadersUpdate '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
+ .next('.' + ts.css.stickyWrap).remove();
+ if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
+ $(window)
+ .add(wo.stickyHeaders_xScroll)
+ .add(wo.stickyHeaders_yScroll)
+ .add(wo.stickyHeaders_attachTo)
+ .unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') );
+ ts.addHeaderResizeEvent(table, true);
+ }
+ });
+
+})(jQuery, window);
+
+/*! Widget: resizable - updated 2018-03-26 (v2.30.2) */
+/*jshint browser:true, jquery:true, unused:false */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ resizableContainer : 'tablesorter-resizable-container',
+ resizableHandle : 'tablesorter-resizable-handle',
+ resizableNoSelect : 'tablesorter-disableSelection',
+ resizableStorage : 'tablesorter-resizable'
+ });
+
+ // Add extra scroller css
+ $(function() {
+ var s = '<style>' +
+ 'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
+ '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
+ '.' + ts.css.resizableContainer + ' { position: relative; height: 1px; }' +
+ // make handle z-index > than stickyHeader z-index, so the handle stays above sticky header
+ '.' + ts.css.resizableHandle + ' { position: absolute; display: inline-block; width: 8px;' +
+ 'top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }' +
+ '</style>';
+ $('head').append(s);
+ });
+
+ ts.resizable = {
+ init : function( c, wo ) {
+ if ( c.$table.hasClass( 'hasResizable' ) ) { return; }
+ c.$table.addClass( 'hasResizable' );
+
+ var noResize, $header, column, storedSizes, tmp,
+ $table = c.$table,
+ $parent = $table.parent(),
+ marginTop = parseInt( $table.css( 'margin-top' ), 10 ),
+
+ // internal variables
+ vars = wo.resizable_vars = {
+ useStorage : ts.storage && wo.resizable !== false,
+ $wrap : $parent,
+ mouseXPosition : 0,
+ $target : null,
+ $next : null,
+ overflow : $parent.css('overflow') === 'auto' ||
+ $parent.css('overflow') === 'scroll' ||
+ $parent.css('overflow-x') === 'auto' ||
+ $parent.css('overflow-x') === 'scroll',
+ storedSizes : []
+ };
+
+ // set default widths
+ ts.resizableReset( c.table, true );
+
+ // now get measurements!
+ vars.tableWidth = $table.width();
+ // attempt to autodetect
+ vars.fullWidth = Math.abs( $parent.width() - vars.tableWidth ) < 20;
+
+ /*
+ // Hacky method to determine if table width is set to 'auto'
+ // http://stackoverflow.com/a/20892048/145346
+ if ( !vars.fullWidth ) {
+ tmp = $table.width();
+ $header = $table.wrap('<span>').parent(); // temp variable
+ storedSizes = parseInt( $table.css( 'margin-left' ), 10 ) || 0;
+ $table.css( 'margin-left', storedSizes + 50 );
+ vars.tableWidth = $header.width() > tmp ? 'auto' : tmp;
+ $table.css( 'margin-left', storedSizes ? storedSizes : '' );
+ $header = null;
+ $table.unwrap('<span>');
+ }
+ */
+
+ if ( vars.useStorage && vars.overflow ) {
+ // save table width
+ ts.storage( c.table, 'tablesorter-table-original-css-width', vars.tableWidth );
+ tmp = ts.storage( c.table, 'tablesorter-table-resized-width' ) || 'auto';
+ ts.resizable.setWidth( $table, tmp, true );
+ }
+ wo.resizable_vars.storedSizes = storedSizes = ( vars.useStorage ?
+ ts.storage( c.table, ts.css.resizableStorage ) :
+ [] ) || [];
+ ts.resizable.setWidths( c, wo, storedSizes );
+ ts.resizable.updateStoredSizes( c, wo );
+
+ wo.$resizable_container = $( '<div class="' + ts.css.resizableContainer + '">' )
+ .css({ top : marginTop })
+ .insertBefore( $table );
+ // add container
+ for ( column = 0; column < c.columns; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ tmp = ts.getColumnData( c.table, c.headers, column );
+ noResize = ts.getData( $header, tmp, 'resizable' ) === 'false';
+ if ( !noResize ) {
+ $( '<div class="' + ts.css.resizableHandle + '">' )
+ .appendTo( wo.$resizable_container )
+ .attr({
+ 'data-column' : column,
+ 'unselectable' : 'on'
+ })
+ .data( 'header', $header )
+ .bind( 'selectstart', false );
+ }
+ }
+ ts.resizable.bindings( c, wo );
+ },
+
+ updateStoredSizes : function( c, wo ) {
+ var column, $header,
+ len = c.columns,
+ vars = wo.resizable_vars;
+ vars.storedSizes = [];
+ for ( column = 0; column < len; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ vars.storedSizes[ column ] = $header.is(':visible') ? $header.width() : 0;
+ }
+ },
+
+ setWidth : function( $el, width, overflow ) {
+ // overflow tables need min & max width set as well
+ $el.css({
+ 'width' : width,
+ 'min-width' : overflow ? width : '',
+ 'max-width' : overflow ? width : ''
+ });
+ },
+
+ setWidths : function( c, wo, storedSizes ) {
+ var column, $temp,
+ vars = wo.resizable_vars,
+ $extra = $( c.namespace + '_extra_headers' ),
+ $col = c.$table.children( 'colgroup' ).children( 'col' );
+ storedSizes = storedSizes || vars.storedSizes || [];
+ // process only if table ID or url match
+ if ( storedSizes.length ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ // set saved resizable widths
+ ts.resizable.setWidth( c.$headerIndexed[ column ], storedSizes[ column ], vars.overflow );
+ if ( $extra.length ) {
+ // stickyHeaders needs to modify min & max width as well
+ $temp = $extra.eq( column ).add( $col.eq( column ) );
+ ts.resizable.setWidth( $temp, storedSizes[ column ], vars.overflow );
+ }
+ }
+ $temp = $( c.namespace + '_extra_table' );
+ if ( $temp.length && !ts.hasWidget( c.table, 'scroller' ) ) {
+ ts.resizable.setWidth( $temp, c.$table.outerWidth(), vars.overflow );
+ }
+ }
+ },
+
+ setHandlePosition : function( c, wo ) {
+ var startPosition,
+ tableHeight = c.$table.height(),
+ $handles = wo.$resizable_container.children(),
+ handleCenter = Math.floor( $handles.width() / 2 );
+
+ if ( ts.hasWidget( c.table, 'scroller' ) ) {
+ tableHeight = 0;
+ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
+ var $this = $(this);
+ // center table has a max-height set
+ tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
+ });
+ }
+
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
+ tableHeight -= c.$table.children('tfoot').height();
+ }
+ // subtract out table left position from resizable handles. Fixes #864
+ // jQuery v3.3.0+ appears to include the start position with the $header.position().left; see #1544
+ startPosition = parseFloat($.fn.jquery) >= 3.3 ? 0 : c.$table.position().left;
+ $handles.each( function() {
+ var $this = $(this),
+ column = parseInt( $this.attr( 'data-column' ), 10 ),
+ columns = c.columns - 1,
+ $header = $this.data( 'header' );
+ if ( !$header ) { return; } // see #859
+ if (
+ !$header.is(':visible') ||
+ ( !wo.resizable_addLastColumn && ts.resizable.checkVisibleColumns(c, column) )
+ ) {
+ $this.hide();
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
+ $this.css({
+ display: 'inline-block',
+ height : tableHeight,
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
+ });
+ }
+ });
+ },
+
+ // Fixes #1485
+ checkVisibleColumns: function( c, column ) {
+ var i,
+ len = 0;
+ for ( i = column + 1; i < c.columns; i++ ) {
+ len += c.$headerIndexed[i].is( ':visible' ) ? 1 : 0;
+ }
+ return len === 0;
+ },
+
+ // prevent text selection while dragging resize bar
+ toggleTextSelection : function( c, wo, toggle ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.resizable_vars.disabled = toggle;
+ $( 'body' ).toggleClass( ts.css.resizableNoSelect, toggle );
+ if ( toggle ) {
+ $( 'body' )
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart' + namespace, false );
+ } else {
+ $( 'body' )
+ .removeAttr( 'unselectable' )
+ .unbind( 'selectstart' + namespace );
+ }
+ },
+
+ bindings : function( c, wo ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.$resizable_container.children().bind( 'mousedown', function( event ) {
+ // save header cell and mouse position
+ var column,
+ vars = wo.resizable_vars,
+ $extras = $( c.namespace + '_extra_headers' ),
+ $header = $( event.target ).data( 'header' );
+
+ column = parseInt( $header.attr( 'data-column' ), 10 );
+ vars.$target = $header = $header.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.target = column;
+
+ // if table is not as wide as it's parent, then resize the table
+ vars.$next = event.shiftKey || wo.resizable_targetLast ?
+ $header.parent().children().not( '.resizable-false' ).filter( ':last' ) :
+ $header.nextAll( ':not(.resizable-false)' ).eq( 0 );
+
+ column = parseInt( vars.$next.attr( 'data-column' ), 10 );
+ vars.$next = vars.$next.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.next = column;
+
+ vars.mouseXPosition = event.pageX;
+ ts.resizable.updateStoredSizes( c, wo );
+ ts.resizable.toggleTextSelection(c, wo, true );
+ });
+
+ $( document )
+ .bind( 'mousemove' + namespace, function( event ) {
+ var vars = wo.resizable_vars;
+ // ignore mousemove if no mousedown
+ if ( !vars.disabled || vars.mouseXPosition === 0 || !vars.$target ) { return; }
+ if ( wo.resizable_throttle ) {
+ clearTimeout( vars.timer );
+ vars.timer = setTimeout( function() {
+ ts.resizable.mouseMove( c, wo, event );
+ }, isNaN( wo.resizable_throttle ) ? 5 : wo.resizable_throttle );
+ } else {
+ ts.resizable.mouseMove( c, wo, event );
+ }
+ })
+ .bind( 'mouseup' + namespace, function() {
+ if (!wo.resizable_vars.disabled) { return; }
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizable.stopResize( c, wo );
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // resizeEnd event triggered by scroller widget
+ $( window ).bind( 'resize' + namespace + ' resizeEnd' + namespace, function() {
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // right click to reset columns to default widths
+ c.$table
+ .bind( 'columnUpdate pagerComplete resizableUpdate '.split( ' ' ).join( namespace + ' ' ), function() {
+ ts.resizable.setHandlePosition( c, wo );
+ })
+ .bind( 'resizableReset' + namespace, function() {
+ ts.resizableReset( c.table );
+ })
+ .find( 'thead:first' )
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
+ .bind( 'contextmenu' + namespace, function() {
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
+ var allowClick = wo.resizable_vars.storedSizes.length === 0;
+ ts.resizableReset( c.table );
+ ts.resizable.setHandlePosition( c, wo );
+ wo.resizable_vars.storedSizes = [];
+ return allowClick;
+ });
+
+ },
+
+ mouseMove : function( c, wo, event ) {
+ if ( wo.resizable_vars.mouseXPosition === 0 || !wo.resizable_vars.$target ) { return; }
+ // resize columns
+ var column,
+ total = 0,
+ vars = wo.resizable_vars,
+ $next = vars.$next,
+ tar = vars.storedSizes[ vars.target ],
+ leftEdge = event.pageX - vars.mouseXPosition;
+ if ( vars.overflow ) {
+ if ( tar + leftEdge > 0 ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidth( vars.$target, vars.storedSizes[ vars.target ], true );
+ // update the entire table width
+ for ( column = 0; column < c.columns; column++ ) {
+ total += vars.storedSizes[ column ];
+ }
+ ts.resizable.setWidth( c.$table.add( $( c.namespace + '_extra_table' ) ), total );
+ }
+ if ( !$next.length ) {
+ // if expanding right-most column, scroll the wrapper
+ vars.$wrap[0].scrollLeft = c.$table.width();
+ }
+ } else if ( vars.fullWidth ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ vars.storedSizes[ vars.next ] -= leftEdge;
+ ts.resizable.setWidths( c, wo );
+ } else {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidths( c, wo );
+ }
+ vars.mouseXPosition = event.pageX;
+ // dynamically update sticky header widths
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ },
+
+ stopResize : function( c, wo ) {
+ var vars = wo.resizable_vars;
+ ts.resizable.updateStoredSizes( c, wo );
+ if ( vars.useStorage ) {
+ // save all column widths
+ ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
+ ts.storage( c.table, 'tablesorter-table-resized-width', c.$table.width() );
+ }
+ vars.mouseXPosition = 0;
+ vars.$target = vars.$next = null;
+ // will update stickyHeaders, just in case, see #912
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ c.$table.triggerHandler('resizableComplete');
+ }
+ };
+
+ // this widget saves the column widths if
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'resizable',
+ priority: 40,
+ options: {
+ resizable : true, // save column widths to storage
+ resizable_addLastColumn : false,
+ resizable_includeFooter: true,
+ resizable_widths : [],
+ resizable_throttle : false, // set to true (5ms) or any number 0-10 range
+ resizable_targetLast : false
+ },
+ init: function(table, thisWidget, c, wo) {
+ ts.resizable.init( c, wo );
+ },
+ format: function( table, c, wo ) {
+ ts.resizable.setHandlePosition( c, wo );
+ },
+ remove: function( table, c, wo, refreshing ) {
+ if (wo.$resizable_container) {
+ var namespace = c.namespace + 'tsresize';
+ c.$table.add( $( c.namespace + '_extra_table' ) )
+ .removeClass('hasResizable')
+ .children( 'thead' )
+ .unbind( 'contextmenu' + namespace );
+
+ wo.$resizable_container.remove();
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizableReset( table, refreshing );
+ $( document ).unbind( 'mousemove' + namespace + ' mouseup' + namespace );
+ }
+ }
+ });
+
+ ts.resizableReset = function( table, refreshing ) {
+ $( table ).each(function() {
+ var index, $t,
+ c = this.config,
+ wo = c && c.widgetOptions,
+ vars = wo.resizable_vars;
+ if ( table && c && c.$headerIndexed.length ) {
+ // restore the initial table width
+ if ( vars.overflow && vars.tableWidth ) {
+ ts.resizable.setWidth( c.$table, vars.tableWidth, true );
+ if ( vars.useStorage ) {
+ ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
+ }
+ }
+ for ( index = 0; index < c.columns; index++ ) {
+ $t = c.$headerIndexed[ index ];
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
+ ts.resizable.setWidth( $t, wo.resizable_widths[ index ], vars.overflow );
+ } else if ( !$t.hasClass( 'resizable-false' ) ) {
+ // don't clear the width of any column that is not resizable
+ ts.resizable.setWidth( $t, '', vars.overflow );
+ }
+ }
+
+ // reset stickyHeader widths
+ c.$table.triggerHandler( 'stickyHeadersUpdate' );
+ if ( ts.storage && !refreshing ) {
+ ts.storage( this, ts.css.resizableStorage, [] );
+ }
+ }
+ });
+ };
+
+})( jQuery, window );
+
+/*! Widget: saveSort - updated 2018-03-19 (v2.30.1) *//*
+* Requires tablesorter v2.16+
+* by Rob Garrison
+*/
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ function getStoredSortList(c) {
+ var stored = ts.storage( c.table, 'tablesorter-savesort' );
+ return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : [];
+ }
+
+ function sortListChanged(c, sortList) {
+ return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
+ }
+
+ // this widget saves the last sort only if the
+ // saveSort widget option is true AND the
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'saveSort',
+ priority: 20,
+ options: {
+ saveSort : true
+ },
+ init: function(table, thisWidget, c, wo) {
+ // run widget format before all other widgets are applied to the table
+ thisWidget.format(table, c, wo, true);
+ },
+ format: function(table, c, wo, init) {
+ var time,
+ $table = c.$table,
+ saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
+ sortList = { 'sortList' : c.sortList },
+ debug = ts.debug(c, 'saveSort');
+ if (debug) {
+ time = new Date();
+ }
+ if ($table.hasClass('hasSaveSort')) {
+ if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
+ ts.storage( table, 'tablesorter-savesort', sortList );
+ if (debug) {
+ console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
+ }
+ }
+ } else {
+ // set table sort on initial run of the widget
+ $table.addClass('hasSaveSort');
+ sortList = '';
+ // get data
+ if (ts.storage) {
+ sortList = getStoredSortList(c);
+ if (debug) {
+ console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
+ }
+ $table.bind('saveSortReset', function(event) {
+ event.stopPropagation();
+ ts.storage( table, 'tablesorter-savesort', '' );
+ });
+ }
+ // init is true when widget init is run, this will run this widget before all other widgets have initialized
+ // this method allows using this widget in the original tablesorter plugin; but then it will run all widgets twice.
+ if (init && sortList && sortList.length > 0) {
+ c.sortList = sortList;
+ } else if (table.hasInitialized && sortList && sortList.length > 0) {
+ // update sort change
+ if (sortListChanged(c, sortList)) {
+ ts.sortOn(c, sortList);
+ }
+ }
+ }
+ },
+ remove: function(table, c) {
+ c.$table.removeClass('hasSaveSort');
+ // clear storage
+ if (ts.storage) { ts.storage( table, 'tablesorter-savesort', '' ); }
+ }
+ });
+
+})(jQuery);
+return jQuery.tablesorter;}));
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.combined.min.js b/web/_static/tablesorter/js/jquery.tablesorter.combined.min.js
new file mode 100644
index 0000000..427e328
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.combined.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! tablesorter (FORK) - updated 2020-03-03 (v2.31.3)*/
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(R){"use strict";var T=R.tablesorter={version:"2.31.3",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(t,r){if(t&&t.tHead&&0!==t.tBodies.length&&!0!==t.hasInitialized){var e,a="",s=R(t),i=R.metadata;t.hasInitialized=!1,t.isProcessing=!0,t.config=r,R.data(t,"tablesorter",r),T.debug(r,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+T.version),R.data(t,"startoveralltimer",new Date)),r.supportsDataObject=((e=R.fn.jquery.split("."))[0]=parseInt(e[0],10),1<e[0]||1===e[0]&&4<=parseInt(e[1],10)),r.emptyTo=r.emptyTo.toLowerCase(),r.stringTo=r.stringTo.toLowerCase(),r.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(s.attr("class"))||(a=""!==r.theme?" tablesorter-"+r.theme:""),r.namespace?r.namespace="."+r.namespace.replace(T.regex.nonWord,""):r.namespace=".tablesorter"+Math.random().toString(16).slice(2),r.table=t,r.$table=s.addClass(T.css.table+" "+r.tableClass+a+" "+r.namespace.slice(1)).attr("role","grid"),r.$headers=s.find(r.selectorHeaders),r.$table.children().children("tr").attr("role","row"),r.$tbodies=s.children("tbody:not(."+r.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),r.$table.children("caption").length&&((a=r.$table.children("caption")[0]).id||(a.id=r.namespace.slice(1)+"caption"),r.$table.attr("aria-labelledby",a.id)),r.widgetInit={},r.textExtraction=r.$table.attr("data-text-extraction")||r.textExtraction||"basic",T.buildHeaders(r),T.fixColumnWidth(t),T.addWidgetFromClass(t),T.applyWidgetOptions(t),T.setupParsers(r),r.totalRows=0,r.debug&&T.validateOptions(r),r.delayInit||T.buildCache(r),T.bindEvents(t,r.$headers,!0),T.bindMethods(r),r.supportsDataObject&&void 0!==s.data().sortlist?r.sortList=s.data().sortlist:i&&s.metadata()&&s.metadata().sortlist&&(r.sortList=s.metadata().sortlist),T.applyWidget(t,!0),0<r.sortList.length?(r.last.sortList=r.sortList,T.sortOn(r,r.sortList,{},!r.initWidgets)):(T.setHeadersCss(r),r.initWidgets&&T.applyWidget(t,!1)),r.showProcessing&&s.unbind("sortBegin"+r.namespace+" sortEnd"+r.namespace).bind("sortBegin"+r.namespace+" sortEnd"+r.namespace,function(e){clearTimeout(r.timerProcessing),T.isProcessing(t),"sortBegin"===e.type&&(r.timerProcessing=setTimeout(function(){T.isProcessing(t,!0)},500))}),t.hasInitialized=!0,t.isProcessing=!1,T.debug(r,"core")&&(console.log("Overall initialization time:"+T.benchmark(R.data(t,"startoveralltimer"))),T.debug(r,"core")&&console.groupEnd&&console.groupEnd()),s.triggerHandler("tablesorter-initialized",t),"function"==typeof r.initialized&&r.initialized(t)}else T.debug(r,"core")&&(t.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody",t))},bindMethods:function(r){var e=r.$table,t=r.namespace,a="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(t+" ");e.unbind(a.replace(T.regex.spaces," ")).bind("sortReset"+t,function(e,t){e.stopPropagation(),T.sortReset(this.config,function(e){e.isApplyingWidgets?setTimeout(function(){T.applyWidget(e,"",t)},100):T.applyWidget(e,"",t)})}).bind("updateAll"+t,function(e,t,r){e.stopPropagation(),T.updateAll(this.config,t,r)}).bind("update"+t+" updateRows"+t,function(e,t,r){e.stopPropagation(),T.update(this.config,t,r)}).bind("updateHeaders"+t,function(e,t){e.stopPropagation(),T.updateHeaders(this.config,t)}).bind("updateCell"+t,function(e,t,r,a){e.stopPropagation(),T.updateCell(this.config,t,r,a)}).bind("addRows"+t,function(e,t,r,a){e.stopPropagation(),T.addRows(this.config,t,r,a)}).bind("updateComplete"+t,function(){this.isUpdating=!1}).bind("sorton"+t,function(e,t,r,a){e.stopPropagation(),T.sortOn(this.config,t,r,a)}).bind("appendCache"+t,function(e,t,r){e.stopPropagation(),T.appendCache(this.config,r),R.isFunction(t)&&t(this)}).bind("updateCache"+t,function(e,t,r){e.stopPropagation(),T.updateCache(this.config,t,r)}).bind("applyWidgetId"+t,function(e,t){e.stopPropagation(),T.applyWidgetId(this,t)}).bind("applyWidgets"+t,function(e,t){e.stopPropagation(),T.applyWidget(this,!1,t)}).bind("refreshWidgets"+t,function(e,t,r){e.stopPropagation(),T.refreshWidgets(this,t,r)}).bind("removeWidget"+t,function(e,t,r){e.stopPropagation(),T.removeWidget(this,t,r)}).bind("destroy"+t,function(e,t,r){e.stopPropagation(),T.destroy(this,t,r)}).bind("resetToLoadState"+t,function(e){e.stopPropagation(),T.removeWidget(this,!0,!1);var t=R.extend(!0,{},r.originalSettings);(r=R.extend(!0,{},T.defaults,t)).originalSettings=t,this.hasInitialized=!1,T.setup(this,r)})},bindEvents:function(e,t,r){var a,n=(e=R(e)[0]).config,s=n.namespace,l=null;!0!==r&&(t.addClass(s.slice(1)+"_extra_headers"),(a=T.getClosest(t,"table")).length&&"TABLE"===a[0].nodeName&&a[0]!==e&&R(a[0]).addClass(s.slice(1)+"_extra_table")),a=(n.pointerDown+" "+n.pointerUp+" "+n.pointerClick+" sort keyup ").replace(T.regex.spaces," ").split(" ").join(s+" "),t.find(n.selectorSort).add(t.filter(n.selectorSort)).unbind(a).bind(a,function(e,t){var r,a,s,i=R(e.target),o=" "+e.type+" ";if(!(1!==(e.which||e.button)&&!o.match(" "+n.pointerClick+" | sort | keyup ")||" keyup "===o&&e.which!==T.keyCodes.enter||o.match(" "+n.pointerClick+" ")&&void 0!==e.which||o.match(" "+n.pointerUp+" ")&&l!==e.target&&!0!==t)){if(o.match(" "+n.pointerDown+" "))return l=e.target,void("1"===(s=i.jquery.split("."))[0]&&s[1]<4&&e.preventDefault());if(l=null,r=T.getClosest(R(this),"."+T.css.header),T.regex.formElements.test(e.target.nodeName)||i.hasClass(n.cssNoSort)||0<i.parents("."+n.cssNoSort).length||r.hasClass("sorter-false")||0<i.parents("button").length)return!n.cancelSelection;n.delayInit&&T.isEmptyObject(n.cache)&&T.buildCache(n),n.last.clickedIndex=r.attr("data-column")||r.index(),(a=n.$headerIndexed[n.last.clickedIndex][0])&&!a.sortDisabled&&T.initSort(n,a,e)}}),n.cancelSelection&&t.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(l){var e,c,t,r;for(l.headerList=[],l.headerContent=[],l.sortVars=[],T.debug(l,"core")&&(t=new Date),l.columns=T.computeColumnIndex(l.$table.children("thead, tfoot").children("tr")),c=l.cssIcon?'<i class="'+(l.cssIcon===T.css.icon?T.css.icon:l.cssIcon+" "+T.css.icon)+'"></i>':"",l.$headers=R(R.map(l.$table.find(l.selectorHeaders),function(e,t){var r,a,s,i,o,n=R(e);if(!T.getClosest(n,"tr").hasClass(l.cssIgnoreRow))return/(th|td)/i.test(e.nodeName)||(o=T.getClosest(n,"th, td"),n.attr("data-column",o.attr("data-column"))),r=T.getColumnData(l.table,l.headers,t,!0),l.headerContent[t]=n.html(),""===l.headerTemplate||n.find("."+T.css.headerIn).length||(i=l.headerTemplate.replace(T.regex.templateContent,n.html()).replace(T.regex.templateIcon,n.find("."+T.css.icon).length?"":c),l.onRenderTemplate&&(a=l.onRenderTemplate.apply(n,[t,i]))&&"string"==typeof a&&(i=a),n.html('<div class="'+T.css.headerIn+'">'+i+"</div>")),l.onRenderHeader&&l.onRenderHeader.apply(n,[t,l,l.$table]),s=parseInt(n.attr("data-column"),10),e.column=s,o=T.getOrder(T.getData(n,r,"sortInitialOrder")||l.sortInitialOrder),l.sortVars[s]={count:-1,order:o?l.sortReset?[1,0,2]:[1,0]:l.sortReset?[0,1,2]:[0,1],lockedOrder:!1,sortedBy:""},void 0!==(o=T.getData(n,r,"lockedOrder")||!1)&&!1!==o&&(l.sortVars[s].lockedOrder=!0,l.sortVars[s].order=T.getOrder(o)?[1,1]:[0,0]),l.headerList[t]=e,n.addClass(T.css.header+" "+l.cssHeader),T.getClosest(n,"tr").addClass(T.css.headerRow+" "+l.cssHeaderRow).attr("role","row"),l.tabIndex&&n.attr("tabindex",0),e})),l.$headerIndexed=[],r=0;r<l.columns;r++)T.isEmptyObject(l.sortVars[r])&&(l.sortVars[r]={}),e=l.$headers.filter('[data-column="'+r+'"]'),l.$headerIndexed[r]=e.length?e.not(".sorter-false").length?e.not(".sorter-false").filter(":last"):e.filter(":last"):R();l.$table.find(l.selectorHeaders).attr({scope:"col",role:"columnheader"}),T.updateHeader(l),T.debug(l,"core")&&(console.log("Built headers:"+T.benchmark(t)),console.log(l.$headers))},addInstanceMethods:function(e){R.extend(T.instanceMethods,e)},setupParsers:function(e,t){var r,a,s,i,o,n,l,c,d,f,u,g,p,h,m=e.table,b=0,y=T.debug(e,"core"),v={};if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),0===(h=(p=void 0===t?e.$tbodies:t).length))return y?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(y&&(g=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),a={extractors:[],parsers:[]};b<h;){if((r=p[b].rows).length)for(o=0,i=e.columns,n=0;n<i;n++){if((l=e.$headerIndexed[o])&&l.length&&(c=T.getColumnData(m,e.headers,o),u=T.getParserById(T.getData(l,c,"extractor")),f=T.getParserById(T.getData(l,c,"sorter")),d="false"===T.getData(l,c,"parser"),e.empties[o]=(T.getData(l,c,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[o]=(T.getData(l,c,"string")||e.stringTo||"max").toLowerCase(),d&&(f=T.getParserById("no-parser")),u=u||!1,f=f||T.detectParserForColumn(e,r,-1,o),y&&(v["("+o+") "+l.text()]={parser:f.id,extractor:u?u.id:"none",string:e.strings[o],empty:e.empties[o]}),a.parsers[o]=f,a.extractors[o]=u,0<(s=l[0].colSpan-1)))for(o+=s,i+=s;0<s+1;)a.parsers[o-s]=f,a.extractors[o-s]=u,s--;o++}b+=a.parsers.length?h:1}y&&(T.isEmptyObject(v)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](v),console.log("Completed detecting parsers"+T.benchmark(g)),console.groupEnd&&console.groupEnd()),e.parsers=a.parsers,e.extractors=a.extractors},addParser:function(e){var t,r=T.parsers.length,a=!0;for(t=0;t<r;t++)T.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(a=!1);a&&(T.parsers[T.parsers.length]=e)},getParserById:function(e){if("false"==e)return!1;var t,r=T.parsers.length;for(t=0;t<r;t++)if(T.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return T.parsers[t];return!1},detectParserForColumn:function(e,t,r,a){for(var s,i,o,n=T.parsers.length,l=!1,c="",d=T.debug(e,"core"),f=!0;""===c&&f;)(o=t[++r])&&r<50?o.className.indexOf(T.cssIgnoreRow)<0&&(l=t[r].cells[a],c=T.getElementText(e,l,a),i=R(l),d&&console.log("Checking if value was empty on row "+r+", column: "+a+': "'+c+'"')):f=!1;for(;0<=--n;)if((s=T.parsers[n])&&"text"!==s.id&&s.is&&s.is(c,e.table,l,i))return s;return T.getParserById("text")},getElementText:function(e,t,r){if(!t)return"";var a,s=e.textExtraction||"",i=t.jquery?t:R(t);return"string"==typeof s?"basic"===s&&void 0!==(a=i.attr(e.textAttribute))?R.trim(a):R.trim(t.textContent||i.text()):"function"==typeof s?R.trim(s(i[0],e.table,r)):"function"==typeof(a=T.getColumnData(e.table,s,r))?R.trim(a(i[0],e.table,r)):R.trim(i[0].textContent||i.text())},getParsedText:function(e,t,r,a){void 0===a&&(a=T.getElementText(e,t,r));var s=""+a,i=e.parsers[r],o=e.extractors[r];return i&&(o&&"function"==typeof o.format&&(a=o.format(a,e.table,t,r)),s="no-parser"===i.id?"":i.format(""+a,e.table,t,r),e.ignoreCase&&"string"==typeof s&&(s=s.toLowerCase())),s},buildCache:function(e,t,r){var a,s,i,o,n,l,c,d,f,u,g,p,h,m,b,y,v,w,x,C,_,$,S=e.table,z=e.parsers,F=T.debug(e,"core");if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),c=void 0===r?e.$tbodies:r,e.cache={},e.totalRows=0,!z)return F?console.warn("Warning: *Empty table!* Not building a cache"):"";for(F&&(p=new Date),e.showProcessing&&T.isProcessing(S,!0),l=0;l<c.length;l++){for(y=[],a=e.cache[l]={normalized:[]},h=c[l]&&c[l].rows.length||0,o=0;o<h;++o)if(m={child:[],raw:[]},f=[],!(d=R(c[l].rows[o])).hasClass(e.selectorRemove.slice(1)))if(d.hasClass(e.cssChildRow)&&0!==o)for(_=a.normalized.length-1,(b=a.normalized[_][e.columns]).$row=b.$row.add(d),d.prev().hasClass(e.cssChildRow)||d.prev().addClass(T.css.cssHasChild),u=d.children("th, td"),_=b.child.length,b.child[_]=[],w=0,C=e.columns,n=0;n<C;n++)(g=u[n])&&(b.child[_][n]=T.getParsedText(e,g,n),0<(v=u[n].colSpan-1)&&(w+=v,C+=v)),w++;else{for(m.$row=d,m.order=o,w=0,C=e.columns,n=0;n<C;++n){if((g=d[0].cells[n])&&w<e.columns&&(!(x=void 0!==z[w])&&F&&console.warn("No parser found for row: "+o+", column: "+n+'; cell containing: "'+R(g).text()+'"; does it have a header?'),s=T.getElementText(e,g,w),m.raw[w]=s,i=T.getParsedText(e,g,w,s),f[w]=i,x&&"numeric"===(z[w].type||"").toLowerCase()&&(y[w]=Math.max(Math.abs(i)||0,y[w]||0)),0<(v=g.colSpan-1))){for($=0;$<=v;)i=e.duplicateSpan||0===$?i:"string"!=typeof e.textExtraction&&T.getElementText(e,g,w+$)||"",m.raw[w+$]=i,f[w+$]=i,$++;w+=v,C+=v}w++}f[e.columns]=m,a.normalized[a.normalized.length]=f}a.colMax=y,e.totalRows+=a.normalized.length}if(e.showProcessing&&T.isProcessing(S),F){for(_=Math.min(5,e.cache[0].normalized.length),console[console.group?"group":"log"]("Building cache for "+e.totalRows+" rows (showing "+_+" rows in log) and "+e.columns+" columns"+T.benchmark(p)),s={},n=0;n<e.columns;n++)for(w=0;w<_;w++)s["row: "+w]||(s["row: "+w]={}),s["row: "+w][e.$headerIndexed[n].text()]=e.cache[0].normalized[w][n];console[console.table?"table":"log"](s),console.groupEnd&&console.groupEnd()}R.isFunction(t)&&t(S)},getColumnText:function(e,t,r,a){var s,i,o,n,l,c,d,f,u,g,p="function"==typeof r,h="all"===t,m={raw:[],parsed:[],$cell:[]},b=(e=R(e)[0]).config;if(!T.isEmptyObject(b)){for(l=b.$tbodies.length,s=0;s<l;s++)for(c=(o=b.cache[s].normalized).length,i=0;i<c;i++)n=o[i],a&&!n[b.columns].$row.is(a)||(g=!0,f=h?n.slice(0,b.columns):n[t],n=n[b.columns],d=h?n.raw:n.raw[t],u=h?n.$row.children():n.$row.children().eq(t),p&&(g=r({tbodyIndex:s,rowIndex:i,parsed:f,raw:d,$row:n.$row,$cell:u})),!1!==g&&(m.parsed[m.parsed.length]=f,m.raw[m.raw.length]=d,m.$cell[m.$cell.length]=u));return m}T.debug(b,"core")&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(i){function e(e,t){e.removeClass(o).addClass(n[t]).attr("aria-sort",c[t]).find("."+T.css.icon).removeClass(l[2]).addClass(l[t])}var t,r,a=i.sortList,s=a.length,o=T.css.sortNone+" "+i.cssNone,n=[T.css.sortAsc+" "+i.cssAsc,T.css.sortDesc+" "+i.cssDesc],l=[i.cssIconAsc,i.cssIconDesc,i.cssIconNone],c=["ascending","descending"],d=i.$table.find("tfoot tr").children("td, th").add(R(i.namespace+"_extra_headers")).removeClass(n.join(" ")),f=i.$headers.add(R("thead "+i.namespace+"_extra_headers")).removeClass(n.join(" ")).addClass(o).attr("aria-sort","none").find("."+T.css.icon).removeClass(l.join(" ")).end();for(f.not(".sorter-false").find("."+T.css.icon).addClass(l[2]),i.cssIconDisabled&&f.filter(".sorter-false").find("."+T.css.icon).addClass(i.cssIconDisabled),t=0;t<s;t++)if(2!==a[t][1]){if((f=(f=i.$headers.filter(function(e){for(var t=!0,r=i.$headers.eq(e),a=parseInt(r.attr("data-column"),10),s=a+T.getClosest(r,"th, td")[0].colSpan;a<s;a++)t=!!t&&(t||-1<T.isValueInArray(a,i.sortList));return t})).not(".sorter-false").filter('[data-column="'+a[t][0]+'"]'+(1===s?":last":""))).length)for(r=0;r<f.length;r++)f[r].sortDisabled||e(f.eq(r),a[t][1]);d.length&&e(d.filter('[data-column="'+a[t][0]+'"]'),a[t][1])}for(s=i.$headers.length,t=0;t<s;t++)T.setColumnAriaLabel(i,i.$headers.eq(t))},getClosest:function(e,t){return R.fn.closest?e.closest(t):e.is(t)?e:e.parents(t).filter(":first")},setColumnAriaLabel:function(e,t,r){if(t.length){var a=parseInt(t.attr("data-column"),10),s=e.sortVars[a],i=t.hasClass(T.css.sortAsc)?"sortAsc":t.hasClass(T.css.sortDesc)?"sortDesc":"sortNone",o=R.trim(t.text())+": "+T.language[i];t.hasClass("sorter-false")||!1===r?o+=T.language.sortDisabled:(i=(s.count+1)%s.order.length,r=s.order[i],o+=T.language[0===r?"nextAsc":1===r?"nextDesc":"nextNone"]),t.attr("aria-label",o),s.sortedBy?t.attr("data-sortedBy",s.sortedBy):t.removeAttr("data-sortedBy")}},updateHeader:function(e){var t,r,a,s,i=e.table,o=e.$headers.length;for(t=0;t<o;t++)a=e.$headers.eq(t),s=T.getColumnData(i,e.headers,t,!0),r="false"===T.getData(a,s,"sorter")||"false"===T.getData(a,s,"parser"),T.setColumnSort(e,a,r)},setColumnSort:function(e,t,r){var a=e.table.id;t[0].sortDisabled=r,t[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.tabIndex&&(r?t.removeAttr("tabindex"):t.attr("tabindex","0")),a&&(r?t.removeAttr("aria-controls"):t.attr("aria-controls",a))},updateHeaderSortCount:function(e,t){var r,a,s,i,o,n,l,c,d=t||e.sortList,f=d.length;for(e.sortList=[],i=0;i<f;i++)if(l=d[i],(r=parseInt(l[0],10))<e.columns){switch(e.sortVars[r].order||(c=T.getOrder(e.sortInitialOrder)?e.sortReset?[1,0,2]:[1,0]:e.sortReset?[0,1,2]:[0,1],e.sortVars[r].order=c,e.sortVars[r].count=0),c=e.sortVars[r].order,a=(a=(""+l[1]).match(/^(1|d|s|o|n)/))?a[0]:""){case"1":case"d":a=1;break;case"s":a=o||0;break;case"o":a=0===(n=c[(o||0)%c.length])?1:1===n?0:2;break;case"n":a=c[++e.sortVars[r].count%c.length];break;default:a=0}o=0===i?a:o,s=[r,parseInt(a,10)||0],e.sortList[e.sortList.length]=s,a=R.inArray(s[1],c),e.sortVars[r].count=0<=a?a:s[1]%c.length}},updateAll:function(e,t,r){var a=e.table;a.isUpdating=!0,T.refreshWidgets(a,!0,!0),T.buildHeaders(e),T.bindEvents(a,e.$headers,!0),T.bindMethods(e),T.commonUpdate(e,t,r)},update:function(e,t,r){e.table.isUpdating=!0,T.updateHeader(e),T.commonUpdate(e,t,r)},updateHeaders:function(e,t){e.table.isUpdating=!0,T.buildHeaders(e),T.bindEvents(e.table,e.$headers,!0),T.resortComplete(e,t)},updateCell:function(e,t,r,a){if(R(t).closest("tr").hasClass(e.cssChildRow))console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');else{if(T.isEmptyObject(e.cache))return T.updateHeader(e),void T.commonUpdate(e,r,a);e.table.isUpdating=!0,e.$table.find(e.selectorRemove).remove();var s,i,o,n,l,c,d=e.$tbodies,f=R(t),u=d.index(T.getClosest(f,"tbody")),g=e.cache[u],p=T.getClosest(f,"tr");if(t=f[0],d.length&&0<=u){if(o=d.eq(u).find("tr").not("."+e.cssChildRow).index(p),l=g.normalized[o],(c=p[0].cells.length)!==e.columns)for(s=!1,i=n=0;i<c;i++)s||p[0].cells[i]===t?s=!0:n+=p[0].cells[i].colSpan;else n=f.index();s=T.getElementText(e,t,n),l[e.columns].raw[n]=s,s=T.getParsedText(e,t,n,s),l[n]=s,"numeric"===(e.parsers[n].type||"").toLowerCase()&&(g.colMax[n]=Math.max(Math.abs(s)||0,g.colMax[n]||0)),!1!==(s="undefined"!==r?r:e.resort)?T.checkResort(e,s,a):T.resortComplete(e,a)}else T.debug(e,"core")&&console.error("updateCell aborted, tbody missing or not within the indicated table"),e.table.isUpdating=!1}},addRows:function(e,t,r,a){var s,i,o,n,l,c,d,f,u,g,p,h,m,b="string"==typeof t&&1===e.$tbodies.length&&/<tr/.test(t||""),y=e.table;if(b)t=R(t),e.$tbodies.append(t);else if(!(t&&t instanceof R&&T.getClosest(t,"table")[0]===e.table))return T.debug(e,"core")&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(y.isUpdating=!0,T.isEmptyObject(e.cache))T.updateHeader(e),T.commonUpdate(e,r,a);else{for(l=t.filter("tr").attr("role","row").length,o=e.$tbodies.index(t.parents("tbody").filter(":first")),e.parsers&&e.parsers.length||T.setupParsers(e),n=0;n<l;n++){for(u=0,d=t[n].cells.length,f=e.cache[o].normalized.length,p=[],g={child:[],raw:[],$row:t.eq(n),order:f},c=0;c<d;c++)h=t[n].cells[c],s=T.getElementText(e,h,u),g.raw[u]=s,i=T.getParsedText(e,h,u,s),p[u]=i,"numeric"===(e.parsers[u].type||"").toLowerCase()&&(e.cache[o].colMax[u]=Math.max(Math.abs(i)||0,e.cache[o].colMax[u]||0)),0<(m=h.colSpan-1)&&(u+=m),u++;p[e.columns]=g,e.cache[o].normalized[f]=p}T.checkResort(e,r,a)}},updateCache:function(e,t,r){e.parsers&&e.parsers.length||T.setupParsers(e,r),T.buildCache(e,t,r)},appendCache:function(e,t){var r,a,s,i,o,n,l,c=e.table,d=e.$tbodies,f=[],u=e.cache;if(T.isEmptyObject(u))return e.appender?e.appender(c,f):c.isUpdating?e.$table.triggerHandler("updateComplete",c):"";for(T.debug(e,"core")&&(l=new Date),n=0;n<d.length;n++)if((s=d.eq(n)).length){for(i=T.processTbody(c,s,!0),a=(r=u[n].normalized).length,o=0;o<a;o++)f[f.length]=r[o][e.columns].$row,e.appender&&(!e.pager||e.pager.removeRows||e.pager.ajax)||i.append(r[o][e.columns].$row);T.processTbody(c,i,!1)}e.appender&&e.appender(c,f),T.debug(e,"core")&&console.log("Rebuilt table"+T.benchmark(l)),t||e.appender||T.applyWidget(c),c.isUpdating&&e.$table.triggerHandler("updateComplete",c)},commonUpdate:function(e,t,r){e.$table.find(e.selectorRemove).remove(),T.setupParsers(e),T.buildCache(e),T.checkResort(e,t,r)},initSort:function(t,e,r){if(t.table.isUpdating)return setTimeout(function(){T.initSort(t,e,r)},50);var a,s,i,o,n,l,c,d=!r[t.sortMultiSortKey],f=t.table,u=t.$headers.length,g=T.getClosest(R(e),"th, td"),p=parseInt(g.attr("data-column"),10),h="mouseup"===r.type?"user":r.type,m=t.sortVars[p].order;if(g=g[0],t.$table.triggerHandler("sortStart",f),l=(t.sortVars[p].count+1)%m.length,t.sortVars[p].count=r[t.sortResetKey]?2:l,t.sortRestart)for(i=0;i<u;i++)c=t.$headers.eq(i),p!==(l=parseInt(c.attr("data-column"),10))&&(d||c.hasClass(T.css.sortNone))&&(t.sortVars[l].count=-1);if(d){if(R.each(t.sortVars,function(e){t.sortVars[e].sortedBy=""}),t.sortList=[],t.last.sortList=[],null!==t.sortForce)for(a=t.sortForce,s=0;s<a.length;s++)a[s][0]!==p&&(t.sortList[t.sortList.length]=a[s],t.sortVars[a[s][0]].sortedBy="sortForce");if((o=m[t.sortVars[p].count])<2&&(t.sortList[t.sortList.length]=[p,o],t.sortVars[p].sortedBy=h,1<g.colSpan))for(s=1;s<g.colSpan;s++)t.sortList[t.sortList.length]=[p+s,o],t.sortVars[p+s].count=R.inArray(o,m),t.sortVars[p+s].sortedBy=h}else if(t.sortList=R.extend([],t.last.sortList),0<=T.isValueInArray(p,t.sortList))for(t.sortVars[p].sortedBy=h,s=0;s<t.sortList.length;s++)(l=t.sortList[s])[0]===p&&(l[1]=m[t.sortVars[p].count],2===l[1]&&(t.sortList.splice(s,1),t.sortVars[p].count=-1));else if(o=m[t.sortVars[p].count],t.sortVars[p].sortedBy=h,o<2&&(t.sortList[t.sortList.length]=[p,o],1<g.colSpan))for(s=1;s<g.colSpan;s++)t.sortList[t.sortList.length]=[p+s,o],t.sortVars[p+s].count=R.inArray(o,m),t.sortVars[p+s].sortedBy=h;if(t.last.sortList=R.extend([],t.sortList),t.sortList.length&&t.sortAppend&&(a=R.isArray(t.sortAppend)?t.sortAppend:t.sortAppend[t.sortList[0][0]],!T.isEmptyObject(a)))for(s=0;s<a.length;s++)if(a[s][0]!==p&&T.isValueInArray(a[s][0],t.sortList)<0){if(n=(""+(o=a[s][1])).match(/^(a|d|s|o|n)/))switch(l=t.sortList[0][1],n[0]){case"d":o=1;break;case"s":o=l;break;case"o":o=0===l?1:0;break;case"n":o=(l+1)%m.length;break;default:o=0}t.sortList[t.sortList.length]=[a[s][0],o],t.sortVars[a[s][0]].sortedBy="sortAppend"}t.$table.triggerHandler("sortBegin",f),setTimeout(function(){T.setHeadersCss(t),T.multisort(t),T.appendCache(t),t.$table.triggerHandler("sortBeforeEnd",f),t.$table.triggerHandler("sortEnd",f)},1)},multisort:function(c){var e,t,d,r,f=c.table,u=[],g=0,p=c.textSorter||"",h=c.sortList,m=h.length,a=c.$tbodies.length;if(!c.serverSideSorting&&!T.isEmptyObject(c.cache)){if(T.debug(c,"core")&&(t=new Date),"object"==typeof p)for(d=c.columns;d--;)"function"==typeof(r=T.getColumnData(f,p,d))&&(u[d]=r);for(e=0;e<a;e++)d=c.cache[e].colMax,c.cache[e].normalized.sort(function(e,t){var r,a,s,i,o,n,l;for(r=0;r<m;r++){if(s=h[r][0],i=h[r][1],g=0===i,c.sortStable&&e[s]===t[s]&&1===m)return e[c.columns].order-t[c.columns].order;if(o=(a=/n/i.test(T.getSortType(c.parsers,s)))&&c.strings[s]?(a="boolean"==typeof T.string[c.strings[s]]?(g?1:-1)*(T.string[c.strings[s]]?-1:1):c.strings[s]&&T.string[c.strings[s]]||0,c.numberSorter?c.numberSorter(e[s],t[s],g,d[s],f):T["sortNumeric"+(g?"Asc":"Desc")](e[s],t[s],a,d[s],s,c)):(n=g?e:t,l=g?t:e,"function"==typeof p?p(n[s],l[s],g,s,f):"function"==typeof u[s]?u[s](n[s],l[s],g,s,f):T["sortNatural"+(g?"Asc":"Desc")](e[s]||"",t[s]||"",s,c)))return o}return e[c.columns].order-t[c.columns].order});T.debug(c,"core")&&console.log("Applying sort "+h.toString()+T.benchmark(t))}},resortComplete:function(e,t){e.table.isUpdating&&e.$table.triggerHandler("updateComplete",e.table),R.isFunction(t)&&t(e.table)},checkResort:function(e,t,r){var a=R.isArray(t)?t:e.sortList;!1===(void 0===t?e.resort:t)||e.serverSideSorting||e.table.isProcessing?(T.resortComplete(e,r),T.applyWidget(e.table,!1)):a.length?T.sortOn(e,a,function(){T.resortComplete(e,r)},!0):T.sortReset(e,function(){T.resortComplete(e,r),T.applyWidget(e.table,!1)})},sortOn:function(e,t,r,a){var s,i=e.table;for(e.$table.triggerHandler("sortStart",i),s=0;s<e.columns;s++)e.sortVars[s].sortedBy=-1<T.isValueInArray(s,t)?"sorton":"";T.updateHeaderSortCount(e,t),T.setHeadersCss(e),e.delayInit&&T.isEmptyObject(e.cache)&&T.buildCache(e),e.$table.triggerHandler("sortBegin",i),T.multisort(e),T.appendCache(e,a),e.$table.triggerHandler("sortBeforeEnd",i),e.$table.triggerHandler("sortEnd",i),T.applyWidget(i),R.isFunction(r)&&r(i)},sortReset:function(e,t){var r;for(e.sortList=[],r=0;r<e.columns;r++)e.sortVars[r].count=-1,e.sortVars[r].sortedBy="";T.setHeadersCss(e),T.multisort(e),T.appendCache(e),R.isFunction(t)&&t(e.table)},getSortType:function(e,t){return e&&e[t]&&e[t].type||""},getOrder:function(e){return/^d/i.test(e)||1===e},sortNatural:function(e,t){if(e===t)return 0;e=(e||"").toString(),t=(t||"").toString();var r,a,s,i,o,n,l=T.regex;if(l.hex.test(t)){if((r=parseInt(e.match(l.hex),16))<(a=parseInt(t.match(l.hex),16)))return-1;if(a<r)return 1}for(r=e.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),a=t.replace(l.chunk,"\\0$1\\0").replace(l.chunks,"").split("\\0"),n=Math.max(r.length,a.length),o=0;o<n;o++){if(s=isNaN(r[o])?r[o]||0:parseFloat(r[o])||0,i=isNaN(a[o])?a[o]||0:parseFloat(a[o])||0,isNaN(s)!==isNaN(i))return isNaN(s)?1:-1;if(typeof s!=typeof i&&(s+="",i+=""),s<i)return-1;if(i<s)return 1}return 0},sortNaturalAsc:function(e,t,r,a){if(e===t)return 0;var s=T.string[a.empties[r]||a.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:-s||-1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:s||1:T.sortNatural(e,t)},sortNaturalDesc:function(e,t,r,a){if(e===t)return 0;var s=T.string[a.empties[r]||a.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:s||1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:-s||-1:T.sortNatural(t,e)},sortText:function(e,t){return t<e?1:e<t?-1:0},getTextValue:function(e,t,r){if(r){var a,s=e?e.length:0,i=r+t;for(a=0;a<s;a++)i+=e.charCodeAt(a);return t*i}return 0},sortNumericAsc:function(e,t,r,a,s,i){if(e===t)return 0;var o=T.string[i.empties[s]||i.emptyTo];return""===e&&0!==o?"boolean"==typeof o?o?-1:1:-o||-1:""===t&&0!==o?"boolean"==typeof o?o?1:-1:o||1:(isNaN(e)&&(e=T.getTextValue(e,r,a)),isNaN(t)&&(t=T.getTextValue(t,r,a)),e-t)},sortNumericDesc:function(e,t,r,a,s,i){if(e===t)return 0;var o=T.string[i.empties[s]||i.emptyTo];return""===e&&0!==o?"boolean"==typeof o?o?-1:1:o||1:""===t&&0!==o?"boolean"==typeof o?o?1:-1:-o||-1:(isNaN(e)&&(e=T.getTextValue(e,r,a)),isNaN(t)&&(t=T.getTextValue(t,r,a)),t-e)},sortNumeric:function(e,t){return e-t},addWidget:function(e){e.id&&!T.isEmptyObject(T.getWidgetById(e.id))&&console.warn('"'+e.id+'" widget was loaded more than once!'),T.widgets[T.widgets.length]=e},hasWidget:function(e,t){return(e=R(e)).length&&e[0].config&&e[0].config.widgetInit[t]||!1},getWidgetById:function(e){var t,r,a=T.widgets.length;for(t=0;t<a;t++)if((r=T.widgets[t])&&r.id&&r.id.toLowerCase()===e.toLowerCase())return r},applyWidgetOptions:function(e){var t,r,a,s=e.config,i=s.widgets.length;if(i)for(t=0;t<i;t++)(r=T.getWidgetById(s.widgets[t]))&&r.options&&(a=R.extend(!0,{},r.options),s.widgetOptions=R.extend(!0,a,s.widgetOptions),R.extend(!0,T.defaults.widgetOptions,r.options))},addWidgetFromClass:function(e){var t,r,a=e.config,s="^"+a.widgetClass.replace(T.regex.templateName,"(\\S+)+")+"$",i=new RegExp(s,"g"),o=(e.className||"").split(T.regex.spaces);if(o.length)for(t=o.length,r=0;r<t;r++)o[r].match(i)&&(a.widgets[a.widgets.length]=o[r].replace(i,"$1"))},applyWidgetId:function(e,t,r){var a,s,i,o=(e=R(e)[0]).config,n=o.widgetOptions,l=T.debug(o,"core"),c=T.getWidgetById(t);c&&(i=c.id,a=!1,R.inArray(i,o.widgets)<0&&(o.widgets[o.widgets.length]=i),l&&(s=new Date),!r&&o.widgetInit[i]||(o.widgetInit[i]=!0,e.hasInitialized&&T.applyWidgetOptions(e),"function"==typeof c.init&&(a=!0,l&&console[console.group?"group":"log"]("Initializing "+i+" widget"),c.init(e,c,o,n))),r||"function"!=typeof c.format||(a=!0,l&&console[console.group?"group":"log"]("Updating "+i+" widget"),c.format(e,o,n,!1)),l&&a&&(console.log("Completed "+(r?"initializing ":"applying ")+i+" widget"+T.benchmark(s)),console.groupEnd&&console.groupEnd()))},applyWidget:function(e,t,r){var a,s,i,o,n,l=(e=R(e)[0]).config,c=T.debug(l,"core"),d=[];if(!1===t||!e.hasInitialized||!e.isApplyingWidgets&&!e.isUpdating){if(c&&(n=new Date),T.addWidgetFromClass(e),clearTimeout(l.timerReady),l.widgets.length){for(e.isApplyingWidgets=!0,l.widgets=R.grep(l.widgets,function(e,t){return R.inArray(e,l.widgets)===t}),s=(i=l.widgets||[]).length,a=0;a<s;a++)(o=T.getWidgetById(i[a]))&&o.id?(o.priority||(o.priority=10),d[a]=o):c&&console.warn('"'+i[a]+'" was enabled, but the widget code has not been loaded!');for(d.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),s=d.length,c&&console[console.group?"group":"log"]("Start "+(t?"initializing":"applying")+" widgets"),a=0;a<s;a++)(o=d[a])&&o.id&&T.applyWidgetId(e,o.id,t);c&&console.groupEnd&&console.groupEnd()}l.timerReady=setTimeout(function(){e.isApplyingWidgets=!1,R.data(e,"lastWidgetApplication",new Date),l.$table.triggerHandler("tablesorter-ready"),t||"function"!=typeof r||r(e),c&&(o=l.widgets.length,console.log("Completed "+(!0===t?"initializing ":"applying ")+o+" widget"+(1!==o?"s":"")+T.benchmark(n)))},10)}},removeWidget:function(e,t,r){var a,s,i,o,n=(e=R(e)[0]).config;if(!0===t)for(t=[],o=T.widgets.length,i=0;i<o;i++)(s=T.widgets[i])&&s.id&&(t[t.length]=s.id);else t=(R.isArray(t)?t.join(","):t||"").toLowerCase().split(/[\s,]+/);for(o=t.length,a=0;a<o;a++)s=T.getWidgetById(t[a]),0<=(i=R.inArray(t[a],n.widgets))&&!0!==r&&n.widgets.splice(i,1),s&&s.remove&&(T.debug(n,"core")&&console.log((r?"Refreshing":"Removing")+' "'+t[a]+'" widget'),s.remove(e,n,n.widgetOptions,r),n.widgetInit[t[a]]=!1);n.$table.triggerHandler("widgetRemoveEnd",e)},refreshWidgets:function(e,t,r){function a(e){R(e).triggerHandler("refreshComplete")}var s,i,o=(e=R(e)[0]).config.widgets,n=T.widgets,l=n.length,c=[];for(s=0;s<l;s++)(i=n[s])&&i.id&&(t||R.inArray(i.id,o)<0)&&(c[c.length]=i.id);T.removeWidget(e,c.join(","),!0),!0!==r?(T.applyWidget(e,t||!1,a),t&&T.applyWidget(e,!1,a)):a(e)},benchmark:function(e){return" ("+((new Date).getTime()-e.getTime())+" ms)"},log:function(){console.log(arguments)},debug:function(e,t){return e&&(!0===e.debug||"string"==typeof e.debug&&-1<e.debug.indexOf(t))},isEmptyObject:function(e){for(var t in e)return!1;return!0},isValueInArray:function(e,t){var r,a=t&&t.length||0;for(r=0;r<a;r++)if(t[r][0]===e)return r;return-1},formatFloat:function(e,t){return"string"!=typeof e||""===e?e:(e=(t&&t.config?!1!==t.config.usNumberFormat:void 0===t||t)?e.replace(T.regex.comma,""):e.replace(T.regex.digitNonUS,"").replace(T.regex.comma,"."),T.regex.digitNegativeTest.test(e)&&(e=e.replace(T.regex.digitNegativeReplace,"-$1")),r=parseFloat(e),isNaN(r)?R.trim(e):r);var r},isDigit:function(e){return isNaN(e)?T.regex.digitTest.test(e.toString().replace(T.regex.digitReplace,"")):""!==e},computeColumnIndex:function(e,t){var r,a,s,i,o,n,l,c,d,f,u=t&&t.columns||0,g=[],p=new Array(u);for(r=0;r<e.length;r++)for(n=e[r].cells,a=0;a<n.length;a++){for(l=r,c=(o=n[a]).rowSpan||1,d=o.colSpan||1,void 0===g[l]&&(g[l]=[]),s=0;s<g[l].length+1;s++)if(void 0===g[l][s]){f=s;break}for(u&&o.cellIndex===f||(o.setAttribute?o.setAttribute("data-column",f):R(o).attr("data-column",f)),s=l;s<l+c;s++)for(void 0===g[s]&&(g[s]=[]),p=g[s],i=f;i<f+d;i++)p[i]="x"}return T.checkColumnCount(e,g,p.length),p.length},checkColumnCount:function(e,t,r){var a,s,i=!0,o=[];for(a=0;a<t.length;a++)if(t[a]&&(s=t[a].length,t[a].length!==r)){i=!1;break}i||(e.each(function(e,t){var r=t.parentElement.nodeName;o.indexOf(r)<0&&o.push(r)}),console.error("Invalid or incorrect number of columns in the "+o.join(" or ")+"; expected "+r+", but found "+s+" columns"))},fixColumnWidth:function(e){var t,r,a,s,i,o=(e=R(e)[0]).config,n=o.$table.children("colgroup");if(n.length&&n.hasClass(T.css.colgroup)&&n.remove(),o.widthFixed&&0===o.$table.children("colgroup").length){for(n=R('<colgroup class="'+T.css.colgroup+'">'),t=o.$table.width(),s=(a=o.$tbodies.find("tr:first").children(":visible")).length,i=0;i<s;i++)r=parseInt(a.eq(i).width()/t*1e3,10)/10+"%",n.append(R("<col>").css("width",r));o.$table.prepend(n)}},getData:function(e,t,r){var a,s,i="",o=R(e);return o.length?(a=!!R.metadata&&o.metadata(),s=" "+(o.attr("class")||""),void 0!==o.data(r)||void 0!==o.data(r.toLowerCase())?i+=o.data(r)||o.data(r.toLowerCase()):a&&void 0!==a[r]?i+=a[r]:t&&void 0!==t[r]?i+=t[r]:" "!==s&&s.match(" "+r+"-")&&(i=s.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""),R.trim(i)):""},getColumnData:function(e,t,r,a,s){if("object"!=typeof t||null===t)return t;var i,o=(e=R(e)[0]).config,n=s||o.$headers,l=o.$headerIndexed&&o.$headerIndexed[r]||n.find('[data-column="'+r+'"]:last');if(void 0!==t[r])return a?t[r]:t[n.index(l)];for(i in t)if("string"==typeof i&&l.filter(i).add(l.find(i)).length)return t[i]},isProcessing:function(e,t,r){var a=(e=R(e))[0].config,s=r||e.find("."+T.css.header);t?(void 0!==r&&0<a.sortList.length&&(s=s.filter(function(){return!this.sortDisabled&&0<=T.isValueInArray(parseFloat(R(this).attr("data-column")),a.sortList)})),e.add(s).addClass(T.css.processing+" "+a.cssProcessing)):e.add(s).removeClass(T.css.processing+" "+a.cssProcessing)},processTbody:function(e,t,r){if(e=R(e)[0],r)return e.isProcessing=!0,t.before('<colgroup class="tablesorter-savemyplace"/>'),R.fn.detach?t.detach():t.remove();var a=R(e).find("colgroup.tablesorter-savemyplace");t.insertAfter(a),a.remove(),e.isProcessing=!1},clearTableBody:function(e){R(e)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var t,r="[",a=T.characterEquivalents;if(!T.characterRegex){for(t in T.characterRegexArray={},a)"string"==typeof t&&(r+=a[t],T.characterRegexArray[t]=new RegExp("["+a[t]+"]","g"));T.characterRegex=new RegExp(r+"]")}if(T.characterRegex.test(e))for(t in a)"string"==typeof t&&(e=e.replace(T.characterRegexArray[t],t));return e},validateOptions:function(e){var t,r,a,s,i="headers sortForce sortList sortAppend widgets".split(" "),o=e.originalSettings;if(o){for(t in T.debug(e,"core")&&(s=new Date),o)if("undefined"===(a=typeof T.defaults[t]))console.warn('Tablesorter Warning! "table.config.'+t+'" option not recognized');else if("object"===a)for(r in o[t])a=T.defaults[t]&&typeof T.defaults[t][r],R.inArray(t,i)<0&&"undefined"===a&&console.warn('Tablesorter Warning! "table.config.'+t+"."+r+'" option not recognized');T.debug(e,"core")&&console.log("validate options time:"+T.benchmark(s))}},restoreHeaders:function(e){var t,r,a=R(e)[0].config,s=a.$table.find(a.selectorHeaders),i=s.length;for(t=0;t<i;t++)(r=s.eq(t)).find("."+T.css.headerIn).length&&r.html(a.headerContent[t])},destroy:function(e,t,r){if((e=R(e)[0]).hasInitialized){T.removeWidget(e,!0,!1);var a,s=R(e),i=e.config,o=s.find("thead:first"),n=o.find("tr."+T.css.headerRow).removeClass(T.css.headerRow+" "+i.cssHeaderRow),l=s.find("tfoot:first > tr").children("th, td");!1===t&&0<=R.inArray("uitheme",i.widgets)&&(s.triggerHandler("applyWidgetId",["uitheme"]),s.triggerHandler("applyWidgetId",["zebra"])),o.find("tr").not(n).remove(),a="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(i.namespace+" "),s.removeData("tablesorter").unbind(a.replace(T.regex.spaces," ")),i.$headers.add(l).removeClass([T.css.header,i.cssHeader,i.cssAsc,i.cssDesc,T.css.sortAsc,T.css.sortDesc,T.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),n.find(i.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(i.namespace+" ").replace(T.regex.spaces," ")),T.restoreHeaders(e),s.toggleClass(T.css.table+" "+i.tableClass+" tablesorter-"+i.theme,!1===t),s.removeClass(i.namespace.slice(1)),e.hasInitialized=!1,delete e.config.cache,"function"==typeof r&&r(e),T.debug(i,"core")&&console.log("tablesorter has been removed")}}};R.fn.tablesorter=function(t){return this.each(function(){var e=R.extend(!0,{},T.defaults,t,T.instanceMethods);e.originalSettings=t,!this.hasInitialized&&T.buildTable&&"TABLE"!==this.nodeName?T.buildTable(this,e):T.setup(this,e)})},window.console&&window.console.log||(T.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=1<arguments.length?arguments:arguments[0];T.logs[T.logs.length]={date:Date.now(),log:e}}),T.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),T.addParser({id:"text",is:function(){return!0},format:function(e,t){var r=t.config;return e&&(e=R.trim(r.ignoreCase?e.toLocaleLowerCase():e),e=r.sortLocaleCompare?T.replaceAccents(e):e),e},type:"text"}),T.regex.nondigit=/[^\w,. \-()]/g,T.addParser({id:"digit",is:function(e){return T.isDigit(e)},format:function(e,t){var r=T.formatFloat((e||"").replace(T.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?R.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),T.regex.currencyReplace=/[+\-,. ]/g,T.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,T.addParser({id:"currency",is:function(e){return e=(e||"").replace(T.regex.currencyReplace,""),T.regex.currencyTest.test(e)},format:function(e,t){var r=T.formatFloat((e||"").replace(T.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?R.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),T.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,T.regex.urlProtocolReplace=/(https?|ftp|file):\/\/(www\.)?/,T.addParser({id:"url",is:function(e){return T.regex.urlProtocolTest.test(e)},format:function(e){return e?R.trim(e.replace(T.regex.urlProtocolReplace,"")):e},type:"text"}),T.regex.dash=/-/g,T.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,T.addParser({id:"isoDate",is:function(e){return T.regex.isoDate.test(e)},format:function(e){var t=e?new Date(e.replace(T.regex.dash,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),T.regex.percent=/%/g,T.regex.percentTest=/(\d\s*?%|%\s*?\d)/,T.addParser({id:"percent",is:function(e){return T.regex.percentTest.test(e)&&e.length<15},format:function(e,t){return e?T.formatFloat(e.replace(T.regex.percent,""),t):e},type:"numeric"}),T.addParser({id:"image",is:function(e,t,r,a){return 0<a.find("img").length},format:function(e,t,r){return R(r).find("img").attr(t.config.imgAttr||"alt")||e},parsed:!0,type:"text"}),T.regex.dateReplace=/(\S)([AP]M)$/i,T.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,T.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,T.addParser({id:"usLongDate",is:function(e){return T.regex.usLongDateTest1.test(e)||T.regex.usLongDateTest2.test(e)},format:function(e){var t=e?new Date(e.replace(T.regex.dateReplace,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),T.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,T.regex.shortDateReplace=/[\-.,]/g,T.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,T.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,T.convertFormat=function(e,t){e=(e||"").replace(T.regex.spaces," ").replace(T.regex.shortDateReplace,"/"),"mmddyyyy"===t?e=e.replace(T.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===t?e=e.replace(T.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===t&&(e=e.replace(T.regex.shortDateYMD,"$1/$2/$3"));var r=new Date(e);return r instanceof Date&&isFinite(r)?r.getTime():""},T.addParser({id:"shortDate",is:function(e){return e=(e||"").replace(T.regex.spaces," ").replace(T.regex.shortDateReplace,"/"),T.regex.shortDateTest.test(e)},format:function(e,t,r,a){if(e){var s=t.config,i=s.$headerIndexed[a],o=i.length&&i.data("dateFormat")||T.getData(i,T.getColumnData(t,s.headers,a),"dateFormat")||s.dateFormat;return i.length&&i.data("dateFormat",o),T.convertFormat(e,o)||e}return e},type:"numeric"}),T.regex.timeTest=/^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i,T.regex.timeMatch=/(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,T.addParser({id:"time",is:function(e){return T.regex.timeTest.test(e)},format:function(e){var t=(e||"").match(T.regex.timeMatch),r=new Date(e),a=e&&(null!==t?t[0]:"00:00 AM"),s=a?new Date("2000/01/01 "+a.replace(T.regex.dateReplace,"$1 $2")):a;return s instanceof Date&&isFinite(s)?(r instanceof Date&&isFinite(r)?r.getTime():0)?parseFloat(s.getTime()+"."+r.getTime()):s.getTime():e},type:"numeric"}),T.addParser({id:"metadata",is:function(){return!1},format:function(e,t,r){var a=t.config,s=a.parserMetadataName?a.parserMetadataName:"sortValue";return R(r).metadata()[s]},type:"numeric"}),T.addWidget({id:"zebra",priority:90,format:function(e,t,r){var a,s,i,o,n,l,c,d=new RegExp(t.cssChildRow,"i"),f=t.$tbodies.add(R(t.namespace+"_extra_table").children("tbody:not(."+t.cssInfoBlock+")"));for(n=0;n<f.length;n++)for(i=0,c=(a=f.eq(n).children("tr:visible").not(t.selectorRemove)).length,l=0;l<c;l++)s=a.eq(l),d.test(s[0].className)||i++,o=i%2==0,s.removeClass(r.zebra[o?1:0]).addClass(r.zebra[o?0:1])},remove:function(e,t,r,a){if(!a){var s,i,o=t.$tbodies,n=(r.zebra||["even","odd"]).join(" ");for(s=0;s<o.length;s++)(i=T.processTbody(e,o.eq(s),!0)).children().removeClass(n),T.processTbody(e,i,!1)}}})}(e),function(b,y,v){"use strict";var w=b.tablesorter||{};b.extend(!0,w.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),w.storage=function(e,t,r,a){var s,i,o,n=!1,l={},c=(e=b(e)[0]).config,d=c&&c.widgetOptions,f=w.debug(c,"storage"),u=(a&&a.storageType||d&&d.storage_storageType).toString().charAt(0).toLowerCase(),g=u?"":a&&a.useSessionStorage||d&&d.storage_useSessionStorage,p=b(e),h=a&&a.id||p.attr(a&&a.group||d&&d.storage_group||"data-table-group")||d&&d.storage_tableId||e.id||b(".tablesorter").index(p),m=a&&a.url||p.attr(a&&a.page||d&&d.storage_page||"data-table-page")||d&&d.storage_fixedUrl||c&&c.fixedUrl||y.location.pathname;if("c"!==u&&(u="s"===u||g?"sessionStorage":"localStorage")in y)try{y[u].setItem("_tmptest","temp"),n=!0,y[u].removeItem("_tmptest")}catch(e){console.warn(u+" is not supported in this browser")}if(f&&console.log("Storage >> Using",n?u:"cookies"),b.parseJSON&&(l=n?b.parseJSON(y[u][t]||"null")||{}:(i=v.cookie.split(/[;\s|=]/),0!==(s=b.inArray(t,i)+1)&&b.parseJSON(i[s]||"null")||{})),void 0===r||!y.JSON||!JSON.hasOwnProperty("stringify"))return l&&l[m]?l[m][h]:"";l[m]||(l[m]={}),l[m][h]=r,n?y[u][t]=JSON.stringify(l):((o=new Date).setTime(o.getTime()+31536e6),v.cookie=t+"="+JSON.stringify(l).replace(/\"/g,'"')+"; expires="+o.toGMTString()+"; path=/")}}(e,window,document),function($){"use strict";var S=$.tablesorter||{};S.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"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 ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},$.extend(S.css,{wrapper:"tablesorter-wrapper"}),S.addWidget({id:"uitheme",priority:10,format:function(e,t,r){var a,s,i,o,n,l,c,d,f,u,g,p,h,m=S.themes,b=t.$table.add($(t.namespace+"_extra_table")),y=t.$headers.add($(t.namespace+"_extra_headers")),v=t.theme||"jui",w=m[v]||{},x=$.trim([w.sortNone,w.sortDesc,w.sortAsc,w.active].join(" ")),C=$.trim([w.iconSortNone,w.iconSortDesc,w.iconSortAsc].join(" ")),_=S.debug(t,"uitheme");for(_&&(n=new Date),b.hasClass("tablesorter-"+v)&&t.theme===t.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,u=m[t.appliedTheme]||{},g=(h=!$.isEmptyObject(u))?[u.sortNone,u.sortDesc,u.sortAsc,u.active].join(" "):"",p=h?[u.iconSortNone,u.iconSortDesc,u.iconSortAsc].join(" "):"",h&&(r.zebra[0]=$.trim(" "+r.zebra[0].replace(" "+u.even,"")),r.zebra[1]=$.trim(" "+r.zebra[1].replace(" "+u.odd,"")),t.$tbodies.children().removeClass([u.even,u.odd].join(" "))),w.even&&(r.zebra[0]+=" "+w.even),w.odd&&(r.zebra[1]+=" "+w.odd),b.children("caption").removeClass(u.caption||"").addClass(w.caption),d=b.removeClass((t.appliedTheme?"tablesorter-"+(t.appliedTheme||""):"")+" "+(u.table||"")).addClass("tablesorter-"+v+" "+(w.table||"")).children("tfoot"),t.appliedTheme=t.theme,d.length&&d.children("tr").removeClass(u.footerRow||"").addClass(w.footerRow).children("th, td").removeClass(u.footerCells||"").addClass(w.footerCells),y.removeClass((h?[u.header,u.hover,g].join(" "):"")||"").addClass(w.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(e){$(this)["mouseenter"===e.type?"addClass":"removeClass"](w.hover||"")}),y.each(function(){var e=$(this);e.find("."+S.css.wrapper).length||e.wrapInner('<div class="'+S.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),t.cssIcon&&y.find("."+S.css.icon).removeClass(h?[u.icons,p].join(" "):"").addClass(w.icons||""),S.hasWidget(t.table,"filter")&&(s=function(){b.children("thead").children("."+S.css.filterRow).removeClass(h&&u.filterRow||"").addClass(w.filterRow||"")},r.filter_initialized?s():b.one("filterInit",function(){s()}))),a=0;a<t.columns;a++)l=t.$headers.add($(t.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+a+'"]'),c=S.css.icon?l.find("."+S.css.icon):$(),(f=y.not(".sorter-false").filter('[data-column="'+a+'"]:last')).length&&(l.removeClass(x),c.removeClass(C),f[0].sortDisabled?c.removeClass(w.icons||""):(i=w.sortNone,o=w.iconSortNone,f.hasClass(S.css.sortAsc)?(i=[w.sortAsc,w.active].join(" "),o=w.iconSortAsc):f.hasClass(S.css.sortDesc)&&(i=[w.sortDesc,w.active].join(" "),o=w.iconSortDesc),l.addClass(i),c.addClass(o||"")));_&&console.log("uitheme >> Applied "+v+" theme"+S.benchmark(n))},remove:function(e,t,r,a){if(r.uitheme_applied){var s=t.$table,i=t.appliedTheme||"jui",o=S.themes[i]||S.themes.jui,n=s.children("thead").children(),l=o.sortNone+" "+o.sortDesc+" "+o.sortAsc,c=o.iconSortNone+" "+o.iconSortDesc+" "+o.iconSortAsc;s.removeClass("tablesorter-"+i+" "+o.table),r.uitheme_applied=!1,a||(s.find(S.css.header).removeClass(o.header),n.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(o.hover+" "+l+" "+o.active).filter("."+S.css.filterRow).removeClass(o.filterRow),n.find("."+S.css.icon).removeClass(o.icons+" "+c))}}})}(e),function(b){"use strict";var y=b.tablesorter||{};y.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(e,t,r){var a,s,i,o,n,l,c,d,f=t.$table,u=t.$tbodies,g=t.sortList,p=g.length,h=r&&r.columns||["primary","secondary","tertiary"],m=h.length-1;for(c=h.join(" "),s=0;s<u.length;s++)(i=(a=y.processTbody(e,u.eq(s),!0)).children("tr")).each(function(){if(n=b(this),"none"!==this.style.display&&(l=n.children().removeClass(c),g&&g[0]&&(l.eq(g[0][0]).addClass(h[0]),1<p)))for(d=1;d<p;d++)l.eq(g[d][0]).addClass(h[d]||h[m])}),y.processTbody(e,a,!1);if(o=!1!==r.columns_thead?["thead tr"]:[],!1!==r.columns_tfoot&&o.push("tfoot tr"),o.length&&(i=f.find(o.join(",")).children().removeClass(c),p))for(d=0;d<p;d++)i.filter('[data-column="'+g[d][0]+'"]').addClass(h[d]||h[m])},remove:function(e,t,r){var a,s,i=t.$tbodies,o=(r.columns||["primary","secondary","tertiary"]).join(" ");for(t.$headers.removeClass(o),t.$table.children("tfoot").children("tr").children("th, td").removeClass(o),a=0;a<i.length;a++)(s=y.processTbody(e,i.eq(a),!0)).children("tr").each(function(){b(this).children().removeClass(o)}),y.processTbody(e,s,!1)}})}(e),function(A){"use strict";var D,H,N=A.tablesorter||{},b=N.css,l=N.keyCodes;A.extend(b,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),A.extend(l,{backSpace:8,escape:27,space:32,left:37,down:40}),N.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnAnyMatch:!0,filter_columnFilters:!0,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:!0,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:!1,filter_startsWith:!1,filter_useParsedData:!1},format:function(e,t,r){t.$table.hasClass("hasFilters")||D.init(e,t,r)},remove:function(e,t,r,a){var s,i,o=t.$table,n=t.$tbodies,l="addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ".split(" ").join(t.namespace+"filter ");if(o.removeClass("hasFilters").unbind(l.replace(N.regex.spaces," ")).find("."+b.filterRow).remove(),r.filter_initialized=!1,!a){for(s=0;s<n.length;s++)(i=N.processTbody(e,n.eq(s),!0)).children().removeClass(r.filter_filteredRow).show(),N.processTbody(e,i,!1);r.filter_reset&&A(document).undelegate(r.filter_reset,"click"+t.namespace+"filter")}}}),H=(D=N.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(e,t,r){if(!H.orTest.test(t.iFilter)&&!H.orSplit.test(t.filter)||H.regex.test(t.filter))return null;var a,s,i,o=A.extend({},t),n=t.filter.split(H.orSplit),l=t.iFilter.split(H.orSplit),c=n.length;for(a=0;a<c;a++){o.nestedFilters=!0,o.filter=""+(D.parseFilter(e,n[a],t)||""),o.iFilter=""+(D.parseFilter(e,l[a],t)||""),i="("+(D.parseFilter(e,o.filter,t)||"")+")";try{if(s=new RegExp(t.isMatch?i:"^"+i+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(o.exact)||D.processTypes(e,o,r))return s}catch(e){return null}}return s||!1},and:function(e,t,r){if(H.andTest.test(t.filter)){var a,s,i,o,n=A.extend({},t),l=t.filter.split(H.andSplit),c=t.iFilter.split(H.andSplit),d=l.length;for(a=0;a<d;a++){n.nestedFilters=!0,n.filter=""+(D.parseFilter(e,l[a],t)||""),n.iFilter=""+(D.parseFilter(e,c[a],t)||""),o=("("+(D.parseFilter(e,n.filter,t)||"")+")").replace(H.wild01,"\\S{1}").replace(H.wild0More,"\\S*");try{i=new RegExp(t.isMatch?o:"^"+o+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(n.exact)||D.processTypes(e,n,r),s=0===a?i:s&&i}catch(e){return null}}return s||!1}return null},regex:function(e,t){if(H.regex.test(t.filter)){var r,a=t.filter_regexCache[t.index]||H.regex.exec(t.filter),s=a instanceof RegExp;try{s||(t.filter_regexCache[t.index]=a=new RegExp(a[1],a[2])),r=a.test(t.exact)}catch(e){r=!1}return r}return null},operators:function(e,t){if(H.operTest.test(t.iFilter)&&""!==t.iExact){var r,a,s,i=e.table,o=t.parsed[t.index],n=N.formatFloat(t.iFilter.replace(H.operators,""),i),l=e.parsers[t.index]||{},c=n;return!o&&"numeric"!==l.type||(s=A.trim(""+t.iFilter.replace(H.operators,"")),n="number"!=typeof(a=D.parseFilter(e,s,t,!0))||""===a||isNaN(a)?n:a),r=!o&&"numeric"!==l.type||isNaN(n)||void 0===t.cache?(s=isNaN(t.iExact)?t.iExact.replace(N.regex.nondigit,""):t.iExact,N.formatFloat(s,i)):t.cache,H.gtTest.test(t.iFilter)?a=H.gteTest.test(t.iFilter)?n<=r:n<r:H.ltTest.test(t.iFilter)&&(a=H.lteTest.test(t.iFilter)?r<=n:r<n),a||""!==c||(a=!0),a}return null},notMatch:function(e,t){if(H.notTest.test(t.iFilter)){var r,a=t.iFilter.replace("!",""),s=D.parseFilter(e,a,t)||"";return H.exact.test(s)?""===(s=s.replace(H.exact,""))||A.trim(s)!==t.iExact:(r=t.iExact.search(A.trim(s)),""===s||(t.anyMatch?r<0:!(e.widgetOptions.filter_startsWith?0===r:0<=r)))}return null},exact:function(e,t){if(H.exact.test(t.iFilter)){var r=t.iFilter.replace(H.exact,""),a=D.parseFilter(e,r,t)||"";return t.anyMatch?0<=A.inArray(a,t.rowArray):a==t.iExact}return null},range:function(e,t){if(H.toTest.test(t.iFilter)){var r,a,s,i,o=e.table,n=t.index,l=t.parsed[n],c=t.iFilter.split(H.toSplit);return a=c[0].replace(N.regex.nondigit,"")||"",s=N.formatFloat(D.parseFilter(e,a,t),o),a=c[1].replace(N.regex.nondigit,"")||"",i=N.formatFloat(D.parseFilter(e,a,t),o),!l&&"numeric"!==e.parsers[n].type||(s=""===(r=e.parsers[n].format(""+c[0],o,e.$headers.eq(n),n))||isNaN(r)?s:r,i=""===(r=e.parsers[n].format(""+c[1],o,e.$headers.eq(n),n))||isNaN(r)?i:r),r=!l&&"numeric"!==e.parsers[n].type||isNaN(s)||isNaN(i)?(a=isNaN(t.iExact)?t.iExact.replace(N.regex.nondigit,""):t.iExact,N.formatFloat(a,o)):t.cache,i<s&&(a=s,s=i,i=a),s<=r&&r<=i||""===s||""===i}return null},wild:function(e,t){if(H.wildOrTest.test(t.iFilter)){var r=""+(D.parseFilter(e,t.iFilter,t)||"");!H.wildTest.test(r)&&t.nestedFilters&&(r=t.isMatch?r:"^("+r+")$");try{return new RegExp(r.replace(H.wild01,"\\S{1}").replace(H.wild0More,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(t.exact)}catch(e){return null}}return null},fuzzy:function(e,t){if(H.fuzzyTest.test(t.iFilter)){var r,a=0,s=t.iExact.length,i=t.iFilter.slice(1),o=D.parseFilter(e,i,t)||"";for(r=0;r<s;r++)t.iExact[r]===o[a]&&(a+=1);return a===o.length}return null}},init:function(r){N.language=A.extend(!0,{},{to:"to",or:"or",and:"and"},N.language);function e(e,t,r){return""===(t=t.trim())?"":(e||"")+t+(r||"")}var t,a,s,i,o,n,l,c,d=r.config,f=d.widgetOptions;if(d.$table.addClass("hasFilters"),d.lastSearch=[],f.filter_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*=","]',n="\\{"+H.query+"\\}",A.extend(H,{child:new RegExp(d.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+e("|",N.language.or)+e("|",N.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+e("|",N.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+e("|",N.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+e("",N.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+e("",N.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+e("|\\s+",N.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+e("|\\s+(?:",N.language.or,")\\s+")+")","gi"),iQuery:new RegExp(n,"i"),igQuery:new RegExp(n,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/}),n=d.$headers.filter(".filter-false, .parser-false").length,!1!==f.filter_columnFilters&&n!==d.$headers.length&&D.buildRow(r,d,f),s="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(s,function(e,t){return n=f.filter_hideEmpty&&A.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===e.type),d.$table.find("."+b.filterRow).toggleClass(f.filter_filteredRow,n),/(search|filter)/.test(e.type)||(e.stopPropagation(),D.buildDefault(r,!0)),"filterReset"===e.type||"filterAndSortReset"===e.type?(d.$table.find("."+b.filter).add(f.filter_$externalFilters).val(""),"filterAndSortReset"===e.type?N.sortReset(this.config,function(){D.searching(r,[])}):D.searching(r,[])):"filterResetSaved"===e.type?N.storage(r,"tablesorter-filters",""):"filterEnd"===e.type?D.buildDefault(r,!0):(t="search"===e.type?t:"updateComplete"===e.type?d.$table.data("lastSearch"):"",/(update|add)/.test(e.type)&&"updateComplete"!==e.type&&(d.lastCombinedFilter=null,d.lastSearch=[],setTimeout(function(){d.$table.triggerHandler("filterFomatterUpdate")},100)),D.searching(r,t,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof A?f.filter_reset.click(function(){d.$table.triggerHandler("filterReset")}):A(f.filter_reset).length&&A(document).undelegate(f.filter_reset,"click"+d.namespace+"filter").delegate(f.filter_reset,"click"+d.namespace+"filter",function(){d.$table.triggerHandler("filterReset")})),f.filter_functions)for(o=0;o<d.columns;o++)if(l=N.getColumnData(r,f.filter_functions,o))if(c=!((i=d.$headerIndexed[o].removeClass("filter-select")).hasClass("filter-false")||i.hasClass("parser-false")),!(t="")===l&&c)D.buildSelect(r,o);else if("object"==typeof l&&c){for(a in l)"string"==typeof a&&(t+=""===t?'<option value="">'+(i.data("placeholder")||i.attr("data-placeholder")||f.filter_placeholder.select||"")+"</option>":"",0<=(s=n=a).indexOf(f.filter_selectSourceSeparator)&&(s=(n=a.split(f.filter_selectSourceSeparator))[1],n=n[0]),t+="<option "+(s===n?"":'data-function-name="'+a+'" ')+'value="'+n+'">'+s+"</option>");d.$table.find("thead").find("select."+b.filter+'[data-column="'+o+'"]').append(t),(l="function"==typeof(s=f.filter_selectSource)||N.getColumnData(r,s,o))&&D.buildSelect(d.table,o,"",!0,i.hasClass(f.filter_onlyAvail))}D.buildDefault(r,!0),D.bindSearch(r,d.$table.find("."+b.filter),!0),f.filter_external&&D.bindSearch(r,f.filter_external),f.filter_hideFilters&&D.hideFilters(d),d.showProcessing&&(s="filterStart filterEnd ".split(" ").join(d.namespace+"filter-sp "),d.$table.unbind(s.replace(N.regex.spaces," ")).bind(s,function(e,t){i=t?d.$table.find("."+b.header).filter("[data-column]").filter(function(){return""!==t[A(this).data("column")]}):"",N.isProcessing(r,"filterStart"===e.type,t?i:"")})),d.filteredRows=d.totalRows,s="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "),d.$table.unbind(s.replace(N.regex.spaces," ")).bind(s,function(){D.completeInit(this)}),d.pager&&d.pager.initialized&&!f.filter_initialized?(d.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){D.filterInitComplete(d)},100)):f.filter_initialized||D.completeInit(r)},completeInit:function(e){var t=e.config,r=t.widgetOptions,a=D.setDefaults(e,t,r)||[];a.length&&(t.delayInit&&""===a.join("")||N.setFilters(e,a,!0)),t.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){r.filter_initialized||D.filterInitComplete(t)},100)},formatterUpdated:function(e,t){var r=e&&e.closest("table"),a=r.length&&r[0].config,s=a&&a.widgetOptions;s&&!s.filter_initialized&&(s.filter_formatterInit[t]=1)},filterInitComplete:function(e){function t(){s.filter_initialized=!0,e.lastSearch=e.$table.data("lastSearch"),e.$table.triggerHandler("filterInit",e),D.findRows(e.table,e.lastSearch||[]),N.debug(e,"filter")&&console.log("Filter >> Widget initialized")}var r,a,s=e.widgetOptions,i=0;if(A.isEmptyObject(s.filter_formatter))t();else{for(a=s.filter_formatterInit.length,r=0;r<a;r++)1===s.filter_formatterInit[r]&&i++;clearTimeout(s.filter_initTimer),s.filter_initialized||i!==s.filter_formatterCount?s.filter_initialized||(s.filter_initTimer=setTimeout(function(){t()},500)):t()}},processFilters:function(e,t){var r,a=[],s=t?encodeURIComponent:decodeURIComponent,i=e.length;for(r=0;r<i;r++)e[r]&&(a[r]=s(e[r]));return a},setDefaults:function(e,t,r){var a,s,i,o,n,l=N.getFilters(e)||[];if(r.filter_saveFilters&&N.storage&&(s=N.storage(e,"tablesorter-filters")||[],(a=A.isArray(s))&&""===s.join("")||!a||(l=D.processFilters(s))),""===l.join(""))for(n=t.$headers.add(r.filter_$externalFilters).filter("["+r.filter_defaultAttrib+"]"),i=0;i<=t.columns;i++)o=i===t.columns?"all":i,l[i]=n.filter('[data-column="'+o+'"]').attr(r.filter_defaultAttrib)||l[i]||"";return t.$table.data("lastSearch",l),l},parseFilter:function(e,t,r,a){return a||r.parsed[r.index]?e.parsers[r.index].format(t,e.table,[],r.index):t},buildRow:function(e,t,r){var a,s,i,o,n,l,c,d,f,u=r.filter_cellFilter,g=t.columns,p=A.isArray(u),h='<tr role="search" class="'+b.filterRow+" "+t.cssIgnoreRow+'">';for(i=0;i<g;i++)t.$headerIndexed[i].length&&(h+=1<(f=t.$headerIndexed[i]&&t.$headerIndexed[i][0].colSpan||0)?'<td data-column="'+i+"-"+(i+f-1)+'" colspan="'+f+'"':'<td data-column="'+i+'"',h+=p?u[i]?' class="'+u[i]+'"':"":""!==u?' class="'+u+'"':"",h+="></td>");for(t.$filters=A(h+="</tr>").appendTo(t.$table.children("thead").eq(0)).children("td"),i=0;i<g;i++)l=!1,(o=t.$headerIndexed[i])&&o.length&&(a=D.getColumnElm(t,t.$filters,i),d=N.getColumnData(e,r.filter_functions,i),n=r.filter_functions&&d&&"function"!=typeof d||o.hasClass("filter-select"),s=N.getColumnData(e,t.headers,i),l="false"===N.getData(o[0],s,"filter")||"false"===N.getData(o[0],s,"parser"),n?h=A("<select>").appendTo(a):((d=N.getColumnData(e,r.filter_formatter,i))?(r.filter_formatterCount++,(h=d(a,i))&&0===h.length&&(h=a.children("input")),h&&(0===h.parent().length||h.parent().length&&h.parent()[0]!==a[0])&&a.append(h)):h=A('<input type="search">').appendTo(a),h&&(f=o.data("placeholder")||o.attr("data-placeholder")||r.filter_placeholder.search||"",h.attr("placeholder",f))),h&&(c=(A.isArray(r.filter_cssFilter)?void 0!==r.filter_cssFilter[i]&&r.filter_cssFilter[i]||"":r.filter_cssFilter)||"",h.addClass(b.filter+" "+c),f=(f=(c=r.filter_filterLabel).match(/{{([^}]+?)}}/g))||["{{label}}"],A.each(f,function(e,t){var r=new RegExp(t,"g"),a=o.attr("data-"+t.replace(/{{|}}/g,"")),s=void 0===a?o.text():a;c=c.replace(r,A.trim(s))}),h.attr({"data-column":a.attr("data-column"),"aria-label":c}),l&&(h.attr("placeholder","").addClass(b.filterDisabled)[0].disabled=!0)))},bindSearch:function(s,e,t){if(s=A(s)[0],(e=A(e)).length){var r,i=s.config,o=i.widgetOptions,a=i.namespace+"filter",n=o.filter_$externalFilters;!0!==t&&(r=o.filter_anyColumnSelector+","+o.filter_multipleColumnSelector,o.filter_$anyMatch=e.filter(r),n&&n.length?o.filter_$externalFilters=o.filter_$externalFilters.add(e):o.filter_$externalFilters=e,N.setFilters(s,i.$table.data("lastSearch")||[],!1===t)),r="keypress keyup keydown search change input ".split(" ").join(a+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(r.replace(N.regex.spaces," ")).bind("keydown"+a,function(e){if(e.which===l.escape&&!s.config.widgetOptions.filter_resetOnEsc)return!1}).bind("keyup"+a,function(e){o=s.config.widgetOptions;var t=parseInt(A(this).attr("data-column"),10),r="boolean"==typeof o.filter_liveSearch?o.filter_liveSearch:N.getColumnData(s,o.filter_liveSearch,t);if(void 0===r&&(r=o.filter_liveSearch.fallback||!1),A(this).attr("data-lastSearchTime",(new Date).getTime()),e.which===l.escape)this.value=o.filter_resetOnEsc?"":i.lastSearch[t];else{if(""!==this.value&&("number"==typeof r&&this.value.length<r||e.which!==l.enter&&e.which!==l.backSpace&&(e.which<l.space||e.which>=l.left&&e.which<=l.down)))return;if(!1===r&&""!==this.value&&e.which!==l.enter)return}D.searching(s,!0,!0,t)}).bind("search change keypress input blur ".split(" ").join(a+" "),function(e){var t=parseInt(A(this).attr("data-column"),10),r=e.type,a="boolean"==typeof o.filter_liveSearch?o.filter_liveSearch:N.getColumnData(s,o.filter_liveSearch,t);!s.config.widgetOptions.filter_initialized||e.which!==l.enter&&"search"!==r&&"blur"!==r&&("change"!==r&&"input"!==r||!0!==a&&(!0===a||"INPUT"===e.target.nodeName)||this.value===i.lastSearch[t])||(e.preventDefault(),A(this).attr("data-lastSearchTime",(new Date).getTime()),D.searching(s,"keypress"!==r||e.which===l.enter,!0,t))})}},searching:function(e,t,r,a){var s,i=e.config.widgetOptions;void 0===a?s=!1:void 0===(s="boolean"==typeof i.filter_liveSearch?i.filter_liveSearch:N.getColumnData(e,i.filter_liveSearch,a))&&(s=i.filter_liveSearch.fallback||!1),clearTimeout(i.filter_searchTimer),void 0===t||!0===t?i.filter_searchTimer=setTimeout(function(){D.checkFilters(e,t,r)},s?i.filter_searchDelay:10):D.checkFilters(e,t,r)},equalFilters:function(e,t,r){var a,s=[],i=[],o=e.columns+1;for(t=A.isArray(t)?t:[],r=A.isArray(r)?r:[],a=0;a<o;a++)s[a]=t[a]||"",i[a]=r[a]||"";return s.join(",")===i.join(",")},checkFilters:function(e,t,r){var a=e.config,s=a.widgetOptions,i=A.isArray(t),o=i?t:N.getFilters(e,!0),n=o||[];if(A.isEmptyObject(a.cache))a.delayInit&&(!a.pager||a.pager&&a.pager.initialized)&&N.updateCache(a,function(){D.checkFilters(e,!1,r)});else{if(i&&(N.setFilters(e,o,!1,!0!==r),s.filter_initialized||(a.lastSearch=[],a.lastCombinedFilter="")),s.filter_hideFilters&&a.$table.find("."+b.filterRow).triggerHandler(D.hideFiltersCheck(a)?"mouseleave":"mouseenter"),D.equalFilters(a,a.lastSearch,n)){if(!1!==t)return;a.lastCombinedFilter="",a.lastSearch=[]}if(o=o||[],o=Array.prototype.map?o.map(String):o.join("�").split("�"),s.filter_initialized&&a.$table.triggerHandler("filterStart",[o]),!a.showProcessing)return D.findRows(e,o,n),!1;setTimeout(function(){return D.findRows(e,o,n),!1},30)}},hideFiltersCheck:function(e){if("function"==typeof e.widgetOptions.filter_hideFilters){var t=e.widgetOptions.filter_hideFilters(e);if("boolean"==typeof t)return t}return""===N.getFilters(e.$table).join("")},hideFilters:function(a,e){var s;(e||a.$table).find("."+b.filterRow).addClass(b.filterRowHide).bind("mouseenter mouseleave",function(e){var t=e,r=A(this);clearTimeout(s),s=setTimeout(function(){/enter|over/.test(t.type)?r.removeClass(b.filterRowHide):A(document.activeElement).closest("tr")[0]!==r[0]&&r.toggleClass(b.filterRowHide,D.hideFiltersCheck(a))},200)}).find("input, select").bind("focus blur",function(e){var t=e,r=A(this).closest("tr");clearTimeout(s),s=setTimeout(function(){clearTimeout(s),r.toggleClass(b.filterRowHide,D.hideFiltersCheck(a)&&"focus"!==t.type)},200)})},defaultFilter:function(e,t){if(""===e)return e;var r=H.iQuery,a=t.match(H.igQuery).length,s=1<a?A.trim(e).split(/\s/):[A.trim(e)],i=s.length-1,o=0,n=t;for(i<1&&1<a&&(s[1]=s[0]);r.test(n);)n=n.replace(r,s[o++]||""),r.test(n)&&o<i&&""!==(s[o]||"")&&(n=t.replace(r,n));return n},getLatestSearch:function(e){return e?e.sort(function(e,t){return A(t).attr("data-lastSearchTime")-A(e).attr("data-lastSearchTime")}):e||A()},findRange:function(e,t,r){var a,s,i,o,n,l,c,d,f,u=[];if(/^[0-9]+$/.test(t))return[parseInt(t,10)];if(!r&&/-/.test(t))for(f=(s=t.match(/(\d+)\s*-\s*(\d+)/g))?s.length:0,d=0;d<f;d++){for(i=s[d].split(/\s*-\s*/),o=parseInt(i[0],10)||0,(n=parseInt(i[1],10)||e.columns-1)<o&&(a=o,o=n,n=a),n>=e.columns&&(n=e.columns-1);o<=n;o++)u[u.length]=o;t=t.replace(s[d],"")}if(!r&&/,/.test(t))for(f=(l=t.split(/\s*,\s*/)).length,c=0;c<f;c++)""!==l[c]&&(d=parseInt(l[c],10))<e.columns&&(u[u.length]=d);if(!u.length)for(d=0;d<e.columns;d++)u[u.length]=d;return u},getColumnElm:function(t,e,r){return e.filter(function(){var e=D.findRange(t,A(this).attr("data-column"));return-1<A.inArray(r,e)})},multipleColumns:function(e,t){var r=e.widgetOptions,a=r.filter_initialized||!t.filter(r.filter_anyColumnSelector).length,s=A.trim(D.getLatestSearch(t).attr("data-column")||"");return D.findRange(e,s,!a)},processTypes:function(e,t,r){var a,s=null,i=null;for(a in D.types)A.inArray(a,r.excludeMatch)<0&&null===i&&null!==(i=D.types[a](e,t,r))&&(t.matchedOn=a,s=i);return s},matchType:function(e,t){var r=e.widgetOptions,a=e.$headerIndexed[t];return!a.hasClass("filter-exact")&&(!!a.hasClass("filter-match")||(r.filter_columnFilters?a=e.$filters.find("."+b.filter).add(r.filter_$externalFilters).filter('[data-column="'+t+'"]'):r.filter_$externalFilters&&(a=r.filter_$externalFilters.filter('[data-column="'+t+'"]')),!!a.length&&"match"===e.widgetOptions.filter_matchType[(a[0].nodeName||"").toLowerCase()]))},processRow:function(t,r,e){var a,s,i,o,n,l=t.widgetOptions,c=!0,d=l.filter_$anyMatch&&l.filter_$anyMatch.length,f=l.filter_$anyMatch&&l.filter_$anyMatch.length?D.multipleColumns(t,l.filter_$anyMatch):[];if(r.$cells=r.$row.children(),r.matchedOn=null,r.anyMatchFlag&&1<f.length||r.anyMatchFilter&&!d){if(r.anyMatch=!0,r.isMatch=!0,r.rowArray=r.$cells.map(function(e){if(-1<A.inArray(e,f)||r.anyMatchFilter&&!d)return r.parsed[e]?n=r.cacheArray[e]:(n=r.rawArray[e],n=A.trim(l.filter_ignoreCase?n.toLowerCase():n),t.sortLocaleCompare&&(n=N.replaceAccents(n))),n}).get(),r.filter=r.anyMatchFilter,r.iFilter=r.iAnyMatchFilter,r.exact=r.rowArray.join(" "),r.iExact=l.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.cache=r.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,null!==(s=D.processTypes(t,r,e)))c=s;else if(l.filter_startsWith)for(c=!1,f=Math.min(t.columns,r.rowArray.length);!c&&0<f;)f--,c=c||0===r.rowArray[f].indexOf(r.iFilter);else c=0<=(r.iExact+r.childRowText).indexOf(r.iFilter);if(r.anyMatch=!1,r.filters.join("")===r.filter)return c}for(f=0;f<t.columns;f++)r.filter=r.filters[f],r.index=f,e.excludeMatch=e.excludeFilter[f],r.filter&&(r.cache=r.cacheArray[f],a=r.parsed[f]?r.cache:r.rawArray[f]||"",r.exact=t.sortLocaleCompare?N.replaceAccents(a):a,r.iExact=!H.type.test(typeof r.exact)&&l.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.isMatch=D.matchType(t,f),a=c,o=l.filter_columnFilters&&t.$filters.add(l.filter_$externalFilters).filter('[data-column="'+f+'"]').find("select option:selected").attr("data-function-name")||"",t.sortLocaleCompare&&(r.filter=N.replaceAccents(r.filter)),l.filter_defaultFilter&&H.iQuery.test(e.defaultColFilter[f])&&(r.filter=D.defaultFilter(r.filter,e.defaultColFilter[f])),r.iFilter=l.filter_ignoreCase?(r.filter||"").toLowerCase():r.filter,s=null,(i=e.functions[f])&&("function"==typeof i?s=i(r.exact,r.cache,r.filter,f,r.$row,t,r):"function"==typeof i[o||r.filter]&&(s=i[n=o||r.filter](r.exact,r.cache,r.filter,f,r.$row,t,r))),c=!!(a=null===s?(s=D.processTypes(t,r,e),n=!0===i&&("and"===r.matchedOn||"or"===r.matchedOn),null===s||n?!0===i?r.isMatch?0<=(""+r.iExact).search(r.iFilter):r.filter===r.exact:(n=(r.iExact+r.childRowText).indexOf(D.parseFilter(t,r.iFilter,r)),!l.filter_startsWith&&0<=n||l.filter_startsWith&&0===n):s):s)&&c);return c},findRows:function(e,r,t){if(!D.equalFilters(e.config,e.config.lastSearch,t)&&e.config.widgetOptions.filter_initialized){var a,s,i,o,n,l,c,d,f,u,g,p,h,m,b,y,v,w,x,C,_,$,S,z=A.extend([],r),F=e.config,R=F.widgetOptions,T=N.debug(F,"filter"),I={anyMatch:!1,filters:r,filter_regexCache:[]},k={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:N.getColumnData(e,R.filter_defaultFilter,F.columns,!0)||""};for(I.parsed=[],f=0;f<F.columns;f++)I.parsed[f]=R.filter_useParsedData||F.parsers&&F.parsers[f]&&F.parsers[f].parsed||N.getData&&"parsed"===N.getData(F.$headerIndexed[f],N.getColumnData(e,F.headers,f),"filter")||F.$headerIndexed[f].hasClass("filter-parsed"),k.functions[f]=N.getColumnData(e,R.filter_functions,f)||F.$headerIndexed[f].hasClass("filter-select"),k.defaultColFilter[f]=N.getColumnData(e,R.filter_defaultFilter,f)||"",k.excludeFilter[f]=(N.getColumnData(e,R.filter_excludeFilter,f,!0)||"").split(/\s+/);for(T&&(console.log("Filter >> Starting filter widget search",r),m=new Date),F.filteredRows=0,t=z||[],c=F.totalRows=0;c<F.$tbodies.length;c++){if(d=N.processTbody(e,F.$tbodies.eq(c),!0),f=F.columns,s=F.cache[c].normalized,o=A(A.map(s,function(e){return e[f].$row.get()})),""===t.join("")||R.filter_serversideFiltering)o.removeClass(R.filter_filteredRow).not("."+F.cssChildRow).css("display","");else{if(a=(o=o.not("."+F.cssChildRow)).length,(R.filter_$anyMatch&&R.filter_$anyMatch.length||void 0!==r[F.columns])&&(I.anyMatchFlag=!0,I.anyMatchFilter=""+(r[F.columns]||R.filter_$anyMatch&&D.getLatestSearch(R.filter_$anyMatch).val()||""),R.filter_columnAnyMatch)){for(x=I.anyMatchFilter.split(H.andSplit),C=!1,y=0;y<x.length;y++)1<(_=x[y].split(":")).length&&(isNaN(_[0])?A.each(F.headerContent,function(e,t){-1<t.toLowerCase().indexOf(_[0])&&(r[$=e]=_[1])}):$=parseInt(_[0],10)-1,0<=$&&$<F.columns&&(r[$]=_[1],x.splice(y,1),y--,C=!0));C&&(I.anyMatchFilter=x.join(" && "))}if(w=R.filter_searchFiltered,g=F.lastSearch||F.$table.data("lastSearch")||[],w)for(y=0;y<f+1;y++)b=r[y]||"",w||(y=f),w=w&&g.length&&0===b.indexOf(g[y]||"")&&!H.alreadyFiltered.test(b)&&!H.exactTest.test(b)&&!(H.isNeg1.test(b)||H.isNeg2.test(b))&&!(""!==b&&F.$filters&&F.$filters.filter('[data-column="'+y+'"]').find("select").length&&!D.matchType(F,y));for(v=o.not("."+R.filter_filteredRow).length,w&&0===v&&(w=!1),T&&console.log("Filter >> Searching through "+(w&&v<a?v:"all")+" rows"),I.anyMatchFlag&&(F.sortLocaleCompare&&(I.anyMatchFilter=N.replaceAccents(I.anyMatchFilter)),R.filter_defaultFilter&&H.iQuery.test(k.defaultAnyFilter)&&(I.anyMatchFilter=D.defaultFilter(I.anyMatchFilter,k.defaultAnyFilter),w=!1),I.iAnyMatchFilter=R.filter_ignoreCase&&F.ignoreCase?I.anyMatchFilter.toLowerCase():I.anyMatchFilter),l=0;l<a;l++)if(S=o[l].className,!(l&&H.child.test(S)||w&&H.filtered.test(S))){if(I.$row=o.eq(l),I.rowIndex=l,I.cacheArray=s[l],i=I.cacheArray[F.columns],I.rawArray=i.raw,I.childRowText="",!R.filter_childByColumn){for(S="",u=i.child,y=0;y<u.length;y++)S+=" "+u[y].join(" ")||"";I.childRowText=R.filter_childRows?R.filter_ignoreCase?S.toLowerCase():S:""}if(p=!1,h=D.processRow(F,I,k),n=i.$row,b=!!h,u=i.$row.filter(":gt(0)"),R.filter_childRows&&u.length){if(R.filter_childByColumn)for(R.filter_childWithSibs||(u.addClass(R.filter_filteredRow),n=n.eq(0)),y=0;y<u.length;y++)I.$row=u.eq(y),I.cacheArray=i.child[y],I.rawArray=I.cacheArray,b=D.processRow(F,I,k),p=p||b,!R.filter_childWithSibs&&b&&u.eq(y).removeClass(R.filter_filteredRow);p=p||h}else p=b;n.toggleClass(R.filter_filteredRow,!p)[0].display=p?"":"none"}}F.filteredRows+=o.not("."+R.filter_filteredRow).length,F.totalRows+=o.length,N.processTbody(e,d,!1)}F.lastCombinedFilter=z.join(""),F.lastSearch=z,F.$table.data("lastSearch",z),R.filter_saveFilters&&N.storage&&N.storage(e,"tablesorter-filters",D.processFilters(z,!0)),T&&console.log("Filter >> Completed search"+N.benchmark(m)),R.filter_initialized&&(F.$table.triggerHandler("filterBeforeEnd",F),F.$table.triggerHandler("filterEnd",F)),setTimeout(function(){N.applyWidget(F.table)},0)}},getOptionSource:function(e,t,r){var a=(e=A(e)[0]).config,s=!1,i=a.widgetOptions.filter_selectSource,o=a.$table.data("lastSearch")||[],n="function"==typeof i||N.getColumnData(e,i,t);if(r&&""!==o[t]&&(r=!1),!0===n)s=i(e,t,r);else{if(n instanceof A||"string"===A.type(n)&&0<=n.indexOf("</option>"))return n;if(A.isArray(n))s=n;else if("object"===A.type(i)&&n&&null===(s=n(e,t,r)))return null}return!1===s&&(s=D.getOptions(e,t,r)),D.processOptions(e,t,s)},processOptions:function(s,i,r){if(!A.isArray(r))return!1;var o,e,t,a,n,l,c=(s=A(s)[0]).config,d=null!=i&&0<=i&&i<c.columns,f=d&&c.$headerIndexed[i].hasClass("filter-select-sort-desc"),u=[];if(r=A.grep(r,function(e,t){return!!e.text||A.inArray(e,r)===t}),d&&c.$headerIndexed[i].hasClass("filter-select-nosort"))return r;for(a=r.length,t=0;t<a;t++)l=(e=r[t]).text?e.text:e,n=(d&&c.parsers&&c.parsers.length&&c.parsers[i].format(l,s,[],i)||l).toString(),n=c.widgetOptions.filter_ignoreCase?n.toLowerCase():n,e.text?(e.parsed=n,u[u.length]=e):u[u.length]={text:e,parsed:n};for(o=c.textSorter||"",u.sort(function(e,t){var r=f?t.parsed:e.parsed,a=f?e.parsed:t.parsed;return d&&"function"==typeof o?o(r,a,!0,i,s):d&&"object"==typeof o&&o.hasOwnProperty(i)?o[i](r,a,!0,i,s):!N.sortNatural||N.sortNatural(r,a)}),r=[],a=u.length,t=0;t<a;t++)r[r.length]=u[t];return r},getOptions:function(e,t,r){var a,s,i,o,n,l,c,d,f=(e=A(e)[0]).config,u=f.widgetOptions,g=[];for(s=0;s<f.$tbodies.length;s++)for(n=f.cache[s],i=f.cache[s].normalized.length,a=0;a<i;a++)if(o=n.row?n.row[a]:n.normalized[a][f.columns].$row[0],!r||!o.className.match(u.filter_filteredRow))if(u.filter_useParsedData||f.parsers[t].parsed||f.$headerIndexed[t].hasClass("filter-parsed")){if(g[g.length]=""+n.normalized[a][t],u.filter_childRows&&u.filter_childByColumn)for(d=n.normalized[a][f.columns].$row.length-1,l=0;l<d;l++)g[g.length]=""+n.normalized[a][f.columns].child[l][t]}else if(g[g.length]=n.normalized[a][f.columns].raw[t],u.filter_childRows&&u.filter_childByColumn)for(d=n.normalized[a][f.columns].$row.length,l=1;l<d;l++)c=n.normalized[a][f.columns].$row.eq(l).children().eq(t),g[g.length]=""+N.getElementText(f,c,t);return g},buildSelect:function(e,t,r,a,s){if(e=A(e)[0],t=parseInt(t,10),e.config.cache&&!A.isEmptyObject(e.config.cache)){var i,o,n,l,c,d,f,u=e.config,g=u.widgetOptions,p=u.$headerIndexed[t],h='<option value="">'+(p.data("placeholder")||p.attr("data-placeholder")||g.filter_placeholder.select||"")+"</option>",m=u.$table.find("thead").find("select."+b.filter+'[data-column="'+t+'"]').val();if(void 0!==r&&""!==r||null!==(r=D.getOptionSource(e,t,s))){if(A.isArray(r)){for(i=0;i<r.length;i++)if((f=r[i]).text){for(o in f["data-function-name"]=void 0===f.value?f.text:f.value,h+="<option",f)f.hasOwnProperty(o)&&"text"!==o&&(h+=" "+o+'="'+f[o].replace(H.quote,"&quot;")+'"');f.value||(h+=' value="'+f.text.replace(H.quote,"&quot;")+'"'),h+=">"+f.text.replace(H.quote,"&quot;")+"</option>"}else""+f!="[object Object]"&&(0<=(o=n=f=(""+f).replace(H.quote,"&quot;")).indexOf(g.filter_selectSourceSeparator)&&(o=(l=n.split(g.filter_selectSourceSeparator))[0],n=l[1]),h+=""!==f?"<option "+(o===n?"":'data-function-name="'+f+'" ')+'value="'+o+'">'+n+"</option>":"");r=[]}c=(u.$filters?u.$filters:u.$table.children("thead")).find("."+b.filter),g.filter_$externalFilters&&(c=c&&c.length?c.add(g.filter_$externalFilters):g.filter_$externalFilters),(d=c.filter('select[data-column="'+t+'"]')).length&&(d[a?"html":"append"](h),A.isArray(r)||d.append(r).val(m),d.val(m))}}},buildDefault:function(e,t){var r,a,s,i=e.config,o=i.widgetOptions,n=i.columns;for(r=0;r<n;r++)s=!((a=i.$headerIndexed[r]).hasClass("filter-false")||a.hasClass("parser-false")),(a.hasClass("filter-select")||!0===N.getColumnData(e,o.filter_functions,r))&&s&&D.buildSelect(e,r,"",t,a.hasClass(o.filter_onlyAvail))}}).regex,N.getFilters=function(e,t,r,a){var s,i,o,n,l=[],c=e?A(e)[0].config:"",d=c?c.widgetOptions:"";if(!0!==t&&d&&!d.filter_columnFilters||A.isArray(r)&&D.equalFilters(c,r,c.lastSearch))return A(e).data("lastSearch")||[];if(c&&(c.$filters&&(i=c.$filters.find("."+b.filter)),d.filter_$externalFilters&&(i=i&&i.length?i.add(d.filter_$externalFilters):d.filter_$externalFilters),i&&i.length))for(l=r||[],s=0;s<c.columns+1;s++)n=s===c.columns?d.filter_anyColumnSelector+","+d.filter_multipleColumnSelector:'[data-column="'+s+'"]',(o=i.filter(n)).length&&(o=D.getLatestSearch(o),A.isArray(r)?(a&&1<o.length&&(o=o.slice(1)),s===c.columns&&(o=(n=o.filter(d.filter_anyColumnSelector)).length?n:o),o.val(r[s]).trigger("change"+c.namespace)):(l[s]=o.val()||"",s===c.columns?o.slice(1).filter('[data-column*="'+o.attr("data-column")+'"]').val(l[s]):o.slice(1).val(l[s])),s===c.columns&&o.length&&(d.filter_$anyMatch=o));return l},N.setFilters=function(e,t,r,a){var s=e?A(e)[0].config:"",i=N.getFilters(e,!0,t,a);return void 0===r&&(r=!0),s&&r&&(s.lastCombinedFilter=null,s.lastSearch=[],D.searching(s.table,t,a),s.$table.triggerHandler("filterFomatterUpdate")),0!==i.length}}(e),function(S,z){"use strict";var F=S.tablesorter||{};function R(e,t){var r=isNaN(t.stickyHeaders_offset)?S(t.stickyHeaders_offset):[];return r.length?r.height()||0:parseInt(t.stickyHeaders_offset,10)||0}S.extend(F.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),F.addHeaderResizeEvent=function(e,t,r){if((e=S(e)[0]).config){var a=S.extend({},{timer:250},r),l=e.config,c=l.widgetOptions,s=function(e){var t,r,a,s,i,o,n=l.$headers.length;for(c.resize_flag=!0,r=[],t=0;t<n;t++)s=(a=l.$headers.eq(t)).data("savedSizes")||[0,0],i=a[0].offsetWidth,o=a[0].offsetHeight,i===s[0]&&o===s[1]||(a.data("savedSizes",[i,o]),r.push(a[0]));r.length&&!1!==e&&l.$table.triggerHandler("resize",[r]),c.resize_flag=!1};if(clearInterval(c.resize_timer),t)return c.resize_flag=!1;s(!1),c.resize_timer=setInterval(function(){c.resize_flag||s()},a.timer)}},F.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,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(e,r,p){if(!(r.$table.hasClass("hasStickyHeaders")||0<=S.inArray("filter",r.widgets)&&!r.$table.hasClass("hasFilters"))){var t,a,s,i,h=r.$table,m=S(p.stickyHeaders_attachTo||p.stickyHeaders_appendTo),o=r.namespace+"stickyheaders ",b=S(p.stickyHeaders_yScroll||p.stickyHeaders_attachTo||z),n=S(p.stickyHeaders_xScroll||p.stickyHeaders_attachTo||z),l=h.children("thead:first").children("tr").not(".sticky-false").children(),y=h.children("tfoot"),c=R(0,p),v=h.parent().closest("."+F.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],w=v.length?v.height():0,d=p.$sticky=h.clone().addClass("containsStickyHeaders "+F.css.sticky+" "+p.stickyHeaders+" "+r.namespace.slice(1)+"_extra_table").wrap('<div class="'+F.css.stickyWrap+'">'),x=d.parent().addClass(F.css.stickyHide).css({position:m.length?"absolute":"fixed",padding:parseInt(d.parent().parent().css("padding-left"),10),top:c+w,left:0,visibility:"hidden",zIndex:p.stickyHeaders_zIndex||2}),f=d.children("thead:first"),C="",u=function(e,t){var r,a,s,i,o,n=e.filter(":visible"),l=n.length;for(r=0;r<l;r++)i=t.filter(":visible").eq(r),a="border-box"===(o=n.eq(r)).css("box-sizing")?o.outerWidth():"collapse"===i.css("border-collapse")?z.getComputedStyle?parseFloat(z.getComputedStyle(o[0],null).width):(s=parseFloat(o.css("border-width")),o.outerWidth()-parseFloat(o.css("padding-left"))-parseFloat(o.css("padding-right"))-s):o.width(),i.css({width:a,"min-width":a,"max-width":a})},_=function(e){return!1===e&&v.length?h.position().left:m.length?parseInt(m.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-S(z).scrollLeft()},$=function(){x.css({left:_(),width:h.outerWidth()}),u(h,d),u(l,i)},g=function(e){if(h.is(":visible")){w=v.length?v.offset().top-b.scrollTop()+v.height():0;var t,r=h.offset(),a=R(0,p),s=S.isWindow(b[0]),i=s?b.scrollTop():v.length?parseInt(v[0].style.top,10):b.offset().top,o=m.length?i:b.scrollTop(),n=p.stickyHeaders_includeCaption?0:h.children("caption").height()||0,l=o+a+w-n,c=h.height()-(x.height()+(y.height()||0))-n,d=l>r.top&&l<r.top+c?"visible":"hidden",f="visible"==d?F.css.stickyVis:F.css.stickyHide,u=!x.hasClass(f),g={visibility:d};m.length&&(u=!0,g.top=s?l-m.offset().top:m.scrollTop()),(t=_(s))!==parseInt(x.css("left"),10)&&(u=!0,g.left=t),g.top=(g.top||0)+(!s&&v.length?v.height():a+w),u&&x.removeClass(F.css.stickyVis+" "+F.css.stickyHide).addClass(f).css(g),d===C&&!e||($(),C=d)}};if(m.length&&!m.css("position")&&m.css("position","relative"),d.attr("id")&&(d[0].id+=p.stickyHeaders_cloneId),d.find("> thead:gt(0), tr.sticky-false").hide(),d.find("> tbody, > tfoot").remove(),d.find("caption").toggle(p.stickyHeaders_includeCaption),i=f.children().children(),d.css({height:0,width:0,margin:0}),i.find("."+F.css.resizer).remove(),h.addClass("hasStickyHeaders").bind("pagerComplete"+o,function(){$()}),F.bindEvents(e,f.children().children("."+F.css.header)),p.stickyHeaders_appendTo?S(p.stickyHeaders_appendTo).append(x):h.after(x),r.onRenderHeader)for(a=(s=f.children("tr").children()).length,t=0;t<a;t++)r.onRenderHeader.apply(s.eq(t),[t,r,d]);n.add(b).unbind("scroll resize ".split(" ").join(o).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(o),function(e){g("resize"===e.type)}),r.$table.unbind("stickyHeadersUpdate"+o).bind("stickyHeadersUpdate"+o,function(){g(!0)}),p.stickyHeaders_addResizeEvent&&F.addHeaderResizeEvent(e),h.hasClass("hasFilters")&&p.filter_columnFilters&&(h.bind("filterEnd"+o,function(){var e=S(document.activeElement).closest("td"),t=e.parent().children().index(e);x.hasClass(F.css.stickyVis)&&p.stickyHeaders_filteredToTop&&(z.scrollTo(0,h.position().top),0<=t&&r.$filters&&r.$filters.eq(t).find("a, select, input").filter(":visible").focus())}),F.filter.bindSearch(h,i.find("."+F.css.filter)),p.filter_hideFilters&&F.filter.hideFilters(r,d)),p.stickyHeaders_addResizeEvent&&h.bind("resize"+r.namespace+"stickyheaders",function(){$()}),g(!0),h.triggerHandler("stickyHeadersInit")}},remove:function(e,t,r){var a=t.namespace+"stickyheaders ";t.$table.removeClass("hasStickyHeaders").unbind("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(a).replace(/\s+/g," ")).next("."+F.css.stickyWrap).remove(),r.$sticky&&r.$sticky.length&&r.$sticky.remove(),S(z).add(r.stickyHeaders_xScroll).add(r.stickyHeaders_yScroll).add(r.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(a).replace(/\s+/g," ")),F.addHeaderResizeEvent(e,!0)}})}(e,window),function(d,t){"use strict";var f=d.tablesorter||{};d.extend(f.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),d(function(){var e="<style>body."+f.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+f.css.resizableContainer+" { position: relative; height: 1px; }."+f.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";d("head").append(e)}),f.resizable={init:function(e,t){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable");var r,a,s,i,o=e.$table,n=o.parent(),l=parseInt(o.css("margin-top"),10),c=t.resizable_vars={useStorage:f.storage&&!1!==t.resizable,$wrap:n,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===n.css("overflow")||"scroll"===n.css("overflow")||"auto"===n.css("overflow-x")||"scroll"===n.css("overflow-x"),storedSizes:[]};for(f.resizableReset(e.table,!0),c.tableWidth=o.width(),c.fullWidth=Math.abs(n.width()-c.tableWidth)<20,c.useStorage&&c.overflow&&(f.storage(e.table,"tablesorter-table-original-css-width",c.tableWidth),i=f.storage(e.table,"tablesorter-table-resized-width")||"auto",f.resizable.setWidth(o,i,!0)),t.resizable_vars.storedSizes=s=(c.useStorage?f.storage(e.table,f.css.resizableStorage):[])||[],f.resizable.setWidths(e,t,s),f.resizable.updateStoredSizes(e,t),t.$resizable_container=d('<div class="'+f.css.resizableContainer+'">').css({top:l}).insertBefore(o),a=0;a<e.columns;a++)r=e.$headerIndexed[a],i=f.getColumnData(e.table,e.headers,a),"false"===f.getData(r,i,"resizable")||d('<div class="'+f.css.resizableHandle+'">').appendTo(t.$resizable_container).attr({"data-column":a,unselectable:"on"}).data("header",r).bind("selectstart",!1);f.resizable.bindings(e,t)}},updateStoredSizes:function(e,t){var r,a,s=e.columns,i=t.resizable_vars;for(i.storedSizes=[],r=0;r<s;r++)a=e.$headerIndexed[r],i.storedSizes[r]=a.is(":visible")?a.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(e,t,r){var a,s,i=t.resizable_vars,o=d(e.namespace+"_extra_headers"),n=e.$table.children("colgroup").children("col");if((r=r||i.storedSizes||[]).length){for(a=0;a<e.columns;a++)f.resizable.setWidth(e.$headerIndexed[a],r[a],i.overflow),o.length&&(s=o.eq(a).add(n.eq(a)),f.resizable.setWidth(s,r[a],i.overflow));(s=d(e.namespace+"_extra_table")).length&&!f.hasWidget(e.table,"scroller")&&f.resizable.setWidth(s,e.$table.outerWidth(),i.overflow)}},setHandlePosition:function(s,i){var o,n=s.$table.height(),e=i.$resizable_container.children(),l=Math.floor(e.width()/2);f.hasWidget(s.table,"scroller")&&(n=0,s.$table.closest("."+f.css.scrollerWrap).children().each(function(){var e=d(this);n+=e.filter('[style*="height"]').length?e.height():e.children("table").height()})),!i.resizable_includeFooter&&s.$table.children("tfoot").length&&(n-=s.$table.children("tfoot").height()),o=3.3<=parseFloat(d.fn.jquery)?0:s.$table.position().left,e.each(function(){var e=d(this),t=parseInt(e.attr("data-column"),10),r=s.columns-1,a=e.data("header");a&&(!a.is(":visible")||!i.resizable_addLastColumn&&f.resizable.checkVisibleColumns(s,t)?e.hide():(t<r||t===r&&i.resizable_addLastColumn)&&e.css({display:"inline-block",height:n,left:a.position().left-o+a.outerWidth()-l}))})},checkVisibleColumns:function(e,t){var r,a=0;for(r=t+1;r<e.columns;r++)a+=e.$headerIndexed[r].is(":visible")?1:0;return 0===a},toggleTextSelection:function(e,t,r){var a=e.namespace+"tsresize";t.resizable_vars.disabled=r,d("body").toggleClass(f.css.resizableNoSelect,r),r?d("body").attr("unselectable","on").bind("selectstart"+a,!1):d("body").removeAttr("unselectable").unbind("selectstart"+a)},bindings:function(i,o){var e=i.namespace+"tsresize";o.$resizable_container.children().bind("mousedown",function(e){var t,r=o.resizable_vars,a=d(i.namespace+"_extra_headers"),s=d(e.target).data("header");t=parseInt(s.attr("data-column"),10),r.$target=s=s.add(a.filter('[data-column="'+t+'"]')),r.target=t,r.$next=e.shiftKey||o.resizable_targetLast?s.parent().children().not(".resizable-false").filter(":last"):s.nextAll(":not(.resizable-false)").eq(0),t=parseInt(r.$next.attr("data-column"),10),r.$next=r.$next.add(a.filter('[data-column="'+t+'"]')),r.next=t,r.mouseXPosition=e.pageX,f.resizable.updateStoredSizes(i,o),f.resizable.toggleTextSelection(i,o,!0)}),d(document).bind("mousemove"+e,function(e){var t=o.resizable_vars;t.disabled&&0!==t.mouseXPosition&&t.$target&&(o.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){f.resizable.mouseMove(i,o,e)},isNaN(o.resizable_throttle)?5:o.resizable_throttle)):f.resizable.mouseMove(i,o,e))}).bind("mouseup"+e,function(){o.resizable_vars.disabled&&(f.resizable.toggleTextSelection(i,o,!1),f.resizable.stopResize(i,o),f.resizable.setHandlePosition(i,o))}),d(t).bind("resize"+e+" resizeEnd"+e,function(){f.resizable.setHandlePosition(i,o)}),i.$table.bind("columnUpdate pagerComplete resizableUpdate ".split(" ").join(e+" "),function(){f.resizable.setHandlePosition(i,o)}).bind("resizableReset"+e,function(){f.resizableReset(i.table)}).find("thead:first").add(d(i.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+e,function(){var e=0===o.resizable_vars.storedSizes.length;return f.resizableReset(i.table),f.resizable.setHandlePosition(i,o),o.resizable_vars.storedSizes=[],e})},mouseMove:function(e,t,r){if(0!==t.resizable_vars.mouseXPosition&&t.resizable_vars.$target){var a,s=0,i=t.resizable_vars,o=i.$next,n=i.storedSizes[i.target],l=r.pageX-i.mouseXPosition;if(i.overflow){if(0<n+l){for(i.storedSizes[i.target]+=l,f.resizable.setWidth(i.$target,i.storedSizes[i.target],!0),a=0;a<e.columns;a++)s+=i.storedSizes[a];f.resizable.setWidth(e.$table.add(d(e.namespace+"_extra_table")),s)}o.length||(i.$wrap[0].scrollLeft=e.$table.width())}else i.fullWidth?(i.storedSizes[i.target]+=l,i.storedSizes[i.next]-=l):i.storedSizes[i.target]+=l,f.resizable.setWidths(e,t);i.mouseXPosition=r.pageX,e.$table.triggerHandler("stickyHeadersUpdate")}},stopResize:function(e,t){var r=t.resizable_vars;f.resizable.updateStoredSizes(e,t),r.useStorage&&(f.storage(e.table,f.css.resizableStorage,r.storedSizes),f.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),r.mouseXPosition=0,r.$target=r.$next=null,e.$table.triggerHandler("stickyHeadersUpdate"),e.$table.triggerHandler("resizableComplete")}},f.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_includeFooter:!0,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,r,a){f.resizable.init(r,a)},format:function(e,t,r){f.resizable.setHandlePosition(t,r)},remove:function(e,t,r,a){if(r.$resizable_container){var s=t.namespace+"tsresize";t.$table.add(d(t.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+s),r.$resizable_container.remove(),f.resizable.toggleTextSelection(t,r,!1),f.resizableReset(e,a),d(document).unbind("mousemove"+s+" mouseup"+s)}}}),f.resizableReset=function(i,o){d(i).each(function(){var e,t,r=this.config,a=r&&r.widgetOptions,s=a.resizable_vars;if(i&&r&&r.$headerIndexed.length){for(s.overflow&&s.tableWidth&&(f.resizable.setWidth(r.$table,s.tableWidth,!0),s.useStorage&&f.storage(i,"tablesorter-table-resized-width",s.tableWidth)),e=0;e<r.columns;e++)t=r.$headerIndexed[e],a.resizable_widths&&a.resizable_widths[e]?f.resizable.setWidth(t,a.resizable_widths[e],s.overflow):t.hasClass("resizable-false")||f.resizable.setWidth(t,"",s.overflow);r.$table.triggerHandler("stickyHeadersUpdate"),f.storage&&!o&&f.storage(this,f.css.resizableStorage,[])}})}}(e,window),function(r){"use strict";var c=r.tablesorter||{};function d(e){var t=c.storage(e.table,"tablesorter-savesort");return t&&t.hasOwnProperty("sortList")&&r.isArray(t.sortList)?t.sortList:[]}function f(e,t){return(t||d(e)).join(",")!==e.sortList.join(",")}c.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,a){t.format(e,r,a,!0)},format:function(t,e,r,a){var s,i=e.$table,o=!1!==r.saveSort,n={sortList:e.sortList},l=c.debug(e,"saveSort");l&&(s=new Date),i.hasClass("hasSaveSort")?o&&t.hasInitialized&&c.storage&&f(e)&&(c.storage(t,"tablesorter-savesort",n),l&&console.log("saveSort >> Saving last sort: "+e.sortList+c.benchmark(s))):(i.addClass("hasSaveSort"),n="",c.storage&&(n=d(e),l&&console.log('saveSort >> Last sort loaded: "'+n+'"'+c.benchmark(s)),i.bind("saveSortReset",function(e){e.stopPropagation(),c.storage(t,"tablesorter-savesort","")})),a&&n&&0<n.length?e.sortList=n:t.hasInitialized&&n&&0<n.length&&f(e,n)&&c.sortOn(e,n))},remove:function(e,t){t.$table.removeClass("hasSaveSort"),c.storage&&c.storage(e,"tablesorter-savesort","")}})}(e),e.tablesorter});return jQuery;}));
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.js b/web/_static/tablesorter/js/jquery.tablesorter.js
new file mode 100644
index 0000000..0ecb1b4
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.js
@@ -0,0 +1,2916 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+/*! TableSorter (FORK) v2.31.3 *//*
+* Client-side table sorting with ease!
+* @requires jQuery v1.2.6+
+*
+* Copyright (c) 2007 Christian Bach
+* fork maintained by Rob Garrison
+*
+* Examples and original docs at: http://tablesorter.com
+* Dual licensed under the MIT and GPL licenses:
+* http://www.opensource.org/licenses/mit-license.php
+* http://www.gnu.org/licenses/gpl.html
+*
+* @type jQuery
+* @name tablesorter (FORK)
+* @cat Plugins/Tablesorter
+* @author Christian Bach - christian.bach@polyester.se
+* @contributor Rob Garrison - https://github.com/Mottie/tablesorter
+* @docs (fork) - https://mottie.github.io/tablesorter/docs/
+*/
+/*jshint browser:true, jquery:true, unused:false, expr: true */
+;( function( $ ) {
+ 'use strict';
+ var ts = $.tablesorter = {
+
+ version : '2.31.3',
+
+ parsers : [],
+ widgets : [],
+ defaults : {
+
+ // *** appearance
+ theme : 'default', // adds tablesorter-{theme} to the table for styling
+ widthFixed : false, // adds colgroup to fix widths of columns
+ showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
+
+ headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
+ onRenderHeader : null, // function( index ) {}, // nothing to return
+
+ // *** functionality
+ cancelSelection : true, // prevent text selection in the header
+ tabIndex : true, // add tabindex to header for keyboard accessibility
+ dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
+ sortMultiSortKey : 'shiftKey', // key used to select additional columns
+ sortResetKey : 'ctrlKey', // key used to remove sorting on a column
+ usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
+ delayInit : false, // if false, the parsed table contents will not update until the first sort
+ serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
+ resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
+
+ // *** sort options
+ headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
+ ignoreCase : true, // ignore case while sorting
+ sortForce : null, // column(s) first sorted; always applied
+ sortList : [], // Initial sort order; applied initially; updated when manually sorted
+ sortAppend : null, // column(s) sorted last; always applied
+ sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained
+
+ sortInitialOrder : 'asc', // sort direction on first click
+ sortLocaleCompare: false, // replace equivalent character (accented characters)
+ sortReset : false, // third click on the header will reset column to default - unsorted
+ sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
+
+ emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
+ stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
+ duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
+ textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
+ textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
+ numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
+
+ // *** widget options
+ initWidgets : true, // apply widgets on tablesorter initialization
+ widgetClass : 'widget-{name}', // table class name template to match to include a widget
+ widgets : [], // method to add widgets, e.g. widgets: ['zebra']
+ widgetOptions : {
+ zebra : [ 'even', 'odd' ] // zebra widget alternating row class names
+ },
+
+ // *** callbacks
+ initialized : null, // function( table ) {},
+
+ // *** extra css class names
+ tableClass : '',
+ cssAsc : '',
+ cssDesc : '',
+ cssNone : '',
+ cssHeader : '',
+ cssHeaderRow : '',
+ cssProcessing : '', // processing icon applied to header during sort/filter
+
+ cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to its parent
+ cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!)
+ cssNoSort : 'tablesorter-noSort', // class name added to element inside header; clicking on it won't cause a sort
+ cssIgnoreRow : 'tablesorter-ignoreRow',// header row to ignore; cells within this row will not be added to c.$headers
+
+ cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate
+ cssIconNone : '', // class name added to the icon when there is no column sort
+ cssIconAsc : '', // class name added to the icon when the column has an ascending sort
+ cssIconDesc : '', // class name added to the icon when the column has a descending sort
+ cssIconDisabled : '', // class name added to the icon when the column has a disabled sort
+
+ // *** events
+ pointerClick : 'click',
+ pointerDown : 'mousedown',
+ pointerUp : 'mouseup',
+
+ // *** selectors
+ selectorHeaders : '> thead th, > thead td',
+ selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort
+ selectorRemove : '.remove-me',
+
+ // *** advanced
+ debug : false,
+
+ // *** Internal variables
+ headerList: [],
+ empties: {},
+ strings: {},
+ parsers: [],
+
+ // *** parser options for validator; values must be falsy!
+ globalize: 0,
+ imgAttr: 0
+
+ // removed: widgetZebra: { css: ['even', 'odd'] }
+
+ },
+
+ // internal css classes - these will ALWAYS be added to
+ // the table and MUST only contain one class name - fixes #381
+ 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'
+ },
+
+ // labels applied to sortable headers for accessibility (aria) support
+ language : {
+ sortAsc : 'Ascending sort applied, ',
+ sortDesc : 'Descending sort applied, ',
+ sortNone : 'No sort applied, ',
+ sortDisabled : 'sorting is disabled',
+ nextAsc : 'activate to apply an ascending sort',
+ nextDesc : 'activate to apply a descending sort',
+ nextNone : 'activate to remove the sort'
+ },
+
+ regex : {
+ templateContent : /\{content\}/g,
+ templateIcon : /\{icon\}/g,
+ templateName : /\{name\}/i,
+ spaces : /\s+/g,
+ nonWord : /\W/g,
+ formElements : /(input|select|button|textarea)/i,
+
+ // *** sort functions ***
+ // regex used in natural sort
+ // chunk/tokenize numbers & letters
+ chunk : /(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,
+ // replace chunks @ ends
+ chunks : /(^\\0|\\0$)/,
+ hex : /^0x[0-9a-f]+$/i,
+
+ // *** formatFloat ***
+ comma : /,/g,
+ digitNonUS : /[\s|\.]/g,
+ digitNegativeTest : /^\s*\([.\d]+\)/,
+ digitNegativeReplace : /^\s*\(([.\d]+)\)/,
+
+ // *** isDigit ***
+ digitTest : /^[\-+(]?\d+[)]?$/,
+ digitReplace : /[,.'"\s]/g
+
+ },
+
+ // digit sort, text location
+ string : {
+ max : 1,
+ min : -1,
+ emptymin : 1,
+ emptymax : -1,
+ zero : 0,
+ none : 0,
+ 'null' : 0,
+ top : true,
+ bottom : false
+ },
+
+ keyCodes : {
+ enter : 13
+ },
+
+ // placeholder date parser data (globalize)
+ dates : {},
+
+ // These methods can be applied on table.config instance
+ instanceMethods : {},
+
+ /*
+ ▄█████ ██████ ██████ ██ ██ █████▄
+ ▀█▄ ██▄▄ ██ ██ ██ ██▄▄██
+ ▀█▄ ██▀▀ ██ ██ ██ ██▀▀▀
+ █████▀ ██████ ██ ▀████▀ ██
+ */
+
+ setup : function( table, c ) {
+ // if no thead or tbody, or tablesorter is already present, quit
+ if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
+ if ( ts.debug(c, 'core') ) {
+ if ( table.hasInitialized ) {
+ console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
+ } else {
+ console.error( 'Stopping initialization! No table, thead or tbody', table );
+ }
+ }
+ return;
+ }
+
+ var tmp = '',
+ $table = $( table ),
+ meta = $.metadata;
+ // initialization flag
+ table.hasInitialized = false;
+ // table is being processed flag
+ table.isProcessing = true;
+ // make sure to store the config object
+ table.config = c;
+ // save the settings where they read
+ $.data( table, 'tablesorter', c );
+ if ( ts.debug(c, 'core') ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
+ $.data( table, 'startoveralltimer', new Date() );
+ }
+
+ // removing this in version 3 (only supports jQuery 1.7+)
+ c.supportsDataObject = ( function( version ) {
+ version[ 0 ] = parseInt( version[ 0 ], 10 );
+ return ( version[ 0 ] > 1 ) || ( version[ 0 ] === 1 && parseInt( version[ 1 ], 10 ) >= 4 );
+ })( $.fn.jquery.split( '.' ) );
+ // ensure case insensitivity
+ c.emptyTo = c.emptyTo.toLowerCase();
+ c.stringTo = c.stringTo.toLowerCase();
+ c.last = { sortList : [], clickedIndex : -1 };
+ // add table theme class only if there isn't already one there
+ if ( !/tablesorter\-/.test( $table.attr( 'class' ) ) ) {
+ tmp = ( c.theme !== '' ? ' tablesorter-' + c.theme : '' );
+ }
+
+ // give the table a unique id, which will be used in namespace binding
+ if ( !c.namespace ) {
+ c.namespace = '.tablesorter' + Math.random().toString( 16 ).slice( 2 );
+ } else {
+ // make sure namespace starts with a period & doesn't have weird characters
+ c.namespace = '.' + c.namespace.replace( ts.regex.nonWord, '' );
+ }
+
+ c.table = table;
+ c.$table = $table
+ // add namespace to table to allow bindings on extra elements to target
+ // the parent table (e.g. parser-input-select)
+ .addClass( ts.css.table + ' ' + c.tableClass + tmp + ' ' + c.namespace.slice(1) )
+ .attr( 'role', 'grid' );
+ c.$headers = $table.find( c.selectorHeaders );
+
+ c.$table.children().children( 'tr' ).attr( 'role', 'row' );
+ c.$tbodies = $table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ).attr({
+ 'aria-live' : 'polite',
+ 'aria-relevant' : 'all'
+ });
+ if ( c.$table.children( 'caption' ).length ) {
+ tmp = c.$table.children( 'caption' )[ 0 ];
+ if ( !tmp.id ) { tmp.id = c.namespace.slice( 1 ) + 'caption'; }
+ c.$table.attr( 'aria-labelledby', tmp.id );
+ }
+ c.widgetInit = {}; // keep a list of initialized widgets
+ // change textExtraction via data-attribute
+ c.textExtraction = c.$table.attr( 'data-text-extraction' ) || c.textExtraction || 'basic';
+ // build headers
+ ts.buildHeaders( c );
+ // fixate columns if the users supplies the fixedWidth option
+ // do this after theme has been applied
+ ts.fixColumnWidth( table );
+ // add widgets from class name
+ ts.addWidgetFromClass( table );
+ // add widget options before parsing (e.g. grouping widget has parser settings)
+ ts.applyWidgetOptions( table );
+ // try to auto detect column type, and store in tables config
+ ts.setupParsers( c );
+ // start total row count at zero
+ c.totalRows = 0;
+ // only validate options while debugging. See #1528
+ if (c.debug) {
+ ts.validateOptions( c );
+ }
+ // build the cache for the tbody cells
+ // delayInit will delay building the cache until the user starts a sort
+ if ( !c.delayInit ) { ts.buildCache( c ); }
+ // bind all header events and methods
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ // get sort list from jQuery data or metadata
+ // in jQuery < 1.4, an error occurs when calling $table.data()
+ if ( c.supportsDataObject && typeof $table.data().sortlist !== 'undefined' ) {
+ c.sortList = $table.data().sortlist;
+ } else if ( meta && ( $table.metadata() && $table.metadata().sortlist ) ) {
+ c.sortList = $table.metadata().sortlist;
+ }
+ // apply widget init code
+ ts.applyWidget( table, true );
+ // if user has supplied a sort list to constructor
+ if ( c.sortList.length > 0 ) {
+ // save sortList before any sortAppend is added
+ c.last.sortList = c.sortList;
+ ts.sortOn( c, c.sortList, {}, !c.initWidgets );
+ } else {
+ ts.setHeadersCss( c );
+ if ( c.initWidgets ) {
+ // apply widget format
+ ts.applyWidget( table, false );
+ }
+ }
+
+ // show processesing icon
+ if ( c.showProcessing ) {
+ $table
+ .unbind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace )
+ .bind( 'sortBegin' + c.namespace + ' sortEnd' + c.namespace, function( e ) {
+ clearTimeout( c.timerProcessing );
+ ts.isProcessing( table );
+ if ( e.type === 'sortBegin' ) {
+ c.timerProcessing = setTimeout( function() {
+ ts.isProcessing( table, true );
+ }, 500 );
+ }
+ });
+ }
+
+ // initialized
+ table.hasInitialized = true;
+ table.isProcessing = false;
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
+ }
+ $table.triggerHandler( 'tablesorter-initialized', table );
+ if ( typeof c.initialized === 'function' ) {
+ c.initialized( table );
+ }
+ },
+
+ bindMethods : function( c ) {
+ var $table = c.$table,
+ namespace = c.namespace,
+ events = ( 'sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete ' +
+ 'sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup ' +
+ 'mouseleave ' ).split( ' ' )
+ .join( namespace + ' ' );
+ // apply easy methods that trigger bound events
+ $table
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'sortReset' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // using this.config to ensure functions are getting a non-cached version of the config
+ ts.sortReset( this.config, function( table ) {
+ if (table.isApplyingWidgets) {
+ // multiple triggers in a row... filterReset, then sortReset - see #1361
+ // wait to update widgets
+ setTimeout( function() {
+ ts.applyWidget( table, '', callback );
+ }, 100 );
+ } else {
+ ts.applyWidget( table, '', callback );
+ }
+ });
+ })
+ .bind( 'updateAll' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.updateAll( this.config, resort, callback );
+ })
+ .bind( 'update' + namespace + ' updateRows' + namespace, function( e, resort, callback ) {
+ e.stopPropagation();
+ ts.update( this.config, resort, callback );
+ })
+ .bind( 'updateHeaders' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ ts.updateHeaders( this.config, callback );
+ })
+ .bind( 'updateCell' + namespace, function( e, cell, resort, callback ) {
+ e.stopPropagation();
+ ts.updateCell( this.config, cell, resort, callback );
+ })
+ .bind( 'addRows' + namespace, function( e, $row, resort, callback ) {
+ e.stopPropagation();
+ ts.addRows( this.config, $row, resort, callback );
+ })
+ .bind( 'updateComplete' + namespace, function() {
+ this.isUpdating = false;
+ })
+ .bind( 'sorton' + namespace, function( e, list, callback, init ) {
+ e.stopPropagation();
+ ts.sortOn( this.config, list, callback, init );
+ })
+ .bind( 'appendCache' + namespace, function( e, callback, init ) {
+ e.stopPropagation();
+ ts.appendCache( this.config, init );
+ if ( $.isFunction( callback ) ) {
+ callback( this );
+ }
+ })
+ // $tbodies variable is used by the tbody sorting widget
+ .bind( 'updateCache' + namespace, function( e, callback, $tbodies ) {
+ e.stopPropagation();
+ ts.updateCache( this.config, callback, $tbodies );
+ })
+ .bind( 'applyWidgetId' + namespace, function( e, id ) {
+ e.stopPropagation();
+ ts.applyWidgetId( this, id );
+ })
+ .bind( 'applyWidgets' + namespace, function( e, callback ) {
+ e.stopPropagation();
+ // apply widgets (false = not initializing)
+ ts.applyWidget( this, false, callback );
+ })
+ .bind( 'refreshWidgets' + namespace, function( e, all, dontapply ) {
+ e.stopPropagation();
+ ts.refreshWidgets( this, all, dontapply );
+ })
+ .bind( 'removeWidget' + namespace, function( e, name, refreshing ) {
+ e.stopPropagation();
+ ts.removeWidget( this, name, refreshing );
+ })
+ .bind( 'destroy' + namespace, function( e, removeClasses, callback ) {
+ e.stopPropagation();
+ ts.destroy( this, removeClasses, callback );
+ })
+ .bind( 'resetToLoadState' + namespace, function( e ) {
+ e.stopPropagation();
+ // remove all widgets
+ ts.removeWidget( this, true, false );
+ var tmp = $.extend( true, {}, c.originalSettings );
+ // restore original settings; this clears out current settings, but does not clear
+ // values saved to storage.
+ c = $.extend( true, {}, ts.defaults, tmp );
+ c.originalSettings = tmp;
+ this.hasInitialized = false;
+ // setup the entire table again
+ ts.setup( this, c );
+ });
+ },
+
+ bindEvents : function( table, $headers, core ) {
+ table = $( table )[ 0 ];
+ var tmp,
+ c = table.config,
+ namespace = c.namespace,
+ downTarget = null;
+ if ( core !== true ) {
+ $headers.addClass( namespace.slice( 1 ) + '_extra_headers' );
+ tmp = ts.getClosest( $headers, 'table' );
+ if ( tmp.length && tmp[ 0 ].nodeName === 'TABLE' && tmp[ 0 ] !== table ) {
+ $( tmp[ 0 ] ).addClass( namespace.slice( 1 ) + '_extra_table' );
+ }
+ }
+ tmp = ( c.pointerDown + ' ' + c.pointerUp + ' ' + c.pointerClick + ' sort keyup ' )
+ .replace( ts.regex.spaces, ' ' )
+ .split( ' ' )
+ .join( namespace + ' ' );
+ // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc)
+ $headers
+ // http://stackoverflow.com/questions/5312849/jquery-find-self;
+ .find( c.selectorSort )
+ .add( $headers.filter( c.selectorSort ) )
+ .unbind( tmp )
+ .bind( tmp, function( e, external ) {
+ var $cell, cell, temp,
+ $target = $( e.target ),
+ // wrap event type in spaces, so the match doesn't trigger on inner words
+ type = ' ' + e.type + ' ';
+ // only recognize left clicks
+ if ( ( ( e.which || e.button ) !== 1 && !type.match( ' ' + c.pointerClick + ' | sort | keyup ' ) ) ||
+ // allow pressing enter
+ ( type === ' keyup ' && e.which !== ts.keyCodes.enter ) ||
+ // allow triggering a click event (e.which is undefined) & ignore physical clicks
+ ( type.match( ' ' + c.pointerClick + ' ' ) && typeof e.which !== 'undefined' ) ) {
+ return;
+ }
+ // ignore mouseup if mousedown wasn't on the same target
+ if ( type.match( ' ' + c.pointerUp + ' ' ) && downTarget !== e.target && external !== true ) {
+ return;
+ }
+ // set target on mousedown
+ if ( type.match( ' ' + c.pointerDown + ' ' ) ) {
+ downTarget = e.target;
+ // preventDefault needed or jQuery v1.3.2 and older throws an
+ // "Uncaught TypeError: handler.apply is not a function" error
+ temp = $target.jquery.split( '.' );
+ if ( temp[ 0 ] === '1' && temp[ 1 ] < 4 ) { e.preventDefault(); }
+ return;
+ }
+ downTarget = null;
+ $cell = ts.getClosest( $( this ), '.' + ts.css.header );
+ // prevent sort being triggered on form elements
+ if ( ts.regex.formElements.test( e.target.nodeName ) ||
+ // nosort class name, or elements within a nosort container
+ $target.hasClass( c.cssNoSort ) || $target.parents( '.' + c.cssNoSort ).length > 0 ||
+ // disabled cell directly clicked
+ $cell.hasClass( 'sorter-false' ) ||
+ // elements within a button
+ $target.parents( 'button' ).length > 0 ) {
+ return !c.cancelSelection;
+ }
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ // use column index from data-attribute or index of current row; fixes #1116
+ c.last.clickedIndex = $cell.attr( 'data-column' ) || $cell.index();
+ cell = c.$headerIndexed[ c.last.clickedIndex ][0];
+ if ( cell && !cell.sortDisabled ) {
+ ts.initSort( c, cell, e );
+ }
+ });
+ if ( c.cancelSelection ) {
+ // cancel selection
+ $headers
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart', false )
+ .css({
+ 'user-select' : 'none',
+ 'MozUserSelect' : 'none' // not needed for jQuery 1.8+
+ });
+ }
+ },
+
+ buildHeaders : function( c ) {
+ var $temp, icon, timer, indx;
+ c.headerList = [];
+ c.headerContent = [];
+ c.sortVars = [];
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ // children tr in tfoot - see issue #196 & #547
+ // don't pass table.config to computeColumnIndex here - widgets (math) pass it to "quickly" index tbody cells
+ c.columns = ts.computeColumnIndex( c.$table.children( 'thead, tfoot' ).children( 'tr' ) );
+ // add icon if cssIcon option exists
+ icon = c.cssIcon ?
+ '<i class="' + ( c.cssIcon === ts.css.icon ? ts.css.icon : c.cssIcon + ' ' + ts.css.icon ) + '"></i>' :
+ '';
+ // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683
+ c.$headers = $( $.map( c.$table.find( c.selectorHeaders ), function( elem, index ) {
+ var configHeaders, header, column, template, tmp,
+ $elem = $( elem );
+ // ignore cell (don't add it to c.$headers) if row has ignoreRow class
+ if ( ts.getClosest( $elem, 'tr' ).hasClass( c.cssIgnoreRow ) ) { return; }
+ // transfer data-column to element if not th/td - #1459
+ if ( !/(th|td)/i.test( elem.nodeName ) ) {
+ tmp = ts.getClosest( $elem, 'th, td' );
+ $elem.attr( 'data-column', tmp.attr( 'data-column' ) );
+ }
+ // make sure to get header cell & not column indexed cell
+ configHeaders = ts.getColumnData( c.table, c.headers, index, true );
+ // save original header content
+ c.headerContent[ index ] = $elem.html();
+ // if headerTemplate is empty, don't reformat the header cell
+ if ( c.headerTemplate !== '' && !$elem.find( '.' + ts.css.headerIn ).length ) {
+ // set up header template
+ template = c.headerTemplate
+ .replace( ts.regex.templateContent, $elem.html() )
+ .replace( ts.regex.templateIcon, $elem.find( '.' + ts.css.icon ).length ? '' : icon );
+ if ( c.onRenderTemplate ) {
+ header = c.onRenderTemplate.apply( $elem, [ index, template ] );
+ // only change t if something is returned
+ if ( header && typeof header === 'string' ) {
+ template = header;
+ }
+ }
+ $elem.html( '<div class="' + ts.css.headerIn + '">' + template + '</div>' ); // faster than wrapInner
+ }
+ if ( c.onRenderHeader ) {
+ c.onRenderHeader.apply( $elem, [ index, c, c.$table ] );
+ }
+ column = parseInt( $elem.attr( 'data-column' ), 10 );
+ elem.column = column;
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
+ // this may get updated numerous times if there are multiple rows
+ c.sortVars[ column ] = {
+ count : -1, // set to -1 because clicking on the header automatically adds one
+ order : tmp ?
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
+ lockedOrder : false,
+ sortedBy : ''
+ };
+ tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
+ if ( typeof tmp !== 'undefined' && tmp !== false ) {
+ c.sortVars[ column ].lockedOrder = true;
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
+ }
+ // add cell to headerList
+ c.headerList[ index ] = elem;
+ $elem.addClass( ts.css.header + ' ' + c.cssHeader );
+ // add to parent in case there are multiple rows
+ ts.getClosest( $elem, 'tr' )
+ .addClass( ts.css.headerRow + ' ' + c.cssHeaderRow )
+ .attr( 'role', 'row' );
+ // allow keyboard cursor to focus on element
+ if ( c.tabIndex ) {
+ $elem.attr( 'tabindex', 0 );
+ }
+ return elem;
+ }) );
+ // cache headers per column
+ c.$headerIndexed = [];
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ // colspan in header making a column undefined
+ if ( ts.isEmptyObject( c.sortVars[ indx ] ) ) {
+ c.sortVars[ indx ] = {};
+ }
+ // Use c.$headers.parent() in case selectorHeaders doesn't point to the th/td
+ $temp = c.$headers.filter( '[data-column="' + indx + '"]' );
+ // target sortable column cells, unless there are none, then use non-sortable cells
+ // .last() added in jQuery 1.4; use .filter(':last') to maintain compatibility with jQuery v1.2.6
+ c.$headerIndexed[ indx ] = $temp.length ?
+ $temp.not( '.sorter-false' ).length ?
+ $temp.not( '.sorter-false' ).filter( ':last' ) :
+ $temp.filter( ':last' ) :
+ $();
+ }
+ c.$table.find( c.selectorHeaders ).attr({
+ scope: 'col',
+ role : 'columnheader'
+ });
+ // enable/disable sorting
+ ts.updateHeader( c );
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Built headers:' + ts.benchmark( timer ) );
+ console.log( c.$headers );
+ }
+ },
+
+ // Use it to add a set of methods to table.config which will be available for all tables.
+ // This should be done before table initialization
+ addInstanceMethods : function( methods ) {
+ $.extend( ts.instanceMethods, methods );
+ },
+
+ /*
+ █████▄ ▄████▄ █████▄ ▄█████ ██████ █████▄ ▄█████
+ ██▄▄██ ██▄▄██ ██▄▄██ ▀█▄ ██▄▄ ██▄▄██ ▀█▄
+ ██▀▀▀ ██▀▀██ ██▀██ ▀█▄ ██▀▀ ██▀██ ▀█▄
+ ██ ██ ██ ██ ██ █████▀ ██████ ██ ██ █████▀
+ */
+ setupParsers : function( c, $tbodies ) {
+ var rows, list, span, max, colIndex, indx, header, configHeaders,
+ noParser, parser, extractor, time, tbody, len,
+ table = c.table,
+ tbodyIndex = 0,
+ debug = ts.debug(c, 'core'),
+ debugOutput = {};
+ // update table bodies in case we start with an empty table
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
+ len = tbody.length;
+ if ( len === 0 ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
+ } else if ( debug ) {
+ time = new Date();
+ console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
+ }
+ list = {
+ extractors: [],
+ parsers: []
+ };
+ while ( tbodyIndex < len ) {
+ rows = tbody[ tbodyIndex ].rows;
+ if ( rows.length ) {
+ colIndex = 0;
+ max = c.columns;
+ for ( indx = 0; indx < max; indx++ ) {
+ header = c.$headerIndexed[ colIndex ];
+ if ( header && header.length ) {
+ // get column indexed table cell; adding true parameter fixes #1362 but
+ // it would break backwards compatibility...
+ configHeaders = ts.getColumnData( table, c.headers, colIndex ); // , true );
+ // get column parser/extractor
+ extractor = ts.getParserById( ts.getData( header, configHeaders, 'extractor' ) );
+ parser = ts.getParserById( ts.getData( header, configHeaders, 'sorter' ) );
+ noParser = ts.getData( header, configHeaders, 'parser' ) === 'false';
+ // empty cells behaviour - keeping emptyToBottom for backwards compatibility
+ c.empties[colIndex] = (
+ ts.getData( header, configHeaders, 'empty' ) ||
+ c.emptyTo || ( c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase();
+ // text strings behaviour in numerical sorts
+ c.strings[colIndex] = (
+ ts.getData( header, configHeaders, 'string' ) ||
+ c.stringTo ||
+ 'max' ).toLowerCase();
+ if ( noParser ) {
+ parser = ts.getParserById( 'no-parser' );
+ }
+ if ( !extractor ) {
+ // For now, maybe detect someday
+ extractor = false;
+ }
+ if ( !parser ) {
+ parser = ts.detectParserForColumn( c, rows, -1, colIndex );
+ }
+ if ( debug ) {
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
+ parser : parser.id,
+ extractor : extractor ? extractor.id : 'none',
+ string : c.strings[ colIndex ],
+ empty : c.empties[ colIndex ]
+ };
+ }
+ list.parsers[ colIndex ] = parser;
+ list.extractors[ colIndex ] = extractor;
+ span = header[ 0 ].colSpan - 1;
+ if ( span > 0 ) {
+ colIndex += span;
+ max += span;
+ while ( span + 1 > 0 ) {
+ // set colspan columns to use the same parsers & extractors
+ list.parsers[ colIndex - span ] = parser;
+ list.extractors[ colIndex - span ] = extractor;
+ span--;
+ }
+ }
+ }
+ colIndex++;
+ }
+ }
+ tbodyIndex += ( list.parsers.length ) ? len : 1;
+ }
+ if ( debug ) {
+ if ( !ts.isEmptyObject( debugOutput ) ) {
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
+ } else {
+ console.warn( ' No parsers detected!' );
+ }
+ console.log( 'Completed detecting parsers' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ c.parsers = list.parsers;
+ c.extractors = list.extractors;
+ },
+
+ addParser : function( parser ) {
+ var indx,
+ len = ts.parsers.length,
+ add = true;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === parser.id.toLowerCase() ) {
+ add = false;
+ }
+ }
+ if ( add ) {
+ ts.parsers[ ts.parsers.length ] = parser;
+ }
+ },
+
+ getParserById : function( name ) {
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
+ if ( name == 'false' ) { return false; }
+ var indx,
+ len = ts.parsers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( ts.parsers[ indx ].id.toLowerCase() === ( name.toString() ).toLowerCase() ) {
+ return ts.parsers[ indx ];
+ }
+ }
+ return false;
+ },
+
+ detectParserForColumn : function( c, rows, rowIndex, cellIndex ) {
+ var cur, $node, row,
+ indx = ts.parsers.length,
+ node = false,
+ nodeValue = '',
+ debug = ts.debug(c, 'core'),
+ keepLooking = true;
+ while ( nodeValue === '' && keepLooking ) {
+ rowIndex++;
+ row = rows[ rowIndex ];
+ // stop looking after 50 empty rows
+ if ( row && rowIndex < 50 ) {
+ if ( row.className.indexOf( ts.cssIgnoreRow ) < 0 ) {
+ node = rows[ rowIndex ].cells[ cellIndex ];
+ nodeValue = ts.getElementText( c, node, cellIndex );
+ $node = $( node );
+ if ( debug ) {
+ console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
+ cellIndex + ': "' + nodeValue + '"' );
+ }
+ }
+ } else {
+ keepLooking = false;
+ }
+ }
+ while ( --indx >= 0 ) {
+ cur = ts.parsers[ indx ];
+ // ignore the default text parser because it will always be true
+ if ( cur && cur.id !== 'text' && cur.is && cur.is( nodeValue, c.table, node, $node ) ) {
+ return cur;
+ }
+ }
+ // nothing found, return the generic parser (text)
+ return ts.getParserById( 'text' );
+ },
+
+ getElementText : function( c, node, cellIndex ) {
+ if ( !node ) { return ''; }
+ var tmp,
+ extract = c.textExtraction || '',
+ // node could be a jquery object
+ // http://jsperf.com/jquery-vs-instanceof-jquery/2
+ $node = node.jquery ? node : $( node );
+ if ( typeof extract === 'string' ) {
+ // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow!
+ // http://www.kellegous.com/j/2013/02/27/innertext-vs-textcontent/
+ if ( extract === 'basic' && typeof ( tmp = $node.attr( c.textAttribute ) ) !== 'undefined' ) {
+ return $.trim( tmp );
+ }
+ return $.trim( node.textContent || $node.text() );
+ } else {
+ if ( typeof extract === 'function' ) {
+ return $.trim( extract( $node[ 0 ], c.table, cellIndex ) );
+ } else if ( typeof ( tmp = ts.getColumnData( c.table, extract, cellIndex ) ) === 'function' ) {
+ return $.trim( tmp( $node[ 0 ], c.table, cellIndex ) );
+ }
+ }
+ // fallback
+ return $.trim( $node[ 0 ].textContent || $node.text() );
+ },
+
+ // centralized function to extract/parse cell contents
+ getParsedText : function( c, cell, colIndex, txt ) {
+ if ( typeof txt === 'undefined' ) {
+ txt = ts.getElementText( c, cell, colIndex );
+ }
+ // if no parser, make sure to return the txt
+ var val = '' + txt,
+ parser = c.parsers[ colIndex ],
+ extractor = c.extractors[ colIndex ];
+ if ( parser ) {
+ // do extract before parsing, if there is one
+ if ( extractor && typeof extractor.format === 'function' ) {
+ txt = extractor.format( txt, c.table, cell, colIndex );
+ }
+ // allow parsing if the string is empty, previously parsing would change it to zero,
+ // in case the parser needs to extract data from the table cell attributes
+ val = parser.id === 'no-parser' ? '' :
+ // make sure txt is a string (extractor may have converted it)
+ parser.format( '' + txt, c.table, cell, colIndex );
+ if ( c.ignoreCase && typeof val === 'string' ) {
+ val = val.toLowerCase();
+ }
+ }
+ return val;
+ },
+
+ /*
+ ▄████▄ ▄████▄ ▄████▄ ██ ██ ██████
+ ██ ▀▀ ██▄▄██ ██ ▀▀ ██▄▄██ ██▄▄
+ ██ ▄▄ ██▀▀██ ██ ▄▄ ██▀▀██ ██▀▀
+ ▀████▀ ██ ██ ▀████▀ ██ ██ ██████
+ */
+ buildCache : function( c, callback, $tbodies ) {
+ var cache, val, txt, rowIndex, colIndex, tbodyIndex, $tbody, $row,
+ cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
+ colMax, span, cacheIndex, hasParser, max, len, index,
+ table = c.table,
+ parsers = c.parsers,
+ debug = ts.debug(c, 'core');
+ // update tbody variable
+ c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
+ $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
+ c.cache = {};
+ c.totalRows = 0;
+ // if no parsers found, return - it's an empty table.
+ if ( !parsers ) {
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
+ }
+ if ( debug ) {
+ cacheTime = new Date();
+ }
+ // processing icon
+ if ( c.showProcessing ) {
+ ts.isProcessing( table, true );
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbody.length; tbodyIndex++ ) {
+ colMax = []; // column max value per tbody
+ cache = c.cache[ tbodyIndex ] = {
+ normalized: [] // array of normalized row data; last entry contains 'rowData' above
+ // colMax: # // added at the end
+ };
+
+ totalRows = ( $tbody[ tbodyIndex ] && $tbody[ tbodyIndex ].rows.length ) || 0;
+ for ( rowIndex = 0; rowIndex < totalRows; ++rowIndex ) {
+ rowData = {
+ // order: original row order #
+ // $row : jQuery Object[]
+ child: [], // child row text (filter widget)
+ raw: [] // original row text
+ };
+ /** Add the table data to main data array */
+ $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
+ cols = [];
+ // ignore "remove-me" rows
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
+ continue;
+ }
+ // if this is a child row, add it to the last row's children and continue to the next row
+ // ignore child row class, if it is the first row
+ if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
+ len = cache.normalized.length - 1;
+ prevRowData = cache.normalized[ len ][ c.columns ];
+ prevRowData.$row = prevRowData.$row.add( $row );
+ // add 'hasChild' class name to parent row
+ if ( !$row.prev().hasClass( c.cssChildRow ) ) {
+ $row.prev().addClass( ts.css.cssHasChild );
+ }
+ // save child row content (un-parsed!)
+ $cells = $row.children( 'th, td' );
+ len = prevRowData.child.length;
+ prevRowData.child[ len ] = [];
+ // child row content does not account for colspans/rowspans; so indexing may be off
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; colIndex++ ) {
+ cell = $cells[ colIndex ];
+ if ( cell ) {
+ prevRowData.child[ len ][ colIndex ] = ts.getParsedText( c, cell, colIndex );
+ span = $cells[ colIndex ].colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // go to the next for loop
+ continue;
+ }
+ rowData.$row = $row;
+ rowData.order = rowIndex; // add original row position to rowCache
+ cacheIndex = 0;
+ max = c.columns;
+ for ( colIndex = 0; colIndex < max; ++colIndex ) {
+ cell = $row[ 0 ].cells[ colIndex ];
+ if ( cell && cacheIndex < c.columns ) {
+ hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
+ if ( !hasParser && debug ) {
+ console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
+ '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
+ }
+ val = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = val; // save original row text
+ // save raw column text even if there is no parser set
+ txt = ts.getParsedText( c, cell, cacheIndex, val );
+ cols[ cacheIndex ] = txt;
+ if ( hasParser && ( parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // determine column max value (ignore sign)
+ colMax[ cacheIndex ] = Math.max( Math.abs( txt ) || 0, colMax[ cacheIndex ] || 0 );
+ }
+ // allow colSpan in tbody
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ index = 0;
+ while ( index <= span ) {
+ // duplicate text (or not) to spanned columns
+ // instead of setting duplicate span to empty string, use textExtraction to try to get a value
+ // see http://stackoverflow.com/q/36449711/145346
+ txt = c.duplicateSpan || index === 0 ?
+ txt :
+ typeof c.textExtraction !== 'string' ?
+ ts.getElementText( c, cell, cacheIndex + index ) || '' :
+ '';
+ rowData.raw[ cacheIndex + index ] = txt;
+ cols[ cacheIndex + index ] = txt;
+ index++;
+ }
+ cacheIndex += span;
+ max += span;
+ }
+ }
+ cacheIndex++;
+ }
+ // ensure rowData is always in the same location (after the last column)
+ cols[ c.columns ] = rowData;
+ cache.normalized[ cache.normalized.length ] = cols;
+ }
+ cache.colMax = colMax;
+ // total up rows, not including child rows
+ c.totalRows += cache.normalized.length;
+
+ }
+ if ( c.showProcessing ) {
+ ts.isProcessing( table ); // remove processing icon
+ }
+ if ( debug ) {
+ len = Math.min( 5, c.cache[ 0 ].normalized.length );
+ console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
+ ts.benchmark( cacheTime ) );
+ val = {};
+ for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
+ for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
+ if ( !val[ 'row: ' + cacheIndex ] ) {
+ val[ 'row: ' + cacheIndex ] = {};
+ }
+ val[ 'row: ' + cacheIndex ][ c.$headerIndexed[ colIndex ].text() ] =
+ c.cache[ 0 ].normalized[ cacheIndex ][ colIndex ];
+ }
+ }
+ console[ console.table ? 'table' : 'log' ]( val );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ getColumnText : function( table, column, callback, rowFilter ) {
+ table = $( table )[0];
+ var tbodyIndex, rowIndex, cache, row, tbodyLen, rowLen, raw, parsed, $cell, result,
+ hasCallback = typeof callback === 'function',
+ allColumns = column === 'all',
+ data = { raw : [], parsed: [], $cell: [] },
+ c = table.config;
+ if ( ts.isEmptyObject( c ) ) {
+ if ( ts.debug(c, 'core') ) {
+ console.warn( 'No cache found - aborting getColumnText function!' );
+ }
+ } else {
+ tbodyLen = c.$tbodies.length;
+ for ( tbodyIndex = 0; tbodyIndex < tbodyLen; tbodyIndex++ ) {
+ cache = c.cache[ tbodyIndex ].normalized;
+ rowLen = cache.length;
+ for ( rowIndex = 0; rowIndex < rowLen; rowIndex++ ) {
+ row = cache[ rowIndex ];
+ if ( rowFilter && !row[ c.columns ].$row.is( rowFilter ) ) {
+ continue;
+ }
+ result = true;
+ parsed = ( allColumns ) ? row.slice( 0, c.columns ) : row[ column ];
+ row = row[ c.columns ];
+ raw = ( allColumns ) ? row.raw : row.raw[ column ];
+ $cell = ( allColumns ) ? row.$row.children() : row.$row.children().eq( column );
+ if ( hasCallback ) {
+ result = callback({
+ tbodyIndex : tbodyIndex,
+ rowIndex : rowIndex,
+ parsed : parsed,
+ raw : raw,
+ $row : row.$row,
+ $cell : $cell
+ });
+ }
+ if ( result !== false ) {
+ data.parsed[ data.parsed.length ] = parsed;
+ data.raw[ data.raw.length ] = raw;
+ data.$cell[ data.$cell.length ] = $cell;
+ }
+ }
+ }
+ // return everything
+ return data;
+ }
+ },
+
+ /*
+ ██ ██ █████▄ █████▄ ▄████▄ ██████ ██████
+ ██ ██ ██▄▄██ ██ ██ ██▄▄██ ██ ██▄▄
+ ██ ██ ██▀▀▀ ██ ██ ██▀▀██ ██ ██▀▀
+ ▀████▀ ██ █████▀ ██ ██ ██ ██████
+ */
+ setHeadersCss : function( c ) {
+ var indx, column,
+ list = c.sortList,
+ len = list.length,
+ none = ts.css.sortNone + ' ' + c.cssNone,
+ css = [ ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc ],
+ cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ],
+ aria = [ 'ascending', 'descending' ],
+ updateColumnSort = function($el, index) {
+ $el
+ .removeClass( none )
+ .addClass( css[ index ] )
+ .attr( 'aria-sort', aria[ index ] )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon[ 2 ] )
+ .addClass( cssIcon[ index ] );
+ },
+ // find the footer
+ $extras = c.$table
+ .find( 'tfoot tr' )
+ .children( 'td, th' )
+ .add( $( c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) ),
+ // remove all header information
+ $sorted = c.$headers
+ .add( $( 'thead ' + c.namespace + '_extra_headers' ) )
+ .removeClass( css.join( ' ' ) )
+ .addClass( none )
+ .attr( 'aria-sort', 'none' )
+ .find( '.' + ts.css.icon )
+ .removeClass( cssIcon.join( ' ' ) )
+ .end();
+ // add css none to all sortable headers
+ $sorted
+ .not( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( cssIcon[ 2 ] );
+ // add disabled css icon class
+ if ( c.cssIconDisabled ) {
+ $sorted
+ .filter( '.sorter-false' )
+ .find( '.' + ts.css.icon )
+ .addClass( c.cssIconDisabled );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ // direction = 2 means reset!
+ if ( list[ indx ][ 1 ] !== 2 ) {
+ // multicolumn sorting updating - see #1005
+ // .not(function() {}) needs jQuery 1.4
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
+ $sorted = c.$headers.filter( function( i ) {
+ // only include headers that are in the sortList (this includes colspans)
+ var include = true,
+ $el = c.$headers.eq( i ),
+ col = parseInt( $el.attr( 'data-column' ), 10 ),
+ end = col + ts.getClosest( $el, 'th, td' )[0].colSpan;
+ for ( ; col < end; col++ ) {
+ include = include ? include || ts.isValueInArray( col, c.sortList ) > -1 : false;
+ }
+ return include;
+ });
+
+ // choose the :last in case there are nested columns
+ $sorted = $sorted
+ .not( '.sorter-false' )
+ .filter( '[data-column="' + list[ indx ][ 0 ] + '"]' + ( len === 1 ? ':last' : '' ) );
+ if ( $sorted.length ) {
+ for ( column = 0; column < $sorted.length; column++ ) {
+ if ( !$sorted[ column ].sortDisabled ) {
+ updateColumnSort( $sorted.eq( column ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add sorted class to footer & extra headers, if they exist
+ if ( $extras.length ) {
+ updateColumnSort( $extras.filter( '[data-column="' + list[ indx ][ 0 ] + '"]' ), list[ indx ][ 1 ] );
+ }
+ }
+ }
+ // add verbose aria labels
+ len = c.$headers.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ ts.setColumnAriaLabel( c, c.$headers.eq( indx ) );
+ }
+ },
+
+ getClosest : function( $el, selector ) {
+ // jQuery v1.2.6 doesn't have closest()
+ if ( $.fn.closest ) {
+ return $el.closest( selector );
+ }
+ return $el.is( selector ) ?
+ $el :
+ $el.parents( selector ).filter( ':first' );
+ },
+
+ // nextSort (optional), lets you disable next sort text
+ setColumnAriaLabel : function( c, $header, nextSort ) {
+ if ( $header.length ) {
+ var column = parseInt( $header.attr( 'data-column' ), 10 ),
+ vars = c.sortVars[ column ],
+ tmp = $header.hasClass( ts.css.sortAsc ) ?
+ 'sortAsc' :
+ $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
+ txt = $.trim( $header.text() ) + ': ' + ts.language[ tmp ];
+ if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
+ txt += ts.language.sortDisabled;
+ } else {
+ tmp = ( vars.count + 1 ) % vars.order.length;
+ nextSort = vars.order[ tmp ];
+ // if nextSort
+ txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
+ }
+ $header.attr( 'aria-label', txt );
+ if (vars.sortedBy) {
+ $header.attr( 'data-sortedBy', vars.sortedBy );
+ } else {
+ $header.removeAttr('data-sortedBy');
+ }
+ }
+ },
+
+ updateHeader : function( c ) {
+ var index, isDisabled, $header, col,
+ table = c.table,
+ len = c.$headers.length;
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ col = ts.getColumnData( table, c.headers, index, true );
+ // add 'sorter-false' class if 'parser-false' is set
+ isDisabled = ts.getData( $header, col, 'sorter' ) === 'false' || ts.getData( $header, col, 'parser' ) === 'false';
+ ts.setColumnSort( c, $header, isDisabled );
+ }
+ },
+
+ setColumnSort : function( c, $header, isDisabled ) {
+ var id = c.table.id;
+ $header[ 0 ].sortDisabled = isDisabled;
+ $header[ isDisabled ? 'addClass' : 'removeClass' ]( 'sorter-false' )
+ .attr( 'aria-disabled', '' + isDisabled );
+ // disable tab index on disabled cells
+ if ( c.tabIndex ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'tabindex' );
+ } else {
+ $header.attr( 'tabindex', '0' );
+ }
+ }
+ // aria-controls - requires table ID
+ if ( id ) {
+ if ( isDisabled ) {
+ $header.removeAttr( 'aria-controls' );
+ } else {
+ $header.attr( 'aria-controls', id );
+ }
+ }
+ },
+
+ updateHeaderSortCount : function( c, list ) {
+ var col, dir, group, indx, primary, temp, val, order,
+ sortList = list || c.sortList,
+ len = sortList.length;
+ c.sortList = [];
+ for ( indx = 0; indx < len; indx++ ) {
+ val = sortList[ indx ];
+ // ensure all sortList values are numeric - fixes #127
+ col = parseInt( val[ 0 ], 10 );
+ // prevents error if sorton array is wrong
+ if ( col < c.columns ) {
+
+ // set order if not already defined - due to colspan header without associated header cell
+ // adding this check prevents a javascript error
+ if ( !c.sortVars[ col ].order ) {
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
+ } else {
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
+ }
+ c.sortVars[ col ].order = order;
+ c.sortVars[ col ].count = 0;
+ }
+
+ order = c.sortVars[ col ].order;
+ dir = ( '' + val[ 1 ] ).match( /^(1|d|s|o|n)/ );
+ dir = dir ? dir[ 0 ] : '';
+ // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext
+ switch ( dir ) {
+ case '1' : case 'd' : // descending
+ dir = 1;
+ break;
+ case 's' : // same direction (as primary column)
+ // if primary sort is set to 's', make it ascending
+ dir = primary || 0;
+ break;
+ case 'o' :
+ temp = order[ ( primary || 0 ) % order.length ];
+ // opposite of primary column; but resets if primary resets
+ dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
+ break;
+ case 'n' :
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
+ break;
+ default : // ascending
+ dir = 0;
+ break;
+ }
+ primary = indx === 0 ? dir : primary;
+ group = [ col, parseInt( dir, 10 ) || 0 ];
+ c.sortList[ c.sortList.length ] = group;
+ dir = $.inArray( group[ 1 ], order ); // fixes issue #167
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
+ }
+ }
+ },
+
+ updateAll : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ ts.refreshWidgets( table, true, true );
+ ts.buildHeaders( c );
+ ts.bindEvents( table, c.$headers, true );
+ ts.bindMethods( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ update : function( c, resort, callback ) {
+ var table = c.table;
+ table.isUpdating = true;
+ // update sorting (if enabled/disabled)
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ },
+
+ // simple header update - see #989
+ updateHeaders : function( c, callback ) {
+ c.table.isUpdating = true;
+ ts.buildHeaders( c );
+ ts.bindEvents( c.table, c.$headers, true );
+ ts.resortComplete( c, callback );
+ },
+
+ updateCell : function( c, cell, resort, callback ) {
+ // updateCell for child rows is a mess - we'll ignore them for now
+ // eventually I'll break out the "update" row cache code to make everything consistent
+ if ( $( cell ).closest( 'tr' ).hasClass( c.cssChildRow ) ) {
+ console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');
+ return;
+ }
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #1099
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ return;
+ }
+ c.table.isUpdating = true;
+ c.$table.find( c.selectorRemove ).remove();
+ // get position from the dom
+ var tmp, indx, row, icell, cache, len,
+ $tbodies = c.$tbodies,
+ $cell = $( cell ),
+ // update cache - format: function( s, table, cell, cellIndex )
+ // no closest in jQuery v1.2.6
+ tbodyIndex = $tbodies.index( ts.getClosest( $cell, 'tbody' ) ),
+ tbcache = c.cache[ tbodyIndex ],
+ $row = ts.getClosest( $cell, 'tr' );
+ cell = $cell[ 0 ]; // in case cell is a jQuery object
+ // tbody may not exist if update is initialized while tbody is removed for processing
+ if ( $tbodies.length && tbodyIndex >= 0 ) {
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
+ cache = tbcache.normalized[ row ];
+ len = $row[ 0 ].cells.length;
+ if ( len !== c.columns ) {
+ // colspan in here somewhere!
+ icell = 0;
+ tmp = false;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( !tmp && $row[ 0 ].cells[ indx ] !== cell ) {
+ icell += $row[ 0 ].cells[ indx ].colSpan;
+ } else {
+ tmp = true;
+ }
+ }
+ } else {
+ icell = $cell.index();
+ }
+ tmp = ts.getElementText( c, cell, icell ); // raw
+ cache[ c.columns ].raw[ icell ] = tmp;
+ tmp = ts.getParsedText( c, cell, icell, tmp );
+ cache[ icell ] = tmp; // parsed
+ if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
+ }
+ tmp = resort !== 'undefined' ? resort : c.resort;
+ if ( tmp !== false ) {
+ // widgets will be reapplied
+ ts.checkResort( c, tmp, callback );
+ } else {
+ // don't reapply widgets is resort is false, just in case it causes
+ // problems with element focus
+ ts.resortComplete( c, callback );
+ }
+ } else {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
+ }
+ c.table.isUpdating = false;
+ }
+ },
+
+ addRows : function( c, $row, resort, callback ) {
+ var txt, val, tbodyIndex, rowIndex, rows, cellIndex, len, order,
+ cacheIndex, rowData, cells, cell, span,
+ // allow passing a row string if only one non-info tbody exists in the table
+ valid = typeof $row === 'string' && c.$tbodies.length === 1 && /<tr/.test( $row || '' ),
+ table = c.table;
+ if ( valid ) {
+ $row = $( $row );
+ c.$tbodies.append( $row );
+ } else if (
+ !$row ||
+ // row is a jQuery object?
+ !( $row instanceof $ ) ||
+ // row contained in the table?
+ ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
+ ) {
+ if ( ts.debug(c, 'core') ) {
+ console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
+ 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
+ }
+ return false;
+ }
+ table.isUpdating = true;
+ if ( ts.isEmptyObject( c.cache ) ) {
+ // empty table, do an update instead - fixes #450
+ ts.updateHeader( c );
+ ts.commonUpdate( c, resort, callback );
+ } else {
+ rows = $row.filter( 'tr' ).attr( 'role', 'row' ).length;
+ tbodyIndex = c.$tbodies.index( $row.parents( 'tbody' ).filter( ':first' ) );
+ // fixes adding rows to an empty table - see issue #179
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c );
+ }
+ // add each row
+ for ( rowIndex = 0; rowIndex < rows; rowIndex++ ) {
+ cacheIndex = 0;
+ len = $row[ rowIndex ].cells.length;
+ order = c.cache[ tbodyIndex ].normalized.length;
+ cells = [];
+ rowData = {
+ child : [],
+ raw : [],
+ $row : $row.eq( rowIndex ),
+ order : order
+ };
+ // add each cell
+ for ( cellIndex = 0; cellIndex < len; cellIndex++ ) {
+ cell = $row[ rowIndex ].cells[ cellIndex ];
+ txt = ts.getElementText( c, cell, cacheIndex );
+ rowData.raw[ cacheIndex ] = txt;
+ val = ts.getParsedText( c, cell, cacheIndex, txt );
+ cells[ cacheIndex ] = val;
+ if ( ( c.parsers[ cacheIndex ].type || '' ).toLowerCase() === 'numeric' ) {
+ // update column max value (ignore sign)
+ c.cache[ tbodyIndex ].colMax[ cacheIndex ] =
+ Math.max( Math.abs( val ) || 0, c.cache[ tbodyIndex ].colMax[ cacheIndex ] || 0 );
+ }
+ span = cell.colSpan - 1;
+ if ( span > 0 ) {
+ cacheIndex += span;
+ }
+ cacheIndex++;
+ }
+ // add the row data to the end
+ cells[ c.columns ] = rowData;
+ // update cache
+ c.cache[ tbodyIndex ].normalized[ order ] = cells;
+ }
+ // resort using current settings
+ ts.checkResort( c, resort, callback );
+ }
+ },
+
+ updateCache : function( c, callback, $tbodies ) {
+ // rebuild parsers
+ if ( !( c.parsers && c.parsers.length ) ) {
+ ts.setupParsers( c, $tbodies );
+ }
+ // rebuild the cache map
+ ts.buildCache( c, callback, $tbodies );
+ },
+
+ // init flag (true) used by pager plugin to prevent widget application
+ // renamed from appendToTable
+ appendCache : function( c, init ) {
+ var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
+ table = c.table,
+ $tbodies = c.$tbodies,
+ rows = [],
+ cache = c.cache;
+ // empty table - fixes #206/#346
+ if ( ts.isEmptyObject( cache ) ) {
+ // run pager appender in case the table was just emptied
+ return c.appender ? c.appender( table, rows ) :
+ table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
+ }
+ if ( ts.debug(c, 'core') ) {
+ appendTime = new Date();
+ }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = $tbodies.eq( tbodyIndex );
+ if ( $tbody.length ) {
+ // detach tbody for manipulation
+ $curTbody = ts.processTbody( table, $tbody, true );
+ parsed = cache[ tbodyIndex ].normalized;
+ totalRows = parsed.length;
+ for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
+ rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
+ // removeRows used by the pager plugin; don't render if using ajax - fixes #411
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
+ $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
+ }
+ }
+ // restore tbody
+ ts.processTbody( table, $curTbody, false );
+ }
+ }
+ if ( c.appender ) {
+ c.appender( table, rows );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
+ }
+ // apply table widgets; but not before ajax completes
+ if ( !init && !c.appender ) {
+ ts.applyWidget( table );
+ }
+ if ( table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', table );
+ }
+ },
+
+ commonUpdate : function( c, resort, callback ) {
+ // remove rows/elements before update
+ c.$table.find( c.selectorRemove ).remove();
+ // rebuild parsers
+ ts.setupParsers( c );
+ // rebuild the cache map
+ ts.buildCache( c );
+ ts.checkResort( c, resort, callback );
+ },
+
+ /*
+ ▄█████ ▄████▄ █████▄ ██████ ██ █████▄ ▄████▄
+ ▀█▄ ██ ██ ██▄▄██ ██ ██ ██ ██ ██ ▄▄▄
+ ▀█▄ ██ ██ ██▀██ ██ ██ ██ ██ ██ ▀██
+ █████▀ ▀████▀ ██ ██ ██ ██ ██ ██ ▀████▀
+ */
+ initSort : function( c, cell, event ) {
+ if ( c.table.isUpdating ) {
+ // let any updates complete before initializing a sort
+ return setTimeout( function() {
+ ts.initSort( c, cell, event );
+ }, 50 );
+ }
+
+ var arry, indx, headerIndx, dir, temp, tmp, $header,
+ notMultiSort = !event[ c.sortMultiSortKey ],
+ table = c.table,
+ len = c.$headers.length,
+ th = ts.getClosest( $( cell ), 'th, td' ),
+ col = parseInt( th.attr( 'data-column' ), 10 ),
+ sortedBy = event.type === 'mouseup' ? 'user' : event.type,
+ order = c.sortVars[ col ].order;
+ th = th[0];
+ // Only call sortStart if sorting is enabled
+ c.$table.triggerHandler( 'sortStart', table );
+ // get current column sort order
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
+ // reset all sorts on non-current column - issue #30
+ if ( c.sortRestart ) {
+ for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
+ $header = c.$headers.eq( headerIndx );
+ tmp = parseInt( $header.attr( 'data-column' ), 10 );
+ // only reset counts on columns that weren't just clicked on and if not included in a multisort
+ if ( col !== tmp && ( notMultiSort || $header.hasClass( ts.css.sortNone ) ) ) {
+ c.sortVars[ tmp ].count = -1;
+ }
+ }
+ }
+ // user only wants to sort on one column
+ if ( notMultiSort ) {
+ $.each( c.sortVars, function( i ) {
+ c.sortVars[ i ].sortedBy = '';
+ });
+ // flush the sort list
+ c.sortList = [];
+ c.last.sortList = [];
+ if ( c.sortForce !== null ) {
+ arry = c.sortForce;
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col ) {
+ c.sortList[ c.sortList.length ] = arry[ indx ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortForce';
+ }
+ }
+ }
+ // add column to sort list
+ dir = order[ c.sortVars[ col ].count ];
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ // multi column sorting
+ } else {
+ // get rid of the sortAppend before adding more - fixes issue #115 & #523
+ c.sortList = $.extend( [], c.last.sortList );
+
+ // the user has clicked on an already sorted column
+ if ( ts.isValueInArray( col, c.sortList ) >= 0 ) {
+ // reverse the sorting direction
+ c.sortVars[ col ].sortedBy = sortedBy;
+ for ( indx = 0; indx < c.sortList.length; indx++ ) {
+ tmp = c.sortList[ indx ];
+ if ( tmp[ 0 ] === col ) {
+ // order.count seems to be incorrect when compared to cell.count
+ tmp[ 1 ] = order[ c.sortVars[ col ].count ];
+ if ( tmp[1] === 2 ) {
+ c.sortList.splice( indx, 1 );
+ c.sortVars[ col ].count = -1;
+ }
+ }
+ }
+ } else {
+ // add column to sort list array
+ dir = order[ c.sortVars[ col ].count ];
+ c.sortVars[ col ].sortedBy = sortedBy;
+ if ( dir < 2 ) {
+ c.sortList[ c.sortList.length ] = [ col, dir ];
+ // add other columns if header spans across multiple
+ if ( th.colSpan > 1 ) {
+ for ( indx = 1; indx < th.colSpan; indx++ ) {
+ c.sortList[ c.sortList.length ] = [ col + indx, dir ];
+ // update count on columns in colSpan
+ c.sortVars[ col + indx ].count = $.inArray( dir, order );
+ c.sortVars[ col + indx ].sortedBy = sortedBy;
+ }
+ }
+ }
+ }
+ }
+ // save sort before applying sortAppend
+ c.last.sortList = $.extend( [], c.sortList );
+ if ( c.sortList.length && c.sortAppend ) {
+ arry = $.isArray( c.sortAppend ) ? c.sortAppend : c.sortAppend[ c.sortList[ 0 ][ 0 ] ];
+ if ( !ts.isEmptyObject( arry ) ) {
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ if ( arry[ indx ][ 0 ] !== col && ts.isValueInArray( arry[ indx ][ 0 ], c.sortList ) < 0 ) {
+ dir = arry[ indx ][ 1 ];
+ temp = ( '' + dir ).match( /^(a|d|s|o|n)/ );
+ if ( temp ) {
+ tmp = c.sortList[ 0 ][ 1 ];
+ switch ( temp[ 0 ] ) {
+ case 'd' :
+ dir = 1;
+ break;
+ case 's' :
+ dir = tmp;
+ break;
+ case 'o' :
+ dir = tmp === 0 ? 1 : 0;
+ break;
+ case 'n' :
+ dir = ( tmp + 1 ) % order.length;
+ break;
+ default:
+ dir = 0;
+ break;
+ }
+ }
+ c.sortList[ c.sortList.length ] = [ arry[ indx ][ 0 ], dir ];
+ c.sortVars[ arry[ indx ][ 0 ] ].sortedBy = 'sortAppend';
+ }
+ }
+ }
+ }
+ // sortBegin event triggered immediately before the sort
+ c.$table.triggerHandler( 'sortBegin', table );
+ // setTimeout needed so the processing icon shows up
+ setTimeout( function() {
+ // set css for headers
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ }, 1 );
+ },
+
+ // sort multiple columns
+ multisort : function( c ) { /*jshint loopfunc:true */
+ var tbodyIndex, sortTime, colMax, rows, tmp,
+ table = c.table,
+ sorter = [],
+ dir = 0,
+ textSorter = c.textSorter || '',
+ sortList = c.sortList,
+ sortLen = sortList.length,
+ len = c.$tbodies.length;
+ if ( c.serverSideSorting || ts.isEmptyObject( c.cache ) ) {
+ // empty table - fixes #206/#346
+ return;
+ }
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
+ // cache textSorter to optimize speed
+ if ( typeof textSorter === 'object' ) {
+ colMax = c.columns;
+ while ( colMax-- ) {
+ tmp = ts.getColumnData( table, textSorter, colMax );
+ if ( typeof tmp === 'function' ) {
+ sorter[ colMax ] = tmp;
+ }
+ }
+ }
+ for ( tbodyIndex = 0; tbodyIndex < len; tbodyIndex++ ) {
+ colMax = c.cache[ tbodyIndex ].colMax;
+ rows = c.cache[ tbodyIndex ].normalized;
+
+ rows.sort( function( a, b ) {
+ var sortIndex, num, col, order, sort, x, y;
+ // rows is undefined here in IE, so don't use it!
+ for ( sortIndex = 0; sortIndex < sortLen; sortIndex++ ) {
+ col = sortList[ sortIndex ][ 0 ];
+ order = sortList[ sortIndex ][ 1 ];
+ // sort direction, true = asc, false = desc
+ dir = order === 0;
+
+ if ( c.sortStable && a[ col ] === b[ col ] && sortLen === 1 ) {
+ return a[ c.columns ].order - b[ c.columns ].order;
+ }
+
+ // fallback to natural sort since it is more robust
+ num = /n/i.test( ts.getSortType( c.parsers, col ) );
+ if ( num && c.strings[ col ] ) {
+ // sort strings in numerical columns
+ if ( typeof ( ts.string[ c.strings[ col ] ] ) === 'boolean' ) {
+ num = ( dir ? 1 : -1 ) * ( ts.string[ c.strings[ col ] ] ? -1 : 1 );
+ } else {
+ num = ( c.strings[ col ] ) ? ts.string[ c.strings[ col ] ] || 0 : 0;
+ }
+ // fall back to built-in numeric sort
+ // var sort = $.tablesorter['sort' + s]( a[col], b[col], dir, colMax[col], table );
+ sort = c.numberSorter ? c.numberSorter( a[ col ], b[ col ], dir, colMax[ col ], table ) :
+ ts[ 'sortNumeric' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ], b[ col ], num, colMax[ col ], col, c );
+ } else {
+ // set a & b depending on sort direction
+ x = dir ? a : b;
+ y = dir ? b : a;
+ // text sort function
+ if ( typeof textSorter === 'function' ) {
+ // custom OVERALL text sorter
+ sort = textSorter( x[ col ], y[ col ], dir, col, table );
+ } else if ( typeof sorter[ col ] === 'function' ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ sort = sorter[ col ]( x[ col ], y[ col ], dir, col, table );
+ } else {
+ // fall back to natural sort
+ sort = ts[ 'sortNatural' + ( dir ? 'Asc' : 'Desc' ) ]( a[ col ] || '', b[ col ] || '', col, c );
+ }
+ }
+ if ( sort ) { return sort; }
+ }
+ return a[ c.columns ].order - b[ c.columns ].order;
+ });
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
+ }
+ },
+
+ resortComplete : function( c, callback ) {
+ if ( c.table.isUpdating ) {
+ c.$table.triggerHandler( 'updateComplete', c.table );
+ }
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ checkResort : function( c, resort, callback ) {
+ var sortList = $.isArray( resort ) ? resort : c.sortList,
+ // if no resort parameter is passed, fallback to config.resort (true by default)
+ resrt = typeof resort === 'undefined' ? c.resort : resort;
+ // don't try to resort if the table is still processing
+ // this will catch spamming of the updateCell method
+ if ( resrt !== false && !c.serverSideSorting && !c.table.isProcessing ) {
+ if ( sortList.length ) {
+ ts.sortOn( c, sortList, function() {
+ ts.resortComplete( c, callback );
+ }, true );
+ } else {
+ ts.sortReset( c, function() {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ } );
+ }
+ } else {
+ ts.resortComplete( c, callback );
+ ts.applyWidget( c.table, false );
+ }
+ },
+
+ sortOn : function( c, list, callback, init ) {
+ var indx,
+ table = c.table;
+ c.$table.triggerHandler( 'sortStart', table );
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].sortedBy = ts.isValueInArray( indx, list ) > -1 ? 'sorton' : '';
+ }
+ // update header count index
+ ts.updateHeaderSortCount( c, list );
+ // set css for headers
+ ts.setHeadersCss( c );
+ // fixes #346
+ if ( c.delayInit && ts.isEmptyObject( c.cache ) ) {
+ ts.buildCache( c );
+ }
+ c.$table.triggerHandler( 'sortBegin', table );
+ // sort the table and append it to the dom
+ ts.multisort( c );
+ ts.appendCache( c, init );
+ c.$table.triggerHandler( 'sortBeforeEnd', table );
+ c.$table.triggerHandler( 'sortEnd', table );
+ ts.applyWidget( table );
+ if ( $.isFunction( callback ) ) {
+ callback( table );
+ }
+ },
+
+ sortReset : function( c, callback ) {
+ c.sortList = [];
+ var indx;
+ for (indx = 0; indx < c.columns; indx++) {
+ c.sortVars[ indx ].count = -1;
+ c.sortVars[ indx ].sortedBy = '';
+ }
+ ts.setHeadersCss( c );
+ ts.multisort( c );
+ ts.appendCache( c );
+ if ( $.isFunction( callback ) ) {
+ callback( c.table );
+ }
+ },
+
+ getSortType : function( parsers, column ) {
+ return ( parsers && parsers[ column ] ) ? parsers[ column ].type || '' : '';
+ },
+
+ getOrder : function( val ) {
+ // look for 'd' in 'desc' order; return true
+ return ( /^d/i.test( val ) || val === 1 );
+ },
+
+ // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
+ sortNatural : function( a, b ) {
+ if ( a === b ) { return 0; }
+ a = ( a || '' ).toString();
+ b = ( b || '' ).toString();
+ var aNum, bNum, aFloat, bFloat, indx, max,
+ regex = ts.regex;
+ // first try and sort Hex codes
+ if ( regex.hex.test( b ) ) {
+ aNum = parseInt( a.match( regex.hex ), 16 );
+ bNum = parseInt( b.match( regex.hex ), 16 );
+ if ( aNum < bNum ) { return -1; }
+ if ( aNum > bNum ) { return 1; }
+ }
+ // chunk/tokenize
+ aNum = a.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ bNum = b.replace( regex.chunk, '\\0$1\\0' ).replace( regex.chunks, '' ).split( '\\0' );
+ max = Math.max( aNum.length, bNum.length );
+ // natural sorting through split numeric strings and default strings
+ for ( indx = 0; indx < max; indx++ ) {
+ // find floats not starting with '0', string or 0 if not defined
+ aFloat = isNaN( aNum[ indx ] ) ? aNum[ indx ] || 0 : parseFloat( aNum[ indx ] ) || 0;
+ bFloat = isNaN( bNum[ indx ] ) ? bNum[ indx ] || 0 : parseFloat( bNum[ indx ] ) || 0;
+ // handle numeric vs string comparison - number < string - (Kyle Adams)
+ if ( isNaN( aFloat ) !== isNaN( bFloat ) ) { return isNaN( aFloat ) ? 1 : -1; }
+ // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
+ if ( typeof aFloat !== typeof bFloat ) {
+ aFloat += '';
+ bFloat += '';
+ }
+ if ( aFloat < bFloat ) { return -1; }
+ if ( aFloat > bFloat ) { return 1; }
+ }
+ return 0;
+ },
+
+ sortNaturalAsc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ return ts.sortNatural( a, b );
+ },
+
+ sortNaturalDesc : function( a, b, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ return ts.sortNatural( b, a );
+ },
+
+ // basic alphabetical sort
+ sortText : function( a, b ) {
+ return a > b ? 1 : ( a < b ? -1 : 0 );
+ },
+
+ // return text string value by adding up ascii value
+ // so the text is somewhat sorted when using a digital sort
+ // this is NOT an alphanumeric sort
+ getTextValue : function( val, num, max ) {
+ if ( max ) {
+ // make sure the text value is greater than the max numerical value (max)
+ var indx,
+ len = val ? val.length : 0,
+ n = max + num;
+ for ( indx = 0; indx < len; indx++ ) {
+ n += val.charCodeAt( indx );
+ }
+ return num * n;
+ }
+ return 0;
+ },
+
+ sortNumericAsc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : -empty || -1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : empty || 1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return a - b;
+ },
+
+ sortNumericDesc : function( a, b, num, max, col, c ) {
+ if ( a === b ) { return 0; }
+ var empty = ts.string[ ( c.empties[ col ] || c.emptyTo ) ];
+ if ( a === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? -1 : 1 ) : empty || 1; }
+ if ( b === '' && empty !== 0 ) { return typeof empty === 'boolean' ? ( empty ? 1 : -1 ) : -empty || -1; }
+ if ( isNaN( a ) ) { a = ts.getTextValue( a, num, max ); }
+ if ( isNaN( b ) ) { b = ts.getTextValue( b, num, max ); }
+ return b - a;
+ },
+
+ sortNumeric : function( a, b ) {
+ return a - b;
+ },
+
+ /*
+ ██ ██ ██ ██ █████▄ ▄████▄ ██████ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ▄▄▄ ██▄▄ ██ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ▀██ ██▀▀ ██ ▀█▄
+ ███████▀ ██ █████▀ ▀████▀ ██████ ██ █████▀
+ */
+ addWidget : function( widget ) {
+ if ( widget.id && !ts.isEmptyObject( ts.getWidgetById( widget.id ) ) ) {
+ console.warn( '"' + widget.id + '" widget was loaded more than once!' );
+ }
+ ts.widgets[ ts.widgets.length ] = widget;
+ },
+
+ hasWidget : function( $table, name ) {
+ $table = $( $table );
+ return $table.length && $table[ 0 ].config && $table[ 0 ].config.widgetInit[ name ] || false;
+ },
+
+ getWidgetById : function( name ) {
+ var indx, widget,
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id && widget.id.toLowerCase() === name.toLowerCase() ) {
+ return widget;
+ }
+ }
+ },
+
+ applyWidgetOptions : function( table ) {
+ var indx, widget, wo,
+ c = table.config,
+ len = c.widgets.length;
+ if ( len ) {
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( c.widgets[ indx ] );
+ if ( widget && widget.options ) {
+ wo = $.extend( true, {}, widget.options );
+ c.widgetOptions = $.extend( true, wo, c.widgetOptions );
+ // add widgetOptions to defaults for option validator
+ $.extend( true, ts.defaults.widgetOptions, widget.options );
+ }
+ }
+ }
+ },
+
+ addWidgetFromClass : function( table ) {
+ var len, indx,
+ c = table.config,
+ // look for widgets to apply from table class
+ // don't match from 'ui-widget-content'; use \S instead of \w to include widgets
+ // with dashes in the name, e.g. "widget-test-2" extracts out "test-2"
+ regex = '^' + c.widgetClass.replace( ts.regex.templateName, '(\\S+)+' ) + '$',
+ widgetClass = new RegExp( regex, 'g' ),
+ // split up table class (widget id's can include dashes) - stop using match
+ // otherwise only one widget gets extracted, see #1109
+ widgets = ( table.className || '' ).split( ts.regex.spaces );
+ if ( widgets.length ) {
+ len = widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( widgets[ indx ].match( widgetClass ) ) {
+ c.widgets[ c.widgets.length ] = widgets[ indx ].replace( widgetClass, '$1' );
+ }
+ }
+ }
+ },
+
+ applyWidgetId : function( table, id, init ) {
+ table = $(table)[0];
+ var applied, time, name,
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'core'),
+ widget = ts.getWidgetById( id );
+ if ( widget ) {
+ name = widget.id;
+ applied = false;
+ // add widget name to option list so it gets reapplied after sorting, filtering, etc
+ if ( $.inArray( name, c.widgets ) < 0 ) {
+ c.widgets[ c.widgets.length ] = name;
+ }
+ if ( debug ) { time = new Date(); }
+
+ if ( init || !( c.widgetInit[ name ] ) ) {
+ // set init flag first to prevent calling init more than once (e.g. pager)
+ c.widgetInit[ name ] = true;
+ if ( table.hasInitialized ) {
+ // don't reapply widget options on tablesorter init
+ ts.applyWidgetOptions( table );
+ }
+ if ( typeof widget.init === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
+ }
+ widget.init( table, widget, c, wo );
+ }
+ }
+ if ( !init && typeof widget.format === 'function' ) {
+ applied = true;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
+ }
+ widget.format( table, c, wo, false );
+ }
+ if ( debug ) {
+ if ( applied ) {
+ console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
+ if ( console.groupEnd ) { console.groupEnd(); }
+ }
+ }
+ }
+ },
+
+ applyWidget : function( table, init, callback ) {
+ table = $( table )[ 0 ]; // in case this is called externally
+ var indx, len, names, widget, time,
+ c = table.config,
+ debug = ts.debug(c, 'core'),
+ widgets = [];
+ // prevent numerous consecutive widget applications
+ if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
+ return;
+ }
+ if ( debug ) { time = new Date(); }
+ ts.addWidgetFromClass( table );
+ // prevent "tablesorter-ready" from firing multiple times in a row
+ clearTimeout( c.timerReady );
+ if ( c.widgets.length ) {
+ table.isApplyingWidgets = true;
+ // ensure unique widget ids
+ c.widgets = $.grep( c.widgets, function( val, index ) {
+ return $.inArray( val, c.widgets ) === index;
+ });
+ names = c.widgets || [];
+ len = names.length;
+ // build widget array & add priority as needed
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.getWidgetById( names[ indx ] );
+ if ( widget && widget.id ) {
+ // set priority to 10 if not defined
+ if ( !widget.priority ) { widget.priority = 10; }
+ widgets[ indx ] = widget;
+ } else if ( debug ) {
+ console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
+ }
+ }
+ // sort widgets by priority
+ widgets.sort( function( a, b ) {
+ return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1;
+ });
+ // add/update selected widgets
+ len = widgets.length;
+ if ( debug ) {
+ console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
+ }
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id ) {
+ ts.applyWidgetId( table, widget.id, init );
+ }
+ }
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
+ }
+ c.timerReady = setTimeout( function() {
+ table.isApplyingWidgets = false;
+ $.data( table, 'lastWidgetApplication', new Date() );
+ c.$table.triggerHandler( 'tablesorter-ready' );
+ // callback executed on init only
+ if ( !init && typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( debug ) {
+ widget = c.widgets.length;
+ console.log( 'Completed ' +
+ ( init === true ? 'initializing ' : 'applying ' ) + widget +
+ ' widget' + ( widget !== 1 ? 's' : '' ) + ts.benchmark( time ) );
+ }
+ }, 10 );
+ },
+
+ removeWidget : function( table, name, refreshing ) {
+ table = $( table )[ 0 ];
+ var index, widget, indx, len,
+ c = table.config;
+ // if name === true, add all widgets from $.tablesorter.widgets
+ if ( name === true ) {
+ name = [];
+ len = ts.widgets.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = ts.widgets[ indx ];
+ if ( widget && widget.id ) {
+ name[ name.length ] = widget.id;
+ }
+ }
+ } else {
+ // name can be either an array of widgets names,
+ // or a space/comma separated list of widget names
+ name = ( $.isArray( name ) ? name.join( ',' ) : name || '' ).toLowerCase().split( /[\s,]+/ );
+ }
+ len = name.length;
+ for ( index = 0; index < len; index++ ) {
+ widget = ts.getWidgetById( name[ index ] );
+ indx = $.inArray( name[ index ], c.widgets );
+ // don't remove the widget from config.widget if refreshing
+ if ( indx >= 0 && refreshing !== true ) {
+ c.widgets.splice( indx, 1 );
+ }
+ if ( widget && widget.remove ) {
+ if ( ts.debug(c, 'core') ) {
+ console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
+ }
+ widget.remove( table, c, c.widgetOptions, refreshing );
+ c.widgetInit[ name[ index ] ] = false;
+ }
+ }
+ c.$table.triggerHandler( 'widgetRemoveEnd', table );
+ },
+
+ refreshWidgets : function( table, doAll, dontapply ) {
+ table = $( table )[ 0 ]; // see issue #243
+ var indx, widget,
+ c = table.config,
+ curWidgets = c.widgets,
+ widgets = ts.widgets,
+ len = widgets.length,
+ list = [],
+ callback = function( table ) {
+ $( table ).triggerHandler( 'refreshComplete' );
+ };
+ // remove widgets not defined in config.widgets, unless doAll is true
+ for ( indx = 0; indx < len; indx++ ) {
+ widget = widgets[ indx ];
+ if ( widget && widget.id && ( doAll || $.inArray( widget.id, curWidgets ) < 0 ) ) {
+ list[ list.length ] = widget.id;
+ }
+ }
+ ts.removeWidget( table, list.join( ',' ), true );
+ if ( dontapply !== true ) {
+ // call widget init if
+ ts.applyWidget( table, doAll || false, callback );
+ if ( doAll ) {
+ // apply widget format
+ ts.applyWidget( table, false, callback );
+ }
+ } else {
+ callback( table );
+ }
+ },
+
+ /*
+ ██ ██ ██████ ██ ██ ██ ██████ ██ ██████ ▄█████
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▄▄ ▀█▄
+ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀█▄
+ ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
+ */
+ benchmark : function( diff ) {
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
+ },
+ // deprecated ts.log
+ log : function() {
+ console.log( arguments );
+ },
+ debug : function(c, name) {
+ return c && (
+ c.debug === true ||
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
+ );
+ },
+
+ // $.isEmptyObject from jQuery v1.4
+ isEmptyObject : function( obj ) {
+ /*jshint forin: false */
+ for ( var name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isValueInArray : function( column, arry ) {
+ var indx,
+ len = arry && arry.length || 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( arry[ indx ][ 0 ] === column ) {
+ return indx;
+ }
+ }
+ return -1;
+ },
+
+ formatFloat : function( str, table ) {
+ if ( typeof str !== 'string' || str === '' ) { return str; }
+ // allow using formatFloat without a table; defaults to US number format
+ var num,
+ usFormat = table && table.config ? table.config.usNumberFormat !== false :
+ typeof table !== 'undefined' ? table : true;
+ if ( usFormat ) {
+ // US Format - 1,234,567.89 -> 1234567.89
+ str = str.replace( ts.regex.comma, '' );
+ } else {
+ // German Format = 1.234.567,89 -> 1234567.89
+ // French Format = 1 234 567,89 -> 1234567.89
+ str = str.replace( ts.regex.digitNonUS, '' ).replace( ts.regex.comma, '.' );
+ }
+ if ( ts.regex.digitNegativeTest.test( str ) ) {
+ // make (#) into a negative number -> (10) = -10
+ str = str.replace( ts.regex.digitNegativeReplace, '-$1' );
+ }
+ num = parseFloat( str );
+ // return the text instead of zero
+ return isNaN( num ) ? $.trim( str ) : num;
+ },
+
+ isDigit : function( str ) {
+ // replace all unwanted chars and match
+ return isNaN( str ) ?
+ ts.regex.digitTest.test( str.toString().replace( ts.regex.digitReplace, '' ) ) :
+ str !== '';
+ },
+
+ // computeTableHeaderCellIndexes from:
+ // http://www.javascripttoolbox.com/lib/table/examples.php
+ // http://www.javascripttoolbox.com/temp/table_cellindex.html
+ computeColumnIndex : function( $rows, c ) {
+ var i, j, k, l, cell, cells, rowIndex, rowSpan, colSpan, firstAvailCol,
+ // total columns has been calculated, use it to set the matrixrow
+ columns = c && c.columns || 0,
+ matrix = [],
+ matrixrow = new Array( columns );
+ for ( i = 0; i < $rows.length; i++ ) {
+ cells = $rows[ i ].cells;
+ for ( j = 0; j < cells.length; j++ ) {
+ cell = cells[ j ];
+ rowIndex = i;
+ rowSpan = cell.rowSpan || 1;
+ colSpan = cell.colSpan || 1;
+ if ( typeof matrix[ rowIndex ] === 'undefined' ) {
+ matrix[ rowIndex ] = [];
+ }
+ // Find first available column in the first row
+ for ( k = 0; k < matrix[ rowIndex ].length + 1; k++ ) {
+ if ( typeof matrix[ rowIndex ][ k ] === 'undefined' ) {
+ firstAvailCol = k;
+ break;
+ }
+ }
+ // jscs:disable disallowEmptyBlocks
+ if ( columns && cell.cellIndex === firstAvailCol ) {
+ // don't to anything
+ } else if ( cell.setAttribute ) {
+ // jscs:enable disallowEmptyBlocks
+ // add data-column (setAttribute = IE8+)
+ cell.setAttribute( 'data-column', firstAvailCol );
+ } else {
+ // remove once we drop support for IE7 - 1/12/2016
+ $( cell ).attr( 'data-column', firstAvailCol );
+ }
+ for ( k = rowIndex; k < rowIndex + rowSpan; k++ ) {
+ if ( typeof matrix[ k ] === 'undefined' ) {
+ matrix[ k ] = [];
+ }
+ matrixrow = matrix[ k ];
+ for ( l = firstAvailCol; l < firstAvailCol + colSpan; l++ ) {
+ matrixrow[ l ] = 'x';
+ }
+ }
+ }
+ }
+ ts.checkColumnCount($rows, matrix, matrixrow.length);
+ return matrixrow.length;
+ },
+
+ checkColumnCount : function($rows, matrix, columns) {
+ // this DOES NOT report any tbody column issues, except for the math and
+ // and column selector widgets
+ var i, len,
+ valid = true,
+ cells = [];
+ for ( i = 0; i < matrix.length; i++ ) {
+ // some matrix entries are undefined when testing the footer because
+ // it is using the rowIndex property
+ if ( matrix[i] ) {
+ len = matrix[i].length;
+ if ( matrix[i].length !== columns ) {
+ valid = false;
+ break;
+ }
+ }
+ }
+ if ( !valid ) {
+ $rows.each( function( indx, el ) {
+ var cell = el.parentElement.nodeName;
+ if ( cells.indexOf( cell ) < 0 ) {
+ cells.push( cell );
+ }
+ });
+ console.error(
+ 'Invalid or incorrect number of columns in the ' +
+ cells.join( ' or ' ) + '; expected ' + columns +
+ ', but found ' + len + ' columns'
+ );
+ }
+ },
+
+ // automatically add a colgroup with col elements set to a percentage width
+ fixColumnWidth : function( table ) {
+ table = $( table )[ 0 ];
+ var overallWidth, percent, $tbodies, len, index,
+ c = table.config,
+ $colgroup = c.$table.children( 'colgroup' );
+ // remove plugin-added colgroup, in case we need to refresh the widths
+ if ( $colgroup.length && $colgroup.hasClass( ts.css.colgroup ) ) {
+ $colgroup.remove();
+ }
+ if ( c.widthFixed && c.$table.children( 'colgroup' ).length === 0 ) {
+ $colgroup = $( '<colgroup class="' + ts.css.colgroup + '">' );
+ overallWidth = c.$table.width();
+ // only add col for visible columns - fixes #371
+ $tbodies = c.$tbodies.find( 'tr:first' ).children( ':visible' );
+ len = $tbodies.length;
+ for ( index = 0; index < len; index++ ) {
+ percent = parseInt( ( $tbodies.eq( index ).width() / overallWidth ) * 1000, 10 ) / 10 + '%';
+ $colgroup.append( $( '<col>' ).css( 'width', percent ) );
+ }
+ c.$table.prepend( $colgroup );
+ }
+ },
+
+ // get sorter, string, empty, etc options for each column from
+ // jQuery data, metadata, header option or header class name ('sorter-false')
+ // priority = jQuery data > meta > headers option > header class name
+ getData : function( header, configHeader, key ) {
+ var meta, cl4ss,
+ val = '',
+ $header = $( header );
+ if ( !$header.length ) { return ''; }
+ meta = $.metadata ? $header.metadata() : false;
+ cl4ss = ' ' + ( $header.attr( 'class' ) || '' );
+ if ( typeof $header.data( key ) !== 'undefined' ||
+ typeof $header.data( key.toLowerCase() ) !== 'undefined' ) {
+ // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder'
+ // 'data-sort-initial-order' is assigned to 'sortInitialOrder'
+ val += $header.data( key ) || $header.data( key.toLowerCase() );
+ } else if ( meta && typeof meta[ key ] !== 'undefined' ) {
+ val += meta[ key ];
+ } else if ( configHeader && typeof configHeader[ key ] !== 'undefined' ) {
+ val += configHeader[ key ];
+ } else if ( cl4ss !== ' ' && cl4ss.match( ' ' + key + '-' ) ) {
+ // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser'
+ val = cl4ss.match( new RegExp( '\\s' + key + '-([\\w-]+)' ) )[ 1 ] || '';
+ }
+ return $.trim( val );
+ },
+
+ getColumnData : function( table, obj, indx, getCell, $headers ) {
+ if ( typeof obj !== 'object' || obj === null ) {
+ return obj;
+ }
+ table = $( table )[ 0 ];
+ var $header, key,
+ c = table.config,
+ $cells = ( $headers || c.$headers ),
+ // c.$headerIndexed is not defined initially
+ $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
+ $cells.find( '[data-column="' + indx + '"]:last' );
+ if ( typeof obj[ indx ] !== 'undefined' ) {
+ return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
+ }
+ for ( key in obj ) {
+ if ( typeof key === 'string' ) {
+ $header = $cell
+ // header cell with class/id
+ .filter( key )
+ // find elements within the header cell with cell/id
+ .add( $cell.find( key ) );
+ if ( $header.length ) {
+ return obj[ key ];
+ }
+ }
+ }
+ return;
+ },
+
+ // *** Process table ***
+ // add processing indicator
+ isProcessing : function( $table, toggle, $headers ) {
+ $table = $( $table );
+ var c = $table[ 0 ].config,
+ // default to all headers
+ $header = $headers || $table.find( '.' + ts.css.header );
+ if ( toggle ) {
+ // don't use sortList if custom $headers used
+ if ( typeof $headers !== 'undefined' && c.sortList.length > 0 ) {
+ // get headers from the sortList
+ $header = $header.filter( function() {
+ // get data-column from attr to keep compatibility with jQuery 1.2.6
+ return this.sortDisabled ?
+ false :
+ ts.isValueInArray( parseFloat( $( this ).attr( 'data-column' ) ), c.sortList ) >= 0;
+ });
+ }
+ $table.add( $header ).addClass( ts.css.processing + ' ' + c.cssProcessing );
+ } else {
+ $table.add( $header ).removeClass( ts.css.processing + ' ' + c.cssProcessing );
+ }
+ },
+
+ // detach tbody but save the position
+ // don't use tbody because there are portions that look for a tbody index (updateCell)
+ processTbody : function( table, $tb, getIt ) {
+ table = $( table )[ 0 ];
+ if ( getIt ) {
+ table.isProcessing = true;
+ $tb.before( '<colgroup class="tablesorter-savemyplace"/>' );
+ return $.fn.detach ? $tb.detach() : $tb.remove();
+ }
+ var holdr = $( table ).find( 'colgroup.tablesorter-savemyplace' );
+ $tb.insertAfter( holdr );
+ holdr.remove();
+ table.isProcessing = false;
+ },
+
+ clearTableBody : function( table ) {
+ $( table )[ 0 ].config.$tbodies.children().detach();
+ },
+
+ // used when replacing accented characters during sorting
+ characterEquivalents : {
+ 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå
+ 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ
+ 'c' : '\u00e7\u0107\u010d', // çćč
+ 'C' : '\u00c7\u0106\u010c', // ÇĆČ
+ 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę
+ 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ
+ 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı
+ 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ
+ 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6\u014d', // óòôõöō
+ 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6\u014c', // ÓÒÔÕÖŌ
+ 'ss': '\u00df', // ß (s sharp)
+ 'SS': '\u1e9e', // ẞ (Capital sharp s)
+ 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů
+ 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ
+ },
+
+ replaceAccents : function( str ) {
+ var chr,
+ acc = '[',
+ eq = ts.characterEquivalents;
+ if ( !ts.characterRegex ) {
+ ts.characterRegexArray = {};
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ acc += eq[ chr ];
+ ts.characterRegexArray[ chr ] = new RegExp( '[' + eq[ chr ] + ']', 'g' );
+ }
+ }
+ ts.characterRegex = new RegExp( acc + ']' );
+ }
+ if ( ts.characterRegex.test( str ) ) {
+ for ( chr in eq ) {
+ if ( typeof chr === 'string' ) {
+ str = str.replace( ts.characterRegexArray[ chr ], chr );
+ }
+ }
+ }
+ return str;
+ },
+
+ validateOptions : function( c ) {
+ var setting, setting2, typ, timer,
+ // ignore options containing an array
+ ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
+ orig = c.originalSettings;
+ if ( orig ) {
+ if ( ts.debug(c, 'core') ) {
+ timer = new Date();
+ }
+ for ( setting in orig ) {
+ typ = typeof ts.defaults[setting];
+ if ( typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '" option not recognized' );
+ } else if ( typ === 'object' ) {
+ for ( setting2 in orig[setting] ) {
+ typ = ts.defaults[setting] && typeof ts.defaults[setting][setting2];
+ if ( $.inArray( setting, ignore ) < 0 && typ === 'undefined' ) {
+ console.warn( 'Tablesorter Warning! "table.config.' + setting + '.' + setting2 + '" option not recognized' );
+ }
+ }
+ }
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'validate options time:' + ts.benchmark( timer ) );
+ }
+ }
+ },
+
+ // restore headers
+ restoreHeaders : function( table ) {
+ var index, $cell,
+ c = $( table )[ 0 ].config,
+ $headers = c.$table.find( c.selectorHeaders ),
+ len = $headers.length;
+ // don't use c.$headers here in case header cells were swapped
+ for ( index = 0; index < len; index++ ) {
+ $cell = $headers.eq( index );
+ // only restore header cells if it is wrapped
+ // because this is also used by the updateAll method
+ if ( $cell.find( '.' + ts.css.headerIn ).length ) {
+ $cell.html( c.headerContent[ index ] );
+ }
+ }
+ },
+
+ destroy : function( table, removeClasses, callback ) {
+ table = $( table )[ 0 ];
+ if ( !table.hasInitialized ) { return; }
+ // remove all widgets
+ ts.removeWidget( table, true, false );
+ var events,
+ $t = $( table ),
+ c = table.config,
+ $h = $t.find( 'thead:first' ),
+ $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
+ $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
+ if ( removeClasses === false && $.inArray( 'uitheme', c.widgets ) >= 0 ) {
+ // reapply uitheme classes, in case we want to maintain appearance
+ $t.triggerHandler( 'applyWidgetId', [ 'uitheme' ] );
+ $t.triggerHandler( 'applyWidgetId', [ 'zebra' ] );
+ }
+ // remove widget added rows, just in case
+ $h.find( 'tr' ).not( $r ).remove();
+ // disable tablesorter - not using .unbind( namespace ) because namespacing was
+ // added in jQuery v1.4.3 - see http://api.jquery.com/event.namespace/
+ events = 'sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton ' +
+ 'appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave ' +
+ 'keypress sortBegin sortEnd resetToLoadState '.split( ' ' )
+ .join( c.namespace + ' ' );
+ $t
+ .removeData( 'tablesorter' )
+ .unbind( events.replace( ts.regex.spaces, ' ' ) );
+ c.$headers
+ .add( $f )
+ .removeClass( [ ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone ].join( ' ' ) )
+ .removeAttr( 'data-column' )
+ .removeAttr( 'aria-label' )
+ .attr( 'aria-disabled', 'true' );
+ $r
+ .find( c.selectorSort )
+ .unbind( ( 'mousedown mouseup keypress '.split( ' ' ).join( c.namespace + ' ' ) ).replace( ts.regex.spaces, ' ' ) );
+ ts.restoreHeaders( table );
+ $t.toggleClass( ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false );
+ $t.removeClass(c.namespace.slice(1));
+ // clear flag in case the plugin is initialized again
+ table.hasInitialized = false;
+ delete table.config.cache;
+ if ( typeof callback === 'function' ) {
+ callback( table );
+ }
+ if ( ts.debug(c, 'core') ) {
+ console.log( 'tablesorter has been removed' );
+ }
+ }
+
+ };
+
+ $.fn.tablesorter = function( settings ) {
+ return this.each( function() {
+ var table = this,
+ // merge & extend config options
+ c = $.extend( true, {}, ts.defaults, settings, ts.instanceMethods );
+ // save initial settings
+ c.originalSettings = settings;
+ // create a table from data (build table widget)
+ if ( !table.hasInitialized && ts.buildTable && this.nodeName !== 'TABLE' ) {
+ // return the table (in case the original target is the table's container)
+ ts.buildTable( table, c );
+ } else {
+ ts.setup( table, c );
+ }
+ });
+ };
+
+ // set up debug logs
+ if ( !( window.console && window.console.log ) ) {
+ // access $.tablesorter.logs for browsers that don't have a console...
+ ts.logs = [];
+ /*jshint -W020 */
+ console = {};
+ console.log = console.warn = console.error = console.table = function() {
+ var arg = arguments.length > 1 ? arguments : arguments[0];
+ ts.logs[ ts.logs.length ] = { date: Date.now(), log: arg };
+ };
+ }
+
+ // add default parsers
+ ts.addParser({
+ id : 'no-parser',
+ is : function() {
+ return false;
+ },
+ format : function() {
+ return '';
+ },
+ type : 'text'
+ });
+
+ ts.addParser({
+ id : 'text',
+ is : function() {
+ return true;
+ },
+ format : function( str, table ) {
+ var c = table.config;
+ if ( str ) {
+ str = $.trim( c.ignoreCase ? str.toLocaleLowerCase() : str );
+ str = c.sortLocaleCompare ? ts.replaceAccents( str ) : str;
+ }
+ return str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.nondigit = /[^\w,. \-()]/g;
+ ts.addParser({
+ id : 'digit',
+ is : function( str ) {
+ return ts.isDigit( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.currencyReplace = /[+\-,. ]/g;
+ ts.regex.currencyTest = /^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/;
+ ts.addParser({
+ id : 'currency',
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.currencyReplace, '' );
+ // test for £$€¤¥¢
+ return ts.regex.currencyTest.test( str );
+ },
+ format : function( str, table ) {
+ var num = ts.formatFloat( ( str || '' ).replace( ts.regex.nondigit, '' ), table );
+ return str && typeof num === 'number' ? num :
+ str ? $.trim( str && table.config.ignoreCase ? str.toLocaleLowerCase() : str ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
+ // now, this regex can be updated before initialization
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
+ ts.addParser({
+ id : 'url',
+ is : function( str ) {
+ return ts.regex.urlProtocolTest.test( str );
+ },
+ format : function( str ) {
+ return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
+ },
+ type : 'text'
+ });
+
+ ts.regex.dash = /-/g;
+ ts.regex.isoDate = /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/;
+ ts.addParser({
+ id : 'isoDate',
+ is : function( str ) {
+ return ts.regex.isoDate.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ ts.regex.percent = /%/g;
+ ts.regex.percentTest = /(\d\s*?%|%\s*?\d)/;
+ ts.addParser({
+ id : 'percent',
+ is : function( str ) {
+ return ts.regex.percentTest.test( str ) && str.length < 15;
+ },
+ format : function( str, table ) {
+ return str ? ts.formatFloat( str.replace( ts.regex.percent, '' ), table ) : str;
+ },
+ type : 'numeric'
+ });
+
+ // added image parser to core v2.17.9
+ ts.addParser({
+ id : 'image',
+ is : function( str, table, node, $node ) {
+ return $node.find( 'img' ).length > 0;
+ },
+ format : function( str, table, cell ) {
+ return $( cell ).find( 'img' ).attr( table.config.imgAttr || 'alt' ) || str;
+ },
+ parsed : true, // filter widget flag
+ type : 'text'
+ });
+
+ ts.regex.dateReplace = /(\S)([AP]M)$/i; // used by usLongDate & time parser
+ ts.regex.usLongDateTest1 = /^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i;
+ ts.regex.usLongDateTest2 = /^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i;
+ ts.addParser({
+ id : 'usLongDate',
+ is : function( str ) {
+ // two digit years are not allowed cross-browser
+ // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
+ return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
+ },
+ format : function( str ) {
+ var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
+ return date instanceof Date && isFinite( date ) ? date.getTime() : str;
+ },
+ type : 'numeric'
+ });
+
+ // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included
+ ts.regex.shortDateTest = /(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/;
+ // escaped "-" because JSHint in Firefox was showing it as an error
+ ts.regex.shortDateReplace = /[\-.,]/g;
+ // XXY covers MDY & DMY formats
+ ts.regex.shortDateXXY = /(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/;
+ ts.regex.shortDateYMD = /(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
+ ts.convertFormat = function( dateString, format ) {
+ dateString = ( dateString || '' )
+ .replace( ts.regex.spaces, ' ' )
+ .replace( ts.regex.shortDateReplace, '/' );
+ if ( format === 'mmddyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$1/$2' );
+ } else if ( format === 'ddmmyyyy' ) {
+ dateString = dateString.replace( ts.regex.shortDateXXY, '$3/$2/$1' );
+ } else if ( format === 'yyyymmdd' ) {
+ dateString = dateString.replace( ts.regex.shortDateYMD, '$1/$2/$3' );
+ }
+ var date = new Date( dateString );
+ return date instanceof Date && isFinite( date ) ? date.getTime() : '';
+ };
+
+ ts.addParser({
+ id : 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd'
+ is : function( str ) {
+ str = ( str || '' ).replace( ts.regex.spaces, ' ' ).replace( ts.regex.shortDateReplace, '/' );
+ return ts.regex.shortDateTest.test( str );
+ },
+ format : function( str, table, cell, cellIndex ) {
+ if ( str ) {
+ var c = table.config,
+ $header = c.$headerIndexed[ cellIndex ],
+ format = $header.length && $header.data( 'dateFormat' ) ||
+ ts.getData( $header, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat' ) ||
+ c.dateFormat;
+ // save format because getData can be slow...
+ if ( $header.length ) {
+ $header.data( 'dateFormat', format );
+ }
+ return ts.convertFormat( str, format ) || str;
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ // match 24 hour time & 12 hours time + am/pm - see http://regexr.com/3c3tk
+ ts.regex.timeTest = /^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i;
+ ts.regex.timeMatch = /(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i;
+ ts.addParser({
+ id : 'time',
+ is : function( str ) {
+ return ts.regex.timeTest.test( str );
+ },
+ format : function( str ) {
+ // isolate time... ignore month, day and year
+ var temp,
+ timePart = ( str || '' ).match( ts.regex.timeMatch ),
+ orig = new Date( str ),
+ // no time component? default to 00:00 by leaving it out, but only if str is defined
+ time = str && ( timePart !== null ? timePart[ 0 ] : '00:00 AM' ),
+ date = time ? new Date( '2000/01/01 ' + time.replace( ts.regex.dateReplace, '$1 $2' ) ) : time;
+ if ( date instanceof Date && isFinite( date ) ) {
+ temp = orig instanceof Date && isFinite( orig ) ? orig.getTime() : 0;
+ // if original string was a valid date, add it to the decimal so the column sorts in some kind of order
+ // luckily new Date() ignores the decimals
+ return temp ? parseFloat( date.getTime() + '.' + orig.getTime() ) : date.getTime();
+ }
+ return str;
+ },
+ type : 'numeric'
+ });
+
+ ts.addParser({
+ id : 'metadata',
+ is : function() {
+ return false;
+ },
+ format : function( str, table, cell ) {
+ var c = table.config,
+ p = ( !c.parserMetadataName ) ? 'sortValue' : c.parserMetadataName;
+ return $( cell ).metadata()[ p ];
+ },
+ type : 'numeric'
+ });
+
+ /*
+ ██████ ██████ █████▄ █████▄ ▄████▄
+ ▄█▀ ██▄▄ ██▄▄██ ██▄▄██ ██▄▄██
+ ▄█▀ ██▀▀ ██▀▀██ ██▀▀█ ██▀▀██
+ ██████ ██████ █████▀ ██ ██ ██ ██
+ */
+ // add default widgets
+ ts.addWidget({
+ id : 'zebra',
+ priority : 90,
+ format : function( table, c, wo ) {
+ var $visibleRows, $row, count, isEven, tbodyIndex, rowIndex, len,
+ child = new RegExp( c.cssChildRow, 'i' ),
+ $tbodies = c.$tbodies.add( $( c.namespace + '_extra_table' ).children( 'tbody:not(.' + c.cssInfoBlock + ')' ) );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ // loop through the visible rows
+ count = 0;
+ $visibleRows = $tbodies.eq( tbodyIndex ).children( 'tr:visible' ).not( c.selectorRemove );
+ len = $visibleRows.length;
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ $row = $visibleRows.eq( rowIndex );
+ // style child rows the same way the parent row was styled
+ if ( !child.test( $row[ 0 ].className ) ) { count++; }
+ isEven = ( count % 2 === 0 );
+ $row
+ .removeClass( wo.zebra[ isEven ? 1 : 0 ] )
+ .addClass( wo.zebra[ isEven ? 0 : 1 ] );
+ }
+ }
+ },
+ remove : function( table, c, wo, refreshing ) {
+ if ( refreshing ) { return; }
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( toRemove );
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ }
+ });
+
+})( jQuery );
+return jQuery.tablesorter;}));
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.min.js b/web/_static/tablesorter/js/jquery.tablesorter.min.js
new file mode 100644
index 0000000..50a0e17
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.min.js
@@ -0,0 +1 @@
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(A){"use strict";var L=A.tablesorter={version:"2.31.3",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(t,r){if(t&&t.tHead&&0!==t.tBodies.length&&!0!==t.hasInitialized){var e,o="",s=A(t),a=A.metadata;t.hasInitialized=!1,t.isProcessing=!0,t.config=r,A.data(t,"tablesorter",r),L.debug(r,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+L.version),A.data(t,"startoveralltimer",new Date)),r.supportsDataObject=((e=A.fn.jquery.split("."))[0]=parseInt(e[0],10),1<e[0]||1===e[0]&&4<=parseInt(e[1],10)),r.emptyTo=r.emptyTo.toLowerCase(),r.stringTo=r.stringTo.toLowerCase(),r.last={sortList:[],clickedIndex:-1},/tablesorter\-/.test(s.attr("class"))||(o=""!==r.theme?" tablesorter-"+r.theme:""),r.namespace?r.namespace="."+r.namespace.replace(L.regex.nonWord,""):r.namespace=".tablesorter"+Math.random().toString(16).slice(2),r.table=t,r.$table=s.addClass(L.css.table+" "+r.tableClass+o+" "+r.namespace.slice(1)).attr("role","grid"),r.$headers=s.find(r.selectorHeaders),r.$table.children().children("tr").attr("role","row"),r.$tbodies=s.children("tbody:not(."+r.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),r.$table.children("caption").length&&((o=r.$table.children("caption")[0]).id||(o.id=r.namespace.slice(1)+"caption"),r.$table.attr("aria-labelledby",o.id)),r.widgetInit={},r.textExtraction=r.$table.attr("data-text-extraction")||r.textExtraction||"basic",L.buildHeaders(r),L.fixColumnWidth(t),L.addWidgetFromClass(t),L.applyWidgetOptions(t),L.setupParsers(r),r.totalRows=0,r.debug&&L.validateOptions(r),r.delayInit||L.buildCache(r),L.bindEvents(t,r.$headers,!0),L.bindMethods(r),r.supportsDataObject&&void 0!==s.data().sortlist?r.sortList=s.data().sortlist:a&&s.metadata()&&s.metadata().sortlist&&(r.sortList=s.metadata().sortlist),L.applyWidget(t,!0),0<r.sortList.length?(r.last.sortList=r.sortList,L.sortOn(r,r.sortList,{},!r.initWidgets)):(L.setHeadersCss(r),r.initWidgets&&L.applyWidget(t,!1)),r.showProcessing&&s.unbind("sortBegin"+r.namespace+" sortEnd"+r.namespace).bind("sortBegin"+r.namespace+" sortEnd"+r.namespace,function(e){clearTimeout(r.timerProcessing),L.isProcessing(t),"sortBegin"===e.type&&(r.timerProcessing=setTimeout(function(){L.isProcessing(t,!0)},500))}),t.hasInitialized=!0,t.isProcessing=!1,L.debug(r,"core")&&(console.log("Overall initialization time:"+L.benchmark(A.data(t,"startoveralltimer"))),L.debug(r,"core")&&console.groupEnd&&console.groupEnd()),s.triggerHandler("tablesorter-initialized",t),"function"==typeof r.initialized&&r.initialized(t)}else L.debug(r,"core")&&(t.hasInitialized?console.warn("Stopping initialization. Tablesorter has already been initialized"):console.error("Stopping initialization! No table, thead or tbody",t))},bindMethods:function(r){var e=r.$table,t=r.namespace,o="sortReset update updateRows updateAll updateHeaders addRows updateCell updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(t+" ");e.unbind(o.replace(L.regex.spaces," ")).bind("sortReset"+t,function(e,t){e.stopPropagation(),L.sortReset(this.config,function(e){e.isApplyingWidgets?setTimeout(function(){L.applyWidget(e,"",t)},100):L.applyWidget(e,"",t)})}).bind("updateAll"+t,function(e,t,r){e.stopPropagation(),L.updateAll(this.config,t,r)}).bind("update"+t+" updateRows"+t,function(e,t,r){e.stopPropagation(),L.update(this.config,t,r)}).bind("updateHeaders"+t,function(e,t){e.stopPropagation(),L.updateHeaders(this.config,t)}).bind("updateCell"+t,function(e,t,r,o){e.stopPropagation(),L.updateCell(this.config,t,r,o)}).bind("addRows"+t,function(e,t,r,o){e.stopPropagation(),L.addRows(this.config,t,r,o)}).bind("updateComplete"+t,function(){this.isUpdating=!1}).bind("sorton"+t,function(e,t,r,o){e.stopPropagation(),L.sortOn(this.config,t,r,o)}).bind("appendCache"+t,function(e,t,r){e.stopPropagation(),L.appendCache(this.config,r),A.isFunction(t)&&t(this)}).bind("updateCache"+t,function(e,t,r){e.stopPropagation(),L.updateCache(this.config,t,r)}).bind("applyWidgetId"+t,function(e,t){e.stopPropagation(),L.applyWidgetId(this,t)}).bind("applyWidgets"+t,function(e,t){e.stopPropagation(),L.applyWidget(this,!1,t)}).bind("refreshWidgets"+t,function(e,t,r){e.stopPropagation(),L.refreshWidgets(this,t,r)}).bind("removeWidget"+t,function(e,t,r){e.stopPropagation(),L.removeWidget(this,t,r)}).bind("destroy"+t,function(e,t,r){e.stopPropagation(),L.destroy(this,t,r)}).bind("resetToLoadState"+t,function(e){e.stopPropagation(),L.removeWidget(this,!0,!1);var t=A.extend(!0,{},r.originalSettings);(r=A.extend(!0,{},L.defaults,t)).originalSettings=t,this.hasInitialized=!1,L.setup(this,r)})},bindEvents:function(e,t,r){var o,i=(e=A(e)[0]).config,s=i.namespace,d=null;!0!==r&&(t.addClass(s.slice(1)+"_extra_headers"),(o=L.getClosest(t,"table")).length&&"TABLE"===o[0].nodeName&&o[0]!==e&&A(o[0]).addClass(s.slice(1)+"_extra_table")),o=(i.pointerDown+" "+i.pointerUp+" "+i.pointerClick+" sort keyup ").replace(L.regex.spaces," ").split(" ").join(s+" "),t.find(i.selectorSort).add(t.filter(i.selectorSort)).unbind(o).bind(o,function(e,t){var r,o,s,a=A(e.target),n=" "+e.type+" ";if(!(1!==(e.which||e.button)&&!n.match(" "+i.pointerClick+" | sort | keyup ")||" keyup "===n&&e.which!==L.keyCodes.enter||n.match(" "+i.pointerClick+" ")&&void 0!==e.which||n.match(" "+i.pointerUp+" ")&&d!==e.target&&!0!==t)){if(n.match(" "+i.pointerDown+" "))return d=e.target,void("1"===(s=a.jquery.split("."))[0]&&s[1]<4&&e.preventDefault());if(d=null,r=L.getClosest(A(this),"."+L.css.header),L.regex.formElements.test(e.target.nodeName)||a.hasClass(i.cssNoSort)||0<a.parents("."+i.cssNoSort).length||r.hasClass("sorter-false")||0<a.parents("button").length)return!i.cancelSelection;i.delayInit&&L.isEmptyObject(i.cache)&&L.buildCache(i),i.last.clickedIndex=r.attr("data-column")||r.index(),(o=i.$headerIndexed[i.last.clickedIndex][0])&&!o.sortDisabled&&L.initSort(i,o,e)}}),i.cancelSelection&&t.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},buildHeaders:function(d){var e,l,t,r;for(d.headerList=[],d.headerContent=[],d.sortVars=[],L.debug(d,"core")&&(t=new Date),d.columns=L.computeColumnIndex(d.$table.children("thead, tfoot").children("tr")),l=d.cssIcon?'<i class="'+(d.cssIcon===L.css.icon?L.css.icon:d.cssIcon+" "+L.css.icon)+'"></i>':"",d.$headers=A(A.map(d.$table.find(d.selectorHeaders),function(e,t){var r,o,s,a,n,i=A(e);if(!L.getClosest(i,"tr").hasClass(d.cssIgnoreRow))return/(th|td)/i.test(e.nodeName)||(n=L.getClosest(i,"th, td"),i.attr("data-column",n.attr("data-column"))),r=L.getColumnData(d.table,d.headers,t,!0),d.headerContent[t]=i.html(),""===d.headerTemplate||i.find("."+L.css.headerIn).length||(a=d.headerTemplate.replace(L.regex.templateContent,i.html()).replace(L.regex.templateIcon,i.find("."+L.css.icon).length?"":l),d.onRenderTemplate&&(o=d.onRenderTemplate.apply(i,[t,a]))&&"string"==typeof o&&(a=o),i.html('<div class="'+L.css.headerIn+'">'+a+"</div>")),d.onRenderHeader&&d.onRenderHeader.apply(i,[t,d,d.$table]),s=parseInt(i.attr("data-column"),10),e.column=s,n=L.getOrder(L.getData(i,r,"sortInitialOrder")||d.sortInitialOrder),d.sortVars[s]={count:-1,order:n?d.sortReset?[1,0,2]:[1,0]:d.sortReset?[0,1,2]:[0,1],lockedOrder:!1,sortedBy:""},void 0!==(n=L.getData(i,r,"lockedOrder")||!1)&&!1!==n&&(d.sortVars[s].lockedOrder=!0,d.sortVars[s].order=L.getOrder(n)?[1,1]:[0,0]),d.headerList[t]=e,i.addClass(L.css.header+" "+d.cssHeader),L.getClosest(i,"tr").addClass(L.css.headerRow+" "+d.cssHeaderRow).attr("role","row"),d.tabIndex&&i.attr("tabindex",0),e})),d.$headerIndexed=[],r=0;r<d.columns;r++)L.isEmptyObject(d.sortVars[r])&&(d.sortVars[r]={}),e=d.$headers.filter('[data-column="'+r+'"]'),d.$headerIndexed[r]=e.length?e.not(".sorter-false").length?e.not(".sorter-false").filter(":last"):e.filter(":last"):A();d.$table.find(d.selectorHeaders).attr({scope:"col",role:"columnheader"}),L.updateHeader(d),L.debug(d,"core")&&(console.log("Built headers:"+L.benchmark(t)),console.log(d.$headers))},addInstanceMethods:function(e){A.extend(L.instanceMethods,e)},setupParsers:function(e,t){var r,o,s,a,n,i,d,l,c,g,p,u,f,h,m=e.table,b=0,y=L.debug(e,"core"),w={};if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),0===(h=(f=void 0===t?e.$tbodies:t).length))return y?console.warn("Warning: *Empty table!* Not building a parser cache"):"";for(y&&(u=new Date,console[console.group?"group":"log"]("Detecting parsers for each column")),o={extractors:[],parsers:[]};b<h;){if((r=f[b].rows).length)for(n=0,a=e.columns,i=0;i<a;i++){if((d=e.$headerIndexed[n])&&d.length&&(l=L.getColumnData(m,e.headers,n),p=L.getParserById(L.getData(d,l,"extractor")),g=L.getParserById(L.getData(d,l,"sorter")),c="false"===L.getData(d,l,"parser"),e.empties[n]=(L.getData(d,l,"empty")||e.emptyTo||(e.emptyToBottom?"bottom":"top")).toLowerCase(),e.strings[n]=(L.getData(d,l,"string")||e.stringTo||"max").toLowerCase(),c&&(g=L.getParserById("no-parser")),p=p||!1,g=g||L.detectParserForColumn(e,r,-1,n),y&&(w["("+n+") "+d.text()]={parser:g.id,extractor:p?p.id:"none",string:e.strings[n],empty:e.empties[n]}),o.parsers[n]=g,o.extractors[n]=p,0<(s=d[0].colSpan-1)))for(n+=s,a+=s;0<s+1;)o.parsers[n-s]=g,o.extractors[n-s]=p,s--;n++}b+=o.parsers.length?h:1}y&&(L.isEmptyObject(w)?console.warn(" No parsers detected!"):console[console.table?"table":"log"](w),console.log("Completed detecting parsers"+L.benchmark(u)),console.groupEnd&&console.groupEnd()),e.parsers=o.parsers,e.extractors=o.extractors},addParser:function(e){var t,r=L.parsers.length,o=!0;for(t=0;t<r;t++)L.parsers[t].id.toLowerCase()===e.id.toLowerCase()&&(o=!1);o&&(L.parsers[L.parsers.length]=e)},getParserById:function(e){if("false"==e)return!1;var t,r=L.parsers.length;for(t=0;t<r;t++)if(L.parsers[t].id.toLowerCase()===e.toString().toLowerCase())return L.parsers[t];return!1},detectParserForColumn:function(e,t,r,o){for(var s,a,n,i=L.parsers.length,d=!1,l="",c=L.debug(e,"core"),g=!0;""===l&&g;)(n=t[++r])&&r<50?n.className.indexOf(L.cssIgnoreRow)<0&&(d=t[r].cells[o],l=L.getElementText(e,d,o),a=A(d),c&&console.log("Checking if value was empty on row "+r+", column: "+o+': "'+l+'"')):g=!1;for(;0<=--i;)if((s=L.parsers[i])&&"text"!==s.id&&s.is&&s.is(l,e.table,d,a))return s;return L.getParserById("text")},getElementText:function(e,t,r){if(!t)return"";var o,s=e.textExtraction||"",a=t.jquery?t:A(t);return"string"==typeof s?"basic"===s&&void 0!==(o=a.attr(e.textAttribute))?A.trim(o):A.trim(t.textContent||a.text()):"function"==typeof s?A.trim(s(a[0],e.table,r)):"function"==typeof(o=L.getColumnData(e.table,s,r))?A.trim(o(a[0],e.table,r)):A.trim(a[0].textContent||a.text())},getParsedText:function(e,t,r,o){void 0===o&&(o=L.getElementText(e,t,r));var s=""+o,a=e.parsers[r],n=e.extractors[r];return a&&(n&&"function"==typeof n.format&&(o=n.format(o,e.table,t,r)),s="no-parser"===a.id?"":a.format(""+o,e.table,t,r),e.ignoreCase&&"string"==typeof s&&(s=s.toLowerCase())),s},buildCache:function(e,t,r){var o,s,a,n,i,d,l,c,g,p,u,f,h,m,b,y,w,x,v,C,$,I,D=e.table,R=e.parsers,T=L.debug(e,"core");if(e.$tbodies=e.$table.children("tbody:not(."+e.cssInfoBlock+")"),l=void 0===r?e.$tbodies:r,e.cache={},e.totalRows=0,!R)return T?console.warn("Warning: *Empty table!* Not building a cache"):"";for(T&&(f=new Date),e.showProcessing&&L.isProcessing(D,!0),d=0;d<l.length;d++){for(y=[],o=e.cache[d]={normalized:[]},h=l[d]&&l[d].rows.length||0,n=0;n<h;++n)if(m={child:[],raw:[]},g=[],!(c=A(l[d].rows[n])).hasClass(e.selectorRemove.slice(1)))if(c.hasClass(e.cssChildRow)&&0!==n)for($=o.normalized.length-1,(b=o.normalized[$][e.columns]).$row=b.$row.add(c),c.prev().hasClass(e.cssChildRow)||c.prev().addClass(L.css.cssHasChild),p=c.children("th, td"),$=b.child.length,b.child[$]=[],x=0,C=e.columns,i=0;i<C;i++)(u=p[i])&&(b.child[$][i]=L.getParsedText(e,u,i),0<(w=p[i].colSpan-1)&&(x+=w,C+=w)),x++;else{for(m.$row=c,m.order=n,x=0,C=e.columns,i=0;i<C;++i){if((u=c[0].cells[i])&&x<e.columns&&(!(v=void 0!==R[x])&&T&&console.warn("No parser found for row: "+n+", column: "+i+'; cell containing: "'+A(u).text()+'"; does it have a header?'),s=L.getElementText(e,u,x),m.raw[x]=s,a=L.getParsedText(e,u,x,s),g[x]=a,v&&"numeric"===(R[x].type||"").toLowerCase()&&(y[x]=Math.max(Math.abs(a)||0,y[x]||0)),0<(w=u.colSpan-1))){for(I=0;I<=w;)a=e.duplicateSpan||0===I?a:"string"!=typeof e.textExtraction&&L.getElementText(e,u,x+I)||"",m.raw[x+I]=a,g[x+I]=a,I++;x+=w,C+=w}x++}g[e.columns]=m,o.normalized[o.normalized.length]=g}o.colMax=y,e.totalRows+=o.normalized.length}if(e.showProcessing&&L.isProcessing(D),T){for($=Math.min(5,e.cache[0].normalized.length),console[console.group?"group":"log"]("Building cache for "+e.totalRows+" rows (showing "+$+" rows in log) and "+e.columns+" columns"+L.benchmark(f)),s={},i=0;i<e.columns;i++)for(x=0;x<$;x++)s["row: "+x]||(s["row: "+x]={}),s["row: "+x][e.$headerIndexed[i].text()]=e.cache[0].normalized[x][i];console[console.table?"table":"log"](s),console.groupEnd&&console.groupEnd()}A.isFunction(t)&&t(D)},getColumnText:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f="function"==typeof r,h="all"===t,m={raw:[],parsed:[],$cell:[]},b=(e=A(e)[0]).config;if(!L.isEmptyObject(b)){for(d=b.$tbodies.length,s=0;s<d;s++)for(l=(n=b.cache[s].normalized).length,a=0;a<l;a++)i=n[a],o&&!i[b.columns].$row.is(o)||(u=!0,g=h?i.slice(0,b.columns):i[t],i=i[b.columns],c=h?i.raw:i.raw[t],p=h?i.$row.children():i.$row.children().eq(t),f&&(u=r({tbodyIndex:s,rowIndex:a,parsed:g,raw:c,$row:i.$row,$cell:p})),!1!==u&&(m.parsed[m.parsed.length]=g,m.raw[m.raw.length]=c,m.$cell[m.$cell.length]=p));return m}L.debug(b,"core")&&console.warn("No cache found - aborting getColumnText function!")},setHeadersCss:function(a){function e(e,t){e.removeClass(n).addClass(i[t]).attr("aria-sort",l[t]).find("."+L.css.icon).removeClass(d[2]).addClass(d[t])}var t,r,o=a.sortList,s=o.length,n=L.css.sortNone+" "+a.cssNone,i=[L.css.sortAsc+" "+a.cssAsc,L.css.sortDesc+" "+a.cssDesc],d=[a.cssIconAsc,a.cssIconDesc,a.cssIconNone],l=["ascending","descending"],c=a.$table.find("tfoot tr").children("td, th").add(A(a.namespace+"_extra_headers")).removeClass(i.join(" ")),g=a.$headers.add(A("thead "+a.namespace+"_extra_headers")).removeClass(i.join(" ")).addClass(n).attr("aria-sort","none").find("."+L.css.icon).removeClass(d.join(" ")).end();for(g.not(".sorter-false").find("."+L.css.icon).addClass(d[2]),a.cssIconDisabled&&g.filter(".sorter-false").find("."+L.css.icon).addClass(a.cssIconDisabled),t=0;t<s;t++)if(2!==o[t][1]){if((g=(g=a.$headers.filter(function(e){for(var t=!0,r=a.$headers.eq(e),o=parseInt(r.attr("data-column"),10),s=o+L.getClosest(r,"th, td")[0].colSpan;o<s;o++)t=!!t&&(t||-1<L.isValueInArray(o,a.sortList));return t})).not(".sorter-false").filter('[data-column="'+o[t][0]+'"]'+(1===s?":last":""))).length)for(r=0;r<g.length;r++)g[r].sortDisabled||e(g.eq(r),o[t][1]);c.length&&e(c.filter('[data-column="'+o[t][0]+'"]'),o[t][1])}for(s=a.$headers.length,t=0;t<s;t++)L.setColumnAriaLabel(a,a.$headers.eq(t))},getClosest:function(e,t){return A.fn.closest?e.closest(t):e.is(t)?e:e.parents(t).filter(":first")},setColumnAriaLabel:function(e,t,r){if(t.length){var o=parseInt(t.attr("data-column"),10),s=e.sortVars[o],a=t.hasClass(L.css.sortAsc)?"sortAsc":t.hasClass(L.css.sortDesc)?"sortDesc":"sortNone",n=A.trim(t.text())+": "+L.language[a];t.hasClass("sorter-false")||!1===r?n+=L.language.sortDisabled:(a=(s.count+1)%s.order.length,r=s.order[a],n+=L.language[0===r?"nextAsc":1===r?"nextDesc":"nextNone"]),t.attr("aria-label",n),s.sortedBy?t.attr("data-sortedBy",s.sortedBy):t.removeAttr("data-sortedBy")}},updateHeader:function(e){var t,r,o,s,a=e.table,n=e.$headers.length;for(t=0;t<n;t++)o=e.$headers.eq(t),s=L.getColumnData(a,e.headers,t,!0),r="false"===L.getData(o,s,"sorter")||"false"===L.getData(o,s,"parser"),L.setColumnSort(e,o,r)},setColumnSort:function(e,t,r){var o=e.table.id;t[0].sortDisabled=r,t[r?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+r),e.tabIndex&&(r?t.removeAttr("tabindex"):t.attr("tabindex","0")),o&&(r?t.removeAttr("aria-controls"):t.attr("aria-controls",o))},updateHeaderSortCount:function(e,t){var r,o,s,a,n,i,d,l,c=t||e.sortList,g=c.length;for(e.sortList=[],a=0;a<g;a++)if(d=c[a],(r=parseInt(d[0],10))<e.columns){switch(e.sortVars[r].order||(l=L.getOrder(e.sortInitialOrder)?e.sortReset?[1,0,2]:[1,0]:e.sortReset?[0,1,2]:[0,1],e.sortVars[r].order=l,e.sortVars[r].count=0),l=e.sortVars[r].order,o=(o=(""+d[1]).match(/^(1|d|s|o|n)/))?o[0]:""){case"1":case"d":o=1;break;case"s":o=n||0;break;case"o":o=0===(i=l[(n||0)%l.length])?1:1===i?0:2;break;case"n":o=l[++e.sortVars[r].count%l.length];break;default:o=0}n=0===a?o:n,s=[r,parseInt(o,10)||0],e.sortList[e.sortList.length]=s,o=A.inArray(s[1],l),e.sortVars[r].count=0<=o?o:s[1]%l.length}},updateAll:function(e,t,r){var o=e.table;o.isUpdating=!0,L.refreshWidgets(o,!0,!0),L.buildHeaders(e),L.bindEvents(o,e.$headers,!0),L.bindMethods(e),L.commonUpdate(e,t,r)},update:function(e,t,r){e.table.isUpdating=!0,L.updateHeader(e),L.commonUpdate(e,t,r)},updateHeaders:function(e,t){e.table.isUpdating=!0,L.buildHeaders(e),L.bindEvents(e.table,e.$headers,!0),L.resortComplete(e,t)},updateCell:function(e,t,r,o){if(A(t).closest("tr").hasClass(e.cssChildRow))console.warn('Tablesorter Warning! "updateCell" for child row content has been disabled, use "update" instead');else{if(L.isEmptyObject(e.cache))return L.updateHeader(e),void L.commonUpdate(e,r,o);e.table.isUpdating=!0,e.$table.find(e.selectorRemove).remove();var s,a,n,i,d,l,c=e.$tbodies,g=A(t),p=c.index(L.getClosest(g,"tbody")),u=e.cache[p],f=L.getClosest(g,"tr");if(t=g[0],c.length&&0<=p){if(n=c.eq(p).find("tr").not("."+e.cssChildRow).index(f),d=u.normalized[n],(l=f[0].cells.length)!==e.columns)for(s=!1,a=i=0;a<l;a++)s||f[0].cells[a]===t?s=!0:i+=f[0].cells[a].colSpan;else i=g.index();s=L.getElementText(e,t,i),d[e.columns].raw[i]=s,s=L.getParsedText(e,t,i,s),d[i]=s,"numeric"===(e.parsers[i].type||"").toLowerCase()&&(u.colMax[i]=Math.max(Math.abs(s)||0,u.colMax[i]||0)),!1!==(s="undefined"!==r?r:e.resort)?L.checkResort(e,s,o):L.resortComplete(e,o)}else L.debug(e,"core")&&console.error("updateCell aborted, tbody missing or not within the indicated table"),e.table.isUpdating=!1}},addRows:function(e,t,r,o){var s,a,n,i,d,l,c,g,p,u,f,h,m,b="string"==typeof t&&1===e.$tbodies.length&&/<tr/.test(t||""),y=e.table;if(b)t=A(t),e.$tbodies.append(t);else if(!(t&&t instanceof A&&L.getClosest(t,"table")[0]===e.table))return L.debug(e,"core")&&console.error("addRows method requires (1) a jQuery selector reference to rows that have already been added to the table, or (2) row HTML string to be added to a table with only one tbody"),!1;if(y.isUpdating=!0,L.isEmptyObject(e.cache))L.updateHeader(e),L.commonUpdate(e,r,o);else{for(d=t.filter("tr").attr("role","row").length,n=e.$tbodies.index(t.parents("tbody").filter(":first")),e.parsers&&e.parsers.length||L.setupParsers(e),i=0;i<d;i++){for(p=0,c=t[i].cells.length,g=e.cache[n].normalized.length,f=[],u={child:[],raw:[],$row:t.eq(i),order:g},l=0;l<c;l++)h=t[i].cells[l],s=L.getElementText(e,h,p),u.raw[p]=s,a=L.getParsedText(e,h,p,s),f[p]=a,"numeric"===(e.parsers[p].type||"").toLowerCase()&&(e.cache[n].colMax[p]=Math.max(Math.abs(a)||0,e.cache[n].colMax[p]||0)),0<(m=h.colSpan-1)&&(p+=m),p++;f[e.columns]=u,e.cache[n].normalized[g]=f}L.checkResort(e,r,o)}},updateCache:function(e,t,r){e.parsers&&e.parsers.length||L.setupParsers(e,r),L.buildCache(e,t,r)},appendCache:function(e,t){var r,o,s,a,n,i,d,l=e.table,c=e.$tbodies,g=[],p=e.cache;if(L.isEmptyObject(p))return e.appender?e.appender(l,g):l.isUpdating?e.$table.triggerHandler("updateComplete",l):"";for(L.debug(e,"core")&&(d=new Date),i=0;i<c.length;i++)if((s=c.eq(i)).length){for(a=L.processTbody(l,s,!0),o=(r=p[i].normalized).length,n=0;n<o;n++)g[g.length]=r[n][e.columns].$row,e.appender&&(!e.pager||e.pager.removeRows||e.pager.ajax)||a.append(r[n][e.columns].$row);L.processTbody(l,a,!1)}e.appender&&e.appender(l,g),L.debug(e,"core")&&console.log("Rebuilt table"+L.benchmark(d)),t||e.appender||L.applyWidget(l),l.isUpdating&&e.$table.triggerHandler("updateComplete",l)},commonUpdate:function(e,t,r){e.$table.find(e.selectorRemove).remove(),L.setupParsers(e),L.buildCache(e),L.checkResort(e,t,r)},initSort:function(t,e,r){if(t.table.isUpdating)return setTimeout(function(){L.initSort(t,e,r)},50);var o,s,a,n,i,d,l,c=!r[t.sortMultiSortKey],g=t.table,p=t.$headers.length,u=L.getClosest(A(e),"th, td"),f=parseInt(u.attr("data-column"),10),h="mouseup"===r.type?"user":r.type,m=t.sortVars[f].order;if(u=u[0],t.$table.triggerHandler("sortStart",g),d=(t.sortVars[f].count+1)%m.length,t.sortVars[f].count=r[t.sortResetKey]?2:d,t.sortRestart)for(a=0;a<p;a++)l=t.$headers.eq(a),f!==(d=parseInt(l.attr("data-column"),10))&&(c||l.hasClass(L.css.sortNone))&&(t.sortVars[d].count=-1);if(c){if(A.each(t.sortVars,function(e){t.sortVars[e].sortedBy=""}),t.sortList=[],t.last.sortList=[],null!==t.sortForce)for(o=t.sortForce,s=0;s<o.length;s++)o[s][0]!==f&&(t.sortList[t.sortList.length]=o[s],t.sortVars[o[s][0]].sortedBy="sortForce");if((n=m[t.sortVars[f].count])<2&&(t.sortList[t.sortList.length]=[f,n],t.sortVars[f].sortedBy=h,1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h}else if(t.sortList=A.extend([],t.last.sortList),0<=L.isValueInArray(f,t.sortList))for(t.sortVars[f].sortedBy=h,s=0;s<t.sortList.length;s++)(d=t.sortList[s])[0]===f&&(d[1]=m[t.sortVars[f].count],2===d[1]&&(t.sortList.splice(s,1),t.sortVars[f].count=-1));else if(n=m[t.sortVars[f].count],t.sortVars[f].sortedBy=h,n<2&&(t.sortList[t.sortList.length]=[f,n],1<u.colSpan))for(s=1;s<u.colSpan;s++)t.sortList[t.sortList.length]=[f+s,n],t.sortVars[f+s].count=A.inArray(n,m),t.sortVars[f+s].sortedBy=h;if(t.last.sortList=A.extend([],t.sortList),t.sortList.length&&t.sortAppend&&(o=A.isArray(t.sortAppend)?t.sortAppend:t.sortAppend[t.sortList[0][0]],!L.isEmptyObject(o)))for(s=0;s<o.length;s++)if(o[s][0]!==f&&L.isValueInArray(o[s][0],t.sortList)<0){if(i=(""+(n=o[s][1])).match(/^(a|d|s|o|n)/))switch(d=t.sortList[0][1],i[0]){case"d":n=1;break;case"s":n=d;break;case"o":n=0===d?1:0;break;case"n":n=(d+1)%m.length;break;default:n=0}t.sortList[t.sortList.length]=[o[s][0],n],t.sortVars[o[s][0]].sortedBy="sortAppend"}t.$table.triggerHandler("sortBegin",g),setTimeout(function(){L.setHeadersCss(t),L.multisort(t),L.appendCache(t),t.$table.triggerHandler("sortBeforeEnd",g),t.$table.triggerHandler("sortEnd",g)},1)},multisort:function(l){var e,t,c,r,g=l.table,p=[],u=0,f=l.textSorter||"",h=l.sortList,m=h.length,o=l.$tbodies.length;if(!l.serverSideSorting&&!L.isEmptyObject(l.cache)){if(L.debug(l,"core")&&(t=new Date),"object"==typeof f)for(c=l.columns;c--;)"function"==typeof(r=L.getColumnData(g,f,c))&&(p[c]=r);for(e=0;e<o;e++)c=l.cache[e].colMax,l.cache[e].normalized.sort(function(e,t){var r,o,s,a,n,i,d;for(r=0;r<m;r++){if(s=h[r][0],a=h[r][1],u=0===a,l.sortStable&&e[s]===t[s]&&1===m)return e[l.columns].order-t[l.columns].order;if(n=(o=/n/i.test(L.getSortType(l.parsers,s)))&&l.strings[s]?(o="boolean"==typeof L.string[l.strings[s]]?(u?1:-1)*(L.string[l.strings[s]]?-1:1):l.strings[s]&&L.string[l.strings[s]]||0,l.numberSorter?l.numberSorter(e[s],t[s],u,c[s],g):L["sortNumeric"+(u?"Asc":"Desc")](e[s],t[s],o,c[s],s,l)):(i=u?e:t,d=u?t:e,"function"==typeof f?f(i[s],d[s],u,s,g):"function"==typeof p[s]?p[s](i[s],d[s],u,s,g):L["sortNatural"+(u?"Asc":"Desc")](e[s]||"",t[s]||"",s,l)))return n}return e[l.columns].order-t[l.columns].order});L.debug(l,"core")&&console.log("Applying sort "+h.toString()+L.benchmark(t))}},resortComplete:function(e,t){e.table.isUpdating&&e.$table.triggerHandler("updateComplete",e.table),A.isFunction(t)&&t(e.table)},checkResort:function(e,t,r){var o=A.isArray(t)?t:e.sortList;!1===(void 0===t?e.resort:t)||e.serverSideSorting||e.table.isProcessing?(L.resortComplete(e,r),L.applyWidget(e.table,!1)):o.length?L.sortOn(e,o,function(){L.resortComplete(e,r)},!0):L.sortReset(e,function(){L.resortComplete(e,r),L.applyWidget(e.table,!1)})},sortOn:function(e,t,r,o){var s,a=e.table;for(e.$table.triggerHandler("sortStart",a),s=0;s<e.columns;s++)e.sortVars[s].sortedBy=-1<L.isValueInArray(s,t)?"sorton":"";L.updateHeaderSortCount(e,t),L.setHeadersCss(e),e.delayInit&&L.isEmptyObject(e.cache)&&L.buildCache(e),e.$table.triggerHandler("sortBegin",a),L.multisort(e),L.appendCache(e,o),e.$table.triggerHandler("sortBeforeEnd",a),e.$table.triggerHandler("sortEnd",a),L.applyWidget(a),A.isFunction(r)&&r(a)},sortReset:function(e,t){var r;for(e.sortList=[],r=0;r<e.columns;r++)e.sortVars[r].count=-1,e.sortVars[r].sortedBy="";L.setHeadersCss(e),L.multisort(e),L.appendCache(e),A.isFunction(t)&&t(e.table)},getSortType:function(e,t){return e&&e[t]&&e[t].type||""},getOrder:function(e){return/^d/i.test(e)||1===e},sortNatural:function(e,t){if(e===t)return 0;e=(e||"").toString(),t=(t||"").toString();var r,o,s,a,n,i,d=L.regex;if(d.hex.test(t)){if((r=parseInt(e.match(d.hex),16))<(o=parseInt(t.match(d.hex),16)))return-1;if(o<r)return 1}for(r=e.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),o=t.replace(d.chunk,"\\0$1\\0").replace(d.chunks,"").split("\\0"),i=Math.max(r.length,o.length),n=0;n<i;n++){if(s=isNaN(r[n])?r[n]||0:parseFloat(r[n])||0,a=isNaN(o[n])?o[n]||0:parseFloat(o[n])||0,isNaN(s)!==isNaN(a))return isNaN(s)?1:-1;if(typeof s!=typeof a&&(s+="",a+=""),s<a)return-1;if(a<s)return 1}return 0},sortNaturalAsc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:-s||-1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:s||1:L.sortNatural(e,t)},sortNaturalDesc:function(e,t,r,o){if(e===t)return 0;var s=L.string[o.empties[r]||o.emptyTo];return""===e&&0!==s?"boolean"==typeof s?s?-1:1:s||1:""===t&&0!==s?"boolean"==typeof s?s?1:-1:-s||-1:L.sortNatural(t,e)},sortText:function(e,t){return t<e?1:e<t?-1:0},getTextValue:function(e,t,r){if(r){var o,s=e?e.length:0,a=r+t;for(o=0;o<s;o++)a+=e.charCodeAt(o);return t*a}return 0},sortNumericAsc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:-n||-1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:n||1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),e-t)},sortNumericDesc:function(e,t,r,o,s,a){if(e===t)return 0;var n=L.string[a.empties[s]||a.emptyTo];return""===e&&0!==n?"boolean"==typeof n?n?-1:1:n||1:""===t&&0!==n?"boolean"==typeof n?n?1:-1:-n||-1:(isNaN(e)&&(e=L.getTextValue(e,r,o)),isNaN(t)&&(t=L.getTextValue(t,r,o)),t-e)},sortNumeric:function(e,t){return e-t},addWidget:function(e){e.id&&!L.isEmptyObject(L.getWidgetById(e.id))&&console.warn('"'+e.id+'" widget was loaded more than once!'),L.widgets[L.widgets.length]=e},hasWidget:function(e,t){return(e=A(e)).length&&e[0].config&&e[0].config.widgetInit[t]||!1},getWidgetById:function(e){var t,r,o=L.widgets.length;for(t=0;t<o;t++)if((r=L.widgets[t])&&r.id&&r.id.toLowerCase()===e.toLowerCase())return r},applyWidgetOptions:function(e){var t,r,o,s=e.config,a=s.widgets.length;if(a)for(t=0;t<a;t++)(r=L.getWidgetById(s.widgets[t]))&&r.options&&(o=A.extend(!0,{},r.options),s.widgetOptions=A.extend(!0,o,s.widgetOptions),A.extend(!0,L.defaults.widgetOptions,r.options))},addWidgetFromClass:function(e){var t,r,o=e.config,s="^"+o.widgetClass.replace(L.regex.templateName,"(\\S+)+")+"$",a=new RegExp(s,"g"),n=(e.className||"").split(L.regex.spaces);if(n.length)for(t=n.length,r=0;r<t;r++)n[r].match(a)&&(o.widgets[o.widgets.length]=n[r].replace(a,"$1"))},applyWidgetId:function(e,t,r){var o,s,a,n=(e=A(e)[0]).config,i=n.widgetOptions,d=L.debug(n,"core"),l=L.getWidgetById(t);l&&(a=l.id,o=!1,A.inArray(a,n.widgets)<0&&(n.widgets[n.widgets.length]=a),d&&(s=new Date),!r&&n.widgetInit[a]||(n.widgetInit[a]=!0,e.hasInitialized&&L.applyWidgetOptions(e),"function"==typeof l.init&&(o=!0,d&&console[console.group?"group":"log"]("Initializing "+a+" widget"),l.init(e,l,n,i))),r||"function"!=typeof l.format||(o=!0,d&&console[console.group?"group":"log"]("Updating "+a+" widget"),l.format(e,n,i,!1)),d&&o&&(console.log("Completed "+(r?"initializing ":"applying ")+a+" widget"+L.benchmark(s)),console.groupEnd&&console.groupEnd()))},applyWidget:function(e,t,r){var o,s,a,n,i,d=(e=A(e)[0]).config,l=L.debug(d,"core"),c=[];if(!1===t||!e.hasInitialized||!e.isApplyingWidgets&&!e.isUpdating){if(l&&(i=new Date),L.addWidgetFromClass(e),clearTimeout(d.timerReady),d.widgets.length){for(e.isApplyingWidgets=!0,d.widgets=A.grep(d.widgets,function(e,t){return A.inArray(e,d.widgets)===t}),s=(a=d.widgets||[]).length,o=0;o<s;o++)(n=L.getWidgetById(a[o]))&&n.id?(n.priority||(n.priority=10),c[o]=n):l&&console.warn('"'+a[o]+'" was enabled, but the widget code has not been loaded!');for(c.sort(function(e,t){return e.priority<t.priority?-1:e.priority===t.priority?0:1}),s=c.length,l&&console[console.group?"group":"log"]("Start "+(t?"initializing":"applying")+" widgets"),o=0;o<s;o++)(n=c[o])&&n.id&&L.applyWidgetId(e,n.id,t);l&&console.groupEnd&&console.groupEnd()}d.timerReady=setTimeout(function(){e.isApplyingWidgets=!1,A.data(e,"lastWidgetApplication",new Date),d.$table.triggerHandler("tablesorter-ready"),t||"function"!=typeof r||r(e),l&&(n=d.widgets.length,console.log("Completed "+(!0===t?"initializing ":"applying ")+n+" widget"+(1!==n?"s":"")+L.benchmark(i)))},10)}},removeWidget:function(e,t,r){var o,s,a,n,i=(e=A(e)[0]).config;if(!0===t)for(t=[],n=L.widgets.length,a=0;a<n;a++)(s=L.widgets[a])&&s.id&&(t[t.length]=s.id);else t=(A.isArray(t)?t.join(","):t||"").toLowerCase().split(/[\s,]+/);for(n=t.length,o=0;o<n;o++)s=L.getWidgetById(t[o]),0<=(a=A.inArray(t[o],i.widgets))&&!0!==r&&i.widgets.splice(a,1),s&&s.remove&&(L.debug(i,"core")&&console.log((r?"Refreshing":"Removing")+' "'+t[o]+'" widget'),s.remove(e,i,i.widgetOptions,r),i.widgetInit[t[o]]=!1);i.$table.triggerHandler("widgetRemoveEnd",e)},refreshWidgets:function(e,t,r){function o(e){A(e).triggerHandler("refreshComplete")}var s,a,n=(e=A(e)[0]).config.widgets,i=L.widgets,d=i.length,l=[];for(s=0;s<d;s++)(a=i[s])&&a.id&&(t||A.inArray(a.id,n)<0)&&(l[l.length]=a.id);L.removeWidget(e,l.join(","),!0),!0!==r?(L.applyWidget(e,t||!1,o),t&&L.applyWidget(e,!1,o)):o(e)},benchmark:function(e){return" ("+((new Date).getTime()-e.getTime())+" ms)"},log:function(){console.log(arguments)},debug:function(e,t){return e&&(!0===e.debug||"string"==typeof e.debug&&-1<e.debug.indexOf(t))},isEmptyObject:function(e){for(var t in e)return!1;return!0},isValueInArray:function(e,t){var r,o=t&&t.length||0;for(r=0;r<o;r++)if(t[r][0]===e)return r;return-1},formatFloat:function(e,t){return"string"!=typeof e||""===e?e:(e=(t&&t.config?!1!==t.config.usNumberFormat:void 0===t||t)?e.replace(L.regex.comma,""):e.replace(L.regex.digitNonUS,"").replace(L.regex.comma,"."),L.regex.digitNegativeTest.test(e)&&(e=e.replace(L.regex.digitNegativeReplace,"-$1")),r=parseFloat(e),isNaN(r)?A.trim(e):r);var r},isDigit:function(e){return isNaN(e)?L.regex.digitTest.test(e.toString().replace(L.regex.digitReplace,"")):""!==e},computeColumnIndex:function(e,t){var r,o,s,a,n,i,d,l,c,g,p=t&&t.columns||0,u=[],f=new Array(p);for(r=0;r<e.length;r++)for(i=e[r].cells,o=0;o<i.length;o++){for(d=r,l=(n=i[o]).rowSpan||1,c=n.colSpan||1,void 0===u[d]&&(u[d]=[]),s=0;s<u[d].length+1;s++)if(void 0===u[d][s]){g=s;break}for(p&&n.cellIndex===g||(n.setAttribute?n.setAttribute("data-column",g):A(n).attr("data-column",g)),s=d;s<d+l;s++)for(void 0===u[s]&&(u[s]=[]),f=u[s],a=g;a<g+c;a++)f[a]="x"}return L.checkColumnCount(e,u,f.length),f.length},checkColumnCount:function(e,t,r){var o,s,a=!0,n=[];for(o=0;o<t.length;o++)if(t[o]&&(s=t[o].length,t[o].length!==r)){a=!1;break}a||(e.each(function(e,t){var r=t.parentElement.nodeName;n.indexOf(r)<0&&n.push(r)}),console.error("Invalid or incorrect number of columns in the "+n.join(" or ")+"; expected "+r+", but found "+s+" columns"))},fixColumnWidth:function(e){var t,r,o,s,a,n=(e=A(e)[0]).config,i=n.$table.children("colgroup");if(i.length&&i.hasClass(L.css.colgroup)&&i.remove(),n.widthFixed&&0===n.$table.children("colgroup").length){for(i=A('<colgroup class="'+L.css.colgroup+'">'),t=n.$table.width(),s=(o=n.$tbodies.find("tr:first").children(":visible")).length,a=0;a<s;a++)r=parseInt(o.eq(a).width()/t*1e3,10)/10+"%",i.append(A("<col>").css("width",r));n.$table.prepend(i)}},getData:function(e,t,r){var o,s,a="",n=A(e);return n.length?(o=!!A.metadata&&n.metadata(),s=" "+(n.attr("class")||""),void 0!==n.data(r)||void 0!==n.data(r.toLowerCase())?a+=n.data(r)||n.data(r.toLowerCase()):o&&void 0!==o[r]?a+=o[r]:t&&void 0!==t[r]?a+=t[r]:" "!==s&&s.match(" "+r+"-")&&(a=s.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""),A.trim(a)):""},getColumnData:function(e,t,r,o,s){if("object"!=typeof t||null===t)return t;var a,n=(e=A(e)[0]).config,i=s||n.$headers,d=n.$headerIndexed&&n.$headerIndexed[r]||i.find('[data-column="'+r+'"]:last');if(void 0!==t[r])return o?t[r]:t[i.index(d)];for(a in t)if("string"==typeof a&&d.filter(a).add(d.find(a)).length)return t[a]},isProcessing:function(e,t,r){var o=(e=A(e))[0].config,s=r||e.find("."+L.css.header);t?(void 0!==r&&0<o.sortList.length&&(s=s.filter(function(){return!this.sortDisabled&&0<=L.isValueInArray(parseFloat(A(this).attr("data-column")),o.sortList)})),e.add(s).addClass(L.css.processing+" "+o.cssProcessing)):e.add(s).removeClass(L.css.processing+" "+o.cssProcessing)},processTbody:function(e,t,r){if(e=A(e)[0],r)return e.isProcessing=!0,t.before('<colgroup class="tablesorter-savemyplace"/>'),A.fn.detach?t.detach():t.remove();var o=A(e).find("colgroup.tablesorter-savemyplace");t.insertAfter(o),o.remove(),e.isProcessing=!1},clearTableBody:function(e){A(e)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var t,r="[",o=L.characterEquivalents;if(!L.characterRegex){for(t in L.characterRegexArray={},o)"string"==typeof t&&(r+=o[t],L.characterRegexArray[t]=new RegExp("["+o[t]+"]","g"));L.characterRegex=new RegExp(r+"]")}if(L.characterRegex.test(e))for(t in o)"string"==typeof t&&(e=e.replace(L.characterRegexArray[t],t));return e},validateOptions:function(e){var t,r,o,s,a="headers sortForce sortList sortAppend widgets".split(" "),n=e.originalSettings;if(n){for(t in L.debug(e,"core")&&(s=new Date),n)if("undefined"===(o=typeof L.defaults[t]))console.warn('Tablesorter Warning! "table.config.'+t+'" option not recognized');else if("object"===o)for(r in n[t])o=L.defaults[t]&&typeof L.defaults[t][r],A.inArray(t,a)<0&&"undefined"===o&&console.warn('Tablesorter Warning! "table.config.'+t+"."+r+'" option not recognized');L.debug(e,"core")&&console.log("validate options time:"+L.benchmark(s))}},restoreHeaders:function(e){var t,r,o=A(e)[0].config,s=o.$table.find(o.selectorHeaders),a=s.length;for(t=0;t<a;t++)(r=s.eq(t)).find("."+L.css.headerIn).length&&r.html(o.headerContent[t])},destroy:function(e,t,r){if((e=A(e)[0]).hasInitialized){L.removeWidget(e,!0,!1);var o,s=A(e),a=e.config,n=s.find("thead:first"),i=n.find("tr."+L.css.headerRow).removeClass(L.css.headerRow+" "+a.cssHeaderRow),d=s.find("tfoot:first > tr").children("th, td");!1===t&&0<=A.inArray("uitheme",a.widgets)&&(s.triggerHandler("applyWidgetId",["uitheme"]),s.triggerHandler("applyWidgetId",["zebra"])),n.find("tr").not(i).remove(),o="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(a.namespace+" "),s.removeData("tablesorter").unbind(o.replace(L.regex.spaces," ")),a.$headers.add(d).removeClass([L.css.header,a.cssHeader,a.cssAsc,a.cssDesc,L.css.sortAsc,L.css.sortDesc,L.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(a.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(a.namespace+" ").replace(L.regex.spaces," ")),L.restoreHeaders(e),s.toggleClass(L.css.table+" "+a.tableClass+" tablesorter-"+a.theme,!1===t),s.removeClass(a.namespace.slice(1)),e.hasInitialized=!1,delete e.config.cache,"function"==typeof r&&r(e),L.debug(a,"core")&&console.log("tablesorter has been removed")}}};A.fn.tablesorter=function(t){return this.each(function(){var e=A.extend(!0,{},L.defaults,t,L.instanceMethods);e.originalSettings=t,!this.hasInitialized&&L.buildTable&&"TABLE"!==this.nodeName?L.buildTable(this,e):L.setup(this,e)})},window.console&&window.console.log||(L.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=1<arguments.length?arguments:arguments[0];L.logs[L.logs.length]={date:Date.now(),log:e}}),L.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),L.addParser({id:"text",is:function(){return!0},format:function(e,t){var r=t.config;return e&&(e=A.trim(r.ignoreCase?e.toLocaleLowerCase():e),e=r.sortLocaleCompare?L.replaceAccents(e):e),e},type:"text"}),L.regex.nondigit=/[^\w,. \-()]/g,L.addParser({id:"digit",is:function(e){return L.isDigit(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.currencyReplace=/[+\-,. ]/g,L.regex.currencyTest=/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/,L.addParser({id:"currency",is:function(e){return e=(e||"").replace(L.regex.currencyReplace,""),L.regex.currencyTest.test(e)},format:function(e,t){var r=L.formatFloat((e||"").replace(L.regex.nondigit,""),t);return e&&"number"==typeof r?r:e?A.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},type:"numeric"}),L.regex.urlProtocolTest=/^(https?|ftp|file):\/\//,L.regex.urlProtocolReplace=/(https?|ftp|file):\/\/(www\.)?/,L.addParser({id:"url",is:function(e){return L.regex.urlProtocolTest.test(e)},format:function(e){return e?A.trim(e.replace(L.regex.urlProtocolReplace,"")):e},type:"text"}),L.regex.dash=/-/g,L.regex.isoDate=/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/,L.addParser({id:"isoDate",is:function(e){return L.regex.isoDate.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dash,"/")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.percent=/%/g,L.regex.percentTest=/(\d\s*?%|%\s*?\d)/,L.addParser({id:"percent",is:function(e){return L.regex.percentTest.test(e)&&e.length<15},format:function(e,t){return e?L.formatFloat(e.replace(L.regex.percent,""),t):e},type:"numeric"}),L.addParser({id:"image",is:function(e,t,r,o){return 0<o.find("img").length},format:function(e,t,r){return A(r).find("img").attr(t.config.imgAttr||"alt")||e},parsed:!0,type:"text"}),L.regex.dateReplace=/(\S)([AP]M)$/i,L.regex.usLongDateTest1=/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i,L.regex.usLongDateTest2=/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i,L.addParser({id:"usLongDate",is:function(e){return L.regex.usLongDateTest1.test(e)||L.regex.usLongDateTest2.test(e)},format:function(e){var t=e?new Date(e.replace(L.regex.dateReplace,"$1 $2")):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),L.regex.shortDateTest=/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/,L.regex.shortDateReplace=/[\-.,]/g,L.regex.shortDateXXY=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,L.regex.shortDateYMD=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,L.convertFormat=function(e,t){e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),"mmddyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$1/$2"):"ddmmyyyy"===t?e=e.replace(L.regex.shortDateXXY,"$3/$2/$1"):"yyyymmdd"===t&&(e=e.replace(L.regex.shortDateYMD,"$1/$2/$3"));var r=new Date(e);return r instanceof Date&&isFinite(r)?r.getTime():""},L.addParser({id:"shortDate",is:function(e){return e=(e||"").replace(L.regex.spaces," ").replace(L.regex.shortDateReplace,"/"),L.regex.shortDateTest.test(e)},format:function(e,t,r,o){if(e){var s=t.config,a=s.$headerIndexed[o],n=a.length&&a.data("dateFormat")||L.getData(a,L.getColumnData(t,s.headers,o),"dateFormat")||s.dateFormat;return a.length&&a.data("dateFormat",n),L.convertFormat(e,n)||e}return e},type:"numeric"}),L.regex.timeTest=/^(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)$|^((?:[01]\d|[2][0-4]):[0-5]\d)$/i,L.regex.timeMatch=/(0?[1-9]|1[0-2]):([0-5]\d)(\s[AP]M)|((?:[01]\d|[2][0-4]):[0-5]\d)/i,L.addParser({id:"time",is:function(e){return L.regex.timeTest.test(e)},format:function(e){var t=(e||"").match(L.regex.timeMatch),r=new Date(e),o=e&&(null!==t?t[0]:"00:00 AM"),s=o?new Date("2000/01/01 "+o.replace(L.regex.dateReplace,"$1 $2")):o;return s instanceof Date&&isFinite(s)?(r instanceof Date&&isFinite(r)?r.getTime():0)?parseFloat(s.getTime()+"."+r.getTime()):s.getTime():e},type:"numeric"}),L.addParser({id:"metadata",is:function(){return!1},format:function(e,t,r){var o=t.config,s=o.parserMetadataName?o.parserMetadataName:"sortValue";return A(r).metadata()[s]},type:"numeric"}),L.addWidget({id:"zebra",priority:90,format:function(e,t,r){var o,s,a,n,i,d,l,c=new RegExp(t.cssChildRow,"i"),g=t.$tbodies.add(A(t.namespace+"_extra_table").children("tbody:not(."+t.cssInfoBlock+")"));for(i=0;i<g.length;i++)for(a=0,l=(o=g.eq(i).children("tr:visible").not(t.selectorRemove)).length,d=0;d<l;d++)s=o.eq(d),c.test(s[0].className)||a++,n=a%2==0,s.removeClass(r.zebra[n?1:0]).addClass(r.zebra[n?0:1])},remove:function(e,t,r,o){if(!o){var s,a,n=t.$tbodies,i=(r.zebra||["even","odd"]).join(" ");for(s=0;s<n.length;s++)(a=L.processTbody(e,n.eq(s),!0)).children().removeClass(i),L.processTbody(e,a,!1)}}})}(e),e.tablesorter}); \ No newline at end of file
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.widgets.js b/web/_static/tablesorter/js/jquery.tablesorter.widgets.js
new file mode 100644
index 0000000..f5401b5
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.widgets.js
@@ -0,0 +1,3178 @@
+/*! tablesorter (FORK) - updated 2020-03-03 (v2.31.3)*/
+/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery) {
+/*! Widget: storage - updated 2018-03-18 (v2.30.0) */
+/*global JSON:false */
+;(function ($, window, document) {
+ 'use strict';
+
+ var ts = $.tablesorter || {};
+
+ // update defaults for validator; these values must be falsy!
+ $.extend(true, ts.defaults, {
+ fixedUrl: '',
+ widgetOptions: {
+ storage_fixedUrl: '',
+ storage_group: '',
+ storage_page: '',
+ storage_storageType: '',
+ storage_tableId: '',
+ storage_useSessionStorage: ''
+ }
+ });
+
+ // *** Store data in local storage, with a cookie fallback ***
+ /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
+ if you need it, then include https://github.com/douglascrockford/JSON-js
+
+ $.parseJSON is not available is jQuery versions older than 1.4.1, using older
+ versions will only allow storing information for one page at a time
+
+ // *** Save data (JSON format only) ***
+ // val must be valid JSON... use http://jsonlint.com/ to ensure it is valid
+ var val = { "mywidget" : "data1" }; // valid JSON uses double quotes
+ // $.tablesorter.storage(table, key, val);
+ $.tablesorter.storage(table, 'tablesorter-mywidget', val);
+
+ // *** Get data: $.tablesorter.storage(table, key); ***
+ v = $.tablesorter.storage(table, 'tablesorter-mywidget');
+ // val may be empty, so also check for your data
+ val = (v && v.hasOwnProperty('mywidget')) ? v.mywidget : '';
+ alert(val); // 'data1' if saved, or '' if not
+ */
+ ts.storage = function(table, key, value, options) {
+ table = $(table)[0];
+ var cookieIndex, cookies, date,
+ hasStorage = false,
+ values = {},
+ c = table.config,
+ wo = c && c.widgetOptions,
+ debug = ts.debug(c, 'storage'),
+ storageType = (
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
+ ).toString().charAt(0).toLowerCase(),
+ // deprecating "useSessionStorage"; any storageType setting overrides it
+ session = storageType ? '' :
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
+ $table = $(table),
+ // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
+ // (4) table ID, then (5) table index
+ id = options && options.id ||
+ $table.attr( options && options.group || wo && wo.storage_group || 'data-table-group') ||
+ wo && wo.storage_tableId || table.id || $('.tablesorter').index( $table ),
+ // url from (1) options url, (2) table 'data-table-page' attribute, (3) widgetOptions.storage_fixedUrl,
+ // (4) table.config.fixedUrl (deprecated), then (5) window location path
+ url = options && options.url ||
+ $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
+ wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
+
+ // skip if using cookies
+ if (storageType !== 'c') {
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
+ // https://gist.github.com/paulirish/5558557
+ if (storageType in window) {
+ try {
+ window[storageType].setItem('_tmptest', 'temp');
+ hasStorage = true;
+ window[storageType].removeItem('_tmptest');
+ } catch (error) {
+ console.warn( storageType + ' is not supported in this browser' );
+ }
+ }
+ }
+ if (debug) {
+ console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
+ }
+ // *** get value ***
+ if ($.parseJSON) {
+ if (hasStorage) {
+ values = $.parseJSON( window[storageType][key] || 'null' ) || {};
+ } else {
+ // old browser, using cookies
+ cookies = document.cookie.split(/[;\s|=]/);
+ // add one to get from the key to the value
+ cookieIndex = $.inArray(key, cookies) + 1;
+ values = (cookieIndex !== 0) ? $.parseJSON(cookies[cookieIndex] || 'null') || {} : {};
+ }
+ }
+ // allow value to be an empty string too
+ if (typeof value !== 'undefined' && window.JSON && JSON.hasOwnProperty('stringify')) {
+ // add unique identifiers = url pathname > table ID/index on page > data
+ if (!values[url]) {
+ values[url] = {};
+ }
+ values[url][id] = value;
+ // *** set value ***
+ if (hasStorage) {
+ window[storageType][key] = JSON.stringify(values);
+ } else {
+ date = new Date();
+ date.setTime(date.getTime() + (31536e+6)); // 365 days
+ document.cookie = key + '=' + (JSON.stringify(values)).replace(/\"/g, '\"') + '; expires=' + date.toGMTString() + '; path=/';
+ }
+ } else {
+ return values && values[url] ? values[url][id] : '';
+ }
+ };
+
+})(jQuery, window, document);
+
+/*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.themes = {
+ 'bootstrap' : {
+ table : 'table table-bordered table-striped',
+ caption : 'caption',
+ // header class names
+ header : 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css)
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : '', // applied when column is sorted
+ hover : '', // custom css required - a defined bootstrap style may not override other classes
+ // icon class names
+ icons : '', // add 'bootstrap-icon-white' to make them white; this icon class is added to the <i> in the header
+ iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted
+ iconSortAsc : 'glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort
+ iconSortDesc : 'glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort
+ filterRow : '', // filter row class
+ footerRow : '',
+ footerCells : '',
+ even : '', // even row zebra striping
+ odd : '' // odd row zebra striping
+ },
+ 'jui' : {
+ table : 'ui-widget ui-widget-content ui-corner-all', // table classes
+ caption : 'ui-widget-content',
+ // header class names
+ header : 'ui-widget-header ui-corner-all ui-state-default', // header classes
+ sortNone : '',
+ sortAsc : '',
+ sortDesc : '',
+ active : 'ui-state-active', // applied when column is sorted
+ hover : 'ui-state-hover', // hover class
+ // icon class names
+ icons : 'ui-icon', // icon class added to the <i> in the header
+ iconSortNone : 'ui-icon-carat-2-n-s ui-icon-caret-2-n-s', // class name added to icon when column is not sorted
+ iconSortAsc : 'ui-icon-carat-1-n ui-icon-caret-1-n', // class name added to icon when column has ascending sort
+ iconSortDesc : 'ui-icon-carat-1-s ui-icon-caret-1-s', // class name added to icon when column has descending sort
+ filterRow : '',
+ footerRow : '',
+ footerCells : '',
+ even : 'ui-widget-content', // even row zebra striping
+ odd : 'ui-state-default' // odd row zebra striping
+ }
+ };
+
+ $.extend(ts.css, {
+ wrapper : 'tablesorter-wrapper' // ui theme & resizable
+ });
+
+ ts.addWidget({
+ id: 'uitheme',
+ priority: 10,
+ format: function(table, c, wo) {
+ var i, tmp, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme,
+ themesAll = ts.themes,
+ $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( ' ' ) ),
+ iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
+ debug = ts.debug(c, 'uitheme');
+ if (debug) { time = new Date(); }
+ // initialization code - run once
+ if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
+ wo.uitheme_applied = true;
+ oldtheme = themesAll[c.appliedTheme] || {};
+ hasOldTheme = !$.isEmptyObject(oldtheme);
+ oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '';
+ oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : '';
+ if (hasOldTheme) {
+ wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') );
+ wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') );
+ c.$tbodies.children().removeClass( [ oldtheme.even, oldtheme.odd ].join(' ') );
+ }
+ // update zebra stripes
+ if (themes.even) { wo.zebra[0] += ' ' + themes.even; }
+ if (themes.odd) { wo.zebra[1] += ' ' + themes.odd; }
+ // add caption style
+ $table.children('caption')
+ .removeClass(oldtheme.caption || '')
+ .addClass(themes.caption);
+ // add table/footer class names
+ $tfoot = $table
+ // remove other selected themes
+ .removeClass( (c.appliedTheme ? 'tablesorter-' + (c.appliedTheme || '') : '') + ' ' + (oldtheme.table || '') )
+ .addClass('tablesorter-' + theme + ' ' + (themes.table || '')) // add theme widget class name
+ .children('tfoot');
+ c.appliedTheme = c.theme;
+
+ if ($tfoot.length) {
+ $tfoot
+ // if oldtheme.footerRow or oldtheme.footerCells are undefined, all class names are removed
+ .children('tr').removeClass(oldtheme.footerRow || '').addClass(themes.footerRow)
+ .children('th, td').removeClass(oldtheme.footerCells || '').addClass(themes.footerCells);
+ }
+ // update header classes
+ $headers
+ .removeClass( (hasOldTheme ? [ oldtheme.header, oldtheme.hover, oldremove ].join(' ') : '') || '' )
+ .addClass(themes.header)
+ .not('.sorter-false')
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme')
+ .bind('mouseenter.tsuitheme mouseleave.tsuitheme', function(event) {
+ // toggleClass with switch added in jQuery 1.3
+ $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
+ });
+
+ $headers.each(function() {
+ var $this = $(this);
+ if (!$this.find('.' + ts.css.wrapper).length) {
+ // Firefox needs this inner div to position the icon & resizer correctly
+ $this.wrapInner('<div class="' + ts.css.wrapper + '" style="position:relative;height:100%;width:100%"></div>');
+ }
+ });
+ if (c.cssIcon) {
+ // if c.cssIcon is '', then no <i> is added to the header
+ $headers
+ .find('.' + ts.css.icon)
+ .removeClass(hasOldTheme ? [ oldtheme.icons, oldIconRmv ].join(' ') : '')
+ .addClass(themes.icons || '');
+ }
+ // filter widget initializes after uitheme
+ if (ts.hasWidget( c.table, 'filter' )) {
+ tmp = function() {
+ $table.children('thead').children('.' + ts.css.filterRow)
+ .removeClass(hasOldTheme ? oldtheme.filterRow || '' : '')
+ .addClass(themes.filterRow || '');
+ };
+ if (wo.filter_initialized) {
+ tmp();
+ } else {
+ $table.one('filterInit', function() {
+ tmp();
+ });
+ }
+ }
+ }
+ for (i = 0; i < c.columns; 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) {
+ $header.removeClass(remove);
+ $icon.removeClass(iconRmv);
+ if ($h[0].sortDisabled) {
+ // no sort arrows for disabled columns!
+ $icon.removeClass(themes.icons || '');
+ } else {
+ hdr = themes.sortNone;
+ icon = themes.iconSortNone;
+ if ($h.hasClass(ts.css.sortAsc)) {
+ hdr = [ themes.sortAsc, themes.active ].join(' ');
+ icon = themes.iconSortAsc;
+ } else if ($h.hasClass(ts.css.sortDesc)) {
+ hdr = [ themes.sortDesc, themes.active ].join(' ');
+ icon = themes.iconSortDesc;
+ }
+ $header.addClass(hdr);
+ $icon.addClass(icon || '');
+ }
+ }
+ }
+ if (debug) {
+ console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
+ }
+ },
+ remove: function(table, c, wo, refreshing) {
+ if (!wo.uitheme_applied) { return; }
+ var $table = c.$table,
+ theme = c.appliedTheme || 'jui',
+ themes = ts.themes[ theme ] || ts.themes.jui,
+ $headers = $table.children('thead').children(),
+ remove = themes.sortNone + ' ' + themes.sortDesc + ' ' + themes.sortAsc,
+ iconRmv = themes.iconSortNone + ' ' + themes.iconSortDesc + ' ' + themes.iconSortAsc;
+ $table.removeClass('tablesorter-' + theme + ' ' + themes.table);
+ wo.uitheme_applied = false;
+ if (refreshing) { return; }
+ $table.find(ts.css.header).removeClass(themes.header);
+ $headers
+ .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover
+ .removeClass(themes.hover + ' ' + remove + ' ' + themes.active)
+ .filter('.' + ts.css.filterRow)
+ .removeClass(themes.filterRow);
+ $headers.find('.' + ts.css.icon).removeClass(themes.icons + ' ' + iconRmv);
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ ts.addWidget({
+ id: 'columns',
+ priority: 65,
+ options : {
+ columns : [ 'primary', 'secondary', 'tertiary' ]
+ },
+ format: function(table, c, wo) {
+ var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ sortList = c.sortList,
+ len = sortList.length,
+ // removed c.widgetColumns support
+ css = wo && wo.columns || [ 'primary', 'secondary', 'tertiary' ],
+ last = css.length - 1;
+ remove = css.join(' ');
+ // check if there is a sort (on initialization there may not be one)
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // detach tbody
+ $rows = $tbody.children('tr');
+ // loop through the visible rows
+ $rows.each(function() {
+ $row = $(this);
+ if (this.style.display !== 'none') {
+ // remove all columns class names
+ $cells = $row.children().removeClass(remove);
+ // add appropriate column class names
+ if (sortList && sortList[0]) {
+ // primary sort column class
+ $cells.eq(sortList[0][0]).addClass(css[0]);
+ if (len > 1) {
+ for (indx = 1; indx < len; indx++) {
+ // secondary, tertiary, etc sort column classes
+ $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] );
+ }
+ }
+ }
+ }
+ });
+ ts.processTbody(table, $tbody, false);
+ }
+ // add classes to thead and tfoot
+ rows = wo.columns_thead !== false ? [ 'thead tr' ] : [];
+ if (wo.columns_tfoot !== false) {
+ rows.push('tfoot tr');
+ }
+ if (rows.length) {
+ $rows = $table.find( rows.join(',') ).children().removeClass(remove);
+ if (len) {
+ for (indx = 0; indx < len; indx++) {
+ // add primary. secondary, tertiary, etc sort column classes
+ $rows.filter('[data-column="' + sortList[indx][0] + '"]').addClass(css[indx] || css[last]);
+ }
+ }
+ }
+ },
+ remove: function(table, c, wo) {
+ var tbodyIndex, $tbody,
+ $tbodies = c.$tbodies,
+ remove = (wo.columns || [ 'primary', 'secondary', 'tertiary' ]).join(' ');
+ c.$headers.removeClass(remove);
+ c.$table.children('tfoot').children('tr').children('th, td').removeClass(remove);
+ for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody
+ $tbody.children('tr').each(function() {
+ $(this).children().removeClass(remove);
+ });
+ ts.processTbody(table, $tbody, false); // restore tbody
+ }
+ }
+ });
+
+})(jQuery);
+
+/*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.7+
+ * by Rob Garrison
+ */
+;( function ( $ ) {
+ 'use strict';
+ var tsf, tsfRegex,
+ ts = $.tablesorter || {},
+ tscss = ts.css,
+ tskeyCodes = ts.keyCodes;
+
+ $.extend( tscss, {
+ filterRow : 'tablesorter-filter-row',
+ filter : 'tablesorter-filter',
+ filterDisabled : 'disabled',
+ filterRowHide : 'hideme'
+ });
+
+ $.extend( tskeyCodes, {
+ backSpace : 8,
+ escape : 27,
+ space : 32,
+ left : 37,
+ down : 40
+ });
+
+ ts.addWidget({
+ id: 'filter',
+ priority: 50,
+ options : {
+ filter_cellFilter : '', // css class name added to the filter cell ( string or array )
+ filter_childRows : false, // if true, filter includes child row content in the search
+ filter_childByColumn : false, // ( filter_childRows must be true ) if true = search child rows by column; false = search all child row text grouped
+ filter_childWithSibs : true, // if true, include matching child row siblings
+ filter_columnAnyMatch: true, // if true, allows using '#:{query}' in AnyMatch searches ( column:query )
+ filter_columnFilters : true, // if true, a filter will be added to the top of each table column
+ filter_cssFilter : '', // css class name added to the filter row & each input in the row ( tablesorter-filter is ALWAYS added )
+ filter_defaultAttrib : 'data-value', // data attribute in the header cell that contains the default filter value
+ filter_defaultFilter : {}, // add a default column filter type '~{query}' to make fuzzy searches default; '{q1} AND {q2}' to make all searches use a logical AND.
+ filter_excludeFilter : {}, // filters to exclude, per column
+ filter_external : '', // jQuery selector string ( or jQuery object ) of external filters
+ filter_filteredRow : 'filtered', // class added to filtered rows; define in css with "display:none" to hide the filtered-out rows
+ filter_filterLabel : 'Filter "{{label}}" column by...', // Aria-label added to filter input/select; see #1495
+ filter_formatter : null, // add custom filter elements to the filter row
+ filter_functions : null, // add custom filter functions using this option
+ filter_hideEmpty : true, // hide filter row when table is empty
+ filter_hideFilters : false, // collapse filter row when mouse leaves the area
+ filter_ignoreCase : true, // if true, make all searches case-insensitive
+ filter_liveSearch : true, // if true, search column content while the user types ( with a delay )
+ filter_matchType : { 'input': 'exact', 'select': 'exact' }, // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
+ filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available ( visible ) options within the drop down
+ filter_placeholder : { search : '', select : '' }, // default placeholder text ( overridden by any header 'data-placeholder' setting )
+ filter_reset : null, // jQuery selector string of an element used to reset the filters
+ filter_resetOnEsc : true, // Reset filter input when the user presses escape - normalized across browsers
+ filter_saveFilters : false, // Use the $.tablesorter.storage utility to save the most recent filters
+ filter_searchDelay : 300, // typing delay in milliseconds before starting a search
+ filter_searchFiltered: true, // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true
+ filter_selectSource : null, // include a function to return an array of values to be added to the column filter select
+ filter_selectSourceSeparator : '|', // filter_selectSource array text left of the separator is added to the option value, right into the option text
+ filter_serversideFiltering : false, // if true, must perform server-side filtering b/c client-side filtering is disabled, but the ui and events will still be used.
+ filter_startsWith : false, // if true, filter start from the beginning of the cell contents
+ filter_useParsedData : false // filter all data using parsed content
+ },
+ format: function( table, c, wo ) {
+ if ( !c.$table.hasClass( 'hasFilters' ) ) {
+ tsf.init( table, c, wo );
+ }
+ },
+ remove: function( table, c, wo, refreshing ) {
+ var tbodyIndex, $tbody,
+ $table = c.$table,
+ $tbodies = c.$tbodies,
+ events = (
+ 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
+ ).split( ' ' ).join( c.namespace + 'filter ' );
+ $table
+ .removeClass( 'hasFilters' )
+ // add filter namespace to all BUT search
+ .unbind( events.replace( ts.regex.spaces, ' ' ) )
+ // remove the filter row even if refreshing, because the column might have been moved
+ .find( '.' + tscss.filterRow ).remove();
+ wo.filter_initialized = false;
+ if ( refreshing ) { return; }
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
+ $tbody.children().removeClass( wo.filter_filteredRow ).show();
+ ts.processTbody( table, $tbody, false ); // restore tbody
+ }
+ if ( wo.filter_reset ) {
+ $( document ).undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' );
+ }
+ }
+ });
+
+ tsf = ts.filter = {
+
+ // regex used in filter 'check' functions - not for general use and not documented
+ regex: {
+ regex : /^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/, // regex to test for regex
+ child : /tablesorter-childRow/, // child row class name; this gets updated in the script
+ filtered : /filtered/, // filtered (hidden) row class name; updated in the script
+ type : /undefined|number/, // check type
+ exact : /(^[\"\'=]+)|([\"\'=]+$)/g, // exact match (allow '==')
+ operators : /[<>=]/g, // replace operators
+ query : '(q|query)', // replace filter queries
+ wild01 : /\?/g, // wild card match 0 or 1
+ wild0More : /\*/g, // wild care match 0 or more
+ quote : /\"/g,
+ isNeg1 : /(>=?\s*-\d)/,
+ isNeg2 : /(<=?\s*\d)/
+ },
+ // function( c, data ) { }
+ // c = table.config
+ // data.$row = jQuery object of the row currently being processed
+ // data.$cells = jQuery object of all cells within the current row
+ // data.filters = array of filters for all columns ( some may be undefined )
+ // data.filter = filter for the current column
+ // data.iFilter = same as data.filter, except lowercase ( if wo.filter_ignoreCase is true )
+ // data.exact = table cell text ( or parsed data if column parser enabled; may be a number & not a string )
+ // data.iExact = same as data.exact, except lowercase ( if wo.filter_ignoreCase is true; may be a number & not a string )
+ // data.cache = table cell text from cache, so it has been parsed ( & in all lower case if c.ignoreCase is true )
+ // data.cacheArray = An array of parsed content from each table cell in the row being processed
+ // data.index = column index; table = table element ( DOM )
+ // data.parsed = array ( by column ) of boolean values ( from filter_useParsedData or 'filter-parsed' class )
+ types: {
+ or : function( c, data, vars ) {
+ // look for "|", but not if it is inside of a regular expression
+ if ( ( tsfRegex.orTest.test( data.iFilter ) || tsfRegex.orSplit.test( data.filter ) ) &&
+ // this test for regex has potential to slow down the overall search
+ !tsfRegex.regex.test( data.filter ) ) {
+ var indx, filterMatched, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.orSplit ),
+ iFilter = data.iFilter.split( tsfRegex.orSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')';
+ try {
+ // use try/catch, because query may not be a valid regex if "|" is contained within a partial regex search,
+ // e.g "/(Alex|Aar" -> Uncaught SyntaxError: Invalid regular expression: /(/(Alex)/: Unterminated group
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // filterMatched = data2.filter === '' && indx > 0 ? true
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ filterMatched = regex.test( data2.exact ) || tsf.processTypes( c, data2, vars );
+ if ( filterMatched ) {
+ return filterMatched;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for an AND or && operator ( logical and )
+ and : function( c, data, vars ) {
+ if ( tsfRegex.andTest.test( data.filter ) ) {
+ var indx, filterMatched, result, query, regex,
+ // duplicate data but split filter
+ data2 = $.extend( {}, data ),
+ filter = data.filter.split( tsfRegex.andSplit ),
+ iFilter = data.iFilter.split( tsfRegex.andSplit ),
+ len = filter.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ data2.nestedFilters = true;
+ data2.filter = '' + ( tsf.parseFilter( c, filter[ indx ], data ) || '' );
+ data2.iFilter = '' + ( tsf.parseFilter( c, iFilter[ indx ], data ) || '' );
+ query = ( '(' + ( tsf.parseFilter( c, data2.filter, data ) || '' ) + ')' )
+ // replace wild cards since /(a*)/i will match anything
+ .replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' );
+ try {
+ // use try/catch just in case RegExp is invalid
+ regex = new RegExp( data.isMatch ? query : '^' + query + '$', c.widgetOptions.filter_ignoreCase ? 'i' : '' );
+ // look for an exact match with the 'and' unless the 'filter-match' class is found
+ result = ( regex.test( data2.exact ) || tsf.processTypes( c, data2, vars ) );
+ if ( indx === 0 ) {
+ filterMatched = result;
+ } else {
+ filterMatched = filterMatched && result;
+ }
+ } catch ( error ) {
+ return null;
+ }
+ }
+ // may be null from processing types
+ return filterMatched || false;
+ }
+ return null;
+ },
+ // Look for regex
+ regex: function( c, data ) {
+ if ( tsfRegex.regex.test( data.filter ) ) {
+ var matches,
+ // cache regex per column for optimal speed
+ regex = data.filter_regexCache[ data.index ] || tsfRegex.regex.exec( data.filter ),
+ isRegex = regex instanceof RegExp;
+ try {
+ if ( !isRegex ) {
+ // force case insensitive search if ignoreCase option set?
+ // if ( c.ignoreCase && !regex[2] ) { regex[2] = 'i'; }
+ data.filter_regexCache[ data.index ] = regex = new RegExp( regex[1], regex[2] );
+ }
+ matches = regex.test( data.exact );
+ } catch ( error ) {
+ matches = false;
+ }
+ return matches;
+ }
+ return null;
+ },
+ // Look for operators >, >=, < or <=
+ operators: function( c, data ) {
+ // ignore empty strings... because '' < 10 is true
+ if ( tsfRegex.operTest.test( data.iFilter ) && data.iExact !== '' ) {
+ var cachedValue, result, txt,
+ table = c.table,
+ parsed = data.parsed[ data.index ],
+ query = ts.formatFloat( data.iFilter.replace( tsfRegex.operators, '' ), table ),
+ parser = c.parsers[ data.index ] || {},
+ savedSearch = query;
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || parser.type === 'numeric' ) {
+ txt = $.trim( '' + data.iFilter.replace( tsfRegex.operators, '' ) );
+ result = tsf.parseFilter( c, txt, data, true );
+ query = ( typeof result === 'number' && result !== '' && !isNaN( result ) ) ? result : query;
+ }
+ // iExact may be numeric - see issue #149;
+ // check if cached is defined, because sometimes j goes out of range? ( numeric columns )
+ if ( ( parsed || parser.type === 'numeric' ) && !isNaN( query ) &&
+ typeof data.cache !== 'undefined' ) {
+ cachedValue = data.cache;
+ } else {
+ txt = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ cachedValue = ts.formatFloat( txt, table );
+ }
+ if ( tsfRegex.gtTest.test( data.iFilter ) ) {
+ result = tsfRegex.gteTest.test( data.iFilter ) ? cachedValue >= query : cachedValue > query;
+ } else if ( tsfRegex.ltTest.test( data.iFilter ) ) {
+ result = tsfRegex.lteTest.test( data.iFilter ) ? cachedValue <= query : cachedValue < query;
+ }
+ // keep showing all rows if nothing follows the operator
+ if ( !result && savedSearch === '' ) {
+ result = true;
+ }
+ return result;
+ }
+ return null;
+ },
+ // Look for a not match
+ notMatch: function( c, data ) {
+ if ( tsfRegex.notTest.test( data.iFilter ) ) {
+ var indx,
+ txt = data.iFilter.replace( '!', '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ if ( tsfRegex.exact.test( filter ) ) {
+ // look for exact not matches - see #628
+ filter = filter.replace( tsfRegex.exact, '' );
+ return filter === '' ? true : $.trim( filter ) !== data.iExact;
+ } else {
+ indx = data.iExact.search( $.trim( filter ) );
+ return filter === '' ? true :
+ // return true if not found
+ data.anyMatch ? indx < 0 :
+ // return false if found
+ !( c.widgetOptions.filter_startsWith ? indx === 0 : indx >= 0 );
+ }
+ }
+ return null;
+ },
+ // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric
+ exact: function( c, data ) {
+ /*jshint eqeqeq:false */
+ if ( tsfRegex.exact.test( data.iFilter ) ) {
+ var txt = data.iFilter.replace( tsfRegex.exact, '' ),
+ filter = tsf.parseFilter( c, txt, data ) || '';
+ // eslint-disable-next-line eqeqeq
+ return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
+ }
+ return null;
+ },
+ // Look for a range ( using ' to ' or ' - ' ) - see issue #166; thanks matzhu!
+ range : function( c, data ) {
+ if ( tsfRegex.toTest.test( data.iFilter ) ) {
+ var result, tmp, range1, range2,
+ table = c.table,
+ index = data.index,
+ parsed = data.parsed[index],
+ // make sure the dash is for a range and not indicating a negative number
+ query = data.iFilter.split( tsfRegex.toSplit );
+
+ tmp = query[0].replace( ts.regex.nondigit, '' ) || '';
+ range1 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ tmp = query[1].replace( ts.regex.nondigit, '' ) || '';
+ range2 = ts.formatFloat( tsf.parseFilter( c, tmp, data ), table );
+ // parse filter value in case we're comparing numbers ( dates )
+ if ( parsed || c.parsers[ index ].type === 'numeric' ) {
+ result = c.parsers[ index ].format( '' + query[0], table, c.$headers.eq( index ), index );
+ range1 = ( result !== '' && !isNaN( result ) ) ? result : range1;
+ result = c.parsers[ index ].format( '' + query[1], table, c.$headers.eq( index ), index );
+ range2 = ( result !== '' && !isNaN( result ) ) ? result : range2;
+ }
+ if ( ( parsed || c.parsers[ index ].type === 'numeric' ) && !isNaN( range1 ) && !isNaN( range2 ) ) {
+ result = data.cache;
+ } else {
+ tmp = isNaN( data.iExact ) ? data.iExact.replace( ts.regex.nondigit, '' ) : data.iExact;
+ result = ts.formatFloat( tmp, table );
+ }
+ if ( range1 > range2 ) {
+ tmp = range1; range1 = range2; range2 = tmp; // swap
+ }
+ return ( result >= range1 && result <= range2 ) || ( range1 === '' || range2 === '' );
+ }
+ return null;
+ },
+ // Look for wild card: ? = single, * = multiple, or | = logical OR
+ wild : function( c, data ) {
+ if ( tsfRegex.wildOrTest.test( data.iFilter ) ) {
+ var query = '' + ( tsf.parseFilter( c, data.iFilter, data ) || '' );
+ // look for an exact match with the 'or' unless the 'filter-match' class is found
+ if ( !tsfRegex.wildTest.test( query ) && data.nestedFilters ) {
+ query = data.isMatch ? query : '^(' + query + ')$';
+ }
+ // parsing the filter may not work properly when using wildcards =/
+ try {
+ return new RegExp(
+ query.replace( tsfRegex.wild01, '\\S{1}' ).replace( tsfRegex.wild0More, '\\S*' ),
+ c.widgetOptions.filter_ignoreCase ? 'i' : ''
+ )
+ .test( data.exact );
+ } catch ( error ) {
+ return null;
+ }
+ }
+ return null;
+ },
+ // fuzzy text search; modified from https://github.com/mattyork/fuzzy ( MIT license )
+ fuzzy: function( c, data ) {
+ if ( tsfRegex.fuzzyTest.test( data.iFilter ) ) {
+ var indx,
+ patternIndx = 0,
+ len = data.iExact.length,
+ txt = data.iFilter.slice( 1 ),
+ pattern = tsf.parseFilter( c, txt, data ) || '';
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( data.iExact[ indx ] === pattern[ patternIndx ] ) {
+ patternIndx += 1;
+ }
+ }
+ return patternIndx === pattern.length;
+ }
+ return null;
+ }
+ },
+ init: function( table ) {
+ // filter language options
+ ts.language = $.extend( true, {}, {
+ to : 'to',
+ or : 'or',
+ and : 'and'
+ }, ts.language );
+
+ var options, string, txt, $header, column, val, fxn, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ processStr = function(prefix, str, suffix) {
+ str = str.trim();
+ // don't include prefix/suffix if str is empty
+ return str === '' ? '' : (prefix || '') + str + (suffix || '');
+ };
+ c.$table.addClass( 'hasFilters' );
+ c.lastSearch = [];
+
+ // define timers so using clearTimeout won't cause an undefined error
+ wo.filter_searchTimer = null;
+ wo.filter_initTimer = null;
+ wo.filter_formatterCount = 0;
+ wo.filter_formatterInit = [];
+ wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]';
+ wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]';
+
+ val = '\\{' + tsfRegex.query + '\\}';
+ $.extend( tsfRegex, {
+ child : new RegExp( c.cssChildRow ),
+ filtered : new RegExp( wo.filter_filteredRow ),
+ alreadyFiltered : new RegExp( '(\\s+(-' + processStr('|', ts.language.or) + processStr('|', ts.language.to) + ')\\s+)', 'i' ),
+ toTest : new RegExp( '\\s+(-' + processStr('|', ts.language.to) + ')\\s+', 'i' ),
+ toSplit : new RegExp( '(?:\\s+(?:-' + processStr('|', ts.language.to) + ')\\s+)', 'gi' ),
+ andTest : new RegExp( '\\s+(' + processStr('', ts.language.and, '|') + '&&)\\s+', 'i' ),
+ andSplit : new RegExp( '(?:\\s+(?:' + processStr('', ts.language.and, '|') + '&&)\\s+)', 'gi' ),
+ orTest : new RegExp( '(\\|' + processStr('|\\s+', ts.language.or, '\\s+') + ')', 'i' ),
+ orSplit : new RegExp( '(?:\\|' + processStr('|\\s+(?:', ts.language.or, ')\\s+') + ')', 'gi' ),
+ iQuery : new RegExp( val, 'i' ),
+ igQuery : new RegExp( val, 'ig' ),
+ operTest : /^[<>]=?/,
+ gtTest : />/,
+ gteTest : />=/,
+ ltTest : /</,
+ lteTest : /<=/,
+ notTest : /^\!/,
+ wildOrTest : /[\?\*\|]/,
+ wildTest : /\?\*/,
+ fuzzyTest : /^~/,
+ exactTest : /[=\"\|!]/
+ });
+
+ // don't build filter row if columnFilters is false or all columns are set to 'filter-false'
+ // see issue #156
+ val = c.$headers.filter( '.filter-false, .parser-false' ).length;
+ if ( wo.filter_columnFilters !== false && val !== c.$headers.length ) {
+ // build filter row
+ tsf.buildRow( table, c, wo );
+ }
+
+ txt = 'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
+ 'filterAndSortReset filterResetSaved filterEnd search '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table.bind( txt, function( event, filter ) {
+ val = wo.filter_hideEmpty &&
+ $.isEmptyObject( c.cache ) &&
+ !( c.delayInit && event.type === 'appendCache' );
+ // hide filter row using the 'filtered' class name
+ c.$table.find( '.' + tscss.filterRow ).toggleClass( wo.filter_filteredRow, val ); // fixes #450
+ if ( !/(search|filter)/.test( event.type ) ) {
+ event.stopPropagation();
+ tsf.buildDefault( table, true );
+ }
+ // Add filterAndSortReset - see #1361
+ if ( event.type === 'filterReset' || event.type === 'filterAndSortReset' ) {
+ c.$table.find( '.' + tscss.filter ).add( wo.filter_$externalFilters ).val( '' );
+ if ( event.type === 'filterAndSortReset' ) {
+ ts.sortReset( this.config, function() {
+ tsf.searching( table, [] );
+ });
+ } else {
+ tsf.searching( table, [] );
+ }
+ } else if ( event.type === 'filterResetSaved' ) {
+ ts.storage( table, 'tablesorter-filters', '' );
+ } else if ( event.type === 'filterEnd' ) {
+ tsf.buildDefault( table, true );
+ } else {
+ // send false argument to force a new search; otherwise if the filter hasn't changed,
+ // it will return
+ filter = event.type === 'search' ? filter :
+ event.type === 'updateComplete' ? c.$table.data( 'lastSearch' ) : '';
+ if ( /(update|add)/.test( event.type ) && event.type !== 'updateComplete' ) {
+ // force a new search since content has changed
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ // update filterFormatters after update (& small delay) - Fixes #1237
+ setTimeout(function() {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }, 100);
+ }
+ // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
+ // input ensures all inputs are updated when a search is triggered on the table
+ // $( 'table' ).trigger( 'search', [...] );
+ tsf.searching( table, filter, true );
+ }
+ return false;
+ });
+
+ // reset button/link
+ if ( wo.filter_reset ) {
+ if ( wo.filter_reset instanceof $ ) {
+ // reset contains a jQuery object, bind to it
+ wo.filter_reset.click( function() {
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ } else if ( $( wo.filter_reset ).length ) {
+ // reset is a jQuery selector, use event delegation
+ $( document )
+ .undelegate( wo.filter_reset, 'click' + c.namespace + 'filter' )
+ .delegate( wo.filter_reset, 'click' + c.namespace + 'filter', function() {
+ // trigger a reset event, so other functions ( filter_formatter ) know when to reset
+ c.$table.triggerHandler( 'filterReset' );
+ });
+ }
+ }
+ if ( wo.filter_functions ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ fxn = ts.getColumnData( table, wo.filter_functions, column );
+ if ( fxn ) {
+ // remove 'filter-select' from header otherwise the options added here are replaced with
+ // all options
+ $header = c.$headerIndexed[ column ].removeClass( 'filter-select' );
+ // don't build select if 'filter-false' or 'parser-false' set
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ options = '';
+ if ( fxn === true && noSelect ) {
+ tsf.buildSelect( table, column );
+ } else if ( typeof fxn === 'object' && noSelect ) {
+ // add custom drop down list
+ for ( string in fxn ) {
+ if ( typeof string === 'string' ) {
+ options += options === '' ?
+ '<option value="">' +
+ ( $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select ||
+ ''
+ ) +
+ '</option>' : '';
+ val = string;
+ txt = string;
+ if ( string.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ val = string.split( wo.filter_selectSourceSeparator );
+ txt = val[1];
+ val = val[0];
+ }
+ options += '<option ' +
+ ( txt === val ? '' : 'data-function-name="' + string + '" ' ) +
+ 'value="' + val + '">' + txt + '</option>';
+ }
+ }
+ c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .append( options );
+ txt = wo.filter_selectSource;
+ fxn = typeof txt === 'function' ? true : ts.getColumnData( table, txt, column );
+ if ( fxn ) {
+ // updating so the extra options are appended
+ tsf.buildSelect( c.table, column, '', true, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ }
+ }
+ // not really updating, but if the column has both the 'filter-select' class &
+ // filter_functions set to true, it would append the same options twice.
+ tsf.buildDefault( table, true );
+
+ tsf.bindSearch( table, c.$table.find( '.' + tscss.filter ), true );
+ if ( wo.filter_external ) {
+ tsf.bindSearch( table, wo.filter_external );
+ }
+
+ if ( wo.filter_hideFilters ) {
+ tsf.hideFilters( c );
+ }
+
+ // show processing icon
+ if ( c.showProcessing ) {
+ txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function( event, columns ) {
+ // only add processing to certain columns to all columns
+ $header = ( columns ) ?
+ c.$table
+ .find( '.' + tscss.header )
+ .filter( '[data-column]' )
+ .filter( function() {
+ return columns[ $( this ).data( 'column' ) ] !== '';
+ }) : '';
+ ts.isProcessing( table, event.type === 'filterStart', columns ? $header : '' );
+ });
+ }
+
+ // set filtered rows count ( intially unfiltered )
+ c.filteredRows = c.totalRows;
+
+ // add default values
+ txt = 'tablesorter-initialized pagerBeforeInitialized '.split( ' ' ).join( c.namespace + 'filter ' );
+ c.$table
+ .unbind( txt.replace( ts.regex.spaces, ' ' ) )
+ .bind( txt, function() {
+ tsf.completeInit( this );
+ });
+ // if filter widget is added after pager has initialized; then set filter init flag
+ if ( c.pager && c.pager.initialized && !wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ setTimeout( function() {
+ tsf.filterInitComplete( c );
+ }, 100 );
+ } else if ( !wo.filter_initialized ) {
+ tsf.completeInit( table );
+ }
+ },
+ completeInit: function( table ) {
+ // redefine 'c' & 'wo' so they update properly inside this callback
+ var c = table.config,
+ wo = c.widgetOptions,
+ filters = tsf.setDefaults( table, c, wo ) || [];
+ if ( filters.length ) {
+ // prevent delayInit from triggering a cache build if filters are empty
+ if ( !( c.delayInit && filters.join( '' ) === '' ) ) {
+ ts.setFilters( table, filters, true );
+ }
+ }
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ // trigger init after setTimeout to prevent multiple filterStart/End/Init triggers
+ setTimeout( function() {
+ if ( !wo.filter_initialized ) {
+ tsf.filterInitComplete( c );
+ }
+ }, 100 );
+ },
+
+ // $cell parameter, but not the config, is passed to the filter_formatters,
+ // so we have to work with it instead
+ formatterUpdated: function( $cell, column ) {
+ // prevent error if $cell is undefined - see #1056
+ var $table = $cell && $cell.closest( 'table' );
+ var config = $table.length && $table[0].config,
+ wo = config && config.widgetOptions;
+ if ( wo && !wo.filter_initialized ) {
+ // add updates by column since this function
+ // may be called numerous times before initialization
+ wo.filter_formatterInit[ column ] = 1;
+ }
+ },
+ filterInitComplete: function( c ) {
+ var indx, len,
+ wo = c.widgetOptions,
+ count = 0,
+ completed = function() {
+ wo.filter_initialized = true;
+ // update lastSearch - it gets cleared often
+ c.lastSearch = c.$table.data( 'lastSearch' );
+ c.$table.triggerHandler( 'filterInit', c );
+ tsf.findRows( c.table, c.lastSearch || [] );
+ if (ts.debug(c, 'filter')) {
+ console.log('Filter >> Widget initialized');
+ }
+ };
+ if ( $.isEmptyObject( wo.filter_formatter ) ) {
+ completed();
+ } else {
+ len = wo.filter_formatterInit.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( wo.filter_formatterInit[ indx ] === 1 ) {
+ count++;
+ }
+ }
+ clearTimeout( wo.filter_initTimer );
+ if ( !wo.filter_initialized && count === wo.filter_formatterCount ) {
+ // filter widget initialized
+ completed();
+ } else if ( !wo.filter_initialized ) {
+ // fall back in case a filter_formatter doesn't call
+ // $.tablesorter.filter.formatterUpdated( $cell, column ), and the count is off
+ wo.filter_initTimer = setTimeout( function() {
+ completed();
+ }, 500 );
+ }
+ }
+ },
+ // encode or decode filters for storage; see #1026
+ processFilters: function( filters, encode ) {
+ var indx,
+ // fixes #1237; previously returning an encoded "filters" value
+ result = [],
+ mode = encode ? encodeURIComponent : decodeURIComponent,
+ len = filters.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ if ( filters[ indx ] ) {
+ result[ indx ] = mode( filters[ indx ] );
+ }
+ }
+ return result;
+ },
+ setDefaults: function( table, c, wo ) {
+ var isArray, saved, indx, col, $filters,
+ // get current ( default ) filters
+ filters = ts.getFilters( table ) || [];
+ if ( wo.filter_saveFilters && ts.storage ) {
+ saved = ts.storage( table, 'tablesorter-filters' ) || [];
+ isArray = $.isArray( saved );
+ // make sure we're not just getting an empty array
+ if ( !( isArray && saved.join( '' ) === '' || !isArray ) ) {
+ filters = tsf.processFilters( saved );
+ }
+ }
+ // if no filters saved, then check default settings
+ if ( filters.join( '' ) === '' ) {
+ // allow adding default setting to external filters
+ $filters = c.$headers.add( wo.filter_$externalFilters )
+ .filter( '[' + wo.filter_defaultAttrib + ']' );
+ for ( indx = 0; indx <= c.columns; indx++ ) {
+ // include data-column='all' external filters
+ col = indx === c.columns ? 'all' : indx;
+ filters[ indx ] = $filters
+ .filter( '[data-column="' + col + '"]' )
+ .attr( wo.filter_defaultAttrib ) || filters[indx] || '';
+ }
+ }
+ c.$table.data( 'lastSearch', filters );
+ return filters;
+ },
+ parseFilter: function( c, filter, data, parsed ) {
+ return parsed || data.parsed[ data.index ] ?
+ c.parsers[ data.index ].format( filter, c.table, [], data.index ) :
+ filter;
+ },
+ buildRow: function( table, c, wo ) {
+ var $filter, col, column, $header, makeSelect, disabled, name, ffxn, tmp,
+ // c.columns defined in computeThIndexes()
+ cellFilter = wo.filter_cellFilter,
+ columns = c.columns,
+ arry = $.isArray( cellFilter ),
+ buildFilter = '<tr role="search" class="' + tscss.filterRow + ' ' + c.cssIgnoreRow + '">';
+ for ( column = 0; column < columns; column++ ) {
+ if ( c.$headerIndexed[ column ].length ) {
+ // account for entire column set with colspan. See #1047
+ tmp = c.$headerIndexed[ column ] && c.$headerIndexed[ column ][0].colSpan || 0;
+ if ( tmp > 1 ) {
+ buildFilter += '<td data-column="' + column + '-' + ( column + tmp - 1 ) + '" colspan="' + tmp + '"';
+ } else {
+ buildFilter += '<td data-column="' + column + '"';
+ }
+ if ( arry ) {
+ buildFilter += ( cellFilter[ column ] ? ' class="' + cellFilter[ column ] + '"' : '' );
+ } else {
+ buildFilter += ( cellFilter !== '' ? ' class="' + cellFilter + '"' : '' );
+ }
+ buildFilter += '></td>';
+ }
+ }
+ c.$filters = $( buildFilter += '</tr>' )
+ .appendTo( c.$table.children( 'thead' ).eq( 0 ) )
+ .children( 'td' );
+ // build each filter input
+ for ( column = 0; column < columns; column++ ) {
+ disabled = false;
+ // assuming last cell of a column is the main column
+ $header = c.$headerIndexed[ column ];
+ if ( $header && $header.length ) {
+ // $filter = c.$filters.filter( '[data-column="' + column + '"]' );
+ $filter = tsf.getColumnElm( c, c.$filters, column );
+ ffxn = ts.getColumnData( table, wo.filter_functions, column );
+ makeSelect = ( wo.filter_functions && ffxn && typeof ffxn !== 'function' ) ||
+ $header.hasClass( 'filter-select' );
+ // get data from jQuery data, metadata, headers option or header class name
+ col = ts.getColumnData( table, c.headers, column );
+ disabled = ts.getData( $header[0], col, 'filter' ) === 'false' ||
+ ts.getData( $header[0], col, 'parser' ) === 'false';
+
+ if ( makeSelect ) {
+ buildFilter = $( '<select>' ).appendTo( $filter );
+ } else {
+ ffxn = ts.getColumnData( table, wo.filter_formatter, column );
+ if ( ffxn ) {
+ wo.filter_formatterCount++;
+ buildFilter = ffxn( $filter, column );
+ // no element returned, so lets go find it
+ if ( buildFilter && buildFilter.length === 0 ) {
+ buildFilter = $filter.children( 'input' );
+ }
+ // element not in DOM, so lets attach it
+ if ( buildFilter && ( buildFilter.parent().length === 0 ||
+ ( buildFilter.parent().length && buildFilter.parent()[0] !== $filter[0] ) ) ) {
+ $filter.append( buildFilter );
+ }
+ } else {
+ buildFilter = $( '<input type="search">' ).appendTo( $filter );
+ }
+ if ( buildFilter ) {
+ tmp = $header.data( 'placeholder' ) ||
+ $header.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.search || '';
+ buildFilter.attr( 'placeholder', tmp );
+ }
+ }
+ if ( buildFilter ) {
+ // add filter class name
+ name = ( $.isArray( wo.filter_cssFilter ) ?
+ ( typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '' ) :
+ wo.filter_cssFilter ) || '';
+ // copy data-column from table cell (it will include colspan)
+ buildFilter.addClass( tscss.filter + ' ' + name );
+ name = wo.filter_filterLabel;
+ tmp = name.match(/{{([^}]+?)}}/g);
+ if (!tmp) {
+ tmp = [ '{{label}}' ];
+ }
+ $.each(tmp, function(indx, attr) {
+ var regex = new RegExp(attr, 'g'),
+ data = $header.attr('data-' + attr.replace(/{{|}}/g, '')),
+ text = typeof data === 'undefined' ? $header.text() : data;
+ name = name.replace( regex, $.trim( text ) );
+ });
+ buildFilter.attr({
+ 'data-column': $filter.attr( 'data-column' ),
+ 'aria-label': name
+ });
+ if ( disabled ) {
+ buildFilter.attr( 'placeholder', '' ).addClass( tscss.filterDisabled )[0].disabled = true;
+ }
+ }
+ }
+ }
+ },
+ bindSearch: function( table, $el, internal ) {
+ table = $( table )[0];
+ $el = $( $el ); // allow passing a selector string
+ if ( !$el.length ) { return; }
+ var tmp,
+ c = table.config,
+ wo = c.widgetOptions,
+ namespace = c.namespace + 'filter',
+ $ext = wo.filter_$externalFilters;
+ if ( internal !== true ) {
+ // save anyMatch element
+ tmp = wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector;
+ wo.filter_$anyMatch = $el.filter( tmp );
+ if ( $ext && $ext.length ) {
+ wo.filter_$externalFilters = wo.filter_$externalFilters.add( $el );
+ } else {
+ wo.filter_$externalFilters = $el;
+ }
+ // update values ( external filters added after table initialization )
+ ts.setFilters( table, c.$table.data( 'lastSearch' ) || [], internal === false );
+ }
+ // unbind events
+ tmp = ( 'keypress keyup keydown search change input '.split( ' ' ).join( namespace + ' ' ) );
+ $el
+ // use data attribute instead of jQuery data since the head is cloned without including
+ // the data/binding
+ .attr( 'data-lastSearchTime', new Date().getTime() )
+ .unbind( tmp.replace( ts.regex.spaces, ' ' ) )
+ .bind( 'keydown' + namespace, function( event ) {
+ if ( event.which === tskeyCodes.escape && !table.config.widgetOptions.filter_resetOnEsc ) {
+ // prevent keypress event
+ return false;
+ }
+ })
+ .bind( 'keyup' + namespace, function( event ) {
+ wo = table.config.widgetOptions; // make sure "wo" isn't cached
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ // emulate what webkit does.... escape clears the filter
+ if ( event.which === tskeyCodes.escape ) {
+ // make sure to restore the last value on escape
+ this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
+ // don't return if the search value is empty ( all rows need to be revealed )
+ } else if ( this.value !== '' && (
+ // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
+ ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
+ // let return & backspace continue on, but ignore arrows & non-valid characters
+ ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
+ ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
+ return;
+ // live search
+ } else if ( liveSearch === false ) {
+ if ( this.value !== '' && event.which !== tskeyCodes.enter ) {
+ return;
+ }
+ }
+ // change event = no delay; last true flag tells getFilters to skip newest timed input
+ tsf.searching( table, true, true, column );
+ })
+ // include change for select - fixes #473
+ .bind( 'search change keypress input blur '.split( ' ' ).join( namespace + ' ' ), function( event ) {
+ // don't get cached data, in case data-column changes dynamically
+ var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
+ eventType = event.type,
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( table.config.widgetOptions.filter_initialized &&
+ // immediate search if user presses enter
+ ( event.which === tskeyCodes.enter ||
+ // immediate search if a "search" or "blur" is triggered on the input
+ ( eventType === 'search' || eventType === 'blur' ) ||
+ // change & input events must be ignored if liveSearch !== true
+ ( eventType === 'change' || eventType === 'input' ) &&
+ // prevent search if liveSearch is a number
+ ( liveSearch === true || liveSearch !== true && event.target.nodeName !== 'INPUT' ) &&
+ // don't allow 'change' or 'input' event to process if the input value
+ // is the same - fixes #685
+ this.value !== c.lastSearch[column]
+ )
+ ) {
+ event.preventDefault();
+ // init search with no delay
+ $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
+ tsf.searching( table, eventType !== 'keypress' || event.which === tskeyCodes.enter, true, column );
+ }
+ });
+ },
+ searching: function( table, filter, skipFirst, column ) {
+ var liveSearch,
+ wo = table.config.widgetOptions;
+ if (typeof column === 'undefined') {
+ // no delay
+ liveSearch = false;
+ } else {
+ liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
+ wo.filter_liveSearch :
+ // get column setting, or set to fallback value, or default to false
+ ts.getColumnData( table, wo.filter_liveSearch, column );
+ if ( typeof liveSearch === 'undefined' ) {
+ liveSearch = wo.filter_liveSearch.fallback || false;
+ }
+ }
+ clearTimeout( wo.filter_searchTimer );
+ if ( typeof filter === 'undefined' || filter === true ) {
+ // delay filtering
+ wo.filter_searchTimer = setTimeout( function() {
+ tsf.checkFilters( table, filter, skipFirst );
+ }, liveSearch ? wo.filter_searchDelay : 10 );
+ } else {
+ // skip delay
+ tsf.checkFilters( table, filter, skipFirst );
+ }
+ },
+ equalFilters: function (c, filter1, filter2) {
+ var indx,
+ f1 = [],
+ f2 = [],
+ len = c.columns + 1; // add one to include anyMatch filter
+ filter1 = $.isArray(filter1) ? filter1 : [];
+ filter2 = $.isArray(filter2) ? filter2 : [];
+ for (indx = 0; indx < len; indx++) {
+ f1[indx] = filter1[indx] || '';
+ f2[indx] = filter2[indx] || '';
+ }
+ return f1.join(',') === f2.join(',');
+ },
+ checkFilters: function( table, filter, skipFirst ) {
+ var c = table.config,
+ wo = c.widgetOptions,
+ filterArray = $.isArray( filter ),
+ filters = ( filterArray ) ? filter : ts.getFilters( table, true ),
+ currentFilters = filters || []; // current filter values
+ // prevent errors if delay init is set
+ if ( $.isEmptyObject( c.cache ) ) {
+ // update cache if delayInit set & pager has initialized ( after user initiates a search )
+ if ( c.delayInit && ( !c.pager || c.pager && c.pager.initialized ) ) {
+ ts.updateCache( c, function() {
+ tsf.checkFilters( table, false, skipFirst );
+ });
+ }
+ return;
+ }
+ // add filter array back into inputs
+ if ( filterArray ) {
+ ts.setFilters( table, filters, false, skipFirst !== true );
+ if ( !wo.filter_initialized ) {
+ c.lastSearch = [];
+ c.lastCombinedFilter = '';
+ }
+ }
+ if ( wo.filter_hideFilters ) {
+ // show/hide filter row as needed
+ c.$table
+ .find( '.' + tscss.filterRow )
+ .triggerHandler( tsf.hideFiltersCheck( c ) ? 'mouseleave' : 'mouseenter' );
+ }
+ // return if the last search is the same; but filter === false when updating the search
+ // see example-widget-filter.html filter toggle buttons
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) ) {
+ if ( filter !== false ) {
+ return;
+ } else {
+ // force filter refresh
+ c.lastCombinedFilter = '';
+ c.lastSearch = [];
+ }
+ }
+ // define filter inside it is false
+ filters = filters || [];
+ // convert filters to strings - see #1070
+ filters = Array.prototype.map ?
+ filters.map( String ) :
+ // for IE8 & older browsers - maybe not the best method
+ filters.join( '\ufffd' ).split( '\ufffd' );
+
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterStart', [ filters ] );
+ }
+ if ( c.showProcessing ) {
+ // give it time for the processing icon to kick in
+ setTimeout( function() {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }, 30 );
+ } else {
+ tsf.findRows( table, filters, currentFilters );
+ return false;
+ }
+ },
+ hideFiltersCheck: function( c ) {
+ if (typeof c.widgetOptions.filter_hideFilters === 'function') {
+ var val = c.widgetOptions.filter_hideFilters( c );
+ if (typeof val === 'boolean') {
+ return val;
+ }
+ }
+ return ts.getFilters( c.$table ).join( '' ) === '';
+ },
+ hideFilters: function( c, $table ) {
+ var timer;
+ ( $table || c.$table )
+ .find( '.' + tscss.filterRow )
+ .addClass( tscss.filterRowHide )
+ .bind( 'mouseenter mouseleave', function( e ) {
+ // save event object - http://bugs.jquery.com/ticket/12140
+ var event = e,
+ $row = $( this );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ if ( /enter|over/.test( event.type ) ) {
+ $row.removeClass( tscss.filterRowHide );
+ } else {
+ // don't hide if input has focus
+ // $( ':focus' ) needs jQuery 1.6+
+ if ( $( document.activeElement ).closest( 'tr' )[0] !== $row[0] ) {
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) );
+ }
+ }
+ }, 200 );
+ })
+ .find( 'input, select' ).bind( 'focus blur', function( e ) {
+ var event = e,
+ $row = $( this ).closest( 'tr' );
+ clearTimeout( timer );
+ timer = setTimeout( function() {
+ clearTimeout( timer );
+ // don't hide row if any filter has a value
+ $row.toggleClass( tscss.filterRowHide, tsf.hideFiltersCheck( c ) && event.type !== 'focus' );
+ }, 200 );
+ });
+ },
+ defaultFilter: function( filter, mask ) {
+ if ( filter === '' ) { return filter; }
+ var regex = tsfRegex.iQuery,
+ maskLen = mask.match( tsfRegex.igQuery ).length,
+ query = maskLen > 1 ? $.trim( filter ).split( /\s/ ) : [ $.trim( filter ) ],
+ len = query.length - 1,
+ indx = 0,
+ val = mask;
+ if ( len < 1 && maskLen > 1 ) {
+ // only one 'word' in query but mask has >1 slots
+ query[1] = query[0];
+ }
+ // replace all {query} with query words...
+ // if query = 'Bob', then convert mask from '!{query}' to '!Bob'
+ // if query = 'Bob Joe Frank', then convert mask '{q} OR {q}' to 'Bob OR Joe OR Frank'
+ while ( regex.test( val ) ) {
+ val = val.replace( regex, query[indx++] || '' );
+ if ( regex.test( val ) && indx < len && ( query[indx] || '' ) !== '' ) {
+ val = mask.replace( regex, val );
+ }
+ }
+ return val;
+ },
+ getLatestSearch: function( $input ) {
+ if ( $input ) {
+ return $input.sort( function( a, b ) {
+ return $( b ).attr( 'data-lastSearchTime' ) - $( a ).attr( 'data-lastSearchTime' );
+ });
+ }
+ return $input || $();
+ },
+ findRange: function( c, val, ignoreRanges ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var temp, ranges, range, start, end, singles, i, indx, len,
+ columns = [];
+ if ( /^[0-9]+$/.test( val ) ) {
+ // always return an array
+ return [ parseInt( val, 10 ) ];
+ }
+ // process column range
+ if ( !ignoreRanges && /-/.test( val ) ) {
+ ranges = val.match( /(\d+)\s*-\s*(\d+)/g );
+ len = ranges ? ranges.length : 0;
+ for ( indx = 0; indx < len; indx++ ) {
+ range = ranges[indx].split( /\s*-\s*/ );
+ start = parseInt( range[0], 10 ) || 0;
+ end = parseInt( range[1], 10 ) || ( c.columns - 1 );
+ if ( start > end ) {
+ temp = start; start = end; end = temp; // swap
+ }
+ if ( end >= c.columns ) {
+ end = c.columns - 1;
+ }
+ for ( ; start <= end; start++ ) {
+ columns[ columns.length ] = start;
+ }
+ // remove processed range from val
+ val = val.replace( ranges[ indx ], '' );
+ }
+ }
+ // process single columns
+ if ( !ignoreRanges && /,/.test( val ) ) {
+ singles = val.split( /\s*,\s*/ );
+ len = singles.length;
+ for ( i = 0; i < len; i++ ) {
+ if ( singles[ i ] !== '' ) {
+ indx = parseInt( singles[ i ], 10 );
+ if ( indx < c.columns ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ }
+ }
+ // return all columns
+ if ( !columns.length ) {
+ for ( indx = 0; indx < c.columns; indx++ ) {
+ columns[ columns.length ] = indx;
+ }
+ }
+ return columns;
+ },
+ getColumnElm: function( c, $elements, column ) {
+ // data-column may contain multiple columns '1-3,5-6,8'
+ // replaces: c.$filters.filter( '[data-column="' + column + '"]' );
+ return $elements.filter( function() {
+ var cols = tsf.findRange( c, $( this ).attr( 'data-column' ) );
+ return $.inArray( column, cols ) > -1;
+ });
+ },
+ multipleColumns: function( c, $input ) {
+ // look for multiple columns '1-3,4-6,8' in data-column
+ var wo = c.widgetOptions,
+ // only target 'all' column inputs on initialization
+ // & don't target 'all' column inputs if they don't exist
+ targets = wo.filter_initialized || !$input.filter( wo.filter_anyColumnSelector ).length,
+ val = $.trim( tsf.getLatestSearch( $input ).attr( 'data-column' ) || '' );
+ return tsf.findRange( c, val, !targets );
+ },
+ processTypes: function( c, data, vars ) {
+ var ffxn,
+ filterMatched = null,
+ matches = null;
+ for ( ffxn in tsf.types ) {
+ if ( $.inArray( ffxn, vars.excludeMatch ) < 0 && matches === null ) {
+ matches = tsf.types[ffxn]( c, data, vars );
+ if ( matches !== null ) {
+ data.matchedOn = ffxn;
+ filterMatched = matches;
+ }
+ }
+ }
+ return filterMatched;
+ },
+ matchType: function( c, columnIndex ) {
+ var isMatch,
+ wo = c.widgetOptions,
+ $el = c.$headerIndexed[ columnIndex ];
+ // filter-exact > filter-match > filter_matchType for type
+ if ( $el.hasClass( 'filter-exact' ) ) {
+ isMatch = false;
+ } else if ( $el.hasClass( 'filter-match' ) ) {
+ isMatch = true;
+ } else {
+ // filter-select is not applied when filter_functions are used, so look for a select
+ if ( wo.filter_columnFilters ) {
+ $el = c.$filters
+ .find( '.' + tscss.filter )
+ .add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' );
+ } else if ( wo.filter_$externalFilters ) {
+ $el = wo.filter_$externalFilters.filter( '[data-column="' + columnIndex + '"]' );
+ }
+ isMatch = $el.length ?
+ c.widgetOptions.filter_matchType[ ( $el[ 0 ].nodeName || '' ).toLowerCase() ] === 'match' :
+ // default to exact, if no inputs found
+ false;
+ }
+ return isMatch;
+ },
+ processRow: function( c, data, vars ) {
+ var result, filterMatched,
+ fxn, ffxn, txt,
+ wo = c.widgetOptions,
+ showRow = true,
+ hasAnyMatchInput = wo.filter_$anyMatch && wo.filter_$anyMatch.length,
+
+ // if wo.filter_$anyMatch data-column attribute is changed dynamically
+ // we don't want to do an "anyMatch" search on one column using data
+ // for the entire row - see #998
+ columnIndex = wo.filter_$anyMatch && wo.filter_$anyMatch.length ?
+ // look for multiple columns '1-3,4-6,8'
+ tsf.multipleColumns( c, wo.filter_$anyMatch ) :
+ [];
+ data.$cells = data.$row.children();
+ data.matchedOn = null;
+ if ( data.anyMatchFlag && columnIndex.length > 1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ data.anyMatch = true;
+ data.isMatch = true;
+ data.rowArray = data.$cells.map( function( i ) {
+ if ( $.inArray( i, columnIndex ) > -1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
+ if ( data.parsed[ i ] ) {
+ txt = data.cacheArray[ i ];
+ } else {
+ txt = data.rawArray[ i ];
+ txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt );
+ if ( c.sortLocaleCompare ) {
+ txt = ts.replaceAccents( txt );
+ }
+ }
+ return txt;
+ }
+ }).get();
+ data.filter = data.anyMatchFilter;
+ data.iFilter = data.iAnyMatchFilter;
+ data.exact = data.rowArray.join( ' ' );
+ data.iExact = wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact;
+ data.cache = data.cacheArray.slice( 0, -1 ).join( ' ' );
+ vars.excludeMatch = vars.noAnyMatch;
+ filterMatched = tsf.processTypes( c, data, vars );
+ if ( filterMatched !== null ) {
+ showRow = filterMatched;
+ } else {
+ if ( wo.filter_startsWith ) {
+ showRow = false;
+ // data.rowArray may not contain all columns
+ columnIndex = Math.min( c.columns, data.rowArray.length );
+ while ( !showRow && columnIndex > 0 ) {
+ columnIndex--;
+ showRow = showRow || data.rowArray[ columnIndex ].indexOf( data.iFilter ) === 0;
+ }
+ } else {
+ showRow = ( data.iExact + data.childRowText ).indexOf( data.iFilter ) >= 0;
+ }
+ }
+ data.anyMatch = false;
+ // no other filters to process
+ if ( data.filters.join( '' ) === data.filter ) {
+ return showRow;
+ }
+ }
+
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.filter = data.filters[ columnIndex ];
+ data.index = columnIndex;
+
+ // filter types to exclude, per column
+ vars.excludeMatch = vars.excludeFilter[ columnIndex ];
+
+ // ignore if filter is empty or disabled
+ if ( data.filter ) {
+ data.cache = data.cacheArray[ columnIndex ];
+ result = data.parsed[ columnIndex ] ? data.cache : data.rawArray[ columnIndex ] || '';
+ data.exact = c.sortLocaleCompare ? ts.replaceAccents( result ) : result; // issue #405
+ data.iExact = !tsfRegex.type.test( typeof data.exact ) && wo.filter_ignoreCase ?
+ data.exact.toLowerCase() : data.exact;
+ data.isMatch = tsf.matchType( c, columnIndex );
+
+ result = showRow; // if showRow is true, show that row
+
+ // in case select filter option has a different value vs text 'a - z|A through Z'
+ ffxn = wo.filter_columnFilters ?
+ c.$filters.add( wo.filter_$externalFilters )
+ .filter( '[data-column="' + columnIndex + '"]' )
+ .find( 'select option:selected' )
+ .attr( 'data-function-name' ) || '' : '';
+ // replace accents - see #357
+ if ( c.sortLocaleCompare ) {
+ data.filter = ts.replaceAccents( data.filter );
+ }
+
+ // replace column specific default filters - see #1088
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultColFilter[ columnIndex ] ) ) {
+ data.filter = tsf.defaultFilter( data.filter, vars.defaultColFilter[ columnIndex ] );
+ }
+
+ // data.iFilter = case insensitive ( if wo.filter_ignoreCase is true ),
+ // data.filter = case sensitive
+ data.iFilter = wo.filter_ignoreCase ? ( data.filter || '' ).toLowerCase() : data.filter;
+ fxn = vars.functions[ columnIndex ];
+ filterMatched = null;
+ if ( fxn ) {
+ if ( typeof fxn === 'function' ) {
+ // filter callback( exact cell content, parser normalized content,
+ // filter input value, column index, jQuery row object )
+ filterMatched = fxn( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ } else if ( typeof fxn[ ffxn || data.filter ] === 'function' ) {
+ // selector option function
+ txt = ffxn || data.filter;
+ filterMatched =
+ fxn[ txt ]( data.exact, data.cache, data.filter, columnIndex, data.$row, c, data );
+ }
+ }
+ if ( filterMatched === null ) {
+ // cycle through the different filters
+ // filters return a boolean or null if nothing matches
+ filterMatched = tsf.processTypes( c, data, vars );
+ // select with exact match; ignore "and" or "or" within the text; fixes #1486
+ txt = fxn === true && (data.matchedOn === 'and' || data.matchedOn === 'or');
+ if ( filterMatched !== null && !txt) {
+ result = filterMatched;
+ // Look for match, and add child row data for matching
+ } else {
+ // check fxn (filter-select in header) after filter types are checked
+ // without this, the filter + jQuery UI selectmenu demo was breaking
+ if ( fxn === true ) {
+ // default selector uses exact match unless 'filter-match' class is found
+ result = data.isMatch ?
+ // data.iExact may be a number
+ ( '' + data.iExact ).search( data.iFilter ) >= 0 :
+ data.filter === data.exact;
+ } else {
+ txt = ( data.iExact + data.childRowText ).indexOf( tsf.parseFilter( c, data.iFilter, data ) );
+ result = ( ( !wo.filter_startsWith && txt >= 0 ) || ( wo.filter_startsWith && txt === 0 ) );
+ }
+ }
+ } else {
+ result = filterMatched;
+ }
+ showRow = ( result ) ? showRow : false;
+ }
+ }
+ return showRow;
+ },
+ findRows: function( table, filters, currentFilters ) {
+ if (
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
+ !table.config.widgetOptions.filter_initialized
+ ) {
+ return;
+ }
+ var len, norm_rows, rowData, $rows, $row, rowIndex, tbodyIndex, $tbody, columnIndex,
+ isChild, childRow, lastSearch, showRow, showParent, time, val, indx,
+ notFiltered, searchFiltered, query, injected, res, id, txt,
+ storedFilters = $.extend( [], filters ),
+ c = table.config,
+ wo = c.widgetOptions,
+ debug = ts.debug(c, 'filter'),
+ // data object passed to filters; anyMatch is a flag for the filters
+ data = {
+ anyMatch: false,
+ filters: filters,
+ // regex filter type cache
+ filter_regexCache : []
+ },
+ vars = {
+ // anyMatch really screws up with these types of filters
+ noAnyMatch: [ 'range', 'operators' ],
+ // cache filter variables that use ts.getColumnData in the main loop
+ functions : [],
+ excludeFilter : [],
+ defaultColFilter : [],
+ defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
+ };
+ // parse columns after formatter, in case the class is added at that point
+ data.parsed = [];
+ for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
+ data.parsed[ columnIndex ] = wo.filter_useParsedData ||
+ // parser has a "parsed" parameter
+ ( c.parsers && c.parsers[ columnIndex ] && c.parsers[ columnIndex ].parsed ||
+ // getData may not return 'parsed' if other 'filter-' class names exist
+ // ( e.g. <th class="filter-select filter-parsed"> )
+ ts.getData && ts.getData( c.$headerIndexed[ columnIndex ],
+ ts.getColumnData( table, c.headers, columnIndex ), 'filter' ) === 'parsed' ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-parsed' ) );
+
+ vars.functions[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) ||
+ c.$headerIndexed[ columnIndex ].hasClass( 'filter-select' );
+ vars.defaultColFilter[ columnIndex ] =
+ ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '';
+ vars.excludeFilter[ columnIndex ] =
+ ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
+ }
+
+ if ( debug ) {
+ console.log( 'Filter >> Starting filter widget search', filters );
+ time = new Date();
+ }
+ // filtered rows count
+ c.filteredRows = 0;
+ c.totalRows = 0;
+ currentFilters = ( storedFilters || [] );
+
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ $tbody = ts.processTbody( table, c.$tbodies.eq( tbodyIndex ), true );
+ // skip child rows & widget added ( removable ) rows - fixes #448 thanks to @hempel!
+ // $rows = $tbody.children( 'tr' ).not( c.selectorRemove );
+ columnIndex = c.columns;
+ // convert stored rows into a jQuery object
+ norm_rows = c.cache[ tbodyIndex ].normalized;
+ $rows = $( $.map( norm_rows, function( el ) {
+ return el[ columnIndex ].$row.get();
+ }) );
+
+ if ( currentFilters.join('') === '' || wo.filter_serversideFiltering ) {
+ $rows
+ .removeClass( wo.filter_filteredRow )
+ .not( '.' + c.cssChildRow )
+ .css( 'display', '' );
+ } else {
+ // filter out child rows
+ $rows = $rows.not( '.' + c.cssChildRow );
+ len = $rows.length;
+
+ if ( ( wo.filter_$anyMatch && wo.filter_$anyMatch.length ) ||
+ typeof filters[c.columns] !== 'undefined' ) {
+ data.anyMatchFlag = true;
+ data.anyMatchFilter = '' + (
+ filters[ c.columns ] ||
+ wo.filter_$anyMatch && tsf.getLatestSearch( wo.filter_$anyMatch ).val() ||
+ ''
+ );
+ if ( wo.filter_columnAnyMatch ) {
+ // specific columns search
+ query = data.anyMatchFilter.split( tsfRegex.andSplit );
+ injected = false;
+ for ( indx = 0; indx < query.length; indx++ ) {
+ res = query[ indx ].split( ':' );
+ if ( res.length > 1 ) {
+ // make the column a one-based index ( non-developers start counting from one :P )
+ if ( isNaN( res[0] ) ) {
+ $.each( c.headerContent, function( i, txt ) {
+ // multiple matches are possible
+ if ( txt.toLowerCase().indexOf( res[0] ) > -1 ) {
+ id = i;
+ filters[ id ] = res[1];
+ }
+ });
+ } else {
+ id = parseInt( res[0], 10 ) - 1;
+ }
+ if ( id >= 0 && id < c.columns ) { // if id is an integer
+ filters[ id ] = res[1];
+ query.splice( indx, 1 );
+ indx--;
+ injected = true;
+ }
+ }
+ }
+ if ( injected ) {
+ data.anyMatchFilter = query.join( ' && ' );
+ }
+ }
+ }
+
+ // optimize searching only through already filtered rows - see #313
+ searchFiltered = wo.filter_searchFiltered;
+ lastSearch = c.lastSearch || c.$table.data( 'lastSearch' ) || [];
+ if ( searchFiltered ) {
+ // cycle through all filters; include last ( columnIndex + 1 = match any column ). Fixes #669
+ for ( indx = 0; indx < columnIndex + 1; indx++ ) {
+ val = filters[indx] || '';
+ // break out of loop if we've already determined not to search filtered rows
+ if ( !searchFiltered ) { indx = columnIndex; }
+ // search already filtered rows if...
+ searchFiltered = searchFiltered && lastSearch.length &&
+ // there are no changes from beginning of filter
+ val.indexOf( lastSearch[indx] || '' ) === 0 &&
+ // if there is NOT a logical 'or', or range ( 'to' or '-' ) in the string
+ !tsfRegex.alreadyFiltered.test( val ) &&
+ // if we are not doing exact matches, using '|' ( logical or ) or not '!'
+ !tsfRegex.exactTest.test( val ) &&
+ // don't search only filtered if the value is negative
+ // ( '> -10' => '> -100' will ignore hidden rows )
+ !( tsfRegex.isNeg1.test( val ) || tsfRegex.isNeg2.test( val ) ) &&
+ // if filtering using a select without a 'filter-match' class ( exact match ) - fixes #593
+ !( val !== '' && c.$filters && c.$filters.filter( '[data-column="' + indx + '"]' ).find( 'select' ).length &&
+ !tsf.matchType( c, indx ) );
+ }
+ }
+ notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
+ // can't search when all rows are hidden - this happens when looking for exact matches
+ if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
+ if ( debug ) {
+ console.log( 'Filter >> Searching through ' +
+ ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
+ }
+ if ( data.anyMatchFlag ) {
+ if ( c.sortLocaleCompare ) {
+ // replace accents
+ data.anyMatchFilter = ts.replaceAccents( data.anyMatchFilter );
+ }
+ if ( wo.filter_defaultFilter && tsfRegex.iQuery.test( vars.defaultAnyFilter ) ) {
+ data.anyMatchFilter = tsf.defaultFilter( data.anyMatchFilter, vars.defaultAnyFilter );
+ // clear search filtered flag because default filters are not saved to the last search
+ searchFiltered = false;
+ }
+ // make iAnyMatchFilter lowercase unless both filter widget & core ignoreCase options are true
+ // when c.ignoreCase is true, the cache contains all lower case data
+ data.iAnyMatchFilter = !( wo.filter_ignoreCase && c.ignoreCase ) ?
+ data.anyMatchFilter :
+ data.anyMatchFilter.toLowerCase();
+ }
+
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+
+ txt = $rows[ rowIndex ].className;
+ // the first row can never be a child row
+ isChild = rowIndex && tsfRegex.child.test( txt );
+ // skip child rows & already filtered rows
+ if ( isChild || ( searchFiltered && tsfRegex.filtered.test( txt ) ) ) {
+ continue;
+ }
+
+ data.$row = $rows.eq( rowIndex );
+ data.rowIndex = rowIndex;
+ data.cacheArray = norm_rows[ rowIndex ];
+ rowData = data.cacheArray[ c.columns ];
+ data.rawArray = rowData.raw;
+ data.childRowText = '';
+
+ if ( !wo.filter_childByColumn ) {
+ txt = '';
+ // child row cached text
+ childRow = rowData.child;
+ // so, if 'table.config.widgetOptions.filter_childRows' is true and there is
+ // a match anywhere in the child row, then it will make the row visible
+ // checked here so the option can be changed dynamically
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ txt += ' ' + childRow[indx].join( ' ' ) || '';
+ }
+ data.childRowText = wo.filter_childRows ?
+ ( wo.filter_ignoreCase ? txt.toLowerCase() : txt ) :
+ '';
+ }
+
+ showRow = false;
+ showParent = tsf.processRow( c, data, vars );
+ $row = rowData.$row;
+
+ // don't pass reference to val
+ val = showParent ? true : false;
+ childRow = rowData.$row.filter( ':gt(0)' );
+ if ( wo.filter_childRows && childRow.length ) {
+ if ( wo.filter_childByColumn ) {
+ if ( !wo.filter_childWithSibs ) {
+ // hide all child rows
+ childRow.addClass( wo.filter_filteredRow );
+ // if only showing resulting child row, only include parent
+ $row = $row.eq( 0 );
+ }
+ // cycle through each child row
+ for ( indx = 0; indx < childRow.length; indx++ ) {
+ data.$row = childRow.eq( indx );
+ data.cacheArray = rowData.child[ indx ];
+ data.rawArray = data.cacheArray;
+ val = tsf.processRow( c, data, vars );
+ // use OR comparison on child rows
+ showRow = showRow || val;
+ if ( !wo.filter_childWithSibs && val ) {
+ childRow.eq( indx ).removeClass( wo.filter_filteredRow );
+ }
+ }
+ }
+ // keep parent row match even if no child matches... see #1020
+ showRow = showRow || showParent;
+ } else {
+ showRow = val;
+ }
+ $row
+ .toggleClass( wo.filter_filteredRow, !showRow )[0]
+ .display = showRow ? '' : 'none';
+ }
+ }
+ c.filteredRows += $rows.not( '.' + wo.filter_filteredRow ).length;
+ c.totalRows += $rows.length;
+ ts.processTbody( table, $tbody, false );
+ }
+ // lastCombinedFilter is no longer used internally
+ c.lastCombinedFilter = storedFilters.join(''); // save last search
+ // don't save 'filters' directly since it may have altered ( AnyMatch column searches )
+ c.lastSearch = storedFilters;
+ c.$table.data( 'lastSearch', storedFilters );
+ if ( wo.filter_saveFilters && ts.storage ) {
+ ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
+ }
+ if ( debug ) {
+ console.log( 'Filter >> Completed search' + ts.benchmark(time) );
+ }
+ if ( wo.filter_initialized ) {
+ c.$table.triggerHandler( 'filterBeforeEnd', c );
+ c.$table.triggerHandler( 'filterEnd', c );
+ }
+ setTimeout( function() {
+ ts.applyWidget( c.table ); // make sure zebra widget is applied
+ }, 0 );
+ },
+ getOptionSource: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var c = table.config,
+ wo = c.widgetOptions,
+ arry = false,
+ source = wo.filter_selectSource,
+ last = c.$table.data( 'lastSearch' ) || [],
+ fxn = typeof source === 'function' ? true : ts.getColumnData( table, source, column );
+
+ if ( onlyAvail && last[column] !== '' ) {
+ onlyAvail = false;
+ }
+
+ // filter select source option
+ if ( fxn === true ) {
+ // OVERALL source
+ arry = source( table, column, onlyAvail );
+ } else if ( fxn instanceof $ || ( $.type( fxn ) === 'string' && fxn.indexOf( '</option>' ) >= 0 ) ) {
+ // selectSource is a jQuery object or string of options
+ return fxn;
+ } else if ( $.isArray( fxn ) ) {
+ arry = fxn;
+ } else if ( $.type( source ) === 'object' && fxn ) {
+ // custom select source function for a SPECIFIC COLUMN
+ arry = fxn( table, column, onlyAvail );
+ // abort - updating the selects from an external method
+ if (arry === null) {
+ return null;
+ }
+ }
+ if ( arry === false ) {
+ // fall back to original method
+ arry = tsf.getOptions( table, column, onlyAvail );
+ }
+
+ return tsf.processOptions( table, column, arry );
+
+ },
+ processOptions: function( table, column, arry ) {
+ if ( !$.isArray( arry ) ) {
+ return false;
+ }
+ table = $( table )[0];
+ var cts, txt, indx, len, parsedTxt, str,
+ c = table.config,
+ validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
+ direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
+ parsed = [];
+ // get unique elements and sort the list
+ // if $.tablesorter.sortText exists ( not in the original tablesorter ),
+ // then natural sort the list otherwise use a basic sort
+ arry = $.grep( arry, function( value, indx ) {
+ if ( value.text ) {
+ return true;
+ }
+ return $.inArray( value, arry ) === indx;
+ });
+ if ( validColumn && c.$headerIndexed[ column ].hasClass( 'filter-select-nosort' ) ) {
+ // unsorted select options
+ return arry;
+ } else {
+ len = arry.length;
+ // parse select option values
+ for ( indx = 0; indx < len; indx++ ) {
+ txt = arry[ indx ];
+ // check for object
+ str = txt.text ? txt.text : txt;
+ // sortNatural breaks if you don't pass it strings
+ parsedTxt = ( validColumn && c.parsers && c.parsers.length &&
+ c.parsers[ column ].format( str, table, [], column ) || str ).toString();
+ parsedTxt = c.widgetOptions.filter_ignoreCase ? parsedTxt.toLowerCase() : parsedTxt;
+ // parse array data using set column parser; this DOES NOT pass the original
+ // table cell to the parser format function
+ if ( txt.text ) {
+ txt.parsed = parsedTxt;
+ parsed[ parsed.length ] = txt;
+ } else {
+ parsed[ parsed.length ] = {
+ text : txt,
+ // check parser length - fixes #934
+ parsed : parsedTxt
+ };
+ }
+ }
+ // sort parsed select options
+ cts = c.textSorter || '';
+ parsed.sort( function( a, b ) {
+ var x = direction ? b.parsed : a.parsed,
+ y = direction ? a.parsed : b.parsed;
+ if ( validColumn && typeof cts === 'function' ) {
+ // custom OVERALL text sorter
+ return cts( x, y, true, column, table );
+ } else if ( validColumn && typeof cts === 'object' && cts.hasOwnProperty( column ) ) {
+ // custom text sorter for a SPECIFIC COLUMN
+ return cts[column]( x, y, true, column, table );
+ } else if ( ts.sortNatural ) {
+ // fall back to natural sort
+ return ts.sortNatural( x, y );
+ }
+ // using an older version! do a basic sort
+ return true;
+ });
+ // rebuild arry from sorted parsed data
+ arry = [];
+ len = parsed.length;
+ for ( indx = 0; indx < len; indx++ ) {
+ arry[ arry.length ] = parsed[indx];
+ }
+ return arry;
+ }
+ },
+ getOptions: function( table, column, onlyAvail ) {
+ table = $( table )[0];
+ var rowIndex, tbodyIndex, len, row, cache, indx, child, childLen,
+ c = table.config,
+ wo = c.widgetOptions,
+ arry = [];
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
+ cache = c.cache[tbodyIndex];
+ len = c.cache[tbodyIndex].normalized.length;
+ // loop through the rows
+ for ( rowIndex = 0; rowIndex < len; rowIndex++ ) {
+ // get cached row from cache.row ( old ) or row data object
+ // ( new; last item in normalized array )
+ row = cache.row ?
+ cache.row[ rowIndex ] :
+ cache.normalized[ rowIndex ][ c.columns ].$row[0];
+ // check if has class filtered
+ if ( onlyAvail && row.className.match( wo.filter_filteredRow ) ) {
+ continue;
+ }
+ // get non-normalized cell content
+ if ( wo.filter_useParsedData ||
+ c.parsers[column].parsed ||
+ c.$headerIndexed[column].hasClass( 'filter-parsed' ) ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ column ];
+ // child row parsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length - 1;
+ for ( indx = 0; indx < childLen; indx++ ) {
+ arry[ arry.length ] = '' + cache.normalized[ rowIndex ][ c.columns ].child[ indx ][ column ];
+ }
+ }
+ } else {
+ // get raw cached data instead of content directly from the cells
+ arry[ arry.length ] = cache.normalized[ rowIndex ][ c.columns ].raw[ column ];
+ // child row unparsed data
+ if ( wo.filter_childRows && wo.filter_childByColumn ) {
+ childLen = cache.normalized[ rowIndex ][ c.columns ].$row.length;
+ for ( indx = 1; indx < childLen; indx++ ) {
+ child = cache.normalized[ rowIndex ][ c.columns ].$row.eq( indx ).children().eq( column );
+ arry[ arry.length ] = '' + ts.getElementText( c, child, column );
+ }
+ }
+ }
+ }
+ }
+ return arry;
+ },
+ buildSelect: function( table, column, arry, updating, onlyAvail ) {
+ table = $( table )[0];
+ column = parseInt( column, 10 );
+ if ( !table.config.cache || $.isEmptyObject( table.config.cache ) ) {
+ return;
+ }
+
+ var indx, val, txt, t, $filters, $filter, option,
+ c = table.config,
+ wo = c.widgetOptions,
+ node = c.$headerIndexed[ column ],
+ // t.data( 'placeholder' ) won't work in jQuery older than 1.4.3
+ options = '<option value="">' +
+ ( node.data( 'placeholder' ) ||
+ node.attr( 'data-placeholder' ) ||
+ wo.filter_placeholder.select || ''
+ ) + '</option>',
+ // Get curent filter value
+ currentValue = c.$table
+ .find( 'thead' )
+ .find( 'select.' + tscss.filter + '[data-column="' + column + '"]' )
+ .val();
+
+ // nothing included in arry ( external source ), so get the options from
+ // filter_selectSource or column data
+ if ( typeof arry === 'undefined' || arry === '' ) {
+ arry = tsf.getOptionSource( table, column, onlyAvail );
+ // abort, selects are updated by an external method
+ if (arry === null) {
+ return;
+ }
+ }
+
+ if ( $.isArray( arry ) ) {
+ // build option list
+ for ( indx = 0; indx < arry.length; indx++ ) {
+ option = arry[ indx ];
+ if ( option.text ) {
+ // OBJECT!! add data-function-name in case the value is set in filter_functions
+ option['data-function-name'] = typeof option.value === 'undefined' ? option.text : option.value;
+
+ // support jQuery < v1.8, otherwise the below code could be shortened to
+ // options += $( '<option>', option )[ 0 ].outerHTML;
+ options += '<option';
+ for ( val in option ) {
+ if ( option.hasOwnProperty( val ) && val !== 'text' ) {
+ options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ }
+ if ( !option.value ) {
+ options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
+ }
+ options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
+ // above code is needed in jQuery < v1.8
+
+ // make sure we don't turn an object into a string (objects without a "text" property)
+ } else if ( '' + option !== '[object Object]' ) {
+ txt = option = ( '' + option ).replace( tsfRegex.quote, '&quot;' );
+ val = txt;
+ // allow including a symbol in the selectSource array
+ // 'a-z|A through Z' so that 'a-z' becomes the option value
+ // and 'A through Z' becomes the option text
+ if ( txt.indexOf( wo.filter_selectSourceSeparator ) >= 0 ) {
+ t = txt.split( wo.filter_selectSourceSeparator );
+ val = t[0];
+ txt = t[1];
+ }
+ // replace quotes - fixes #242 & ignore empty strings
+ // see http://stackoverflow.com/q/14990971/145346
+ options += option !== '' ?
+ '<option ' +
+ ( val === txt ? '' : 'data-function-name="' + option + '" ' ) +
+ 'value="' + val + '">' + txt +
+ '</option>' : '';
+ }
+ }
+ // clear arry so it doesn't get appended twice
+ arry = [];
+ }
+
+ // update all selects in the same column ( clone thead in sticky headers &
+ // any external selects ) - fixes 473
+ $filters = ( c.$filters ? c.$filters : c.$table.children( 'thead' ) )
+ .find( '.' + tscss.filter );
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ $filter = $filters.filter( 'select[data-column="' + column + '"]' );
+
+ // make sure there is a select there!
+ if ( $filter.length ) {
+ $filter[ updating ? 'html' : 'append' ]( options );
+ if ( !$.isArray( arry ) ) {
+ // append options if arry is provided externally as a string or jQuery object
+ // options ( default value ) was already added
+ $filter.append( arry ).val( currentValue );
+ }
+ $filter.val( currentValue );
+ }
+ },
+ buildDefault: function( table, updating ) {
+ var columnIndex, $header, noSelect,
+ c = table.config,
+ wo = c.widgetOptions,
+ columns = c.columns;
+ // build default select dropdown
+ for ( columnIndex = 0; columnIndex < columns; columnIndex++ ) {
+ $header = c.$headerIndexed[columnIndex];
+ noSelect = !( $header.hasClass( 'filter-false' ) || $header.hasClass( 'parser-false' ) );
+ // look for the filter-select class; build/update it if found
+ if ( ( $header.hasClass( 'filter-select' ) ||
+ ts.getColumnData( table, wo.filter_functions, columnIndex ) === true ) && noSelect ) {
+ tsf.buildSelect( table, columnIndex, '', updating, $header.hasClass( wo.filter_onlyAvail ) );
+ }
+ }
+ }
+ };
+
+ // filter regex variable
+ tsfRegex = tsf.regex;
+
+ ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
+ var i, $filters, $column, cols,
+ filters = [],
+ c = table ? $( table )[0].config : '',
+ wo = c ? c.widgetOptions : '';
+ if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
+ // setFilters called, but last search is exactly the same as the current
+ // fixes issue #733 & #903 where calling update causes the input values to reset
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
+ ) {
+ return $( table ).data( 'lastSearch' ) || [];
+ }
+ if ( c ) {
+ if ( c.$filters ) {
+ $filters = c.$filters.find( '.' + tscss.filter );
+ }
+ if ( wo.filter_$externalFilters ) {
+ $filters = $filters && $filters.length ?
+ $filters.add( wo.filter_$externalFilters ) :
+ wo.filter_$externalFilters;
+ }
+ if ( $filters && $filters.length ) {
+ filters = setFilters || [];
+ for ( i = 0; i < c.columns + 1; i++ ) {
+ cols = ( i === c.columns ?
+ // 'all' columns can now include a range or set of columms ( data-column='0-2,4,6-7' )
+ wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector :
+ '[data-column="' + i + '"]' );
+ $column = $filters.filter( cols );
+ if ( $column.length ) {
+ // move the latest search to the first slot in the array
+ $column = tsf.getLatestSearch( $column );
+ if ( $.isArray( setFilters ) ) {
+ // skip first ( latest input ) to maintain cursor position while typing
+ if ( skipFirst && $column.length > 1 ) {
+ $column = $column.slice( 1 );
+ }
+ if ( i === c.columns ) {
+ // prevent data-column='all' from filling data-column='0,1' ( etc )
+ cols = $column.filter( wo.filter_anyColumnSelector );
+ $column = cols.length ? cols : $column;
+ }
+ $column
+ .val( setFilters[ i ] )
+ // must include a namespace here; but not c.namespace + 'filter'?
+ .trigger( 'change' + c.namespace );
+ } else {
+ filters[i] = $column.val() || '';
+ // don't change the first... it will move the cursor
+ if ( i === c.columns ) {
+ // don't update range columns from 'all' setting
+ $column
+ .slice( 1 )
+ .filter( '[data-column*="' + $column.attr( 'data-column' ) + '"]' )
+ .val( filters[ i ] );
+ } else {
+ $column
+ .slice( 1 )
+ .val( filters[ i ] );
+ }
+ }
+ // save any match input dynamically
+ if ( i === c.columns && $column.length ) {
+ wo.filter_$anyMatch = $column;
+ }
+ }
+ }
+ }
+ }
+ return filters;
+ };
+
+ ts.setFilters = function( table, filter, apply, skipFirst ) {
+ var c = table ? $( table )[0].config : '',
+ valid = ts.getFilters( table, true, filter, skipFirst );
+ // default apply to "true"
+ if ( typeof apply === 'undefined' ) {
+ apply = true;
+ }
+ if ( c && apply ) {
+ // ensure new set filters are applied, even if the search is the same
+ c.lastCombinedFilter = null;
+ c.lastSearch = [];
+ tsf.searching( c.table, filter, skipFirst );
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
+ }
+ return valid.length !== 0;
+ };
+
+})( jQuery );
+
+/*! Widget: stickyHeaders - updated 9/27/2017 (v2.29.0) *//*
+ * Requires tablesorter v2.8+ and jQuery 1.4.3+
+ * by Rob Garrison
+ */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ sticky : 'tablesorter-stickyHeader', // stickyHeader
+ stickyVis : 'tablesorter-sticky-visible',
+ stickyHide: 'tablesorter-sticky-hidden',
+ stickyWrap: 'tablesorter-sticky-wrapper'
+ });
+
+ // Add a resize event to table headers
+ ts.addHeaderResizeEvent = function(table, disable, settings) {
+ table = $(table)[0]; // make sure we're using a dom element
+ if ( !table.config ) { return; }
+ var defaults = {
+ timer : 250
+ },
+ options = $.extend({}, defaults, settings),
+ c = table.config,
+ wo = c.widgetOptions,
+ checkSizes = function( triggerEvent ) {
+ var index, headers, $header, sizes, width, height,
+ len = c.$headers.length;
+ wo.resize_flag = true;
+ headers = [];
+ for ( index = 0; index < len; index++ ) {
+ $header = c.$headers.eq( index );
+ sizes = $header.data( 'savedSizes' ) || [ 0, 0 ]; // fixes #394
+ width = $header[0].offsetWidth;
+ height = $header[0].offsetHeight;
+ if ( width !== sizes[0] || height !== sizes[1] ) {
+ $header.data( 'savedSizes', [ width, height ] );
+ headers.push( $header[0] );
+ }
+ }
+ if ( headers.length && triggerEvent !== false ) {
+ c.$table.triggerHandler( 'resize', [ headers ] );
+ }
+ wo.resize_flag = false;
+ };
+ clearInterval(wo.resize_timer);
+ if (disable) {
+ wo.resize_flag = false;
+ return false;
+ }
+ checkSizes( false );
+ wo.resize_timer = setInterval(function() {
+ if (wo.resize_flag) { return; }
+ checkSizes();
+ }, options.timer);
+ };
+
+ function getStickyOffset(c, wo) {
+ var $el = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : [];
+ return $el.length ?
+ $el.height() || 0 :
+ parseInt(wo.stickyHeaders_offset, 10) || 0;
+ }
+
+ // Sticky headers based on this awesome article:
+ // http://css-tricks.com/13465-persistent-headers/
+ // and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech
+ // **************************
+ ts.addWidget({
+ id: 'stickyHeaders',
+ priority: 54, // sticky widget must be initialized after the filter & before pager widget!
+ options: {
+ stickyHeaders : '', // extra class name added to the sticky header row
+ stickyHeaders_appendTo : null, // jQuery selector or object to phycially attach the sticky headers
+ stickyHeaders_attachTo : null, // jQuery selector or object to attach scroll listener to (overridden by xScroll & yScroll settings)
+ stickyHeaders_xScroll : null, // jQuery selector or object to monitor horizontal scroll position (defaults: xScroll > attachTo > window)
+ stickyHeaders_yScroll : null, // jQuery selector or object to monitor vertical scroll position (defaults: yScroll > attachTo > window)
+ stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
+ stickyHeaders_filteredToTop: true, // scroll table top into view after filtering
+ stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists
+ stickyHeaders_addResizeEvent : true, // trigger 'resize' event on headers
+ stickyHeaders_includeCaption : true, // if false and a caption exist, it won't be included in the sticky header
+ stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs
+ },
+ format: function(table, c, wo) {
+ // filter widget doesn't initialize on an empty table. Fixes #449
+ if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) {
+ return;
+ }
+ var index, len, $t,
+ $table = c.$table,
+ // add position: relative to attach element, hopefully it won't cause trouble.
+ $attach = $(wo.stickyHeaders_attachTo || wo.stickyHeaders_appendTo),
+ namespace = c.namespace + 'stickyheaders ',
+ // element to watch for the scroll event
+ $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window),
+ $xScroll = $(wo.stickyHeaders_xScroll || wo.stickyHeaders_attachTo || window),
+ $thead = $table.children('thead:first'),
+ $header = $thead.children('tr').not('.sticky-false').children(),
+ $tfoot = $table.children('tfoot'),
+ stickyOffset = getStickyOffset(c, wo),
+ // is this table nested? If so, find parent sticky header wrapper (div, not table)
+ $nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ?
+ $table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [],
+ 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 + ' ' + c.namespace.slice(1) + '_extra_table' )
+ .wrap('<div class="' + ts.css.stickyWrap + '">'),
+ $stickyWrap = $stickyTable.parent()
+ .addClass(ts.css.stickyHide)
+ .css({
+ position : $attach.length ? 'absolute' : 'fixed',
+ padding : parseInt( $stickyTable.parent().parent().css('padding-left'), 10 ),
+ top : stickyOffset + nestedStickyTop,
+ left : 0,
+ visibility : 'hidden',
+ zIndex : wo.stickyHeaders_zIndex || 2
+ }),
+ $stickyThead = $stickyTable.children('thead:first'),
+ $stickyCells,
+ laststate = '',
+ setWidth = function($orig, $clone) {
+ var index, width, border, $cell, $this,
+ $cells = $orig.filter(':visible'),
+ len = $cells.length;
+ for ( index = 0; index < len; index++ ) {
+ $cell = $clone.filter(':visible').eq(index);
+ $this = $cells.eq(index);
+ // code from https://github.com/jmosbech/StickyTableHeaders
+ if ($this.css('box-sizing') === 'border-box') {
+ width = $this.outerWidth();
+ } else {
+ if ($cell.css('border-collapse') === 'collapse') {
+ if (window.getComputedStyle) {
+ width = parseFloat( window.getComputedStyle($this[0], null).width );
+ } else {
+ // ie8 only
+ border = parseFloat( $this.css('border-width') );
+ width = $this.outerWidth() - parseFloat( $this.css('padding-left') ) - parseFloat( $this.css('padding-right') ) - border;
+ }
+ } else {
+ width = $this.width();
+ }
+ }
+ $cell.css({
+ 'width': width,
+ 'min-width': width,
+ 'max-width': width
+ });
+ }
+ },
+ getLeftPosition = function(yWindow) {
+ if (yWindow === false && $nestedSticky.length) {
+ return $table.position().left;
+ }
+ return $attach.length ?
+ parseInt($attach.css('padding-left'), 10) || 0 :
+ $table.offset().left - parseInt($table.css('margin-left'), 10) - $(window).scrollLeft();
+ },
+ resizeHeader = function() {
+ $stickyWrap.css({
+ left : getLeftPosition(),
+ width: $table.outerWidth()
+ });
+ setWidth( $table, $stickyTable );
+ setWidth( $header, $stickyCells );
+ },
+ scrollSticky = function( resizing ) {
+ if (!$table.is(':visible')) { return; } // fixes #278
+ // Detect nested tables - fixes #724
+ nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
+ var tmp,
+ offset = $table.offset(),
+ stickyOffset = getStickyOffset(c, wo),
+ yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3
+ yScroll = yWindow ?
+ $yScroll.scrollTop() :
+ // use parent sticky position if nested AND inside of a scrollable element - see #1512
+ $nestedSticky.length ? parseInt($nestedSticky[0].style.top, 10) : $yScroll.offset().top,
+ attachTop = $attach.length ? yScroll : $yScroll.scrollTop(),
+ captionHeight = wo.stickyHeaders_includeCaption ? 0 : $table.children( 'caption' ).height() || 0,
+ scrollTop = attachTop + stickyOffset + nestedStickyTop - captionHeight,
+ tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)) - captionHeight,
+ isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden',
+ state = isVisible === 'visible' ? ts.css.stickyVis : ts.css.stickyHide,
+ needsUpdating = !$stickyWrap.hasClass( state ),
+ cssSettings = { visibility : isVisible };
+ if ($attach.length) {
+ // attached sticky headers always need updating
+ needsUpdating = true;
+ cssSettings.top = yWindow ? scrollTop - $attach.offset().top : $attach.scrollTop();
+ }
+ // adjust when scrolling horizontally - fixes issue #143
+ tmp = getLeftPosition(yWindow);
+ if (tmp !== parseInt($stickyWrap.css('left'), 10)) {
+ needsUpdating = true;
+ cssSettings.left = tmp;
+ }
+ cssSettings.top = ( cssSettings.top || 0 ) +
+ // If nested AND inside of a scrollable element, only add parent sticky height
+ (!yWindow && $nestedSticky.length ? $nestedSticky.height() : stickyOffset + nestedStickyTop);
+ if (needsUpdating) {
+ $stickyWrap
+ .removeClass( ts.css.stickyVis + ' ' + ts.css.stickyHide )
+ .addClass( state )
+ .css(cssSettings);
+ }
+ if (isVisible !== laststate || resizing) {
+ // make sure the column widths match
+ resizeHeader();
+ laststate = isVisible;
+ }
+ };
+ // only add a position relative if a position isn't already defined
+ if ($attach.length && !$attach.css('position')) {
+ $attach.css('position', 'relative');
+ }
+ // 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
+ // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing
+ $stickyTable.find('> thead:gt(0), tr.sticky-false').hide();
+ $stickyTable.find('> tbody, > tfoot').remove();
+ $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption);
+ // issue #172 - find td/th in sticky header
+ $stickyCells = $stickyThead.children().children();
+ $stickyTable.css({ height:0, width:0, margin: 0 });
+ // remove resizable block
+ $stickyCells.find('.' + ts.css.resizer).remove();
+ // update sticky header class names to match real header after sorting
+ $table
+ .addClass('hasStickyHeaders')
+ .bind('pagerComplete' + namespace, function() {
+ resizeHeader();
+ });
+
+ ts.bindEvents(table, $stickyThead.children().children('.' + ts.css.header));
+
+ if (wo.stickyHeaders_appendTo) {
+ $(wo.stickyHeaders_appendTo).append( $stickyWrap );
+ } else {
+ // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
+ $table.after( $stickyWrap );
+ }
+
+ // onRenderHeader is defined, we need to do something about it (fixes #641)
+ if (c.onRenderHeader) {
+ $t = $stickyThead.children('tr').children();
+ len = $t.length;
+ for ( index = 0; index < len; index++ ) {
+ // send second parameter
+ c.onRenderHeader.apply( $t.eq( index ), [ index, c, $stickyTable ] );
+ }
+ }
+ // make it sticky!
+ $xScroll.add($yScroll)
+ .unbind( ('scroll resize '.split(' ').join( namespace )).replace(/\s+/g, ' ') )
+ .bind('scroll resize '.split(' ').join( namespace ), function( event ) {
+ scrollSticky( event.type === 'resize' );
+ });
+ c.$table
+ .unbind('stickyHeadersUpdate' + namespace)
+ .bind('stickyHeadersUpdate' + namespace, function() {
+ scrollSticky( true );
+ });
+
+ if (wo.stickyHeaders_addResizeEvent) {
+ ts.addHeaderResizeEvent(table);
+ }
+
+ // look for filter widget
+ if ($table.hasClass('hasFilters') && wo.filter_columnFilters) {
+ // scroll table into view after filtering, if sticky header is active - #482
+ $table.bind('filterEnd' + namespace, function() {
+ // $(':focus') needs jQuery 1.6+
+ var $td = $(document.activeElement).closest('td'),
+ column = $td.parent().children().index($td);
+ // only scroll if sticky header is active
+ if ($stickyWrap.hasClass(ts.css.stickyVis) && wo.stickyHeaders_filteredToTop) {
+ // scroll to original table (not sticky clone)
+ window.scrollTo(0, $table.position().top);
+ // give same input/select focus; check if c.$filters exists; fixes #594
+ if (column >= 0 && c.$filters) {
+ c.$filters.eq(column).find('a, select, input').filter(':visible').focus();
+ }
+ }
+ });
+ ts.filter.bindSearch( $table, $stickyCells.find('.' + ts.css.filter) );
+ // support hideFilters
+ if (wo.filter_hideFilters) {
+ ts.filter.hideFilters(c, $stickyTable);
+ }
+ }
+
+ // resize table (Firefox)
+ if (wo.stickyHeaders_addResizeEvent) {
+ $table.bind('resize' + c.namespace + 'stickyheaders', function() {
+ resizeHeader();
+ });
+ }
+
+ // make sure sticky is visible if page is partially scrolled
+ scrollSticky( true );
+ $table.triggerHandler('stickyHeadersInit');
+
+ },
+ remove: function(table, c, wo) {
+ var namespace = c.namespace + 'stickyheaders ';
+ c.$table
+ .removeClass('hasStickyHeaders')
+ .unbind( ('pagerComplete resize filterEnd stickyHeadersUpdate '.split(' ').join(namespace)).replace(/\s+/g, ' ') )
+ .next('.' + ts.css.stickyWrap).remove();
+ if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
+ $(window)
+ .add(wo.stickyHeaders_xScroll)
+ .add(wo.stickyHeaders_yScroll)
+ .add(wo.stickyHeaders_attachTo)
+ .unbind( ('scroll resize '.split(' ').join(namespace)).replace(/\s+/g, ' ') );
+ ts.addHeaderResizeEvent(table, true);
+ }
+ });
+
+})(jQuery, window);
+
+/*! Widget: resizable - updated 2018-03-26 (v2.30.2) */
+/*jshint browser:true, jquery:true, unused:false */
+;(function ($, window) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ $.extend(ts.css, {
+ resizableContainer : 'tablesorter-resizable-container',
+ resizableHandle : 'tablesorter-resizable-handle',
+ resizableNoSelect : 'tablesorter-disableSelection',
+ resizableStorage : 'tablesorter-resizable'
+ });
+
+ // Add extra scroller css
+ $(function() {
+ var s = '<style>' +
+ 'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
+ '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
+ '.' + ts.css.resizableContainer + ' { position: relative; height: 1px; }' +
+ // make handle z-index > than stickyHeader z-index, so the handle stays above sticky header
+ '.' + ts.css.resizableHandle + ' { position: absolute; display: inline-block; width: 8px;' +
+ 'top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }' +
+ '</style>';
+ $('head').append(s);
+ });
+
+ ts.resizable = {
+ init : function( c, wo ) {
+ if ( c.$table.hasClass( 'hasResizable' ) ) { return; }
+ c.$table.addClass( 'hasResizable' );
+
+ var noResize, $header, column, storedSizes, tmp,
+ $table = c.$table,
+ $parent = $table.parent(),
+ marginTop = parseInt( $table.css( 'margin-top' ), 10 ),
+
+ // internal variables
+ vars = wo.resizable_vars = {
+ useStorage : ts.storage && wo.resizable !== false,
+ $wrap : $parent,
+ mouseXPosition : 0,
+ $target : null,
+ $next : null,
+ overflow : $parent.css('overflow') === 'auto' ||
+ $parent.css('overflow') === 'scroll' ||
+ $parent.css('overflow-x') === 'auto' ||
+ $parent.css('overflow-x') === 'scroll',
+ storedSizes : []
+ };
+
+ // set default widths
+ ts.resizableReset( c.table, true );
+
+ // now get measurements!
+ vars.tableWidth = $table.width();
+ // attempt to autodetect
+ vars.fullWidth = Math.abs( $parent.width() - vars.tableWidth ) < 20;
+
+ /*
+ // Hacky method to determine if table width is set to 'auto'
+ // http://stackoverflow.com/a/20892048/145346
+ if ( !vars.fullWidth ) {
+ tmp = $table.width();
+ $header = $table.wrap('<span>').parent(); // temp variable
+ storedSizes = parseInt( $table.css( 'margin-left' ), 10 ) || 0;
+ $table.css( 'margin-left', storedSizes + 50 );
+ vars.tableWidth = $header.width() > tmp ? 'auto' : tmp;
+ $table.css( 'margin-left', storedSizes ? storedSizes : '' );
+ $header = null;
+ $table.unwrap('<span>');
+ }
+ */
+
+ if ( vars.useStorage && vars.overflow ) {
+ // save table width
+ ts.storage( c.table, 'tablesorter-table-original-css-width', vars.tableWidth );
+ tmp = ts.storage( c.table, 'tablesorter-table-resized-width' ) || 'auto';
+ ts.resizable.setWidth( $table, tmp, true );
+ }
+ wo.resizable_vars.storedSizes = storedSizes = ( vars.useStorage ?
+ ts.storage( c.table, ts.css.resizableStorage ) :
+ [] ) || [];
+ ts.resizable.setWidths( c, wo, storedSizes );
+ ts.resizable.updateStoredSizes( c, wo );
+
+ wo.$resizable_container = $( '<div class="' + ts.css.resizableContainer + '">' )
+ .css({ top : marginTop })
+ .insertBefore( $table );
+ // add container
+ for ( column = 0; column < c.columns; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ tmp = ts.getColumnData( c.table, c.headers, column );
+ noResize = ts.getData( $header, tmp, 'resizable' ) === 'false';
+ if ( !noResize ) {
+ $( '<div class="' + ts.css.resizableHandle + '">' )
+ .appendTo( wo.$resizable_container )
+ .attr({
+ 'data-column' : column,
+ 'unselectable' : 'on'
+ })
+ .data( 'header', $header )
+ .bind( 'selectstart', false );
+ }
+ }
+ ts.resizable.bindings( c, wo );
+ },
+
+ updateStoredSizes : function( c, wo ) {
+ var column, $header,
+ len = c.columns,
+ vars = wo.resizable_vars;
+ vars.storedSizes = [];
+ for ( column = 0; column < len; column++ ) {
+ $header = c.$headerIndexed[ column ];
+ vars.storedSizes[ column ] = $header.is(':visible') ? $header.width() : 0;
+ }
+ },
+
+ setWidth : function( $el, width, overflow ) {
+ // overflow tables need min & max width set as well
+ $el.css({
+ 'width' : width,
+ 'min-width' : overflow ? width : '',
+ 'max-width' : overflow ? width : ''
+ });
+ },
+
+ setWidths : function( c, wo, storedSizes ) {
+ var column, $temp,
+ vars = wo.resizable_vars,
+ $extra = $( c.namespace + '_extra_headers' ),
+ $col = c.$table.children( 'colgroup' ).children( 'col' );
+ storedSizes = storedSizes || vars.storedSizes || [];
+ // process only if table ID or url match
+ if ( storedSizes.length ) {
+ for ( column = 0; column < c.columns; column++ ) {
+ // set saved resizable widths
+ ts.resizable.setWidth( c.$headerIndexed[ column ], storedSizes[ column ], vars.overflow );
+ if ( $extra.length ) {
+ // stickyHeaders needs to modify min & max width as well
+ $temp = $extra.eq( column ).add( $col.eq( column ) );
+ ts.resizable.setWidth( $temp, storedSizes[ column ], vars.overflow );
+ }
+ }
+ $temp = $( c.namespace + '_extra_table' );
+ if ( $temp.length && !ts.hasWidget( c.table, 'scroller' ) ) {
+ ts.resizable.setWidth( $temp, c.$table.outerWidth(), vars.overflow );
+ }
+ }
+ },
+
+ setHandlePosition : function( c, wo ) {
+ var startPosition,
+ tableHeight = c.$table.height(),
+ $handles = wo.$resizable_container.children(),
+ handleCenter = Math.floor( $handles.width() / 2 );
+
+ if ( ts.hasWidget( c.table, 'scroller' ) ) {
+ tableHeight = 0;
+ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
+ var $this = $(this);
+ // center table has a max-height set
+ tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
+ });
+ }
+
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
+ tableHeight -= c.$table.children('tfoot').height();
+ }
+ // subtract out table left position from resizable handles. Fixes #864
+ // jQuery v3.3.0+ appears to include the start position with the $header.position().left; see #1544
+ startPosition = parseFloat($.fn.jquery) >= 3.3 ? 0 : c.$table.position().left;
+ $handles.each( function() {
+ var $this = $(this),
+ column = parseInt( $this.attr( 'data-column' ), 10 ),
+ columns = c.columns - 1,
+ $header = $this.data( 'header' );
+ if ( !$header ) { return; } // see #859
+ if (
+ !$header.is(':visible') ||
+ ( !wo.resizable_addLastColumn && ts.resizable.checkVisibleColumns(c, column) )
+ ) {
+ $this.hide();
+ } else if ( column < columns || column === columns && wo.resizable_addLastColumn ) {
+ $this.css({
+ display: 'inline-block',
+ height : tableHeight,
+ left : $header.position().left - startPosition + $header.outerWidth() - handleCenter
+ });
+ }
+ });
+ },
+
+ // Fixes #1485
+ checkVisibleColumns: function( c, column ) {
+ var i,
+ len = 0;
+ for ( i = column + 1; i < c.columns; i++ ) {
+ len += c.$headerIndexed[i].is( ':visible' ) ? 1 : 0;
+ }
+ return len === 0;
+ },
+
+ // prevent text selection while dragging resize bar
+ toggleTextSelection : function( c, wo, toggle ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.resizable_vars.disabled = toggle;
+ $( 'body' ).toggleClass( ts.css.resizableNoSelect, toggle );
+ if ( toggle ) {
+ $( 'body' )
+ .attr( 'unselectable', 'on' )
+ .bind( 'selectstart' + namespace, false );
+ } else {
+ $( 'body' )
+ .removeAttr( 'unselectable' )
+ .unbind( 'selectstart' + namespace );
+ }
+ },
+
+ bindings : function( c, wo ) {
+ var namespace = c.namespace + 'tsresize';
+ wo.$resizable_container.children().bind( 'mousedown', function( event ) {
+ // save header cell and mouse position
+ var column,
+ vars = wo.resizable_vars,
+ $extras = $( c.namespace + '_extra_headers' ),
+ $header = $( event.target ).data( 'header' );
+
+ column = parseInt( $header.attr( 'data-column' ), 10 );
+ vars.$target = $header = $header.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.target = column;
+
+ // if table is not as wide as it's parent, then resize the table
+ vars.$next = event.shiftKey || wo.resizable_targetLast ?
+ $header.parent().children().not( '.resizable-false' ).filter( ':last' ) :
+ $header.nextAll( ':not(.resizable-false)' ).eq( 0 );
+
+ column = parseInt( vars.$next.attr( 'data-column' ), 10 );
+ vars.$next = vars.$next.add( $extras.filter('[data-column="' + column + '"]') );
+ vars.next = column;
+
+ vars.mouseXPosition = event.pageX;
+ ts.resizable.updateStoredSizes( c, wo );
+ ts.resizable.toggleTextSelection(c, wo, true );
+ });
+
+ $( document )
+ .bind( 'mousemove' + namespace, function( event ) {
+ var vars = wo.resizable_vars;
+ // ignore mousemove if no mousedown
+ if ( !vars.disabled || vars.mouseXPosition === 0 || !vars.$target ) { return; }
+ if ( wo.resizable_throttle ) {
+ clearTimeout( vars.timer );
+ vars.timer = setTimeout( function() {
+ ts.resizable.mouseMove( c, wo, event );
+ }, isNaN( wo.resizable_throttle ) ? 5 : wo.resizable_throttle );
+ } else {
+ ts.resizable.mouseMove( c, wo, event );
+ }
+ })
+ .bind( 'mouseup' + namespace, function() {
+ if (!wo.resizable_vars.disabled) { return; }
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizable.stopResize( c, wo );
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // resizeEnd event triggered by scroller widget
+ $( window ).bind( 'resize' + namespace + ' resizeEnd' + namespace, function() {
+ ts.resizable.setHandlePosition( c, wo );
+ });
+
+ // right click to reset columns to default widths
+ c.$table
+ .bind( 'columnUpdate pagerComplete resizableUpdate '.split( ' ' ).join( namespace + ' ' ), function() {
+ ts.resizable.setHandlePosition( c, wo );
+ })
+ .bind( 'resizableReset' + namespace, function() {
+ ts.resizableReset( c.table );
+ })
+ .find( 'thead:first' )
+ .add( $( c.namespace + '_extra_table' ).find( 'thead:first' ) )
+ .bind( 'contextmenu' + namespace, function() {
+ // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset
+ var allowClick = wo.resizable_vars.storedSizes.length === 0;
+ ts.resizableReset( c.table );
+ ts.resizable.setHandlePosition( c, wo );
+ wo.resizable_vars.storedSizes = [];
+ return allowClick;
+ });
+
+ },
+
+ mouseMove : function( c, wo, event ) {
+ if ( wo.resizable_vars.mouseXPosition === 0 || !wo.resizable_vars.$target ) { return; }
+ // resize columns
+ var column,
+ total = 0,
+ vars = wo.resizable_vars,
+ $next = vars.$next,
+ tar = vars.storedSizes[ vars.target ],
+ leftEdge = event.pageX - vars.mouseXPosition;
+ if ( vars.overflow ) {
+ if ( tar + leftEdge > 0 ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidth( vars.$target, vars.storedSizes[ vars.target ], true );
+ // update the entire table width
+ for ( column = 0; column < c.columns; column++ ) {
+ total += vars.storedSizes[ column ];
+ }
+ ts.resizable.setWidth( c.$table.add( $( c.namespace + '_extra_table' ) ), total );
+ }
+ if ( !$next.length ) {
+ // if expanding right-most column, scroll the wrapper
+ vars.$wrap[0].scrollLeft = c.$table.width();
+ }
+ } else if ( vars.fullWidth ) {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ vars.storedSizes[ vars.next ] -= leftEdge;
+ ts.resizable.setWidths( c, wo );
+ } else {
+ vars.storedSizes[ vars.target ] += leftEdge;
+ ts.resizable.setWidths( c, wo );
+ }
+ vars.mouseXPosition = event.pageX;
+ // dynamically update sticky header widths
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ },
+
+ stopResize : function( c, wo ) {
+ var vars = wo.resizable_vars;
+ ts.resizable.updateStoredSizes( c, wo );
+ if ( vars.useStorage ) {
+ // save all column widths
+ ts.storage( c.table, ts.css.resizableStorage, vars.storedSizes );
+ ts.storage( c.table, 'tablesorter-table-resized-width', c.$table.width() );
+ }
+ vars.mouseXPosition = 0;
+ vars.$target = vars.$next = null;
+ // will update stickyHeaders, just in case, see #912
+ c.$table.triggerHandler('stickyHeadersUpdate');
+ c.$table.triggerHandler('resizableComplete');
+ }
+ };
+
+ // this widget saves the column widths if
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'resizable',
+ priority: 40,
+ options: {
+ resizable : true, // save column widths to storage
+ resizable_addLastColumn : false,
+ resizable_includeFooter: true,
+ resizable_widths : [],
+ resizable_throttle : false, // set to true (5ms) or any number 0-10 range
+ resizable_targetLast : false
+ },
+ init: function(table, thisWidget, c, wo) {
+ ts.resizable.init( c, wo );
+ },
+ format: function( table, c, wo ) {
+ ts.resizable.setHandlePosition( c, wo );
+ },
+ remove: function( table, c, wo, refreshing ) {
+ if (wo.$resizable_container) {
+ var namespace = c.namespace + 'tsresize';
+ c.$table.add( $( c.namespace + '_extra_table' ) )
+ .removeClass('hasResizable')
+ .children( 'thead' )
+ .unbind( 'contextmenu' + namespace );
+
+ wo.$resizable_container.remove();
+ ts.resizable.toggleTextSelection( c, wo, false );
+ ts.resizableReset( table, refreshing );
+ $( document ).unbind( 'mousemove' + namespace + ' mouseup' + namespace );
+ }
+ }
+ });
+
+ ts.resizableReset = function( table, refreshing ) {
+ $( table ).each(function() {
+ var index, $t,
+ c = this.config,
+ wo = c && c.widgetOptions,
+ vars = wo.resizable_vars;
+ if ( table && c && c.$headerIndexed.length ) {
+ // restore the initial table width
+ if ( vars.overflow && vars.tableWidth ) {
+ ts.resizable.setWidth( c.$table, vars.tableWidth, true );
+ if ( vars.useStorage ) {
+ ts.storage( table, 'tablesorter-table-resized-width', vars.tableWidth );
+ }
+ }
+ for ( index = 0; index < c.columns; index++ ) {
+ $t = c.$headerIndexed[ index ];
+ if ( wo.resizable_widths && wo.resizable_widths[ index ] ) {
+ ts.resizable.setWidth( $t, wo.resizable_widths[ index ], vars.overflow );
+ } else if ( !$t.hasClass( 'resizable-false' ) ) {
+ // don't clear the width of any column that is not resizable
+ ts.resizable.setWidth( $t, '', vars.overflow );
+ }
+ }
+
+ // reset stickyHeader widths
+ c.$table.triggerHandler( 'stickyHeadersUpdate' );
+ if ( ts.storage && !refreshing ) {
+ ts.storage( this, ts.css.resizableStorage, [] );
+ }
+ }
+ });
+ };
+
+})( jQuery, window );
+
+/*! Widget: saveSort - updated 2018-03-19 (v2.30.1) *//*
+* Requires tablesorter v2.16+
+* by Rob Garrison
+*/
+;(function ($) {
+ 'use strict';
+ var ts = $.tablesorter || {};
+
+ function getStoredSortList(c) {
+ var stored = ts.storage( c.table, 'tablesorter-savesort' );
+ return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : [];
+ }
+
+ function sortListChanged(c, sortList) {
+ return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
+ }
+
+ // this widget saves the last sort only if the
+ // saveSort widget option is true AND the
+ // $.tablesorter.storage function is included
+ // **************************
+ ts.addWidget({
+ id: 'saveSort',
+ priority: 20,
+ options: {
+ saveSort : true
+ },
+ init: function(table, thisWidget, c, wo) {
+ // run widget format before all other widgets are applied to the table
+ thisWidget.format(table, c, wo, true);
+ },
+ format: function(table, c, wo, init) {
+ var time,
+ $table = c.$table,
+ saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
+ sortList = { 'sortList' : c.sortList },
+ debug = ts.debug(c, 'saveSort');
+ if (debug) {
+ time = new Date();
+ }
+ if ($table.hasClass('hasSaveSort')) {
+ if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
+ ts.storage( table, 'tablesorter-savesort', sortList );
+ if (debug) {
+ console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
+ }
+ }
+ } else {
+ // set table sort on initial run of the widget
+ $table.addClass('hasSaveSort');
+ sortList = '';
+ // get data
+ if (ts.storage) {
+ sortList = getStoredSortList(c);
+ if (debug) {
+ console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
+ }
+ $table.bind('saveSortReset', function(event) {
+ event.stopPropagation();
+ ts.storage( table, 'tablesorter-savesort', '' );
+ });
+ }
+ // init is true when widget init is run, this will run this widget before all other widgets have initialized
+ // this method allows using this widget in the original tablesorter plugin; but then it will run all widgets twice.
+ if (init && sortList && sortList.length > 0) {
+ c.sortList = sortList;
+ } else if (table.hasInitialized && sortList && sortList.length > 0) {
+ // update sort change
+ if (sortListChanged(c, sortList)) {
+ ts.sortOn(c, sortList);
+ }
+ }
+ }
+ },
+ remove: function(table, c) {
+ c.$table.removeClass('hasSaveSort');
+ // clear storage
+ if (ts.storage) { ts.storage( table, 'tablesorter-savesort', '' ); }
+ }
+ });
+
+})(jQuery);
+return jQuery.tablesorter;}));
diff --git a/web/_static/tablesorter/js/jquery.tablesorter.widgets.min.js b/web/_static/tablesorter/js/jquery.tablesorter.widgets.min.js
new file mode 100644
index 0000000..1d08185
--- /dev/null
+++ b/web/_static/tablesorter/js/jquery.tablesorter.widgets.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! tablesorter (FORK) - updated 2020-03-03 (v2.31.3)*/
+!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){return function(b,y,_){"use strict";var v=b.tablesorter||{};b.extend(!0,v.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),v.storage=function(e,t,r,i){var a,l,s,n=!1,o={},c=(e=b(e)[0]).config,d=c&&c.widgetOptions,f=v.debug(c,"storage"),h=(i&&i.storageType||d&&d.storage_storageType).toString().charAt(0).toLowerCase(),u=h?"":i&&i.useSessionStorage||d&&d.storage_useSessionStorage,p=b(e),g=i&&i.id||p.attr(i&&i.group||d&&d.storage_group||"data-table-group")||d&&d.storage_tableId||e.id||b(".tablesorter").index(p),m=i&&i.url||p.attr(i&&i.page||d&&d.storage_page||"data-table-page")||d&&d.storage_fixedUrl||c&&c.fixedUrl||y.location.pathname;if("c"!==h&&(h="s"===h||u?"sessionStorage":"localStorage")in y)try{y[h].setItem("_tmptest","temp"),n=!0,y[h].removeItem("_tmptest")}catch(e){console.warn(h+" is not supported in this browser")}if(f&&console.log("Storage >> Using",n?h:"cookies"),b.parseJSON&&(o=n?b.parseJSON(y[h][t]||"null")||{}:(l=_.cookie.split(/[;\s|=]/),0!==(a=b.inArray(t,l)+1)&&b.parseJSON(l[a]||"null")||{})),void 0===r||!y.JSON||!JSON.hasOwnProperty("stringify"))return o&&o[m]?o[m][g]:"";o[m]||(o[m]={}),o[m][g]=r,n?y[h][t]=JSON.stringify(o):((s=new Date).setTime(s.getTime()+31536e6),_.cookie=t+"="+JSON.stringify(o).replace(/\"/g,'"')+"; expires="+s.toGMTString()+"; path=/")}}(e,window,document),function(C){"use strict";var z=C.tablesorter||{};z.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"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 ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},C.extend(z.css,{wrapper:"tablesorter-wrapper"}),z.addWidget({id:"uitheme",priority:10,format:function(e,t,r){var i,a,l,s,n,o,c,d,f,h,u,p,g,m=z.themes,b=t.$table.add(C(t.namespace+"_extra_table")),y=t.$headers.add(C(t.namespace+"_extra_headers")),_=t.theme||"jui",v=m[_]||{},w=C.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=C.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" ")),S=z.debug(t,"uitheme");for(S&&(n=new Date),b.hasClass("tablesorter-"+_)&&t.theme===t.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,h=m[t.appliedTheme]||{},u=(g=!C.isEmptyObject(h))?[h.sortNone,h.sortDesc,h.sortAsc,h.active].join(" "):"",p=g?[h.iconSortNone,h.iconSortDesc,h.iconSortAsc].join(" "):"",g&&(r.zebra[0]=C.trim(" "+r.zebra[0].replace(" "+h.even,"")),r.zebra[1]=C.trim(" "+r.zebra[1].replace(" "+h.odd,"")),t.$tbodies.children().removeClass([h.even,h.odd].join(" "))),v.even&&(r.zebra[0]+=" "+v.even),v.odd&&(r.zebra[1]+=" "+v.odd),b.children("caption").removeClass(h.caption||"").addClass(v.caption),d=b.removeClass((t.appliedTheme?"tablesorter-"+(t.appliedTheme||""):"")+" "+(h.table||"")).addClass("tablesorter-"+_+" "+(v.table||"")).children("tfoot"),t.appliedTheme=t.theme,d.length&&d.children("tr").removeClass(h.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(h.footerCells||"").addClass(v.footerCells),y.removeClass((g?[h.header,h.hover,u].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(e){C(this)["mouseenter"===e.type?"addClass":"removeClass"](v.hover||"")}),y.each(function(){var e=C(this);e.find("."+z.css.wrapper).length||e.wrapInner('<div class="'+z.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),t.cssIcon&&y.find("."+z.css.icon).removeClass(g?[h.icons,p].join(" "):"").addClass(v.icons||""),z.hasWidget(t.table,"filter")&&(a=function(){b.children("thead").children("."+z.css.filterRow).removeClass(g&&h.filterRow||"").addClass(v.filterRow||"")},r.filter_initialized?a():b.one("filterInit",function(){a()}))),i=0;i<t.columns;i++)o=t.$headers.add(C(t.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),c=z.css.icon?o.find("."+z.css.icon):C(),(f=y.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(o.removeClass(w),c.removeClass(x),f[0].sortDisabled?c.removeClass(v.icons||""):(l=v.sortNone,s=v.iconSortNone,f.hasClass(z.css.sortAsc)?(l=[v.sortAsc,v.active].join(" "),s=v.iconSortAsc):f.hasClass(z.css.sortDesc)&&(l=[v.sortDesc,v.active].join(" "),s=v.iconSortDesc),o.addClass(l),c.addClass(s||"")));S&&console.log("uitheme >> Applied "+_+" theme"+z.benchmark(n))},remove:function(e,t,r,i){if(r.uitheme_applied){var a=t.$table,l=t.appliedTheme||"jui",s=z.themes[l]||z.themes.jui,n=a.children("thead").children(),o=s.sortNone+" "+s.sortDesc+" "+s.sortAsc,c=s.iconSortNone+" "+s.iconSortDesc+" "+s.iconSortAsc;a.removeClass("tablesorter-"+l+" "+s.table),r.uitheme_applied=!1,i||(a.find(z.css.header).removeClass(s.header),n.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(s.hover+" "+o+" "+s.active).filter("."+z.css.filterRow).removeClass(s.filterRow),n.find("."+z.css.icon).removeClass(s.icons+" "+c))}}})}(e),function(b){"use strict";var y=b.tablesorter||{};y.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(e,t,r){var i,a,l,s,n,o,c,d,f=t.$table,h=t.$tbodies,u=t.sortList,p=u.length,g=r&&r.columns||["primary","secondary","tertiary"],m=g.length-1;for(c=g.join(" "),a=0;a<h.length;a++)(l=(i=y.processTbody(e,h.eq(a),!0)).children("tr")).each(function(){if(n=b(this),"none"!==this.style.display&&(o=n.children().removeClass(c),u&&u[0]&&(o.eq(u[0][0]).addClass(g[0]),1<p)))for(d=1;d<p;d++)o.eq(u[d][0]).addClass(g[d]||g[m])}),y.processTbody(e,i,!1);if(s=!1!==r.columns_thead?["thead tr"]:[],!1!==r.columns_tfoot&&s.push("tfoot tr"),s.length&&(l=f.find(s.join(",")).children().removeClass(c),p))for(d=0;d<p;d++)l.filter('[data-column="'+u[d][0]+'"]').addClass(g[d]||g[m])},remove:function(e,t,r){var i,a,l=t.$tbodies,s=(r.columns||["primary","secondary","tertiary"]).join(" ");for(t.$headers.removeClass(s),t.$table.children("tfoot").children("tr").children("th, td").removeClass(s),i=0;i<l.length;i++)(a=y.processTbody(e,l.eq(i),!0)).children("tr").each(function(){b(this).children().removeClass(s)}),y.processTbody(e,a,!1)}})}(e),function(A){"use strict";var I,O,E=A.tablesorter||{},b=E.css,o=E.keyCodes;A.extend(b,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),A.extend(o,{backSpace:8,escape:27,space:32,left:37,down:40}),E.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnAnyMatch:!0,filter_columnFilters:!0,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:!0,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:!1,filter_startsWith:!1,filter_useParsedData:!1},format:function(e,t,r){t.$table.hasClass("hasFilters")||I.init(e,t,r)},remove:function(e,t,r,i){var a,l,s=t.$table,n=t.$tbodies,o="addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ".split(" ").join(t.namespace+"filter ");if(s.removeClass("hasFilters").unbind(o.replace(E.regex.spaces," ")).find("."+b.filterRow).remove(),r.filter_initialized=!1,!i){for(a=0;a<n.length;a++)(l=E.processTbody(e,n.eq(a),!0)).children().removeClass(r.filter_filteredRow).show(),E.processTbody(e,l,!1);r.filter_reset&&A(document).undelegate(r.filter_reset,"click"+t.namespace+"filter")}}}),O=(I=E.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(e,t,r){if(!O.orTest.test(t.iFilter)&&!O.orSplit.test(t.filter)||O.regex.test(t.filter))return null;var i,a,l,s=A.extend({},t),n=t.filter.split(O.orSplit),o=t.iFilter.split(O.orSplit),c=n.length;for(i=0;i<c;i++){s.nestedFilters=!0,s.filter=""+(I.parseFilter(e,n[i],t)||""),s.iFilter=""+(I.parseFilter(e,o[i],t)||""),l="("+(I.parseFilter(e,s.filter,t)||"")+")";try{if(a=new RegExp(t.isMatch?l:"^"+l+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(s.exact)||I.processTypes(e,s,r))return a}catch(e){return null}}return a||!1},and:function(e,t,r){if(O.andTest.test(t.filter)){var i,a,l,s,n=A.extend({},t),o=t.filter.split(O.andSplit),c=t.iFilter.split(O.andSplit),d=o.length;for(i=0;i<d;i++){n.nestedFilters=!0,n.filter=""+(I.parseFilter(e,o[i],t)||""),n.iFilter=""+(I.parseFilter(e,c[i],t)||""),s=("("+(I.parseFilter(e,n.filter,t)||"")+")").replace(O.wild01,"\\S{1}").replace(O.wild0More,"\\S*");try{l=new RegExp(t.isMatch?s:"^"+s+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(n.exact)||I.processTypes(e,n,r),a=0===i?l:a&&l}catch(e){return null}}return a||!1}return null},regex:function(e,t){if(O.regex.test(t.filter)){var r,i=t.filter_regexCache[t.index]||O.regex.exec(t.filter),a=i instanceof RegExp;try{a||(t.filter_regexCache[t.index]=i=new RegExp(i[1],i[2])),r=i.test(t.exact)}catch(e){r=!1}return r}return null},operators:function(e,t){if(O.operTest.test(t.iFilter)&&""!==t.iExact){var r,i,a,l=e.table,s=t.parsed[t.index],n=E.formatFloat(t.iFilter.replace(O.operators,""),l),o=e.parsers[t.index]||{},c=n;return!s&&"numeric"!==o.type||(a=A.trim(""+t.iFilter.replace(O.operators,"")),n="number"!=typeof(i=I.parseFilter(e,a,t,!0))||""===i||isNaN(i)?n:i),r=!s&&"numeric"!==o.type||isNaN(n)||void 0===t.cache?(a=isNaN(t.iExact)?t.iExact.replace(E.regex.nondigit,""):t.iExact,E.formatFloat(a,l)):t.cache,O.gtTest.test(t.iFilter)?i=O.gteTest.test(t.iFilter)?n<=r:n<r:O.ltTest.test(t.iFilter)&&(i=O.lteTest.test(t.iFilter)?r<=n:r<n),i||""!==c||(i=!0),i}return null},notMatch:function(e,t){if(O.notTest.test(t.iFilter)){var r,i=t.iFilter.replace("!",""),a=I.parseFilter(e,i,t)||"";return O.exact.test(a)?""===(a=a.replace(O.exact,""))||A.trim(a)!==t.iExact:(r=t.iExact.search(A.trim(a)),""===a||(t.anyMatch?r<0:!(e.widgetOptions.filter_startsWith?0===r:0<=r)))}return null},exact:function(e,t){if(O.exact.test(t.iFilter)){var r=t.iFilter.replace(O.exact,""),i=I.parseFilter(e,r,t)||"";return t.anyMatch?0<=A.inArray(i,t.rowArray):i==t.iExact}return null},range:function(e,t){if(O.toTest.test(t.iFilter)){var r,i,a,l,s=e.table,n=t.index,o=t.parsed[n],c=t.iFilter.split(O.toSplit);return i=c[0].replace(E.regex.nondigit,"")||"",a=E.formatFloat(I.parseFilter(e,i,t),s),i=c[1].replace(E.regex.nondigit,"")||"",l=E.formatFloat(I.parseFilter(e,i,t),s),!o&&"numeric"!==e.parsers[n].type||(a=""===(r=e.parsers[n].format(""+c[0],s,e.$headers.eq(n),n))||isNaN(r)?a:r,l=""===(r=e.parsers[n].format(""+c[1],s,e.$headers.eq(n),n))||isNaN(r)?l:r),r=!o&&"numeric"!==e.parsers[n].type||isNaN(a)||isNaN(l)?(i=isNaN(t.iExact)?t.iExact.replace(E.regex.nondigit,""):t.iExact,E.formatFloat(i,s)):t.cache,l<a&&(i=a,a=l,l=i),a<=r&&r<=l||""===a||""===l}return null},wild:function(e,t){if(O.wildOrTest.test(t.iFilter)){var r=""+(I.parseFilter(e,t.iFilter,t)||"");!O.wildTest.test(r)&&t.nestedFilters&&(r=t.isMatch?r:"^("+r+")$");try{return new RegExp(r.replace(O.wild01,"\\S{1}").replace(O.wild0More,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(t.exact)}catch(e){return null}}return null},fuzzy:function(e,t){if(O.fuzzyTest.test(t.iFilter)){var r,i=0,a=t.iExact.length,l=t.iFilter.slice(1),s=I.parseFilter(e,l,t)||"";for(r=0;r<a;r++)t.iExact[r]===s[i]&&(i+=1);return i===s.length}return null}},init:function(r){E.language=A.extend(!0,{},{to:"to",or:"or",and:"and"},E.language);function e(e,t,r){return""===(t=t.trim())?"":(e||"")+t+(r||"")}var t,i,a,l,s,n,o,c,d=r.config,f=d.widgetOptions;if(d.$table.addClass("hasFilters"),d.lastSearch=[],f.filter_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*=","]',n="\\{"+O.query+"\\}",A.extend(O,{child:new RegExp(d.cssChildRow),filtered:new RegExp(f.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+e("|",E.language.or)+e("|",E.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+e("|",E.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+e("|",E.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+e("",E.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+e("",E.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+e("|\\s+",E.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+e("|\\s+(?:",E.language.or,")\\s+")+")","gi"),iQuery:new RegExp(n,"i"),igQuery:new RegExp(n,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/}),n=d.$headers.filter(".filter-false, .parser-false").length,!1!==f.filter_columnFilters&&n!==d.$headers.length&&I.buildRow(r,d,f),a="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(a,function(e,t){return n=f.filter_hideEmpty&&A.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===e.type),d.$table.find("."+b.filterRow).toggleClass(f.filter_filteredRow,n),/(search|filter)/.test(e.type)||(e.stopPropagation(),I.buildDefault(r,!0)),"filterReset"===e.type||"filterAndSortReset"===e.type?(d.$table.find("."+b.filter).add(f.filter_$externalFilters).val(""),"filterAndSortReset"===e.type?E.sortReset(this.config,function(){I.searching(r,[])}):I.searching(r,[])):"filterResetSaved"===e.type?E.storage(r,"tablesorter-filters",""):"filterEnd"===e.type?I.buildDefault(r,!0):(t="search"===e.type?t:"updateComplete"===e.type?d.$table.data("lastSearch"):"",/(update|add)/.test(e.type)&&"updateComplete"!==e.type&&(d.lastCombinedFilter=null,d.lastSearch=[],setTimeout(function(){d.$table.triggerHandler("filterFomatterUpdate")},100)),I.searching(r,t,!0)),!1}),f.filter_reset&&(f.filter_reset instanceof A?f.filter_reset.click(function(){d.$table.triggerHandler("filterReset")}):A(f.filter_reset).length&&A(document).undelegate(f.filter_reset,"click"+d.namespace+"filter").delegate(f.filter_reset,"click"+d.namespace+"filter",function(){d.$table.triggerHandler("filterReset")})),f.filter_functions)for(s=0;s<d.columns;s++)if(o=E.getColumnData(r,f.filter_functions,s))if(c=!((l=d.$headerIndexed[s].removeClass("filter-select")).hasClass("filter-false")||l.hasClass("parser-false")),!(t="")===o&&c)I.buildSelect(r,s);else if("object"==typeof o&&c){for(i in o)"string"==typeof i&&(t+=""===t?'<option value="">'+(l.data("placeholder")||l.attr("data-placeholder")||f.filter_placeholder.select||"")+"</option>":"",0<=(a=n=i).indexOf(f.filter_selectSourceSeparator)&&(a=(n=i.split(f.filter_selectSourceSeparator))[1],n=n[0]),t+="<option "+(a===n?"":'data-function-name="'+i+'" ')+'value="'+n+'">'+a+"</option>");d.$table.find("thead").find("select."+b.filter+'[data-column="'+s+'"]').append(t),(o="function"==typeof(a=f.filter_selectSource)||E.getColumnData(r,a,s))&&I.buildSelect(d.table,s,"",!0,l.hasClass(f.filter_onlyAvail))}I.buildDefault(r,!0),I.bindSearch(r,d.$table.find("."+b.filter),!0),f.filter_external&&I.bindSearch(r,f.filter_external),f.filter_hideFilters&&I.hideFilters(d),d.showProcessing&&(a="filterStart filterEnd ".split(" ").join(d.namespace+"filter-sp "),d.$table.unbind(a.replace(E.regex.spaces," ")).bind(a,function(e,t){l=t?d.$table.find("."+b.header).filter("[data-column]").filter(function(){return""!==t[A(this).data("column")]}):"",E.isProcessing(r,"filterStart"===e.type,t?l:"")})),d.filteredRows=d.totalRows,a="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "),d.$table.unbind(a.replace(E.regex.spaces," ")).bind(a,function(){I.completeInit(this)}),d.pager&&d.pager.initialized&&!f.filter_initialized?(d.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){I.filterInitComplete(d)},100)):f.filter_initialized||I.completeInit(r)},completeInit:function(e){var t=e.config,r=t.widgetOptions,i=I.setDefaults(e,t,r)||[];i.length&&(t.delayInit&&""===i.join("")||E.setFilters(e,i,!0)),t.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){r.filter_initialized||I.filterInitComplete(t)},100)},formatterUpdated:function(e,t){var r=e&&e.closest("table"),i=r.length&&r[0].config,a=i&&i.widgetOptions;a&&!a.filter_initialized&&(a.filter_formatterInit[t]=1)},filterInitComplete:function(e){function t(){a.filter_initialized=!0,e.lastSearch=e.$table.data("lastSearch"),e.$table.triggerHandler("filterInit",e),I.findRows(e.table,e.lastSearch||[]),E.debug(e,"filter")&&console.log("Filter >> Widget initialized")}var r,i,a=e.widgetOptions,l=0;if(A.isEmptyObject(a.filter_formatter))t();else{for(i=a.filter_formatterInit.length,r=0;r<i;r++)1===a.filter_formatterInit[r]&&l++;clearTimeout(a.filter_initTimer),a.filter_initialized||l!==a.filter_formatterCount?a.filter_initialized||(a.filter_initTimer=setTimeout(function(){t()},500)):t()}},processFilters:function(e,t){var r,i=[],a=t?encodeURIComponent:decodeURIComponent,l=e.length;for(r=0;r<l;r++)e[r]&&(i[r]=a(e[r]));return i},setDefaults:function(e,t,r){var i,a,l,s,n,o=E.getFilters(e)||[];if(r.filter_saveFilters&&E.storage&&(a=E.storage(e,"tablesorter-filters")||[],(i=A.isArray(a))&&""===a.join("")||!i||(o=I.processFilters(a))),""===o.join(""))for(n=t.$headers.add(r.filter_$externalFilters).filter("["+r.filter_defaultAttrib+"]"),l=0;l<=t.columns;l++)s=l===t.columns?"all":l,o[l]=n.filter('[data-column="'+s+'"]').attr(r.filter_defaultAttrib)||o[l]||"";return t.$table.data("lastSearch",o),o},parseFilter:function(e,t,r,i){return i||r.parsed[r.index]?e.parsers[r.index].format(t,e.table,[],r.index):t},buildRow:function(e,t,r){var i,a,l,s,n,o,c,d,f,h=r.filter_cellFilter,u=t.columns,p=A.isArray(h),g='<tr role="search" class="'+b.filterRow+" "+t.cssIgnoreRow+'">';for(l=0;l<u;l++)t.$headerIndexed[l].length&&(g+=1<(f=t.$headerIndexed[l]&&t.$headerIndexed[l][0].colSpan||0)?'<td data-column="'+l+"-"+(l+f-1)+'" colspan="'+f+'"':'<td data-column="'+l+'"',g+=p?h[l]?' class="'+h[l]+'"':"":""!==h?' class="'+h+'"':"",g+="></td>");for(t.$filters=A(g+="</tr>").appendTo(t.$table.children("thead").eq(0)).children("td"),l=0;l<u;l++)o=!1,(s=t.$headerIndexed[l])&&s.length&&(i=I.getColumnElm(t,t.$filters,l),d=E.getColumnData(e,r.filter_functions,l),n=r.filter_functions&&d&&"function"!=typeof d||s.hasClass("filter-select"),a=E.getColumnData(e,t.headers,l),o="false"===E.getData(s[0],a,"filter")||"false"===E.getData(s[0],a,"parser"),n?g=A("<select>").appendTo(i):((d=E.getColumnData(e,r.filter_formatter,l))?(r.filter_formatterCount++,(g=d(i,l))&&0===g.length&&(g=i.children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==i[0])&&i.append(g)):g=A('<input type="search">').appendTo(i),g&&(f=s.data("placeholder")||s.attr("data-placeholder")||r.filter_placeholder.search||"",g.attr("placeholder",f))),g&&(c=(A.isArray(r.filter_cssFilter)?void 0!==r.filter_cssFilter[l]&&r.filter_cssFilter[l]||"":r.filter_cssFilter)||"",g.addClass(b.filter+" "+c),f=(f=(c=r.filter_filterLabel).match(/{{([^}]+?)}}/g))||["{{label}}"],A.each(f,function(e,t){var r=new RegExp(t,"g"),i=s.attr("data-"+t.replace(/{{|}}/g,"")),a=void 0===i?s.text():i;c=c.replace(r,A.trim(a))}),g.attr({"data-column":i.attr("data-column"),"aria-label":c}),o&&(g.attr("placeholder","").addClass(b.filterDisabled)[0].disabled=!0)))},bindSearch:function(a,e,t){if(a=A(a)[0],(e=A(e)).length){var r,l=a.config,s=l.widgetOptions,i=l.namespace+"filter",n=s.filter_$externalFilters;!0!==t&&(r=s.filter_anyColumnSelector+","+s.filter_multipleColumnSelector,s.filter_$anyMatch=e.filter(r),n&&n.length?s.filter_$externalFilters=s.filter_$externalFilters.add(e):s.filter_$externalFilters=e,E.setFilters(a,l.$table.data("lastSearch")||[],!1===t)),r="keypress keyup keydown search change input ".split(" ").join(i+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(r.replace(E.regex.spaces," ")).bind("keydown"+i,function(e){if(e.which===o.escape&&!a.config.widgetOptions.filter_resetOnEsc)return!1}).bind("keyup"+i,function(e){s=a.config.widgetOptions;var t=parseInt(A(this).attr("data-column"),10),r="boolean"==typeof s.filter_liveSearch?s.filter_liveSearch:E.getColumnData(a,s.filter_liveSearch,t);if(void 0===r&&(r=s.filter_liveSearch.fallback||!1),A(this).attr("data-lastSearchTime",(new Date).getTime()),e.which===o.escape)this.value=s.filter_resetOnEsc?"":l.lastSearch[t];else{if(""!==this.value&&("number"==typeof r&&this.value.length<r||e.which!==o.enter&&e.which!==o.backSpace&&(e.which<o.space||e.which>=o.left&&e.which<=o.down)))return;if(!1===r&&""!==this.value&&e.which!==o.enter)return}I.searching(a,!0,!0,t)}).bind("search change keypress input blur ".split(" ").join(i+" "),function(e){var t=parseInt(A(this).attr("data-column"),10),r=e.type,i="boolean"==typeof s.filter_liveSearch?s.filter_liveSearch:E.getColumnData(a,s.filter_liveSearch,t);!a.config.widgetOptions.filter_initialized||e.which!==o.enter&&"search"!==r&&"blur"!==r&&("change"!==r&&"input"!==r||!0!==i&&(!0===i||"INPUT"===e.target.nodeName)||this.value===l.lastSearch[t])||(e.preventDefault(),A(this).attr("data-lastSearchTime",(new Date).getTime()),I.searching(a,"keypress"!==r||e.which===o.enter,!0,t))})}},searching:function(e,t,r,i){var a,l=e.config.widgetOptions;void 0===i?a=!1:void 0===(a="boolean"==typeof l.filter_liveSearch?l.filter_liveSearch:E.getColumnData(e,l.filter_liveSearch,i))&&(a=l.filter_liveSearch.fallback||!1),clearTimeout(l.filter_searchTimer),void 0===t||!0===t?l.filter_searchTimer=setTimeout(function(){I.checkFilters(e,t,r)},a?l.filter_searchDelay:10):I.checkFilters(e,t,r)},equalFilters:function(e,t,r){var i,a=[],l=[],s=e.columns+1;for(t=A.isArray(t)?t:[],r=A.isArray(r)?r:[],i=0;i<s;i++)a[i]=t[i]||"",l[i]=r[i]||"";return a.join(",")===l.join(",")},checkFilters:function(e,t,r){var i=e.config,a=i.widgetOptions,l=A.isArray(t),s=l?t:E.getFilters(e,!0),n=s||[];if(A.isEmptyObject(i.cache))i.delayInit&&(!i.pager||i.pager&&i.pager.initialized)&&E.updateCache(i,function(){I.checkFilters(e,!1,r)});else{if(l&&(E.setFilters(e,s,!1,!0!==r),a.filter_initialized||(i.lastSearch=[],i.lastCombinedFilter="")),a.filter_hideFilters&&i.$table.find("."+b.filterRow).triggerHandler(I.hideFiltersCheck(i)?"mouseleave":"mouseenter"),I.equalFilters(i,i.lastSearch,n)){if(!1!==t)return;i.lastCombinedFilter="",i.lastSearch=[]}if(s=s||[],s=Array.prototype.map?s.map(String):s.join("�").split("�"),a.filter_initialized&&i.$table.triggerHandler("filterStart",[s]),!i.showProcessing)return I.findRows(e,s,n),!1;setTimeout(function(){return I.findRows(e,s,n),!1},30)}},hideFiltersCheck:function(e){if("function"==typeof e.widgetOptions.filter_hideFilters){var t=e.widgetOptions.filter_hideFilters(e);if("boolean"==typeof t)return t}return""===E.getFilters(e.$table).join("")},hideFilters:function(i,e){var a;(e||i.$table).find("."+b.filterRow).addClass(b.filterRowHide).bind("mouseenter mouseleave",function(e){var t=e,r=A(this);clearTimeout(a),a=setTimeout(function(){/enter|over/.test(t.type)?r.removeClass(b.filterRowHide):A(document.activeElement).closest("tr")[0]!==r[0]&&r.toggleClass(b.filterRowHide,I.hideFiltersCheck(i))},200)}).find("input, select").bind("focus blur",function(e){var t=e,r=A(this).closest("tr");clearTimeout(a),a=setTimeout(function(){clearTimeout(a),r.toggleClass(b.filterRowHide,I.hideFiltersCheck(i)&&"focus"!==t.type)},200)})},defaultFilter:function(e,t){if(""===e)return e;var r=O.iQuery,i=t.match(O.igQuery).length,a=1<i?A.trim(e).split(/\s/):[A.trim(e)],l=a.length-1,s=0,n=t;for(l<1&&1<i&&(a[1]=a[0]);r.test(n);)n=n.replace(r,a[s++]||""),r.test(n)&&s<l&&""!==(a[s]||"")&&(n=t.replace(r,n));return n},getLatestSearch:function(e){return e?e.sort(function(e,t){return A(t).attr("data-lastSearchTime")-A(e).attr("data-lastSearchTime")}):e||A()},findRange:function(e,t,r){var i,a,l,s,n,o,c,d,f,h=[];if(/^[0-9]+$/.test(t))return[parseInt(t,10)];if(!r&&/-/.test(t))for(f=(a=t.match(/(\d+)\s*-\s*(\d+)/g))?a.length:0,d=0;d<f;d++){for(l=a[d].split(/\s*-\s*/),s=parseInt(l[0],10)||0,(n=parseInt(l[1],10)||e.columns-1)<s&&(i=s,s=n,n=i),n>=e.columns&&(n=e.columns-1);s<=n;s++)h[h.length]=s;t=t.replace(a[d],"")}if(!r&&/,/.test(t))for(f=(o=t.split(/\s*,\s*/)).length,c=0;c<f;c++)""!==o[c]&&(d=parseInt(o[c],10))<e.columns&&(h[h.length]=d);if(!h.length)for(d=0;d<e.columns;d++)h[h.length]=d;return h},getColumnElm:function(t,e,r){return e.filter(function(){var e=I.findRange(t,A(this).attr("data-column"));return-1<A.inArray(r,e)})},multipleColumns:function(e,t){var r=e.widgetOptions,i=r.filter_initialized||!t.filter(r.filter_anyColumnSelector).length,a=A.trim(I.getLatestSearch(t).attr("data-column")||"");return I.findRange(e,a,!i)},processTypes:function(e,t,r){var i,a=null,l=null;for(i in I.types)A.inArray(i,r.excludeMatch)<0&&null===l&&null!==(l=I.types[i](e,t,r))&&(t.matchedOn=i,a=l);return a},matchType:function(e,t){var r=e.widgetOptions,i=e.$headerIndexed[t];return!i.hasClass("filter-exact")&&(!!i.hasClass("filter-match")||(r.filter_columnFilters?i=e.$filters.find("."+b.filter).add(r.filter_$externalFilters).filter('[data-column="'+t+'"]'):r.filter_$externalFilters&&(i=r.filter_$externalFilters.filter('[data-column="'+t+'"]')),!!i.length&&"match"===e.widgetOptions.filter_matchType[(i[0].nodeName||"").toLowerCase()]))},processRow:function(t,r,e){var i,a,l,s,n,o=t.widgetOptions,c=!0,d=o.filter_$anyMatch&&o.filter_$anyMatch.length,f=o.filter_$anyMatch&&o.filter_$anyMatch.length?I.multipleColumns(t,o.filter_$anyMatch):[];if(r.$cells=r.$row.children(),r.matchedOn=null,r.anyMatchFlag&&1<f.length||r.anyMatchFilter&&!d){if(r.anyMatch=!0,r.isMatch=!0,r.rowArray=r.$cells.map(function(e){if(-1<A.inArray(e,f)||r.anyMatchFilter&&!d)return r.parsed[e]?n=r.cacheArray[e]:(n=r.rawArray[e],n=A.trim(o.filter_ignoreCase?n.toLowerCase():n),t.sortLocaleCompare&&(n=E.replaceAccents(n))),n}).get(),r.filter=r.anyMatchFilter,r.iFilter=r.iAnyMatchFilter,r.exact=r.rowArray.join(" "),r.iExact=o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.cache=r.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,null!==(a=I.processTypes(t,r,e)))c=a;else if(o.filter_startsWith)for(c=!1,f=Math.min(t.columns,r.rowArray.length);!c&&0<f;)f--,c=c||0===r.rowArray[f].indexOf(r.iFilter);else c=0<=(r.iExact+r.childRowText).indexOf(r.iFilter);if(r.anyMatch=!1,r.filters.join("")===r.filter)return c}for(f=0;f<t.columns;f++)r.filter=r.filters[f],r.index=f,e.excludeMatch=e.excludeFilter[f],r.filter&&(r.cache=r.cacheArray[f],i=r.parsed[f]?r.cache:r.rawArray[f]||"",r.exact=t.sortLocaleCompare?E.replaceAccents(i):i,r.iExact=!O.type.test(typeof r.exact)&&o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.isMatch=I.matchType(t,f),i=c,s=o.filter_columnFilters&&t.$filters.add(o.filter_$externalFilters).filter('[data-column="'+f+'"]').find("select option:selected").attr("data-function-name")||"",t.sortLocaleCompare&&(r.filter=E.replaceAccents(r.filter)),o.filter_defaultFilter&&O.iQuery.test(e.defaultColFilter[f])&&(r.filter=I.defaultFilter(r.filter,e.defaultColFilter[f])),r.iFilter=o.filter_ignoreCase?(r.filter||"").toLowerCase():r.filter,a=null,(l=e.functions[f])&&("function"==typeof l?a=l(r.exact,r.cache,r.filter,f,r.$row,t,r):"function"==typeof l[s||r.filter]&&(a=l[n=s||r.filter](r.exact,r.cache,r.filter,f,r.$row,t,r))),c=!!(i=null===a?(a=I.processTypes(t,r,e),n=!0===l&&("and"===r.matchedOn||"or"===r.matchedOn),null===a||n?!0===l?r.isMatch?0<=(""+r.iExact).search(r.iFilter):r.filter===r.exact:(n=(r.iExact+r.childRowText).indexOf(I.parseFilter(t,r.iFilter,r)),!o.filter_startsWith&&0<=n||o.filter_startsWith&&0===n):a):a)&&c);return c},findRows:function(e,r,t){if(!I.equalFilters(e.config,e.config.lastSearch,t)&&e.config.widgetOptions.filter_initialized){var i,a,l,s,n,o,c,d,f,h,u,p,g,m,b,y,_,v,w,x,S,C,z,$=A.extend([],r),F=e.config,R=F.widgetOptions,T=E.debug(F,"filter"),k={anyMatch:!1,filters:r,filter_regexCache:[]},H={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:E.getColumnData(e,R.filter_defaultFilter,F.columns,!0)||""};for(k.parsed=[],f=0;f<F.columns;f++)k.parsed[f]=R.filter_useParsedData||F.parsers&&F.parsers[f]&&F.parsers[f].parsed||E.getData&&"parsed"===E.getData(F.$headerIndexed[f],E.getColumnData(e,F.headers,f),"filter")||F.$headerIndexed[f].hasClass("filter-parsed"),H.functions[f]=E.getColumnData(e,R.filter_functions,f)||F.$headerIndexed[f].hasClass("filter-select"),H.defaultColFilter[f]=E.getColumnData(e,R.filter_defaultFilter,f)||"",H.excludeFilter[f]=(E.getColumnData(e,R.filter_excludeFilter,f,!0)||"").split(/\s+/);for(T&&(console.log("Filter >> Starting filter widget search",r),m=new Date),F.filteredRows=0,t=$||[],c=F.totalRows=0;c<F.$tbodies.length;c++){if(d=E.processTbody(e,F.$tbodies.eq(c),!0),f=F.columns,a=F.cache[c].normalized,s=A(A.map(a,function(e){return e[f].$row.get()})),""===t.join("")||R.filter_serversideFiltering)s.removeClass(R.filter_filteredRow).not("."+F.cssChildRow).css("display","");else{if(i=(s=s.not("."+F.cssChildRow)).length,(R.filter_$anyMatch&&R.filter_$anyMatch.length||void 0!==r[F.columns])&&(k.anyMatchFlag=!0,k.anyMatchFilter=""+(r[F.columns]||R.filter_$anyMatch&&I.getLatestSearch(R.filter_$anyMatch).val()||""),R.filter_columnAnyMatch)){for(w=k.anyMatchFilter.split(O.andSplit),x=!1,y=0;y<w.length;y++)1<(S=w[y].split(":")).length&&(isNaN(S[0])?A.each(F.headerContent,function(e,t){-1<t.toLowerCase().indexOf(S[0])&&(r[C=e]=S[1])}):C=parseInt(S[0],10)-1,0<=C&&C<F.columns&&(r[C]=S[1],w.splice(y,1),y--,x=!0));x&&(k.anyMatchFilter=w.join(" && "))}if(v=R.filter_searchFiltered,u=F.lastSearch||F.$table.data("lastSearch")||[],v)for(y=0;y<f+1;y++)b=r[y]||"",v||(y=f),v=v&&u.length&&0===b.indexOf(u[y]||"")&&!O.alreadyFiltered.test(b)&&!O.exactTest.test(b)&&!(O.isNeg1.test(b)||O.isNeg2.test(b))&&!(""!==b&&F.$filters&&F.$filters.filter('[data-column="'+y+'"]').find("select").length&&!I.matchType(F,y));for(_=s.not("."+R.filter_filteredRow).length,v&&0===_&&(v=!1),T&&console.log("Filter >> Searching through "+(v&&_<i?_:"all")+" rows"),k.anyMatchFlag&&(F.sortLocaleCompare&&(k.anyMatchFilter=E.replaceAccents(k.anyMatchFilter)),R.filter_defaultFilter&&O.iQuery.test(H.defaultAnyFilter)&&(k.anyMatchFilter=I.defaultFilter(k.anyMatchFilter,H.defaultAnyFilter),v=!1),k.iAnyMatchFilter=R.filter_ignoreCase&&F.ignoreCase?k.anyMatchFilter.toLowerCase():k.anyMatchFilter),o=0;o<i;o++)if(z=s[o].className,!(o&&O.child.test(z)||v&&O.filtered.test(z))){if(k.$row=s.eq(o),k.rowIndex=o,k.cacheArray=a[o],l=k.cacheArray[F.columns],k.rawArray=l.raw,k.childRowText="",!R.filter_childByColumn){for(z="",h=l.child,y=0;y<h.length;y++)z+=" "+h[y].join(" ")||"";k.childRowText=R.filter_childRows?R.filter_ignoreCase?z.toLowerCase():z:""}if(p=!1,g=I.processRow(F,k,H),n=l.$row,b=!!g,h=l.$row.filter(":gt(0)"),R.filter_childRows&&h.length){if(R.filter_childByColumn)for(R.filter_childWithSibs||(h.addClass(R.filter_filteredRow),n=n.eq(0)),y=0;y<h.length;y++)k.$row=h.eq(y),k.cacheArray=l.child[y],k.rawArray=k.cacheArray,b=I.processRow(F,k,H),p=p||b,!R.filter_childWithSibs&&b&&h.eq(y).removeClass(R.filter_filteredRow);p=p||g}else p=b;n.toggleClass(R.filter_filteredRow,!p)[0].display=p?"":"none"}}F.filteredRows+=s.not("."+R.filter_filteredRow).length,F.totalRows+=s.length,E.processTbody(e,d,!1)}F.lastCombinedFilter=$.join(""),F.lastSearch=$,F.$table.data("lastSearch",$),R.filter_saveFilters&&E.storage&&E.storage(e,"tablesorter-filters",I.processFilters($,!0)),T&&console.log("Filter >> Completed search"+E.benchmark(m)),R.filter_initialized&&(F.$table.triggerHandler("filterBeforeEnd",F),F.$table.triggerHandler("filterEnd",F)),setTimeout(function(){E.applyWidget(F.table)},0)}},getOptionSource:function(e,t,r){var i=(e=A(e)[0]).config,a=!1,l=i.widgetOptions.filter_selectSource,s=i.$table.data("lastSearch")||[],n="function"==typeof l||E.getColumnData(e,l,t);if(r&&""!==s[t]&&(r=!1),!0===n)a=l(e,t,r);else{if(n instanceof A||"string"===A.type(n)&&0<=n.indexOf("</option>"))return n;if(A.isArray(n))a=n;else if("object"===A.type(l)&&n&&null===(a=n(e,t,r)))return null}return!1===a&&(a=I.getOptions(e,t,r)),I.processOptions(e,t,a)},processOptions:function(a,l,r){if(!A.isArray(r))return!1;var s,e,t,i,n,o,c=(a=A(a)[0]).config,d=null!=l&&0<=l&&l<c.columns,f=d&&c.$headerIndexed[l].hasClass("filter-select-sort-desc"),h=[];if(r=A.grep(r,function(e,t){return!!e.text||A.inArray(e,r)===t}),d&&c.$headerIndexed[l].hasClass("filter-select-nosort"))return r;for(i=r.length,t=0;t<i;t++)o=(e=r[t]).text?e.text:e,n=(d&&c.parsers&&c.parsers.length&&c.parsers[l].format(o,a,[],l)||o).toString(),n=c.widgetOptions.filter_ignoreCase?n.toLowerCase():n,e.text?(e.parsed=n,h[h.length]=e):h[h.length]={text:e,parsed:n};for(s=c.textSorter||"",h.sort(function(e,t){var r=f?t.parsed:e.parsed,i=f?e.parsed:t.parsed;return d&&"function"==typeof s?s(r,i,!0,l,a):d&&"object"==typeof s&&s.hasOwnProperty(l)?s[l](r,i,!0,l,a):!E.sortNatural||E.sortNatural(r,i)}),r=[],i=h.length,t=0;t<i;t++)r[r.length]=h[t];return r},getOptions:function(e,t,r){var i,a,l,s,n,o,c,d,f=(e=A(e)[0]).config,h=f.widgetOptions,u=[];for(a=0;a<f.$tbodies.length;a++)for(n=f.cache[a],l=f.cache[a].normalized.length,i=0;i<l;i++)if(s=n.row?n.row[i]:n.normalized[i][f.columns].$row[0],!r||!s.className.match(h.filter_filteredRow))if(h.filter_useParsedData||f.parsers[t].parsed||f.$headerIndexed[t].hasClass("filter-parsed")){if(u[u.length]=""+n.normalized[i][t],h.filter_childRows&&h.filter_childByColumn)for(d=n.normalized[i][f.columns].$row.length-1,o=0;o<d;o++)u[u.length]=""+n.normalized[i][f.columns].child[o][t]}else if(u[u.length]=n.normalized[i][f.columns].raw[t],h.filter_childRows&&h.filter_childByColumn)for(d=n.normalized[i][f.columns].$row.length,o=1;o<d;o++)c=n.normalized[i][f.columns].$row.eq(o).children().eq(t),u[u.length]=""+E.getElementText(f,c,t);return u},buildSelect:function(e,t,r,i,a){if(e=A(e)[0],t=parseInt(t,10),e.config.cache&&!A.isEmptyObject(e.config.cache)){var l,s,n,o,c,d,f,h=e.config,u=h.widgetOptions,p=h.$headerIndexed[t],g='<option value="">'+(p.data("placeholder")||p.attr("data-placeholder")||u.filter_placeholder.select||"")+"</option>",m=h.$table.find("thead").find("select."+b.filter+'[data-column="'+t+'"]').val();if(void 0!==r&&""!==r||null!==(r=I.getOptionSource(e,t,a))){if(A.isArray(r)){for(l=0;l<r.length;l++)if((f=r[l]).text){for(s in f["data-function-name"]=void 0===f.value?f.text:f.value,g+="<option",f)f.hasOwnProperty(s)&&"text"!==s&&(g+=" "+s+'="'+f[s].replace(O.quote,"&quot;")+'"');f.value||(g+=' value="'+f.text.replace(O.quote,"&quot;")+'"'),g+=">"+f.text.replace(O.quote,"&quot;")+"</option>"}else""+f!="[object Object]"&&(0<=(s=n=f=(""+f).replace(O.quote,"&quot;")).indexOf(u.filter_selectSourceSeparator)&&(s=(o=n.split(u.filter_selectSourceSeparator))[0],n=o[1]),g+=""!==f?"<option "+(s===n?"":'data-function-name="'+f+'" ')+'value="'+s+'">'+n+"</option>":"");r=[]}c=(h.$filters?h.$filters:h.$table.children("thead")).find("."+b.filter),u.filter_$externalFilters&&(c=c&&c.length?c.add(u.filter_$externalFilters):u.filter_$externalFilters),(d=c.filter('select[data-column="'+t+'"]')).length&&(d[i?"html":"append"](g),A.isArray(r)||d.append(r).val(m),d.val(m))}}},buildDefault:function(e,t){var r,i,a,l=e.config,s=l.widgetOptions,n=l.columns;for(r=0;r<n;r++)a=!((i=l.$headerIndexed[r]).hasClass("filter-false")||i.hasClass("parser-false")),(i.hasClass("filter-select")||!0===E.getColumnData(e,s.filter_functions,r))&&a&&I.buildSelect(e,r,"",t,i.hasClass(s.filter_onlyAvail))}}).regex,E.getFilters=function(e,t,r,i){var a,l,s,n,o=[],c=e?A(e)[0].config:"",d=c?c.widgetOptions:"";if(!0!==t&&d&&!d.filter_columnFilters||A.isArray(r)&&I.equalFilters(c,r,c.lastSearch))return A(e).data("lastSearch")||[];if(c&&(c.$filters&&(l=c.$filters.find("."+b.filter)),d.filter_$externalFilters&&(l=l&&l.length?l.add(d.filter_$externalFilters):d.filter_$externalFilters),l&&l.length))for(o=r||[],a=0;a<c.columns+1;a++)n=a===c.columns?d.filter_anyColumnSelector+","+d.filter_multipleColumnSelector:'[data-column="'+a+'"]',(s=l.filter(n)).length&&(s=I.getLatestSearch(s),A.isArray(r)?(i&&1<s.length&&(s=s.slice(1)),a===c.columns&&(s=(n=s.filter(d.filter_anyColumnSelector)).length?n:s),s.val(r[a]).trigger("change"+c.namespace)):(o[a]=s.val()||"",a===c.columns?s.slice(1).filter('[data-column*="'+s.attr("data-column")+'"]').val(o[a]):s.slice(1).val(o[a])),a===c.columns&&s.length&&(d.filter_$anyMatch=s));return o},E.setFilters=function(e,t,r,i){var a=e?A(e)[0].config:"",l=E.getFilters(e,!0,t,i);return void 0===r&&(r=!0),a&&r&&(a.lastCombinedFilter=null,a.lastSearch=[],I.searching(a.table,t,i),a.$table.triggerHandler("filterFomatterUpdate")),0!==l.length}}(e),function(z,$){"use strict";var F=z.tablesorter||{};function R(e,t){var r=isNaN(t.stickyHeaders_offset)?z(t.stickyHeaders_offset):[];return r.length?r.height()||0:parseInt(t.stickyHeaders_offset,10)||0}z.extend(F.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),F.addHeaderResizeEvent=function(e,t,r){if((e=z(e)[0]).config){var i=z.extend({},{timer:250},r),o=e.config,c=o.widgetOptions,a=function(e){var t,r,i,a,l,s,n=o.$headers.length;for(c.resize_flag=!0,r=[],t=0;t<n;t++)a=(i=o.$headers.eq(t)).data("savedSizes")||[0,0],l=i[0].offsetWidth,s=i[0].offsetHeight,l===a[0]&&s===a[1]||(i.data("savedSizes",[l,s]),r.push(i[0]));r.length&&!1!==e&&o.$table.triggerHandler("resize",[r]),c.resize_flag=!1};if(clearInterval(c.resize_timer),t)return c.resize_flag=!1;a(!1),c.resize_timer=setInterval(function(){c.resize_flag||a()},i.timer)}},F.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,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(e,r,p){if(!(r.$table.hasClass("hasStickyHeaders")||0<=z.inArray("filter",r.widgets)&&!r.$table.hasClass("hasFilters"))){var t,i,a,l,g=r.$table,m=z(p.stickyHeaders_attachTo||p.stickyHeaders_appendTo),s=r.namespace+"stickyheaders ",b=z(p.stickyHeaders_yScroll||p.stickyHeaders_attachTo||$),n=z(p.stickyHeaders_xScroll||p.stickyHeaders_attachTo||$),o=g.children("thead:first").children("tr").not(".sticky-false").children(),y=g.children("tfoot"),c=R(0,p),_=g.parent().closest("."+F.css.table).hasClass("hasStickyHeaders")?g.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],v=_.length?_.height():0,d=p.$sticky=g.clone().addClass("containsStickyHeaders "+F.css.sticky+" "+p.stickyHeaders+" "+r.namespace.slice(1)+"_extra_table").wrap('<div class="'+F.css.stickyWrap+'">'),w=d.parent().addClass(F.css.stickyHide).css({position:m.length?"absolute":"fixed",padding:parseInt(d.parent().parent().css("padding-left"),10),top:c+v,left:0,visibility:"hidden",zIndex:p.stickyHeaders_zIndex||2}),f=d.children("thead:first"),x="",h=function(e,t){var r,i,a,l,s,n=e.filter(":visible"),o=n.length;for(r=0;r<o;r++)l=t.filter(":visible").eq(r),i="border-box"===(s=n.eq(r)).css("box-sizing")?s.outerWidth():"collapse"===l.css("border-collapse")?$.getComputedStyle?parseFloat($.getComputedStyle(s[0],null).width):(a=parseFloat(s.css("border-width")),s.outerWidth()-parseFloat(s.css("padding-left"))-parseFloat(s.css("padding-right"))-a):s.width(),l.css({width:i,"min-width":i,"max-width":i})},S=function(e){return!1===e&&_.length?g.position().left:m.length?parseInt(m.css("padding-left"),10)||0:g.offset().left-parseInt(g.css("margin-left"),10)-z($).scrollLeft()},C=function(){w.css({left:S(),width:g.outerWidth()}),h(g,d),h(o,l)},u=function(e){if(g.is(":visible")){v=_.length?_.offset().top-b.scrollTop()+_.height():0;var t,r=g.offset(),i=R(0,p),a=z.isWindow(b[0]),l=a?b.scrollTop():_.length?parseInt(_[0].style.top,10):b.offset().top,s=m.length?l:b.scrollTop(),n=p.stickyHeaders_includeCaption?0:g.children("caption").height()||0,o=s+i+v-n,c=g.height()-(w.height()+(y.height()||0))-n,d=o>r.top&&o<r.top+c?"visible":"hidden",f="visible"==d?F.css.stickyVis:F.css.stickyHide,h=!w.hasClass(f),u={visibility:d};m.length&&(h=!0,u.top=a?o-m.offset().top:m.scrollTop()),(t=S(a))!==parseInt(w.css("left"),10)&&(h=!0,u.left=t),u.top=(u.top||0)+(!a&&_.length?_.height():i+v),h&&w.removeClass(F.css.stickyVis+" "+F.css.stickyHide).addClass(f).css(u),d===x&&!e||(C(),x=d)}};if(m.length&&!m.css("position")&&m.css("position","relative"),d.attr("id")&&(d[0].id+=p.stickyHeaders_cloneId),d.find("> thead:gt(0), tr.sticky-false").hide(),d.find("> tbody, > tfoot").remove(),d.find("caption").toggle(p.stickyHeaders_includeCaption),l=f.children().children(),d.css({height:0,width:0,margin:0}),l.find("."+F.css.resizer).remove(),g.addClass("hasStickyHeaders").bind("pagerComplete"+s,function(){C()}),F.bindEvents(e,f.children().children("."+F.css.header)),p.stickyHeaders_appendTo?z(p.stickyHeaders_appendTo).append(w):g.after(w),r.onRenderHeader)for(i=(a=f.children("tr").children()).length,t=0;t<i;t++)r.onRenderHeader.apply(a.eq(t),[t,r,d]);n.add(b).unbind("scroll resize ".split(" ").join(s).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(s),function(e){u("resize"===e.type)}),r.$table.unbind("stickyHeadersUpdate"+s).bind("stickyHeadersUpdate"+s,function(){u(!0)}),p.stickyHeaders_addResizeEvent&&F.addHeaderResizeEvent(e),g.hasClass("hasFilters")&&p.filter_columnFilters&&(g.bind("filterEnd"+s,function(){var e=z(document.activeElement).closest("td"),t=e.parent().children().index(e);w.hasClass(F.css.stickyVis)&&p.stickyHeaders_filteredToTop&&($.scrollTo(0,g.position().top),0<=t&&r.$filters&&r.$filters.eq(t).find("a, select, input").filter(":visible").focus())}),F.filter.bindSearch(g,l.find("."+F.css.filter)),p.filter_hideFilters&&F.filter.hideFilters(r,d)),p.stickyHeaders_addResizeEvent&&g.bind("resize"+r.namespace+"stickyheaders",function(){C()}),u(!0),g.triggerHandler("stickyHeadersInit")}},remove:function(e,t,r){var i=t.namespace+"stickyheaders ";t.$table.removeClass("hasStickyHeaders").unbind("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(i).replace(/\s+/g," ")).next("."+F.css.stickyWrap).remove(),r.$sticky&&r.$sticky.length&&r.$sticky.remove(),z($).add(r.stickyHeaders_xScroll).add(r.stickyHeaders_yScroll).add(r.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(i).replace(/\s+/g," ")),F.addHeaderResizeEvent(e,!0)}})}(e,window),function(d,t){"use strict";var f=d.tablesorter||{};d.extend(f.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),d(function(){var e="<style>body."+f.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+f.css.resizableContainer+" { position: relative; height: 1px; }."+f.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";d("head").append(e)}),f.resizable={init:function(e,t){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable");var r,i,a,l,s=e.$table,n=s.parent(),o=parseInt(s.css("margin-top"),10),c=t.resizable_vars={useStorage:f.storage&&!1!==t.resizable,$wrap:n,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===n.css("overflow")||"scroll"===n.css("overflow")||"auto"===n.css("overflow-x")||"scroll"===n.css("overflow-x"),storedSizes:[]};for(f.resizableReset(e.table,!0),c.tableWidth=s.width(),c.fullWidth=Math.abs(n.width()-c.tableWidth)<20,c.useStorage&&c.overflow&&(f.storage(e.table,"tablesorter-table-original-css-width",c.tableWidth),l=f.storage(e.table,"tablesorter-table-resized-width")||"auto",f.resizable.setWidth(s,l,!0)),t.resizable_vars.storedSizes=a=(c.useStorage?f.storage(e.table,f.css.resizableStorage):[])||[],f.resizable.setWidths(e,t,a),f.resizable.updateStoredSizes(e,t),t.$resizable_container=d('<div class="'+f.css.resizableContainer+'">').css({top:o}).insertBefore(s),i=0;i<e.columns;i++)r=e.$headerIndexed[i],l=f.getColumnData(e.table,e.headers,i),"false"===f.getData(r,l,"resizable")||d('<div class="'+f.css.resizableHandle+'">').appendTo(t.$resizable_container).attr({"data-column":i,unselectable:"on"}).data("header",r).bind("selectstart",!1);f.resizable.bindings(e,t)}},updateStoredSizes:function(e,t){var r,i,a=e.columns,l=t.resizable_vars;for(l.storedSizes=[],r=0;r<a;r++)i=e.$headerIndexed[r],l.storedSizes[r]=i.is(":visible")?i.width():0},setWidth:function(e,t,r){e.css({width:t,"min-width":r?t:"","max-width":r?t:""})},setWidths:function(e,t,r){var i,a,l=t.resizable_vars,s=d(e.namespace+"_extra_headers"),n=e.$table.children("colgroup").children("col");if((r=r||l.storedSizes||[]).length){for(i=0;i<e.columns;i++)f.resizable.setWidth(e.$headerIndexed[i],r[i],l.overflow),s.length&&(a=s.eq(i).add(n.eq(i)),f.resizable.setWidth(a,r[i],l.overflow));(a=d(e.namespace+"_extra_table")).length&&!f.hasWidget(e.table,"scroller")&&f.resizable.setWidth(a,e.$table.outerWidth(),l.overflow)}},setHandlePosition:function(a,l){var s,n=a.$table.height(),e=l.$resizable_container.children(),o=Math.floor(e.width()/2);f.hasWidget(a.table,"scroller")&&(n=0,a.$table.closest("."+f.css.scrollerWrap).children().each(function(){var e=d(this);n+=e.filter('[style*="height"]').length?e.height():e.children("table").height()})),!l.resizable_includeFooter&&a.$table.children("tfoot").length&&(n-=a.$table.children("tfoot").height()),s=3.3<=parseFloat(d.fn.jquery)?0:a.$table.position().left,e.each(function(){var e=d(this),t=parseInt(e.attr("data-column"),10),r=a.columns-1,i=e.data("header");i&&(!i.is(":visible")||!l.resizable_addLastColumn&&f.resizable.checkVisibleColumns(a,t)?e.hide():(t<r||t===r&&l.resizable_addLastColumn)&&e.css({display:"inline-block",height:n,left:i.position().left-s+i.outerWidth()-o}))})},checkVisibleColumns:function(e,t){var r,i=0;for(r=t+1;r<e.columns;r++)i+=e.$headerIndexed[r].is(":visible")?1:0;return 0===i},toggleTextSelection:function(e,t,r){var i=e.namespace+"tsresize";t.resizable_vars.disabled=r,d("body").toggleClass(f.css.resizableNoSelect,r),r?d("body").attr("unselectable","on").bind("selectstart"+i,!1):d("body").removeAttr("unselectable").unbind("selectstart"+i)},bindings:function(l,s){var e=l.namespace+"tsresize";s.$resizable_container.children().bind("mousedown",function(e){var t,r=s.resizable_vars,i=d(l.namespace+"_extra_headers"),a=d(e.target).data("header");t=parseInt(a.attr("data-column"),10),r.$target=a=a.add(i.filter('[data-column="'+t+'"]')),r.target=t,r.$next=e.shiftKey||s.resizable_targetLast?a.parent().children().not(".resizable-false").filter(":last"):a.nextAll(":not(.resizable-false)").eq(0),t=parseInt(r.$next.attr("data-column"),10),r.$next=r.$next.add(i.filter('[data-column="'+t+'"]')),r.next=t,r.mouseXPosition=e.pageX,f.resizable.updateStoredSizes(l,s),f.resizable.toggleTextSelection(l,s,!0)}),d(document).bind("mousemove"+e,function(e){var t=s.resizable_vars;t.disabled&&0!==t.mouseXPosition&&t.$target&&(s.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){f.resizable.mouseMove(l,s,e)},isNaN(s.resizable_throttle)?5:s.resizable_throttle)):f.resizable.mouseMove(l,s,e))}).bind("mouseup"+e,function(){s.resizable_vars.disabled&&(f.resizable.toggleTextSelection(l,s,!1),f.resizable.stopResize(l,s),f.resizable.setHandlePosition(l,s))}),d(t).bind("resize"+e+" resizeEnd"+e,function(){f.resizable.setHandlePosition(l,s)}),l.$table.bind("columnUpdate pagerComplete resizableUpdate ".split(" ").join(e+" "),function(){f.resizable.setHandlePosition(l,s)}).bind("resizableReset"+e,function(){f.resizableReset(l.table)}).find("thead:first").add(d(l.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+e,function(){var e=0===s.resizable_vars.storedSizes.length;return f.resizableReset(l.table),f.resizable.setHandlePosition(l,s),s.resizable_vars.storedSizes=[],e})},mouseMove:function(e,t,r){if(0!==t.resizable_vars.mouseXPosition&&t.resizable_vars.$target){var i,a=0,l=t.resizable_vars,s=l.$next,n=l.storedSizes[l.target],o=r.pageX-l.mouseXPosition;if(l.overflow){if(0<n+o){for(l.storedSizes[l.target]+=o,f.resizable.setWidth(l.$target,l.storedSizes[l.target],!0),i=0;i<e.columns;i++)a+=l.storedSizes[i];f.resizable.setWidth(e.$table.add(d(e.namespace+"_extra_table")),a)}s.length||(l.$wrap[0].scrollLeft=e.$table.width())}else l.fullWidth?(l.storedSizes[l.target]+=o,l.storedSizes[l.next]-=o):l.storedSizes[l.target]+=o,f.resizable.setWidths(e,t);l.mouseXPosition=r.pageX,e.$table.triggerHandler("stickyHeadersUpdate")}},stopResize:function(e,t){var r=t.resizable_vars;f.resizable.updateStoredSizes(e,t),r.useStorage&&(f.storage(e.table,f.css.resizableStorage,r.storedSizes),f.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),r.mouseXPosition=0,r.$target=r.$next=null,e.$table.triggerHandler("stickyHeadersUpdate"),e.$table.triggerHandler("resizableComplete")}},f.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_includeFooter:!0,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,r,i){f.resizable.init(r,i)},format:function(e,t,r){f.resizable.setHandlePosition(t,r)},remove:function(e,t,r,i){if(r.$resizable_container){var a=t.namespace+"tsresize";t.$table.add(d(t.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+a),r.$resizable_container.remove(),f.resizable.toggleTextSelection(t,r,!1),f.resizableReset(e,i),d(document).unbind("mousemove"+a+" mouseup"+a)}}}),f.resizableReset=function(l,s){d(l).each(function(){var e,t,r=this.config,i=r&&r.widgetOptions,a=i.resizable_vars;if(l&&r&&r.$headerIndexed.length){for(a.overflow&&a.tableWidth&&(f.resizable.setWidth(r.$table,a.tableWidth,!0),a.useStorage&&f.storage(l,"tablesorter-table-resized-width",a.tableWidth)),e=0;e<r.columns;e++)t=r.$headerIndexed[e],i.resizable_widths&&i.resizable_widths[e]?f.resizable.setWidth(t,i.resizable_widths[e],a.overflow):t.hasClass("resizable-false")||f.resizable.setWidth(t,"",a.overflow);r.$table.triggerHandler("stickyHeadersUpdate"),f.storage&&!s&&f.storage(this,f.css.resizableStorage,[])}})}}(e,window),function(r){"use strict";var c=r.tablesorter||{};function d(e){var t=c.storage(e.table,"tablesorter-savesort");return t&&t.hasOwnProperty("sortList")&&r.isArray(t.sortList)?t.sortList:[]}function f(e,t){return(t||d(e)).join(",")!==e.sortList.join(",")}c.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(e,t,r,i){t.format(e,r,i,!0)},format:function(t,e,r,i){var a,l=e.$table,s=!1!==r.saveSort,n={sortList:e.sortList},o=c.debug(e,"saveSort");o&&(a=new Date),l.hasClass("hasSaveSort")?s&&t.hasInitialized&&c.storage&&f(e)&&(c.storage(t,"tablesorter-savesort",n),o&&console.log("saveSort >> Saving last sort: "+e.sortList+c.benchmark(a))):(l.addClass("hasSaveSort"),n="",c.storage&&(n=d(e),o&&console.log('saveSort >> Last sort loaded: "'+n+'"'+c.benchmark(a)),l.bind("saveSortReset",function(e){e.stopPropagation(),c.storage(t,"tablesorter-savesort","")})),i&&n&&0<n.length?e.sortList=n:t.hasInitialized&&n&&0<n.length&&f(e,n)&&c.sortOn(e,n))},remove:function(e,t){t.$table.removeClass("hasSaveSort"),c.storage&&c.storage(e,"tablesorter-savesort","")}})}(e),e.tablesorter});return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-extract.min.js b/web/_static/tablesorter/js/parsers/parser-date-extract.min.js
new file mode 100644
index 0000000..b2d85bb
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-extract.min.js
@@ -0,0 +1,11 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: Extract out date - updated 10/26/2014 (v2.18.0) */
+!function(e){"use strict";var a=/[A-Z]{3,10}\.?\s+\d{1,2},?\s+(?:\d{4})(?:\s+\d{1,2}:\d{2}(?::\d{2})?(?:\s+[AP]M)?)?/i,n=/(\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,i=/(\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,s=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,d=/(\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,c=/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/;
+/*! extract US Long Date */e.tablesorter.addParser({id:"extractUSLongDate",is:function(){return!1},format:function(e){var t,r=e?e.match(a):e;return r&&(t=new Date(r[0]))instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),
+/*! extract MMDDYYYY */
+e.tablesorter.addParser({id:"extractMMDDYYYY",is:function(){return!1},format:function(e){var t,r=e?e.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(n):e;return r&&(t=new Date(r[0]))instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),
+/*! extract DDMMYYYY */
+e.tablesorter.addParser({id:"extractDDMMYYYY",is:function(){return!1},format:function(e){var t,r=e?e.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(i):e;return r&&(t=new Date(r[0].replace(s,"$2/$1/$3")))instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"}),
+/*! extract YYYYMMDD */
+e.tablesorter.addParser({id:"extractYYYYMMDD",is:function(){return!1},format:function(e){var t,r=e?e.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(d):e;return r&&(t=new Date(r[0].replace(c,"$2/$3/$1")))instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-iso8601.min.js b/web/_static/tablesorter/js/parsers/parser-date-iso8601.min.js
new file mode 100644
index 0000000..fe116cb
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-iso8601.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: ISO-8601 date - updated 10/26/2014 (v2.18.0) */
+!function(e){"use strict";var s=/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/;e.tablesorter.addParser({id:"iso8601date",is:function(e){return!!e&&e.match(s)},format:function(e){var t=e?e.match(s):e;if(t){var r=new Date(t[1],0,1);return t[3]&&r.setMonth(t[3]-1),t[5]&&r.setDate(t[5]),t[7]&&r.setHours(t[7]),t[8]&&r.setMinutes(t[8]),t[10]&&r.setSeconds(t[10]),t[12]&&r.setMilliseconds(1e3*Number("0."+t[12])),r.getTime()}return e},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-month.min.js b/web/_static/tablesorter/js/parsers/parser-date-month.min.js
new file mode 100644
index 0000000..14c465d
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-month.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: Month - updated 11/22/2015 (v2.24.6) */
+!function(){"use strict";var c=jQuery.tablesorter;c.dates||(c.dates={}),c.dates.months||(c.dates.months={}),c.dates.months.en={1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},c.addParser({id:"month",is:function(){return!1},format:function(e,t,n,a){if(e){var r,o,s=t.config,i=s.globalize&&(s.globalize[a]||s.globalize)||{},u=c.dates.months[i.lang||"en"];for(o in s.ignoreCase&&(e=e.toLowerCase()),u)if("string"==typeof o&&(r=u[o],s.ignoreCase&&(r=r.toLowerCase()),e.match(r)))return parseInt(o,10)}return e},type:"numeric"})}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-range.min.js b/web/_static/tablesorter/js/parsers/parser-date-range.min.js
new file mode 100644
index 0000000..4cd6f11
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-range.min.js
@@ -0,0 +1,11 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: date ranges -updated 11/22/2015 (v2.24.6) */
+!function(e){"use strict";var u,f=e.tablesorter,i=/(\d{1,2}[-\s]\d{1,2}[-\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/gi,d=/(\d{1,2}[-\s]\d{1,2}[-\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/gi,o=/(\d{1,2})[-\s](\d{1,2})[-\s](\d{4})/,c=/(\d{4}[-\s]\d{1,2}[-\s]\d{1,2}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/gi,g=/(\d{4})[-\s](\d{1,2})[-\s](\d{1,2})/,l=/(\d{1,2}\s+\w+\s+\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s\w+)?)?)/g,p=/(\d{1,2})\s+(\w+)\s+(\d{4})/;
+/*! date-range MMDDYYYY */e.tablesorter.addParser({id:"date-range-mdy",is:function(){return!1},format:function(e){var t,r,a,n,s=[];if(n=(r=e.replace(/\s+/g," ").replace(/[\/\-.,]/g,"-").match(i))&&r.length){for(a=0;a<n;a++)t=new Date(r[a]),s.push(t instanceof Date&&isFinite(t)?t.getTime():r[a]);return s.sort().join(" - ")}return e},type:"text"}),
+/*! date-range DDMMYYYY */
+e.tablesorter.addParser({id:"date-range-dmy",is:function(){return!1},format:function(e){var t,r,a,n,s=[];if(n=(r=e.replace(/\s+/g," ").replace(/[\/\-.,]/g,"-").match(d))&&r.length){for(a=0;a<n;a++)t=new Date((""+r[a]).replace(o,"$2/$1/$3")),s.push(t instanceof Date&&isFinite(t)?t.getTime():r[a]);return s.sort().join(" - ")}return e},type:"text"}),
+/*! date-range DDMMYYYY */
+e.tablesorter.addParser({id:"date-range-ymd",is:function(){return!1},format:function(e){var t,r,a,n,s=[];if(n=(r=e.replace(/\s+/g," ").replace(/[\/\-.,]/g,"-").match(c))&&r.length){for(a=0;a<n;a++)t=new Date((""+r[a]).replace(g,"$2/$3/$1")),s.push(t instanceof Date&&isFinite(t)?t.getTime():r[a]);return s.sort().join(" - ")}return e},type:"text"}),f.dates||(f.dates={}),f.dates.months||(f.dates.months={}),f.dates.months.en={1:"Jan",2:"Feb",3:"Mar",4:"Apr",5:"May",6:"Jun",7:"Jul",8:"Aug",9:"Sep",10:"Oct",11:"Nov",12:"Dec"},u=function(e,t,r){var a,n,s=t.globalize&&(t.globalize[r]||t.globalize)||{},i=f.dates.months[s.lang||"en"];for(n in t.ignoreCase&&(e=e.toLowerCase()),i)if("string"==typeof n&&(a=i[n],t.ignoreCase&&(a=a.toLowerCase()),e.match(a)))return parseInt(n,10);return e},
+/*! date-range "dd MMM yyyy - dd MMM yyyy" */
+f.addParser({id:"date-range-dMMMyyyy",is:function(){return!1},format:function(e,t,r,a){var n,s,i,d,o=[],c=e.replace(/\s+/g," ").match(l),g=c&&c.length;if(g){for(d=0;d<g;d++)n="",(i=c[d].match(p))&&4<=i.length&&(i.shift(),s=u(i[1],t.config,a),isNaN(s)||(c[d]=c[d].replace(i[1],s)),n=new Date((""+c[d]).replace(f.regex.shortDateXXY,"$3/$2/$1"))),o.push(n instanceof Date&&isFinite(n)?n.getTime():c[d]);return o.sort().join(" - ")}return e},type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-two-digit-year.min.js b/web/_static/tablesorter/js/parsers/parser-date-two-digit-year.min.js
new file mode 100644
index 0000000..73bf007
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-two-digit-year.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: two digit year - updated 11/26/2016 (v2.28.0) */
+!function(e){"use strict";var r=e.tablesorter,u=(new Date).getFullYear();r.defaults.dataRange="",r.dates||(r.dates={}),r.dates.regxxxxyy=/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{2})/,r.dates.regyyxxxx=/(\d{2})[\/\s](\d{1,2})[\/\s](\d{1,2})/,r.formatDate=function(e,t,r,a){if(e){var n,d,s=e.replace(/\s+/g," ").replace(/[-.,]/g,"/").replace(t,r),i=new Date(s);if(i instanceof Date&&isFinite(i)){for(n=i.getFullYear(),d=a&&a.config.dateRange||50;d<u-n;)n+=100;return i.setFullYear(n)}}return e},e.tablesorter.addParser({id:"ddmmyy",is:function(){return!1},format:function(e,t){return r.formatDate(e,r.dates.regxxxxyy,"$2/$1/19$3",t)},type:"numeric"}),e.tablesorter.addParser({id:"mmddyy",is:function(){return!1},format:function(e,t){return r.formatDate(e,r.dates.regxxxxyy,"$1/$2/19$3",t)},type:"numeric"}),e.tablesorter.addParser({id:"yymmdd",is:function(){return!1},format:function(e,t){return r.formatDate(e,r.dates.regyyxxxx,"$2/$3/19$1",t)},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date-weekday.min.js b/web/_static/tablesorter/js/parsers/parser-date-weekday.min.js
new file mode 100644
index 0000000..d66fa75
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date-weekday.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: weekday - updated 11/22/2015 (v2.24.6) */
+!function(w){"use strict";var y=w.tablesorter;y.dates||(y.dates={}),y.dates.weekdays||(y.dates.weekdays={}),y.dates.weekdays.en={sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},y.dates.weekStartList={sun:"1995",mon:"1996",fri:"1999",sat:"2000"},y.dates.weekdaysXref=["sun","mon","tue","wed","thu","fri","sat"],y.addParser({id:"weekday",is:function(){return!1},format:function(e,t,a,r){if(e){var n,s,i,d=t.config,o=d.globalize&&(d.globalize[r]||d.globalize)||{},u=y.dates.weekdays[o.lang||"en"],f=y.dates.weekdaysXref;for(s in d.ignoreCase&&(e=e.toLowerCase()),u)if("string"==typeof s&&(n=u[s],d.ignoreCase&&(n=n.toLowerCase()),e.match(n)))return-1<(i=w.inArray(s,f))?i:e}return e},type:"numeric"}),y.addParser({id:"weekday-index",is:function(){return!1},format:function(e,t){if(e){var a=t.config,r=new Date(e);if(r instanceof Date&&isFinite(r))return new Date("1/"+(r.getDay()+1)+"/"+y.dates.weekStartList[a.weekStarts||"sun"])}return e},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-date.min.js b/web/_static/tablesorter/js/parsers/parser-date.min.js
new file mode 100644
index 0000000..e61936f
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-date.min.js
@@ -0,0 +1,7 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: dates - updated 5/24/2017 (v2.28.11) */
+!function(e){"use strict";
+/*! Sugar (https://sugarjs.com/docs/#/DateParsing) */e.tablesorter.addParser({id:"sugar",is:function(){return!1},format:function(e){var t=Date.create||Sugar.Date.create,r=t?t(e):e?new Date(e):e;return r instanceof Date&&isFinite(r)?r.getTime():e},type:"numeric"}),
+/*! Datejs (http://www.datejs.com/) */
+e.tablesorter.addParser({id:"datejs",is:function(){return!1},format:function(e){var t=Date.parse?Date.parse(e):e?new Date(e):e;return t instanceof Date&&isFinite(t)?t.getTime():e},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-duration.min.js b/web/_static/tablesorter/js/parsers/parser-duration.min.js
new file mode 100644
index 0000000..7afe723
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-duration.min.js
@@ -0,0 +1,6 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: duration & countdown - updated 2/7/2015 (v2.19.0) */
+!function(e){"use strict";e.tablesorter.addParser({id:"duration",is:function(){return!1},format:function(e,r){var t,n,s=r.config,i="",o="",a=s.durationLength||4,u=new Array(a+1).join("0"),d=(s.durationLabels||"(?:years|year|y),(?:days|day|d),(?:hours|hour|h),(?:minutes|minute|min|m),(?:seconds|second|sec|s)").split(/\s*,\s*/),c=d.length;if(!s.durationRegex){for(t=0;t<c;t++)i+="(?:(\\d+)\\s*"+d[t]+"\\s*)?";s.durationRegex=new RegExp(i,"i")}for(n=(s.usNumberFormat?e.replace(/,/g,""):e.replace(/(\d)(?:\.|\s*)(\d)/g,"$1$2")).match(s.durationRegex),t=1;t<c+1;t++)o+=(u+(n[t]||0)).slice(-a);return o},type:"text"}),
+/*! Countdown parser ( hh:mm:ss ) */
+e.tablesorter.addParser({id:"countdown",is:function(){return!1},format:function(e,r){for(var t=r.config.durationLength||4,n=new Array(t+1).join("0"),s=e.split(/\s*:\s*/),i=s.length,o=[];i;)o.push((n+(s[--i]||0)).slice(-t));return o.length?o.reverse().join(""):e},type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-feet-inch-fraction.min.js b/web/_static/tablesorter/js/parsers/parser-feet-inch-fraction.min.js
new file mode 100644
index 0000000..accc777
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-feet-inch-fraction.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: distance */
+!function(a){"use strict";var n=a.tablesorter;n.symbolRegex=/[\u215b\u215c\u215d\u215e\u00bc\u00bd\u00be]/g,n.processFractions=function(t,e){if(t){var r,s=0;t=a.trim(t.replace(/\"/,"")),/\s/.test(t)&&(s=n.formatFloat(t.split(" ")[0],e),t=a.trim(t.substring(t.indexOf(" "),t.length))),/\//g.test(t)?(r=t.split("/"),t=s+parseInt(r[0],10)/parseInt(r[1]||1,10)):n.symbolRegex.test(t)&&(t=s+t.replace(n.symbolRegex,function(t){return{"⅛":".125","⅜":".375","⅝":".625","⅞":".875","¼":".25","½":".5","¾":".75"}[t]}))}return t||0},a.tablesorter.addParser({id:"distance",is:function(){return!1},format:function(t,e){if(""===t)return"";var r=/^\s*\S*(\s+\S+)?\s*\'/.test(t)?t.split(/\'/):[0,t],s=n.processFractions(r[0],e),a=n.processFractions(r[1],e);return/[\'\"]/.test(t)?parseFloat(s)+(parseFloat(a)/12||0):parseFloat(s)+parseFloat(a)},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-file-type.min.js b/web/_static/tablesorter/js/parsers/parser-file-type.min.js
new file mode 100644
index 0000000..5314f83
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-file-type.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: filetype - updated 11/10/2015 (v2.24.4) */
+!function(c){"use strict";c.tablesorter.fileTypes={separator:"|",equivalents:{"3D Image":"3dm|3ds|dwg|max|obj",Audio:"aif|aac|ape|flac|la|m4a|mid|midi|mp2|mp3|ogg|ra|raw|rm|wav|wma",Compressed:"7z|bin|cab|cbr|gz|gzip|iso|lha|lz|rar|tar|tgz|zip|zipx|zoo",Database:"csv|dat|db|dbf|json|ldb|mdb|myd|pdb|sql|tsv|wdb|wmdb|xlr|xls|xlsx|xml",Development:"asm|c|class|cls|cpp|cc|cs|cxx|cbp|cs|dba|fla|h|java|lua|pl|py|pyc|pyo|sh|sln|r|rb|vb",Document:"doc|docx|odt|ott|pages|pdf|rtf|tex|wpd|wps|wrd|wri",Executable:"apk|app|com|exe|gadget|lnk|msi",Fonts:"eot|fnt|fon|otf|ttf|woff",Icons:"ani|cur|icns|ico",Images:"bmp|gif|jpg|jpeg|jpe|jp2|pic|png|psd|tga|tif|tiff|wmf|webp",Presentation:"pps|ppt",Published:"chp|epub|lit|pub|ppp|fm|mobi",Script:"as|bat|cgi|cmd|jar|js|lua|scpt|scptd|sh|vbs|vb|wsf",Styles:"css|less|sass",Text:"info|log|md|markdown|nfo|tex|text|txt",Vectors:"awg|ai|eps|cdr|ps|svg",Video:"asf|avi|flv|m4v|mkv|mov|mp4|mpe|mpeg|mpg|ogg|rm|rv|swf|vob|wmv",Web:"asp|aspx|cer|cfm|htm|html|php|url|xhtml"}},c.tablesorter.addParser({id:"filetype",is:function(){return!1},format:function(t,e){var s,a=e.config.widgetOptions,p=a.group_separator||"-",r=t.lastIndexOf("."),i=c.tablesorter.fileTypes.separator,o=c.tablesorter.fileTypes.matching,n=c.tablesorter.fileTypes.equivalents;if(o||(s=[],c.each(n,function(t,e){s.push(e)}),o=c.tablesorter.fileTypes.matching=i+s.join(i)+i),0<=r&&(s=i+t.substring(r+1,t.length)+i,0<=o.indexOf(s)))for(r in n)if(0<=(i+n[r]+i).indexOf(s))return r+("/"!==p.toString().charAt(0)?a.group_separator:"-")+t;return t},type:"text"}),c.tablesorter.addParser({id:"file-extension",is:function(){return!1},format:function(t){var e,s=t.split(".");return s.length?(e=s.pop(),s.unshift(e),s.join(".")):t},type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-globalize.min.js b/web/_static/tablesorter/js/parsers/parser-globalize.min.js
new file mode 100644
index 0000000..cfe9c67
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-globalize.min.js
@@ -0,0 +1,7 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: jQuery Globalize - updated 11/2/2015 (v2.24.1) */
+!function(b){"use strict";
+/*! jQuery Globalize date parser (https://github.com/jquery/globalize#date-module) */b.tablesorter.addParser({id:"globalize-date",is:function(){return!1},format:function(e,l,a,o){var r,i,t=l.config,n=t.globalize&&(t.globalize[o]||t.globalize)||{};return Globalize&&(r="object"==typeof n.Globalize?n.Globalize:Globalize(n.lang||"en"),n.Globalize||(n.Globalize=r)),(i=r&&r.dateParser?r.dateParser(n)(e):e?new Date(e):e)instanceof Date&&isFinite(i)?i.getTime():e},type:"numeric"}),
+/*! jQuery Globalize number parser (https://github.com/jquery/globalize#number-module) */
+b.tablesorter.addParser({id:"globalize-number",is:function(){return!1},format:function(e,l,a,o){var r,i,t=l.config,n=t.globalize&&(t.globalize[o]||t.globalize)||{};return Globalize&&(r="object"==typeof n.Globalize?n.Globalize:Globalize(n.lang||"en"),n.Globalize||(n.Globalize=r)),i=r&&r.numberParser?r.numberParser(n)(e):e?b.tablesorter.formatFloat((e||"").replace(/[^\w,. \-()]/g,""),l):e,e&&"number"==typeof i?i:e},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-huge-numbers.min.js b/web/_static/tablesorter/js/parsers/parser-huge-numbers.min.js
new file mode 100644
index 0000000..038110e
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-huge-numbers.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: hugeNumbers - updated 3/1/2016 (v2.25.5) */
+!function(){"use strict";jQuery.tablesorter.addParser({id:"hugeNumbers",is:function(){return!1},format:function(e){return e.replace(/\B(?=(\d{12})+(?!\d))/g,",")},type:"text"})}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-ignore-articles.min.js b/web/_static/tablesorter/js/parsers/parser-ignore-articles.min.js
new file mode 100644
index 0000000..8c0a1a0
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-ignore-articles.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: ignoreArticles - updated 9/15/2014 (v2.17.8) */
+!function(o){"use strict";var g=o.tablesorter;g.ignoreArticles={en:"the, a, an",de:"der, die, das, des, dem, den, ein, eine, einer, eines, einem, einen",nl:"de, het, de, een",es:"el, la, lo, los, las, un, una, unos, unas",pt:"o, a, os, as, um, uma, uns, umas",fr:"le, la, l'_, les, un, une, des",it:"il, lo, la, l'_, i, gli, le, un', uno, una, un",hu:"a, az, egy"},g.addParser({id:"ignoreArticles",is:function(){return!1},format:function(e,r,s,a){var n,i,t,l=r.config,d=e||"";return l.headers&&l.headers[a]&&l.headers[a].ignoreArticlesRegex||(l.headers||(l.headers={}),l.headers[a]||(l.headers[a]={}),t=g.getData(l.$headers.eq(a),g.getColumnData(r,l.headers,a),"ignoreArticles"),n=(g.ignoreArticles[t]||"the, a, an")+"",l.headers[a].ignoreArticlesRegex=new RegExp("^("+o.trim(n.split(/\s*\,\s*/).join("\\s|")+"\\s").replace("_\\s","")+")","i"),i=g.getData(l.$headers.eq(a),g.getColumnData(r,l.headers,a),"ignoreArticlesExcept"),l.headers[a].ignoreArticlesRegex2=""!==i?new RegExp("^("+i.replace(/\s/g,"\\s")+")","i"):""),!(n=l.headers[a].ignoreArticlesRegex).test(d)||(i=l.headers[a].ignoreArticlesRegex2)&&i.test(d)?d:d.replace(n,"")},type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-image.min.js b/web/_static/tablesorter/js/parsers/parser-image.min.js
new file mode 100644
index 0000000..fe05a1a
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-image.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: image - new 7/17/2014 (v2.17.5) */
+!function(i){"use strict";i.tablesorter.addParser({id:"image",is:function(){return!1},format:function(t,r,e){return i(e).find("img").attr(r.config.imgAttr||"alt")||t},parsed:!0,type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-input-select.min.js b/web/_static/tablesorter/js/parsers/parser-input-select.min.js
new file mode 100644
index 0000000..3176747
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-input-select.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: input & select - updated 2018-07-10 (v2.30.7) */
+!function(p){"use strict";p.tablesorter.addParser({id:"inputs",is:function(){return!1},format:function(e,t,a){var r=p(a).find("input");return r.length?r.val():e},parsed:!0,type:"text"}),p.tablesorter.addParser({id:"inputs-numeric",is:function(){return!1},format:function(e,t,a){var r=p(a).find("input"),n=r.length?r.val():e,i=p.tablesorter.formatFloat((n||"").replace(/[^\w,. \-()]/g,""),t);return e&&"number"==typeof i?i:e?p.trim(e&&t.config.ignoreCase?e.toLocaleLowerCase():e):e},parsed:!0,type:"numeric"}),p.tablesorter.addParser({id:"checkbox",is:function(){return!1},format:function(e,t,a){var r=p(a),n=t.config.widgetOptions,i=n.group_checkbox?n.group_checkbox:["checked","unchecked"],s=r.find('input[type="checkbox"]'),o=s.length?s[0].checked:"";return s.length?i[o?0:1]:e},parsed:!0,type:"text"}),p.tablesorter.addParser({id:"radio",is:function(){return!1},format:function(e,t,a){var r=p(a).find("input:checked");return r.length?r.val():e},parsed:!0,type:"text"}),p.tablesorter.addParser({id:"select",is:function(){return!1},format:function(e,t,a){var r=p(a).find("select");return r.length?r.val():e},parsed:!0,type:"text"}),p.tablesorter.addParser({id:"select-text",is:function(){return!1},format:function(e,t,a){var r=p(a).find("select");return r.length?r.find("option:selected").text()||"":e},parsed:!0,type:"text"}),p.tablesorter.addParser({id:"textarea",is:function(){return!1},format:function(e,t,a){var r=p(a).find("textarea");return r.length?r.val():e},parsed:!0,type:"text"}),p.tablesorter.defaults.checkboxClass="",p.tablesorter.defaults.checkboxVisible="",p(function(){if(p.fn.on){var h=function(e,t,a,r){e.toggleClass(t+"-"+a,r),(e[0].className||"").match(t+"-")?e.addClass(t):e.removeClass(t)},u=function(e,t){if(e.length&&"INPUT"!==e[0].nodeName&&(e=e.find('input[type="checkbox"]')),e.length){var a=window.navigator.userAgent;"indeterminate"===t?(e.prop("checked",!(-1<a.indexOf("Trident/")||-1<a.indexOf("Edge/"))),e.prop("indeterminate",!0)):(e.prop("checked",t),e.prop("indeterminate",!1))}},f=function(e,r){var n,i=e.children("tbody").children(":visible"),s=i.length,t=e[0].config,a=t&&t.widgetOptions,o=t&&t.$headers.add(p(t.namespace+"_extra_headers"))||e.children("thead"),c=a&&a.$sticky;o.find('input[type="checkbox"]').each(function(){c&&(n=c.find('[data-column="'+e+'"]'));var e=p(this).closest("td, th").attr("data-column"),t=i.filter("."+r+"-"+e).length,a=t===s&&0<s;0===t||a?(u(p(this),a),n&&u(n,a)):(u(p(this),"indeterminate"),n&&u(n,"indeterminate"))})};p("table").on("tablesorter-initialized updateComplete",function(){this.tablesorterBusy=!1;var e=".parser-forms";p(this).addClass(this.config.namespace.slice(1)).children("tbody").off(e).on("mouseleave"+e,function(e){"TBODY"===e.target.nodeName&&p(":focus").blur()}).on("focus"+e,"select, input:not([type=checkbox]), textarea",function(e){var t=p(e.target).closest("tr"),a=t.closest("table")[0].config;!a||a&&a.ignoreChildRow&&t.hasClass(a.cssChildRow)||p(this).data("ts-original-value",this.value)}).on("blur"+e,"input:not([type=checkbox]), textarea",function(e){var t=p(e.target).closest("tr"),a=t.closest("table")[0].config;!a||a&&a.ignoreChildRow&&t.hasClass(a.cssChildRow)||(this.value=p(this).data("ts-original-value"))}).on("change keyup ".split(" ").join(e+" "),"select, input, textarea",function(e){var t=p(this).closest("tr"),a=t.closest("table")[0].config;if(a&&!(a&&a.ignoreChildRow&&t.hasClass(a.cssChildRow)))if(27!==e.which||"INPUT"===this.nodeName&&"checkbox"===this.type){if("change"===e.type||"keyup"===e.type&&13===e.which&&("INPUT"===e.target.nodeName||"TEXTAREA"===e.target.nodeName&&e.altKey)){var r,n=p(e.target),i="checkbox"===e.target.type,s=n.closest("td"),o=s[0].cellIndex,c=a.table.tablesorterBusy,l=a.$headerIndexed&&a.$headerIndexed[o]||[],d=i?e.target.checked:n.val();if(p.isEmptyObject(a)||!1!==c)return;if(i&&(r=a.checkboxClass||"checked",h(s.closest("tr"),r,o,d),f(a.$table,r)),l.length&&(l.hasClass("parser-false")||l.hasClass("sorter-false")&&l.hasClass("filter-false"))||"change"===e.type&&a.table.isUpdating)return;(a&&d!==n.data("ts-original-value")||i)&&(n.data("ts-original-value",d),a.table.tablesorterBusy=!0,p.tablesorter.updateCell(a,s,void 0,function(){a.$table,a.table.tablesorterBusy=!1}))}}else this.value=p(this).data("ts-original-value")}),p(this).children("thead").find('input[type="checkbox"]')&&p(this).off(e).on("tablesorter-ready"+e,function(){var e,t=p(this),a=t.length&&t[0].config;p.isEmptyObject(a)||(this.tablesorterBusy=!0,e=a&&a.checkboxClass||"checked",f(t,e),this.tablesorterBusy=!1)}).children("thead").add(this.config.widgetOptions.$sticky).off(e).on("click"+e+" change"+e,'input[type="checkbox"]',function(e){var t,a,r,n,i,s,o=p(this),c=this.checked,l=o.closest("table"),d=l.length&&l[0].className.match(/(tablesorter\w+)_extra_table/);return d&&(d=d[1],l=p("."+d+":not(."+d+"_extra_table)")),t=l.length&&l[0].config,!(!l.length||!t||l[0].tablesorterBusy)&&(r=parseInt(o.closest("td, th").attr("data-column"),10),i="checkbox"===t.parsers[r].id,a=t.checkboxVisible,l[0].tablesorterBusy=!0,u(n=l.children("tbody").children("tr"+(void 0===a||!0===a?":visible":"")).children(":nth-child("+(r+1)+")"),c),s=t.checkboxClass||"checked",n.each(function(){h(p(this).closest("tr"),s,r,c)}),d?u(l.children("thead").find('[data-column="'+r+'"]'),c):t.widgetOptions.$sticky&&u(t.widgetOptions.$sticky.find("thead").find('[data-column="'+r+'"]'),c),f(l,s),i?p.tablesorter.update(t,void 0,function(){l[0].tablesorterBusy=!1}):l[0].tablesorterBusy=!1,!0)})})}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-leading-zeros.min.js b/web/_static/tablesorter/js/parsers/parser-leading-zeros.min.js
new file mode 100644
index 0000000..e69f342
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-leading-zeros.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: leading zeros - updated 4/2/2017 (v2.28.6) */
+!function(){"use strict";var i=jQuery.tablesorter;i.addParser({id:"leadingZeros",is:function(){return!1},format:function(e,t){var r=(e||"").replace(i.regex.nondigit,""),n=i.formatFloat(r,t),a=n.toString();return isNaN(n)||n!=r||r.length===a.length||(n-=1e-10*(e.length-a.length)),n},type:"number"})}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-metric.min.js b/web/_static/tablesorter/js/parsers/parser-metric.min.js
new file mode 100644
index 0000000..37d70b5
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-metric.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: metric */
+!function(h){"use strict";var f={"Y|Yotta|yotta":[1e24,Math.pow(1024,8)],"Z|Zetta|zetta":[1e21,Math.pow(1024,7)],"E|Exa|exa":[1e18,Math.pow(1024,6)],"P|Peta|peta":[1e15,Math.pow(1024,5)],"T|Tera|tera":[1e12,Math.pow(1024,4)],"G|Giga|giga":[1e9,Math.pow(1024,3)],"M|Mega|mega":[1e6,Math.pow(1024,2)],"k|Kilo|kilo":[1e3,1024],"h|hecto":[100,100],"da|deka":[10,10],"d|deci":[.1,.1],"c|centi":[.01,.01],"m|milli":[.001,.001],"µ|micro":[1e-6,1e-6],"n|nano":[1e-9,1e-9],"p|pico":[1e-12,1e-12],"f|femto":[1e-15,1e-15],"a|atto":[1e-18,1e-18],"z|zepto":[1e-21,1e-21],"y|yocto":[1e-24,1e-24]},l=/^[b|bit|byte|o|octet]/i;h.tablesorter.addParser({id:"metric",is:function(){return!1},format:function(e,t,a,o){var r,i,c,n,m="m|meter",p=h.tablesorter.formatFloat(e.replace(/[^\w,. \-()]/g,""),t),d=t.config.$headerIndexed[o],s=d.data("metric");if(s||(r=(d.attr("data-metric-name")||m).split("|"),c=d.attr("data-metric-name-full")||"",n=d.attr("data-metric-name-abbr")||"",s=[c||r[1]||r[0].substring(1),n||r[0]],i=l.test(s.join("")),s[2]=new RegExp("(\\d+)(\\s+)?([Zz]etta|[Ee]xa|[Pp]eta|[Tt]era|[Gg]iga|[Mm]ega|kilo|hecto|deka|deci|centi|milli|micro|nano|pico|femto|atto|zepto|yocto)("+((""===c?"":c+"|"+n)||(i?s[0].toLowerCase()+"|"+s[0].toUpperCase():s[0])+"|"+(i?s[1].toLowerCase()+"|"+s[1].toUpperCase():s[1]))+")"),s[3]=new RegExp("(\\d+)(\\s+)?(Z|E|P|T|G|M|k|h|da|d|c|m|µ|n|p|f|a|z|y)("+(n||(i?s[1].toLowerCase()+"|"+s[1].toUpperCase():s[1]))+")"),d.data("metric",s)),r=e.match(s[2])||e.match(s[3]))for(m in f)if(r[3].match(m))return i=l.test(r[4])?1:0,p*f[m][i];return p},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-named-numbers.min.js b/web/_static/tablesorter/js/parsers/parser-named-numbers.min.js
new file mode 100644
index 0000000..e474b82
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-named-numbers.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: namedNumbers - updated 10/26/2014 (v2.18.0) */
+!function(d){"use strict";var g,v,c={negative:["negative","minus"],numbers:{zero:0,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fourty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90},hundred:"hundred",powers:{thousand:1e3,million:1e6,billion:1e9,trillion:1e12,quadrillion:1e15,quintillion:1e18,sextillion:1e21,septillion:1e24,octillion:1e27,nonillion:1e30,decillion:1e33,undecillion:1e36,duodecillion:1e39,tredecillion:1e42,quattuordecillion:1e45,quindecillion:1e48,sexdecillion:1e51,septendecillion:1e54,octodecillion:1e57,novemdecillion:1e60,vigintillion:1e63,unvigintillion:1e66,duovigintillion:1e69,trevigintillion:1e72,quattuorvigintillion:1e75,quinvigintillion:1e78,sexvigintillion:1e81,septenvigintillion:1e84,octovigintillion:1e87,novemvigintillion:1e90,trigintillion:1e93,untrigintillion:1e96,duotrigintillion:1e99,googl:1e100}},f=new RegExp("("+c.negative.join("|")+")");d.tablesorter.addParser({id:"namedNumbers",is:function(){return!1},format:function(e,i){v=g=0;var n,t,l,o,r,u,s=(e||"").split(/[\s-]+/),a=s.length;for(n=0;n<a;n++)t=s[n].toLowerCase(),l=i,r=void 0,o=t.replace(/[,."']/g,""),r=d.tablesorter.formatFloat(t||"",l),u=c.powers.hasOwnProperty(o)?c.powers[o]:null,null!==(r="number"==typeof r?r:c.numbers.hasOwnProperty(o)?c.numbers[o]:null)?v+=r:o===c.hundred?v*=100:null!==u&&(g+=v*u,v=0);return(g=(g+v)*(e.match(f)?-1:1))||c.numbers.hasOwnProperty(e)?g:d.tablesorter.formatFloat(e||"",i)},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-network.min.js b/web/_static/tablesorter/js/parsers/parser-network.min.js
new file mode 100644
index 0000000..763539a
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-network.min.js
@@ -0,0 +1,9 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: network - updated 2018-01-10 (v2.29.3) */
+!function(d){"use strict";var e,t,o=d.tablesorter;
+/*! IPv6 Address parser (WIP) */d.extend(o.regex,{},{ipv4Validate:/((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})/,ipv4Extract:/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/,ipv6Validate:/^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/i}),o.defaults.ipv6HexFormat=!1,o.addParser({id:"ipv6Address",is:function(d){return o.regex.ipv6Validate.test(d)},format:function(d,e){var t,a,r,i,f,s=!!e&&("boolean"==typeof e?e:e&&e.config.ipv6HexFormat||!1),n="",p="";if(d=d.replace(/\s*/g,""),o.regex.ipv4Validate.test(d)){for(i=d.match(o.regex.ipv4Extract),a="",t=1;t<i.length;t++)a+=("00"+parseInt(i[t],10).toString(16)).slice(-2)+(2===t?":":"");d=d.replace(o.regex.ipv4Extract,a)}if(-1===d.indexOf("::"))n=d;else{for(r=d.split("::"),t=f=0;t<r.length;t++)f+=r[t].split(":").length;for(n+=r[0]+":",t=0;t<8-f;t++)n+="0000:";n+=r[1]}for(i=n.split(":"),t=0;t<8;t++)i[t]=s?("0000"+i[t]).slice(-4):("00000"+(parseInt(i[t],16)||0)).slice(-5),p+=7!==t?i[t]+":":i[t];return p},type:"text"}),t=function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},e=function(d){var e,t=d?d.split("."):"",a=[],r=t.length;for(e=0;e<r;e++)a.push(("000"+t[e]).slice(-3));return d?a.join("."):d},
+/*! Parser: ipv4Address (a.k.a. ipAddress) */
+o.addParser({id:"ipAddress",is:t,format:e,type:"text"}),o.addParser({id:"ipv4Address",is:t,format:e,type:"text"}),
+/*! Parser: MAC address */
+o.addParser({id:"MAC",is:function(){return!1},format:function(d){var e,t,a=[],r=(d||"").replace(/[:.-]/g,"").match(/\w{2}/g);if(r){for(t=r.length,e=0;e<t;e++)a.push(("000"+parseInt(r[e],16)).slice(-3));return a.join(".")}return d},type:"text"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/parsers/parser-roman.min.js b/web/_static/tablesorter/js/parsers/parser-roman.min.js
new file mode 100644
index 0000000..e4b5222
--- /dev/null
+++ b/web/_static/tablesorter/js/parsers/parser-roman.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Parser: roman - updated 6/28/MMXIV (v2.17.3) */
+!function(c){"use strict";var p=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,m=/\b([MCDLXVI]+\b)/gi,l={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};c.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(r){var t,e=r.toUpperCase().split(""),n=0;if(!r||!p.test(r))return r;for(;e.length;)n+=(t=l[e.shift()])*(t<l[e[0]]?-1:1);return n},type:"numeric"}),c.tablesorter.addParser({id:"roman-ignore",is:function(){return!1},format:function(r,t,e,n){var i,a,o=t.config,s=c.isArray(o.roman_ignore)?o.roman_ignore[n]:0,u=(isNaN(s)?c.trim(r.replace(s,"")):c.trim(r.substring(0,r.length-s))).match(m),f=0;if(!p.test(u))return r;for(u=(a=u[0]).toUpperCase().split("");u.length;)(i=l[u.shift()])&&(f+=i*(i<l[u[0]]?-1:1));return f?r.replace(a,f):r},type:"text"}),c.tablesorter.addParser({id:"roman-extract",is:function(){return!1},format:function(r){var t,e=c.grep(r.split(/\b/),function(r){return p.test(r)?r:""}).join("").match(m),n=0;if(!(e?p.test(e):0))return r;for(e=e[0].toUpperCase().split("");e.length;)(t=l[e.shift()])&&(n+=t*(t<l[e[0]]?-1:1));return n||r},type:"numeric"})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-alignChar.min.js b/web/_static/tablesorter/js/widgets/widget-alignChar.min.js
new file mode 100644
index 0000000..5bd84a8
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-alignChar.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: alignChar - updated 2/7/2015 (v2.19.0) */
+!function(_){"use strict";var e=_.tablesorter;e.alignChar={init:function(i,t,r){t.$headers.filter("["+r.alignChar_charAttrib+"]").each(function(){var n=_(this),a={column:this.column,align:n.attr(r.alignChar_charAttrib),alignIndex:parseInt(n.attr(r.alignChar_indexAttrib)||0,10),adjust:parseFloat(n.attr(r.alignChar_adjustAttrib))||0};a.regex=new RegExp("\\"+a.align,"g"),void 0!==a.align&&(r.alignChar_savedVars[this.column]=a,e.alignChar.setup(i,t,r,a))})},setup:function(n,a,i,t){if(!_.isEmptyObject(a.cache)){var r,e,l,h,g,o,s,d,c,u,f,m,p,C,w=[],b=[];for(r=0;r<a.$tbodies.length;r++)for(u=(s=a.cache[r]).normalized.length,e=0;e<u;e++){if(0<(c=((d=(C=s.row?s.row[e]:s.normalized[e][a.columns].$row).find("td").eq(t.column).text().replace(/[ ]/g," ")).match(t.regex)||[]).length)&&0<t.alignIndex)for(h=Math.min(t.alignIndex,c),g=o=l=0;l++<h;)o=(g=d.indexOf(t.align,g+1))<0?o:g;else o=d.indexOf(t.align);0<=o?(w.push(d.substring(0,o)||""),b.push(d.substring(o,d.length)||"")):(w.push(1<=c&&t.alignIndex>=c?"":d||""),b.push(1<=c&&t.alignIndex>=c&&d||""))}for(f=_.extend([],w).sort(function(n,a){return a.length-n.length})[0],m=_.extend([],b).sort(function(n,a){return a.length-n.length})[0],t.width=t.width||Math.floor(f.length/(f.length+m.length)*100)+t.adjust,f="min-width:"+t.width+"%",m="min-width:"+(100-t.width)+"%",r=0;r<a.$tbodies.length;r++)for(u=(s=a.cache[r]).normalized.length,e=0;e<u;e++)p=_(i.alignChar_wrap).length?_(i.alignChar_wrap).html(t.align)[0].outerHTML:t.align,C=s.row?s.row[e]:s.normalized[e][a.columns].$row,g=b[e].slice(t.align.length),C.find("td").eq(t.column).html('<span class="ts-align-wrap"><span class="ts-align-left" style="'+f+'">'+w[e]+'</span><span class="ts-align-right" style="'+m+'">'+(g.length?p+g:"")+"</span></span>");i.alignChar_initialized=!0}},remove:function(n,a,i){var t,r,e,l,h;if(!_.isEmptyObject(a.cache))for(t=0;t<a.$tbodies.length;t++)for(e=(l=a.cache[t]).normalized.length,r=0;r<e;r++)(h=(l.row?l.row[r]:l.normalized[r][a.columns].$row).find("td").eq(i)).html(h.text().replace(/\s/g," "))}},e.addWidget({id:"alignChar",priority:100,options:{alignChar_wrap:"",alignChar_charAttrib:"data-align-char",alignChar_indexAttrib:"data-align-index",alignChar_adjustAttrib:"data-align-adjust"},init:function(n,a,i,t){t.alignChar_initialized=!1,t.alignChar_savedVars=[],e.alignChar.init(n,i,t),i.$table.on("pagerEnd refreshAlign",function(){i.$headers.filter("["+t.alignChar_charAttrib+"]").each(function(){e.alignChar.remove(n,i,this.column)}),e.alignChar.init(n,i,t)})},format:function(n,a,i){i.alignChar_initialized||a.$table.triggerHandler("refreshAlign")},remove:function(n,a,i,t){t||(a.$headers.filter("["+i.alignChar_charAttrib+"]").each(function(){e.alignChar.remove(n,a,this.column)}),i.alignChar_initialized=!1)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-build-table.min.js b/web/_static/tablesorter/js/widgets/widget-build-table.min.js
new file mode 100644
index 0000000..78ef758
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-build-table.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: Build Table - updated 2018-03-26 (v2.30.2) */
+!function(y){"use strict";var f=y.tablesorter=y.tablesorter||{},_=f.buildTable=function(e,o){y.extend(!0,f.defaults.widgetOptions,_.defaults);function t(e){var t=y.type(e),l=e instanceof y;if("function"==typeof i&&(e=i(e,n)),o.data=e,l||"string"===t){if(l||/<\s*\/tr\s*>/.test(e))return _.html(r,e,n);try{if(e=y.parseJSON(e||"null"))return _.object(r,e,n)}catch(e){}}return"array"===t||"string"===t||"array"===d||"csv"===d?_.csv(r,e,n):_.object(r,e,n)}var l="TABLE"===e.nodeName?y(e):y("<table>").appendTo(e),r=l[0],n=o.widgetOptions=y.extend(!0,{},_.defaults,o.widgetOptions),i=n.build_processing,d=n.build_type,s=n.build_source||o.data,a=f.debug(o,"build");if(r.config=o,!f.buildTable.hasOwnProperty(d)&&""!==d)return a&&console.error("Build >> ERROR: Aborting build table widget, incorrect build type"),!1;s instanceof y?t(y.trim(s.html())):s&&(s.hasOwnProperty("url")||"json"===d)?y.ajax(n.build_source).done(function(e){t(e)}).fail(function(e,t){a&&console.error("Build >> ERROR: Aborting build table widget, failed ajax load"),l.html('<tr><td class="error">'+e.status+" "+t+"</td></tr>")}):t(s)};f.defaults.data="",_.defaults={build_type:"",build_source:"",build_processing:null,build_complete:"tablesorter-build-complete",build_headers:{rows:1,classes:[],text:[],widths:[]},build_footers:{rows:1,classes:[],text:[]},build_numbers:{addColumn:!1,sortable:!1},build_csvStartLine:0,build_csvSeparator:",",build_objectRowKey:"rows",build_objectCellKey:"cells",build_objectHeaderKey:"headers",build_objectFooterKey:"footers"},_.build={colgroup:function(e){var l="";return e&&e.length&&(l+="<colgroup>",y.each(e,function(e,t){l+="<col"+(t?' style="width:'+t+'"':"")+">"}),l+="</colgroup>"),l},cell:function(e,t,l,o,r){var n,i,d=r?y("<col>"):"",s=t.build_headers.classes,a=t.build_headers.widths;if(/string|number/.test(typeof e))i=y("<"+l+(s&&s[o]?' class="'+s[o]+'"':"")+">"+e+"</"+l+">"),r&&a&&a[o]&&d.width(a[o]||"");else for(n in i=y("<"+l+">"),e)e.hasOwnProperty(n)&&("text"===n||"html"===n?i[n](e[n]):r&&"width"===n?d.width(e[n]||""):i.attr(n,e[n]));return[i,d]},header:function(e,t){var l=t.build_headers.text,o=t.build_headers.classes,r="<tr>"+(t.build_numbers.addColumn?"<th"+(t.build_numbers.sortable?"":' class="sorter-false"')+">"+t.build_numbers.addColumn+"</th>":"");return y.each(e,function(e,t){/<\s*\/t(d|h)\s*>/.test(t)?r+=t:r+="<th"+(o&&o[e]?' class="'+o[e]+'"':"")+">"+(l&&l[e]?l[e]:t)+"</th>"}),r+"</tr>"},rows:function(e,l,o,t,r,n){var i=n?"th":"td",d="<tr>"+(t.build_numbers.addColumn?"<"+i+">"+(n?"":r)+"</"+i+">":"");return y.each(e,function(e,t){/<\s*\/t(d|h)\s*>/.test(t)?d+=t:d+="<"+(n?i+(o&&o[e]?' class="'+o[e]+'"':""):i)+">"+(n&&l&&l.length&&l[e]?l[e]:t)+"</"+i+">"}),d+"</tr>"}},_.buildComplete=function(e,t){y(e).triggerHandler(t.build_complete),e.config&&f.debug(e.config,"build")&&console.log("Build >> Table build complete"),f.setup(e,e.config)},_.array=function(e,t,l){return _.csv(e,t,l)},_.csv=function(e,t,l){var o,r,n,i="csv"===l.build_type||"string"==typeof t,d=y(e),s=i?t.replace("\r","").split("\n"):t,a=s.length,u=0,c=!1,b=l.build_headers.rows+(i?l.build_csvStartLine:0),h=l.build_footers.rows,p=0,f="",g=_.build.colgroup(l.build_headers.widths)+"<thead>";y.each(s,function(e,t){a-h<=e&&(c=!0),(!i||e>=l.build_csvStartLine)&&e<b?(r=i?_.splitCSV(t,l.build_csvSeparator):t,p=r.length,g+=_.build.header(r,l)):b<=e&&(e===b&&(g+="</thead><tbody>"),n=i?_.splitCSV(t,l.build_csvSeparator):t,c&&0<h&&(g+=(e===a-h?"</tbody><tfoot>":"")+(e===a?"</tfoot>":"")),1<n.length&&(u++,n.length!==p&&(f+="error on line "+e+": Item count ("+n.length+") does not match header count ("+p+") \n"),o=c?l.build_footers.classes:"",g+=_.build.rows(n,l.build_footers.text,o,l,u,c)))}),g+=0<h?"":"</tbody>",f?d.html(f):(d.html(g),_.buildComplete(e,l))},_.splitCSV=function(e,t){var l,o,r=y.trim(e).split(t=t||",");for(l=r.length-1;0<=l;l--)'"'===r[l].replace(/\"\s+$/,'"').charAt(r[l].length-1)?1<(o=r[l].replace(/^\s+\"/,'"')).length&&'"'===o.charAt(0)?r[l]=r[l].replace(/^\s*"|"\s*$/g,"").replace(/""/g,'"'):l?r.splice(l-1,2,[r[l-1],r[l]].join(t)):r=r.shift().split(t).concat(r):r[l].replace(/""/g,'"');return r},_.html=function(e,t,l){var o=y(e);t instanceof y?o.empty().append(t):o.html(t),_.buildComplete(e,l)},_.object=function(e,t,o){var l,r,n,i,d,s,a,u=e.config,c=o.build_objectHeaderKey,b=o.build_objectRowKey,h=t.hasOwnProperty(c)&&!y.isEmptyObject(t.kh)?t.kh:!!t.hasOwnProperty("headers")&&t.headers,p=t.hasOwnProperty(b)&&!y.isEmptyObject(t.kr)?t.kr:!!t.hasOwnProperty("rows")&&t.rows;if(!h||!p||0===h.length||0===p.length)return f.debug(u,"build")&&console.error("Build >> ERROR: Aborting build table widget, missing data for object build"),!1;i=y("<colgroup>"),d=y("<table><thead/></table>"),y.each(h,function(e,t){for(a=y("<tr>").appendTo(d.find("thead")),r=t.length,l=0;l<r;l++)(n=_.build.cell(t[l],o,"th",l,0===e))[0]&&n[0].length&&n[0].appendTo(a),0===e&&n[1]&&n[1].appendTo(i)}),i.find("col[style]").length&&d.prepend(i),s=y("<tbody>"),y.each(p,function(e,t){var l;if((n="object"===y.type(t))&&t.newTbody)for(l in s=y("<tbody>").appendTo(d),t)t.hasOwnProperty(l)&&"newTbody"!==l&&s.attr(l,t[l]);else{if(0===e&&s.appendTo(d),a=y("<tr>").appendTo(s),n){for(l in t)t.hasOwnProperty(l)&&l!==o.build_objectCellKey&&a.attr(l,t[l]);t.hasOwnProperty(o.build_objectCellKey)&&(t=t.cells)}for(r=t.length,l=0;l<r;l++)(i=_.build.cell(t[l],o,"td",l))[0]&&i[0].length&&i[0].appendTo(a)}}),t.hasOwnProperty(o.build_objectFooterKey)&&("clone"===(n=t[o.build_objectFooterKey])?(i=d.find("thead").html(),d.append("<tfoot>"+i+"</tfoot>")):(i=y("<tfoot>").appendTo(d),y.each(n,function(e,t){for(a=y("<tr>").appendTo(i),r=t.length,l=0;l<r;l++)(s=_.build.cell(t[l],o,"th",l))[0]&&s[0].length&&s[0].appendTo(a)}))),y(e).html(d.html()),_.buildComplete(e,o)},_.ajax=_.json=function(e,t,l){return _.object(e,t,l)}}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-chart.min.js b/web/_static/tablesorter/js/widgets/widget-chart.min.js
new file mode 100644
index 0000000..86fb0c3
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-chart.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function(l){"use strict";var n=l.tablesorter,s=[],c=[],u=[],a=[],_=[],f=[],d=[],g=[],p=n.chart={nonDigit:/[^\d,.\-()]/g,init:function(t,e){t.$table.off(e.chart_event).on(e.chart_event,function(){if(this.hasInitialized){var t=this.config;p.getCols(t,t.widgetOptions),p.getData(t,t.widgetOptions)}})},getCols:function(t,e){var a;for(s=[],f=[],g=[],a=0;a<t.columns;a++)e.chart_useSelector&&n.hasWidget(t.table,"columnSelector")&&!t.selector.auto?(t.selector.states[a]&&l.inArray(a,e.chart_ignoreColumns)<0||a===e.chart_labelCol||a===e.chart_sort[0][0])&&s.push(a):(l.inArray(a,e.chart_ignoreColumns)<0||a===e.chart_labelCol||a===e.chart_sort[0][0])&&s.push(a)},getData:function(t,e){p.getHeaders(t,e),p.getRows(t,e),a=[c],l.each(u,function(t,e){a.push(e)}),t.chart={data:a,categories:_,series:f,category:d,dataset:g}},getHeaders:function(a,r){var o;f=[],g=[],(c=[]).push(a.headerContent[r.chart_labelCol]),l.each(s,function(t,e){if(e===r.chart_labelCol)return!0;o=a.headerContent[e],c.push(o),f.push({name:o,data:[]}),g.push({seriesname:o,data:[]})})},getRows:function(c,i){var t=c.cache[0].normalized,h=[];u=[],_=[],d=[],l.each(t,function(t,e){var a,r,o=e[c.columns].$row,s=o.children("th,td"),n=[];if(/v/i.test(i.chart_incRows)&&o.is(":visible")||/f/i.test(i.chart_incRows)&&!o.hasClass(i.filter_filteredRow||"filtered")||!/(v|f)/i.test(i.chart_incRows)){for(a=0;a<c.columns;a++)0<=l.inArray(t,i.chart_parsed)?n.push(e[a]):(r=s[a].getAttribute(c.textAttribute)||s[a].textContent||s.eq(a).text(),n.push(l.trim(r)));h.push(n)}}),h.sort(function(t,e){return 1===i.chart_sort[0][1]?n.sortNatural(e[i.chart_sort[0][0]],t[i.chart_sort[0][0]]):n.sortNatural(t[i.chart_sort[0][0]],e[i.chart_sort[0][0]])}),l.each(h,function(t,e){var r,o=0,s=[],a=e[i.chart_labelCol];s.push(""+a),l.each(e,function(t,e){var a;if(t===i.chart_labelCol)return _.push(e),d.push({label:e}),!0;r=!1,i.chart_useSelector&&n.hasWidget(c.table,"columnSelector")&&!c.selector.auto?c.selector.states[t]&&l.inArray(t,i.chart_ignoreColumns)<0&&(r=""+e):l.inArray(t,i.chart_ignoreColumns)<0&&(r=""+e),!1!==r&&(/s/i.test(""+i.chart_layout[t])?(s.push(r),f[o].data.push(r),g[o].data.push(r)):(a=n.formatFloat(r.replace(p.nonDigit,""),c.table),a=isNaN(a)?r:a,s.push(a),f[o].data.push(a),g[o].data.push({value:a})),o++)}),u.push(s)})},remove:function(t,e){t.$table.off(e.chart_event)}};n.addWidget({id:"chart",options:{chart_incRows:"filtered",chart_useSelector:!1,chart_ignoreColumns:[],chart_parsed:[],chart_layout:{0:"string"},chart_labelCol:0,chart_sort:[[0,0]],chart_event:"chartData"},init:function(t,e,a,r){p.init(a,r)},remove:function(t,e,a){p.remove(e,a)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-columnSelector.min.js b/web/_static/tablesorter/js/widgets/widget-columnSelector.min.js
new file mode 100644
index 0000000..061f380
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-columnSelector.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function(h){"use strict";var f=h.tablesorter,c=".tscolsel",S=f.columnSelector={queryAll:"@media only all { [columns] { display: none; } } ",queryBreak:"@media all and (min-width: [size]) { [columns] { display: table-cell; } } ",init:function(e,t,o){var l,a,n=f.debug(t,"columnSelector");(l=h(o.columnSelector_layout)).find("input").add(l.filter("input")).length?(t.$table.addClass(t.namespace.slice(1)+"columnselector"),(a=t.selector={$container:h(o.columnSelector_container||"<div>")}).$style=h("<style></style>").prop("disabled",!0).appendTo("head"),a.$breakpoints=h("<style></style>").prop("disabled",!0).appendTo("head"),a.isInitializing=!0,S.setUpColspan(t,o),S.setupSelector(t,o),o.columnSelector_mediaquery&&S.setupBreakpoints(t,o),a.isInitializing=!1,a.$container.length?S.updateCols(t,o):n&&console.warn("ColumnSelector >> container not found"),t.$table.off("refreshColumnSelector"+c).on("refreshColumnSelector"+c,function(e,t,o){S.refreshColumns(this.config,t,o)}),n&&console.log("ColumnSelector >> Widget initialized")):n&&console.error("ColumnSelector >> ERROR: Column Selector aborting, no input found in the layout! ***")},refreshColumns:function(e,t,o){var l,a,n,c,r=e.selector,s=h.isArray(o||t),i=e.widgetOptions;if(null!=t&&r.$container.length){if("selectors"===t&&(r.$container.empty(),S.setupSelector(e,i),S.setupBreakpoints(e,i),void 0===o&&null!==o&&(o=r.auto)),s)for(a=o||t,h.each(a,function(e,t){a[e]=parseInt(t,10)}),l=0;l<e.columns;l++)c=0<=h.inArray(l,a),(n=r.$container.find("input[data-column="+l+"]")).length&&(n.prop("checked",c),r.states[l]=c);c=!0===o||!0===t||"auto"===t&&!1!==o,n=r.$container.find('input[data-column="auto"]').prop("checked",c),S.updateAuto(e,i,n)}else S.updateBreakpoints(e,i),S.updateCols(e,i);S.saveValues(e,i),S.adjustColspans(e,i)},setupSelector:function(t,o){var e,l,a,n,c,r,s,i=t.selector,u=i.$container,d=o.columnSelector_saveColumns&&f.storage,p=d?f.storage(t.table,"tablesorter-columnSelector"):[],m=d?f.storage(t.table,"tablesorter-columnSelector-auto"):{};for(i.auto=h.isEmptyObject(m)||"boolean"!==h.type(m.auto)?o.columnSelector_mediaqueryState:m.auto,i.states=[],i.$column=[],i.$wrapper=[],i.$checkbox=[],e=0;e<t.columns;e++)n=(a=t.$headerIndexed[e]).attr(o.columnSelector_priority)||1,r=a.attr("data-column"),c=f.getColumnData(t.table,t.headers,r),m=f.getData(a,c,"columnSelector"),isNaN(n)&&0<n.length||"disable"===m||o.columnSelector_columns[r]&&"disable"===o.columnSelector_columns[r]?i.states[r]=null:(i.states[r]=p&&void 0!==p[r]&&null!==p[r]?p[r]:void 0!==o.columnSelector_columns[r]&&null!==o.columnSelector_columns[r]?o.columnSelector_columns[r]:"true"===m||"false"!==m,i.$column[r]=h(this),u.length&&(l=a.attr(o.columnSelector_name)||a.text().trim(),"function"==typeof o.columnSelector_layoutCustomizer&&(s=a.find("."+f.css.headerIn),l=o.columnSelector_layoutCustomizer(s.length?s:a,l,parseInt(r,10))),i.$wrapper[r]=h(o.columnSelector_layout.replace(/\{name\}/g,l)).appendTo(u),i.$checkbox[r]=i.$wrapper[r].find("input").add(i.$wrapper[r].filter("input")).attr("data-column",r).toggleClass(o.columnSelector_cssChecked,i.states[r]).prop("checked",i.states[r]).on("change",function(){if(!i.isInitializing){var e=h(this).attr("data-column");if(!S.checkChange(t,this.checked))return this.checked=!this.checked,!1;t.selector.states[e]=this.checked,S.updateCols(t,o)}}).change()))},checkChange:function(e,t){for(var o=e.widgetOptions,l=o.columnSelector_maxVisible,a=o.columnSelector_minVisible,n=e.selector.states,c=n.length,r=0;0<=c--;)n[c]&&r++;return!(t&null!==l&&l<=r||!t&&null!==a&&r<=a)},setupBreakpoints:function(e,t){var o=e.selector;t.columnSelector_mediaquery&&(o.lastIndex=-1,S.updateBreakpoints(e,t),e.$table.off("updateAll"+c).on("updateAll"+c,function(){S.setupSelector(e,t),S.setupBreakpoints(e,t),S.updateBreakpoints(e,t),S.updateCols(e,t)})),o.$container.length&&(t.columnSelector_mediaquery&&(o.$auto=h(t.columnSelector_layout.replace(/\{name\}/g,t.columnSelector_mediaqueryName)).prependTo(o.$container),o.$auto.find("input").add(o.$auto.filter("input")).attr("data-column","auto").prop("checked",o.auto).toggleClass(t.columnSelector_cssChecked,o.auto).on("change",function(){S.updateAuto(e,t,h(this))}).change()),e.$table.off("update"+c).on("update"+c,function(){S.updateCols(e,t)}))},updateAuto:function(e,t,o){var l=e.selector;l.auto=o.prop("checked")||!1,h.each(l.$checkbox,function(e,t){t&&(t[0].disabled=l.auto,l.$wrapper[e].toggleClass("disabled",l.auto))}),t.columnSelector_mediaquery&&S.updateBreakpoints(e,t),S.updateCols(e,t),e.selector.$popup&&e.selector.$popup.find(".tablesorter-column-selector").html(l.$container.html()).find("input").each(function(){var e=h(this).attr("data-column");h(this).prop("checked","auto"===e?l.auto:l.states[e])}),S.saveValues(e,t),S.adjustColspans(e,t),l.auto&&e.$table.triggerHandler(t.columnSelector_updated)},addSelectors:function(e,t,o){var l=[],a=" col:nth-child("+o+")";return l.push(t+a+","+t+"_extra_table"+a),a=" tr:not(."+e.columnSelector_classHasSpan+') th[data-column="'+(o-1)+'"]',l.push(t+a+","+t+"_extra_table"+a),a=" tr:not(."+e.columnSelector_classHasSpan+") td:nth-child("+o+")",l.push(t+a+","+t+"_extra_table"+a),a=" tr td:not("+t+e.columnSelector_classHasSpan+')[data-column="'+(o-1)+'"]',l.push(t+a+","+t+"_extra_table"+a),l},updateBreakpoints:function(e,t){var o,l,a,n,c=[],r=e.selector,s=e.namespace+"columnselector",i=[],u="";if(t.columnSelector_mediaquery&&!r.auto)return r.$breakpoints.prop("disabled",!0),void r.$style.prop("disabled",!1);if(t.columnSelector_mediaqueryHidden)for(a=0;a<e.columns;a++)l=f.getColumnData(e.table,e.headers,a),c[a+1]="false"===f.getData(e.$headerIndexed[a],l,"columnSelector"),c[a+1]&&(i=i.concat(S.addSelectors(t,s,a+1)));for(o=0;o<t.columnSelector_maxPriorities;o++)n=[],e.$headers.filter("["+t.columnSelector_priority+"="+(o+1)+"]").each(function(){a=parseInt(h(this).attr("data-column"),10)+1,c[a]||(n=n.concat(S.addSelectors(t,s,a)))}),n.length&&(i=i.concat(n),u+=S.queryBreak.replace(/\[size\]/g,t.columnSelector_breakpoints[o]).replace(/\[columns\]/g,n.join(",")));r.$style&&r.$style.prop("disabled",!0),i.length&&r.$breakpoints.prop("disabled",!1).text(S.queryAll.replace(/\[columns\]/g,i.join(","))+u)},updateCols:function(e,t){if(!(t.columnSelector_mediaquery&&e.selector.auto||e.selector.isInitializing)){var o,l=e.selector,a=[],n=e.namespace+"columnselector";l.$container.find("input[data-column]").filter('[data-column!="auto"]').each(function(){this.checked||(o=parseInt(h(this).attr("data-column"),10)+1,a=a.concat(S.addSelectors(t,n,o))),h(this).toggleClass(t.columnSelector_cssChecked,this.checked)}),t.columnSelector_mediaquery&&l.$breakpoints.prop("disabled",!0),l.$style&&l.$style.prop("disabled",!1).text(a.length?a.join(",")+" { display: none; }":""),S.saveValues(e,t),S.adjustColspans(e,t),e.$table.triggerHandler(t.columnSelector_updated)}},setUpColspan:function(e,t){var o,l,a,n=h(window),c=!1,r=e.$table.add(h(e.namespace+"_extra_table")).children().children("tr").children("th, td"),s=r.length;for(o=0;o<s;o++)1<(l=r[o].colSpan)&&(c=!0,r.eq(o).addClass(e.namespace.slice(1)+"columnselector"+t.columnSelector_classHasSpan).attr("data-col-span",l),f.computeColumnIndex(r.eq(o).parent().addClass(t.columnSelector_classHasSpan)));c&&t.columnSelector_mediaquery&&(a=e.namespace+"columnselector",n.off(a).on("resize"+a,f.window_resize).on("resizeEnd"+a,function(){n.off("resize"+a,f.window_resize),S.adjustColspans(e,t),n.on("resize"+a,f.window_resize)}))},findHeaders:function(e){var t,o,l="."+f.css.scrollerHeader+" thead > tr > ",a=h(l+"th,"+l+"td"),n=[];for(t=0;t<e.columns;t++)o=a.filter('[data-column="'+t+'"]'),n[t]=o.length?o.not(".sorter-false").length?o.not(".sorter-false").filter(":last"):o.filter(":last"):h();return n},adjustColspans:function(e,t){var o,l,a,n,c,r,s=e.selector,i=t.filter_filteredRow||"filtered",u=t.columnSelector_mediaquery&&s.auto,d=e.$table.children("thead, tfoot").children().children().add(h(e.namespace+"_extra_table").children("thead, tfoot").children().children()).add(e.$table.find(".group-header").children()),p=d.length,m=f.hasWidget(e.table,"scroller")?S.findHeaders(e):e.$headerIndexed;for(o=0;o<p;o++)if(r=d.eq(o),c=(a=parseInt(r.attr("data-column"),10)||r[0].cellIndex)+(n=parseInt(r.attr("data-col-span"),10)||1),1<n){for(l=a;l<c;l++)(!u&&!1===s.states[l]||u&&m[l]&&!m[l].is(":visible"))&&n--;n?r.removeClass(i)[0].colSpan=n:r.addClass(i)}else void 0!==s.states[a]&&null!==s.states[a]&&r.toggleClass(i,!u&&!s.states[a])},saveValues:function(e,t){if(t.columnSelector_saveColumns&&f.storage){var o=e.selector;f.storage(e.$table[0],"tablesorter-columnSelector-auto",{auto:o.auto}),f.storage(e.$table[0],"tablesorter-columnSelector",o.states)}},attachTo:function(e,t){var o,l,a,n=(e=h(e)[0]).config,c=h(t);c.length&&n&&(c.find(".tablesorter-column-selector").length||c.append('<span class="tablesorter-column-selector"></span>'),o=n.selector,l=n.widgetOptions,c.find(".tablesorter-column-selector").html(o.$container.html()).find("input").each(function(){var e=h(this).attr("data-column"),t="auto"===e?o.auto:o.states[e];h(this).toggleClass(l.columnSelector_cssChecked,t).prop("checked",t)}),o.$popup=c.on("change","input",function(){if(!o.isInitializing){if(!S.checkChange(n,this.checked))return this.checked=!this.checked,!1;a=h(this).toggleClass(l.columnSelector_cssChecked,this.checked).attr("data-column"),o.$container.find('input[data-column="'+a+'"]').prop("checked",this.checked).trigger("change")}}))}};f.window_resize=function(){f.timer_resize&&clearTimeout(f.timer_resize),f.timer_resize=setTimeout(function(){h(window).trigger("resizeEnd")},250)},f.addWidget({id:"columnSelector",priority:10,options:{columnSelector_container:null,columnSelector_columns:{},columnSelector_saveColumns:!0,columnSelector_layout:'<label><input type="checkbox">{name}</label>',columnSelector_layoutCustomizer:null,columnSelector_name:"data-selector-name",columnSelector_mediaquery:!0,columnSelector_mediaqueryName:"Auto: ",columnSelector_mediaqueryState:!0,columnSelector_mediaqueryHidden:!1,columnSelector_maxVisible:null,columnSelector_minVisible:null,columnSelector_breakpoints:["20em","30em","40em","50em","60em","70em"],columnSelector_maxPriorities:6,columnSelector_priority:"data-priority",columnSelector_cssChecked:"checked",columnSelector_classHasSpan:"hasSpan",columnSelector_updated:"columnUpdate"},init:function(e,t,o,l){S.init(e,o,l)},remove:function(e,t,o,l){var a=t.selector;!l&&a&&(a&&a.$container.empty(),a.$popup&&a.$popup.empty(),a.$style.remove(),a.$breakpoints.remove(),h(t.namespace+"columnselector"+o.columnSelector_classHasSpan).removeClass(o.filter_filteredRow||"filtered"),t.$table.find("[data-col-span]").each(function(e,t){var o=h(t);o.attr("colspan",o.attr("data-col-span"))}),t.$table.off("updateAll"+c+" update"+c))}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-columns.min.js b/web/_static/tablesorter/js/widgets/widget-columns.min.js
new file mode 100644
index 0000000..024301d
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-columns.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: columns - updated 5/24/2017 (v2.28.11) */
+!function(b){"use strict";var v=b.tablesorter||{};v.addWidget({id:"columns",priority:65,options:{columns:["primary","secondary","tertiary"]},format:function(e,r,o){var t,s,n,i,a,d,l,c,h=r.$table,f=r.$tbodies,m=r.sortList,y=m.length,u=o&&o.columns||["primary","secondary","tertiary"],p=u.length-1;for(l=u.join(" "),s=0;s<f.length;s++)(n=(t=v.processTbody(e,f.eq(s),!0)).children("tr")).each(function(){if(a=b(this),"none"!==this.style.display&&(d=a.children().removeClass(l),m&&m[0]&&(d.eq(m[0][0]).addClass(u[0]),1<y)))for(c=1;c<y;c++)d.eq(m[c][0]).addClass(u[c]||u[p])}),v.processTbody(e,t,!1);if(i=!1!==o.columns_thead?["thead tr"]:[],!1!==o.columns_tfoot&&i.push("tfoot tr"),i.length&&(n=h.find(i.join(",")).children().removeClass(l),y))for(c=0;c<y;c++)n.filter('[data-column="'+m[c][0]+'"]').addClass(u[c]||u[p])},remove:function(e,r,o){var t,s,n=r.$tbodies,i=(o.columns||["primary","secondary","tertiary"]).join(" ");for(r.$headers.removeClass(i),r.$table.children("tfoot").children("tr").children("th, td").removeClass(i),t=0;t<n.length;t++)(s=v.processTbody(e,n.eq(t),!0)).children("tr").each(function(){b(this).children().removeClass(i)}),v.processTbody(e,s,!1)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-cssStickyHeaders.min.js b/web/_static/tablesorter/js/widgets/widget-cssStickyHeaders.min.js
new file mode 100644
index 0000000..c9ba712
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-cssStickyHeaders.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: cssStickyHeaders - updated 6/16/2018 (v2.30.6) */
+!function(d,o){"use strict";var s=d.tablesorter;function a(r,l){function p(e,t){var s=0===t?"":"translate(0px,"+t+"px)";e.css({transform:s,"-ms-transform":s,"-webkit-transform":s})}var e,h,f=r.$table,g=d(l.cssStickyHeaders_attachTo),k="ActiveXObject"in o||-1<o.navigator.userAgent.indexOf("Edge"),t=r.namespace+"cssstickyheader ",y=f.children("thead"),H=f.children("caption"),u=g.length?g:d(o),S=f.parent().closest("table."+s.css.table),b=S.length&&s.hasWidget(S[0],"cssStickyHeaders")?S.children("thead"):[],m=parseInt(f.css("border-top-width"),10)||0,_=f.height(),C=l.cssStickyHeaders_addCaption,T=!1,v=!1;H.length&&(H.hide(),v=f.height()===_,H.show(),e=f.offset().top,p(H,20),T=f.offset().top!==e,p(H,0)),u.unbind("scroll resize ".split(" ").join(t).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(t),function(){l=r.widgetOptions,T&&(p(H,0),h=f.offset().top),u.scrollTop()<H.outerHeight(!0)&&(_=f.height());var e=g.length?g.offset().top:u.scrollTop(),t=(H.outerHeight(!0)||0)+(parseInt(f.css("padding-top"),10)||0)+(parseInt(f.css("border-spacing"),10)||0),s=_+(v&&l.cssStickyHeaders_addCaption?t:0)-y.height()-(f.children("tfoot").height()||0)-(l.cssStickyHeaders_addCaption?t:v?0:t),i=b.length?b.height():0,a=b.length?k?S.data("cssStickyHeaderBottom")+i:b.offset().top+i-u.scrollTop():0,d=T?h:f.offset().top,o=e-(v?d-(l.cssStickyHeaders_addCaption?t:0):d)+a+m+(l.cssStickyHeaders_offset||0)-(l.cssStickyHeaders_addCaption?v?t:0:t),c=0<o&&o<=s?o:0,n=k?y.children().children():y;k&&r.$table.data("cssStickyHeaderBottom",(b.length?i:0)-(l.cssStickyHeaders_addCaption?t:0)),l.cssStickyHeaders_addCaption&&(n=n.add(H)),C!==l.cssStickyHeaders_addCaption&&((C=l.cssStickyHeaders_addCaption)||p(H,0)),p(n,c)}),f.unbind("filterEnd updateComplete ".split(" ").join(t).replace(/\s+/g," ")).bind("filterEnd"+t,function(){l.cssStickyHeaders_filteredToTop&&o.scrollTo(0,f.position().top)}).bind("updateComplete"+t,function(){a(r,r.widgetOptions)})}s.addWidget({id:"cssStickyHeaders",priority:10,options:{cssStickyHeaders_offset:0,cssStickyHeaders_addCaption:!1,cssStickyHeaders_attachTo:null,cssStickyHeaders_filteredToTop:!0},init:function(e,t,s,i){a(s,i)},remove:function(e,t,s,i){if(!i){var a=t.namespace+"cssstickyheader ";d(o).unbind("scroll resize ".split(" ").join(a).replace(/\s+/g," ")),t.$table.unbind("filterEnd scroll resize updateComplete ".split(" ").join(a).replace(/\s+/g," ")).add(t.$table.children("thead").children().children()).children("thead, caption").css({transform:"","-ms-transform":"","-webkit-transform":""})}}})}(jQuery,window);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-currentSort.min.js b/web/_static/tablesorter/js/widgets/widget-currentSort.min.js
new file mode 100644
index 0000000..b9f3845
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-currentSort.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: currentSort - 7/31/2016 (v2.27.0) */
+!function(){"use strict";var i=jQuery.tablesorter;i.currentSortLanguage={0:"asc",1:"desc",2:"unsorted"},i.currentSort={init:function(t){t.$table.on("sortEnd.tscurrentSort",function(){i.currentSort.update(this.config)})},update:function(t){if(t){var r,n=t.widgetOptions,o=i.currentSortLanguage,e=o[2],c=Array.apply(null,Array(t.columns)).map(String.prototype.valueOf,e),u=t.sortList,a=u.length;for(r=0;r<a;r++)c[u[r][0]]=o[u[r][1]];t.currentSort=c,"function"==typeof n.currentSort_callback&&n.currentSort_callback(t,c)}}},i.addWidget({id:"currentSort",options:{currentSort_callback:null},init:function(t,r,n,o){i.currentSort.init(n,o)},remove:function(t,r){r.$table.off("sortEnd.tscurrentSort")}})}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-editable.min.js b/web/_static/tablesorter/js/widgets/widget-editable.min.js
new file mode 100644
index 0000000..98c1fe2
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-editable.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: editable - updated 2018-08-27 (v2.31.0) */
+!function(b){"use strict";var p=b.tablesorter.editable={namespace:".tseditable",lastEdited:"tseditable-last-edited-cell",editComplete:function(e,t,n,i){e.$table.find("."+p.lastEdited).removeClass(p.lastEdited).trigger(t.editable_editComplete,[e]),i&&setTimeout(function(){n.focus()},50)},selectAll:function(n){setTimeout(function(){var e,t;document.queryCommandSupported("SelectAll")?document.execCommand("selectAll",!1,null):document.body.createTextRange?((e=document.body.createTextRange()).moveToElementText(n),e.select()):window.getSelection&&(t=window.getSelection(),(e=document.createRange()).selectNodeContents(n),t.removeAllRanges(),t.addRange(e))},100)},getColumns:function(e,t){var n,i,o,a,l,d=t.editable_columns,s=[];if("string"==typeof d)for(a=(n=d.replace(/\s+/,"").split(/,/)).length-1;0<=a;){if(0<=n[a].indexOf("-"))for(o=n[a].split("-"),i=parseInt(o[0],10)||0,(o=parseInt(o[1],10)||e.columns-1)<i&&(l=i,i=o,o=l);i<=o;i++)s.push("td:nth-child("+(i+1)+")");else s.push("td:nth-child("+((parseInt(n[a],10)||0)+1)+")");a--}else if(b.isArray(d))for(a=d.length,i=0;i<a;i++)d[i]<e.columns&&s.push("td:nth-child("+(d[i]+1)+")");return s},trimContent:function(e,t){if(e.editable_trimContent){var n=t.html();n.trim()!==n&&t.html(""===n?"&nbsp;":n)}},update:function(e,t){var n,i,o,a,l,d,s,r=b("<div>").wrapInner(t.editable_wrapContent).children().length||b.isFunction(t.editable_wrapContent),c=p.getColumns(e,t).join(",");for(e.$tbodies.find(c).find("[contenteditable]").prop("contenteditable",!1),a=(i=e.$tbodies.find(c).not("."+t.editable_noEdit)).length,o=0;o<a;o++)if(n=i.eq(o),r&&0===n.children("div, span").length&&(n.wrapInner(t.editable_wrapContent),""===n.children().text().trim()&&n.children().html("&nbsp;")),s=(l=n.children("div, span").not("."+t.editable_noEdit)).length)for(d=0;d<s;d++){var u=l.eq(d);p.trimContent(t,u),u.prop("contenteditable",!0)}else p.trimContent(t,n),n.prop("contenteditable",!0)},bindEvents:function(d,s){var r=p.namespace;d.$table.off("updateComplete pagerComplete ".split(" ").join(r+" ").replace(/\s+/g," ")).on("updateComplete pagerComplete ".split(" ").join(r+" "),function(){p.update(d,d.widgetOptions)}).children("thead").add(b(d.namespace+"_extra_table").children("thead")).off("mouseenter"+r).on("mouseenter"+r,function(){d.$table.data("contentFocused")&&(d.$table.data("contentFocused",!0),b(":focus").trigger("focusout"))}),d.$tbodies.off("focus focusout keydown ".split(" ").join(r+" ").replace(/\s+/g," ")).on("focus"+r,"[contenteditable]",function(e){clearTimeout(b(this).data("timer")),d.$table.data("contentFocused",e.target),d.table.isUpdating=!0;var t=b(this),n=s.editable_selectAll,i=t.closest("td").index(),o=t.html();s.editable_trimContent&&(o=b.trim(""===o?"&nbsp;":o)),t.off("keydown"+r).on("keydown"+r,function(e){s.editable_enterToAccept&&13===e.which&&!e.shiftKey&&e.preventDefault()}),t.data({before:o,original:o}),"function"==typeof s.editable_focused&&s.editable_focused(o,i,t),n&&("function"==typeof n?n(o,i,t)&&p.selectAll(t[0]):p.selectAll(t[0]))}).on("focusout keydown ".split(" ").join(r+" "),"[contenteditable]",function(e){if(d.$table.data("contentFocused")){var t,n,i=!1,o=b(e.target),a=o.html(),l=o.closest("td").index();if(s.editable_trimContent&&(a=b.trim(""===a?"&nbsp;":a)),27===e.which)return o.html(o.data("original")).trigger("blur"+r),d.$table.data("contentFocused",!1),d.table.isUpdating=!1;if((t=13===e.which&&!e.shiftKey&&(s.editable_enterToAccept||e.altKey)||s.editable_autoAccept&&"keydown"!==e.type)&&o.data("before")!==a){if(n=s.editable_validate,i=a,"function"==typeof n?i=n(a,o.data("original"),l,o):"function"==typeof(n=b.tablesorter.getColumnData(d.table,n,l))&&(i=n(a,o.data("original"),l,o)),t&&!1!==i)return d.$table.find("."+p.lastEdited).removeClass(p.lastEdited),o.addClass(p.lastEdited).html(i).data("before",i).data("original",i).trigger("change"),d.table.hasInitialized&&b.tablesorter.updateCell(d,o.closest("td"),!1,function(){s.editable_autoResort?setTimeout(function(){b.tablesorter.sortOn(d,d.sortList,function(){p.editComplete(d,s,d.$table.data("contentFocused"),!0)},!0)},10):p.editComplete(d,s,d.$table.data("contentFocused"))}),!1}else i||"keydown"===e.type||(clearTimeout(o.data("timer")),o.data("timer",setTimeout(function(){d.table.isUpdating=!1,b.isFunction(s.editable_blur)&&(a=o.html(),s.editable_blur(s.editable_trimContent?b.trim(a):a,l,o))},100)),o.html(o.data("original")))}}).on("paste"+r,"[contenteditable]",function(){var e,t=b(this);setTimeout(function(){t.is(":focus")&&(e="<div>"+t.html()+"</div>",t.html(b(e).text().trim()))},0)})},destroy:function(e,t){var n=p.namespace,i=p.getColumns(e,t),o="updateComplete pagerComplete ".split(" ").join(n+" ").replace(/\s+/g," ");e.$table.off(o),o="focus focusout keydown paste ".split(" ").join(n+" ").replace(/\s+/g," "),e.$tbodies.off(o).find(i.join(",")).find("[contenteditable]").prop("contenteditable",!1)}};b.tablesorter.addWidget({id:"editable",options:{editable_columns:[],editable_enterToAccept:!0,editable_autoAccept:!0,editable_autoResort:!1,editable_wrapContent:"<div>",editable_trimContent:!0,editable_validate:null,editable_focused:null,editable_blur:null,editable_selectAll:!1,editable_noEdit:"no-edit",editable_editComplete:"editComplete"},init:function(e,t,n,i){i.editable_columns.length&&(p.update(n,i),p.bindEvents(n,i))},remove:function(e,t,n,i){i||p.destroy(t,n)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-filter-formatter-html5.min.js b/web/_static/tablesorter/js/widgets/widget-filter-formatter-html5.min.js
new file mode 100644
index 0000000..06ef583
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-filter-formatter-html5.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: filter, html5 formatter functions - updated 7/17/2014 (v2.17.5) */
+!function(u){"use strict";var f=u.tablesorter||{},m=".compare-select",h=f.filterFormatter=u.extend({},f.filterFormatter,{addCompare:function(e,t,a){if(a.compare&&u.isArray(a.compare)&&1<a.compare.length){var n="",i=[m.slice(1)," "+m.slice(1),""],l=a.cellText?'<label class="'+i.join("-label")+t+'">'+a.cellText+"</label>":"";u.each(a.compare,function(e,t){n+="<option "+(a.selected===e?"selected":"")+">"+t+"</option>"}),e.wrapInner('<div class="'+i.join("-wrapper")+t+'" />').prepend(l+'<select class="'+i.join("")+t+'" />').find("select").append(n)}},updateCompare:function(e,t,a){var n=t.val()||"",i=n.replace(/\s*?[><=]\s*?/g,""),l=n.match(/[><=]/g)||"";return a.compare&&(u.isArray(a.compare)&&(l=(l||[]).join("")||a.compare[a.selected||0]),e.find(m).val(l)),[n,i]},html5Number:function(d,t,e){function a(e,t){var a=!c.addToggle||d.find(".toggle").is(":checked"),n=d.find(".number").val(),i=(u.isArray(c.compare)?d.find(m).val()||c.compare[c.selected||0]:c.compare)||"",l=!s.$table[0].hasInitialized||(e||c.delayed||"");r.val(!c.addToggle||a?(i||(c.exactMatch?"=":""))+n:"").trigger(t?"":"search",l).end().find(".number").val(n),d.find(".number").length&&(d.find(".number")[0].disabled=c.disabled||!a),o.length&&(o.find(".number").val(n)[0].disabled=c.disabled||!a,o.find(m).val(i),c.addToggle&&(o.find(".toggle")[0].checked=a))}var n,r,c=u.extend({value:0,min:0,max:100,step:1,delayed:!0,disabled:!1,addToggle:!1,exactMatch:!1,cellText:"",compare:"",skipTest:!1},e),i=u('<input type="number" style="visibility:hidden;" value="test">').appendTo(d),l=c.skipTest||"number"===i.attr("type")&&"test"!==i.val(),o=[],s=d.closest("table")[0].config;return i.remove(),l&&(n=c.addToggle?'<div class="button"><input id="html5button'+t+'" type="checkbox" class="toggle" /><label for="html5button'+t+'"></label></div>':"",n+='<input class="number" type="number" min="'+c.min+'" max="'+c.max+'" value="'+c.value+'" step="'+c.step+'" />',d.append(n+'<input type="hidden" />').find(".toggle, .number").bind("change",function(){a()}).closest("thead").find("th[data-column="+t+"]").addClass("filter-parsed").closest("table").bind("filterReset",function(){u.isArray(c.compare)&&d.add(o).find(m).val(c.compare[c.selected||0]),c.addToggle&&(d.find(".toggle")[0].checked=!1,o.length&&(o.find(".toggle")[0].checked=!1)),d.find(".number").val(c.value),setTimeout(function(){a()},0)}),r=d.find("input[type=hidden]").bind("change",function(){d.find(".number").val(this.value),a()}),s.$table.bind("filterFomatterUpdate",function(){var e=h.updateCompare(d,r,c)[0]||c.value;d.find(".number").val(((e||"")+"").replace(/[><=]/g,"")),a(!1,!0),f.filter.formatterUpdated(d,t)}),c.compare&&(h.addCompare(d,t,c),d.find(m).bind("change",function(){a()})),s.$table.bind("stickyHeadersInit",function(){(o=s.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(t).empty()).append(n).find(".toggle, .number").bind("change",function(){d.find(".number").val(u(this).val()),a()}),c.compare&&(h.addCompare(o,t,c),o.find(m).bind("change",function(){d.find(m).val(u(this).val()),a()})),a()}),a()),l?d.find('input[type="hidden"]'):u('<input type="search">')},html5Range:function(d,r,e){function a(e,t,a){e=(void 0===e?c.val():e).toString().replace(/[<>=]/g,"")||o.value;var n=(u.isArray(o.compare)?d.find(m).val()||o.compare[o.selected||0]:o.compare)||"",i=" ("+(n?n+e:e==o.min?o.allText:e)+")",l=!p.$table[0].hasInitialized||(t||o.delayed||"");d.find("input[type=hidden]").val(n?n+e:e==o.min?"":(o.exactMatch?"=":"")+e).trigger(a?"":"search",l).end().find(".range").val(e),d.closest("thead").find("th[data-column="+r+"]").find(".curvalue").html(i),s.length&&(s.find(".range").val(e).end().find(m).val(n),s.closest("thead").find("th[data-column="+r+"]").find(".curvalue").html(i))}var c,o=u.extend({value:0,min:0,max:100,step:1,delayed:!0,valueToHeader:!0,exactMatch:!0,cellText:"",compare:"",allText:"all",skipTest:!1},e),t=u('<input type="range" style="visibility:hidden;" value="test">').appendTo(d),n=o.skipTest||"range"===t.attr("type")&&"test"!==t.val(),s=[],p=d.closest("table")[0].config;return t.remove(),n&&(d.html('<input type="hidden"><input class="range" type="range" min="'+o.min+'" max="'+o.max+'" value="'+o.value+'" />').closest("thead").find("th[data-column="+r+"]").addClass("filter-parsed").find(".tablesorter-header-inner").append('<span class="curvalue" />'),c=d.find("input[type=hidden]").bind("change"+p.namespace+"filter",function(){var e=this.value,t=(u.isArray(o.compare)?d.find(m).val()||o.compare[o.selected||0]:o.compare)||"";e!==this.lastValue&&(this.lastValue=t?t+e:e==o.min?"":(o.exactMatch?"=":"")+e,this.value=this.lastValue,a(e))}),d.find(".range").bind("change",function(){a(this.value)}),p.$table.bind("filterFomatterUpdate",function(){var e=h.updateCompare(d,c,o)[0];d.find(".range").val(e),a(e,!1,!0),f.filter.formatterUpdated(d,r)}),o.compare&&(h.addCompare(d,r,o),d.find(m).bind("change",function(){a()})),p.$table.bind("stickyHeadersInit",function(){(s=p.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(r).empty()).html('<input class="range" type="range" min="'+o.min+'" max="'+o.max+'" value="'+o.value+'" />').find(".range").bind("change",function(){a(s.find(".range").val())}),a(),o.compare&&(h.addCompare(s,r,o),s.find(m).bind("change",function(){d.find(m).val(u(this).val()),a()}))}),d.closest("table").bind("filterReset",function(){u.isArray(o.compare)&&d.add(s).find(m).val(o.compare[o.selected||0]),setTimeout(function(){a(o.value,!1,!0)},0)}),a()),n?d.find('input[type="hidden"]'):u('<input type="search">')},html5Color:function(i,l,e){function t(e,t){var a=!0,n=" ("+(e=(void 0===e?d.val():e).toString().replace("=","")||r.value)+")";r.addToggle&&(a=i.find(".toggle").is(":checked")),i.find(".colorpicker").length&&(i.find(".colorpicker").val(e)[0].disabled=r.disabled||!a),d.val(a?e+(r.exactMatch?"=":""):"").trigger(!s.$table[0].hasInitialized||t?"":"search"),r.valueToHeader?i.closest("thead").find("th[data-column="+l+"]").find(".curcolor").html(n):i.find(".currentColor").html(n),o.length&&(o.find(".colorpicker").val(e)[0].disabled=r.disabled||!a,r.addToggle&&(o.find(".toggle")[0].checked=a),r.valueToHeader?o.closest("thead").find("th[data-column="+l+"]").find(".curcolor").html(n):o.find(".currentColor").html(n))}var a,d,r=u.extend({value:"#000000",disabled:!1,addToggle:!0,exactMatch:!0,valueToHeader:!1,skipTest:!1},e),n=u('<input type="color" style="visibility:hidden;" value="test">').appendTo(i),c=r.skipTest||"color"===n.attr("type")&&"test"!==n.val(),o=[],s=i.closest("table")[0].config;return n.remove(),c&&(a=""+l+Math.round(100*Math.random()),a='<div class="color-controls-wrapper">'+(r.addToggle?'<div class="button"><input id="colorbutton'+a+'" type="checkbox" class="toggle" /><label for="colorbutton'+a+'"></label></div>':"")+'<input type="hidden"><input class="colorpicker" type="color" />'+(r.valueToHeader?"":'<span class="currentColor">(#000000)</span>')+"</div>",i.html(a),r.valueToHeader&&i.closest("thead").find("th[data-column="+l+"]").find(".tablesorter-header-inner").append('<span class="curcolor" />'),i.find(".toggle, .colorpicker").bind("change",function(){t(i.find(".colorpicker").val())}),d=i.find("input[type=hidden]").bind("change"+s.namespace+"filter",function(){t(this.value)}),s.$table.bind("filterFomatterUpdate",function(){t(d.val(),!0),f.filter.formatterUpdated(i,l)}),i.closest("table").bind("filterReset",function(){r.addToggle&&(i.find(".toggle")[0].checked=!1),setTimeout(function(){t()},0)}),s.$table.bind("stickyHeadersInit",function(){(o=s.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(l)).html(a).find(".toggle, .colorpicker").bind("change",function(){t(o.find(".colorpicker").val())}),t(o.find(".colorpicker").val())}),t(r.value)),c?i.find('input[type="hidden"]'):u('<input type="search">')}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-filter-formatter-jui.min.js b/web/_static/tablesorter/js/widgets/widget-filter-formatter-jui.min.js
new file mode 100644
index 0000000..4e61cc5
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-filter-formatter-jui.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: filter jQuery UI formatter functions - updated 7/17/2014 (v2.17.5) */
+!function(f){"use strict";var u=f.tablesorter||{},m=".compare-select",v=u.filterFormatter=f.extend({},u.filterFormatter,{addCompare:function(e,a,t){if(t.compare&&f.isArray(t.compare)&&1<t.compare.length){var n="",d=[m.slice(1)," "+m.slice(1),""],i=t.cellText?'<label class="'+d.join("-label")+a+'">'+t.cellText+"</label>":"";f.each(t.compare,function(e,a){n+="<option "+(t.selected===e?"selected":"")+">"+a+"</option>"}),e.wrapInner('<div class="'+d.join("-wrapper")+a+'" />').prepend(i+'<select class="'+d.join("")+a+'" />').find("select").append(n)}},updateCompare:function(e,a,t){var n=a.val()||"",d=n.replace(/\s*?[><=]\s*?/g,""),i=n.match(/[><=]/g)||"";return t.compare&&(f.isArray(t.compare)&&(i=(i||[]).join("")||t.compare[t.selected||0]),e.find(m).val(i)),[n,d]},uiSpinner:function(r,a,e){var o=f.extend({delayed:!0,addToggle:!0,exactMatch:!0,value:1,cellText:"",compare:"",min:0,max:100,step:1,disabled:!1},e),s=r.closest("table")[0].config,t=f('<input class="filter" type="hidden">').appendTo(r).bind("change"+s.namespace+"filter",function(){n({value:this.value,delayed:!1})}),c=[],n=function(e,a){var t,n=!0,d=e&&e.value&&u.formatFloat((e.value+"").replace(/[><=]/g,""))||r.find(".spinner").val()||o.value,i=(f.isArray(o.compare)?r.find(m).val()||o.compare[o.selected||0]:o.compare)||"",l=e&&"boolean"==typeof e.delayed?e.delayed:!s.$table[0].hasInitialized||(o.delayed||"");o.addToggle&&(n=r.find(".toggle").is(":checked")),t=o.disabled||!n?"disable":"enable",u.isEmptyObject(r.find(".spinner").data())||(r.find(".filter").val(n?(i||(o.exactMatch?"=":""))+d:"").trigger(a?"":"search",l).end().find(".spinner").spinner(t).val(d),c.length&&(c.find(".spinner").spinner(t).val(d).end().find(m).val(i),o.addToggle&&(c.find(".toggle")[0].checked=n)))};return o.oldcreate=o.create,o.oldspin=o.spin,o.create=function(e,a){n(),"function"==typeof o.oldcreate&&o.oldcreate(e,a)},o.spin=function(e,a){n(a),"function"==typeof o.oldspin&&o.oldspin(e,a)},o.addToggle&&f('<div class="button"><input id="uispinnerbutton'+a+'" type="checkbox" class="toggle" /><label for="uispinnerbutton'+a+'"></label></div>').appendTo(r).find(".toggle").bind("change",function(){n()}),r.closest("thead").find("th[data-column="+a+"]").addClass("filter-parsed"),f('<input class="spinner spinner'+a+'" />').val(o.value).appendTo(r).spinner(o).bind("change keyup",function(){n()}),s.$table.bind("filterFomatterUpdate"+s.namespace+"filter",function(){var e=v.updateCompare(r,t,o)[0];r.find(".spinner").val(e),n({value:e},!0),u.filter.formatterUpdated(r,a)}),o.compare&&(v.addCompare(r,a,o),r.find(m).bind("change",function(){n()})),s.$table.bind("stickyHeadersInit"+s.namespace+"filter",function(){c=s.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(a).empty(),o.addToggle&&f('<div class="button"><input id="stickyuispinnerbutton'+a+'" type="checkbox" class="toggle" /><label for="stickyuispinnerbutton'+a+'"></label></div>').appendTo(c).find(".toggle").bind("change",function(){r.find(".toggle")[0].checked=this.checked,n()}),f('<input class="spinner spinner'+a+'" />').val(o.value).appendTo(c).spinner(o).bind("change keyup",function(){r.find(".spinner").val(this.value),n()}),o.compare&&(v.addCompare(c,a,o),c.find(m).bind("change",function(){r.find(m).val(f(this).val()),n()}))}),s.$table.bind("filterReset"+s.namespace+"filter",function(){f.isArray(o.compare)&&r.add(c).find(m).val(o.compare[o.selected||0]),o.addToggle&&(r.find(".toggle")[0].checked=!1),r.find(".spinner").spinner("value",o.value),setTimeout(function(){n()},0)}),n(),t},uiSlider:function(r,o,e){var s=f.extend({delayed:!0,valueToHeader:!1,exactMatch:!0,cellText:"",compare:"",allText:"all",value:0,min:0,max:100,step:1,range:"min"},e),c=r.closest("table")[0].config,a=f('<input class="filter" type="hidden">').appendTo(r).bind("change"+c.namespace+"filter",function(){t({value:this.value})}),p=[],t=function(e,a){var t=void 0!==e&&u.formatFloat((e.value+"").replace(/[><=]/g,""))||s.value,n=s.compare?t:t===s.min?s.allText:t,d=(f.isArray(s.compare)?r.find(m).val()||s.compare[s.selected||0]:s.compare)||"",i=d+n,l=e&&"boolean"==typeof e.delayed?e.delayed:!c.$table[0].hasInitialized||(s.delayed||"");s.valueToHeader?r.closest("thead").find("th[data-column="+o+"]").find(".curvalue").html(" ("+i+")"):r.find(".ui-slider-handle").addClass("value-popup").attr("data-value",i),u.isEmptyObject(r.find(".slider").data())||(r.find(".filter").val(d?d+t:t===s.min?"":(s.exactMatch?"=":"")+t).trigger(a?"":"search",l).end().find(".slider").slider("value",t),p.length&&(p.find(m).val(d).end().find(".slider").slider("value",t),s.valueToHeader?p.closest("thead").find("th[data-column="+o+"]").find(".curvalue").html(" ("+i+")"):p.find(".ui-slider-handle").addClass("value-popup").attr("data-value",i)))};return r.closest("thead").find("th[data-column="+o+"]").addClass("filter-parsed"),s.valueToHeader&&r.closest("thead").find("th[data-column="+o+"]").find(".tablesorter-header-inner").append('<span class="curvalue" />'),s.oldcreate=s.create,s.oldslide=s.slide,s.create=function(e,a){t(),"function"==typeof s.oldcreate&&s.oldcreate(e,a)},s.slide=function(e,a){t(a),"function"==typeof s.oldslide&&s.oldslide(e,a)},f('<div class="slider slider'+o+'"/>').appendTo(r).slider(s),c.$table.bind("filterFomatterUpdate"+c.namespace+"filter",function(){var e=v.updateCompare(r,a,s)[0];r.find(".slider").slider("value",e),t({value:e},!1),u.filter.formatterUpdated(r,o)}),s.compare&&(v.addCompare(r,o,s),r.find(m).bind("change",function(){t({value:r.find(".slider").slider("value")})})),c.$table.bind("filterReset"+c.namespace+"filter",function(){f.isArray(s.compare)&&r.add(p).find(m).val(s.compare[s.selected||0]),setTimeout(function(){t({value:s.value})},0)}),c.$table.bind("stickyHeadersInit"+c.namespace+"filter",function(){p=c.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(o).empty(),f('<div class="slider slider'+o+'"/>').val(s.value).appendTo(p).slider(s).bind("change keyup",function(){r.find(".slider").slider("value",this.value),t()}),s.compare&&(v.addCompare(p,o,s),p.find(m).bind("change",function(){r.find(m).val(f(this).val()),t()}))}),a},uiRange:function(l,r,e){var o=f.extend({delayed:!0,valueToHeader:!1,values:[0,100],min:0,max:100,range:!0},e),s=l.closest("table")[0].config,t=f('<input class="filter" type="hidden">').appendTo(l).bind("change"+s.namespace+"filter",function(){a()}),c=[],a=function(){var e=t.val(),a=e.split(" - ");""===e&&(a=[o.min,o.max]),a&&a[1]&&n({values:a,delay:!1},!0)},n=function(e,a){var t=e&&e.values||o.values,n=t[0]+" - "+t[1],d=t[0]===o.min&&t[1]===o.max?"":n,i=e&&"boolean"==typeof e.delayed?e.delayed:!s.$table[0].hasInitialized||(o.delayed||"");o.valueToHeader?l.closest("thead").find("th[data-column="+r+"]").find(".currange").html(" ("+n+")"):l.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",t[0]).end().eq(1).attr("data-value",t[1]),u.isEmptyObject(l.find(".range").data())||(l.find(".filter").val(d).trigger(a?"":"search",i).end().find(".range").slider("values",t),c.length&&(c.find(".range").slider("values",t),o.valueToHeader?c.closest("thead").find("th[data-column="+r+"]").find(".currange").html(" ("+n+")"):c.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",t[0]).end().eq(1).attr("data-value",t[1])))};return l.closest("thead").find("th[data-column="+r+"]").addClass("filter-parsed"),o.valueToHeader&&l.closest("thead").find("th[data-column="+r+"]").find(".tablesorter-header-inner").append('<span class="currange"/>'),o.oldcreate=o.create,o.oldslide=o.slide,o.create=function(e,a){n(),"function"==typeof o.oldcreate&&o.oldcreate(e,a)},o.slide=function(e,a){n(a),"function"==typeof o.oldslide&&o.oldslide(e,a)},f('<div class="range range'+r+'"/>').appendTo(l).slider(o),s.$table.bind("filterFomatterUpdate"+s.namespace+"filter",function(){a(),u.filter.formatterUpdated(l,r)}),s.$table.bind("filterReset"+s.namespace+"filter",function(){l.find(".range").slider("values",o.values),setTimeout(function(){n()},0)}),s.$table.bind("stickyHeadersInit"+s.namespace+"filter",function(){c=s.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(r).empty(),f('<div class="range range'+r+'"/>').val(o.value).appendTo(c).slider(o).bind("change keyup",function(){l.find(".range").val(this.value),n()})}),t},uiDateCompare:function(l,t,e){function n(e){var a,t,n=r.datepicker("getDate")||"",d=(f.isArray(o.compare)?l.find(m).val()||o.compare[o.selected||0]:o.compare)||"",i=!s.$table[0].hasInitialized||(o.delayed||"");r.datepicker("setDate",(""===n?"":n)||null),""===n&&(e=!1),t=(a=r.datepicker("getDate"))&&(o.endOfDay&&/<=/.test(d)?a.setHours(23,59,59,999):a.getTime())||"",a&&o.endOfDay&&"="===d&&(d="",t+=" - "+a.setHours(23,59,59,999),e=!1),l.find(".dateCompare").val(d+t).trigger(e?"":"search",i).end(),c.length&&c.find(".dateCompare").val(d+t).end().find(m).val(d)}var r,a,o=f.extend({cellText:"",compare:"",endOfDay:!0,defaultDate:"",changeMonth:!0,changeYear:!0,numberOfMonths:1},e),s=l.closest("table")[0].config,d=l.closest("thead").find("th[data-column="+t+"]").addClass("filter-parsed"),i=f('<input class="dateCompare" type="hidden">').appendTo(l).bind("change"+s.namespace+"filter",function(){var e=this.value;e&&o.onClose(e)}),c=[];return a='<input type="text" class="date date'+t+'" placeholder="'+(d.data("placeholder")||d.attr("data-placeholder")||s.widgetOptions.filter_placeholder.search||"")+'" />',r=f(a).appendTo(l),o.oldonClose=o.onClose,o.onClose=function(e,a){n(),"function"==typeof o.oldonClose&&o.oldonClose(e,a)},r.datepicker(o),s.$table.bind("filterReset"+s.namespace+"filter",function(){f.isArray(o.compare)&&l.add(c).find(m).val(o.compare[o.selected||0]),l.add(c).find(".date").val(o.defaultDate).datepicker("setDate",o.defaultDate||null),setTimeout(function(){n()},0)}),s.$table.bind("filterFomatterUpdate"+s.namespace+"filter",function(){var e,a=i.val();/\s+-\s+/.test(a)?(l.find(m).val("="),e=a.split(/\s+-\s+/)[0],r.datepicker("setDate",e||null)):e=""!==(e=v.updateCompare(l,i,o)[1].toString()||"")?/\d{5}/g.test(e)?new Date(Number(e)):e||"":"",l.add(c).find(".date").datepicker("setDate",e||null),setTimeout(function(){n(!0),u.filter.formatterUpdated(l,t)},0)}),o.compare&&(v.addCompare(l,t,o),l.find(m).bind("change",function(){n()})),s.$table.bind("stickyHeadersInit"+s.namespace+"filter",function(){(c=s.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(t).empty()).append(a).find(".date").datepicker(o),o.compare&&(v.addCompare(c,t,o),c.find(m).bind("change",function(){l.find(m).val(f(this).val()),n()}))}),i.val(o.defaultDate?o.defaultDate:"")},uiDatepicker:function(i,n,e){function l(e){return e instanceof Date&&isFinite(e)}var a,d,r=f.extend({endOfDay:!0,textFrom:"from",textTo:"to",from:"",to:"",changeMonth:!0,changeYear:!0,numberOfMonths:1},e),o=[],t=i.closest("table")[0].config,s=f('<input class="dateRange" type="hidden">').appendTo(i).bind("change"+t.namespace+"filter",function(){var e=this.value;e.match(" - ")?(e=e.split(" - "),i.find(".dateTo").val(e[1]),d(e[0])):e.match(">=")?d(e.replace(">=","")):e.match("<=")&&d(e.replace("<=",""))}),c=i.closest("thead").find("th[data-column="+n+"]").addClass("filter-parsed");return a="<label>"+r.textFrom+'</label><input type="text" class="dateFrom" placeholder="'+(c.data("placeholderFrom")||c.attr("data-placeholder-from")||t.widgetOptions.filter_placeholder.from||"")+'" /><label>'+r.textTo+'</label><input type="text" class="dateTo" placeholder="'+(c.data("placeholderTo")||c.attr("data-placeholder-to")||t.widgetOptions.filter_placeholder.to||"")+'" />',f(a).appendTo(i),r.oldonClose=r.onClose,d=r.onClose=function(e,a){var t,n=i.find(".dateFrom").datepicker("getDate"),d=i.find(".dateTo").datepicker("getDate");n=l(n)?n.getTime():"",d=l(d)&&(r.endOfDay?d.setHours(23,59,59,999):d.getTime())||"",t=n?d?n+" - "+d:">="+n:d?"<="+d:"",i.add(o).find(".dateRange").val(t).trigger("search"),n=n?new Date(n):"",d=d?new Date(d):"",/<=/.test(t)?i.add(o).find(".dateFrom").datepicker("option","maxDate",d||null).end().find(".dateTo").datepicker("option","minDate",null).datepicker("setDate",d||null):/>=/.test(t)?i.add(o).find(".dateFrom").datepicker("option","maxDate",null).datepicker("setDate",n||null).end().find(".dateTo").datepicker("option","minDate",n||null):i.add(o).find(".dateFrom").datepicker("option","maxDate",null).datepicker("setDate",n||null).end().find(".dateTo").datepicker("option","minDate",null).datepicker("setDate",d||null),"function"==typeof r.oldonClose&&r.oldonClose(e,a)},r.defaultDate=r.from||"",i.find(".dateFrom").datepicker(r),r.defaultDate=r.to||"+7d",i.find(".dateTo").datepicker(r),t.$table.bind("filterFomatterUpdate"+t.namespace+"filter",function(){var e=s.val()||"",a="",t="";/\s+-\s+/.test(e)?(a=(e=e.split(/\s+-\s+/)||[])[0]||"",t=e[1]||""):/>=/.test(e)?a=e.replace(/>=/,"")||"":/<=/.test(e)&&(t=e.replace(/<=/,"")||""),a=""!==a?/\d{5}/g.test(a)?new Date(Number(a)):a||"":"",t=""!==t?/\d{5}/g.test(t)?new Date(Number(t)):t||"":"",i.add(o).find(".dateFrom").datepicker("setDate",a||null),i.add(o).find(".dateTo").datepicker("setDate",t||null),setTimeout(function(){d(),u.filter.formatterUpdated(i,n)},0)}),t.$table.bind("stickyHeadersInit"+t.namespace+"filter",function(){(o=t.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(n).empty()).append(a),r.defaultDate=r.from||"",o.find(".dateFrom").datepicker(r),r.defaultDate=r.to||"+7d",o.find(".dateTo").datepicker(r)}),i.closest("table").bind("filterReset"+t.namespace+"filter",function(){i.add(o).find(".dateFrom").val("").datepicker("setDate",r.from||null),i.add(o).find(".dateTo").val("").datepicker("setDate",r.to||null),setTimeout(function(){d()},0)}),s.val(r.from?r.to?r.from+" - "+r.to:">="+r.from:r.to?"<="+r.to:"")}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-filter-formatter-select2.min.js b/web/_static/tablesorter/js/widgets/widget-filter-formatter-select2.min.js
new file mode 100644
index 0000000..f5563b2
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-filter-formatter-select2.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: filter, select2 formatter function - updated 12/1/2019 (v2.31.2) */
+!function(g){"use strict";var h=g.tablesorter||{};h.filterFormatter=h.filterFormatter||{},h.filterFormatter.select2=function(i,c,e){function t(){a=[],l=h.filter.getOptionSource(s.$table[0],c,f)||[],g.each(l,function(e,t){a.push({id:""+t.parsed,text:t.text})}),n.data=a}var l,a,n=g.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},e),s=i.addClass("select2col"+c).closest("table")[0].config,d=s.widgetOptions,r=g('<input class="filter" type="hidden">').appendTo(i).bind("change"+s.namespace+"filter",function(){var e=v(this.value);s.$table.find(".select2col"+c+" .select2").select2("val",e),$()}),o=s.$headerIndexed[c],f=o.hasClass(d.filter_onlyAvail),p=n.match?"":"^",u=n.match?"":"$",b=d.filter_ignoreCase?"i":"",v=function(e){return e.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/i?$/g,"").replace(/\\/g,"").split("|")},$=function(){var e=!1,t=s.$table.find(".select2col"+c+" .select2").select2("val")||n.value||"";g.isArray(t)&&(e=!0,t=t.join("\0"));var l=t.replace(/[-[\]{}()*+?.,/\\^$|#]/g,"\\$&");e&&(t=t.split("\0"),l=l.split("\0")),h.isEmptyObject(i.find(".select2").data())||(r.val(g.isArray(l)&&l.length&&""!==l.join("")?"/("+p+(l||[]).join(u+"|"+p)+u+")/"+b:"").trigger("search"),i.find(".select2").select2("val",t),s.widgetOptions.$sticky&&s.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val",t))};return o.toggleClass("filter-match",n.match),n.cellText&&i.prepend("<label>"+n.cellText+"</label>"),n.ajax&&!g.isEmptyObject(n.ajax)||n.data||(t(),s.$table.bind("filterEnd",function(){t(),s.$table.find(".select2col"+c).add(s.widgetOptions.$sticky&&s.widgetOptions.$sticky.find(".select2col"+c)).find(".select2").select2(n)})),g('<input class="select2 select2-'+c+'" type="hidden" />').val(n.value).appendTo(i).select2(n).bind("change",function(){$()}),s.$table.bind("filterFomatterUpdate",function(){var e=v(s.$table.data("lastSearch")[c]||"");(i=s.$table.find(".select2col"+c)).find(".select2").select2("val",e),$(),h.filter.formatterUpdated(i,c)}),s.$table.bind("stickyHeadersInit",function(){var e=s.widgetOptions.$sticky.find(".select2col"+c).empty();g('<input class="select2 select2-'+c+'" type="hidden">').val(n.value).appendTo(e).select2(n).bind("change",function(){s.$table.find(".select2col"+c).find(".select2").select2("val",s.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val")),$()}),n.cellText&&e.prepend("<label>"+n.cellText+"</label>")}),s.$table.bind("filterReset",function(){s.$table.find(".select2col"+c).find(".select2").select2("val",n.value||""),setTimeout(function(){$()},0)}),$(),r}}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-filter-type-insideRange.min.js b/web/_static/tablesorter/js/widgets/widget-filter-type-insideRange.min.js
new file mode 100644
index 0000000..4dd5a10
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-filter-type-insideRange.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: filter, insideRange filter type - updated 12/10/2015 (v2.25.0) */
+!function(){"use strict";function f(t){return isNaN(t)?t:parseFloat(t)}var t=jQuery.tablesorter,o=/\d+/,p=/\s+-\s+/;t.filter.types.insideRange=function(t,e){if(!e.anyMatch&&o.test(e.iFilter)&&p.test(e.iExact)){var r,i,n,a,s=e.index,l=e.$cells[s],u=e.iExact.split(p),c=t.parsers[e.index]&&t.parsers[e.index].format;return u&&u.length<2||"function"!=typeof c?null:(n=f(c(u[0],t.table,l,s)),(a=f(c(u[1],t.table,l,s)))<n&&(r=a,a=n,n=r),n<=(i=f(c(e.iFilter,t.table,l,s)))&&i<=a)}return null}}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-filter.min.js b/web/_static/tablesorter/js/widgets/widget-filter.min.js
new file mode 100644
index 0000000..632a18b
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-filter.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: filter - updated 2018-03-18 (v2.30.0) */
+!function(M){"use strict";var I,D,z=M.tablesorter||{},_=z.css,o=z.keyCodes;M.extend(_,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter",filterDisabled:"disabled",filterRowHide:"hideme"}),M.extend(o,{backSpace:8,escape:27,space:32,left:37,down:40}),z.addWidget({id:"filter",priority:50,options:{filter_cellFilter:"",filter_childRows:!1,filter_childByColumn:!1,filter_childWithSibs:!0,filter_columnAnyMatch:!0,filter_columnFilters:!0,filter_cssFilter:"",filter_defaultAttrib:"data-value",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_filterLabel:'Filter "{{label}}" column by...',filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_matchType:{input:"exact",select:"exact"},filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_resetOnEsc:!0,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_selectSourceSeparator:"|",filter_serversideFiltering:!1,filter_startsWith:!1,filter_useParsedData:!1},format:function(e,t,r){t.$table.hasClass("hasFilters")||I.init(e,t,r)},remove:function(e,t,r,i){var l,a,n=t.$table,s=t.$tbodies,o="addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit ".split(" ").join(t.namespace+"filter ");if(n.removeClass("hasFilters").unbind(o.replace(z.regex.spaces," ")).find("."+_.filterRow).remove(),r.filter_initialized=!1,!i){for(l=0;l<s.length;l++)(a=z.processTbody(e,s.eq(l),!0)).children().removeClass(r.filter_filteredRow).show(),z.processTbody(e,a,!1);r.filter_reset&&M(document).undelegate(r.filter_reset,"click"+t.namespace+"filter")}}}),D=(I=z.filter={regex:{regex:/^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/,child:/tablesorter-childRow/,filtered:/filtered/,type:/undefined|number/,exact:/(^[\"\'=]+)|([\"\'=]+$)/g,operators:/[<>=]/g,query:"(q|query)",wild01:/\?/g,wild0More:/\*/g,quote:/\"/g,isNeg1:/(>=?\s*-\d)/,isNeg2:/(<=?\s*\d)/},types:{or:function(e,t,r){if(!D.orTest.test(t.iFilter)&&!D.orSplit.test(t.filter)||D.regex.test(t.filter))return null;var i,l,a,n=M.extend({},t),s=t.filter.split(D.orSplit),o=t.iFilter.split(D.orSplit),c=s.length;for(i=0;i<c;i++){n.nestedFilters=!0,n.filter=""+(I.parseFilter(e,s[i],t)||""),n.iFilter=""+(I.parseFilter(e,o[i],t)||""),a="("+(I.parseFilter(e,n.filter,t)||"")+")";try{if(l=new RegExp(t.isMatch?a:"^"+a+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(n.exact)||I.processTypes(e,n,r))return l}catch(e){return null}}return l||!1},and:function(e,t,r){if(D.andTest.test(t.filter)){var i,l,a,n,s=M.extend({},t),o=t.filter.split(D.andSplit),c=t.iFilter.split(D.andSplit),f=o.length;for(i=0;i<f;i++){s.nestedFilters=!0,s.filter=""+(I.parseFilter(e,o[i],t)||""),s.iFilter=""+(I.parseFilter(e,c[i],t)||""),n=("("+(I.parseFilter(e,s.filter,t)||"")+")").replace(D.wild01,"\\S{1}").replace(D.wild0More,"\\S*");try{a=new RegExp(t.isMatch?n:"^"+n+"$",e.widgetOptions.filter_ignoreCase?"i":"").test(s.exact)||I.processTypes(e,s,r),l=0===i?a:l&&a}catch(e){return null}}return l||!1}return null},regex:function(e,t){if(D.regex.test(t.filter)){var r,i=t.filter_regexCache[t.index]||D.regex.exec(t.filter),l=i instanceof RegExp;try{l||(t.filter_regexCache[t.index]=i=new RegExp(i[1],i[2])),r=i.test(t.exact)}catch(e){r=!1}return r}return null},operators:function(e,t){if(D.operTest.test(t.iFilter)&&""!==t.iExact){var r,i,l,a=e.table,n=t.parsed[t.index],s=z.formatFloat(t.iFilter.replace(D.operators,""),a),o=e.parsers[t.index]||{},c=s;return!n&&"numeric"!==o.type||(l=M.trim(""+t.iFilter.replace(D.operators,"")),s="number"!=typeof(i=I.parseFilter(e,l,t,!0))||""===i||isNaN(i)?s:i),r=!n&&"numeric"!==o.type||isNaN(s)||void 0===t.cache?(l=isNaN(t.iExact)?t.iExact.replace(z.regex.nondigit,""):t.iExact,z.formatFloat(l,a)):t.cache,D.gtTest.test(t.iFilter)?i=D.gteTest.test(t.iFilter)?s<=r:s<r:D.ltTest.test(t.iFilter)&&(i=D.lteTest.test(t.iFilter)?r<=s:r<s),i||""!==c||(i=!0),i}return null},notMatch:function(e,t){if(D.notTest.test(t.iFilter)){var r,i=t.iFilter.replace("!",""),l=I.parseFilter(e,i,t)||"";return D.exact.test(l)?""===(l=l.replace(D.exact,""))||M.trim(l)!==t.iExact:(r=t.iExact.search(M.trim(l)),""===l||(t.anyMatch?r<0:!(e.widgetOptions.filter_startsWith?0===r:0<=r)))}return null},exact:function(e,t){if(D.exact.test(t.iFilter)){var r=t.iFilter.replace(D.exact,""),i=I.parseFilter(e,r,t)||"";return t.anyMatch?0<=M.inArray(i,t.rowArray):i==t.iExact}return null},range:function(e,t){if(D.toTest.test(t.iFilter)){var r,i,l,a,n=e.table,s=t.index,o=t.parsed[s],c=t.iFilter.split(D.toSplit);return i=c[0].replace(z.regex.nondigit,"")||"",l=z.formatFloat(I.parseFilter(e,i,t),n),i=c[1].replace(z.regex.nondigit,"")||"",a=z.formatFloat(I.parseFilter(e,i,t),n),!o&&"numeric"!==e.parsers[s].type||(l=""===(r=e.parsers[s].format(""+c[0],n,e.$headers.eq(s),s))||isNaN(r)?l:r,a=""===(r=e.parsers[s].format(""+c[1],n,e.$headers.eq(s),s))||isNaN(r)?a:r),r=!o&&"numeric"!==e.parsers[s].type||isNaN(l)||isNaN(a)?(i=isNaN(t.iExact)?t.iExact.replace(z.regex.nondigit,""):t.iExact,z.formatFloat(i,n)):t.cache,a<l&&(i=l,l=a,a=i),l<=r&&r<=a||""===l||""===a}return null},wild:function(e,t){if(D.wildOrTest.test(t.iFilter)){var r=""+(I.parseFilter(e,t.iFilter,t)||"");!D.wildTest.test(r)&&t.nestedFilters&&(r=t.isMatch?r:"^("+r+")$");try{return new RegExp(r.replace(D.wild01,"\\S{1}").replace(D.wild0More,"\\S*"),e.widgetOptions.filter_ignoreCase?"i":"").test(t.exact)}catch(e){return null}}return null},fuzzy:function(e,t){if(D.fuzzyTest.test(t.iFilter)){var r,i=0,l=t.iExact.length,a=t.iFilter.slice(1),n=I.parseFilter(e,a,t)||"";for(r=0;r<l;r++)t.iExact[r]===n[i]&&(i+=1);return i===n.length}return null}},init:function(r){z.language=M.extend(!0,{},{to:"to",or:"or",and:"and"},z.language);function e(e,t,r){return""===(t=t.trim())?"":(e||"")+t+(r||"")}var t,i,l,a,n,s,o,c,f=r.config,d=f.widgetOptions;if(f.$table.addClass("hasFilters"),f.lastSearch=[],d.filter_searchTimer=null,d.filter_initTimer=null,d.filter_formatterCount=0,d.filter_formatterInit=[],d.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',d.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',s="\\{"+D.query+"\\}",M.extend(D,{child:new RegExp(f.cssChildRow),filtered:new RegExp(d.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+(-"+e("|",z.language.or)+e("|",z.language.to)+")\\s+)","i"),toTest:new RegExp("\\s+(-"+e("|",z.language.to)+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-"+e("|",z.language.to)+")\\s+)","gi"),andTest:new RegExp("\\s+("+e("",z.language.and,"|")+"&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+e("",z.language.and,"|")+"&&)\\s+)","gi"),orTest:new RegExp("(\\|"+e("|\\s+",z.language.or,"\\s+")+")","i"),orSplit:new RegExp("(?:\\|"+e("|\\s+(?:",z.language.or,")\\s+")+")","gi"),iQuery:new RegExp(s,"i"),igQuery:new RegExp(s,"ig"),operTest:/^[<>]=?/,gtTest:/>/,gteTest:/>=/,ltTest:/</,lteTest:/<=/,notTest:/^\!/,wildOrTest:/[\?\*\|]/,wildTest:/\?\*/,fuzzyTest:/^~/,exactTest:/[=\"\|!]/}),s=f.$headers.filter(".filter-false, .parser-false").length,!1!==d.filter_columnFilters&&s!==f.$headers.length&&I.buildRow(r,f,d),l="addRows updateCell update updateRows updateComplete appendCache filterReset "+"filterAndSortReset filterResetSaved filterEnd search ".split(" ").join(f.namespace+"filter "),f.$table.bind(l,function(e,t){return s=d.filter_hideEmpty&&M.isEmptyObject(f.cache)&&!(f.delayInit&&"appendCache"===e.type),f.$table.find("."+_.filterRow).toggleClass(d.filter_filteredRow,s),/(search|filter)/.test(e.type)||(e.stopPropagation(),I.buildDefault(r,!0)),"filterReset"===e.type||"filterAndSortReset"===e.type?(f.$table.find("."+_.filter).add(d.filter_$externalFilters).val(""),"filterAndSortReset"===e.type?z.sortReset(this.config,function(){I.searching(r,[])}):I.searching(r,[])):"filterResetSaved"===e.type?z.storage(r,"tablesorter-filters",""):"filterEnd"===e.type?I.buildDefault(r,!0):(t="search"===e.type?t:"updateComplete"===e.type?f.$table.data("lastSearch"):"",/(update|add)/.test(e.type)&&"updateComplete"!==e.type&&(f.lastCombinedFilter=null,f.lastSearch=[],setTimeout(function(){f.$table.triggerHandler("filterFomatterUpdate")},100)),I.searching(r,t,!0)),!1}),d.filter_reset&&(d.filter_reset instanceof M?d.filter_reset.click(function(){f.$table.triggerHandler("filterReset")}):M(d.filter_reset).length&&M(document).undelegate(d.filter_reset,"click"+f.namespace+"filter").delegate(d.filter_reset,"click"+f.namespace+"filter",function(){f.$table.triggerHandler("filterReset")})),d.filter_functions)for(n=0;n<f.columns;n++)if(o=z.getColumnData(r,d.filter_functions,n))if(c=!((a=f.$headerIndexed[n].removeClass("filter-select")).hasClass("filter-false")||a.hasClass("parser-false")),!(t="")===o&&c)I.buildSelect(r,n);else if("object"==typeof o&&c){for(i in o)"string"==typeof i&&(t+=""===t?'<option value="">'+(a.data("placeholder")||a.attr("data-placeholder")||d.filter_placeholder.select||"")+"</option>":"",0<=(l=s=i).indexOf(d.filter_selectSourceSeparator)&&(l=(s=i.split(d.filter_selectSourceSeparator))[1],s=s[0]),t+="<option "+(l===s?"":'data-function-name="'+i+'" ')+'value="'+s+'">'+l+"</option>");f.$table.find("thead").find("select."+_.filter+'[data-column="'+n+'"]').append(t),(o="function"==typeof(l=d.filter_selectSource)||z.getColumnData(r,l,n))&&I.buildSelect(f.table,n,"",!0,a.hasClass(d.filter_onlyAvail))}I.buildDefault(r,!0),I.bindSearch(r,f.$table.find("."+_.filter),!0),d.filter_external&&I.bindSearch(r,d.filter_external),d.filter_hideFilters&&I.hideFilters(f),f.showProcessing&&(l="filterStart filterEnd ".split(" ").join(f.namespace+"filter-sp "),f.$table.unbind(l.replace(z.regex.spaces," ")).bind(l,function(e,t){a=t?f.$table.find("."+_.header).filter("[data-column]").filter(function(){return""!==t[M(this).data("column")]}):"",z.isProcessing(r,"filterStart"===e.type,t?a:"")})),f.filteredRows=f.totalRows,l="tablesorter-initialized pagerBeforeInitialized ".split(" ").join(f.namespace+"filter "),f.$table.unbind(l.replace(z.regex.spaces," ")).bind(l,function(){I.completeInit(this)}),f.pager&&f.pager.initialized&&!d.filter_initialized?(f.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){I.filterInitComplete(f)},100)):d.filter_initialized||I.completeInit(r)},completeInit:function(e){var t=e.config,r=t.widgetOptions,i=I.setDefaults(e,t,r)||[];i.length&&(t.delayInit&&""===i.join("")||z.setFilters(e,i,!0)),t.$table.triggerHandler("filterFomatterUpdate"),setTimeout(function(){r.filter_initialized||I.filterInitComplete(t)},100)},formatterUpdated:function(e,t){var r=e&&e.closest("table"),i=r.length&&r[0].config,l=i&&i.widgetOptions;l&&!l.filter_initialized&&(l.filter_formatterInit[t]=1)},filterInitComplete:function(e){function t(){l.filter_initialized=!0,e.lastSearch=e.$table.data("lastSearch"),e.$table.triggerHandler("filterInit",e),I.findRows(e.table,e.lastSearch||[]),z.debug(e,"filter")&&console.log("Filter >> Widget initialized")}var r,i,l=e.widgetOptions,a=0;if(M.isEmptyObject(l.filter_formatter))t();else{for(i=l.filter_formatterInit.length,r=0;r<i;r++)1===l.filter_formatterInit[r]&&a++;clearTimeout(l.filter_initTimer),l.filter_initialized||a!==l.filter_formatterCount?l.filter_initialized||(l.filter_initTimer=setTimeout(function(){t()},500)):t()}},processFilters:function(e,t){var r,i=[],l=t?encodeURIComponent:decodeURIComponent,a=e.length;for(r=0;r<a;r++)e[r]&&(i[r]=l(e[r]));return i},setDefaults:function(e,t,r){var i,l,a,n,s,o=z.getFilters(e)||[];if(r.filter_saveFilters&&z.storage&&(l=z.storage(e,"tablesorter-filters")||[],(i=M.isArray(l))&&""===l.join("")||!i||(o=I.processFilters(l))),""===o.join(""))for(s=t.$headers.add(r.filter_$externalFilters).filter("["+r.filter_defaultAttrib+"]"),a=0;a<=t.columns;a++)n=a===t.columns?"all":a,o[a]=s.filter('[data-column="'+n+'"]').attr(r.filter_defaultAttrib)||o[a]||"";return t.$table.data("lastSearch",o),o},parseFilter:function(e,t,r,i){return i||r.parsed[r.index]?e.parsers[r.index].format(t,e.table,[],r.index):t},buildRow:function(e,t,r){var i,l,a,n,s,o,c,f,d,u=r.filter_cellFilter,h=t.columns,p=M.isArray(u),g='<tr role="search" class="'+_.filterRow+" "+t.cssIgnoreRow+'">';for(a=0;a<h;a++)t.$headerIndexed[a].length&&(g+=1<(d=t.$headerIndexed[a]&&t.$headerIndexed[a][0].colSpan||0)?'<td data-column="'+a+"-"+(a+d-1)+'" colspan="'+d+'"':'<td data-column="'+a+'"',g+=p?u[a]?' class="'+u[a]+'"':"":""!==u?' class="'+u+'"':"",g+="></td>");for(t.$filters=M(g+="</tr>").appendTo(t.$table.children("thead").eq(0)).children("td"),a=0;a<h;a++)o=!1,(n=t.$headerIndexed[a])&&n.length&&(i=I.getColumnElm(t,t.$filters,a),f=z.getColumnData(e,r.filter_functions,a),s=r.filter_functions&&f&&"function"!=typeof f||n.hasClass("filter-select"),l=z.getColumnData(e,t.headers,a),o="false"===z.getData(n[0],l,"filter")||"false"===z.getData(n[0],l,"parser"),s?g=M("<select>").appendTo(i):((f=z.getColumnData(e,r.filter_formatter,a))?(r.filter_formatterCount++,(g=f(i,a))&&0===g.length&&(g=i.children("input")),g&&(0===g.parent().length||g.parent().length&&g.parent()[0]!==i[0])&&i.append(g)):g=M('<input type="search">').appendTo(i),g&&(d=n.data("placeholder")||n.attr("data-placeholder")||r.filter_placeholder.search||"",g.attr("placeholder",d))),g&&(c=(M.isArray(r.filter_cssFilter)?void 0!==r.filter_cssFilter[a]&&r.filter_cssFilter[a]||"":r.filter_cssFilter)||"",g.addClass(_.filter+" "+c),d=(d=(c=r.filter_filterLabel).match(/{{([^}]+?)}}/g))||["{{label}}"],M.each(d,function(e,t){var r=new RegExp(t,"g"),i=n.attr("data-"+t.replace(/{{|}}/g,"")),l=void 0===i?n.text():i;c=c.replace(r,M.trim(l))}),g.attr({"data-column":i.attr("data-column"),"aria-label":c}),o&&(g.attr("placeholder","").addClass(_.filterDisabled)[0].disabled=!0)))},bindSearch:function(l,e,t){if(l=M(l)[0],(e=M(e)).length){var r,a=l.config,n=a.widgetOptions,i=a.namespace+"filter",s=n.filter_$externalFilters;!0!==t&&(r=n.filter_anyColumnSelector+","+n.filter_multipleColumnSelector,n.filter_$anyMatch=e.filter(r),s&&s.length?n.filter_$externalFilters=n.filter_$externalFilters.add(e):n.filter_$externalFilters=e,z.setFilters(l,a.$table.data("lastSearch")||[],!1===t)),r="keypress keyup keydown search change input ".split(" ").join(i+" "),e.attr("data-lastSearchTime",(new Date).getTime()).unbind(r.replace(z.regex.spaces," ")).bind("keydown"+i,function(e){if(e.which===o.escape&&!l.config.widgetOptions.filter_resetOnEsc)return!1}).bind("keyup"+i,function(e){n=l.config.widgetOptions;var t=parseInt(M(this).attr("data-column"),10),r="boolean"==typeof n.filter_liveSearch?n.filter_liveSearch:z.getColumnData(l,n.filter_liveSearch,t);if(void 0===r&&(r=n.filter_liveSearch.fallback||!1),M(this).attr("data-lastSearchTime",(new Date).getTime()),e.which===o.escape)this.value=n.filter_resetOnEsc?"":a.lastSearch[t];else{if(""!==this.value&&("number"==typeof r&&this.value.length<r||e.which!==o.enter&&e.which!==o.backSpace&&(e.which<o.space||e.which>=o.left&&e.which<=o.down)))return;if(!1===r&&""!==this.value&&e.which!==o.enter)return}I.searching(l,!0,!0,t)}).bind("search change keypress input blur ".split(" ").join(i+" "),function(e){var t=parseInt(M(this).attr("data-column"),10),r=e.type,i="boolean"==typeof n.filter_liveSearch?n.filter_liveSearch:z.getColumnData(l,n.filter_liveSearch,t);!l.config.widgetOptions.filter_initialized||e.which!==o.enter&&"search"!==r&&"blur"!==r&&("change"!==r&&"input"!==r||!0!==i&&(!0===i||"INPUT"===e.target.nodeName)||this.value===a.lastSearch[t])||(e.preventDefault(),M(this).attr("data-lastSearchTime",(new Date).getTime()),I.searching(l,"keypress"!==r||e.which===o.enter,!0,t))})}},searching:function(e,t,r,i){var l,a=e.config.widgetOptions;void 0===i?l=!1:void 0===(l="boolean"==typeof a.filter_liveSearch?a.filter_liveSearch:z.getColumnData(e,a.filter_liveSearch,i))&&(l=a.filter_liveSearch.fallback||!1),clearTimeout(a.filter_searchTimer),void 0===t||!0===t?a.filter_searchTimer=setTimeout(function(){I.checkFilters(e,t,r)},l?a.filter_searchDelay:10):I.checkFilters(e,t,r)},equalFilters:function(e,t,r){var i,l=[],a=[],n=e.columns+1;for(t=M.isArray(t)?t:[],r=M.isArray(r)?r:[],i=0;i<n;i++)l[i]=t[i]||"",a[i]=r[i]||"";return l.join(",")===a.join(",")},checkFilters:function(e,t,r){var i=e.config,l=i.widgetOptions,a=M.isArray(t),n=a?t:z.getFilters(e,!0),s=n||[];if(M.isEmptyObject(i.cache))i.delayInit&&(!i.pager||i.pager&&i.pager.initialized)&&z.updateCache(i,function(){I.checkFilters(e,!1,r)});else{if(a&&(z.setFilters(e,n,!1,!0!==r),l.filter_initialized||(i.lastSearch=[],i.lastCombinedFilter="")),l.filter_hideFilters&&i.$table.find("."+_.filterRow).triggerHandler(I.hideFiltersCheck(i)?"mouseleave":"mouseenter"),I.equalFilters(i,i.lastSearch,s)){if(!1!==t)return;i.lastCombinedFilter="",i.lastSearch=[]}if(n=n||[],n=Array.prototype.map?n.map(String):n.join("�").split("�"),l.filter_initialized&&i.$table.triggerHandler("filterStart",[n]),!i.showProcessing)return I.findRows(e,n,s),!1;setTimeout(function(){return I.findRows(e,n,s),!1},30)}},hideFiltersCheck:function(e){if("function"==typeof e.widgetOptions.filter_hideFilters){var t=e.widgetOptions.filter_hideFilters(e);if("boolean"==typeof t)return t}return""===z.getFilters(e.$table).join("")},hideFilters:function(i,e){var l;(e||i.$table).find("."+_.filterRow).addClass(_.filterRowHide).bind("mouseenter mouseleave",function(e){var t=e,r=M(this);clearTimeout(l),l=setTimeout(function(){/enter|over/.test(t.type)?r.removeClass(_.filterRowHide):M(document.activeElement).closest("tr")[0]!==r[0]&&r.toggleClass(_.filterRowHide,I.hideFiltersCheck(i))},200)}).find("input, select").bind("focus blur",function(e){var t=e,r=M(this).closest("tr");clearTimeout(l),l=setTimeout(function(){clearTimeout(l),r.toggleClass(_.filterRowHide,I.hideFiltersCheck(i)&&"focus"!==t.type)},200)})},defaultFilter:function(e,t){if(""===e)return e;var r=D.iQuery,i=t.match(D.igQuery).length,l=1<i?M.trim(e).split(/\s/):[M.trim(e)],a=l.length-1,n=0,s=t;for(a<1&&1<i&&(l[1]=l[0]);r.test(s);)s=s.replace(r,l[n++]||""),r.test(s)&&n<a&&""!==(l[n]||"")&&(s=t.replace(r,s));return s},getLatestSearch:function(e){return e?e.sort(function(e,t){return M(t).attr("data-lastSearchTime")-M(e).attr("data-lastSearchTime")}):e||M()},findRange:function(e,t,r){var i,l,a,n,s,o,c,f,d,u=[];if(/^[0-9]+$/.test(t))return[parseInt(t,10)];if(!r&&/-/.test(t))for(d=(l=t.match(/(\d+)\s*-\s*(\d+)/g))?l.length:0,f=0;f<d;f++){for(a=l[f].split(/\s*-\s*/),n=parseInt(a[0],10)||0,(s=parseInt(a[1],10)||e.columns-1)<n&&(i=n,n=s,s=i),s>=e.columns&&(s=e.columns-1);n<=s;n++)u[u.length]=n;t=t.replace(l[f],"")}if(!r&&/,/.test(t))for(d=(o=t.split(/\s*,\s*/)).length,c=0;c<d;c++)""!==o[c]&&(f=parseInt(o[c],10))<e.columns&&(u[u.length]=f);if(!u.length)for(f=0;f<e.columns;f++)u[u.length]=f;return u},getColumnElm:function(t,e,r){return e.filter(function(){var e=I.findRange(t,M(this).attr("data-column"));return-1<M.inArray(r,e)})},multipleColumns:function(e,t){var r=e.widgetOptions,i=r.filter_initialized||!t.filter(r.filter_anyColumnSelector).length,l=M.trim(I.getLatestSearch(t).attr("data-column")||"");return I.findRange(e,l,!i)},processTypes:function(e,t,r){var i,l=null,a=null;for(i in I.types)M.inArray(i,r.excludeMatch)<0&&null===a&&null!==(a=I.types[i](e,t,r))&&(t.matchedOn=i,l=a);return l},matchType:function(e,t){var r=e.widgetOptions,i=e.$headerIndexed[t];return!i.hasClass("filter-exact")&&(!!i.hasClass("filter-match")||(r.filter_columnFilters?i=e.$filters.find("."+_.filter).add(r.filter_$externalFilters).filter('[data-column="'+t+'"]'):r.filter_$externalFilters&&(i=r.filter_$externalFilters.filter('[data-column="'+t+'"]')),!!i.length&&"match"===e.widgetOptions.filter_matchType[(i[0].nodeName||"").toLowerCase()]))},processRow:function(t,r,e){var i,l,a,n,s,o=t.widgetOptions,c=!0,f=o.filter_$anyMatch&&o.filter_$anyMatch.length,d=o.filter_$anyMatch&&o.filter_$anyMatch.length?I.multipleColumns(t,o.filter_$anyMatch):[];if(r.$cells=r.$row.children(),r.matchedOn=null,r.anyMatchFlag&&1<d.length||r.anyMatchFilter&&!f){if(r.anyMatch=!0,r.isMatch=!0,r.rowArray=r.$cells.map(function(e){if(-1<M.inArray(e,d)||r.anyMatchFilter&&!f)return r.parsed[e]?s=r.cacheArray[e]:(s=r.rawArray[e],s=M.trim(o.filter_ignoreCase?s.toLowerCase():s),t.sortLocaleCompare&&(s=z.replaceAccents(s))),s}).get(),r.filter=r.anyMatchFilter,r.iFilter=r.iAnyMatchFilter,r.exact=r.rowArray.join(" "),r.iExact=o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.cache=r.cacheArray.slice(0,-1).join(" "),e.excludeMatch=e.noAnyMatch,null!==(l=I.processTypes(t,r,e)))c=l;else if(o.filter_startsWith)for(c=!1,d=Math.min(t.columns,r.rowArray.length);!c&&0<d;)d--,c=c||0===r.rowArray[d].indexOf(r.iFilter);else c=0<=(r.iExact+r.childRowText).indexOf(r.iFilter);if(r.anyMatch=!1,r.filters.join("")===r.filter)return c}for(d=0;d<t.columns;d++)r.filter=r.filters[d],r.index=d,e.excludeMatch=e.excludeFilter[d],r.filter&&(r.cache=r.cacheArray[d],i=r.parsed[d]?r.cache:r.rawArray[d]||"",r.exact=t.sortLocaleCompare?z.replaceAccents(i):i,r.iExact=!D.type.test(typeof r.exact)&&o.filter_ignoreCase?r.exact.toLowerCase():r.exact,r.isMatch=I.matchType(t,d),i=c,n=o.filter_columnFilters&&t.$filters.add(o.filter_$externalFilters).filter('[data-column="'+d+'"]').find("select option:selected").attr("data-function-name")||"",t.sortLocaleCompare&&(r.filter=z.replaceAccents(r.filter)),o.filter_defaultFilter&&D.iQuery.test(e.defaultColFilter[d])&&(r.filter=I.defaultFilter(r.filter,e.defaultColFilter[d])),r.iFilter=o.filter_ignoreCase?(r.filter||"").toLowerCase():r.filter,l=null,(a=e.functions[d])&&("function"==typeof a?l=a(r.exact,r.cache,r.filter,d,r.$row,t,r):"function"==typeof a[n||r.filter]&&(l=a[s=n||r.filter](r.exact,r.cache,r.filter,d,r.$row,t,r))),c=!!(i=null===l?(l=I.processTypes(t,r,e),s=!0===a&&("and"===r.matchedOn||"or"===r.matchedOn),null===l||s?!0===a?r.isMatch?0<=(""+r.iExact).search(r.iFilter):r.filter===r.exact:(s=(r.iExact+r.childRowText).indexOf(I.parseFilter(t,r.iFilter,r)),!o.filter_startsWith&&0<=s||o.filter_startsWith&&0===s):l):l)&&c);return c},findRows:function(e,r,t){if(!I.equalFilters(e.config,e.config.lastSearch,t)&&e.config.widgetOptions.filter_initialized){var i,l,a,n,s,o,c,f,d,u,h,p,g,m,_,y,F,w,x,b,C,v,$,S=M.extend([],r),R=e.config,T=R.widgetOptions,A=z.debug(R,"filter"),O={anyMatch:!1,filters:r,filter_regexCache:[]},E={noAnyMatch:["range","operators"],functions:[],excludeFilter:[],defaultColFilter:[],defaultAnyFilter:z.getColumnData(e,T.filter_defaultFilter,R.columns,!0)||""};for(O.parsed=[],d=0;d<R.columns;d++)O.parsed[d]=T.filter_useParsedData||R.parsers&&R.parsers[d]&&R.parsers[d].parsed||z.getData&&"parsed"===z.getData(R.$headerIndexed[d],z.getColumnData(e,R.headers,d),"filter")||R.$headerIndexed[d].hasClass("filter-parsed"),E.functions[d]=z.getColumnData(e,T.filter_functions,d)||R.$headerIndexed[d].hasClass("filter-select"),E.defaultColFilter[d]=z.getColumnData(e,T.filter_defaultFilter,d)||"",E.excludeFilter[d]=(z.getColumnData(e,T.filter_excludeFilter,d,!0)||"").split(/\s+/);for(A&&(console.log("Filter >> Starting filter widget search",r),m=new Date),R.filteredRows=0,t=S||[],c=R.totalRows=0;c<R.$tbodies.length;c++){if(f=z.processTbody(e,R.$tbodies.eq(c),!0),d=R.columns,l=R.cache[c].normalized,n=M(M.map(l,function(e){return e[d].$row.get()})),""===t.join("")||T.filter_serversideFiltering)n.removeClass(T.filter_filteredRow).not("."+R.cssChildRow).css("display","");else{if(i=(n=n.not("."+R.cssChildRow)).length,(T.filter_$anyMatch&&T.filter_$anyMatch.length||void 0!==r[R.columns])&&(O.anyMatchFlag=!0,O.anyMatchFilter=""+(r[R.columns]||T.filter_$anyMatch&&I.getLatestSearch(T.filter_$anyMatch).val()||""),T.filter_columnAnyMatch)){for(x=O.anyMatchFilter.split(D.andSplit),b=!1,y=0;y<x.length;y++)1<(C=x[y].split(":")).length&&(isNaN(C[0])?M.each(R.headerContent,function(e,t){-1<t.toLowerCase().indexOf(C[0])&&(r[v=e]=C[1])}):v=parseInt(C[0],10)-1,0<=v&&v<R.columns&&(r[v]=C[1],x.splice(y,1),y--,b=!0));b&&(O.anyMatchFilter=x.join(" && "))}if(w=T.filter_searchFiltered,h=R.lastSearch||R.$table.data("lastSearch")||[],w)for(y=0;y<d+1;y++)_=r[y]||"",w||(y=d),w=w&&h.length&&0===_.indexOf(h[y]||"")&&!D.alreadyFiltered.test(_)&&!D.exactTest.test(_)&&!(D.isNeg1.test(_)||D.isNeg2.test(_))&&!(""!==_&&R.$filters&&R.$filters.filter('[data-column="'+y+'"]').find("select").length&&!I.matchType(R,y));for(F=n.not("."+T.filter_filteredRow).length,w&&0===F&&(w=!1),A&&console.log("Filter >> Searching through "+(w&&F<i?F:"all")+" rows"),O.anyMatchFlag&&(R.sortLocaleCompare&&(O.anyMatchFilter=z.replaceAccents(O.anyMatchFilter)),T.filter_defaultFilter&&D.iQuery.test(E.defaultAnyFilter)&&(O.anyMatchFilter=I.defaultFilter(O.anyMatchFilter,E.defaultAnyFilter),w=!1),O.iAnyMatchFilter=T.filter_ignoreCase&&R.ignoreCase?O.anyMatchFilter.toLowerCase():O.anyMatchFilter),o=0;o<i;o++)if($=n[o].className,!(o&&D.child.test($)||w&&D.filtered.test($))){if(O.$row=n.eq(o),O.rowIndex=o,O.cacheArray=l[o],a=O.cacheArray[R.columns],O.rawArray=a.raw,O.childRowText="",!T.filter_childByColumn){for($="",u=a.child,y=0;y<u.length;y++)$+=" "+u[y].join(" ")||"";O.childRowText=T.filter_childRows?T.filter_ignoreCase?$.toLowerCase():$:""}if(p=!1,g=I.processRow(R,O,E),s=a.$row,_=!!g,u=a.$row.filter(":gt(0)"),T.filter_childRows&&u.length){if(T.filter_childByColumn)for(T.filter_childWithSibs||(u.addClass(T.filter_filteredRow),s=s.eq(0)),y=0;y<u.length;y++)O.$row=u.eq(y),O.cacheArray=a.child[y],O.rawArray=O.cacheArray,_=I.processRow(R,O,E),p=p||_,!T.filter_childWithSibs&&_&&u.eq(y).removeClass(T.filter_filteredRow);p=p||g}else p=_;s.toggleClass(T.filter_filteredRow,!p)[0].display=p?"":"none"}}R.filteredRows+=n.not("."+T.filter_filteredRow).length,R.totalRows+=n.length,z.processTbody(e,f,!1)}R.lastCombinedFilter=S.join(""),R.lastSearch=S,R.$table.data("lastSearch",S),T.filter_saveFilters&&z.storage&&z.storage(e,"tablesorter-filters",I.processFilters(S,!0)),A&&console.log("Filter >> Completed search"+z.benchmark(m)),T.filter_initialized&&(R.$table.triggerHandler("filterBeforeEnd",R),R.$table.triggerHandler("filterEnd",R)),setTimeout(function(){z.applyWidget(R.table)},0)}},getOptionSource:function(e,t,r){var i=(e=M(e)[0]).config,l=!1,a=i.widgetOptions.filter_selectSource,n=i.$table.data("lastSearch")||[],s="function"==typeof a||z.getColumnData(e,a,t);if(r&&""!==n[t]&&(r=!1),!0===s)l=a(e,t,r);else{if(s instanceof M||"string"===M.type(s)&&0<=s.indexOf("</option>"))return s;if(M.isArray(s))l=s;else if("object"===M.type(a)&&s&&null===(l=s(e,t,r)))return null}return!1===l&&(l=I.getOptions(e,t,r)),I.processOptions(e,t,l)},processOptions:function(l,a,r){if(!M.isArray(r))return!1;var n,e,t,i,s,o,c=(l=M(l)[0]).config,f=null!=a&&0<=a&&a<c.columns,d=f&&c.$headerIndexed[a].hasClass("filter-select-sort-desc"),u=[];if(r=M.grep(r,function(e,t){return!!e.text||M.inArray(e,r)===t}),f&&c.$headerIndexed[a].hasClass("filter-select-nosort"))return r;for(i=r.length,t=0;t<i;t++)o=(e=r[t]).text?e.text:e,s=(f&&c.parsers&&c.parsers.length&&c.parsers[a].format(o,l,[],a)||o).toString(),s=c.widgetOptions.filter_ignoreCase?s.toLowerCase():s,e.text?(e.parsed=s,u[u.length]=e):u[u.length]={text:e,parsed:s};for(n=c.textSorter||"",u.sort(function(e,t){var r=d?t.parsed:e.parsed,i=d?e.parsed:t.parsed;return f&&"function"==typeof n?n(r,i,!0,a,l):f&&"object"==typeof n&&n.hasOwnProperty(a)?n[a](r,i,!0,a,l):!z.sortNatural||z.sortNatural(r,i)}),r=[],i=u.length,t=0;t<i;t++)r[r.length]=u[t];return r},getOptions:function(e,t,r){var i,l,a,n,s,o,c,f,d=(e=M(e)[0]).config,u=d.widgetOptions,h=[];for(l=0;l<d.$tbodies.length;l++)for(s=d.cache[l],a=d.cache[l].normalized.length,i=0;i<a;i++)if(n=s.row?s.row[i]:s.normalized[i][d.columns].$row[0],!r||!n.className.match(u.filter_filteredRow))if(u.filter_useParsedData||d.parsers[t].parsed||d.$headerIndexed[t].hasClass("filter-parsed")){if(h[h.length]=""+s.normalized[i][t],u.filter_childRows&&u.filter_childByColumn)for(f=s.normalized[i][d.columns].$row.length-1,o=0;o<f;o++)h[h.length]=""+s.normalized[i][d.columns].child[o][t]}else if(h[h.length]=s.normalized[i][d.columns].raw[t],u.filter_childRows&&u.filter_childByColumn)for(f=s.normalized[i][d.columns].$row.length,o=1;o<f;o++)c=s.normalized[i][d.columns].$row.eq(o).children().eq(t),h[h.length]=""+z.getElementText(d,c,t);return h},buildSelect:function(e,t,r,i,l){if(e=M(e)[0],t=parseInt(t,10),e.config.cache&&!M.isEmptyObject(e.config.cache)){var a,n,s,o,c,f,d,u=e.config,h=u.widgetOptions,p=u.$headerIndexed[t],g='<option value="">'+(p.data("placeholder")||p.attr("data-placeholder")||h.filter_placeholder.select||"")+"</option>",m=u.$table.find("thead").find("select."+_.filter+'[data-column="'+t+'"]').val();if(void 0!==r&&""!==r||null!==(r=I.getOptionSource(e,t,l))){if(M.isArray(r)){for(a=0;a<r.length;a++)if((d=r[a]).text){for(n in d["data-function-name"]=void 0===d.value?d.text:d.value,g+="<option",d)d.hasOwnProperty(n)&&"text"!==n&&(g+=" "+n+'="'+d[n].replace(D.quote,"&quot;")+'"');d.value||(g+=' value="'+d.text.replace(D.quote,"&quot;")+'"'),g+=">"+d.text.replace(D.quote,"&quot;")+"</option>"}else""+d!="[object Object]"&&(0<=(n=s=d=(""+d).replace(D.quote,"&quot;")).indexOf(h.filter_selectSourceSeparator)&&(n=(o=s.split(h.filter_selectSourceSeparator))[0],s=o[1]),g+=""!==d?"<option "+(n===s?"":'data-function-name="'+d+'" ')+'value="'+n+'">'+s+"</option>":"");r=[]}c=(u.$filters?u.$filters:u.$table.children("thead")).find("."+_.filter),h.filter_$externalFilters&&(c=c&&c.length?c.add(h.filter_$externalFilters):h.filter_$externalFilters),(f=c.filter('select[data-column="'+t+'"]')).length&&(f[i?"html":"append"](g),M.isArray(r)||f.append(r).val(m),f.val(m))}}},buildDefault:function(e,t){var r,i,l,a=e.config,n=a.widgetOptions,s=a.columns;for(r=0;r<s;r++)l=!((i=a.$headerIndexed[r]).hasClass("filter-false")||i.hasClass("parser-false")),(i.hasClass("filter-select")||!0===z.getColumnData(e,n.filter_functions,r))&&l&&I.buildSelect(e,r,"",t,i.hasClass(n.filter_onlyAvail))}}).regex,z.getFilters=function(e,t,r,i){var l,a,n,s,o=[],c=e?M(e)[0].config:"",f=c?c.widgetOptions:"";if(!0!==t&&f&&!f.filter_columnFilters||M.isArray(r)&&I.equalFilters(c,r,c.lastSearch))return M(e).data("lastSearch")||[];if(c&&(c.$filters&&(a=c.$filters.find("."+_.filter)),f.filter_$externalFilters&&(a=a&&a.length?a.add(f.filter_$externalFilters):f.filter_$externalFilters),a&&a.length))for(o=r||[],l=0;l<c.columns+1;l++)s=l===c.columns?f.filter_anyColumnSelector+","+f.filter_multipleColumnSelector:'[data-column="'+l+'"]',(n=a.filter(s)).length&&(n=I.getLatestSearch(n),M.isArray(r)?(i&&1<n.length&&(n=n.slice(1)),l===c.columns&&(n=(s=n.filter(f.filter_anyColumnSelector)).length?s:n),n.val(r[l]).trigger("change"+c.namespace)):(o[l]=n.val()||"",l===c.columns?n.slice(1).filter('[data-column*="'+n.attr("data-column")+'"]').val(o[l]):n.slice(1).val(o[l])),l===c.columns&&n.length&&(f.filter_$anyMatch=n));return o},z.setFilters=function(e,t,r,i){var l=e?M(e)[0].config:"",a=z.getFilters(e,!0,t,i);return void 0===r&&(r=!0),l&&r&&(l.lastCombinedFilter=null,l.lastSearch=[],I.searching(l.table,t,i),l.$table.triggerHandler("filterFomatterUpdate")),0!==a.length}}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-formatter.min.js b/web/_static/tablesorter/js/widgets/widget-formatter.min.js
new file mode 100644
index 0000000..31cb720
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-formatter.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: formatter - 2/9/2015 (v2.19.1) */
+!function(d){"use strict";var u=d.tablesorter;u.formatter={init:function(t){var e=t.widgetOptions.formatter_event+" pagerComplete updateComplete ".split(" ").join(".tsformatter ");t.$table.off(e.replace(/\s+/g," ")).on(e,function(){u.formatter.setup(t)}),u.formatter.setup(t)},setup:function(t){if(!d.isEmptyObject(t.cache)){var e,o,r,n,i,a,l,c=t.widgetOptions,f={config:t,wo:c},s=[],m=[];for(l=0;l<t.columns;l++)m[l]=t.$headerIndexed[l],s[l]=u.getColumnData(t.table,c.formatter_column,l)||!1;for(o=0;o<t.$tbodies.length;o++){for(e=u.processTbody(t.table,t.$tbodies.eq(o),!0),a=(n=t.cache[o]).normalized.length,r=0;r<a;r++)for(f.$row=n.normalized[r][t.columns].$row,f.$cells=f.$row.children("th, td"),l=0;l<t.columns;l++)s[l]&&(f.columnIndex=l,f.$header=m[l],f.$cell=f.$cells.eq(l),i=f.$cell[0],f.text=i.getAttribute(t.textAttribute)||i.textContent||f.$cell.text(),i.innerHTML=s[l](f.text,f));u.processTbody(t.table,e,!1)}}}},u.addWidget({id:"formatter",priority:100,options:{formatter_column:{},formatter_event:"applyFormatter"},init:function(t){u.formatter.init(t.config)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-grouping.min.js b/web/_static/tablesorter/js/widgets/widget-grouping.min.js
new file mode 100644
index 0000000..1d35852
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-grouping.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: grouping - updated 9/27/2017 (v2.29.0) */
+!function(i){"use strict";var l=i.tablesorter,g=l.grouping={types:{number:function(r,o,e,u){var p,t=o.hasClass(l.css.sortAsc);return 1<u&&""!==e?(p=t?Math.floor(parseFloat(e)/u)*u:Math.ceil(parseFloat(e)/u)*u,p+=" - "+(p+(u-1)*(t?1:-1))):p=parseFloat(e)||e,p},separator:function(r,o,e,u){var p=(e+"").split(r.widgetOptions.group_separator);return i.trim(p[u-1]||"")},text:function(r,o,e){return e},word:function(r,o,e,u){return((e+" ").match(/\w+/g)||[])[u-1]||""},letter:function(r,o,e,u){return e?(e+" ").substring(0,u):""},date:function(r,o,e,u){var p,t,a=r.widgetOptions,s=new Date(e||"");return s instanceof Date&&isFinite(s)?(p=s.getFullYear(),t=g.findMonth(a,s.getMonth()),"year"===u?p:"month"===u?t:"monthyear"===u?t+" "+p:"day"===u?t+" "+s.getDate():"week"===u?g.findWeek(a,s.getDay()):"time"===u?g.findTime(a,s):"hour"===u?g.findTime(a,s,"hour"):a.group_dateString(s,r,o)):a.group_dateInvalid}},findMonth:function(r,o){return r.group_months[o+(""===(r.group_months[0]||"")?1:0)]},findWeek:function(r,o){if(i.isArray(r.group_week))return r.group_week[o];if(!i.isEmptyObject(r.group_week)){return r.group_week[["sun","mon","tue","wed","thu","fri","sat"][o]]}},findTime:function(r,o,e){var u,p=r.group_time.am&&r.group_time.pm,t=o.getHours(),a=12<=t?1:0,s=("00"+(r.group_time24Hour&&12<t?t-12:r.group_time24Hour&&0===t?t+12:t)).slice(-2),n=("00"+o.getMinutes()).slice(-2);return u=r.group_time[p?["am","pm"][a]:a],"hour"===e?s:s+":"+n+(r.group_time24Hour?"":" "+(u||""))},update:function(r){if(!i.isEmptyObject(r.config.cache)){var o=r.config,e=o.widgetOptions,u=void 0!==o.sortList[0],p={},t=i.isArray(e.group_forceColumn)&&void 0!==e.group_forceColumn[0]?e.group_enforceSort&&!u?-1:e.group_forceColumn[0]:u?o.sortList[0][0]:-1;o.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove(),e.group_collapsible&&o.$table.data("pagerSavedHeight",0),0<=t&&t<o.columns&&!o.$headerIndexed[t].hasClass("group-false")&&(e.group_collapsedGroup="",e.group_collapsedGroups={},p.column=t,p.groupClass=(o.$headerIndexed[t].attr("class")||"").match(/(group-\w+(-\w+)?)/g),p.grouping=p.groupClass?p.groupClass[0].split("-"):["group","letter",1],p.savedGroup=g.saveCurrentGrouping(o,e,p),g.findColumnGroups(o,e,p),g.processHeaders(o,e,p),o.$table.triggerHandler(e.group_complete))}},processHeaders:function(r,o,e){var u,p,t,a,s,n,l=r.$table.find("tr.group-header"),g=l.length;for(l.bind("selectstart",!1),u=0;u<g;u++)s=(n=l.eq(u)).nextUntil("tr.group-header").filter(":visible"),(o.group_count||i.isFunction(o.group_callback))&&(t=n.find(".group-count")).length&&(o.group_count&&t.html(o.group_count.toString().replace(/\{num\}/g,s.length)),i.isFunction(o.group_callback)&&o.group_callback(n.find("td"),s,e.column,r.table)),o.group_saveGroups&&!i.isEmptyObject(o.group_collapsedGroups)&&o.group_collapsedGroups[o.group_collapsedGroup].length?(a=n.find(".group-name").text().toLowerCase()+n.attr("data-group-index"),p=-1<i.inArray(a,o.group_collapsedGroups[o.group_collapsedGroup]),n.toggleClass("collapsed",p),s.toggleClass("group-hidden",p)):o.group_collapsed&&o.group_collapsible&&(n.addClass("collapsed"),s.addClass("group-hidden"))},groupHeaderHTML:function(r,o,e){var u=(e.currentGroup||"").toString().replace(/</g,"&lt;").replace(/>/g,"&gt;");return'<tr class="group-header '+r.selectorRemove.slice(1)+" "+(o.columnSelector_classHasSpan||"hasSpan")+'" unselectable="on" '+(r.tabIndex?'tabindex="0" ':"")+'data-group-index="'+e.groupIndex+'"><td colspan="'+r.columns+'">'+(o.group_collapsible?"<i/>":"")+'<span class="group-name">'+u+'</span><span class="group-count"></span></td></tr>'},saveCurrentGrouping:function(r,o,e){var u,p,t=!1;return o.group_collapsible&&o.group_saveGroups&&(o.group_collapsedGroups=l.storage&&l.storage(r.table,"tablesorter-groups")||{},p="dir"+r.sortList[0][1],u=o.group_collapsedGroup=r.sortList[0][0]+p+e.grouping.join(""),o.group_collapsedGroups[u]?t=!0:o.group_collapsedGroups[u]=[]),t},findColumnGroups:function(r,o,e){var u,p,t,a,s=l.hasWidget(r.table,"pager"),n=r.pager||{};for(u=e.groupIndex=0;u<r.$tbodies.length;u++)for(p=r.cache[u].normalized,e.group=void 0,t=s&&!n.ajax?n.startRow-1:0,a=s?n.endRow-(n.ajax?n.startRow:0):p.length;t<a;t++)e.rowData=p[t],e.rowData&&(e.$row=e.rowData[r.columns].$row,e.$row.is(":visible")&&g.types[e.grouping[1]]&&g.insertGroupHeader(r,o,e));l.hasWidget(r.table,"columnSelector")&&l.columnSelector.setUpColspan(r,o)},insertGroupHeader:function(r,o,e){var u=r.$headerIndexed[e.column],p=e.rowData[e.column],t=/date/.test(e.groupClass)?e.grouping[2]:parseInt(e.grouping[2]||1,10)||1;e.currentGroup=e.rowData?g.types[e.grouping[1]](r,u,p,t,e.group):e.currentGroup,e.group!==e.currentGroup&&(e.group=e.currentGroup,i.isFunction(o.group_formatter)&&(e.currentGroup=o.group_formatter((e.group||"").toString(),e.column,r.table,r,o,e)||e.group),e.$row.first().before(g.groupHeaderHTML(r,o,e)),o.group_saveGroups&&!e.savedGroup&&o.group_collapsed&&o.group_collapsible&&o.group_collapsedGroups[o.group_collapsedGroup].push(e.currentGroup+e.groupIndex),e.groupIndex++)},bindEvents:function(t,a,s){s.group_collapsible&&(s.group_collapsedGroups=[],a.$table.on("click toggleGroup keyup","tr.group-header",function(r){if(r.stopPropagation(),"keyup"!==r.type||13===r.which){var o,e,u=i(this),p=u.find(".group-name").text().toLowerCase()+u.attr("data-group-index");!r.shiftKey||"click"!==r.type&&"keyup"!==r.type||u.siblings(".group-header").trigger("toggleGroup"),u.toggleClass("collapsed"),u.nextUntil("tr.group-header").toggleClass("group-hidden",u.hasClass("collapsed")),!(o=u.hasClass("collapsed"))&&l.hasWidget(a.$table,"zebra")&&l.applyWidgetId(a.$table,"zebra"),s.group_saveGroups&&l.storage&&(s.group_collapsedGroups[s.group_collapsedGroup]||(s.group_collapsedGroups[s.group_collapsedGroup]=[]),o&&s.group_collapsedGroup?s.group_collapsedGroups[s.group_collapsedGroup].push(p):s.group_collapsedGroup&&-1<(e=i.inArray(p,s.group_collapsedGroups[s.group_collapsedGroup]))&&s.group_collapsedGroups[s.group_collapsedGroup].splice(e,1),l.storage(t,"tablesorter-groups",s.group_collapsedGroups))}})),i(s.group_saveReset).on("click",function(){g.clearSavedGroups(t)}),a.$table.on("pagerChange.tsgrouping",function(){g.update(t)})},clearSavedGroups:function(r){r&&l.storage&&(l.storage(r,"tablesorter-groups",""),g.update(r))}};l.addWidget({id:"group",priority:100,options:{group_collapsible:!0,group_collapsed:!1,group_saveGroups:!0,group_saveReset:null,group_count:" ({num})",group_separator:"-",group_formatter:null,group_callback:null,group_complete:"groupingComplete",group_forceColumn:[],group_enforceSort:!0,group_checkbox:["checked","unchecked"],group_months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],group_week:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],group_time:["AM","PM"],group_time24Hour:!1,group_dateInvalid:"Invalid Date",group_dateString:function(r){return r.toLocaleString()}},init:function(r,o,e,u){g.bindEvents(r,e,u)},format:function(r){g.update(r)},remove:function(r,o){o.$table.off("click","tr.group-header").off("pagerChange.tsgrouping").find(".group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove()}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-headerTitles.min.js b/web/_static/tablesorter/js/widgets/widget-headerTitles.min.js
new file mode 100644
index 0000000..1db0d9d
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-headerTitles.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: headerTitles - updated 11/10/2015 (v2.24.4) */
+!function(d){"use strict";var n=d.tablesorter;n.addWidget({id:"headerTitles",options:{headerTitle_useAria:!1,headerTitle_tooltip:"",headerTitle_cur_text:[" sort: A - Z"," sort: Z - A","ly unsorted"],headerTitle_cur_numeric:[" sort: 0 - 9"," sort: 9 - 0","ly unsorted"],headerTitle_nxt_text:[" sort: A - Z"," sort: Z - A","remove sort"],headerTitle_nxt_numeric:[" sort: 0 - 9"," sort: 9 - 0","remove sort"],headerTitle_output_sorted:"current{current}; activate to {next}",headerTitle_output_unsorted:"current{current}; activate to {next} ",headerTitle_output_nosort:"No sort available",headerTitle_type:[],headerTitle_callback:null},init:function(e,t,r,a){r.$table.on("refreshHeaderTitle",function(){t.format(e,r,a)}),d.isArray(a.headerTitle_tooltip)?r.$headers.each(function(){d(this).addClass(a.headerTitle_tooltip[this.column]||"")}):""!==a.headerTitle_tooltip&&r.$headers.addClass(a.headerTitle_tooltip)},format:function(e,s,i){var l;s.$headers.each(function(){var t=d(this),e=parseInt(t.attr("data-column"),10),r=i.headerTitle_type[e]||s.parsers[e].type||"text",a=t.hasClass(n.css.sortAsc)?0:t.hasClass(n.css.sortDesc)?1:2,o=s.sortVars[e].order[(s.sortVars[e].count+1)%(s.sortReset?3:2)];l=i.headerTitle_useAria?t.attr("aria-label")||i.headerTitle_output_nosort||"":(l=(i.headerTitle_prefix||"")+(t.hasClass("sorter-false")?i.headerTitle_output_nosort:0<=n.isValueInArray(e,s.sortList)?i.headerTitle_output_sorted:i.headerTitle_output_unsorted)).replace(/\{(current|next|name)\}/gi,function(e){return{"{name}":t.text(),"{current}":i["headerTitle_cur_"+r][a]||"","{next}":i["headerTitle_nxt_"+r][o]||""}[e.toLowerCase()]}),t.attr("title",d.isFunction(i.headerTitle_callback)?i.headerTitle_callback(t,l):l)})},remove:function(e,t,r){t.$headers.attr("title",""),t.$table.off("refreshHeaderTitle"),d.isArray(r.headerTitle_tooltip)?t.$headers.each(function(){d(this).removeClass(r.headerTitle_tooltip[this.column]||"")}):""!==r.headerTitle_tooltip&&t.$headers.removeClass(r.headerTitle_tooltip)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-lazyload.min.js b/web/_static/tablesorter/js/widgets/widget-lazyload.min.js
new file mode 100644
index 0000000..bf4af8d
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-lazyload.min.js
@@ -0,0 +1,19 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: lazyload (BETA) - 4/1/2016 (v2.25.7) */
+!function(r,o){"use strict";var n=r.tablesorter;n.lazyload={init:function(t,e){"scrollstop"!==e.lazyload_event||n.addScrollStopDone||(n.addScrollStop(),n.addScrollStopDone=!0,r.event.special.scrollstop.latency=e.lazyload_latency||250),n.lazyload.update(t,e);var l=t.namespace+"lazyload ",a=[e.lazyload_update,"pagerUpdate",e.columnSelector_updated||"columnUpdate",""].join(l);t.$table.on(a,function(){n.lazyload.update(t,t.widgetOptions)}).on("filterEnd"+l,function(){r(o).scroll()})},update:function(t,e){var l=(/(\.|#)/.test(e.lazyload_imageClass)?"":".")+e.lazyload_imageClass;t.$table.find(l).lazyload({threshold:e.lazyload_threshold,failure_limit:e.lazyload_failure_limit,event:e.lazyload_event,effect:e.lazyload_effect,container:e.lazyload_container,data_attribute:e.lazyload_data_attribute,skip_invisible:e.lazyload_skip_invisible,appear:e.lazyload_appear,load:e.lazyload_load,placeholder:e.lazyload_placeholder}),setTimeout(function(){r(o).scroll()},1)},remove:function(t){t.$table.off(t.namespace+"lazyload")}},n.addWidget({id:"lazyload",options:{lazyload_imageClass:"lazy",lazyload_update:"lazyloadUpdate",lazyload_latency:250,lazyload_threshold:0,lazyload_failure_limit:0,lazyload_event:"scrollstop",lazyload_effect:"show",lazyload_container:o,lazyload_data_attribute:"original",lazyload_skip_invisible:!0,lazyload_appear:null,lazyload_load:null,lazyload_placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},init:function(t,e,l,a){n.lazyload.init(l,a)},remove:function(t,e,l){n.lazyload.remove(e,l)}}),n.addScrollStop=function(){var n=r.event.dispatch||r.event.handle,i=r.event.special,o="D"+ +new Date,l="D"+(+new Date+1);i.scrollstart={setup:function(t){function e(t){var e=arguments;l?clearTimeout(l):(t.type="scrollstart",n.apply(this,e)),l=setTimeout(function(){l=null},a.latency)}var l,a=r.extend({latency:i.scrollstop.latency},t);r(this).bind("scroll",e).data(o,e)},teardown:function(){r(this).unbind("scroll",r(this).data(o))}},i.scrollstop={latency:250,setup:function(t){function e(t){var e=this,l=arguments;a&&clearTimeout(a),a=setTimeout(function(){a=null,t.type="scrollstop",n.apply(e,l)},o.latency)}var a,o=r.extend({latency:i.scrollstop.latency},t);r(this).bind("scroll",e).data(l,e)},teardown:function(){r(this).unbind("scroll",r(this).data(l))}}}}(jQuery,window),
+/*!
+* Lazy Load - jQuery plugin for lazy loading images
+*
+* Copyright (c) 2007-2015 Mika Tuupola
+*
+* Licensed under the MIT license:
+* http://www.opensource.org/licenses/mit-license.php
+*
+* Project home:
+* http://www.appelsiini.net/projects/lazyload
+*
+* Version: 1.9.7
+*
+*/
+function(r,a,o,d){var f=r(a);r.fn.lazyload=function(t){var e,n=this,i={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:a,data_attribute:"original",skip_invisible:!1,appear:null,load:null,placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="};function l(){var e=0;n.each(function(){var t=r(this);if((!i.skip_invisible||t.is(":visible"))&&!r.abovethetop(this,i)&&!r.leftofbegin(this,i))if(r.belowthefold(this,i)||r.rightoffold(this,i)){if(++e>i.failure_limit)return!1}else t.trigger("appear"),e=0})}return t&&(d!==t.failurelimit&&(t.failure_limit=t.failurelimit,delete t.failurelimit),d!==t.effectspeed&&(t.effect_speed=t.effectspeed,delete t.effectspeed),r.extend(i,t)),e=i.container===d||i.container===a?f:r(i.container),0===i.event.indexOf("scroll")&&e.bind(i.event,function(){return l()}),this.each(function(){var a=this,o=r(a);a.loaded=!1,o.attr("src")!==d&&!1!==o.attr("src")||o.is("img")&&o.attr("src",i.placeholder),o.one("appear",function(){if(!this.loaded){if(i.appear){var t=n.length;i.appear.call(a,t,i)}r("<img />").bind("load",function(){var t=o.attr("data-"+i.data_attribute);o.hide(),o.is("img")?o.attr("src",t):o.css("background-image",'url("'+t+'")'),o[i.effect](i.effect_speed),a.loaded=!0;var e=r.grep(n,function(t){return!t.loaded});if(n=r(e),i.load){var l=n.length;i.load.call(a,l,i)}}).attr("src",o.attr("data-"+i.data_attribute))}}),0!==i.event.indexOf("scroll")&&o.bind(i.event,function(){a.loaded||o.trigger("appear")})}),f.bind("resize",function(){l()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&f.bind("pageshow",function(t){t.originalEvent&&t.originalEvent.persisted&&n.each(function(){r(this).trigger("appear")})}),r(o).ready(function(){l()}),this},r.belowthefold=function(t,e){return(e.container===d||e.container===a?(a.innerHeight?a.innerHeight:f.height())+f.scrollTop():r(e.container).offset().top+r(e.container).height())<=r(t).offset().top-e.threshold},r.rightoffold=function(t,e){return(e.container===d||e.container===a?f.width()+f.scrollLeft():r(e.container).offset().left+r(e.container).width())<=r(t).offset().left-e.threshold},r.abovethetop=function(t,e){return(e.container===d||e.container===a?f.scrollTop():r(e.container).offset().top)>=r(t).offset().top+e.threshold+r(t).height()},r.leftofbegin=function(t,e){return(e.container===d||e.container===a?f.scrollLeft():r(e.container).offset().left)>=r(t).offset().left+e.threshold+r(t).width()},r.inviewport=function(t,e){return!(r.rightoffold(t,e)||r.leftofbegin(t,e)||r.belowthefold(t,e)||r.abovethetop(t,e))},r.extend(r.expr[":"],{"below-the-fold":function(t){return r.belowthefold(t,{threshold:0})},"above-the-top":function(t){return!r.belowthefold(t,{threshold:0})},"right-of-screen":function(t){return r.rightoffold(t,{threshold:0})},"left-of-screen":function(t){return!r.rightoffold(t,{threshold:0})},"in-viewport":function(t){return r.inviewport(t,{threshold:0})},"above-the-fold":function(t){return!r.belowthefold(t,{threshold:0})},"right-of-fold":function(t){return r.rightoffold(t,{threshold:0})},"left-of-fold":function(t){return!r.rightoffold(t,{threshold:0})}})}(jQuery,window,document);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-mark.min.js b/web/_static/tablesorter/js/widgets/widget-mark.min.js
new file mode 100644
index 0000000..5c67169
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-mark.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: mark.js - updated 9/23/2016 (v2.27.7) */
+!function(c){"use strict";var d=c.tablesorter;d.mark={init:function(r){if("function"==typeof c.fn.mark){var e,n=r.widgetOptions.mark_tsUpdate;r.$table.on("filterEnd.tsmark pagerComplete.tsmark"+(n?" "+n:""),function(e,t){d.mark.update(r,e.type===n?t:"")}),e="(?:<|=|>|\\||\"|\\'|\\s+(?:&&|-|"+(d.language.and||"and")+"|"+(d.language.or||"or")+"|"+(d.language.to||"to")+")\\s+)",d.mark.regex.filter=new RegExp(e,"gim")}else console.warn('Widget-mark not initialized: missing "jquery.mark.js"')},regex:{mark:/^mark_(.+)$/,pure:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/},checkRegex:function(e){if(e instanceof RegExp){var t="".match(e);return null===t||t.length<5}return!1},cleanMatches:function(e){for(var t=[],r=e&&e.length||0;r--;)""!==e[r]&&(t[t.length]=e[r]);return t},ignoreColumns:function(e){for(var t=e.widgetOptions,r=e.columns,n=[];r--;)(t.mark_tsIgnore[r]||c(e.$headerIndexed[r]).hasClass("mark-ignore"))&&(n[n.length]=":nth-child("+(r+1)+")");return n.length?":not("+n.join(",")+")":""},update:function(o,e){var l={},g=o.widgetOptions,m=d.mark.regex,s=o.$table.find("tbody tr").unmark().not("."+(o.widgetOptions.filter_filteredRow||"filtered"));e=e||c.tablesorter.getFilters(o.$table),c.each(o.widgetOptions,function(e,t){var r=e.match(m.mark);r&&void 0!==r[1]&&(l[r[1]]=t)}),c.each(e,function(e,t){if(t&&!c(o.$headerIndexed[e]).hasClass("mark-ignore")&&!g.mark_tsIgnore[e]){var r=null,n=t,a=!1,i=e===o.columns?d.mark.ignoreColumns(o):":nth-child("+(e+1)+")";if(m.pure.test(t)){".*"===(n=m.pure.exec(t))[1]&&(n[1]="");try{r=new RegExp(n[1],"gim"),n=new RegExp(n[1],n[2])}catch(e){n=null}return void(d.mark.checkRegex(r)&&s.children(i).markRegExp(n,l))}n=0===t.indexOf("~")?(a=!0,t.replace(/~/g,"").split("")):(-1<t.indexOf("?")&&(a=!0,t=t.replace(/\?/g,"\\S{1}")),-1<t.indexOf("*")&&(a=!0,t=t.replace(/\*/g,"\\S*")),t.split(m.filter)),a&&n&&n.length?(n=new RegExp(d.mark.cleanMatches(n).join(".*"),"gm"),d.mark.checkRegex(n)&&s.children(i).markRegExp(n,l)):s.children(i).mark(d.mark.cleanMatches(n),l)}})}},d.addWidget({id:"mark",options:{mark_tsUpdate:"markUpdate",mark_tsIgnore:{}},init:function(e,t,r,n){d.mark.init(r,n)},remove:function(e,t){var r=t.widgetOptions.mark_tsUpdate;t.$table.off("filterEnd.tsmark pagerComplete.tsmark"+(r?" "+r:""))}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-math.min.js b/web/_static/tablesorter/js/widgets/widget-math.min.js
new file mode 100644
index 0000000..18b2388
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-math.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: math - updated 12/1/2019 (v2.31.2) */
+!function(v){"use strict";var _=v.tablesorter,x={error:{0:"Infinity result: Divide by zero",1:"Need more than one element to make this calculation",undef:"No elements found"},invalid:function(t,e,n){return console.warn(e,x.error[n]),t&&t.widgetOptions.math_none||""},events:"tablesorter-initialized update updateAll updateRows addRows updateCell filterReset ".split(" ").join(".tsmath "),processText:function(t,e){var n,a=t.widgetOptions,r=_.getElementText(t,e,x.getCellIndex(e)),i=t.widgetOptions.math_prefix;return a.math_textAttr&&(r=e.attr(a.math_textAttr)||r),/</.test(i)&&(n=v("<div>"+i+"</div>").text().replace(/\{content\}/g,"").trim(),r=r.replace(n,"")),r=_.formatFloat(r.replace(/[^\w,. \-()]/g,""),t.table)||0,isNaN(r)?0:r},getRow:function(t,e,n){var a,r=t.widgetOptions,i=[],l=e.closest("tr"),o=l.hasClass(r.filter_filteredRow||"filtered");return n&&(l=l.filter(n)),!n&&o||(a=l.children().not("["+r.math_dataAttrib+"=ignore]"),r.math_ignore.length&&(a=a.filter(function(){return-1===v.inArray(x.getCellIndex(v(this)),r.math_ignore)})),i=a.not(e).map(function(){return x.processText(t,v(this))}).get()),i},getColumn:function(t,e,n,a){var r,i,l,o,h,s,d=t.widgetOptions,u=[],c=e.closest("tr"),g=d.math_dataAttrib,f="["+g+"=ignore]",m=d.filter_filteredRow||"filtered",p=x.getCellIndex(e),_=t.$table.children("tbody").children(),b=["["+g+"^=above]","["+g+"^=below]","["+g+"^=col]","["+g+"^=all]"];if("above"===n)for(r=o=_.index(c);0<=r;)s=(l=_.eq(r)).children().filter(b[0]).length,a&&(l=l.filter(a)),i=l.children().filter(function(){return x.getCellIndex(v(this))===p}),((a||!l.hasClass(m))&&l.not(f).length&&r!==o||s&&r!==o)&&(s?r=0:i.length&&i.not(f).length&&(u[u.length]=x.processText(t,i))),r--;else if("below"===n)for(o=_.length,r=_.index(c)+1;r<o&&!(l=_.eq(r)).children().filter(b[1]).length;r++)a&&(l=l.filter(a)),i=l.children().filter(function(){return x.getCellIndex(v(this))===p}),(a||!l.hasClass(m))&&l.not(f).length&&i.length&&i.not(f)&&(u[u.length]=x.processText(t,i));else for(o=(h=_.not(f)).length,r=0;r<o;r++)l=h.eq(r),a&&(l=l.filter(a)),i=l.children().filter(function(){return x.getCellIndex(v(this))===p}),!a&&l.hasClass(m)||!i.not(b.join(",")).length||i.is(e)||!i.not(f).length||(u[u.length]=x.processText(t,i));return u},getAll:function(t,e){var n,a,r,i,l,o,h,s,d=[],u=t.widgetOptions,c=u.math_dataAttrib,g="["+c+"=ignore]",f=u.filter_filteredRow||"filtered",m=t.$table.children("tbody").children().not(g);for(l=m.length,i=0;i<l;i++)if(r=m.eq(i),e&&(r=r.filter(e)),e||!r.hasClass(f))for(s=(o=r.children().not(g)).length,h=0;h<s;h++)n=o.eq(h),a=x.getCellIndex(n),!n.filter("["+c+"]").length&&v.inArray(a,u.math_ignore)<0&&(d[d.length]=x.processText(t,n));return d},setColumnIndexes:function(t){var e=t.$table,r=1,n=e.children("tbody").children().filter(function(){var t,e,n=v(this),a=0<n.children("[colspan]").length;if(1<r?(r--,a=!0):r<1&&(r=1),0<n.children("[rowspan]").length)for(t=this.cells,e=0;e<t.length;e++)r=Math.max(t[e].rowSpan,r);return a});_.computeColumnIndex(n,t)},getCellIndex:function(t){var e=t.attr("data-column");return void 0===e?t[0].cellIndex:parseInt(e,10)},recalculate:function(n,t,e){if(n&&(!t.math_isUpdating||e)){var a,r,i,l,o,h=!1,s={};for((n.debug||t.math_debug)&&(a=new Date),e&&x.setColumnIndexes(n),t.math_dataAttrib="data-"+(t.math_data||"math"),r=t.math_dataAttrib,i=n.$tbodies.children("tr").children("["+r+"]"),h=x.mathType(n,i,t.math_priority)||h,i=n.$table.children("."+n.cssInfoBlock+", tfoot").children("tr").children("["+r+"]"),x.mathType(n,i,t.math_priority),o=(i=n.$table.children().children("tr").children("["+r+"^=all]")).length,l=0;l<o;l++){var d=i.eq(l),u=d.attr(r+"-filter")||t.math_rowFilter;s[u]=s[u]?s[u].add(d):d}v.each(s,function(t,e){h=x.mathType(n,e,["all"],t)||h}),h?(t.math_isUpdating=!0,(n.debug||t.math_debug)&&console[console.group?"group":"log"]("Math widget updating the cache after recalculation"),_.updateCache(n,function(){x.updateComplete(n),e||"function"!=typeof t.math_completed||t.math_completed(n),(n.debug||t.math_debug)&&console.log("Math widget update completed"+_.benchmark(a))})):(e||"function"!=typeof t.math_completed||t.math_completed(n),(n.debug||t.math_debug)&&console.log("Math widget found no changes in data"+_.benchmark(a)))}},updateComplete:function(t){var e=t.widgetOptions;e.math_isUpdating&&(t.debug||e.math_debug)&&console.groupEnd&&console.groupEnd(),e.math_isUpdating=!1},mathType:function(s,d,t,u){if(d.length){var c,g=!1,f=s.widgetOptions,m=f.math_dataAttrib,p=_.equations;return"all"===t[0]&&(c=x.getAll(s,u)),(s.debug||f.math_debug)&&console[console.group?"group":"log"]("Tablesorter Math widget recalculation"),v.each(t,function(t,e){var n,a,r,i,l,o=d.filter("["+m+"^="+e+"]"),h=o.length;if(h){for((s.debug||f.math_debug)&&console[console.group?"group":"log"](e),n=0;n<h;n++)(l=o.eq(n)).parent().hasClass(f.filter_filteredRow||"filtered")||(u=l.attr(m+"-filter")||f.math_rowFilter,r=(l.attr(m)||"").replace(e+"-",""),a="row"===e?x.getRow(s,l,u):"all"===e?c:x.getColumn(s,l,e,u),p[r]&&(a.length?(i=p[r](a,s),(s.debug||f.math_debug)&&console.log(l.attr(m),u?'("'+u+'")':"",a,"=",i)):i=x.invalid(s,r,"mean"===r?0:"undef"),g=x.output(l,s,i,a)||g));(s.debug||f.math_debug)&&console.groupEnd&&console.groupEnd()}}),(s.debug||f.math_debug)&&console.groupEnd&&console.groupEnd(),g}return!1},output:function(t,e,n,a){var r,i=e.widgetOptions,l=!1,o=t.html(),h=t.attr("data-"+i.math_data+"-mask")||i.math_mask,s=t.attr("data-"+i.math_data+"-target")||"",d=_.formatMask(h,n,i.math_prefix,i.math_suffix);return s&&(r=t.find(s)).length&&(t=r),"function"==typeof i.math_complete&&(d=i.math_complete(t,i,d,n,a)),!1!==d&&(l=o!==d,t.html(d)),!(l&&(!(r=t.closest("tbody")).length||r.hasClass(e.cssInfoBlock)||r.parent()[0]!==e.table))&&l}};_.formatMask=function(t,e,n,a){if(!t||isNaN(+e))return e;var r,i,l,o,h,s,d,u,c,g,f,m,p,_,b="",v=t.length,x=t.search(/[0-9\-\+#]/),w=0<x?t.substring(0,x):"",C=w;if(n&&(C=/\{content\}/.test(n||"")?(n||"").replace(/\{content\}/g,w||""):(n||"")+w),p=v-(_=t.split("").reverse().join("").search(/[0-9\-\+#]/)),p+="."===t.substring(p,p+1)?1:0,b=w=0<_?t.substring(p,v):"",a&&(b=/\{content\}/.test(a||"")?(a||"").replace(/\{content\}/g,w||""):w+(a||"")),r=(e="-"===(t=t.substring(x,p)).charAt(0)?-e:+e)<0?e=-e:0,l=(i=t.match(/[^\d\-\+#]/g))&&i[i.length-1]||".",o=i&&i[1]&&i[0]||",",t=t.split(l),e=+(e=e.toFixed(t[1]&&t[1].length))+"",s=t[1]&&t[1].lastIndexOf("0"),(!(u=e.split("."))[1]||u[1]&&u[1].length<=s)&&(e=(+e).toFixed(s+1)),c=t[0].split(o),t[0]=c.join(""),-1<(h=t[0]&&t[0].indexOf("0")))for(;u[0].length<t[0].length-h;)u[0]="0"+u[0];else 0==+u[0]&&(u[0]="");if((e=e.split("."))[0]=u[0],d=c[1]&&c[c.length-1].length){for(f="",m=(g=e[0]).length%d,v=g.length,p=0;p<v;p++)f+=g.charAt(p),!((p-m+1)%d)&&p<v-d&&(f+=o);e[0]=f}return e[1]=t[1]&&e[1]?l+e[1]:"",C+(r?"-":"")+e[0]+e[1]+b},_.equations={count:function(t){return t.length},sum:function(t){var e,n=t.length,a=0;for(e=0;e<n;e++)a+=t[e];return a},mean:function(t){return _.equations.sum(t)/t.length},median:function(t,e){var n,a=t.length;return 1<a?(t.sort(function(t,e){return t-e}),n=Math.floor(a/2),a%2?t[n]:(t[n-1]+t[n])/2):x.invalid(e,"median",1)},mode:function(t){var e,n,a,r={},i=1,l=[t[0]];for(e=0;e<t.length;e++)r[n=t[e]]=r[n]?r[n]+1:1,i<(a=r[n])?(l=[n],i=a):a===i&&(l[l.length]=n,i=a);return l.sort(function(t,e){return t-e})},max:function(t){return Math.max.apply(Math,t)},min:function(t){return Math.min.apply(Math,t)},range:function(t){var e=t.sort(function(t,e){return t-e});return e[t.length-1]-e[0]},variance:function(t,e,n){for(var a,r=_.equations.mean(t),i=0,l=t.length;l--;)i+=Math.pow(t[l]-r,2);return 0==(a=t.length-(e?0:1))?x.invalid(n,"variance",0):i/=a},varp:function(t,e){return _.equations.variance(t,!0,e)},vars:function(t,e){return _.equations.variance(t,!1,e)},stdevs:function(t,e){var n=_.equations.variance(t,!1,e);return Math.sqrt(n)},stdevp:function(t,e){var n=_.equations.variance(t,!0,e);return Math.sqrt(n)}},_.addWidget({id:"math",priority:100,options:{math_data:"math",math_debug:!1,math_ignore:[],math_mask:"#,##0.00",math_complete:null,math_completed:function(){},math_priority:["row","above","below","col"],math_prefix:"",math_suffix:"",math_textAttr:"",math_none:"N/A",math_event:"recalculate",math_rowFilter:""},init:function(t,e,n,a){var r=(_.hasWidget(t,"filter")?"filterEnd":"updateComplete")+".tsmath";x.events+=(_.hasWidget(t,"pager")?"pagerComplete":"filterEnd")+".tsmath ",n.$table.off((x.events+"updateComplete.tsmath "+a.math_event).replace(/\s+/g," ")).on(x.events+a.math_event,function(t){if(this.hasInitialized){var e="tablesorter-initialized"===t.type;a.math_isUpdating&&!e||(/filter/.test(t.type)||e||x.setColumnIndexes(n),x.recalculate(n,a,e))}}).on(r,function(){setTimeout(function(){x.updateComplete(n)},40)}),a.math_isUpdating=!1,t.hasInitialized&&x.recalculate(n,a,!0)},remove:function(t,e,n,a){a||e.$table.off((x.events+" updateComplete.tsmath "+n.math_event).replace(/\s+/g," ")).children().children("tr").children("[data-"+n.math_data+"]").empty()}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-output.min.js b/web/_static/tablesorter/js/widgets/widget-output.min.js
new file mode 100644
index 0000000..3d8f234
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-output.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: output - updated 9/27/2017 (v2.29.0) */
+!function(b){"use strict";var y=b.tablesorter,S=y.output={event:"outputTable",noDblClick:600,lastEvent:0,busy:!1,regexQuote:/([\n\t\x09\x0d\x0a]|<[^<]+>)/,regexBR:/(<br([\s\/])?>|\n)/g,regexIMG:/<img[^>]+alt\s*=\s*['"]([^'"]+)['"][^>]*>/i,regexHTML:/<[^<]+>/g,replaceCR:"\r\n",replaceTab:"\t",popupTitle:"Output",popupStyle:"width:100%;height:100%;margin:0;resize:none;",message:"Your device does not support downloading. Please try again in desktop browser.",init:function(e){e.$table.off(S.event).on(S.event,function(t){t.stopPropagation(),!S.busy&&t.timeStamp-S.lastEvent>S.noDblClick&&(S.lastEvent=t.timeStamp,S.busy=!0,S.process(e,e.widgetOptions))})},processRow:function(t,e,o,u){var n,r,a,p,i,l,s,c,d,f,_=t.widgetOptions,w=[],m=_.output_duplicateSpans,g=o&&u&&_.output_headerRows&&b.isFunction(_.output_callbackJSON),h=0,v=e.length;for(p=0;p<v;p++)for(w[p]||(w[p]=[]),h=0,a=(r=e.eq(p).children()).length,s=0;s<a;s++){if((n=r.eq(s)).filter("[rowspan]").length)for(c=parseInt(n.attr("rowspan"),10)-1,f=S.formatData(t,_,n,o,s),i=1;i<=c;i++)w[p+i]||(w[p+i]=[]),w[p+i][h]=o?f:m?f:"";if(n.filter("[colspan]").length)for(d=parseInt(n.attr("colspan"),10)-1,f=S.formatData(t,_,n,o,s),l=0;l<d;l++)if(n.filter("[rowspan]").length)for(c=parseInt(n.attr("rowspan"),10),i=0;i<c;i++)w[p+i]||(w[p+i]=[]),w[p+i][h+l]=g?_.output_callbackJSON(n,f,h+l)||f+"("+(h+l)+")":o?f:m?f:"";else w[p][h+l]=g?_.output_callbackJSON(n,f,h+l)||f+"("+(h+l)+")":o?f:m?f:"";for(;void 0!==w[p][h];)h++;w[p][h]=w[p][h]||S.formatData(t,_,n,o,h),h++}return y.output.removeColumns(t,_,w)},removeColumns:function(t,e,o){var u,n,r,a=[],p=o.length;for(u=0;u<p;u++)for(n=o[u],a[u]=[],r=0;r<t.columns;r++)e.output_hiddenColumnArray[r]||a[u].push(n[r]);return a},process:function(t,e,o,u){var n,r,a,p,i,l,s,c=window.JSON&&JSON.hasOwnProperty("stringify"),d=0,f=(e.output_separator||",").toLowerCase(),_="json"===f,w="array"===f,m=_||w?",":e.output_separator,g=e.output_saveRows,h=t.$table;for(e.output_regex=new RegExp("("+(/\\/.test(m)?"\\":"")+m+")"),e.output_hiddenColumnArray=[],d=0;d<t.columns;d++)e.output_hiddenColumnArray[d]=-1<b.inArray(d,e.output_ignoreColumns)||!e.output_hiddenColumns&&"none"===t.$headerIndexed[d].css("display")&&!t.$headerIndexed[d].hasClass("tablesorter-scroller-hidden-column");if(r=h.children("thead").children("tr").not("."+(y.css.filterRow||"tablesorter-filter-row")).filter(function(){return e.output_hiddenColumns||"none"!==b(this).css("display")}),a=S.processRow(t,r,!0,_),o=o||h.children("tbody").children("tr").not(t.selectorRemove),o="function"==typeof g?o.filter(g):/^f/.test(g)?o.not("."+(e.filter_filteredRow||"filtered")):/^v/.test(g)?o.filter(":visible"):/^[.#:\[]/.test(g)?o.filter(g):o,p=S.processRow(t,o),e.output_includeFooter&&(p=p.concat(S.processRow(t,h.children("tfoot").children("tr:visible")))),i=a.length,_){for(f=[],l=p.length,d=0;d<l;d++)s=a[1<i&&e.output_headerRows?d%i:i-1],f.push(S.row2Hash(s,p[d]));n=c?JSON.stringify(f):f}else f=e.output_includeHeader?(s=[a[1<i&&e.output_headerRows?d%i:i-1]],S.row2CSV(e,e.output_headerRows?a:s,w).concat(S.row2CSV(e,p,w))):S.row2CSV(e,p,w),n=w&&c?JSON.stringify(f):f.join("\n");if(u)return n;if(b.isFunction(e.output_callback)){if(!1===(s=e.output_callback(t,n,t.pager&&t.pager.ajaxObject.url||null)))return void(S.busy=!1);"string"==typeof s&&(n=s)}/p/i.test(e.output_delivery||"")?S.popup(n,e.output_popupStyle,_||w):S.download(t,e,n),S.busy=!1},row2CSV:function(t,e,o){var u,n,r=[],a=e.length;for(n=0;n<a;n++)u=(e[n]||[]).join("").replace(/\"/g,""),0<(e[n]||[]).length&&""!==u&&(r[r.length]=o?e[n]:e[n].join(t.output_separator));return r},row2Hash:function(t,e){var o,u={},n=e.length;for(o=0;o<n;o++)o<t.length&&(u[t[o]]=e[o]);return u},formatData:function(t,e,o,u,n){var r=o.attr(e.output_dataAttrib),a=void 0!==r?r:o.html(),p=(e.output_separator||",").toLowerCase(),i="json"===p||"array"===p,l=a.replace(/\"/g,e.output_replaceQuote||"“");return a=(l=e.output_trimSpaces?l.replace(S.regexBR,""):l.replace(S.regexBR,S.replaceCR).replace(/\t/g,S.replaceTab)).match(S.regexIMG),e.output_includeHTML||null===a||(l=a[1]),l=e.output_includeHTML&&!u?l:l.replace(S.regexHTML,""),l=e.output_trimSpaces||u?b.trim(l):l,l=(p=!i&&(e.output_wrapQuotes||e.output_regex.test(l)||S.regexQuote.test(l)))?'"'+l+'"':l,"function"==typeof e.output_formatContent?e.output_formatContent(t,e,{isHeader:u||!1,$cell:o,content:l,columnIndex:n,parsed:t.parsers[n].format(l,t.table,o[0],n)}):l},popup:function(e,o,u){var n=window.open("",S.popupTitle,o);try{n.document.write("<html><head><title>"+S.popupTitle+'</title></head><body><textarea wrap="'+(u?"on":"off")+'" style="'+S.popupStyle+'">'+e+"\n</textarea></body></html>"),n.document.close(),n.focus()}catch(t){return n.close(),S.popup(e,o,u)}return!0},download:function(t,e,o){if("function"==typeof e.output_savePlugin)return e.output_savePlugin(t,e,o);var u,n,r,a,p=window.navigator,i=document.createElement("a");if(/(iP)/g.test(p.userAgent))return alert(S.message),!1;try{r=!!new Blob}catch(t){r=!1}return r?(window.URL=window.URL||window.webkitURL,a=/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.output_encoding)?["\ufeff",o]:[o],n=new Blob(a,{type:e.output_encoding}),p.msSaveBlob?p.msSaveBlob(n,e.output_saveFileName):(i.href=window.URL.createObjectURL(n),i.download=e.output_saveFileName,document.createEvent&&((u=document.createEvent("MouseEvents")).initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),i.dispatchEvent(u))),!1):(window.open(e.output_encoding+encodeURIComponent(o)+"?download","_self"),!0)},remove:function(t){t.$table.off(S.event)}};y.addWidget({id:"output",options:{output_separator:",",output_ignoreColumns:[],output_hiddenColumns:!1,output_includeFooter:!1,output_includeHeader:!0,output_headerRows:!1,output_dataAttrib:"data-name",output_delivery:"popup",output_saveRows:"filtered",output_duplicateSpans:!0,output_replaceQuote:"“;",output_includeHTML:!1,output_trimSpaces:!0,output_wrapQuotes:!1,output_popupStyle:"width=500,height=300",output_saveFileName:"mytable.csv",output_formatContent:null,output_callback:function(){return!0},output_callbackJSON:function(t,e,o){return e+"("+o+")"},output_encoding:"data:application/octet-stream;charset=utf8,",output_savePlugin:null},init:function(t,e,o){S.init(o)},remove:function(t,e){S.remove(e)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-pager.min.js b/web/_static/tablesorter/js/widgets/widget-pager.min.js
new file mode 100644
index 0000000..afe3efa
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-pager.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: Pager - updated 2020-03-03 (v2.31.3) */
+!function(S){"use strict";var C,$=S.tablesorter;$.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(e,a){return a},pager_ajaxError:null,pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(e){return e},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(e){C.init(e)},format:function(e,a){if(!a.pager||!a.pager.initialized)return C.initComplete(a);C.moveToPage(a,a.pager,!1)},remove:function(e,a,t,r){C.destroyPager(a,r)}}),C=$.pager={init:function(e){if(!(e.hasInitialized&&e.config.pager&&e.config.pager.initialized)){var a,t=e.config,r=t.widgetOptions,i=r.pager_selectors,s=t.pager=S.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:r.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:r.pager_size,setPage:r.pager_startPage},t.pager);s.removeRows=r.pager_removeRows,s.isInitializing||(s.isInitializing=!0,$.debug(t,"pager")&&console.log("Pager >> Initializing"),s.size=S.data(e,"pagerLastSize")||r.pager_size,s.$container=S(i.container).addClass(r.pager_css.container).show(),s.totalRows=t.$tbodies.eq(0).children("tr").not(r.pager_countChildRows?"":"."+t.cssChildRow).length,s.oldAjaxSuccess=s.oldAjaxSuccess||r.pager_ajaxObject.success,t.appender=C.appender,s.initializing=!0,r.pager_savePages&&$.storage&&(a=$.storage(e,r.pager_storageKey)||{},s.page=(isNaN(a.page)?s.page:a.page)||s.setPage||0,s.size="all"===a.size?a.size:(isNaN(a.size)?s.size:a.size)||s.setSize||10,C.setPageSize(t,s.size)),s.regexRows=new RegExp("("+(r.filter_filteredRow||"filtered")+"|"+t.selectorRemove.slice(1)+"|"+t.cssChildRow+")"),s.regexFiltered=new RegExp(r.filter_filteredRow||"filtered"),s.initialized=!1,t.$table.triggerHandler("pagerBeforeInitialized",t),C.enablePager(t,!1),s.ajaxObject=r.pager_ajaxObject,s.ajaxObject.url=r.pager_ajaxUrl,"string"==typeof r.pager_ajaxUrl?(s.ajax=!0,r.filter_serversideFiltering=!0,t.serverSideSorting=!0,C.moveToPage(t,s)):(s.ajax=!1,$.appendCache(t,!0)))}},initComplete:function(e){var a=e.pager;C.bindEvents(e),a.ajax||C.hideRowsSetup(e),a.initialized=!0,a.initializing=!1,a.isInitializing=!1,C.setPageSize(e,a.size),$.debug(e,"pager")&&console.log("Pager >> Triggering pagerInitialized"),e.$table.triggerHandler("pagerInitialized",e),e.widgetOptions.filter_initialized&&$.hasWidget(e.table,"filter")||C.updatePageDisplay(e,!a.ajax)},bindEvents:function(i){var s,o,e,g=i.pager,n=i.widgetOptions,a=i.namespace+"pager",t=n.pager_selectors,r=$.debug(i,"pager");i.$table.off(a).on("filterInit filterStart ".split(" ").join(a+" "),function(e,a){var t;if(g.currentFilters=S.isArray(a)?a:i.$table.data("lastSearch"),g.ajax&&"filterInit"===e.type)return C.moveToPage(i,g,!1);t=$.filter.equalFilters?$.filter.equalFilters(i,i.lastSearch,g.currentFilters):(i.lastSearch||[]).join("")!==(g.currentFilters||[]).join(""),"filterStart"!==e.type||!1===n.pager_pageReset||t||(g.page=n.pager_pageReset)}).on("filterEnd sortEnd ".split(" ").join(a+" "),function(){g.currentFilters=i.$table.data("lastSearch"),(g.initialized||g.initializing)&&(i.delayInit&&i.rowsCopy&&0===i.rowsCopy.length&&C.updateCache(i),C.updatePageDisplay(i,!1),$.applyWidget(i.table))}).on("disablePager"+a,function(e){e.stopPropagation(),C.showAllRows(i)}).on("enablePager"+a,function(e){e.stopPropagation(),C.enablePager(i,!0)}).on("destroyPager"+a,function(e){e.stopPropagation(),$.removeWidget(i.table,"pager",!1)}).on("updateComplete"+a,function(e,a,t){if(e.stopPropagation(),a&&!t&&!g.ajax){var r=i.$tbodies.eq(0).children("tr").not(i.selectorRemove);g.totalRows=r.length-(n.pager_countChildRows?0:r.filter("."+i.cssChildRow).length),g.totalPages="all"===g.size?1:Math.ceil(g.totalRows/g.size),r.length&&i.rowsCopy&&0===i.rowsCopy.length&&C.updateCache(i),g.page>=g.totalPages&&C.moveToLastPage(i,g),C.hideRows(i),C.changeHeight(i),C.updatePageDisplay(i,!1),$.applyWidget(a),C.updatePageDisplay(i)}}).on("pageSize refreshComplete ".split(" ").join(a+" "),function(e,a){e.stopPropagation(),C.setPageSize(i,C.parsePageSize(i,a,"get")),C.moveToPage(i,g,!0),C.hideRows(i),C.updatePageDisplay(i,!1)}).on("pageSet pagerUpdate ".split(" ").join(a+" "),function(e,a){e.stopPropagation(),"pagerUpdate"===e.type&&(a=void 0===a?g.page+1:a,g.last.page=!0),g.page=(parseInt(a,10)||1)-1,C.moveToPage(i,g,!0),C.updatePageDisplay(i,!1)}).on("pageAndSize"+a,function(e,a,t){e.stopPropagation(),g.page=(parseInt(a,10)||1)-1,C.setPageSize(i,C.parsePageSize(i,t,"get")),C.moveToPage(i,g,!0),C.hideRows(i),C.updatePageDisplay(i,!1)}),s=[t.first,t.prev,t.next,t.last],o=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],r&&!g.$container.length&&console.warn('Pager >> "container" not found'),g.$container.find(s.join(",")).attr("tabindex",0).off("click"+a).on("click"+a,function(e){e.stopPropagation();var a,t=S(this),r=s.length;if(!t.hasClass(n.pager_css.disabled))for(a=0;a<r;a++)if(t.is(s[a])){C[o[a]](i,g);break}}),(e=g.$container.find(n.pager_selectors.gotoPage)).length?e.off("change"+a).on("change"+a,function(){g.page=S(this).val()-1,C.moveToPage(i,g,!0),C.updatePageDisplay(i,!1)}):r&&console.warn('Pager >> "goto" selector not found'),(e=g.$container.find(n.pager_selectors.pageSize)).length?(e.find("option").removeAttr("selected"),e.off("change"+a).on("change"+a,function(){if(!S(this).hasClass(n.pager_css.disabled)){var e=S(this).val();g.$container.find(n.pager_selectors.pageSize).val(e),C.setPageSize(i,e),C.moveToPage(i,g,!0),C.changeHeight(i)}return!1})):r&&console.warn('Pager >> "size" selector not found')},pagerArrows:function(e,a){var t=e.pager,r=!!a,i=r||0===t.page,s=C.getTotalPages(e,t),o=r||t.page===s-1||0===s,g=e.widgetOptions,n=g.pager_selectors;g.pager_updateArrows&&(t.$container.find(n.first+","+n.prev).toggleClass(g.pager_css.disabled,i).prop("aria-disabled",i),t.$container.find(n.next+","+n.last).toggleClass(g.pager_css.disabled,o).prop("aria-disabled",o))},calcFilters:function(e){var a,t,r,i=e.widgetOptions,s=e.pager,o=e.$table.hasClass("hasFilters");if(o&&!s.ajax)if(S.isEmptyObject(e.cache))s.filteredRows=s.totalRows=e.$tbodies.eq(0).children("tr").not(i.pager_countChildRows?"":"."+e.cssChildRow).length;else for(s.filteredRows=0,r=(a=e.cache[0].normalized).length,t=0;t<r;t++)s.filteredRows+=s.regexRows.test(a[t][e.columns].$row[0].className)?0:1;else o||(s.filteredRows=s.totalRows)},updatePageDisplay:function(t,e){if(!t.pager||!t.pager.initializing){var a,r,i,s,o,g,n,l=t.table,p=t.widgetOptions,d=t.pager,c=t.namespace+"pager",f=C.parsePageSize(t,d.size,"get");if("all"===f&&(f=d.totalRows),p.pager_countChildRows&&(r[r.length]=t.cssChildRow),d.$container.find(p.pager_selectors.pageSize+","+p.pager_selectors.gotoPage).removeClass(p.pager_css.disabled).removeAttr("disabled").prop("aria-disabled","false"),d.totalPages=Math.ceil(d.totalRows/f),t.totalRows=d.totalRows,C.parsePageNumber(t,d),C.calcFilters(t),t.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/f)||0,0<=C.getTotalPages(t,d)){if(r=f*d.page>d.filteredRows&&e,d.page=r?p.pager_pageReset||0:d.page,d.startRow=r?f*d.page+1:0===d.filteredRows?0:f*d.page+1,d.endRow=Math.min(d.filteredRows,d.totalRows,f*(d.page+1)),i=d.$container.find(p.pager_selectors.pageDisplay),a="function"==typeof p.pager_output?p.pager_output(l,d):(n=i.attr("data-pager-output"+(d.filteredRows<d.totalRows?"-filtered":""))||p.pager_output,(d.ajaxData&&d.ajaxData.output&&d.ajaxData.output||n).replace(/\{page([\-+]\d+)?\}/gi,function(e,a){return d.totalPages?d.page+(a?parseInt(a,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(e){var a,t,r=e.replace(/[{}\s]/g,""),i=r.split(":"),s=d.ajaxData,o=/(rows?|pages?)$/i.test(r)?0:"";return/(startRow|page)/.test(i[0])&&"input"===i[1]?(a=(""+("page"===i[0]?d.totalPages:d.totalRows)).length,t="page"===i[0]?d.page+1:d.startRow,'<input type="text" class="ts-'+i[0]+'" style="max-width:'+a+'em" value="'+t+'"/>'):1<i.length&&s&&s[i[0]]?s[i[0]][i[1]]:d[r]||(s?s[r]:o)||o})),d.$container.find(p.pager_selectors.gotoPage).length){for(r="",g=(s=C.buildPageSelect(t,d)).length,o=0;o<g;o++)r+='<option value="'+s[o]+'">'+s[o]+"</option>";d.$container.find(p.pager_selectors.gotoPage).html(r).val(d.page+1)}i.length&&(i["INPUT"===i[0].nodeName?"val":"html"](a),i.find(".ts-startRow, .ts-page").off("change"+c).on("change"+c,function(){var e=S(this).val(),a=S(this).hasClass("ts-startRow")?Math.floor(e/f)+1:e;t.$table.triggerHandler("pageSet"+c,[a])}))}C.pagerArrows(t),C.fixHeight(t),d.initialized&&!1!==e&&($.debug(t,"pager")&&console.log("Pager >> Triggering pagerComplete"),t.$table.triggerHandler("pagerComplete",t),p.pager_savePages&&$.storage&&$.storage(l,p.pager_storageKey,{page:d.page,size:f===d.totalRows?"all":f}))}},buildPageSelect:function(e,a){var t,r,i,s,o,g,n=e.widgetOptions,l=C.getTotalPages(e,a)||1,p=5*Math.ceil(l/n.pager_maxOptionSize/5),d=l>n.pager_maxOptionSize,c=a.page+1,f=p,u=l-p,h=[1];for(t=d?p:1;t<=l;)h[h.length]=t,t+=d?p:1;if(h[h.length]=l,d){for(i=[],(f=c-(r=Math.max(Math.floor(n.pager_maxOptionSize/p)-1,5)))<1&&(f=1),l<(u=c+r)&&(u=l),t=f;t<=u;t++)i[i.length]=t;p/2<(o=(h=S.grep(h,function(e,a){return S.inArray(e,h)===a})).length)-(g=i.length)&&o+g>n.pager_maxOptionSize&&(s=Math.floor(o/2)-Math.floor(g/2),Array.prototype.splice.apply(h,[s,g])),h=h.concat(i)}return h=S.grep(h,function(e,a){return S.inArray(e,h)===a}).sort(function(e,a){return e-a})},fixHeight:function(e){var a,t,r,i=e.table,s=e.pager,o=e.widgetOptions,g=e.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),o.pager_fixedHeight&&!s.isDisabled&&(t=S.data(i,"pagerSavedHeight"))&&(r=0,1<S(i).css("border-spacing").split(" ").length&&(r=S(i).css("border-spacing").split(" ")[1].replace(/[^-\d\.]/g,"")),5<(a=t-g.height()+r*s.size-r)&&S.data(i,"pagerLastSize")===s.size&&g.children("tr:visible").length<("all"===s.size?s.totalRows:s.size)&&g.append('<tr class="pagerSavedHeightSpacer '+e.selectorRemove.slice(1)+'" style="height:'+a+'px;"></tr>'))},changeHeight:function(e){var a,t=e.table,r=e.pager,i="all"===r.size?r.totalRows:r.size,s=e.$tbodies.eq(0);s.find("tr.pagerSavedHeightSpacer").remove(),s.children("tr:visible").length||s.append('<tr class="pagerSavedHeightSpacer '+e.selectorRemove.slice(1)+'"><td>&nbsp</td></tr>'),a=s.children("tr").eq(0).height()*i,S.data(t,"pagerSavedHeight",a),C.fixHeight(e),S.data(t,"pagerLastSize",r.size)},hideRows:function(e){if(!e.widgetOptions.pager_ajaxUrl){var a,t,r,i,s,o=e.pager,g=e.widgetOptions,n=e.$tbodies.length,l="all"===o.size?o.totalRows:o.size,p=o.page*l,d=p+l,c=-1,f=0;for(o.cacheIndex=[],a=0;a<n;a++){for(i=(r=e.$tbodies.eq(a).children("tr")).length,c=-1,t=f=s=0;t<i;t++)o.regexFiltered.test(r[t].className)||(f===p&&r[t].className.match(e.cssChildRow)?r[t].style.display="none":(r[t].style.display=p<=f&&f<d?"":"none",c!==f&&p<=f&&f<d&&(o.cacheIndex[o.cacheIndex.length]=t,c=f),(f+=r[t].className.match(e.cssChildRow+"|"+e.selectorRemove.slice(1))&&!g.pager_countChildRows?0:1)===d&&"none"!==r[t].style.display&&r[t].className.match($.css.cssHasChild)&&(s=t)));if(0<s&&r[s].className.match($.css.cssHasChild))for(;++s<i&&r[s].className.match(e.cssChildRow);)r[s].style.display=""}}},hideRowsSetup:function(e){var a=e.pager,t=e.namespace+"pager",r=a.$container.find(e.widgetOptions.pager_selectors.pageSize).val();a.size=C.parsePageSize(e,r,"get"),C.setPageSize(e,a.size),C.pagerArrows(e),e.widgetOptions.pager_removeRows||(C.hideRows(e),e.$table.on("sortEnd filterEnd ".split(" ").join(t+" "),function(){C.hideRows(e)}))},renderAjax:function(e,a,t,r,i){var s=a.table,o=a.pager,g=a.widgetOptions,n=$.debug(a,"pager");if(S.isFunction(g.pager_ajaxProcessing)){a.$tbodies.eq(0).empty();var l,p,d,c,f,u,h,w,P,b,z,R,v,m,x,j=a.$table,_="",y=g.pager_ajaxProcessing(e,s,t)||[0,[]];if($.showError(s),i)n&&console.error("Pager >> Ajax Error",t,r,i),$.showError(s,t,r,i),a.$tbodies.eq(0).children("tr").detach(),o.totalRows=0;else{if(S.isArray(y)?(v=y[(d=isNaN(y[0])&&!isNaN(y[1]))?1:0],o.totalRows=isNaN(v)?o.totalRows||0:v,a.totalRows=a.filteredRows=o.filteredRows=o.totalRows,z=0===o.totalRows?[]:y[d?0:1]||[],b=y[2]):(o.ajaxData=y,a.totalRows=o.totalRows=y.total,a.filteredRows=o.filteredRows=void 0!==y.filteredRows?y.filteredRows:y.total,b=y.headers,z=y.rows||[]),R=z&&z.length,z instanceof S)g.pager_processAjaxOnInit&&(a.$tbodies.eq(0).empty(),a.$tbodies.eq(0).append(z));else if(R){for(l=0;l<R;l++){for(_+="<tr>",p=0;p<z[l].length;p++)_+=/^\s*<td/.test(z[l][p])?S.trim(z[l][p]):"<td>"+z[l][p]+"</td>";_+="</tr>"}g.pager_processAjaxOnInit&&a.$tbodies.eq(0).html(_)}if(g.pager_processAjaxOnInit=!0,b){for(u=(c=j.hasClass("hasStickyHeaders"))?g.$sticky.children("thead:first").children("tr:not(."+a.cssIgnoreRow+")").children():"",f=j.find("tfoot tr:first").children(),m=(h=a.$headers.filter("th")).length,p=0;p<m;p++)(w=h.eq(p)).find("."+$.css.icon).length?(P=w.find("."+$.css.icon).clone(!0),w.find("."+$.css.headerIn).html(b[p]).append(P),c&&u.length&&(P=u.eq(p).find("."+$.css.icon).clone(!0),u.eq(p).find("."+$.css.headerIn).html(b[p]).append(P))):(w.find("."+$.css.headerIn).html(b[p]),c&&u.length&&(o.$container=o.$container.add(g.$sticky),u.eq(p).find("."+$.css.headerIn).html(b[p]))),f.eq(p).html(b[p]);c&&C.bindEvents(a)}}a.showProcessing&&$.isProcessing(s),x=C.parsePageSize(a,o.size,"get"),o.totalPages="all"===x?1:Math.ceil(o.totalRows/x),o.last.totalRows=o.totalRows,o.last.currentFilters=o.currentFilters,o.last.sortList=(a.sortList||[]).join(","),o.initializing=!1,C.updatePageDisplay(a,!1),$.updateCache(a,function(){o.initialized&&setTimeout(function(){n&&console.log("Pager >> Triggering pagerChange"),j.triggerHandler("pagerChange",o),$.applyWidget(s),C.updatePageDisplay(a)},0)})}o.initialized||$.applyWidget(s)},getAjax:function(i){var r,e=C.getAjaxUrl(i),s=S(document),o=i.namespace+"pager",g=i.pager;""!==e&&(i.showProcessing&&$.isProcessing(i.table,!0),s.on("ajaxError"+o,function(e,a,t,r){C.renderAjax(null,i,a,t,r),s.off("ajaxError"+o)}),r=++g.ajaxCounter,g.last.ajaxUrl=e,g.ajaxObject.url=e,g.ajaxObject.success=function(e,a,t){r<g.ajaxCounter||(C.renderAjax(e,i,t),s.off("ajaxError"+o),"function"==typeof g.oldAjaxSuccess&&g.oldAjaxSuccess(e))},$.debug(i,"pager")&&console.log("Pager >> Ajax initialized",g.ajaxObject),S.ajax(g.ajaxObject))},getAjaxUrl:function(e){var a,t,r=e.pager,i=e.widgetOptions,s=i.pager_ajaxUrl?i.pager_ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(e,a){return r.page+(a?parseInt(a,10):0)}).replace(/\{size\}/g,r.size):"",o=e.sortList,g=r.currentFilters||e.$table.data("lastSearch")||[],n=s.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),l=s.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),p=[];if(n){for(n=n[1],t=o.length,a=0;a<t;a++)p[p.length]=n+"["+o[a][0]+"]="+o[a][1];s=s.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,p.length?p.join("&"):n),p=[]}if(l){for(l=l[1],t=g.length,a=0;a<t;a++)g[a]&&(p[p.length]=l+"["+a+"]="+encodeURIComponent(g[a]));s=s.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,p.length?p.join("&"):l),r.currentFilters=g}return S.isFunction(i.pager_customAjaxUrl)&&(s=i.pager_customAjaxUrl(e.table,s)),$.debug(e,"pager")&&console.log("Pager >> Ajax url = "+s),s},renderTable:function(e,a){var t,r,i,s,o=e.table,g=e.pager,n=e.widgetOptions,l=$.debug(e,"pager"),p=e.$table.hasClass("hasFilters"),d=a&&a.length||0,c="all"===g.size?g.totalRows:g.size,f=g.page*c;if(d<1)l&&console.warn("Pager >> No rows for pager to render");else{if(g.page>=g.totalPages)return C.moveToLastPage(e,g);if(g.cacheIndex=[],g.isDisabled=!1,g.initialized&&(l&&console.log("Pager >> Triggering pagerChange"),e.$table.triggerHandler("pagerChange",e)),n.pager_removeRows){for($.clearTableBody(o),t=$.processTbody(o,e.$tbodies.eq(0),!0),i=r=p?0:f,s=0;s<c&&r<a.length;)p&&g.regexFiltered.test(a[r][0].className)||f<++i&&s<=c&&(s++,g.cacheIndex[g.cacheIndex.length]=r,t.append(a[r])),r++;$.processTbody(o,t,!1)}else C.hideRows(e);C.updatePageDisplay(e),n.pager_startPage=g.page,n.pager_size=g.size,o.isUpdating&&(l&&console.log("Pager >> Triggering updateComplete"),e.$table.triggerHandler("updateComplete",[o,!0]))}},showAllRows:function(e){var a,t,r,i=e.table,s=e.pager,o=e.widgetOptions;for(s.ajax?C.pagerArrows(e,!0):(S.data(i,"pagerLastPage",s.page),S.data(i,"pagerLastSize",s.size),s.page=0,s.size=s.totalRows,s.totalPages=1,e.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),C.renderTable(e,e.rowsCopy),s.isDisabled=!0,$.applyWidget(i),$.debug(e,"pager")&&console.log("Pager >> Disabled")),r=(t=s.$container.find(o.pager_selectors.pageSize+","+o.pager_selectors.gotoPage+",.ts-startRow, .ts-page")).length,a=0;a<r;a++)t.eq(a).prop("aria-disabled","true").addClass(o.pager_css.disabled)[0].disabled=!0},updateCache:function(r){var i=r.pager;$.updateCache(r,function(){if(!S.isEmptyObject(r.cache)){var e,a=[],t=r.cache[0].normalized;for(i.totalRows=t.length,e=0;e<i.totalRows;e++)a[a.length]=t[e][r.columns].$row;r.rowsCopy=a,C.moveToPage(r,i,!0),i.last.currentFilters=[" "]}})},moveToPage:function(e,a,t){if(!a.isDisabled){if(!1!==t&&a.initialized&&S.isEmptyObject(e.cache))return C.updateCache(e);var r,i=e.table,s=e.widgetOptions,o=a.last,g=$.debug(e,"pager");a.ajax&&!s.filter_initialized&&$.hasWidget(i,"filter")||(C.parsePageNumber(e,a),C.calcFilters(e),o.currentFilters=""===(o.currentFilters||[]).join("")?[]:o.currentFilters,a.currentFilters=""===(a.currentFilters||[]).join("")?[]:a.currentFilters,o.page===a.page&&o.size===a.size&&o.totalRows===a.totalRows&&(o.currentFilters||[]).join(",")===(a.currentFilters||[]).join(",")&&(o.ajaxUrl||"")===(a.ajaxObject.url||"")&&(o.optAjaxUrl||"")===(s.pager_ajaxUrl||"")&&o.sortList===(e.sortList||[]).join(",")||(g&&console.log("Pager >> Changing to page "+a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalRows:a.totalRows,currentFilters:a.currentFilters||[],ajaxUrl:a.ajaxObject.url||"",optAjaxUrl:s.pager_ajaxUrl},a.ajax?s.pager_processAjaxOnInit||S.isEmptyObject(s.pager_initialRows)?C.getAjax(e):(s.pager_processAjaxOnInit=!0,r=s.pager_initialRows,a.totalRows=void 0!==r.total?r.total:g&&console.error("Pager >> No initial total page set!")||0,a.filteredRows=void 0!==r.filtered?r.filtered:g&&console.error("Pager >> No initial filtered page set!")||0,C.updatePageDisplay(e,!1)):a.ajax||C.renderTable(e,e.rowsCopy),S.data(i,"pagerLastPage",a.page),a.initialized&&!1!==t&&(g&&console.log("Pager >> Triggering pageMoved"),e.$table.triggerHandler("pageMoved",e),$.applyWidget(i),!a.ajax&&i.isUpdating&&(g&&console.log("Pager >> Triggering updateComplete"),e.$table.triggerHandler("updateComplete",[i,!0])))))}},getTotalPages:function(e,a){return $.hasWidget(e.table,"filter")?Math.min(a.totalPages,a.filteredPages):a.totalPages},parsePageNumber:function(e,a){var t=C.getTotalPages(e,a)-1;return a.page=parseInt(a.page,10),(a.page<0||isNaN(a.page))&&(a.page=0),a.page>t&&0<=t&&(a.page=t),a.page},parsePageSize:function(e,a,t){var r=e.pager,i=e.widgetOptions,s=parseInt(a,10)||r.size||i.pager_size||10;return r.initialized&&(/all/i.test(s+" "+a)||s===r.totalRows)?r.$container.find(i.pager_selectors.pageSize+' option[value="all"]').length?"all":r.totalRows:"get"===t?s:r.size},setPageSize:function(e,a){var t=e.pager,r=e.table;t.size=C.parsePageSize(e,a,"get"),t.$container.find(e.widgetOptions.pager_selectors.pageSize).val(t.size),S.data(r,"pagerLastPage",C.parsePageNumber(e,t)),S.data(r,"pagerLastSize",t.size),t.totalPages="all"===t.size?1:Math.ceil(t.totalRows/t.size),t.filteredPages="all"===t.size?1:Math.ceil(t.filteredRows/t.size)},moveToFirstPage:function(e,a){a.page=0,C.moveToPage(e,a,!0)},moveToLastPage:function(e,a){a.page=C.getTotalPages(e,a)-1,C.moveToPage(e,a,!0)},moveToNextPage:function(e,a){a.page++;var t=C.getTotalPages(e,a)-1;a.page>=t&&(a.page=t),C.moveToPage(e,a,!0)},moveToPrevPage:function(e,a){a.page--,a.page<=0&&(a.page=0),C.moveToPage(e,a,!0)},destroyPager:function(e,a){var t=e.table,r=e.pager,i=e.widgetOptions.pager_selectors||{},s=[i.first,i.prev,i.next,i.last,i.gotoPage,i.pageSize].join(","),o=e.namespace+"pager";if(r){if(r.initialized=!1,e.$table.off(o),r.$container.hide().find(s).off(o),a)return;e.appender=null,C.showAllRows(e),$.storage&&$.storage(t,e.widgetOptions.pager_storageKey,""),r.$container=null,e.pager=null,e.rowsCopy=null}},enablePager:function(e,a){var t,r,i=e.table,s=e.pager,o=e.widgetOptions,g=s.$container.find(o.pager_selectors.pageSize);s.isDisabled=!1,s.page=S.data(i,"pagerLastPage")||s.page||0,r=g.find("option[selected]").val(),s.size=S.data(i,"pagerLastSize")||C.parsePageSize(e,r,"get"),C.setPageSize(e,s.size),s.totalPages="all"===s.size?1:Math.ceil(C.getTotalPages(e,s)/s.size),e.$table.removeClass("pagerDisabled"),i.id&&!e.$table.attr("aria-describedby")&&((t=(g=s.$container.find(o.pager_selectors.pageDisplay)).attr("id"))||(t=i.id+"_pager_info",g.attr("id",t)),e.$table.attr("aria-describedby",t)),C.changeHeight(e),a&&($.update(e),C.setPageSize(e,s.size),C.moveToPage(e,s,!0),C.hideRowsSetup(e),$.debug(e,"pager")&&console.log("Pager >> Enabled"))},appender:function(e,a){var t=e.config,r=t.widgetOptions,i=t.pager;i.ajax?C.moveToPage(t,i,!0):(t.rowsCopy=a,i.totalRows=r.pager_countChildRows?t.$tbodies.eq(0).children("tr").length:a.length,i.size=S.data(e,"pagerLastSize")||i.size||r.pager_size||i.setSize||10,i.totalPages="all"===i.size?1:Math.ceil(i.totalRows/i.size),C.moveToPage(t,i),C.updatePageDisplay(t,!1))}},$.showError=function(e,a,t,r){function i(){o.$table.find("thead").find(o.selectorRemove).remove()}var s=S(e),o=s[0].config,g=o&&o.widgetOptions,n=o.pager&&o.pager.cssErrorRow||g&&g.pager_css&&g.pager_css.errorRow||"tablesorter-errorRow",l=typeof a,p=!0,d="";if(s.length){if("function"==typeof o.pager.ajaxError){if(!1===(p=o.pager.ajaxError(o,a,t,r)))return i();d=p}else if("function"==typeof g.pager_ajaxError){if(!1===(p=g.pager_ajaxError(o,a,t,r)))return i();d=p}if(""===d)if("object"==l)d=0===a.status?"Not connected, verify Network":404===a.status?"Requested page not found [404]":500===a.status?"Internal Server Error [500]":"parsererror"===r?"Requested JSON parse failed":"timeout"===r?"Time out error":"abort"===r?"Ajax Request aborted":"Uncaught error: "+a.statusText+" ["+a.status+"]";else{if("string"!=l)return i();d=a}S(/tr\>/.test(d)?d:'<tr><td colspan="'+o.columns+'">'+d+"</td></tr>").click(function(){S(this).remove()}).appendTo(o.$table.find("thead:first")).addClass(n+" "+o.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"})}else console.error("tablesorter showError: no table parameter passed")}}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-print.min.js b/web/_static/tablesorter/js/widgets/widget-print.min.js
new file mode 100644
index 0000000..ceddc04
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-print.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function(a){"use strict";var p=a.tablesorter,s=p.printTable={event:"printTable",basicStyle:"table, tr, td, th { border : solid 1px black; border-collapse : collapse; } td, th { padding: 2px; }",popupStyle:"width=500,height=300,scrollbars=1,resizable=1",init:function(t){t.$table.unbind(s.event).bind(s.event,function(){return s.process(t,t.widgetOptions),!1})},process:function(t,e){var i,n,r=a("<div/>").append(t.$table.clone()),o=s.basicStyle+"table { width: 100%; }."+(p.css.filterRow||"tablesorter-filter-row")+", ."+(e.filter_filteredRow||"filtered")+" { display: none; }."+(p.css.header||"tablesorter-header")+" { background-image: none !important; }@media print { .print_widget_hidden { display: none; } }";r.find("["+e.print_dataAttrib+"]").each(function(){(i=a(this)).text(i.attr(e.print_dataAttrib))}),n="data-"+(e.lazyload_data_attribute||"original"),r.find("img["+n+"]").each(function(){(i=a(this)).attr("src",i.attr(n))}),/^f/i.test(e.print_rows)?o+="tbody tr:not(."+(e.filter_filteredRow||"filtered")+") { display: table-row !important; }":/^a/i.test(e.print_rows)?o+="tbody tr { display: table-row !important; }":/^[.#:\[]/.test(e.print_rows)&&(o+="tbody tr"+e.print_rows+" { display: table-row !important; }"),/s/i.test(e.print_columns)&&t.selector&&p.hasWidget(t.table,"columnSelector")?o+=e.columnSelector_mediaquery&&t.selector.auto?"":t.selector.$style.text():/a/i.test(e.print_columns)&&(o+="td, th { display: table-cell !important; }"),o+=e.print_extraCSS,a.isFunction(e.print_callback)?e.print_callback(t,r,o):s.printOutput(t,r.html(),o)},printOutput:function(t,e,i){var n=t.widgetOptions,r=p.language,o=window.open("",n.print_title,s.popupStyle),a=n.print_title||t.$table.find("caption").text()||t.$table[0].id||document.title||"table",l=n.print_now?"":'<div class="print_widget_hidden"><a href="javascript:window.print();"><button type="button">'+r.button_print+'</button></a> <a href="javascript:window.close();"><button type="button">'+r.button_close+"</button></a><hr></div>";return o.document.write("<html><head><title>"+a+"</title>"+(n.print_styleSheet?'<link rel="stylesheet" href="'+n.print_styleSheet+'">':"")+"<style>"+i+"</style></head><body>"+l+e+"</body></html>"),o.document.close(),n.print_now&&setTimeout(function(){o.print(),o.close()},10),!0},remove:function(t){t.$table.off(s.event)}};p.language.button_close="Close",p.language.button_print="Print",p.addWidget({id:"print",options:{print_title:"",print_dataAttrib:"data-name",print_rows:"filtered",print_columns:"selected",print_extraCSS:"",print_styleSheet:"",print_now:!0,print_callback:null},init:function(t,e,i){s.init(i)},remove:function(t,e){s.remove(e)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-reflow.min.js b/web/_static/tablesorter/js/widgets/widget-reflow.min.js
new file mode 100644
index 0000000..8f6754f
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-reflow.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function(u){"use strict";var h=u.tablesorter,w={init:function(e,t,l){var o,r=l.reflow_dataAttrib,a=l.reflow_headerAttrib,s=[];t.$table.addClass(l.reflow_className).off("refresh.tsreflow updateComplete.tsreflow2").on("refresh.tsreflow updateComplete.tsreflow2",function(){w.init(e,t,l)}),t.$headers.each(function(){o=u(this),s.push(u.trim(o.attr(a)||o.text()))}),t.$tbodies.children().each(function(){u(this).children().each(function(e){u(this).attr(r,s[e])})})},init2:function(e,t,l){var o,r,a,s,i,n,f=t.columns,c=l.reflow2_headerAttrib,d=[];for(t.$table.addClass(l.reflow2_className).off("refresh.tsreflow2 updateComplete.tsreflow2").on("refresh.tsreflow2 updateComplete.tsreflow2",function(){w.init2(e,t,l)}),a=0;a<f;a++)1<(s=t.$headers.filter('[data-column="'+a+'"]')).length?(i=[],s.each(function(){(o=u(this)).hasClass(l.reflow2_classIgnore)||i.push(o.attr(c)||o.text())})):i=[s.attr(c)||s.text()],d.push(i);i='<b class="'+t.selectorRemove.slice(1)+" "+l.reflow2_labelClass,t.$tbodies.children().each(function(){(r=h.processTbody(e,u(this),!0)).children().each(function(e){for(o=u(this),n=d[e].length,a=n-1;0<=a;)o.prepend(i+(0===a&&1<n?" "+l.reflow2_labelTop:"")+'">'+d[e][a]+"</b>"),a--}),h.processTbody(e,r,!1)})},remove:function(e,t,l){t.$table.removeClass(l.reflow_className)},remove2:function(e,t,l){t.$table.removeClass(l.reflow2_className)}};h.addWidget({id:"reflow",options:{reflow_className:"ui-table-reflow",reflow_headerAttrib:"data-name",reflow_dataAttrib:"data-title"},init:function(e,t,l,o){w.init(e,l,o)},remove:function(e,t,l){w.remove(e,t,l)}}),h.addWidget({id:"reflow2",options:{reflow2_className:"ui-table-reflow",reflow2_classIgnore:"ui-table-reflow-ignore",reflow2_headerAttrib:"data-name",reflow2_labelClass:"ui-table-cell-label",reflow2_labelTop:"ui-table-cell-label-top"},init:function(e,t,l,o){w.init2(e,l,o)},remove:function(e,t,l){w.remove2(e,t,l)}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-repeatheaders.min.js b/web/_static/tablesorter/js/widgets/widget-repeatheaders.min.js
new file mode 100644
index 0000000..4640aa7
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-repeatheaders.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: repeatHeaders - updated 9/23/2016 (v2.27.7) */
+!function(n){"use strict";n.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(e,r,t){var a,o,d,i,s="";if(!t.repeatHeaders){for(s='<tr class="repeated-header '+r.selectorRemove.slice(1)+'">',a=0;a<r.columns;a++)s+="<th>"+n.trim(r.$headers.eq(a).html())+"</th>";t.repeatHeaders=s+"</tr>"}for(i=t&&t.rowsToSkip||4,r.$table.find("tr.repeated-header").remove(),d=(o=r.$tbodies.find("tr")).length,a=i;a<d;a+=i)o.eq(a).before(t.repeatHeaders)},remove:function(e,r,t){t.repeatHeaders="",r.$table.find("tr.repeated-header").remove()}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-resizable.min.js b/web/_static/tablesorter/js/widgets/widget-resizable.min.js
new file mode 100644
index 0000000..f6be67b
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-resizable.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: resizable - updated 2018-03-26 (v2.30.2) */
+!function(b,t){"use strict";var c=b.tablesorter||{};b.extend(c.css,{resizableContainer:"tablesorter-resizable-container",resizableHandle:"tablesorter-resizable-handle",resizableNoSelect:"tablesorter-disableSelection",resizableStorage:"tablesorter-resizable"}),b(function(){var e="<style>body."+c.css.resizableNoSelect+" { -ms-user-select: none; -moz-user-select: -moz-none;-khtml-user-select: none; -webkit-user-select: none; user-select: none; }."+c.css.resizableContainer+" { position: relative; height: 1px; }."+c.css.resizableHandle+" { position: absolute; display: inline-block; width: 8px;top: 1px; cursor: ew-resize; z-index: 3; user-select: none; -moz-user-select: none; }</style>";b("head").append(e)}),c.resizable={init:function(e,t){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable");var s,a,i,r,l=e.$table,o=l.parent(),n=parseInt(l.css("margin-top"),10),d=t.resizable_vars={useStorage:c.storage&&!1!==t.resizable,$wrap:o,mouseXPosition:0,$target:null,$next:null,overflow:"auto"===o.css("overflow")||"scroll"===o.css("overflow")||"auto"===o.css("overflow-x")||"scroll"===o.css("overflow-x"),storedSizes:[]};for(c.resizableReset(e.table,!0),d.tableWidth=l.width(),d.fullWidth=Math.abs(o.width()-d.tableWidth)<20,d.useStorage&&d.overflow&&(c.storage(e.table,"tablesorter-table-original-css-width",d.tableWidth),r=c.storage(e.table,"tablesorter-table-resized-width")||"auto",c.resizable.setWidth(l,r,!0)),t.resizable_vars.storedSizes=i=(d.useStorage?c.storage(e.table,c.css.resizableStorage):[])||[],c.resizable.setWidths(e,t,i),c.resizable.updateStoredSizes(e,t),t.$resizable_container=b('<div class="'+c.css.resizableContainer+'">').css({top:n}).insertBefore(l),a=0;a<e.columns;a++)s=e.$headerIndexed[a],r=c.getColumnData(e.table,e.headers,a),"false"===c.getData(s,r,"resizable")||b('<div class="'+c.css.resizableHandle+'">').appendTo(t.$resizable_container).attr({"data-column":a,unselectable:"on"}).data("header",s).bind("selectstart",!1);c.resizable.bindings(e,t)}},updateStoredSizes:function(e,t){var s,a,i=e.columns,r=t.resizable_vars;for(r.storedSizes=[],s=0;s<i;s++)a=e.$headerIndexed[s],r.storedSizes[s]=a.is(":visible")?a.width():0},setWidth:function(e,t,s){e.css({width:t,"min-width":s?t:"","max-width":s?t:""})},setWidths:function(e,t,s){var a,i,r=t.resizable_vars,l=b(e.namespace+"_extra_headers"),o=e.$table.children("colgroup").children("col");if((s=s||r.storedSizes||[]).length){for(a=0;a<e.columns;a++)c.resizable.setWidth(e.$headerIndexed[a],s[a],r.overflow),l.length&&(i=l.eq(a).add(o.eq(a)),c.resizable.setWidth(i,s[a],r.overflow));(i=b(e.namespace+"_extra_table")).length&&!c.hasWidget(e.table,"scroller")&&c.resizable.setWidth(i,e.$table.outerWidth(),r.overflow)}},setHandlePosition:function(i,r){var l,o=i.$table.height(),e=r.$resizable_container.children(),n=Math.floor(e.width()/2);c.hasWidget(i.table,"scroller")&&(o=0,i.$table.closest("."+c.css.scrollerWrap).children().each(function(){var e=b(this);o+=e.filter('[style*="height"]').length?e.height():e.children("table").height()})),!r.resizable_includeFooter&&i.$table.children("tfoot").length&&(o-=i.$table.children("tfoot").height()),l=3.3<=parseFloat(b.fn.jquery)?0:i.$table.position().left,e.each(function(){var e=b(this),t=parseInt(e.attr("data-column"),10),s=i.columns-1,a=e.data("header");a&&(!a.is(":visible")||!r.resizable_addLastColumn&&c.resizable.checkVisibleColumns(i,t)?e.hide():(t<s||t===s&&r.resizable_addLastColumn)&&e.css({display:"inline-block",height:o,left:a.position().left-l+a.outerWidth()-n}))})},checkVisibleColumns:function(e,t){var s,a=0;for(s=t+1;s<e.columns;s++)a+=e.$headerIndexed[s].is(":visible")?1:0;return 0===a},toggleTextSelection:function(e,t,s){var a=e.namespace+"tsresize";t.resizable_vars.disabled=s,b("body").toggleClass(c.css.resizableNoSelect,s),s?b("body").attr("unselectable","on").bind("selectstart"+a,!1):b("body").removeAttr("unselectable").unbind("selectstart"+a)},bindings:function(r,l){var e=r.namespace+"tsresize";l.$resizable_container.children().bind("mousedown",function(e){var t,s=l.resizable_vars,a=b(r.namespace+"_extra_headers"),i=b(e.target).data("header");t=parseInt(i.attr("data-column"),10),s.$target=i=i.add(a.filter('[data-column="'+t+'"]')),s.target=t,s.$next=e.shiftKey||l.resizable_targetLast?i.parent().children().not(".resizable-false").filter(":last"):i.nextAll(":not(.resizable-false)").eq(0),t=parseInt(s.$next.attr("data-column"),10),s.$next=s.$next.add(a.filter('[data-column="'+t+'"]')),s.next=t,s.mouseXPosition=e.pageX,c.resizable.updateStoredSizes(r,l),c.resizable.toggleTextSelection(r,l,!0)}),b(document).bind("mousemove"+e,function(e){var t=l.resizable_vars;t.disabled&&0!==t.mouseXPosition&&t.$target&&(l.resizable_throttle?(clearTimeout(t.timer),t.timer=setTimeout(function(){c.resizable.mouseMove(r,l,e)},isNaN(l.resizable_throttle)?5:l.resizable_throttle)):c.resizable.mouseMove(r,l,e))}).bind("mouseup"+e,function(){l.resizable_vars.disabled&&(c.resizable.toggleTextSelection(r,l,!1),c.resizable.stopResize(r,l),c.resizable.setHandlePosition(r,l))}),b(t).bind("resize"+e+" resizeEnd"+e,function(){c.resizable.setHandlePosition(r,l)}),r.$table.bind("columnUpdate pagerComplete resizableUpdate ".split(" ").join(e+" "),function(){c.resizable.setHandlePosition(r,l)}).bind("resizableReset"+e,function(){c.resizableReset(r.table)}).find("thead:first").add(b(r.namespace+"_extra_table").find("thead:first")).bind("contextmenu"+e,function(){var e=0===l.resizable_vars.storedSizes.length;return c.resizableReset(r.table),c.resizable.setHandlePosition(r,l),l.resizable_vars.storedSizes=[],e})},mouseMove:function(e,t,s){if(0!==t.resizable_vars.mouseXPosition&&t.resizable_vars.$target){var a,i=0,r=t.resizable_vars,l=r.$next,o=r.storedSizes[r.target],n=s.pageX-r.mouseXPosition;if(r.overflow){if(0<o+n){for(r.storedSizes[r.target]+=n,c.resizable.setWidth(r.$target,r.storedSizes[r.target],!0),a=0;a<e.columns;a++)i+=r.storedSizes[a];c.resizable.setWidth(e.$table.add(b(e.namespace+"_extra_table")),i)}l.length||(r.$wrap[0].scrollLeft=e.$table.width())}else r.fullWidth?(r.storedSizes[r.target]+=n,r.storedSizes[r.next]-=n):r.storedSizes[r.target]+=n,c.resizable.setWidths(e,t);r.mouseXPosition=s.pageX,e.$table.triggerHandler("stickyHeadersUpdate")}},stopResize:function(e,t){var s=t.resizable_vars;c.resizable.updateStoredSizes(e,t),s.useStorage&&(c.storage(e.table,c.css.resizableStorage,s.storedSizes),c.storage(e.table,"tablesorter-table-resized-width",e.$table.width())),s.mouseXPosition=0,s.$target=s.$next=null,e.$table.triggerHandler("stickyHeadersUpdate"),e.$table.triggerHandler("resizableComplete")}},c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_includeFooter:!0,resizable_widths:[],resizable_throttle:!1,resizable_targetLast:!1},init:function(e,t,s,a){c.resizable.init(s,a)},format:function(e,t,s){c.resizable.setHandlePosition(t,s)},remove:function(e,t,s,a){if(s.$resizable_container){var i=t.namespace+"tsresize";t.$table.add(b(t.namespace+"_extra_table")).removeClass("hasResizable").children("thead").unbind("contextmenu"+i),s.$resizable_container.remove(),c.resizable.toggleTextSelection(t,s,!1),c.resizableReset(e,a),b(document).unbind("mousemove"+i+" mouseup"+i)}}}),c.resizableReset=function(r,l){b(r).each(function(){var e,t,s=this.config,a=s&&s.widgetOptions,i=a.resizable_vars;if(r&&s&&s.$headerIndexed.length){for(i.overflow&&i.tableWidth&&(c.resizable.setWidth(s.$table,i.tableWidth,!0),i.useStorage&&c.storage(r,"tablesorter-table-resized-width",i.tableWidth)),e=0;e<s.columns;e++)t=s.$headerIndexed[e],a.resizable_widths&&a.resizable_widths[e]?c.resizable.setWidth(t,a.resizable_widths[e],i.overflow):t.hasClass("resizable-false")||c.resizable.setWidth(t,"",i.overflow);s.$table.triggerHandler("stickyHeadersUpdate"),c.storage&&!l&&c.storage(this,c.css.resizableStorage,[])}})}}(jQuery,window);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-saveSort.min.js b/web/_static/tablesorter/js/widgets/widget-saveSort.min.js
new file mode 100644
index 0000000..0e49b57
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-saveSort.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: saveSort - updated 2018-03-19 (v2.30.1) */
+!function(o){"use strict";var v=o.tablesorter||{};function g(t){var s=v.storage(t.table,"tablesorter-savesort");return s&&s.hasOwnProperty("sortList")&&o.isArray(s.sortList)?s.sortList:[]}function S(t,s){return(s||g(t)).join(",")!==t.sortList.join(",")}v.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(t,s,o,r){s.format(t,o,r,!0)},format:function(s,t,o,r){var a,e=t.$table,i=!1!==o.saveSort,n={sortList:t.sortList},l=v.debug(t,"saveSort");l&&(a=new Date),e.hasClass("hasSaveSort")?i&&s.hasInitialized&&v.storage&&S(t)&&(v.storage(s,"tablesorter-savesort",n),l&&console.log("saveSort >> Saving last sort: "+t.sortList+v.benchmark(a))):(e.addClass("hasSaveSort"),n="",v.storage&&(n=g(t),l&&console.log('saveSort >> Last sort loaded: "'+n+'"'+v.benchmark(a)),e.bind("saveSortReset",function(t){t.stopPropagation(),v.storage(s,"tablesorter-savesort","")})),r&&n&&0<n.length?t.sortList=n:s.hasInitialized&&n&&0<n.length&&S(t,n)&&v.sortOn(t,n))},remove:function(t,s){s.$table.removeClass("hasSaveSort"),v.storage&&v.storage(t,"tablesorter-savesort","")}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-scroller.min.js b/web/_static/tablesorter/js/widgets/widget-scroller.min.js
new file mode 100644
index 0000000..dc6d342
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-scroller.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: scroller - updated 2018-05-07 (v2.30.4) */
+!function(z,x){"use strict";var B=z.tablesorter,R=B.css;z.extend(B.css,{scrollerWrap:"tablesorter-scroller",scrollerHeader:"tablesorter-scroller-header",scrollerTable:"tablesorter-scroller-table",scrollerFooter:"tablesorter-scroller-footer",scrollerFixed:"tablesorter-scroller-fixed",scrollerFixedPanel:"tablesorter-scroller-fixed-panel",scrollerHasFix:"tablesorter-scroller-has-fixed-columns",scrollerHideColumn:"tablesorter-scroller-hidden-column",scrollerHideElement:"tablesorter-scroller-hidden",scrollerSpacerRow:"tablesorter-scroller-spacer",scrollerBarSpacer:"tablesorter-scroller-bar-spacer",scrollerAddedHeight:"tablesorter-scroller-added-height",scrollerHack:"tablesorter-scroller-scrollbar-hack",scrollerRtl:"ts-scroller-rtl"}),B.addWidget({id:"scroller",priority:60,options:{scroller_height:300,scroller_jumpToHeader:!0,scroller_upAfterSort:!0,scroller_fixedColumns:0,scroller_rowHighlight:"hover",scroller_addFixedOverlay:!1,scroller_barWidth:null},format:function(e,r,l){r.isScrolling?B.scroller.resize(r,l):B.scroller.setup(r,l)},remove:function(e,r,l){B.scroller.remove(r,l)}}),B.window_resize=function(){B.timer_resize&&clearTimeout(B.timer_resize),B.timer_resize=setTimeout(function(){z(x).trigger("resizeEnd")},250)},z(function(){var e="<style>."+R.scrollerWrap+" { position: relative; overflow: hidden; }."+R.scrollerWrap+" * { box-sizing: border-box; }."+R.scrollerHeader+", ."+R.scrollerFooter+" { position: relative; overflow: hidden; }."+R.scrollerHeader+" table."+R.table+" { margin-bottom: 0; }."+R.scrollerTable+" { position: relative; overflow: auto; }."+R.scrollerTable+" table."+R.table+" { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; max-width: initial; }."+R.scrollerTable+" tfoot, ."+R.scrollerHideElement+", ."+R.scrollerHideColumn+" { display: none; }."+R.scrollerFixed+", ."+R.scrollerFixed+" ."+R.scrollerFixedPanel+" { pointer-events: none; }."+R.scrollerFixed+" > div { pointer-events: all; }."+R.scrollerWrap+" ."+R.scrollerFixed+" { position: absolute; top: 0; z-index: 1; left: 0 } ."+R.scrollerWrap+" ."+R.scrollerFixed+"."+R.scrollerRtl+" { left: auto; right: 0 } ."+R.scrollerWrap+"."+R.scrollerHasFix+" > ."+R.scrollerTable+" { overflow: auto; }."+R.scrollerFixed+" ."+R.scrollerFooter+" { position: absolute; bottom: 0; }."+R.scrollerFixed+" ."+R.scrollerTable+" { position: relative; left: 0; overflow: auto; -ms-overflow-style: none; }."+R.scrollerFixed+" ."+R.scrollerTable+"::-webkit-scrollbar { display: none; }."+R.scrollerWrap+" ."+R.scrollerFixedPanel+" { position: absolute; top: 0; bottom: 0; z-index: 2; left: 0; right: 0; } </style>";z("head").append(e)}),B.scroller={isFirefox:-1<navigator.userAgent.toLowerCase().indexOf("firefox"),isOldIE:document.all&&!x.atob,isIE:document.all&&!x.atob||0<navigator.appVersion.indexOf("Trident/"),isSafari:-1<navigator.userAgent.toLowerCase().indexOf("safari")&&-1===navigator.userAgent.toLowerCase().indexOf("chrome"),hasScrollBar:function(e,r){return r?e.get(0).scrollWidth>e.width():e.get(0).scrollHeight>e.height()},setWidth:function(e,r){e.css({width:r,"min-width":r,"max-width":r})},getBarWidth:function(){var e=z("<div>").css({position:"absolute",top:"-9999px",left:0,width:"100px",height:"100px",overflow:"scroll",visibility:"hidden"}).appendTo("body"),r=e[0],l=r.offsetWidth-r.clientWidth;return e.remove(),l},setup:function(o,s){var r,l,e,t,i,d,c,a,n=z(x),h=B.scroller,f=o.namespace+"tsscroller",p=z(),b=o.namespace.slice(1)+"tsscroller",u=o.$table;o.widthFixed=!0,s.scroller_calcWidths=[],s.scroller_saved=[0,0],s.scroller_isBusy=!0,(s.scroller_scrollTimer=null)!==s.scroller_barWidth?s.scroller_barSetWidth=s.scroller_barWidth:(a=h.getBarWidth(),s.scroller_barSetWidth=null!==a?a:15),c=u.children("caption"),l=z('<table class="'+u.attr("class")+'" cellpadding=0 cellspacing=0>'+(c.length?c[0].outerHTML:"")+u.children("thead")[0].outerHTML+"</table>"),s.scroller_$header=l.addClass(o.namespace.slice(1)+"_extra_table"),(e=u.children("tfoot")).length&&(p=z('<table class="'+u.attr("class")+'" cellpadding=0 cellspacing=0 style="margin-top:0"></table>').addClass(o.namespace.slice(1)+"_extra_table").append(e.clone(!0)).wrap('<div class="'+R.scrollerFooter+'"/>')),s.scroller_$footer=p,u.wrap('<div id="'+b+'" class="'+R.scrollerWrap+'" />').before(l).find("."+R.filterRow).addClass(R.filterRowHide),s.scroller_$container=u.parent(),p.length&&u.after(p.parent()),t=l.wrap('<div class="'+R.scrollerHeader+'" />').find("."+R.header),u.wrap('<div class="'+R.scrollerTable+(0<s.scroller_height?'" style="max-height:'+s.scroller_height+'px;">':'">')),i=u.parent(),B.bindEvents(o.table,t),u.hasClass("hasFilters")&&B.filter.bindSearch(u,l.find("."+R.filter)),u.children("thead, caption").addClass(R.scrollerHideElement),r=i.parent().height(),i.off("scroll"+f).on("scroll"+f,function(){if(clearTimeout(s.scroller_scrollTimer),s.scroller_scrollTimer=setTimeout(function(){s.scroller_saved[0]=i.scrollLeft(),s.scroller_saved[1]=i.scrollTop()},300),s.scroller_jumpToHeader){var e=n.scrollTop()-l.offset().top;0!==z(this).scrollTop()&&e<r&&0<e&&n.scrollTop(l.offset().top)}l.parent().add(p.parent()).scrollLeft(z(this).scrollLeft())}),d=((c=B.hasWidget(o.table,"filter")?"filterEnd filterInit":"tablesorter-initialized updateComplete")+" sortEnd pagerComplete columnUpdate ").split(" ").join(f+" "),u.off(f).on("sortStart"+f,function(){clearTimeout(s.scroller_scrollTimer),s.scroller_isBusy=!0}).on("sortEnd filterEnd".split(" ").join(f+" "),function(e){"sortEnd"===e.type&&s.scroller_upAfterSort?i.scrollLeft(s.scroller_saved[0]).animate({scrollTop:0},"fast",function(){s.scroller_isBusy=!1}):s.scroller_fixedColumns&&setTimeout(function(){i.scrollTop(s.scroller_saved[1]).scrollLeft(s.scroller_saved[0]),h.updateFixed(o,s)},0)}).on("setFixedColumnSize"+f,function(e,r){var l=s.scroller_$container;void 0===r||isNaN(r)||(s.scroller_fixedColumns=parseInt(r,10)),h.removeFixed(o,s),0<(r=s.scroller_fixedColumns)&&r<o.columns-1?h.updateFixed(o,s):l.hasClass(R.scrollerHasFix)&&(l.removeClass(R.scrollerHasFix),h.resize(o,s))}).on(d,function(e){B.hasWidget("pager")&&"updateComplete"===e.type||(0<s.scroller_fixedColumns&&h.updateFixed(o,s),h.resize(o,s))}),n.off("resize resizeEnd ".split(" ").join(f+" ")).on("resize"+f,B.window_resize).on("resizeEnd"+f,function(){n.off("resize"+f,B.window_resize),h.resize(o,s),n.on("resize"+f,B.window_resize),i.trigger("scroll"+f)}),o.isScrolling=!0,h.updateFixed(o,s),o.table.hasInitialized&&o.isScrolling&&setTimeout(function(){B.scroller.resize(o,s)},50)},resize:function(e,r){if(!r.scroller_isBusy){var l,o,s,t,i,d=B.scroller,c=r.scroller_$container,a=e.$table,n=a.parent(),h=r.scroller_$header,f=r.scroller_$footer,p=z(x),b=[p.scrollLeft(),p.scrollTop()],u=e.namespace.slice(1)+"tsscroller",m=z("div."+R.scrollerWrap+'[id!="'+u+'"]').addClass(R.scrollerHideElement),g="padding:0;margin:0;border:0;height:0;max-height:0;min-height:0;",v='<tr class="'+R.scrollerSpacerRow+" "+e.selectorRemove.slice(1)+'" style="'+g+'">';for(r.scroller_calcWidths=[],d.removeFixed(e,r),c.find("."+R.scrollerSpacerRow).remove(),c.find("."+B.css.colgroup).remove(),a.find("."+R.scrollerHideElement).removeClass(R.scrollerHideElement),o=parseInt(a.css("border-left-width"),10),t=e.$headerIndexed,l=0;l<e.columns;l++)v+='<td data-column="'+l+'" style="'+g+"width:"+(s="border-box"===(i=t[l]).css("box-sizing")?i.outerWidth():"collapse"===i.css("border-collapse")?i.length&&x.getComputedStyle?parseFloat(x.getComputedStyle(i[0],null).width):i.outerWidth()-parseFloat(i.css("padding-left"))-parseFloat(i.css("padding-right"))-(parseFloat(i.css("border-width"))||0):i.width())+"px;min-width:"+s+"px;max-width:"+s+'px"></td>',r.scroller_calcWidths[l]=s;v+="</tr>",e.$tbodies.eq(0).append(v),h.children("thead").append(v),f.children("tfoot").append(v),B.fixColumnWidth(e.table),v=e.$table.children("colgroup")[0].outerHTML,h.append(v),f.append(v),g=n.parent().innerWidth()-(d.hasScrollBar(n)?r.scroller_barSetWidth:0),n.width(g),g=(d.hasScrollBar(n)?r.scroller_barSetWidth:0)+o,s=n.innerWidth()-g,h.parent().add(f.parent()).width(s),n.width(s+g),a.children("thead, caption").addClass(R.scrollerHideElement),d.updateFixed(e,r),m.removeClass(R.scrollerHideElement),n.scrollTop(r.scroller_saved[1]),r.scroller_$container.find("."+R.scrollerFixed).find("."+R.scrollerTable).scrollTop(r.scroller_saved[1]),p.scrollLeft(b[0]),p.scrollTop(b[1]),setTimeout(function(){e.$table.triggerHandler("resizableUpdate"),e.$table.triggerHandler("scrollerComplete")},100)}},setupFixed:function(e,r){var l,o,s,t,i,d,c,a=e.$table,n=r.scroller_$container,h=r.scroller_fixedColumns;for((d=n.addClass(R.scrollerHasFix).clone().addClass(R.scrollerFixed).removeClass(R.scrollerWrap).attr("id","")).find("caption").html("&nbsp;"),r.scroller_addFixedOverlay&&d.append('<div class="'+R.scrollerFixedPanel+'">'),(c=d.find("."+R.scrollerTable)).children("table").addClass(e.namespace.slice(1)+"_extra_table").attr("id","").children("thead, tfoot").remove(),r.scroller_$fixedColumns=d,a.hasClass(R.scrollerRtl)&&d.addClass(R.scrollerRtl),t=(s=d.find("tr")).length,l=0;l<t;l++)s.eq(l).children(":gt("+(h-1)+")").remove();if(d.addClass(R.scrollerHideElement).prependTo(n),e.$table.hasClass("hasFilters"))for(s=d.find("."+R.filter).not("."+R.filterDisabled).prop("disabled",!1),B.filter.bindSearch(a,d.find("."+R.filter)),t=(s=n.children("."+R.scrollerHeader).find("."+R.filter)).length,l=0;l<t;l++)s.eq(l).hasClass(R.filterDisabled||"disabled")||s.eq(l).prop("disabled",l<h);for(e.$table.add("."+R.scrollerFooter+" table").children("thead").children("tr."+R.headerRow).children().attr("tabindex",-1),t=(s=r.scroller_$header.add(d.find("."+R.scrollerTable+" table")).children("thead").children("tr."+R.headerRow)).length,l=0;l<t;l++)for(i=s.eq(l).children(),o=0;o<i.length;o++)i.eq(o).attr("tabindex",o<h?-1:0);B.bindEvents(e.table,d.find("."+R.header)),B.scroller.bindFixedColumnEvents(e,r),(B.scroller.isFirefox||B.scroller.isOldIE)&&c.wrap('<div class="'+R.scrollerHack+'" style="overflow:hidden;">')},throttle:function(o,s,t){var i,d;return s=s||50,function(){var e=t||this,r=+new Date,l=arguments;i&&r<i+s?(clearTimeout(d),d=setTimeout(function(){i=r,o.apply(e,l)},s)):(i=r,o.apply(e,l))}},bindFixedColumnEvents:function(l,o){var e=B.scroller,r=l.namespace+"tsscrollerFixed",s="scroll"+r,t=o.scroller_$fixedColumns.find("."+R.scrollerTable),i=!0,d=!0;l.$table.parent().off(s).on(s,e.throttle(function(){if(!o.scroller_isBusy&&i){d=!1;var e=z(this);t[0].scrollTop=o.scroller_saved[1]=e.scrollTop(),o.scroller_saved[0]=e.scrollLeft(),setTimeout(function(){d=!0},20)}})),t.off(s).on(s,e.throttle(function(){!o.scroller_isBusy&&d&&(i=!1,l.$table.parent()[0].scrollTop=o.scroller_saved[1]=z(this).scrollTop(),setTimeout(function(){i=!0},20))})).scroll(),""!==o.scroller_rowHighlight&&(s="mouseover mouseleave ".split(" ").join(r+" "),l.$table.off(s,"tbody > tr").on(s,"tbody > tr",function(e){var r=l.$table.children("tbody").children("tr").index(this);t.children("table").children("tbody").children("tr").eq(r).add(this).toggleClass(o.scroller_rowHighlight,"mouseover"===e.type)}),t.find("table").off(s,"tbody > tr").on(s,"tbody > tr",function(e){var r=t.children("table").children("tbody").children("tr").index(this);l.$table.children("tbody").children("tr").eq(r).add(this).toggleClass(o.scroller_rowHighlight,"mouseover"===e.type)}))},adjustWidth:function(e,r,l,o,s){var t=r.scroller_$container;t.children("."+R.scrollerTable).css(s?"right":"left",l),t.children("."+R.scrollerHeader+", ."+R.scrollerFooter).css(s?"right":"left",l+(s&&B.scroller.isSafari?o:0))},updateFixed:function(e,r){var l,o,s=r.scroller_$container,t=r.scroller_$header,i=r.scroller_$footer,d=e.$table,c=d.parent(),a=r.scroller_barSetWidth,n=d.hasClass(R.scrollerRtl);if(0===r.scroller_fixedColumns)return r.scroller_isBusy=!1,B.scroller.removeFixed(e,r),l=s.width(),c.width(l),o=B.scroller.hasScrollBar(c)?a:0,void t.parent().add(i.parent()).width(l-o);if(e.isScrolling){r.scroller_isBusy=!0,s.find("."+R.scrollerFixed).length||B.scroller.setupFixed(e,r);var h,f,p,b,u,m,g,v=r.scroller_$container.children("."+R.scrollerTable).children("table").children("tbody"),x=r.scroller_$header.children("thead").children("."+R.headerRow),_=r.scroller_$fixedColumns.addClass(R.scrollerHideElement),w=_.find("."+R.scrollerTable).children("table"),C=w.children("tbody"),F=B.scroller,H=r.scroller_fixedColumns,T=function(e,r,l){return parseInt(e.css(r)||"",10)||l||0},y=d.find("tbody td"),$=T(y,"border-right-width",1),W=T(y,"border-spacing",0),S=T(d,"padding-left")+T(d,"padding-right")+2*T(d,"border-left-width",1)+T(d,"border-right-width",1)-$+W/2,E=r.scroller_calcWidths;for(B.scroller.removeFixed(e,r,!1),h=0;h<H;h++)S+=E[h]+W;for(S+=2*$,F.setWidth(_.add(_.children()),S),F.setWidth(_.children().children("table"),S),f=0;f<e.$tbodies.length;f++)if((b=v.eq(f)).length){for(g=(x=b.children()).length,(m=B.processTbody(w,C.eq(f),!0)).empty(),p=0;p<g;p++)(u=z(x[p].outerHTML)).children("td, th").slice(H).remove(),m.append(u);B.processTbody(w,m,!1)}for(o=B.scroller.hasScrollBar(c)?a:0,(F.isFirefox||F.isOldIE)&&w.css("width",S).parent().css("width",S+o),h=0;h<H;h++)l=":nth-child("+(h+1)+")",s.children("div").children("table").find("th"+l+", td"+l+", col"+l).addClass(R.scrollerHideColumn);_.removeClass(R.scrollerHideElement).find("colgroup").each(function(){z(this).find("col:gt("+(H-1)+")").addClass(R.scrollerHideElement)}),S-=$,l=c.parent().innerWidth()-S,c.width(l),s.children("."+R.scrollerTable).css(n?"right":"left",S),s.children("."+R.scrollerHeader+", ."+R.scrollerFooter).css(n?"right":"left",S+(n&&B.scroller.isSafari?o:0)),t.parent().add(i.parent()).width(l-o),o=(l=B.scroller.hasScrollBar(c,!0))?a:0,!_.find("."+R.scrollerBarSpacer).length&&l?(y=z('<div class="'+R.scrollerBarSpacer+'">').css("height",o+"px"),_.find("."+R.scrollerTable).append(y)):l||_.find("."+R.scrollerBarSpacer).remove(),B.scroller.updateRowHeight(e,r),_.height(s.height()),_.removeClass(R.scrollerHideElement),_.find("caption").height(r.scroller_$header.find("caption").height()),c.scroll(),setTimeout(function(){r.scroller_isBusy=!1},0)}},fixHeight:function(e,r){var l,o,s,t,i,d=R.scrollerAddedHeight,c=e.length;for(l=0;l<c;l++)t=e.eq(l),i=r.eq(l),o=t.height(),(s=i.height())<o?i.addClass(d).height(o):o<s&&t.addClass(d).height(s)},updateRowHeight:function(e,r){var l,o,s=r.scroller_$fixedColumns;r.scroller_$container.find("."+R.scrollerAddedHeight).removeClass(R.scrollerAddedHeight).height(""),l=r.scroller_$header.children("thead").children("tr"),o=s.children("."+R.scrollerHeader).children("table").children("thead").children("tr"),B.scroller.fixHeight(l,o),l=r.scroller_$footer.children("tfoot").children("tr"),o=s.children("."+R.scrollerFooter).children("table").children("tfoot").children("tr"),B.scroller.fixHeight(l,o),(B.scroller.isFirefox||B.scroller.isOldIE)&&(s=s.find("."+R.scrollerHack)),l=e.$table.children("tbody").children("tr"),o=s.children("."+R.scrollerTable).children("table").children("tbody").children("tr"),B.scroller.fixHeight(l,o)},removeFixed:function(e,r,l){var o=e.$table,s=r.scroller_$container,t=o.hasClass(R.scrollerRtl);!l&&void 0!==l||s.find("."+R.scrollerFixed).remove(),s.find("."+R.scrollerHideColumn).removeClass(R.scrollerHideColumn),s.children(":not(."+R.scrollerFixed+")").css(t?"right":"left",0)},remove:function(e,r){var l=r.scroller_$container,o=e.namespace+"tsscroller";e.$table.off(o),z(x).off(o),l&&(e.$table.insertBefore(l).find("thead").removeClass(R.scrollerHideElement).children("tr."+R.headerRow).children().attr("tabindex",0).end().find("."+R.filterRow).removeClass(R.scrollerHideElement+" "+R.filterRowHide),e.$table.find("."+R.filter).not("."+R.filterDisabled).prop("disabled",!1),l.remove(),e.isScrolling=!1)}}}(jQuery,window);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-sort2Hash.min.js b/web/_static/tablesorter/js/widgets/widget-sort2Hash.min.js
new file mode 100644
index 0000000..fefbb55
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-sort2Hash.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: sort2Hash (BETA) - updated 9/27/2017 (v2.29.0) */
+!function(g){"use strict";var p=g.tablesorter||{},u=p.sort2Hash={init:function(e,t){var a,r,o,s,n=e.table,i=e.pager,h=p.hasWidget(n,"saveSort"),l=u.decodeHash(e,t,"sort");(l&&!h||l&&h&&t.sort2Hash_overrideSaveSort)&&u.convertString2Sort(e,t,l),p.hasWidget(e.table,"pager")&&(r=parseInt(u.decodeHash(e,t,"page"),10),o=i.page=r<0?0:r>i.totalPages?i.totalPages-1:r,s=i.size=parseInt(u.decodeHash(e,t,"size"),10)),p.hasWidget(n,"filter")&&(a=u.decodeHash(e,t,"filter"))&&(a=a.split(t.sort2Hash_separator),e.$table.one("tablesorter-ready",function(){setTimeout(function(){e.$table.one("filterEnd",function(){g(this).triggerHandler("pageAndSize",[o,s])}),(r=p.filter.equalFilters?p.filter.equalFilters(e,e.lastSearch,a):(e.lastSearch||[]).join("")!==(a||[]).join(""))||g.tablesorter.setFilters(n,a,!0)},100)})),a||e.$table.one("tablesorter-ready",function(){e.$table.triggerHandler("pageAndSize",[o,s])}),e.$table.on("sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash",function(){this.hasInitialized&&u.setHash(this.config,this.config.widgetOptions)})},getTableId:function(e,t){return t.sort2Hash_tableId||e.table.id||"table"+g("table").index(e.$table)},regexEscape:function(e){return e.replace(/([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g,"\\$1")},convertString2Sort:function(e,t,a){for(var r,o,s,n,i,h,l=a.split(t.sort2Hash_separator),d=0,c=l.length,H=[];d<c;){if(o=l[d++],n=parseInt(o,10),isNaN(n)||n>e.columns)for(r=new RegExp("("+u.regexEscape(o)+")","i"),i=0;i<e.columns;i++)h=e.$headerIndexed[i],r.test(h.attr(t.sort2Hash_headerTextAttr))&&(o=i,i=e.columns);s=l[d++],void 0!==o&&void 0!==s&&(isNaN(s)&&(s=-1<s.indexOf(t.sort2Hash_directionText[1])?1:0),H.push([o,s]))}H.length&&(e.sortList=H)},convertSort2String:function(e,t){var a,r,o,s,n=[],i=e.sortList||[],h=i.length;for(a=0;a<h;a++)o=i[a][0],r=g.trim(e.$headerIndexed[o].attr(t.sort2Hash_headerTextAttr)),n.push(""!==r?encodeURIComponent(r):o),s=t.sort2Hash_directionText[i[a][1]],n.push(s);return n.join(t.sort2Hash_separator)},convertFilter2String:function(e,t){var a,r,o,s,n=[],i=e.sortList||[],h=i.length;for(a=0;a<h;a++)o=i[a][0],o=void 0!==(r=g.trim(e.$headerIndexed[o].attr(t.sort2Hash_headerTextAttr)))?encodeURIComponent(r):o,n.push(o),s=t.sort2Hash_directionText[i[a][1]],n.push(s);return n.join(t.sort2Hash_separator)},getParam:function(e,t,a){t=t||window.location.hash;var r=new RegExp("[\\?&]"+u.regexEscape(e)+"=([^&#]*)"),o=r.exec(t);return a?r:null===o?"":decodeURIComponent(o[1])},removeParam:function(e,t){t=t||window.location.hash;var a,r=u.getParam(e,t,!0),o=[],s=t.split("&"),n=s.length;for(a=0;a<n;a++)r.test("&"+s[a])||o.push(s[a]);return o.length?o.join("&"):""},encodeHash:function(e,t,a,r,o){var s=!1,n=u.getTableId(e,t);return"function"==typeof t.sort2Hash_encodeHash&&(s=t.sort2Hash_encodeHash(e,n,a,r,o||r)),!1===s&&(s="&"+a+"["+n+"]="+r),s},decodeHash:function(e,t,a){var r=!1,o=u.getTableId(e,t);return"function"==typeof t.sort2Hash_decodeHash&&(r=t.sort2Hash_decodeHash(e,o,a)),!1===r&&(r=u.getParam(a+"["+o+"]")),r||""},cleanHash:function(e,t,a,r){var o=!1,s=u.getTableId(e,t);return"function"==typeof t.sort2Hash_cleanHash&&(o=t.sort2Hash_cleanHash(e,s,a,r)),!1===o&&(o=u.removeParam(a+"["+s+"]",r)),o||""},setHash:function(a,r){var o="",s=window.location.hash,e=p.hasWidget(a.table,"pager"),t=p.hasWidget(a.table,"filter"),n=u.convertSort2String(a,r),i=t&&""!==a.lastSearch.join("")?a.lastSearch:[],h=encodeURIComponent(i.join(a.widgetOptions.sort2Hash_separator)),l={sort:n?u.encodeHash(a,r,"sort",n,a.sortList):"",page:e?u.encodeHash(a,r,"page",a.pager.page+1):"",size:e?u.encodeHash(a,r,"size",a.pager.size):"",filter:h?u.encodeHash(a,r,"filter",h,i):""};g.each(l,function(e,t){s=u.cleanHash(a,r,e,s),o+=t});var d=r.sort2Hash_hash,c=((window.location.hash||"").replace(d,"").length?s:d)+o;if(r.sort2Hash_replaceHistory){var H=window.location.href.split(d)[0];c[0]!==d&&(c=d+c),window.location.replace(H+c)}else window.location.hash=c}};p.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!1,sort2Hash_replaceHistory:!1,sort2Hash_tableId:null,sort2Hash_encodeHash:null,sort2Hash_decodeHash:null,sort2Hash_cleanHash:null},init:function(e,t,a,r){u.init(a,r)},remove:function(e,t){t.$table.off(".sort2hash")}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-sortTbodies.min.js b/web/_static/tablesorter/js/widgets/widget-sortTbodies.min.js
new file mode 100644
index 0000000..e7f5844
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-sortTbodies.min.js
@@ -0,0 +1,8 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! tablesorter tbody sorting widget (BETA) - 11/26/2016 (v2.28.0)
+ * Requires tablesorter v2.22.2+ and jQuery 1.4+
+ * by Rob Garrison
+ * Contributors: Chris Rogers
+ */
+!function(x){"use strict";var q=x.tablesorter;q.sortTbodies={init:function(o,r){var t,e,s,n,i,d=o.namespace+"sortTbody",a=o.$table.children("tbody"),b=a.length;for(r.sortTbody_original_serverSideSorting=o.serverSideSorting,r.sortTbody_original_cssInfoBlock=o.cssInfoBlock,o.cssInfoBlock=r.sortTbody_noSort,q.sortTbodies.setTbodies(o,r),t=0;t<b;t++)a.eq(t).attr("data-ts-original-order",t);for(o.$table.unbind("sortBegin updateComplete ".split(" ").join(d+" ")).bind("sortBegin"+d,function(){q.sortTbodies.sorter(o)}).bind("updateComplete"+d,function(){q.sortTbodies.setTbodies(o,r),q.updateCache(o,null,o.$tbodies)}).bind("sortEnd",function(){var t=r.sortTbody_primaryRow;r.sortTbody_lockHead&&t&&o.$table.find(t).each(function(){x(this).parents("tbody").prepend(this)})}),!x.isEmptyObject(o.parsers)&&o.$tbodies.length===a.length||(q.sortTbodies.setTbodies(o,r),q.updateCache(o,null,o.$tbodies)),b=(i=a.children("tr")).length,t=0;t<o.columns;t++){if(n=0,"numeric"===o.parsers[t].type)for(e=0;e<b;e++)s=q.getParsedText(o,i.eq(e).children()[t],t),n=Math.max(Math.abs(s)||0,n);o.$headerIndexed[t].attr("data-ts-col-max-value",n)}},setTbodies:function(t,o){t.$tbodies=t.$table.children("tbody").not("."+o.sortTbody_noSort)},sorter:function(m){var t=m.$table,o=m.widgetOptions;if(!0!==o.sortTbody_busy){o.sortTbody_busy=!0;var r=t.children("tbody").not("."+o.sortTbody_noSort),S=o.sortTbody_primaryRow||"tr:eq(0)",v=m.sortList||[],$=v.length;$&&(m.serverSideSorting=!o.sortTbody_sortRows,r.sort(function(t,o){var r,e,s,n,i,d,a,b,l,c,y,T=m.table,p=m.parsers,f=m.textSorter||"",u=x(t),g=x(o),h=u.find(S).children("td, th"),_=g.find(S).children("td, th");for(r=0;r<$;r++){if(a=v[r][0],s=0===v[r][1],e=q.getElementText(m,h.eq(a),a),b=p[a].format(e,T,h[a],a),e=q.getElementText(m,_.eq(a),a),l=p[a].format(e,T,_[a],a),m.sortStable&&b===l&&1===$)return u.attr("data-ts-original-order")-g.attr("data-ts-original-order");if(d=(n=/n/i.test(p&&p[a]&&p[a].type||""))&&m.strings[a]?(i=m.$headerIndexed[a].attr("data-ts-col-max-value")||179e306,n="boolean"==typeof q.string[m.strings[a]]?(s?1:-1)*(q.string[m.strings[a]]?-1:1):m.strings[a]&&q.string[m.strings[a]]||0,m.numberSorter?m.numberSorter(b,l,s,i,T):q["sortNumeric"+(s?"Asc":"Desc")](b,l,n,i,a,m)):(c=s?b:l,y=s?l:b,"function"==typeof f?f(c,y,s,a,T):"object"==typeof f&&f.hasOwnProperty(a)?f[a](c,y,s,a,T):q["sortNatural"+(s?"Asc":"Desc")](b,l,a,m)))return d}return u.attr("data-ts-original-order")-g.attr("data-ts-original-order")}),q.sortTbodies.restoreTbodies(m,o,r),o.sortTbody_busy=!1)}},restoreTbodies:function(t,o,r){var e,s,n,i,d,a,b,l=t.$table,c=!0,y=0;if(l.hide(),r.appendTo(l),i=(s=l.children("tbody")).length,d=(e=s.filter("."+o.sortTbody_noSort).appendTo(l)).length)for(;c&&y<d;){for(c=!1,a=0;a<d;a++)(b=i<=(b=parseInt(e.eq(a).attr("data-ts-original-order"),10))?i:b<0?0:b)!==e.eq(a).index()&&(c=!0,n=e.eq(a).detach(),i<=b?n.appendTo(l):0===b?n.prependTo(l):n.insertBefore(l.children("tbody:eq("+b+")")));y++}l.show()}},q.addWidget({id:"sortTbody",priority:40,options:{sortTbody_lockHead:!1,sortTbody_primaryRow:null,sortTbody_sortRows:!1,sortTbody_noSort:"tablesorter-no-sort-tbody"},init:function(t,o,r,e){q.sortTbodies.init(r,e)},remove:function(t,o,r){o.$table.unbind("sortBegin updateComplete ".split(" ").join(o.namespace+"sortTbody ")),o.serverSideSorting=r.sortTbody_original_serverSideSorting,o.cssInfoBlock=r.sortTbody_original_cssInfoBlock}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-staticRow.min.js b/web/_static/tablesorter/js/widgets/widget-staticRow.min.js
new file mode 100644
index 0000000..6aa4cbc
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-staticRow.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! widget: staticRow - updated 10/31/2015 (v2.24.0) */
+!function(p){"use strict";function s(t){var e,i,a,s,o,n=t.config;n&&(i=n.widgetOptions,n.$tbodies.each(function(){e=p(this).children(),o=e.length,e.filter(i.staticRow_class).each(function(){e=p(this),s=void 0!==(s=e.data(i.staticRow_index))?(a=parseFloat(s),/%/.test(s)?Math.round(a/100*o):a):e.index(),e.data(i.staticRow_data,s)})}))}var o=p.tablesorter;o.addWidget({id:"staticRow",options:{staticRow_class:".static",staticRow_data:"static-index",staticRow_index:"row-index",staticRow_event:"staticRowsRefresh"},init:function(t,e,i,a){s(t),i.$table.unbind(("updateComplete.tsstaticrows "+a.staticRow_event).replace(/\s+/g," ")).bind("updateComplete.tsstaticrows "+a.staticRow_event,function(){s(t),o.applyWidget(t)})},format:function(t,e,i){var a,s,o,n,c,d,r,l;e.$tbodies.each(function(){for(c=p.tablesorter.processTbody(t,p(this),!0),d=!0,o=0,r=c.children(i.staticRow_class),n=c.children("tr").length-1,l=r.length;d&&o<l;)d=!1,r.each(function(){a=p(this).data(i.staticRow_data),(a=n<=a?n:a<0?0:a)!==p(this).index()&&(d=!0,s=p(this).detach(),n<=a?s.appendTo(c):0===a?s.prependTo(c):s.insertBefore(c.find("tr:eq("+a+")")))}),o++;p.tablesorter.processTbody(t,c,!1)}),e.$table.triggerHandler("staticRowsComplete",t)},remove:function(t,e,i){e.$table.unbind(("updateComplete.tsstaticrows "+i.staticRow_event).replace(/\s+/g," "))}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-stickyHeaders.min.js b/web/_static/tablesorter/js/widgets/widget-stickyHeaders.min.js
new file mode 100644
index 0000000..f49c834
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-stickyHeaders.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: stickyHeaders - updated 9/27/2017 (v2.29.0) */
+!function(T,w){"use strict";var S=T.tablesorter||{};function x(e,s){var t=isNaN(s.stickyHeaders_offset)?T(s.stickyHeaders_offset):[];return t.length?t.height()||0:parseInt(s.stickyHeaders_offset,10)||0}T.extend(S.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyHide:"tablesorter-sticky-hidden",stickyWrap:"tablesorter-sticky-wrapper"}),S.addHeaderResizeEvent=function(e,s,t){if((e=T(e)[0]).config){var i=T.extend({},{timer:250},t),c=e.config,l=c.widgetOptions,r=function(e){var s,t,i,r,a,d,n=c.$headers.length;for(l.resize_flag=!0,t=[],s=0;s<n;s++)r=(i=c.$headers.eq(s)).data("savedSizes")||[0,0],a=i[0].offsetWidth,d=i[0].offsetHeight,a===r[0]&&d===r[1]||(i.data("savedSizes",[a,d]),t.push(i[0]));t.length&&!1!==e&&c.$table.triggerHandler("resize",[t]),l.resize_flag=!1};if(clearInterval(l.resize_timer),s)return l.resize_flag=!1;r(!1),l.resize_timer=setInterval(function(){l.resize_flag||r()},i.timer)}},S.addWidget({id:"stickyHeaders",priority:54,options:{stickyHeaders:"",stickyHeaders_appendTo:null,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(e,t,y){if(!(t.$table.hasClass("hasStickyHeaders")||0<=T.inArray("filter",t.widgets)&&!t.$table.hasClass("hasFilters"))){var s,i,r,a,k=t.$table,g=T(y.stickyHeaders_attachTo||y.stickyHeaders_appendTo),d=t.namespace+"stickyheaders ",H=T(y.stickyHeaders_yScroll||y.stickyHeaders_attachTo||w),n=T(y.stickyHeaders_xScroll||y.stickyHeaders_attachTo||w),c=k.children("thead:first").children("tr").not(".sticky-false").children(),u=k.children("tfoot"),l=x(0,y),b=k.parent().closest("."+S.css.table).hasClass("hasStickyHeaders")?k.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],_=b.length?b.height():0,o=y.$sticky=k.clone().addClass("containsStickyHeaders "+S.css.sticky+" "+y.stickyHeaders+" "+t.namespace.slice(1)+"_extra_table").wrap('<div class="'+S.css.stickyWrap+'">'),v=o.parent().addClass(S.css.stickyHide).css({position:g.length?"absolute":"fixed",padding:parseInt(o.parent().parent().css("padding-left"),10),top:l+_,left:0,visibility:"hidden",zIndex:y.stickyHeaders_zIndex||2}),p=o.children("thead:first"),m="",f=function(e,s){var t,i,r,a,d,n=e.filter(":visible"),c=n.length;for(t=0;t<c;t++)a=s.filter(":visible").eq(t),i="border-box"===(d=n.eq(t)).css("box-sizing")?d.outerWidth():"collapse"===a.css("border-collapse")?w.getComputedStyle?parseFloat(w.getComputedStyle(d[0],null).width):(r=parseFloat(d.css("border-width")),d.outerWidth()-parseFloat(d.css("padding-left"))-parseFloat(d.css("padding-right"))-r):d.width(),a.css({width:i,"min-width":i,"max-width":i})},z=function(e){return!1===e&&b.length?k.position().left:g.length?parseInt(g.css("padding-left"),10)||0:k.offset().left-parseInt(k.css("margin-left"),10)-T(w).scrollLeft()},C=function(){v.css({left:z(),width:k.outerWidth()}),f(k,o),f(c,a)},h=function(e){if(k.is(":visible")){_=b.length?b.offset().top-H.scrollTop()+b.height():0;var s,t=k.offset(),i=x(0,y),r=T.isWindow(H[0]),a=r?H.scrollTop():b.length?parseInt(b[0].style.top,10):H.offset().top,d=g.length?a:H.scrollTop(),n=y.stickyHeaders_includeCaption?0:k.children("caption").height()||0,c=d+i+_-n,l=k.height()-(v.height()+(u.height()||0))-n,o=c>t.top&&c<t.top+l?"visible":"hidden",p="visible"==o?S.css.stickyVis:S.css.stickyHide,f=!v.hasClass(p),h={visibility:o};g.length&&(f=!0,h.top=r?c-g.offset().top:g.scrollTop()),(s=z(r))!==parseInt(v.css("left"),10)&&(f=!0,h.left=s),h.top=(h.top||0)+(!r&&b.length?b.height():i+_),f&&v.removeClass(S.css.stickyVis+" "+S.css.stickyHide).addClass(p).css(h),o===m&&!e||(C(),m=o)}};if(g.length&&!g.css("position")&&g.css("position","relative"),o.attr("id")&&(o[0].id+=y.stickyHeaders_cloneId),o.find("> thead:gt(0), tr.sticky-false").hide(),o.find("> tbody, > tfoot").remove(),o.find("caption").toggle(y.stickyHeaders_includeCaption),a=p.children().children(),o.css({height:0,width:0,margin:0}),a.find("."+S.css.resizer).remove(),k.addClass("hasStickyHeaders").bind("pagerComplete"+d,function(){C()}),S.bindEvents(e,p.children().children("."+S.css.header)),y.stickyHeaders_appendTo?T(y.stickyHeaders_appendTo).append(v):k.after(v),t.onRenderHeader)for(i=(r=p.children("tr").children()).length,s=0;s<i;s++)t.onRenderHeader.apply(r.eq(s),[s,t,o]);n.add(H).unbind("scroll resize ".split(" ").join(d).replace(/\s+/g," ")).bind("scroll resize ".split(" ").join(d),function(e){h("resize"===e.type)}),t.$table.unbind("stickyHeadersUpdate"+d).bind("stickyHeadersUpdate"+d,function(){h(!0)}),y.stickyHeaders_addResizeEvent&&S.addHeaderResizeEvent(e),k.hasClass("hasFilters")&&y.filter_columnFilters&&(k.bind("filterEnd"+d,function(){var e=T(document.activeElement).closest("td"),s=e.parent().children().index(e);v.hasClass(S.css.stickyVis)&&y.stickyHeaders_filteredToTop&&(w.scrollTo(0,k.position().top),0<=s&&t.$filters&&t.$filters.eq(s).find("a, select, input").filter(":visible").focus())}),S.filter.bindSearch(k,a.find("."+S.css.filter)),y.filter_hideFilters&&S.filter.hideFilters(t,o)),y.stickyHeaders_addResizeEvent&&k.bind("resize"+t.namespace+"stickyheaders",function(){C()}),h(!0),k.triggerHandler("stickyHeadersInit")}},remove:function(e,s,t){var i=s.namespace+"stickyheaders ";s.$table.removeClass("hasStickyHeaders").unbind("pagerComplete resize filterEnd stickyHeadersUpdate ".split(" ").join(i).replace(/\s+/g," ")).next("."+S.css.stickyWrap).remove(),t.$sticky&&t.$sticky.length&&t.$sticky.remove(),T(w).add(t.stickyHeaders_xScroll).add(t.stickyHeaders_yScroll).add(t.stickyHeaders_attachTo).unbind("scroll resize ".split(" ").join(i).replace(/\s+/g," ")),S.addHeaderResizeEvent(e,!0)}})}(jQuery,window);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-storage.min.js b/web/_static/tablesorter/js/widgets/widget-storage.min.js
new file mode 100644
index 0000000..194d428
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-storage.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: storage - updated 2018-03-18 (v2.30.0) */
+!function(m,y,O){"use strict";var w=m.tablesorter||{};m.extend(!0,w.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),w.storage=function(e,t,r,o){var s,a,i,g=!1,n={},p=(e=m(e)[0]).config,l=p&&p.widgetOptions,d=w.debug(p,"storage"),u=(o&&o.storageType||l&&l.storage_storageType).toString().charAt(0).toLowerCase(),S=u?"":o&&o.useSessionStorage||l&&l.storage_useSessionStorage,c=m(e),_=o&&o.id||c.attr(o&&o.group||l&&l.storage_group||"data-table-group")||l&&l.storage_tableId||e.id||m(".tablesorter").index(c),f=o&&o.url||c.attr(o&&o.page||l&&l.storage_page||"data-table-page")||l&&l.storage_fixedUrl||p&&p.fixedUrl||y.location.pathname;if("c"!==u&&(u="s"===u||S?"sessionStorage":"localStorage")in y)try{y[u].setItem("_tmptest","temp"),g=!0,y[u].removeItem("_tmptest")}catch(e){console.warn(u+" is not supported in this browser")}if(d&&console.log("Storage >> Using",g?u:"cookies"),m.parseJSON&&(n=g?m.parseJSON(y[u][t]||"null")||{}:(a=O.cookie.split(/[;\s|=]/),0!==(s=m.inArray(t,a)+1)&&m.parseJSON(a[s]||"null")||{})),void 0===r||!y.JSON||!JSON.hasOwnProperty("stringify"))return n&&n[f]?n[f][_]:"";n[f]||(n[f]={}),n[f][_]=r,g?y[u][t]=JSON.stringify(n):((i=new Date).setTime(i.getTime()+31536e6),O.cookie=t+"="+JSON.stringify(n).replace(/\"/g,'"')+"; expires="+i.toGMTString()+"; path=/")}}(jQuery,window,document);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-toggle.min.js b/web/_static/tablesorter/js/widgets/widget-toggle.min.js
new file mode 100644
index 0000000..ebf76ab
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-toggle.min.js
@@ -0,0 +1,7 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! tablesorter enable/disable sort & filter (BETA) - 11/10/2015 (v2.24.4)
+ * Requires tablesorter v2.24.4+ & jQuery 1.7+
+ * by Rob Garrison
+ */
+!function(){"use strict";var g=jQuery.tablesorter,s=g.toggleTS={init:function(e,l){l.toggleTS_isEnabled=!0,l.toggleTS_areDisabled={headers:[],filters:[]},e.$table.on("enable.toggleTS disable.toggleTS",function(e){s.toggle(this.config,this.config.widgetOptions,"enable"===e.type)})},toggle:function(e,l,t){if(l.toggleTS_isEnabled!==t){l.toggleTS_isEnabled=t;var i,s,o=e.$headers.length;for(i=0;i<o;i++)s=e.$headers.eq(i),g.setColumnSort(e,s,!t),g.setColumnAriaLabel(e,s,t);if(l.toggleTS_hideFilterRow)e.$table.find("."+g.css.filterRow).toggle(t);else if(g.hasWidget(e.$table,"filter"))for(o=e.$filters.length,i=0;i<o;i++)t&&!l.toggleTS_areDisabled.filters[i]?e.$filters.eq(i).find("input, select").removeClass(g.css.filterDisabled).prop("disabled",!1):t||((s=e.$filters.eq(i).find("input, select")).hasClass(g.css.filterDisabled)&&(l.toggleTS_areDisabled.filters[i]=!0),s.addClass(g.css.filterDisabled).prop("disabled",!0));l.filter_$externalFilters.toggleClass(g.css.filterDisabled,t).prop("disabled",!t)}"function"==typeof l.toggleTS_callback&&l.toggleTS_callback(e,t)}};g.addWidget({id:"toggle-ts",options:{toggleTS_hideFilterRow:!1,toggleTS_callback:null},init:function(e,l,t,i){s.init(t,i)},remove:function(e,l){l.$table.off("enable.toggleTS disable.toggleTS")}})}();return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-uitheme.min.js b/web/_static/tablesorter/js/widgets/widget-uitheme.min.js
new file mode 100644
index 0000000..f7f0457
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-uitheme.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
+!function(A){"use strict";var N=A.tablesorter||{};N.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"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 ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},A.extend(N.css,{wrapper:"tablesorter-wrapper"}),N.addWidget({id:"uitheme",priority:10,format:function(e,o,t){var s,r,i,a,n,c,l,d,h,m,u,p,v,f=N.themes,b=o.$table.add(A(o.namespace+"_extra_table")),C=o.$headers.add(A(o.namespace+"_extra_headers")),w=o.theme||"jui",S=f[w]||{},g=A.trim([S.sortNone,S.sortDesc,S.sortAsc,S.active].join(" ")),j=A.trim([S.iconSortNone,S.iconSortDesc,S.iconSortAsc].join(" ")),D=N.debug(o,"uitheme");for(D&&(n=new Date),b.hasClass("tablesorter-"+w)&&o.theme===o.appliedTheme&&t.uitheme_applied||(t.uitheme_applied=!0,m=f[o.appliedTheme]||{},u=(v=!A.isEmptyObject(m))?[m.sortNone,m.sortDesc,m.sortAsc,m.active].join(" "):"",p=v?[m.iconSortNone,m.iconSortDesc,m.iconSortAsc].join(" "):"",v&&(t.zebra[0]=A.trim(" "+t.zebra[0].replace(" "+m.even,"")),t.zebra[1]=A.trim(" "+t.zebra[1].replace(" "+m.odd,"")),o.$tbodies.children().removeClass([m.even,m.odd].join(" "))),S.even&&(t.zebra[0]+=" "+S.even),S.odd&&(t.zebra[1]+=" "+S.odd),b.children("caption").removeClass(m.caption||"").addClass(S.caption),d=b.removeClass((o.appliedTheme?"tablesorter-"+(o.appliedTheme||""):"")+" "+(m.table||"")).addClass("tablesorter-"+w+" "+(S.table||"")).children("tfoot"),o.appliedTheme=o.theme,d.length&&d.children("tr").removeClass(m.footerRow||"").addClass(S.footerRow).children("th, td").removeClass(m.footerCells||"").addClass(S.footerCells),C.removeClass((v?[m.header,m.hover,u].join(" "):"")||"").addClass(S.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(e){A(this)["mouseenter"===e.type?"addClass":"removeClass"](S.hover||"")}),C.each(function(){var e=A(this);e.find("."+N.css.wrapper).length||e.wrapInner('<div class="'+N.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),o.cssIcon&&C.find("."+N.css.icon).removeClass(v?[m.icons,p].join(" "):"").addClass(S.icons||""),N.hasWidget(o.table,"filter")&&(r=function(){b.children("thead").children("."+N.css.filterRow).removeClass(v&&m.filterRow||"").addClass(S.filterRow||"")},t.filter_initialized?r():b.one("filterInit",function(){r()}))),s=0;s<o.columns;s++)c=o.$headers.add(A(o.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+s+'"]'),l=N.css.icon?c.find("."+N.css.icon):A(),(h=C.not(".sorter-false").filter('[data-column="'+s+'"]:last')).length&&(c.removeClass(g),l.removeClass(j),h[0].sortDisabled?l.removeClass(S.icons||""):(i=S.sortNone,a=S.iconSortNone,h.hasClass(N.css.sortAsc)?(i=[S.sortAsc,S.active].join(" "),a=S.iconSortAsc):h.hasClass(N.css.sortDesc)&&(i=[S.sortDesc,S.active].join(" "),a=S.iconSortDesc),c.addClass(i),l.addClass(a||"")));D&&console.log("uitheme >> Applied "+w+" theme"+N.benchmark(n))},remove:function(e,o,t,s){if(t.uitheme_applied){var r=o.$table,i=o.appliedTheme||"jui",a=N.themes[i]||N.themes.jui,n=r.children("thead").children(),c=a.sortNone+" "+a.sortDesc+" "+a.sortAsc,l=a.iconSortNone+" "+a.iconSortDesc+" "+a.iconSortAsc;r.removeClass("tablesorter-"+i+" "+a.table),t.uitheme_applied=!1,s||(r.find(N.css.header).removeClass(a.header),n.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(a.hover+" "+c+" "+a.active).filter("."+N.css.filterRow).removeClass(a.filterRow),n.find("."+N.css.icon).removeClass(a.icons+" "+l))}}})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-vertical-group.min.js b/web/_static/tablesorter/js/widgets/widget-vertical-group.min.js
new file mode 100644
index 0000000..cffa626
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-vertical-group.min.js
@@ -0,0 +1,4 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+/*! Widget: vertical-group (BETA) - updated 12/13/2017 (v2.29.1) */
+!function(h){"use strict";var G=h.tablesorter,f=G.css;function g(r){r.removeClass(f.verticalGroupHide+" "+f.verticalGroupShow)}function C(r,e,a){e.parent().removeClass(r.zebra[(a+1)%2]).addClass(r.zebra[a%2])}function r(r,e,a){var o=-1,i=r.tBodies[0].rows,t=G.hasWidget(r,"zebra"),l=[],s=[];if(!a.vertical_group_lock){if(a.vertical_group_lock=!0,""===(l=h.map(e.$headerIndexed,function(r){return r.hasClass(f.verticalGroupHeader)?1:""})).join(""))return g(h(i).find("."+f.verticalGroupHide+",."+f.verticalGroupShow)),void(a.vertical_group_lock=!1);for(var c=0;c<i.length;c++)for(var u=!1,v=0;v<e.columns;v++)if(l[v]&&i[c].cells[v]){var d=h(i[c].cells[v]),p=G.isValueInArray(v,e.sortList),n=d.html();p<0?g(d):u||n!==s[v]?0===p&&(u=!0,d.hasClass(f.verticalGroupShow)||d.addClass(f.verticalGroupShow),d.removeClass(f.verticalGroupHide),t&&C(a,d,p?o:++o)):(d.hasClass(f.verticalGroupHide)||d.addClass(f.verticalGroupHide),t&&C(a,d,o),d.removeClass(f.verticalGroupShow)),s[v]=n}else o++;a.vertical_group_lock=!1}}h.extend(G.css,{verticalGroupHeader:"tablesorter-vertical-group",verticalGroupHide:"tablesorter-vertical-group-hide",verticalGroupShow:"tablesorter-vertical-group-show"}),G.addWidget({id:"vertical-group",priority:99,init:r,format:r})}(jQuery);return jQuery;}));
diff --git a/web/_static/tablesorter/js/widgets/widget-view.min.js b/web/_static/tablesorter/js/widgets/widget-view.min.js
new file mode 100644
index 0000000..f66dadc
--- /dev/null
+++ b/web/_static/tablesorter/js/widgets/widget-view.min.js
@@ -0,0 +1,3 @@
+(function(factory){if (typeof define === 'function' && define.amd){define(['jquery'], factory);} else if (typeof module === 'object' && typeof module.exports === 'object'){module.exports = factory(require('jquery'));} else {factory(jQuery);}}(function(jQuery){
+
+!function(r){"use strict";var i,a,o,n=r.tablesorter,l=!1,c=n.view={copyCaption:function(e,t){c.removeCaption(e,t),0<e.$table.find("caption").length&&r(t.view_caption).text(e.$table.find("caption").text())},removeCaption:function(e,t){r(t.view_caption).empty()},buildToolBar:function(t,o){c.removeToolBar(t,o),c.copyCaption(t,o);var n=r(o.view_toolbar);r.each(o.view_layouts,function(e,t){var i=o.view_switcher_class;e===o.view_layout&&(i+=" active");var a=r("<a>",{href:"#","class":i,"data-view-type":e,title:t.title});a.append(r("<i>",{"class":t.icon})),n.append(a)}),n.find("."+o.view_switcher_class).on("click",function(e){if(e.preventDefault(),r(this).hasClass("active"))return!1;n.find("."+o.view_switcher_class).removeClass("active"),r(this).addClass("active"),o.view_layout=r(this).attr("data-view-type"),!0===o.view_layouts[o.view_layout].raw?(c.remove(t,o),c.buildToolBar(t,o)):(!1===l&&c.hideTable(t,o),c.buildView(t,o))})},removeToolBar:function(e,t){r(t.view_toolbar).empty(),c.removeCaption(e,t)},buildView:function(e,t){c.removeView(e,t);var a=t.view_layouts[t.view_layout],o=r(a.container,{"class":t.view_layout});n.getColumnText(e.$table,0,function(e){var l=a.tmpl;r.each(r(e.$row).find("td"),function(e,t){var i={},a="{col"+e+"}";r.each(t.attributes,function(e,t){i[t.nodeName]=t.nodeValue});var o=r(t).html(),n=r("<span />").append(r("<span/>",i).append(o));l=l.replace(new RegExp(a,"g"),n.html()),a="{col"+e+":raw}",l=l.replace(new RegExp(a,"g"),r(t).text())});var i=r(l);r.each(e.$row[0].attributes,function(e,t){"class"===t.nodeName?i.attr(t.nodeName,i.attr(t.nodeName)+" "+t.nodeValue):i.attr(t.nodeName,t.nodeValue)}),o.append(i)}),r(t.view_container).append(o),e.$table.triggerHandler("viewComplete")},removeView:function(e,t){r(t.view_container).empty()},hideTable:function(e){i=e.$table.css("position"),a=e.$table.css("bottom"),o=e.$table.css("left"),e.$table.css({position:"absolute",top:"-10000px",left:"-10000px"}),l=!0},init:function(e,t){!1!==t.view_layout&&void 0!==t.view_layouts[t.view_layout]&&(!1===l&&c.hideTable(e,t),e.$table.on("tablesorter-ready",function(){c.buildToolBar(e,t),c.buildView(e,t)}))},remove:function(e,t){c.removeToolBar(e,t),c.removeView(e,t),e.$table.css({position:i,top:a,left:o}),l=!1}};n.addWidget({id:"view",options:{view_toolbar:"#ts-view-toolbar",view_container:"#ts-view",view_caption:"#ts-view-caption",view_switcher_class:"ts-view-switcher",view_layout:!1,view_layouts:{}},init:function(e,t,i,a){c.init(i,a)},remove:function(e,t,i){c.remove(t,i)}})}(jQuery);return jQuery;}));