diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 431e7124..1309d15d 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.9.0 - Client-side table sorting with ease! +* TableSorter 2.9.1 - Client-side table sorting with ease! * @requires jQuery v1.2.6+ * * Copyright (c) 2007 Christian Bach @@ -24,7 +24,7 @@ var ts = this; - ts.version = "2.9.0"; + ts.version = "2.9.1"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 5bb35f08..730df634 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.9.0 min - Client-side table sorting with ease! +* TableSorter 2.9.1 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(f){f.extend({tablesorter:new function(){function d(c){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(c):alert(c)}function w(c,b){d(c+" ("+((new Date).getTime()-b.getTime())+"ms)")}function r(c,b,a){if(!b)return"";var e=c.config,d=e.textExtraction,m="",m="simple"===d?e.supportsTextContent?b.textContent:f(b).text():"function"===typeof d?d(b,c,a):"object"===typeof d&&d.hasOwnProperty(a)?d[a](b,c,a):e.supportsTextContent?b.textContent:f(b).text();return f.trim(m)} function j(c){var b=c.config,a=b.$tbodies=b.$table.children("tbody:not(."+b.cssInfoBlock+")"),e,t,m,p,k,n,h="";if(0===a.length)return b.debug?d("*Empty table!* Not building a parser cache"):"";a=a[0].rows;if(a[0]){e=[];t=a[0].cells.length;for(m=0;m':"";x.$headers=f(c).find(x.selectorHeaders).each(function(c){u=f(this);v=x.headers[c];x.headerContent[c]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(u,[c,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(u,[c]);this.column=a[this.parentNode.rowIndex+"-"+ this.cellIndex];var b=g.getData(u,v,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(u,v,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);u.addClass(x.cssHeader);x.headerList[c]=this;u.parent().addClass(x.cssHeaderRow)});E(c);x.debug&&(w("Built headers:",D),d(x.$headers))}function A(c,b,a){var e=f(c);e.find(c.config.selectorRemove).remove();j(c); s(c);D(e,b,a)}function E(c){var b,a=c.config;a.$headers.each(function(c,d){b="false"===g.getData(d,a.headers[c],"sorter");d.sortDisabled=b;f(d)[b?"addClass":"removeClass"]("sorter-false")})}function y(c){var b,a,e,d=c.config,m=d.sortList,p=[d.cssAsc,d.cssDesc],k=f(c).find("tfoot tr").children().removeClass(p.join(" "));d.$headers.removeClass(p.join(" "));e=m.length;for(b=0;bn&&(l.sortList.push([h,n]),1n&&(l.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=w;g.construct=function(c){return this.each(function(){if(!this.tHead|| 0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=f(this),a=this,e,t="",m=f.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config={};e=f.extend(!0,a.config,g.defaults,c);f.data(a,"tablesorter",e);e.debug&&f.data(a,"startoveralltimer",new Date);e.supportsTextContent="x"===f("x")[0].textContent;e.supportsDataObject=1.4<=parseFloat(f.fn.jquery);e.string= {max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(t=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=b.addClass(e.tableClass+t);e.$tbodies=b.children("tbody:not(."+e.cssInfoBlock+")");z(a);if(a.config.widthFixed&&0===f(a).find("colgroup").length){var p=f(""),k=f(a).width();f(a.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width",parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(a).prepend(p)}j(a); e.delayInit||s(a);I(a);e.supportsDataObject&&"undefined"!==typeof b.data().sortlist?e.sortList=b.data().sortlist:m&&(b.metadata()&&b.metadata().sortlist)&&(e.sortList=b.metadata().sortlist);g.applyWidget(a,!0);0'),a=f.fn.detach?b.detach():b.remove();a=f(c).find("span.tablesorter-savemyplace");b.insertAfter(a);a.remove();c.isProcessing=!1};g.clearTableBody=function(c){f(c)[0].config.$tbodies.empty()};g.restoreHeaders=function(c){var b=c.config;b.$headers.each(function(a){f(this).find(".tablesorter-header-inner").length&&f(this).html(b.headerContent[a])})};g.destroy=function(c,b,a){c=f(c)[0];if(c.hasInitialized){g.refreshWidgets(c, !0,!0);var e=f(c),d=c.config,m=e.find("thead:first"),p=m.find("tr."+d.cssHeaderRow).removeClass(d.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");m.find("tr").not(p).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd ".split(" ").join(".tablesorter "));d.$headers.add(k).removeClass(d.cssHeader+" "+d.cssAsc+" "+d.cssDesc).removeAttr("data-column"); p.find(d.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(c);!1!==b&&e.removeClass(d.tableClass+" tablesorter-"+d.theme);c.hasInitialized=!1;"function"===typeof a&&a(c)}};g.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];g.sortText=function(c,b,a,e){if(b===a)return 0;var d=c.config,m=d.string[d.empties[e]|| d.emptyTo],f=g.regex;if(""===b&&0!==m)return"boolean"===typeof m?m?-1:1:-m||-1;if(""===a&&0!==m)return"boolean"===typeof m?m?1:-1:m||1;if("function"===typeof d.textSorter)return d.textSorter(b,a,c,e);c=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(f[2]),16)||1!==c.length&&b.match(f[1])&&Date.parse(b);if(a=parseInt(a.match(f[2]),16)||b&&a.match(f[1])&&Date.parse(a)||null){if(b< a)return-1;if(b>a)return 1}d=Math.max(c.length,e.length);for(b=0;bf)return 1}return 0};g.sortTextDesc=function(c,b,a,e){if(b===a)return 0;var d=c.config,f=d.string[d.empties[e]||d.emptyTo];return""===b&&0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof d.textSorter? d.textSorter(a,b,c,e):g.sortText(c,a,b)};g.getTextValue=function(c,b,a){if(b){var e=c?c.length:0,d=b+a;for(b=0;bf.inArray(p[e].id,m)))j.debug&&d("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(c,j,j.widgetOptions);!0!==a&&g.applyWidget(c,b)};g.getData=function(c,b,a){var d="";c=f(c);var g,m;if(!c.length)return"";g=f.metadata?c.metadata():!1;m=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):g&&"undefined"!==typeof g[a]?d+=g[a]:b&&"undefined"!==typeof b[a]?d+=b[a]:" "!==m&&m.match(" "+ a+"-")&&(d=m.match(RegExp("\\s"+a+"-([\\w-]+)"))[1]||"");return f.trim(d)};g.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?f.trim(c):a};g.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}}); var j=f.tablesorter;f.fn.extend({tablesorter:j.construct});j.addParser({id:"text",is:function(){return!0},format:function(d,w){var r=w.config;d&&(d=f.trim(r.ignoreCase?d.toLocaleLowerCase():d),d=r.sortLocaleCompare?j.replaceAccents(d):d);return d},type:"text"});j.addParser({id:"digit",is:function(d){return j.isDigit(d)},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.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,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,f){var r,u=d?d.split("."):"",s="",v=u.length;for(r=0;r':"";x.$headers=f(c).find(x.selectorHeaders).each(function(c){u=f(this);v=x.headers[c];x.headerContent[c]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(u,[c,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(u,[c]);this.column=a[this.parentNode.rowIndex+"-"+ this.cellIndex];var b=g.getData(u,v,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(u,v,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);u.addClass(x.cssHeader);x.headerList[c]=this;u.parent().addClass(x.cssHeaderRow)});E(c);x.debug&&(w("Built headers:",D),d(x.$headers))}function A(c,b,a){var e=f(c);e.find(c.config.selectorRemove).remove();j(c); s(c);D(e,b,a)}function E(c){var b,a=c.config;a.$headers.each(function(c,d){b="false"===g.getData(d,a.headers[c],"sorter");d.sortDisabled=b;f(d)[b?"addClass":"removeClass"]("sorter-false")})}function y(c){var b,a,e,d=c.config,m=d.sortList,p=[d.cssAsc,d.cssDesc],k=f(c).find("tfoot tr").children().removeClass(p.join(" "));d.$headers.removeClass(p.join(" "));e=m.length;for(b=0;bn&&(l.sortList.push([h,n]),1n&&(l.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=w;g.construct=function(c){return this.each(function(){if(!this.tHead|| 0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?d("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var b=f(this),a=this,e,t="",m=f.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config={};e=f.extend(!0,a.config,g.defaults,c);f.data(a,"tablesorter",e);e.debug&&f.data(a,"startoveralltimer",new Date);e.supportsTextContent="x"===f("x")[0].textContent;e.supportsDataObject=1.4<=parseFloat(f.fn.jquery);e.string= {max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1};/tablesorter\-/.test(b.attr("class"))||(t=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=b.addClass(e.tableClass+t);e.$tbodies=b.children("tbody:not(."+e.cssInfoBlock+")");z(a);if(a.config.widthFixed&&0===f(a).find("colgroup").length){var p=f(""),k=f(a).width();f(a.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width",parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(a).prepend(p)}j(a); e.delayInit||s(a);I(a);e.supportsDataObject&&"undefined"!==typeof b.data().sortlist?e.sortList=b.data().sortlist:m&&(b.metadata()&&b.metadata().sortlist)&&(e.sortList=b.metadata().sortlist);g.applyWidget(a,!0);0'),a=f.fn.detach?b.detach():b.remove();a=f(c).find("span.tablesorter-savemyplace");b.insertAfter(a);a.remove();c.isProcessing=!1};g.clearTableBody=function(c){f(c)[0].config.$tbodies.empty()};g.restoreHeaders=function(c){var b=c.config;b.$headers.each(function(a){f(this).find(".tablesorter-header-inner").length&&f(this).html(b.headerContent[a])})};g.destroy=function(c,b,a){c=f(c)[0];if(c.hasInitialized){g.refreshWidgets(c, !0,!0);var e=f(c),d=c.config,m=e.find("thead:first"),p=m.find("tr."+d.cssHeaderRow).removeClass(d.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");m.find("tr").not(p).remove();e.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd ".split(" ").join(".tablesorter "));d.$headers.add(k).removeClass(d.cssHeader+" "+d.cssAsc+" "+d.cssDesc).removeAttr("data-column"); p.find(d.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(c);!1!==b&&e.removeClass(d.tableClass+" tablesorter-"+d.theme);c.hasInitialized=!1;"function"===typeof a&&a(c)}};g.regex=[/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];g.sortText=function(c,b,a,e){if(b===a)return 0;var d=c.config,m=d.string[d.empties[e]|| d.emptyTo],f=g.regex;if(""===b&&0!==m)return"boolean"===typeof m?m?-1:1:-m||-1;if(""===a&&0!==m)return"boolean"===typeof m?m?1:-1:m||1;if("function"===typeof d.textSorter)return d.textSorter(b,a,c,e);c=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(f[2]),16)||1!==c.length&&b.match(f[1])&&Date.parse(b);if(a=parseInt(a.match(f[2]),16)||b&&a.match(f[1])&&Date.parse(a)||null){if(b< a)return-1;if(b>a)return 1}d=Math.max(c.length,e.length);for(b=0;bf)return 1}return 0};g.sortTextDesc=function(c,b,a,e){if(b===a)return 0;var d=c.config,f=d.string[d.empties[e]||d.emptyTo];return""===b&&0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof d.textSorter? d.textSorter(a,b,c,e):g.sortText(c,a,b)};g.getTextValue=function(c,b,a){if(b){var e=c?c.length:0,d=b+a;for(b=0;bf.inArray(p[e].id,m)))j.debug&&d("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(c,j,j.widgetOptions);!0!==a&&g.applyWidget(c,b)};g.getData=function(c,b,a){var d="";c=f(c);var g,m;if(!c.length)return"";g=f.metadata?c.metadata():!1;m=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):g&&"undefined"!==typeof g[a]?d+=g[a]:b&&"undefined"!==typeof b[a]?d+=b[a]:" "!==m&&m.match(" "+ a+"-")&&(d=m.match(RegExp("\\s"+a+"-([\\w-]+)"))[1]||"");return f.trim(d)};g.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;var a;c=(b&&b.config?!1!==b.config.usNumberFormat:"undefined"!==typeof b?b:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));a=parseFloat(c);return isNaN(a)?f.trim(c):a};g.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'"\s]/g,"")):!0}}}); var j=f.tablesorter;f.fn.extend({tablesorter:j.construct});j.addParser({id:"text",is:function(){return!0},format:function(d,w){var r=w.config;d&&(d=f.trim(r.ignoreCase?d.toLocaleLowerCase():d),d=r.sortLocaleCompare?j.replaceAccents(d):d);return d},type:"text"});j.addParser({id:"digit",is:function(d){return j.isDigit(d)},format:function(d,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.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,f){return d?j.formatFloat(d.replace(/[^\w,. \-()]/g,""),f):d},type:"numeric"});j.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,f){var r,u=d?d.split("."):"",s="",v=u.length;for(r=0;r