diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 03fb6659..a6031c74 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -16,6 +16,7 @@ */ /*jshint browser:true, jquery:true, unused:false, expr: true */ /*global console:false, alert:false */ + !(function($) { "use strict"; $.extend({ @@ -407,6 +408,8 @@ c.headerList[index] = this; // add to parent in case there are multiple rows $t.parent().addClass(c.cssHeaderRow); + // allow keyboard cursor to focus on element + $t.attr("tabindex", 0); }); // enable/disable sorting updateHeader(table); @@ -665,19 +668,25 @@ c.$headers // http://stackoverflow.com/questions/5312849/jquery-find-self; .find(c.selectorSort).add( c.$headers.filter(c.selectorSort) ) - .unbind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter') - .bind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter', function(e, external) { + .unbind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter keypress.tablesorter') + .bind('mousedown.tablesorter mouseup.tablesorter sort.tablesorter keypress.tablesorter', function(e, external) { + if (e.keyCode && e.keyCode !== 13) { return; } // jQuery v1.2.6 doesn't have closest() var $cell = /TH|TD/.test(this.tagName) ? $(this) : $(this).parents('th, td').filter(':last'), cell = $cell[0]; - // only recognize left clicks - if ((e.which || e.button) !== 1 && e.type !== 'sort') { return false; } + // only recognize left clicks or enter + if (e.keyCode) { + if (e.keyCode !== 13) { return false; } + } + else if ( (e.which || e.button) !== 1 && e.type !== 'sort') { + return false; + } // set timer on mousedown if (e.type === 'mousedown') { downTime = new Date().getTime(); return e.target.tagName === "INPUT" ? '' : !c.cancelSelection; } // ignore long clicks (prevents resizable widget from initializing a sort) - if (external !== true && (new Date().getTime() - downTime > 250)) { return false; } + if (e.type === 'mouseup' && external !== true && (new Date().getTime() - downTime > 250)) { return false; } if (c.delayInit && !c.cache) { buildCache(table); } if (!cell.sortDisabled) { initSort(table, cell, e); @@ -952,11 +961,11 @@ // disable tablesorter $t .removeData('tablesorter') - .unbind('sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave sortBegin sortEnd '.split(' ').join('.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($f) .removeClass(c.cssHeader + ' ' + c.cssAsc + ' ' + c.cssDesc) .removeAttr('data-column'); - $r.find(c.selectorSort).unbind('mousedown.tablesorter mouseup.tablesorter'); + $r.find(c.selectorSort).unbind('mousedown.tablesorter mouseup.tablesorter keypress.tablesorter'); ts.restoreHeaders(table); if (removeClasses !== false) { $t.removeClass(c.tableClass + ' tablesorter-' + c.theme); diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 747c8984..36fd06a4 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -2,4 +2,4 @@ * TableSorter 2.10.0 min - Client-side table sorting with ease! * Copyright (c) 2007 Christian Bach */ -!function(f){f.extend({tablesorter:new function(){function c(d){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(d):alert(d)}function t(d,a){c(d+" ("+((new Date).getTime()-a.getTime())+"ms)")}function r(d,a,b){if(!a)return"";var e=d.config,c=e.textExtraction,l="",l="simple"===c?e.supportsTextContent?a.textContent:f(a).text():"function"===typeof c?c(a,d,b):"object"===typeof c&&c.hasOwnProperty(b)?c[b](a,d,b):e.supportsTextContent?a.textContent:f(a).text();return f.trim(l)} function j(d){var a=d.config,b=a.$tbodies=a.$table.children("tbody:not(."+a.cssInfoBlock+")"),e,u,l,p,k,n,h="";if(0===b.length)return a.debug?c("*Empty table!* Not building a parser cache"):"";b=b[0].rows;if(b[0]){e=[];u=b[0].cells.length;for(l=0;l':"";x.$headers=f(d).find(x.selectorHeaders).each(function(d){v=f(this);w=x.headers[d];x.headerContent[d]=this.innerHTML;A=x.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,B);x.onRenderTemplate&&(z=x.onRenderTemplate.apply(v,[d,A]))&&"string"===typeof z&&(A=z);this.innerHTML='
'+A+"
";x.onRenderHeader&&x.onRenderHeader.apply(v,[d]);this.column=b[this.parentNode.rowIndex+"-"+ this.cellIndex];var a=g.getData(v,w,"sortInitialOrder")||x.sortInitialOrder;this.order=/^d/i.test(a)||1===a?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;y=g.getData(v,w,"lockedOrder")||!1;"undefined"!==typeof y&&!1!==y&&(this.order=this.lockedOrder=/^d/i.test(y)||1===y?[1,1,1]:[0,0,0]);v.addClass(x.cssHeader);x.headerList[d]=this;v.parent().addClass(x.cssHeaderRow)});E(d);x.debug&&(t("Built headers:",D),c(x.$headers))}function A(d,a,b){var e=f(d);e.find(d.config.selectorRemove).remove();j(d); s(d);D(e,a,b)}function E(d){var a,b=d.config;b.$headers.each(function(d,c){a="false"===g.getData(c,b.headers[d],"sorter");c.sortDisabled=a;f(c)[a?"addClass":"removeClass"]("sorter-false")})}function y(d){var a,b,e,c=d.config,l=c.sortList,p=[c.cssAsc,c.cssDesc],k=f(d).find("tfoot tr").children().removeClass(p.join(" "));c.$headers.removeClass(p.join(" "));e=l.length;for(a=0;an&&(m.sortList.push([h,n]),1n&&(m.sortList.push([h,n]),1 thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};g.benchmark=t;g.construct= function(d){return this.each(function(){if(!this.tHead||0===this.tBodies.length||!0===this.hasInitialized)return this.config&&this.config.debug?c("stopping initialization! No thead, tbody or tablesorter has already been initialized"):"";var a=f(this),b=this,e,u="",l=f.metadata;b.hasInitialized=!1;b.isProcessing=!0;b.config={};e=f.extend(!0,b.config,g.defaults,d);f.data(b,"tablesorter",e);e.debug&&f.data(b,"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(a.attr("class"))||(u=""!==e.theme?" tablesorter-"+e.theme:"");e.$table=a.addClass(e.tableClass+u);e.$tbodies=a.children("tbody:not(."+e.cssInfoBlock+")");z(b);if(b.config.widthFixed&&0===f(b).find("colgroup").length){var p=f(""),k=f(b).width();f(b.tBodies[0]).find("tr:first").children("td").each(function(){p.append(f("").css("width", parseInt(1E3*(f(this).width()/k),10)/10+"%"))});f(b).prepend(p)}j(b);e.delayInit||s(b);I(b);e.supportsDataObject&&"undefined"!==typeof a.data().sortlist?e.sortList=a.data().sortlist:l&&(a.metadata()&&a.metadata().sortlist)&&(e.sortList=a.metadata().sortlist);g.applyWidget(b,!0);0'),b=f.fn.detach?a.detach():a.remove();b=f(d).find("span.tablesorter-savemyplace");a.insertAfter(b);b.remove();d.isProcessing=!1};g.clearTableBody=function(d){f(d)[0].config.$tbodies.empty()};g.restoreHeaders=function(d){var a=d.config;a.$headers.each(function(b){f(this).find(".tablesorter-header-inner").length&&f(this).html(a.headerContent[b])})};g.destroy= function(d,a,b){d=f(d)[0];if(d.hasInitialized){g.refreshWidgets(d,!0,!0);var e=f(d),c=d.config,l=e.find("thead:first"),p=l.find("tr."+c.cssHeaderRow).removeClass(c.cssHeaderRow),k=e.find("tfoot:first > tr").children("th, td");l.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 "));c.$headers.add(k).removeClass(c.cssHeader+ " "+c.cssAsc+" "+c.cssDesc).removeAttr("data-column");p.find(c.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter");g.restoreHeaders(d);!1!==a&&e.removeClass(c.tableClass+" tablesorter-"+c.theme);d.hasInitialized=!1;"function"===typeof b&&b(d)}};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(d,a, b,e){if(a===b)return 0;var c=d.config,l=c.string[c.empties[e]||c.emptyTo],f=g.regex;if(""===a&&0!==l)return"boolean"===typeof l?l?-1:1:-l||-1;if(""===b&&0!==l)return"boolean"===typeof l?l?1:-1:l||1;if("function"===typeof c.textSorter)return c.textSorter(a,b,d,e);d=a.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");e=b.replace(f[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");a=parseInt(a.match(f[2]),16)||1!==d.length&&a.match(f[1])&&Date.parse(a);if(b= parseInt(b.match(f[2]),16)||a&&b.match(f[1])&&Date.parse(b)||null){if(ab)return 1}c=Math.max(d.length,e.length);for(a=0;af)return 1}return 0};g.sortTextDesc=function(d,a,b,e){if(a===b)return 0;var c=d.config,f=c.string[c.empties[e]||c.emptyTo];return""===a&&0!==f?"boolean"===typeof f?f?-1:1: f||1:""===b&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof c.textSorter?c.textSorter(b,a,d,e):g.sortText(d,b,a)};g.getTextValue=function(d,a,b){if(a){var c=d?d.length:0,g=a+b;for(a=0;af.inArray(p[e].id,l)))j.debug&&c("Refeshing widgets: Removing "+p[e].id),p[e].hasOwnProperty("remove")&&p[e].remove(d,j,j.widgetOptions);!0!==b&&g.applyWidget(d,a)};g.getData=function(d,a,b){var c="";d=f(d);var g,l;if(!d.length)return"";g=f.metadata?d.metadata():!1;l=" "+(d.attr("class")||"");"undefined"!==typeof d.data(b)||"undefined"!==typeof d.data(b.toLowerCase())?c+=d.data(b)||d.data(b.toLowerCase()): g&&"undefined"!==typeof g[b]?c+=g[b]:a&&"undefined"!==typeof a[b]?c+=a[b]:" "!==l&&l.match(" "+b+"-")&&(c=l.match(RegExp("\\s"+b+"-([\\w-]+)"))[1]||"");return f.trim(c)};g.formatFloat=function(c,a){if("string"!==typeof c||""===c)return c;var b;c=(a&&a.config?!1!==a.config.usNumberFormat:"undefined"!==typeof a?a:1)?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&&(c=c.replace(/^\s*\(/,"-").replace(/\)/,""));b=parseFloat(c);return isNaN(b)?f.trim(c):b};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(c,t){var r=t.config;c&&(c=f.trim(r.ignoreCase?c.toLocaleLowerCase():c),c=r.sortLocaleCompare?j.replaceAccents(c):c);return c},type:"text"});j.addParser({id:"digit",is:function(c){return j.isDigit(c)},format:function(c,t){var r=j.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),t);return c&& "number"===typeof r?r:c?f.trim(c&&t.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});j.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,t){var r=j.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),t);return c&&"number"===typeof r?r:c?f.trim(c&&t.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"});j.addParser({id:"ipAddress",is:function(c){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(c)}, format:function(c,f){var r,v=c?c.split("."):"",s="",w=v.length;for(r=0;r=0){u=t.parsers[a];if(u&&u.id!=="text"&&u.is&&u.is(l,e,f)){return u}}return t.getParserById("text")}function o(e){var r=e.config,i=r.$tbodies=r.$table.children("tbody:not(."+r.cssInfoBlock+")"),o,u,a,f,l,c,h,p="";if(i.length===0){return r.debug?n("*Empty table!* Not building a parser cache"):""}o=i[0].rows;if(o[0]){u=[];a=o[0].cells.length;for(f=0;f':"";m.$headers=e(i).find(m.selectorHeaders).each(function(n){u=e(this);o=m.headers[n];m.headerContent[n]=this.innerHTML;h=m.headerTemplate.replace(/\{content\}/g,this.innerHTML).replace(/\{icon\}/g,c);if(m.onRenderTemplate){a=m.onRenderTemplate.apply(u,[n,h]);if(a&&typeof a==="string"){h=a}}this.innerHTML='
'+h+"
";if(m.onRenderHeader){m.onRenderHeader.apply(u,[n])}this.column=s[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=l(t.getData(u,o,"sortInitialOrder")||m.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=false;d=t.getData(u,o,"lockedOrder")||false;if(typeof d!=="undefined"&&d!==false){this.order=this.lockedOrder=l(d)?[1,1,1]:[0,0,0]}u.addClass(m.cssHeader);m.headerList[n]=this;u.parent().addClass(m.cssHeaderRow);u.attr("tabindex",0)});p(i);if(m.debug){r("Built headers:",v);n(m.$headers)}}function h(t,n,r){var i=e(t),s=t.config;i.find(s.selectorRemove).remove();o(t);u(t);E(i,n,r)}function p(n){var r,i=n.config;i.$headers.each(function(n,s){r=t.getData(s,i.headers[n],"sorter")==="false";s.sortDisabled=r;e(s)[r?"addClass":"removeClass"]("sorter-false")})}function d(t){var n,r,i,s,o=t.config,u=o.sortList,a=[o.cssAsc,o.cssDesc],f=e(t).find("tfoot tr").children().removeClass(a.join(" "));o.$headers.removeClass(a.join(" "));s=u.length;for(r=0;r"),r=e(t).width();e(t.tBodies[0]).find("tr:first").children("td").each(function(){n.append(e("").css("width",parseInt(e(this).width()/r*1e3,10)/10+"%"))});e(t).prepend(n)}}function m(t,n){var r,i,s,o=t.config,u=n||o.sortList;o.sortList=[];e.each(u,function(t,n){r=[parseInt(n[0],10),parseInt(n[1],10)];s=o.headerList[r[0]];if(s){o.sortList.push(r);i=e.inArray(r[1],s.order);s.count=i>=0?i:r[1]%(o.sortReset?3:2)}})}function g(e,t){return e&&e[t]?e[t].type||"":""}function y(n,r,i){var s,o,u,f,l,c=n.config,h=!i[c.sortMultiSortKey],p=e(n);p.trigger("sortStart",n);r.count=i[c.sortResetKey]?2:(r.count+1)%(c.sortReset?3:2);if(c.sortRestart){o=r;c.$headers.each(function(){if(this!==o&&(h||!e(this).is("."+c.cssDesc+",."+c.cssAsc))){this.count=-1}})}o=r.column;if(h){c.sortList=[];if(c.sortForce!==null){s=c.sortForce;for(u=0;u1){for(u=1;u1){if(t.isValueInArray(c.sortAppend[0][0],c.sortList)){c.sortList.pop()}}if(t.isValueInArray(o,c.sortList)){for(u=0;u1){for(u=1;u250){return false}if(r.delayInit&&!r.cache){u(n)}if(!o.sortDisabled){y(n,o,t)}});if(r.cancelSelection){r.$headers.attr("unselectable","on").bind("selectstart",false).css({"user-select":"none",MozUserSelect:"none"})}s.unbind("sortReset update updateRows updateCell updateAll addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(".tablesorter ")).bind("sortReset.tablesorter",function(e){e.stopPropagation();r.sortList=[];d(n);b(n);a(n)}).bind("updateAll.tablesorter",function(e,r,i){e.stopPropagation();t.restoreHeaders(n);c(n);S(n);h(n,r,i)}).bind("update.tablesorter updateRows.tablesorter",function(e,t,r){e.stopPropagation();p(n);h(n,t,r)}).bind("updateCell.tablesorter",function(t,o,u,a){t.stopPropagation();s.find(r.selectorRemove).remove();var f,l,c,h=s.find("tbody"),p=h.index(e(o).parents("tbody").filter(":last")),d=e(o).parents("tr").filter(":last");o=e(o)[0];if(h.length&&p>=0){l=h.eq(p).find("tr").index(d);c=o.cellIndex;f=r.cache[p].normalized[l].length-1;r.cache[p].row[n.config.cache[p].normalized[l][f]]=d;r.cache[p].normalized[l][c]=r.parsers[c].format(i(n,o,c),n,o,c);E(s,u,a)}}).bind("addRows.tablesorter",function(e,t,u,a){e.stopPropagation();var l,c=t.filter("tr").length,h=[],p=t[0].cells.length,d=s.find("tbody").index(t.closest("tbody"));if(!r.parsers){o(n)}for(l=0;l thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:false,headerList:[],empties:{},strings:{},parsers:[]};t.benchmark=r;t.construct=function(r){return this.each(function(){if(!this.tHead||this.tBodies.length===0||this.hasInitialized===true){return this.config&&this.config.debug?n("stopping initialization! No thead, tbody or tablesorter has already been initialized"):""}var i=e(this),s=this,a,f="",l=e.metadata;s.hasInitialized=false;s.isProcessing=true;s.config={};a=e.extend(true,s.config,t.defaults,r);e.data(s,"tablesorter",a);if(a.debug){e.data(s,"startoveralltimer",new Date)}a.supportsTextContent=e("x")[0].textContent==="x";a.supportsDataObject=parseFloat(e.fn.jquery)>=1.4;a.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:true,bottom:false};if(!/tablesorter\-/.test(i.attr("class"))){f=a.theme!==""?" tablesorter-"+a.theme:""}a.$table=i.addClass(a.tableClass+f);a.$tbodies=i.children("tbody:not(."+a.cssInfoBlock+")");c(s);v(s);o(s);if(!a.delayInit){u(s)}S(s);if(a.supportsDataObject&&typeof i.data().sortlist!=="undefined"){a.sortList=i.data().sortlist}else if(l&&i.metadata()&&i.metadata().sortlist){a.sortList=i.metadata().sortlist}t.applyWidget(s,true);if(a.sortList.length>0){i.trigger("sorton",[a.sortList,{},!a.initWidgets])}else if(a.initWidgets){t.applyWidget(s)}if(a.showProcessing){i.unbind("sortBegin.tablesorter sortEnd.tablesorter").bind("sortBegin.tablesorter sortEnd.tablesorter",function(e){t.isProcessing(s,e.type==="sortBegin")})}s.hasInitialized=true;s.isProcessing=false;if(a.debug){t.benchmark("Overall initialization time",e.data(s,"startoveralltimer"))}i.trigger("tablesorter-initialized",s);if(typeof a.initialized==="function"){a.initialized(s)}})};t.isProcessing=function(n,r,i){n=e(n);var s=n[0].config,o=i||n.find("."+s.cssHeader);if(r){if(s.sortList.length>0){o=o.filter(function(){return this.sortDisabled?false:t.isValueInArray(parseFloat(e(this).attr("data-column")),s.sortList)})}o.addClass(s.cssProcessing)}else{o.removeClass(s.cssProcessing)}};t.processTbody=function(t,n,r){var i;if(r){t.isProcessing=true;n.before('');i=e.fn.detach?n.detach():n.remove();return i}i=e(t).find("span.tablesorter-savemyplace");n.insertAfter(i);i.remove();t.isProcessing=false};t.clearTableBody=function(t){e(t)[0].config.$tbodies.empty()};t.restoreHeaders=function(t){var n=t.config;n.$headers.each(function(t){if(e(this).find(".tablesorter-header-inner").length){e(this).html(n.headerContent[t])}})};t.destroy=function(n,r,i){n=e(n)[0];if(!n.hasInitialized){return}t.refreshWidgets(n,true,true);var s=e(n),o=n.config,u=s.find("thead:first"),a=u.find("tr."+o.cssHeaderRow).removeClass(o.cssHeaderRow),f=s.find("tfoot:first > tr").children("th, td");u.find("tr").not(a).remove();s.removeData("tablesorter").unbind("sortReset update updateAll updateRows updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd ".split(" ").join(".tablesorter "));o.$headers.add(f).removeClass(o.cssHeader+" "+o.cssAsc+" "+o.cssDesc).removeAttr("data-column");a.find(o.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter");t.restoreHeaders(n);if(r!==false){s.removeClass(o.tableClass+" tablesorter-"+o.theme)}n.hasInitialized=false;if(typeof i==="function"){i(n)}};t.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];t.sortText=function(e,n,r,i){if(n===r){return 0}var s=e.config,o=s.string[s.empties[i]||s.emptyTo],u=t.regex,a,f,l,c,h,p,d,v;if(n===""&&o!==0){return typeof o==="boolean"?o?-1:1:-o||-1}if(r===""&&o!==0){return typeof o==="boolean"?o?1:-1:o||1}if(typeof s.textSorter==="function"){return s.textSorter(n,r,e,i)}a=n.replace(u[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");l=r.replace(u[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");f=parseInt(n.match(u[2]),16)||a.length!==1&&n.match(u[1])&&Date.parse(n);c=parseInt(r.match(u[2]),16)||f&&r.match(u[1])&&Date.parse(r)||null;if(c){if(fc){return 1}}v=Math.max(a.length,l.length);for(d=0;dp){return 1}}return 0};t.sortTextDesc=function(e,n,r,i){if(n===r){return 0}var s=e.config,o=s.string[s.empties[i]||s.emptyTo];if(n===""&&o!==0){return typeof o==="boolean"?o?-1:1:o||1}if(r===""&&o!==0){return typeof o==="boolean"?o?1:-1:-o||-1}if(typeof s.textSorter==="function"){return s.textSorter(r,n,e,i)}return t.sortText(e,r,n)};t.getTextValue=function(e,t,n){if(t){var r,i=e?e.length:0,s=t+n;for(r=0;r1){a=0;o=s.children("tr:visible");o.each(function(){u=e(this);if(!p.test(this.className)){a++}f=a%2===0;u.removeClass(i.zebra[f?1:0]).addClass(i.zebra[f?0:1])})}}if(r.debug){t.benchmark("Applying Zebra widget",l)}},remove:function(t,n,r){var i,s,o=n.$tbodies,u=(r.zebra||["even","odd"]).join(" ");for(i=0;i