/*! * TableSorter 2.17.7 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ !function(h){h.extend({tablesorter:new function(){function d(){var a=arguments[0],b=1':"";p.$headers=h(a).find(p.selectorHeaders).each(function(k){c=h(this);b=f.getColumnData(a,p.headers,k,!0);p.headerContent[k]=h(this).html();l=p.headerTemplate.replace(/\{content\}/g,h(this).html()).replace(/\{icon\}/g,e);p.onRenderTemplate&&(g=p.onRenderTemplate.apply(c, [k,l]))&&"string"===typeof g&&(l=g);h(this).html('
'+l+"
");p.onRenderHeader&&p.onRenderHeader.apply(c,[k]);this.column=parseInt(h(this).attr("data-column"),10);this.order=D(f.getData(c,b,"sortInitialOrder")||p.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;x=f.getData(c,b,"lockedOrder")||!1;"undefined"!==typeof x&&!1!==x&&(this.order=this.lockedOrder=D(x)?[1,1,1]:[0,0,0]);c.addClass(f.css.header+" "+p.cssHeader);p.headerList[k]=this;c.parent().addClass(f.css.headerRow+ " "+p.cssHeaderRow).attr("role","row");p.tabIndex&&c.attr("tabindex",0)}).attr({scope:"col",role:"columnheader"});C(a);p.debug&&(q("Built headers:",k),d(p.$headers))}function F(a,b,c){var g=a.config;g.$table.find(g.selectorRemove).remove();v(a);w(a);I(g.$table,b,c)}function C(a){var b,c,g,e=a.config;e.$headers.each(function(l,d){c=h(d);g=f.getColumnData(a,e.headers,l,!0);b="false"===f.getData(d,g,"sorter")||"false"===f.getData(d,g,"parser");d.sortDisabled=b;c[b?"addClass":"removeClass"]("sorter-false").attr("aria-disabled", ""+b);a.id&&(b?c.removeAttr("aria-controls"):c.attr("aria-controls",a.id))})}function G(a){var b,c,g=a.config,e=g.sortList,l=e.length,d=f.css.sortNone+" "+g.cssNone,k=[f.css.sortAsc+" "+g.cssAsc,f.css.sortDesc+" "+g.cssDesc],p=["ascending","descending"],m=h(a).find("tfoot tr").children().add(g.$extraHeaders).removeClass(k.join(" "));g.$headers.removeClass(k.join(" ")).addClass(d).attr("aria-sort","none");for(b=0;b"),c=h(a).width();h(a.tBodies[0]).find("tr:first").children(":visible").each(function(){b.append(h("").css("width",parseInt(h(this).width()/c*1E3,10)/10+"%"))});h(a).prepend(b)}}function P(a,b){var c,g,e,l,f,k=a.config,d=b||k.sortList;k.sortList=[];h.each(d,function(a,b){l=parseInt(b[0],10);if(e=k.$headers.filter('[data-column="'+l+'"]:last')[0]){g=(g=(""+b[1]).match(/^(1|d|s|o|n)/))? g[0]:"";switch(g){case "1":case "d":g=1;break;case "s":g=f||0;break;case "o":c=e.order[(f||0)%(k.sortReset?3:2)];g=0===c?1:1===c?0:2;break;case "n":e.count+=1;g=e.order[e.count%(k.sortReset?3:2)];break;default:g=0}f=0===a?g:f;c=[l,parseInt(g,10)||0];k.sortList.push(c);g=h.inArray(c[1],e.order);e.count=0<=g?g:c[1]%(k.sortReset?3:2)}})}function Q(a,b){return a&&a[b]?a[b].type||"":""}function L(a,b,c){if(a.isUpdating)return setTimeout(function(){L(a,b,c)},50);var g,e,l,d,k=a.config,p=!c[k.sortMultiSortKey], m=k.$table;m.trigger("sortStart",a);b.count=c[k.sortResetKey]?2:(b.count+1)%(k.sortReset?3:2);k.sortRestart&&(e=b,k.$headers.each(function(){this===e||!p&&h(this).is("."+f.css.sortDesc+",."+f.css.sortAsc)||(this.count=-1)}));e=b.column;if(p){k.sortList=[];if(null!==k.sortForce)for(g=k.sortForce,l=0;lg&&(k.sortList.push([e,g]),1g&&(k.sortList.push([e,g]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me", debug:!1,headerList:[],empties:{},strings:{},parsers:[]};f.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"};f.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"};f.log=d;f.benchmark=q;f.construct=function(a){return this.each(function(){var b=h.extend(!0,{},f.defaults,a);b.originalSettings=a;!this.hasInitialized&&f.buildTable&&"TABLE"!==this.tagName?f.buildTable(this,b):f.setup(this,b)})};f.setup=function(a,b){if(!a||!a.tHead||0===a.tBodies.length||!0===a.hasInitialized)return b.debug?d("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"): "";var c="",g=h(a),e=h.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;h.data(a,"tablesorter",b);b.debug&&h.data(a,"startoveralltimer",new Date);b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),c=h.fn.detach?b.detach():b.remove();c=h(a).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove();a.isProcessing=!1};f.clearTableBody=function(a){h(a)[0].config.$tbodies.children().detach()};f.bindEvents=function(a,b,c){a=h(a)[0];var g,e=a.config;!0!==c&&(e.$extraHeaders=e.$extraHeaders?e.$extraHeaders.add(b):b);b.find(e.selectorSort).add(b.filter(e.selectorSort)).unbind(["mousedown","mouseup", "sort","keyup",""].join(e.namespace+" ")).bind(["mousedown","mouseup","sort","keyup",""].join(e.namespace+" "),function(c,d){var f;f=c.type;if(!(1!==(c.which||c.button)&&!/sort|keyup/.test(f)||"keyup"===f&&13!==c.which||"mouseup"===f&&!0!==d&&250<(new Date).getTime()-g)){if("mousedown"===f)return g=(new Date).getTime(),/(input|select|button|textarea)/i.test(c.target.tagName)?"":!e.cancelSelection;e.delayInit&&n(e.cache)&&w(a);f=h.fn.closest?h(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)? this:h(this).parents("th, td")[0];f=e.$headers[b.index(f)];f.sortDisabled||L(a,f,c)}});e.cancelSelection&&b.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})};f.restoreHeaders=function(a){var b=h(a)[0].config;b.$table.find(b.selectorHeaders).each(function(a){h(this).find("."+f.css.headerIn).length&&h(this).html(b.headerContent[a])})};f.destroy=function(a,b,c){a=h(a)[0];if(a.hasInitialized){f.refreshWidgets(a,!0,!0);var g=h(a),e=a.config,d=g.find("thead:first"), q=d.find("tr."+f.css.headerRow).removeClass(f.css.headerRow+" "+e.cssHeaderRow),k=g.find("tfoot:first > tr").children("th, td");!1===b&&0<=h.inArray("uitheme",e.widgets)&&(g.trigger("applyWidgetId",["uitheme"]),g.trigger("applyWidgetId",["zebra"]));d.find("tr").not(q).remove();g.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(e.namespace+ " "));e.$headers.add(k).removeClass([f.css.header,e.cssHeader,e.cssAsc,e.cssDesc,f.css.sortAsc,f.css.sortDesc,f.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true");q.find(e.selectorSort).unbind(["mousedown","mouseup","keypress",""].join(e.namespace+" "));f.restoreHeaders(a);g.toggleClass(f.css.table+" "+e.tableClass+" tablesorter-"+e.theme,!1===b);a.hasInitialized=!1;delete a.config.cache;"function"===typeof c&&c(a)}};f.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i};f.sortNatural=function(a,b){if(a===b)return 0;var c,g,e,d,h,k;g=f.regex;if(g.hex.test(b)){c=parseInt(a.match(g.hex),16);e=parseInt(b.match(g.hex),16);if(ce)return 1}c=a.replace(g.chunk,"\\0$1\\0").replace(g.chunks,"").split("\\0");g=b.replace(g.chunk,"\\0$1\\0").replace(g.chunks,"").split("\\0");k=Math.max(c.length,g.length);for(h=0;hd)return 1}return 0};f.sortNaturalAsc=function(a,b,c,g,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==c?"boolean"===typeof c?c?-1:1:-c||-1:""===b&&0!==c?"boolean"===typeof c?c?1:-1:c||1:f.sortNatural(a,b)};f.sortNaturalDesc=function(a,b,c,g,e){if(a===b)return 0;c=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==c?"boolean"===typeof c?c?-1:1:c||1:""===b&&0!==c?"boolean"===typeof c?c? 1:-1:-c||-1:f.sortNatural(b,a)};f.sortText=function(a,b){return a>b?1:ah.inArray(q[g].id,l))&&(e.debug&&d('Refeshing widgets: Removing "'+q[g].id+'"'),q[g].hasOwnProperty("remove")&&e.widgetInit[q[g].id]&&(q[g].remove(a, e,e.widgetOptions),e.widgetInit[q[g].id]=!1));!0!==c&&f.applyWidget(a,b)};f.getData=function(a,b,c){var d="";a=h(a);var e,f;if(!a.length)return"";e=h.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)||"undefined"!==typeof a.data(c.toLowerCase())?d+=a.data(c)||a.data(c.toLowerCase()):e&&"undefined"!==typeof e[c]?d+=e[c]:b&&"undefined"!==typeof b[c]?d+=b[c]:" "!==f&&f.match(" "+c+"-")&&(d=f.match(new RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return h.trim(d)};f.formatFloat= function(a,b){if("string"!==typeof a||""===a)return a;var c;a=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?a.replace(/,/g,""):a.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(a)&&(a=a.replace(/^\s*\(([.\d]+)\)/,"-$1"));c=parseFloat(a);return isNaN(c)?h.trim(a):c};f.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var r=h.tablesorter;h.fn.extend({tablesorter:r.construct});r.addParser({id:"no-parser",is:function(){return!1}, format:function(){return""},type:"text"});r.addParser({id:"text",is:function(){return!0},format:function(d,q){var n=q.config;d&&(d=h.trim(n.ignoreCase?d.toLocaleLowerCase():d),d=n.sortLocaleCompare?r.replaceAccents(d):d);return d},type:"text"});r.addParser({id:"digit",is:function(d){return r.isDigit(d)},format:function(d,q){var n=r.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),q);return d&&"number"===typeof n?n:d?h.trim(d&&q.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});r.addParser({id:"currency", is:function(d){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((d||"").replace(/[+\-,. ]/g,""))},format:function(d,q){var n=r.formatFloat((d||"").replace(/[^\w,. \-()]/g,""),q);return d&&"number"===typeof n?n:d?h.trim(d&&q.config.ignoreCase?d.toLocaleLowerCase():d):d},type:"numeric"});r.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,h){var n,y=d?d.split("."):"",v="",w=y.length; for(n=0;nd.length},format:function(d,h){return d?r.formatFloat(d.replace(/%/g,""),h):d},type:"numeric"});r.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(d)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(d)},format:function(d,h){return d?r.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,h):d},type:"numeric"});r.addParser({id:"shortDate",is:function(d){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((d|| "").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(d,h,n,y){if(d){n=h.config;var v=n.$headers.filter("[data-column="+y+"]:last");y=v.length&&v[0].dateFormat||r.getData(v,r.getColumnData(h,n.headers,y),"dateFormat")||n.dateFormat;d=d.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===y?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===y?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===y&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, "$1/$2/$3"))}return d?r.formatFloat((new Date(d)).getTime()||d,h):d},type:"numeric"});r.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,h){return d?r.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||d,h):d},type:"numeric"});r.addParser({id:"metadata",is:function(){return!1},format:function(d,q,n){d=q.config;d=d.parserMetadataName?d.parserMetadataName:"sortValue";return h(n).metadata()[d]}, type:"numeric"});r.addWidget({id:"zebra",priority:90,format:function(d,q,n){var y,v,w,z,D,E,F=new RegExp(q.cssChildRow,"i"),C=q.$tbodies;q.debug&&(D=new Date);for(d=0;d