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