/*! * TableSorter (FORK) 2.18.2 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach; fork maintained by Rob Garrison */ !function(h){h.extend({tablesorter:new function(){function f(){var b=arguments[0],a=1':"";n.$headers=h(b).find(n.selectorHeaders).each(function(k){c=h(this);a=g.getColumnData(b,n.headers,k,!0);n.headerContent[k]=h(this).html();""!==n.headerTemplate&&(l=n.headerTemplate.replace(/\{content\}/g,h(this).html()).replace(/\{icon\}/g, d),n.onRenderTemplate&&(e=n.onRenderTemplate.apply(c,[k,l]))&&"string"===typeof e&&(l=e),h(this).html('
'+l+"
"));n.onRenderHeader&&n.onRenderHeader.apply(c,[k,n,n.$table]);this.column=parseInt(h(this).attr("data-column"),10);this.order=E(g.getData(c,a,"sortInitialOrder")||n.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;w=g.getData(c,a,"lockedOrder")||!1;"undefined"!==typeof w&&!1!==w&&(this.order=this.lockedOrder=E(w)?[1,1,1]:[0,0,0]);c.addClass(g.css.header+ " "+n.cssHeader);n.headerList[k]=this;c.parent().addClass(g.css.headerRow+" "+n.cssHeaderRow).attr("role","row");n.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});G(b);n.debug&&(t("Built headers:",k),f(n.$headers))}function H(b,a,c){var e=b.config;e.$table.find(e.selectorRemove).remove();q(b);z(b);I(e.$table,a,c)}function G(b){var a,c,e,d=b.config;d.$headers.each(function(l,f){c=h(f);e=g.getColumnData(b,d.headers,l,!0);a="false"===g.getData(f,e,"sorter")||"false"===g.getData(f, e,"parser");f.sortDisabled=a;c[a?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+a);b.id&&(a?c.removeAttr("aria-controls"):c.attr("aria-controls",b.id))})}function F(b){var a,c,e=b.config,d=e.sortList,l=d.length,f=g.css.sortNone+" "+e.cssNone,k=[g.css.sortAsc+" "+e.cssAsc,g.css.sortDesc+" "+e.cssDesc],n=["ascending","descending"],p=h(b).find("tfoot tr").children().add(e.$extraHeaders).removeClass(k.join(" "));e.$headers.removeClass(k.join(" ")).addClass(f).attr("aria-sort","none"); for(a=0;a"),c=h(b).width(),h(b.tBodies).not("."+e.cssInfoBlock).find("tr:first").children(":visible").each(function(){a.append(h("").css("width",parseInt(h(this).width()/c*1E3,10)/10+"%"))}),e.$table.prepend(a))}function Q(b,a){var c,e,d,l,g,k=b.config,f=a||k.sortList;k.sortList= [];h.each(f,function(b,a){l=parseInt(a[0],10);if(d=k.$headers.filter('[data-column="'+l+'"]:last')[0]){e=(e=(""+a[1]).match(/^(1|d|s|o|n)/))?e[0]:"";switch(e){case "1":case "d":e=1;break;case "s":e=g||0;break;case "o":c=d.order[(g||0)%(k.sortReset?3:2)];e=0===c?1:1===c?0:2;break;case "n":d.count+=1;e=d.order[d.count%(k.sortReset?3:2)];break;default:e=0}g=0===b?e:g;c=[l,parseInt(e,10)||0];k.sortList.push(c);e=h.inArray(c[1],d.order);d.count=0<=e?e:c[1]%(k.sortReset?3:2)}})}function R(b,a){return b&& b[a]?b[a].type||"":""}function M(b,a,c){if(b.isUpdating)return setTimeout(function(){M(b,a,c)},50);var e,d,l,f,k=b.config,n=!c[k.sortMultiSortKey],p=k.$table;p.trigger("sortStart",b);a.count=c[k.sortResetKey]?2:(a.count+1)%(k.sortReset?3:2);k.sortRestart&&(d=a,k.$headers.each(function(){this===d||!n&&h(this).is("."+g.css.sortDesc+",."+g.css.sortAsc)||(this.count=-1)}));d=parseInt(h(a).attr("data-column"),10);if(n){k.sortList=[];if(null!==k.sortForce)for(e=k.sortForce,l=0;le&&(k.sortList.push([d,e]),1e&&(k.sortList.push([d,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",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=t;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 c="",e=h(b),d=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'),c=h.fn.detach?a.detach():a.remove();c=h(b).find("span.tablesorter-savemyplace");a.insertAfter(c);c.remove();b.isProcessing=!1};g.clearTableBody=function(b){h(b)[0].config.$tbodies.children().detach()};g.bindEvents=function(b,a,c){b=h(b)[0];var e,d=b.config;!0!== c&&(d.$extraHeaders=d.$extraHeaders?d.$extraHeaders.add(a):a);a.find(d.selectorSort).add(a.filter(d.selectorSort)).unbind(["mousedown","mouseup","sort","keyup",""].join(d.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(d.namespace+" "),function(c,g){var f;f=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(f)||"keyup"===f&&13!==c.which||"mouseup"===f&&!0!==g&&250<(new Date).getTime()-e)){if("mousedown"===f)return e=(new Date).getTime(),/(input|select|button|textarea)/i.test(c.target.tagName)|| h(c.target).closest("td,th").hasClass(d.cssAllowClicks)?"":!d.cancelSelection;d.delayInit&&m(d.cache)&&z(b);f=h.fn.closest?h(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:h(this).parents("th, td")[0];f=d.$headers[a.index(f)];f.sortDisabled||M(b,f,c)}});d.cancelSelection&&a.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};g.restoreHeaders=function(b){var a=h(b)[0].config;a.$table.find(a.selectorHeaders).each(function(b){h(this).find("."+ g.css.headerIn).length&&h(this).html(a.headerContent[b])})};g.destroy=function(b,a,c){b=h(b)[0];if(b.hasInitialized){g.refreshWidgets(b,!0,!0);var e=h(b),d=b.config,f=e.find("thead:first"),m=f.find("tr."+g.css.headerRow).removeClass(g.css.headerRow+" "+d.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");!1===a&&0<=h.inArray("uitheme",d.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(d.namespace+ " "));d.$headers.add(k).removeClass([g.css.header,d.cssHeader,d.cssAsc,d.cssDesc,g.css.sortAsc,g.css.sortDesc,g.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");m.find(d.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(d.namespace+" "));g.restoreHeaders(b);e.toggleClass(g.css.table+" "+d.tableClass+" tablesorter-"+d.theme,!1===a);b.hasInitialized=!1;delete b.config.cache;"function"===typeof c&&c(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 c,e,d,f,h,k;e=g.regex;if(e.hex.test(a)){c=parseInt(b.match(e.hex),16);d=parseInt(a.match(e.hex),16);if(cd)return 1}c=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(c.length,e.length);for(h=0;hf)return 1}return 0};g.sortNaturalAsc=function(b,a,c,e,d){if(b===a)return 0;c=d.string[d.empties[c]||d.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===a&&0!==c?"boolean"===typeof c?c?1:-1:c||1:g.sortNatural(b,a)};g.sortNaturalDesc=function(b,a,c,e,d){if(b===a)return 0;c=d.string[d.empties[c]||d.emptyTo];return""===b&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===a&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:g.sortNatural(a,b)};g.sortText=function(b,a){return b>a?1:bh.inArray(m[e].id,l))&&(d.debug&&f('Refeshing widgets: Removing "'+m[e].id+'"'),m[e].hasOwnProperty("remove")&&d.widgetInit[m[e].id]&&(m[e].remove(b,d,d.widgetOptions),d.widgetInit[m[e].id]=!1));!0!==c&&g.applyWidget(b,a)};g.getData=function(b, a,c){var e="";b=h(b);var d,f;if(!b.length)return"";d=h.metadata?b.metadata():!1;f=" "+(b.attr("class")||"");"undefined"!==typeof b.data(c)||"undefined"!==typeof b.data(c.toLowerCase())?e+=b.data(c)||b.data(c.toLowerCase()):d&&"undefined"!==typeof d[c]?e+=d[c]:a&&"undefined"!==typeof a[c]?e+=a[c]:" "!==f&&f.match(" "+c+"-")&&(e=f.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return h.trim(e)};g.formatFloat=function(b,a){if("string"!==typeof b||""===b)return b;var c;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"));c=parseFloat(b);return isNaN(c)?h.trim(b):c};g.isDigit=function(b){return isNaN(b)?/^[\-+(]?\d+[)]?$/.test(b.toString().replace(/[,.'"\s]/g,"")):!0}}});var q=h.tablesorter;h.fn.extend({tablesorter:q.construct});q.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"});q.addParser({id:"text",is:function(){return!0}, format:function(f,t){var m=t.config;f&&(f=h.trim(m.ignoreCase?f.toLocaleLowerCase():f),f=m.sortLocaleCompare?q.replaceAccents(f):f);return f},type:"text"});q.addParser({id:"digit",is:function(f){return q.isDigit(f)},format:function(f,t){var m=q.formatFloat((f||"").replace(/[^\w,. \-()]/g,""),t);return f&&"number"===typeof m?m:f?h.trim(f&&t.config.ignoreCase?f.toLocaleLowerCase():f):f},type:"numeric"});q.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,t){var m=q.formatFloat((f||"").replace(/[^\w,. \-()]/g,""),t);return f&&"number"===typeof m?m:f?h.trim(f&&t.config.ignoreCase?f.toLocaleLowerCase():f):f},type:"numeric"});q.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"});q.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"});q.addParser({id:"percent",is:function(f){return/(\d\s*?%|%\s*?\d)/.test(f)&&15>f.length},format:function(f,h){return f?q.formatFloat(f.replace(/%/g,""),h):f},type:"numeric"});q.addParser({id:"image",is:function(f,h,m,q){return 0