/*! * TableSorter 2.13.1 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ !(function(g){g.extend({tablesorter:new function(){function c(a){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(a):alert(a)}function k(a,b){c(a+" ("+((new Date).getTime()-b.getTime())+"ms)")}function m(a){for(var b in a)return!1;return!0}function p(a,b,d){if(!b)return"";var h=a.config,c=h.textExtraction,f="",f="simple"===c?h.supportsTextContent?b.textContent:g(b).text():"function"===typeof c?c(b,a,d):"object"===typeof c&&c.hasOwnProperty(d)?c[d](b,a,d):h.supportsTextContent? b.textContent:g(b).text();return g.trim(f)}function x(a){var b=a.config,d=b.$tbodies=b.$table.children("tbody:not(."+b.cssInfoBlock+")"),h,y,f,l,r,g,n="";if(0===d.length)return b.debug?c("*Empty table!* Not building a parser cache"):"";d=d[0].rows;if(d[0])for(h=[],y=d[0].cells.length,f=0;f':"";n.$headers=g(a).find(n.selectorHeaders).each(function(a){h=g(this);d=n.headers[a];n.headerContent[a]=g(this).html();l=n.headerTemplate.replace(/\{content\}/g,g(this).html()).replace(/\{icon\}/g,f);n.onRenderTemplate&&(y=n.onRenderTemplate.apply(h,[a,l]))&&"string"===typeof y&&(l=y);g(this).html('
'+l+"
");n.onRenderHeader&&n.onRenderHeader.apply(h,[a]); this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];var c=e.getData(h,d,"sortInitialOrder")||n.sortInitialOrder;this.order=/^d/i.test(c)||1===c?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;r=e.getData(h,d,"lockedOrder")||!1;"undefined"!==typeof r&&!1!==r&&(this.order=this.lockedOrder=/^d/i.test(r)||1===r?[1,1,1]:[0,0,0]);h.addClass(e.css.header+" "+n.cssHeader);n.headerList[a]=this;h.parent().addClass(e.css.headerRow+" "+n.cssHeaderRow);h.attr("tabindex",0)});D(a);n.debug&&(k("Built headers:", q),c(n.$headers))}function F(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();x(a);z(a);G(h.$table,b,d)}function D(a){var b,d=a.config;d.$headers.each(function(a,c){b="false"===e.getData(c,d.headers[a],"sorter");c.sortDisabled=b;g(c)[b?"addClass":"removeClass"]("sorter-false")})}function H(a){var b,d,h,c=a.config,f=c.sortList,l=[e.css.sortAsc+" "+c.cssAsc,e.css.sortDesc+" "+c.cssDesc],r=g(a).find("tfoot tr").children().removeClass(l.join(" "));c.$headers.removeClass(l.join(" "));h=f.length; for(b=0;b"),d=g(a).width();g(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(g("").css("width",parseInt(g(this).width()/ d*1E3,10)/10+"%"))});g(a).prepend(b)}}function M(a,b){var d,h,c,f=a.config,e=b||f.sortList;f.sortList=[];g.each(e,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(c=f.headerList[d[0]])f.sortList.push(d),h=g.inArray(d[1],c.order),c.count=0<=h?h:d[1]%(f.sortReset?3:2)})}function N(a,b,d){var h,c,f=a.config,l=!d[f.sortMultiSortKey],r=g(a);r.trigger("sortStart",a);b.count=d[f.sortResetKey]?2:(b.count+1)%(f.sortReset?3:2);f.sortRestart&&(c=b,f.$headers.each(function(){this===c||!l&&g(this).is("."+ e.css.sortDesc+",."+e.css.sortAsc)||(this.count=-1)}));c=b.column;if(l){f.sortList=[];if(null!==f.sortForce)for(h=f.sortForce,d=0;dh&&(f.sortList.push([c,h]),1h&&(f.sortList.push([c,h]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.css={table:"tablesorter",childRow:"tablesorter-childRow",header:"tablesorter-header",headerRow:"tablesorter-headerRow",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc"}; e.log=c;e.benchmark=k;e.construct=function(a){return this.each(function(){var b=g.extend(!0,{},e.defaults,a);!this.hasInitialized&&e.buildTable&&"TABLE"!==this.tagName&&e.buildTable(this,b);e.setup(this,b)})};e.setup=function(a,b){if(!a||!a.tHead||0===a.tBodies.length||!0===a.hasInitialized)return b.debug?c("stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var d="",h=g(a),k=g.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;g.data(a,"tablesorter", b);b.debug&&g.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===g("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),d=g.fn.detach?b.detach():b.remove();d=g(a).find("span.tablesorter-savemyplace");b.insertAfter(d);d.remove();a.isProcessing=!1};e.clearTableBody=function(a){g(a)[0].config.$tbodies.empty()};e.restoreHeaders=function(a){var b=a.config;b.$table.find(b.selectorHeaders).each(function(a){g(this).find(".tablesorter-header-inner").length&&g(this).html(b.headerContent[a])})}; e.destroy=function(a,b,d){a=g(a)[0];if(a.hasInitialized){e.refreshWidgets(a,!0,!0);var c=g(a),k=a.config,f=c.find("thead:first"),l=f.find("tr."+e.css.headerRow).removeClass(e.css.headerRow+" "+k.cssHeaderRow),m=c.find("tfoot:first > tr").children("th, td");f.find("tr").not(l).remove();c.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(".tablesorter ")); k.$headers.add(m).removeClass([e.css.header,k.cssHeader,k.cssAsc,k.cssDesc,e.css.sortAsc,e.css.sortDesc].join(" ")).removeAttr("data-column");l.find(k.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter");e.restoreHeaders(a);!1!==b&&c.removeClass(e.css.table+" "+k.tableClass+" tablesorter-"+k.theme);a.hasInitialized=!1;"function"===typeof d&&d(a)}};e.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,hex:/^0x[0-9a-f]+$/i};e.sortNatural= function(a,b){if(a===b)return 0;var d,c,g,f,l,k;c=e.regex;if(c.hex.test(b)){d=parseInt(a.match(c.hex),16);g=parseInt(b.match(c.hex),16);if(dg)return 1}d=a.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");c=b.replace(c.chunk,"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");k=Math.max(d.length,c.length);for(l=0;lf)return 1}return 0};e.sortText=function(a,b){return a>b?1:ag.inArray(l[h].id,f))&&(k.debug&&c("Refeshing widgets: Removing "+l[h].id),l[h].hasOwnProperty("remove")&&(l[h].remove(a,k,k.widgetOptions),k.widgetInit[l[h].id]=!1));!0!==d&&e.applyWidget(a,b)};e.getData=function(a,b,c){var e="";a=g(a);var k,f;if(!a.length)return"";k=g.metadata?a.metadata():!1;f=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)|| "undefined"!==typeof a.data(c.toLowerCase())?e+=a.data(c)||a.data(c.toLowerCase()):k&&"undefined"!==typeof k[c]?e+=k[c]:b&&"undefined"!==typeof b[c]?e+=b[c]:" "!==f&&f.match(" "+c+"-")&&(e=f.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return g.trim(e)};e.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)?g.trim(a):c};e.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var p=g.tablesorter;g.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(c,k){var m=k.config;c&&(c=g.trim(m.ignoreCase?c.toLocaleLowerCase():c),c=m.sortLocaleCompare?p.replaceAccents(c):c);return c},type:"text"});p.addParser({id:"digit",is:function(c){return p.isDigit(c)},format:function(c,k){var m= p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),k);return c&&"number"===typeof m?m:c?g.trim(c&&k.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});p.addParser({id:"currency",is:function(c){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((c||"").replace(/[,. ]/g,""))},format:function(c,k){var m=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),k);return c&&"number"===typeof m?m:c?g.trim(c&&k.config.ignoreCase?c.toLocaleLowerCase():c): c},type:"numeric"});p.addParser({id:"ipAddress",is:function(c){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(c)},format:function(c,g){var m,u=c?c.split("."):"",x="",z=u.length;for(m=0;mc.length},format:function(c,g){return c?p.formatFloat(c.replace(/%/g,""),g):c},type:"numeric"});p.addParser({id:"usLongDate",is:function(c){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(c)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(c)},format:function(c,g){return c? p.formatFloat((new Date(c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"shortDate",is:function(c){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((c||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(c,g,m,u){if(c){m=g.config;var x=m.headerList[u];u=x.dateFormat||p.getData(x,m.headers[u],"dateFormat")||m.dateFormat;c=c.replace(/\s+/g," ").replace(/[\-.,]/g,"/");"mmddyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===u?c=c.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===u&&(c=c.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"))}return c?p.formatFloat((new Date(c)).getTime()||"",g):c},type:"numeric"});p.addParser({id:"time",is:function(c){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(c)},format:function(c,g){return c?p.formatFloat((new Date("2000/01/01 "+c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",g):c},type:"numeric"});p.addParser({id:"metadata", is:function(){return!1},format:function(c,k,m){c=k.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return g(m).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c,k,m){var u,x,z,B,E,C,F=RegExp(k.cssChildRow,"i"),D=k.$tbodies;k.debug&&(E=new Date);for(c=0;c