/*! * TableSorter (FORK) 2.19.0 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach; fork maintained by Rob Garrison */ (function(h){"function"===typeof define&&define.amd?define(["jquery"],h):"object"===typeof module&&"object"===typeof module.exports?module.exports=h(require("jquery")):h(jQuery)})(function(h){h.extend({tablesorter:new function(){function f(){var b=arguments[0],a=1':"";q.$headers=h(h.map(h(b).find(q.selectorHeaders),function(k,f){d=h(k);if(!d.parent().hasClass(q.cssIgnoreRow))return a=g.getColumnData(b,q.headers,f,!0),q.headerContent[f]=d.html(),""===q.headerTemplate||d.find("."+g.css.headerIn).length||(l=q.headerTemplate.replace(/\{content\}/g,d.html()).replace(/\{icon\}/g,d.find("."+g.css.icon).length?"":c),q.onRenderTemplate&&(e=q.onRenderTemplate.apply(d,[f,l]))&&"string"===typeof e&&(l=e),d.html('
'+l+"
")),q.onRenderHeader&& q.onRenderHeader.apply(d,[f,q,q.$table]),k.column=parseInt(d.attr("data-column"),10),k.order=F(g.getData(d,a,"sortInitialOrder")||q.sortInitialOrder)?[1,0,2]:[0,1,2],k.count=-1,k.lockedOrder=!1,u=g.getData(d,a,"lockedOrder")||!1,"undefined"!==typeof u&&!1!==u&&(k.order=k.lockedOrder=F(u)?[1,1,1]:[0,0,0]),d.addClass(g.css.header+" "+q.cssHeader),q.headerList[f]=k,d.parent().addClass(g.css.headerRow+" "+q.cssHeaderRow).attr("role","row"),q.tabIndex&&d.attr("tabindex",0),k}));h(b).find(q.selectorHeaders).attr({scope:"col", role:"columnheader"});H(b);q.debug&&(y("Built headers:",k),f(q.$headers))}function I(b,a,d){var e=b.config;e.$table.find(e.selectorRemove).remove();p(b);x(b);J(e,a,d)}function H(b){var a,d,e,c=b.config;c.$headers.each(function(l,f){d=h(f);e=g.getColumnData(b,c.headers,l,!0);a="false"===g.getData(f,e,"sorter")||"false"===g.getData(f,e,"parser");f.sortDisabled=a;d[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?d.removeAttr("aria-controls"):d.attr("aria-controls",b.id))})} function G(b){var a,d,e=b.config,c=e.sortList,l=c.length,f=g.css.sortNone+" "+e.cssNone,k=[g.css.sortAsc+" "+e.cssAsc,g.css.sortDesc+" "+e.cssDesc],q=[e.cssIconAsc,e.cssIconDesc,e.cssIconNone],n=["ascending","descending"],m=h(b).find("tfoot tr").children().add(e.$extraHeaders).removeClass(k.join(" "));e.$headers.removeClass(k.join(" ")).addClass(f).attr("aria-sort","none").find("."+e.cssIcon).removeClass(q.join(" ")).addClass(q[2]);for(a=0;ae&&(k.sortList.push([c,e]),1e&&(k.sortList.push([c,e]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.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",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"};g.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"};g.log=f;g.benchmark=y;g.construct=function(b){return this.each(function(){var a= h.extend(!0,{},g.defaults,b);a.originalSettings=b;!this.hasInitialized&&g.buildTable&&"TABLE"!==this.tagName?g.buildTable(this,a):g.setup(this,a)})};g.setup=function(b,a){if(!b||!b.tHead||0===b.tBodies.length||!0===b.hasInitialized)return a.debug?f("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var d="",e=h(b),c=h.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config=a;h.data(b,"tablesorter",a);a.debug&&h.data(b,"startoveralltimer",new Date); a.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),a=e.$table.width(),h(b.tBodies).not("."+e.cssInfoBlock).find("tr:first").children(":visible").each(function(){d=parseInt(h(this).width()/a*1E3,10)/10+"%";c.append(h("").css("width",d))}),e.$table.prepend(c))};g.getColumnData=function(b,a,d,e,c){if("undefined"!==typeof a&&null!==a){b=h(b)[0];var g;b=b.config;c=c||b.$headers;if(a[d])return e?a[d]:a[c.index(c.filter('[data-column="'+ d+'"]:last'))];for(g in a)if("string"===typeof g&&(e=c.filter('[data-column="'+d+'"]:last').filter(g).add(c.filter('[data-column="'+d+'"]:last').find(g)),e.length))return a[g]}};g.computeColumnIndex=function(b){var a=[],d=0,e,c,g,f,k,q,n,m,t,p;for(e=0;e'),d=h.fn.detach?a.detach():a.remove();d=h(b).find("span.tablesorter-savemyplace");a.insertAfter(d);d.remove();b.isProcessing=!1};g.clearTableBody=function(b){h(b)[0].config.$tbodies.children().detach()};g.bindEvents=function(b,a,d){b=h(b)[0];var e,c=b.config;!0!==d&&(c.$extraHeaders=c.$extraHeaders?c.$extraHeaders.add(a):a);a.find(c.selectorSort).add(a.filter(c.selectorSort)).unbind(["mousedown", "mouseup","sort","keyup",""].join(c.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(c.namespace+" "),function(d,g){var f;f=d.type;if(!(1!==(d.which||d.button)&&!/sort|keyup/.test(f)||"keyup"===f&&13!==d.which||"mouseup"===f&&!0!==g&&250<(new Date).getTime()-e)){if("mousedown"===f)return e=(new Date).getTime(),/(input|select|button|textarea)/i.test(d.target.tagName)||h(d.target).closest("td,th").hasClass(c.cssAllowClicks)?"":!c.cancelSelection;c.delayInit&&m(c.cache)&&x(b);f=h.fn.closest? h(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:h(this).parents("th, td")[0];f=c.$headers[a.index(f)];f.sortDisabled||O(b,f,d)}});c.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};g.restoreHeaders=function(b){var a,d=h(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){a=h(this);a.find("."+g.css.headerIn).length&&a.html(d.headerContent[b])})};g.destroy=function(b,a,d){b=h(b)[0];if(b.hasInitialized){g.removeWidget(b, !0,!1);var e=h(b),c=b.config,f=e.find("thead:first"),m=f.find("tr."+g.css.headerRow).removeClass(g.css.headerRow+" "+c.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");!1===a&&0<=h.inArray("uitheme",c.widgets)&&(e.trigger("applyWidgetId",["uitheme"]),e.trigger("applyWidgetId",["zebra"]));f.find("tr").not(m).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(c.namespace+ " "));c.$headers.add(k).removeClass([g.css.header,c.cssHeader,c.cssAsc,c.cssDesc,g.css.sortAsc,g.css.sortDesc,g.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");m.find(c.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(c.namespace+" "));g.restoreHeaders(b);e.toggleClass(g.css.table+" "+c.tableClass+" tablesorter-"+c.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof d&&d(b)}};g.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};g.sortNatural=function(b,a){if(b===a)return 0;var d,e,c,f,h,k;e=g.regex;if(e.hex.test(a)){d=parseInt(b.match(e.hex),16);c=parseInt(a.match(e.hex),16);if(dc)return 1}d=b.replace(e.chunk,"\\0$1\\0").replace(e.chunks,"").split("\\0");e=a.replace(e.chunk,"\\0$1\\0").replace(e.chunks,"").split("\\0");k=Math.max(d.length,e.length);for(h=0;hf)return 1}return 0};g.sortNaturalAsc=function(b,a,d,e,c){if(b===a)return 0;d=c.string[c.empties[d]||c.emptyTo];return""===b&&0!==d?"boolean"===typeof d?d?-1:1:-d||-1:""===a&&0!==d?"boolean"===typeof d?d?1:-1:d||1:g.sortNatural(b,a)};g.sortNaturalDesc=function(b,a,d,e,c){if(b===a)return 0;d=c.string[c.empties[d]||c.emptyTo];return""===b&&0!==d?"boolean"===typeof d?d?-1:1:d||1:""===a&&0!==d?"boolean"===typeof d?d? 1:-1:-d||-1:g.sortNatural(a,b)};g.sortText=function(b,a){return b>a?1:bh.inArray(d.id,e))&&c.push(d.id)});g.removeWidget(b,c.join(","),!0);!0!==d?(g.applyWidget(b,a||!1,f),a&&g.applyWidget(b,!1,f)):f(b)};g.getData=function(b,a,d){var e="";b=h(b);var c,f;if(!b.length)return"";c=h.metadata?b.metadata():!1;f=" "+(b.attr("class")|| "");"undefined"!==typeof b.data(d)||"undefined"!==typeof b.data(d.toLowerCase())?e+=b.data(d)||b.data(d.toLowerCase()):c&&"undefined"!==typeof c[d]?e+=c[d]:a&&"undefined"!==typeof a[d]?e+=a[d]:" "!==f&&f.match(" "+d+"-")&&(e=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||"");return h.trim(e)};g.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var d;b=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."); /^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1"));d=parseFloat(b);return isNaN(d)?h.trim(b):d};g.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=h.tablesorter;h.fn.extend({tablesorter:p.construct});p.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"});p.addParser({id:"text",is:function(){return!0},format:function(f,y){var m=y.config;f&&(f=h.trim(m.ignoreCase?f.toLocaleLowerCase(): f),f=m.sortLocaleCompare?p.replaceAccents(f):f);return f},type:"text"});p.addParser({id:"digit",is:function(f){return p.isDigit(f)},format:function(f,y){var m=p.formatFloat((f||"").replace(/[^\w,. \-()]/g,""),y);return f&&"number"===typeof m?m:f?h.trim(f&&y.config.ignoreCase?f.toLocaleLowerCase():f):f},type:"numeric"});p.addParser({id:"currency",is:function(f){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((f||"").replace(/[+\-,. ]/g,""))},format:function(f, y){var m=p.formatFloat((f||"").replace(/[^\w,. \-()]/g,""),y);return f&&"number"===typeof m?m:f?h.trim(f&&y.config.ignoreCase?f.toLocaleLowerCase():f):f},type:"numeric"});p.addParser({id:"url",is:function(f){return/^(https?|ftp|file):\/\//.test(f)},format:function(f){return f?h.trim(f.replace(/(https?|ftp|file):\/\//,"")):f},parsed:!0,type:"text"});p.addParser({id:"isoDate",is:function(f){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(f)},format:function(f,h){var m=f?new Date(f.replace(/-/g,"/")): f;return m instanceof Date&&isFinite(m)?m.getTime():f},type:"numeric"});p.addParser({id:"percent",is:function(f){return/(\d\s*?%|%\s*?\d)/.test(f)&&15>f.length},format:function(f,h){return f?p.formatFloat(f.replace(/%/g,""),h):f},type:"numeric"});p.addParser({id:"image",is:function(f,h,m,p){return 0