diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index e912c6ba..014339da 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /*! * tablesorter pager plugin - * updated 11/8/2013 + * updated 11/9/2013 */ /*jshint browser:true, jquery:true, unused:false */ ;(function($) { diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index be13aa69..a1434e37 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,2 +1,2 @@ -/*! tablesorter pager plugin minified - updated 10/30/2013 */ -;(function(g){var l=g.tablesorter;g.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,savePages:!0,fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize", cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,x=function(b,a){var c=b.cssDisabled,f=!!a,e=Math.min(b.totalPages,b.filteredPages);b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[f||0===b.page?"addClass":"removeClass"](c),b.$container.find(b.cssNext+","+b.cssLast)[f||b.page===e-1?"addClass":"removeClass"](c))},r=function(b,a,c){var f,e,h,d=b.config;f= d.$table.hasClass("hasFilters")&&!a.ajaxUrl;h=(d.widgetOptions&&d.widgetOptions.filter_filteredRow||"filtered")+","+d.selectorRemove;e=a.size||10;a.totalPages=Math.ceil(a.totalRows/e);a.filteredRows=f?d.$tbodies.eq(0).children("tr:not(."+h+")").length:a.totalRows;a.filteredPages=f?Math.ceil(a.filteredRows/e)||1:a.totalPages;if(0<=Math.min(a.totalPages,a.filteredPages)&&(h=a.size*a.page>a.filteredRows,a.startRow=h?1:0===a.filteredRows?0:a.size*a.page+1,a.page=h?0:a.page,a.endRow=Math.min(a.filteredRows, a.totalRows,a.size*(a.page+1)),f=a.$container.find(a.cssPageDisplay),h=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(b,c){return a.page+(c?parseInt(c,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var c=b.split(":"),d=a.ajaxData;return 1"+f+"";a.$goto.html(h).val(a.page+1)}x(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&l.storage&&l.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=function(b,a){var c,f=b.config,e=f.$tbodies.eq(0);a.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),c=g.data(b,"pagerSavedHeight"))&&(c-=e.height(),5'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();g.data(b,"pagerSavedHeight",c.height());t(b,a);g.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,f=b.config,e=f.$tbodies.eq(0).children(),h=e.length,d=a.page*a.size,g=d+a.size,n=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",m=0;for(c=0;c=d&& m'+(0===f.status?"Not connected, verify Network":404===f.status?"Requested page not found [404]":500===f.status?"Internal Server Error [500]":"parsererror"===e?"Requested JSON parse failed":"timeout"===e?"Time out error":"abort"===e?"Ajax Request aborted":"Uncaught error: "+f.statusText+" ["+f.status+"]")+"").click(function(){g(this).remove()}).appendTo(p.find("thead:first")),k.$tbodies.eq(0).empty();else{g.isArray(h)?(f=isNaN(h[0])&& !isNaN(h[1]),e=h[f?1:0],c.totalRows=isNaN(e)?c.totalRows||0:e,f=h[f?0:1]||[],m=h[2]):(c.ajaxData=h,c.totalRows=h.total,m=h.headers,f=h.rows);v=f.length;if(f instanceof jQuery)k.$tbodies.eq(0).empty().append(f);else if(v){if(0";for(e=0;e"+f[h][e]+"";q+=""}k.$tbodies.eq(0).html(q)}m&&m.length===b&&(n=(d=p.hasClass("hasStickyHeaders"))?k.$sticky.children("thead:first").children().children():"",s=p.find("tfoot tr:first").children(),k.$headers.filter("th").each(function(a){var b= g(this),c;b.find("."+l.css.icon).length?(c=b.find("."+l.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(m[a]).append(c),d&&n.length&&(c=n.eq(a).find("."+l.css.icon).clone(!0),n.eq(a).find(".tablesorter-header-inner").html(m[a]).append(c))):(b.find(".tablesorter-header-inner").html(m[a]),d&&n.length&&n.eq(a).find(".tablesorter-header-inner").html(m[a]));s.eq(a).html(m[a])}))}k.showProcessing&&l.isProcessing(a);c.totalPages=Math.ceil(c.totalRows/(c.size||10));r(a,c);t(a,c);c.initialized? (p.trigger("pagerChange",c),p.trigger("updateComplete")):p.trigger("update")}c.initialized||(c.initialized=!0,g(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),f=g(document),e=b.config;""!==c&&(e.showProcessing&&l.isProcessing(b,!0),f.bind("ajaxError.pager",function(c,d,e,g){C(null,b,a,d,g);f.unbind("ajaxError.pager")}),a.ajaxObject.url=c,a.ajaxObject.success=function(c){C(c,b,a);f.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},g.ajax(a.ajaxObject))}, G=function(b,a){var c=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(c,b){return a.page+(b?parseInt(b,10):0)}).replace(/\{size\}/g,a.size):"",f=b.config.sortList,e=a.currentFilters||[],h=c.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),d=c.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/),k=[];h&&(h=h[1],g.each(f,function(a,b){k.push(h+"["+b[0]+"]="+b[1])}),c=c.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"):h),k=[]);d&&(d=d[1],g.each(e,function(a,b){b&&k.push(d+"["+a+"]="+ encodeURIComponent(b))}),c=c.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,k.length?k.join("&"):d));"function"===typeof a.customAjaxUrl&&(c=a.customAjaxUrl(b,c));return c},y=function(b,a,c){var f,e;f=c.page*c.size;var h=f+c.size;if(!(1>(a&&a.length||0))){c.page>=c.totalPages&&D(b,c);c.isDisabled=!1;c.initialized&&g(b).trigger("pagerChange",c);if(c.removeRows){h>a.length&&(h=a.length);l.clearTableBody(b);for(e=l.processTbody(b,b.config.$tbodies.eq(0),!0);fa.page&&(a.page=0);a.page>e-1&&0!==e&&(a.page=e-1);if(f.page!==a.page||f.size!==a.size||f.total!==a.totalPages||f.filters!==a.currentFilters)a.last={page:a.page,size:a.size,totalPages:a.totalPages,currentFilters:a.currentFilters},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),g.data(b,"pagerLastPage",a.page),g.data(b,"pagerUpdateTriggered",!0),a.initialized&&!1!==c&&g(b).trigger("pageMoved",a)}},z=function(b,a,c){c.size=a;c.$size.val(a);g.data(b,"pagerLastPage",c.page);g.data(b,"pagerLastSize", c.size);c.totalPages=Math.ceil(c.totalRows/(c.size||10));k(b,c)},I=function(b,a){a.page=0;k(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;k(b,a)},J=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);k(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);k(b,a)},F=function(b,a,c){var f=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled= !1;a.page=g.data(b,"pagerLastPage")||a.page||0;a.size=g.data(b,"pagerLastSize")||parseInt(f.find("option[selected]").val(),10)||a.size;f.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/(a.size||10));c&&(g(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a))};w.appender=function(b,a){var c=b.config.pager;c.ajax||(b.config.rowsCopy=a,c.totalRows=a.length,c.size=g.data(b,"pagerLastSize")||c.size,c.totalPages=Math.ceil(c.totalRows/(c.size||10)),y(b,a,c))};w.construct=function(b){return this.each(function(){if(this.config&& this.hasInitialized){var a,c,f,e=this,h=e.config,d=h.pager=g.extend({},g.tablesorterPager.defaults,b),s=h.$table,n=d.$container=g(d.container).addClass("tablesorter-pager").show();d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;h.appender=w.appender;d.savePages&&l.storage&&(a=l.storage(e,"tablesorter-pager")||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10);s.unbind("filterStart.pager filterEnd.pager sortEnd.pager disable.pager enable.pager destroy.pager update.pager pageSize.pager").bind("filterStart.pager", function(a,b){g.data(e,"pagerUpdateTriggered",!1);d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(a){g.data(e,"pagerUpdateTriggered")?g.data(e,"pagerUpdateTriggered",!1):(("filterEnd"===a.type||"sortEnd"===a.type&&h.serverSideSorting)&&k(e,d,!1),r(e,d,!1),t(e,d))}).bind("disable.pager",function(a){a.stopPropagation();E(e,d)}).bind("enable.pager",function(a){a.stopPropagation();F(e,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(e,d);d.$container.hide();e.config.appender= null;d.initialized=!1;g(e).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");l.storage&&l.storage(e,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(e,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();z(e,parseInt(b,10)||10,d);u(e,d);r(e,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation();d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);k(e,d);r(e,d,!1)});c=[d.cssFirst, d.cssPrev,d.cssNext,d.cssLast];f=[I,K,J,D];n.find(c.join(",")).unbind("click.pager").bind("click.pager",function(a){var b=g(this),h=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;aa.filteredRows,a.startRow=g?1:0===a.filteredRows?0:a.size*a.page+1,a.page=g?0:a.page,a.endRow=Math.min(a.filteredRows, a.totalRows,a.size*(a.page+1)),e=a.$container.find(a.cssPageDisplay),g=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(b,d){return a.page+(d?parseInt(d,10):1)}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(b){b=b.replace(/[{}\s]/g,"");var d=b.split(":"),c=a.ajaxData;return 1"+e+"";a.$goto.html(g).val(a.page+1)}w(a);a.initialized&&!1!==c&&(d.$table.trigger("pagerComplete",a),a.savePages&&k.storage&&k.storage(b,"tablesorter-pager",{page:a.page,size:a.size}))},t=function(b,a){var c,e=b.config,f=e.$tbodies.eq(0);a.fixedHeight&&(f.find("tr.pagerSavedHeightSpacer").remove(),c=h.data(b,"pagerSavedHeight"))&&(c-=f.height(),5'))},A=function(b,a){var c=b.config.$tbodies.eq(0);c.find("tr.pagerSavedHeightSpacer").remove();h.data(b,"pagerSavedHeight",c.height());t(b,a);h.data(b,"pagerLastSize",a.size)},u=function(b,a){if(!a.ajaxUrl){var c,e=b.config,f=e.$tbodies.eq(0).children(),g=f.length,d=a.page*a.size,h=d+a.size,k=e.widgetOptions&&e.widgetOptions.filter_filteredRow||"filtered",n=0;for(c=0;c=d&& n'+(0===e.status?"Not connected, verify Network":404===e.status?"Requested page not found [404]":500===e.status?"Internal Server Error [500]":"parsererror"===f?"Requested JSON parse failed":"timeout"===f?"Time out error":"abort"===f?"Ajax Request aborted":"Uncaught error: "+e.statusText+" ["+e.status+"]")+"").click(function(){h(this).remove()}).appendTo(l.find("thead:first")),p.$tbodies.eq(0).empty(); else{h.isArray(g)?(e=isNaN(g[0])&&!isNaN(g[1]),f=g[e?1:0],c.totalRows=isNaN(f)?c.totalRows||0:f,e=g[e?0:1]||[],n=g[2]):(c.ajaxData=g,c.totalRows=g.total,n=g.headers,e=g.rows);x=e.length;if(e instanceof jQuery)p.$tbodies.eq(0).empty().append(e);else if(x){for(g=0;g";for(f=0;f"+e[g][f]+"";q+=""}p.$tbodies.eq(0).html(q)}n&&n.length===b&&(m=(d=l.hasClass("hasStickyHeaders"))?p.$sticky.children("thead:first").children().children():"",s=l.find("tfoot tr:first").children(), p.$headers.filter("th").each(function(a){var b=h(this),c;b.find("."+k.css.icon).length?(c=b.find("."+k.css.icon).clone(!0),b.find(".tablesorter-header-inner").html(n[a]).append(c),d&&m.length&&(c=m.eq(a).find("."+k.css.icon).clone(!0),m.eq(a).find(".tablesorter-header-inner").html(n[a]).append(c))):(b.find(".tablesorter-header-inner").html(n[a]),d&&m.length&&m.eq(a).find(".tablesorter-header-inner").html(n[a]));s.eq(a).html(n[a])}))}p.showProcessing&&k.isProcessing(a);c.last.totalPages=c.totalPages= Math.ceil(c.totalRows/(c.size||10));c.last.currentFilters=c.currentFilters;c.last.sortList=(p.sortList||[]).join(",");r(a,c);t(a,c);l.trigger("applyWidgets");c.initialized?(l.trigger("pagerChange",c),l.trigger("updateComplete")):l.trigger("update")}c.initialized||(c.initialized=!0,h(a).trigger("pagerInitialized",c))},H=function(b,a){var c=G(b,a),e=h(document),f=b.config;""!==c&&(f.showProcessing&&k.isProcessing(b,!0),e.bind("ajaxError.pager",function(c,d,f,h){C(null,b,a,d,h);e.unbind("ajaxError.pager")}), a.ajaxObject.url=c,a.ajaxObject.success=function(c){C(c,b,a);e.unbind("ajaxError.pager");"function"===typeof a.oldAjaxSuccess&&a.oldAjaxSuccess(c)},f.debug&&k.log("ajax initialized",a.ajaxObject),h.ajax(a.ajaxObject))},G=function(b,a){var c=b.config,e=a.ajaxUrl?a.ajaxUrl.replace(/\{page([\-+]\d+)?\}/,function(b,c){return a.page+(c?parseInt(c,10):0)}).replace(/\{size\}/g,a.size):"",f=c.sortList,g=a.currentFilters||h(b).data("lastSearch")||[],d=e.match(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/),l=e.match(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/), m=[];d&&(d=d[1],h.each(f,function(a,b){m.push(d+"["+b[0]+"]="+b[1])}),e=e.replace(/\{\s*sort(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):d),m=[]);l&&(l=l[1],h.each(g,function(a,b){b&&m.push(l+"["+a+"]="+encodeURIComponent(b))}),e=e.replace(/\{\s*filter(?:List)?\s*:\s*(\w*)\s*\}/g,m.length?m.join("&"):l),a.currentFilters=g);"function"===typeof a.customAjaxUrl&&(e=a.customAjaxUrl(b,e));c.debug&&k.log("Pager ajax url: "+e);return e},y=function(b,a,c){var e,f;e=c.page*c.size;var g=e+c.size;if(!(1> (a&&a.length||0))){c.page>=c.totalPages&&D(b,c);c.isDisabled=!1;c.initialized&&h(b).trigger("pagerChange",c);if(c.removeRows){g>a.length&&(g=a.length);k.clearTableBody(b);for(f=k.processTbody(b,b.config.$tbodies.eq(0),!0);ea.page&&(a.page=0);a.page>g-1&&0!==g&&(a.page=g-1);if(f.page!==a.page||f.size!==a.size||f.totalPages!==a.totalPages||(f.currentFilters||[]).join(",")!==(a.currentFilters||[]).join(",")||f.sortList!==(e.sortList||[]).join(","))e.debug&&k.log("Pager changing to page "+ a.page),a.last={page:a.page,size:a.size,sortList:(e.sortList||[]).join(","),totalPages:a.totalPages,currentFilters:a.currentFilters||[]},a.ajax?H(b,a):a.ajax||y(b,b.config.rowsCopy,a),h.data(b,"pagerLastPage",a.page),a.initialized&&!1!==c&&(e.$table.trigger("pageMoved",a),e.$table.trigger("applyWidgets"))}},z=function(b,a,c){c.size=a||c.size||10;c.$size.val(c.size);h.data(b,"pagerLastPage",c.page);h.data(b,"pagerLastSize",c.size);c.totalPages=Math.ceil(c.totalRows/c.size);l(b,c)},I=function(b,a){a.page= 0;l(b,a)},D=function(b,a){a.page=Math.min(a.totalPages,a.filteredPages)-1;l(b,a)},J=function(b,a){a.page++;a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1);l(b,a)},K=function(b,a){a.page--;0>=a.page&&(a.page=0);l(b,a)},F=function(b,a,c){var e=a.$size.removeClass(a.cssDisabled).removeAttr("disabled");a.$goto.removeClass(a.cssDisabled).removeAttr("disabled");a.isDisabled=!1;a.page=h.data(b,"pagerLastPage")||a.page||0;a.size=h.data(b,"pagerLastSize")|| parseInt(e.find("option[selected]").val(),10)||a.size||10;e.val(a.size);a.totalPages=Math.ceil(Math.min(a.totalPages,a.filteredPages)/a.size);c&&(h(b).trigger("update"),z(b,a.size,a),B(b,a),t(b,a),b.config.debug&&k.log("pager enabled"))};v.appender=function(b,a){var c=b.config,e=c.pager;e.ajax||(c.rowsCopy=a,e.totalRows=e.countChildRows?c.$tbodies.eq(0).children().length:a.length,e.size=h.data(b,"pagerLastSize")||e.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),y(b,a,e))};v.construct=function(b){return this.each(function(){if(this.config&& this.hasInitialized){var a,c,e,f=this,g=f.config,d=g.pager=h.extend({},h.tablesorterPager.defaults,b),s=g.$table,m=d.$container=h(d.container).addClass("tablesorter-pager").show();g.debug&&k.log("Pager initializing");d.oldAjaxSuccess=d.oldAjaxSuccess||d.ajaxObject.success;g.appender=v.appender;k.filter&&0<=g.widgets.indexOf("filter")&&(d.currentFilters=g.$table.data("lastSearch")||k.filter.setDefaults(f,g,g.widgetOptions)||[],k.setFilters(f,d.currentFilters,!1));d.savePages&&k.storage&&(a=k.storage(f, "tablesorter-pager")||{},d.page=isNaN(a.page)?d.page:a.page,d.size=(isNaN(a.size)?d.size:a.size)||10,h.data(f,"pagerLastSize",d.size));s.unbind("filterStart filterEnd sortEnd disable enable destroy update pageSize ".split(" ").join(".pager ")).bind("filterStart.pager",function(a,b){d.currentFilters=b}).bind("filterEnd.pager sortEnd.pager",function(){d.initialized&&(l(f,d,!1),r(f,d,!1),t(f,d))}).bind("disable.pager",function(a){a.stopPropagation();E(f,d)}).bind("enable.pager",function(a){a.stopPropagation(); F(f,d,!0)}).bind("destroy.pager",function(a){a.stopPropagation();E(f,d);d.$container.hide();f.config.appender=null;d.initialized=!1;h(f).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager");k.storage&&k.storage(f,"tablesorter-pager","")}).bind("update.pager",function(a){a.stopPropagation();u(f,d)}).bind("pageSize.pager",function(a,b){a.stopPropagation();z(f,parseInt(b,10)||10,d);u(f,d);r(f,d,!1);d.$size.length&&d.$size.val(d.size)}).bind("pageSet.pager",function(a,b){a.stopPropagation(); d.page=(parseInt(b,10)||1)-1;d.$goto.length&&d.$goto.val(d.size);l(f,d);r(f,d,!1)});c=[d.cssFirst,d.cssPrev,d.cssNext,d.cssLast];e=[I,K,J,D];m.find(c.join(",")).unbind("click.pager").bind("click.pager",function(a){a.stopPropagation();var b=h(this),g=c.length;if(!b.hasClass(d.cssDisabled))for(a=0;a=1.2.6" } diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js index 232cc1dc..ea915fef 100644 --- a/js/jquery.tablesorter.js +++ b/js/jquery.tablesorter.js @@ -1,5 +1,5 @@ /**! -* TableSorter 2.13.2 - Client-side table sorting with ease! +* TableSorter 2.13.3 - 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.13.2"; + ts.version = "2.13.3"; ts.parsers = []; ts.widgets = []; diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js index 0cb1da56..1aba2c1c 100644 --- a/js/jquery.tablesorter.min.js +++ b/js/jquery.tablesorter.min.js @@ -1,5 +1,5 @@ /*! -* TableSorter 2.13.2 min - Client-side table sorting with ease! +* TableSorter 2.13.3 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':"";m.$headers=f(a).find(m.selectorHeaders).each(function(a){h=f(this);d=m.headers[a];m.headerContent[a]=f(this).html(); k=m.headerTemplate.replace(/\{content\}/g,f(this).html()).replace(/\{icon\}/g,g);m.onRenderTemplate&&(x=m.onRenderTemplate.apply(h,[a,k]))&&"string"===typeof x&&(k=x);f(this).html('
'+k+"
");m.onRenderHeader&&m.onRenderHeader.apply(h,[a]);this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];var c=e.getData(h,d,"sortInitialOrder")||m.sortInitialOrder;this.order=/^d/i.test(c)||1===c?[1,0,2]:[0,1,2];this.count=-1;this.lockedOrder=!1;q=e.getData(h,d,"lockedOrder")|| !1;"undefined"!==typeof q&&!1!==q&&(this.order=this.lockedOrder=/^d/i.test(q)||1===q?[1,1,1]:[0,0,0]);h.addClass(e.css.header+" "+m.cssHeader);m.headerList[a]=this;h.parent().addClass(e.css.headerRow+" "+m.cssHeaderRow);h.attr("tabindex",0)});D(a);m.debug&&(n("Built headers:",r),c(m.$headers))}function F(a,b,d){var h=a.config;h.$table.find(h.selectorRemove).remove();w(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;f(c)[b?"addClass":"removeClass"]("sorter-false")})}function H(a){var b,d,h,c=a.config,g=c.sortList,k=[e.css.sortAsc+" "+c.cssAsc,e.css.sortDesc+" "+c.cssDesc],q=f(a).find("tfoot tr").children().removeClass(k.join(" "));c.$headers.removeClass(k.join(" "));h=g.length;for(b=0;b"),d=f(a).width();f(a.tBodies[0]).find("tr:first").children("td:visible").each(function(){b.append(f("").css("width",parseInt(f(this).width()/d*1E3,10)/10+"%"))});f(a).prepend(b)}}function M(a,b){var d,h,c,g=a.config,k=b||g.sortList;g.sortList=[];f.each(k,function(a,b){d=[parseInt(b[0],10),parseInt(b[1],10)];if(c=g.$headers[d[0]])g.sortList.push(d),h=f.inArray(d[1], c.order),c.count=0<=h?h:d[1]%(g.sortReset?3:2)})}function N(a,b,d){var h,c,g,k=a.config,q=!d[k.sortMultiSortKey],l=f(a);l.trigger("sortStart",a);b.count=d[k.sortResetKey]?2:(b.count+1)%(k.sortReset?3:2);k.sortRestart&&(c=b,k.$headers.each(function(){this===c||!q&&f(this).is("."+e.css.sortDesc+",."+e.css.sortAsc)||(this.count=-1)}));c=b.column;if(q){k.sortList=[];if(null!==k.sortForce)for(h=k.sortForce,d=0;dh&&(k.sortList.push([c, h]),1h&&(k.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=n;e.construct=function(a){return this.each(function(){var b=f.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=f(a),l=f.metadata;a.hasInitialized=!1;a.isProcessing=!0;a.config=b;f.data(a,"tablesorter",b);b.debug&&f.data(a,"startoveralltimer",new Date);b.supportsTextContent="x"===f("x")[0].textContent;b.supportsDataObject=function(a){a[0]=parseInt(a[0],10);return 1'),d=f.fn.detach?b.detach():b.remove();d=f(a).find("span.tablesorter-savemyplace"); b.insertAfter(d);d.remove();a.isProcessing=!1};e.clearTableBody=function(a){f(a)[0].config.$tbodies.empty()};e.restoreHeaders=function(a){var b=a.config;b.$table.find(b.selectorHeaders).each(function(a){f(this).find(".tablesorter-header-inner").length&&f(this).html(b.headerContent[a])})};e.destroy=function(a,b,d){a=f(a)[0];if(a.hasInitialized){e.refreshWidgets(a,!0,!0);var c=f(a),l=a.config,g=c.find("thead:first"),k=g.find("tr."+e.css.headerRow).removeClass(e.css.headerRow+" "+l.cssHeaderRow),n=c.find("tfoot:first > tr").children("th, td"); g.find("tr").not(k).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 "));l.$headers.add(n).removeClass([e.css.header,l.cssHeader,l.cssAsc,l.cssDesc,e.css.sortAsc,e.css.sortDesc].join(" ")).removeAttr("data-column");k.find(l.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter keypress.tablesorter"); e.restoreHeaders(a);!1!==b&&c.removeClass(e.css.table+" "+l.tableClass+" tablesorter-"+l.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,f,g,k,l;c=e.regex;if(c.hex.test(b)){d=parseInt(a.match(c.hex),16);f=parseInt(b.match(c.hex),16);if(df)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");l=Math.max(d.length,c.length);for(k=0;kg)return 1}return 0};e.sortText=function(a,b){return a>b?1:af.inArray(k[h].id,g))&&(l.debug&& c("Refeshing widgets: Removing "+k[h].id),k[h].hasOwnProperty("remove")&&(k[h].remove(a,l,l.widgetOptions),l.widgetInit[k[h].id]=!1));!0!==d&&e.applyWidget(a,b)};e.getData=function(a,b,c){var e="";a=f(a);var l,g;if(!a.length)return"";l=f.metadata?a.metadata():!1;g=" "+(a.attr("class")||"");"undefined"!==typeof a.data(c)||"undefined"!==typeof a.data(c.toLowerCase())?e+=a.data(c)||a.data(c.toLowerCase()):l&&"undefined"!==typeof l[c]?e+=l[c]:b&&"undefined"!==typeof b[c]?e+=b[c]:" "!==g&&g.match(" "+ c+"-")&&(e=g.match(RegExp("\\s"+c+"-([\\w-]+)"))[1]||"");return f.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)?f.trim(a):c};e.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}}); var p=f.tablesorter;f.fn.extend({tablesorter:p.construct});p.addParser({id:"text",is:function(){return!0},format:function(c,n){var l=n.config;c&&(c=f.trim(l.ignoreCase?c.toLocaleLowerCase():c),c=l.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 l=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),n);return c&&"number"===typeof l?l:c?f.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 l=p.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),n);return c&&"number"===typeof l?l:c?f.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,f){var l,u=c?c.split("."): "",w="",z=u.length;for(l=0;lc.length},format:function(c,f){return c?p.formatFloat(c.replace(/%/g,""),f):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,f){return c?p.formatFloat((new Date(c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",f):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,f,l,u){if(c){l=f.config;var w=l.headerList[u];u=w.dateFormat||p.getData(w,l.headers[u],"dateFormat")||l.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()|| "",f):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,f){return c?p.formatFloat((new Date("2000/01/01 "+c.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",f):c},type:"numeric"});p.addParser({id:"metadata",is:function(){return!1},format:function(c,n,l){c=n.config;c=c.parserMetadataName?c.parserMetadataName:"sortValue";return f(l).metadata()[c]},type:"numeric"});p.addWidget({id:"zebra",priority:90,format:function(c, n,l){var u,w,z,B,E,C,F=RegExp(n.cssChildRow,"i"),D=n.$tbodies;n.debug&&(E=new Date);for(c=0;c').appendTo(b).bind("change.tsfilter",function(){i({value:this.value,delayed:!1})}),g=[],h=b.closest("table")[0].config,i=function(c){var f,d=!0,h=c&&c.value&&a.tablesorter.formatFloat((c.value+"").replace(/[><=]/g,""))||b.find(".spinner").val()||e.value;e.addToggle&&(d=b.find(".toggle").is(":checked")),f=e.disabled||!d?"disable":"enable",b.find(".filter").val(d?(e.compare?e.compare:e.exactMatch?"=":"")+h:"").trigger("search",c&&"boolean"==typeof c.delayed?c.delayed:e.delayed).end().find(".spinner").spinner(f).val(h),g.length&&(g.find(".spinner").spinner(f).val(h),e.addToggle&&(g.find(".toggle")[0].checked=d))};return e.oldcreate=e.create,e.oldspin=e.spin,e.create=function(a,b){i(),"function"==typeof e.oldcreate&&e.oldcreate(a,b)},e.spin=function(a,b){i(b),"function"==typeof e.oldspin&&e.oldspin(a,b)},e.addToggle&&a('
').appendTo(b).find(".toggle").bind("change",function(){i()}),b.closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed"),a('').val(e.value).appendTo(b).spinner(e).bind("change keyup",function(){i()}),h.$table.bind("stickyHeadersInit",function(){g=h.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),e.addToggle&&a('
').appendTo(g).find(".toggle").bind("change",function(){b.find(".toggle")[0].checked=this.checked,i()}),a('').val(e.value).appendTo(g).spinner(e).bind("change keyup",function(){b.find(".spinner").val(this.value),i()})}),h.$table.bind("filterReset",function(){e.addToggle&&(b.find(".toggle")[0].checked=!1),i()}),i(),f},uiSlider:function(b,c,d){var e=a.extend({value:0,min:0,max:100,step:1,range:"min",delayed:!0,valueToHeader:!1,exactMatch:!0,compare:"",allText:"all"},d),f=a('').appendTo(b).bind("change.tsfilter",function(){i({value:this.value})}),g=[],h=b.closest("table")[0].config,i=function(d){var f="undefined"!=typeof d?a.tablesorter.formatFloat((d.value+"").replace(/[><=]/g,""))||e.min:e.value,h=e.compare?f:f===e.min?e.allText:f,i=e.compare+h;e.valueToHeader?b.closest("thead").find("th[data-column="+c+"]").find(".curvalue").html(" ("+i+")"):b.find(".ui-slider-handle").addClass("value-popup").attr("data-value",i),b.find(".filter").val(e.compare?e.compare+f:f===e.min?"":(e.exactMatch?"=":"")+f).trigger("search",d&&"boolean"==typeof d.delayed?d.delayed:e.delayed).end().find(".slider").slider("value",f),g.length&&(g.find(".slider").slider("value",f),e.valueToHeader?g.closest("thead").find("th[data-column="+c+"]").find(".curvalue").html(" ("+i+")"):g.find(".ui-slider-handle").addClass("value-popup").attr("data-value",i))};return b.closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed"),e.valueToHeader&&b.closest("thead").find("th[data-column="+c+"]").find(".tablesorter-header-inner").append(''),e.oldcreate=e.create,e.oldslide=e.slide,e.create=function(a,b){i(),"function"==typeof e.oldcreate&&e.oldcreate(a,b)},e.slide=function(a,b){i(b),"function"==typeof e.oldslide&&e.oldslide(a,b)},a('
').appendTo(b).slider(e),h.$table.bind("filterReset",function(){b.find(".slider").slider("value",e.value),i()}),h.$table.bind("stickyHeadersInit",function(){g=h.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),a('
').val(e.value).appendTo(g).slider(e).bind("change keyup",function(){b.find(".slider").val(this.value),i()})}),f},uiRange:function(b,c,d){var e=a.extend({values:[0,100],min:0,max:100,range:!0,delayed:!0,valueToHeader:!1},d),f=a('').appendTo(b).bind("change.tsfilter",function(){var a=this.value.split(" - ");""===this.value&&(a=[e.min,e.max]),a&&a[1]&&i({values:a,delay:!1})}),g=[],h=b.closest("table")[0].config,i=function(a){var d=a&&a.values||e.values,f=d[0]+" - "+d[1],h=d[0]===e.min&&d[1]===e.max?"":f;e.valueToHeader?b.closest("thead").find("th[data-column="+c+"]").find(".currange").html(" ("+f+")"):b.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",d[0]).end().eq(1).attr("data-value",d[1]),b.find(".filter").val(h).trigger("search",a&&"boolean"==typeof a.delayed?a.delayed:e.delayed).end().find(".range").slider("values",d),g.length&&(g.find(".range").slider("values",d),e.valueToHeader?g.closest("thead").find("th[data-column="+c+"]").find(".currange").html(" ("+f+")"):g.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",d[0]).end().eq(1).attr("data-value",d[1]))};return b.closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed"),e.valueToHeader&&b.closest("thead").find("th[data-column="+c+"]").find(".tablesorter-header-inner").append(''),e.oldcreate=e.create,e.oldslide=e.slide,e.create=function(a,b){i(),"function"==typeof e.oldcreate&&e.oldcreate(a,b)},e.slide=function(a,b){i(b),"function"==typeof e.oldslide&&e.oldslide(a,b)},a('
').appendTo(b).slider(e),h.$table.bind("filterReset",function(){b.find(".range").slider("values",e.values),i()}),h.$table.bind("stickyHeadersInit",function(){g=h.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),a('
').val(e.value).appendTo(g).slider(e).bind("change keyup",function(){b.find(".range").val(this.value),i()})}),f},uiDateCompare:function(b,c,d){var h,i,e=a.extend({defaultDate:"",cellText:"",changeMonth:!0,changeYear:!0,numberOfMonths:1,compare:"",compareOptions:!1},d),f=b.closest("thead").find("th[data-column="+c+"]"),g=a('').appendTo(b).bind("change.tsfilter",function(){var a=this.value;a&&e.onClose(a)}),j=[],k=b.closest("table")[0].config,l=function(a){var c=new Date(b.find(".date").datepicker("getDate")).getTime();b.find(".compare").val(a),b.find(".dateCompare").val(a+c).trigger("search",e.delayed).end(),j.length&&j.find(".compare").val(a)};if(f.addClass("filter-parsed"),e.compareOptions){i='",b.append(i).find(".compare").bind("change",function(){l(a(this).val())})}else e.cellText&&(i="",b.append(i));return h='',a(h).appendTo(b),e.oldonClose=e.onClose,e.onClose=function(a,c){var d=new Date(b.find(".date").datepicker("getDate")).getTime()||"",f=b.find(".compare").val()||e.compare;b.find(".dateCompare").val(f+d).trigger("search").end().find(".date").datepicker("setDate",a),j.length&&j.find(".date").datepicker("setDate",a),"function"==typeof e.oldonClose&&e.oldonClose(a,c)},b.find(".date").datepicker(e),e.filterDate&&b.find(".date").datepicker("setDate",e.filterDate),k.$table.bind("filterReset",function(){b.find(".date").val("").datepicker("option","currentText",""),j.length&&j.find(".date").val("").datepicker("option","currentText","")}),k.$table.bind("stickyHeadersInit",function(){j=k.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),e.compareOptions?j.append(i).find(".compare").bind("change",function(){l(a(this).val())}):e.cellText&&j.append(i),j.append(h).find(".date").datepicker(e)}),g.val(e.defaultDate?e.defaultDate:"")},uiDatepicker:function(b,c,d){var f,g,h,e=a.extend({from:"",to:"",textFrom:"from",textTo:"to",changeMonth:!0,changeYear:!0,numberOfMonths:1},d),i=[],j=a('').appendTo(b).bind("change.tsfilter",function(){var a=this.value;a.match(" - ")?(a=a.split(" - "),b.find(".dateTo").val(a[1]),h(a[0])):a.match(">=")?h(a.replace(">=","")):a.match("<=")&&g(a.replace("<=",""))}),k=b.closest("table")[0].config;b.closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed"),f="',a(f).appendTo(b),e.oldonClose=e.onClose;var l=e.defaultDate=e.from||e.defaultDate;return h=e.onClose=function(a,c){var d=new Date(b.find(".dateFrom").datepicker("getDate")).getTime()||"",f=new Date(b.find(".dateTo").datepicker("getDate")).getTime()||"",g=d?f?d+" - "+f:">="+d:f?"<="+f:"";b.find(".dateRange").val(g).trigger("search").end().find(".dateTo").datepicker("option","minDate",a).end().find(".dateFrom").val(a),i.length&&i.find(".dateTo").datepicker("option","minDate",a).end().find(".dateFrom").val(a),"function"==typeof e.oldonClose&&e.oldonClose(a,c)},b.find(".dateFrom").datepicker(e),e.defaultDate=e.to||"+7d",g=e.onClose=function(a,c){var d=new Date(b.find(".dateFrom").datepicker("getDate")).getTime()||"",f=new Date(b.find(".dateTo").datepicker("getDate")).getTime()||"",g=d?f?d+" - "+f:">="+d:f?"<="+f:"";b.find(".dateRange").val(g).trigger("search").end().find(".dateFrom").datepicker("option","maxDate",a).end().find(".dateTo").val(a),i.length&&i.find(".dateFrom").datepicker("option","maxDate",a).end().find(".dateTo").val(a),"function"==typeof e.oldonClose&&e.oldonClose(a,c)},b.find(".dateTo").datepicker(e),k.$table.bind("stickyHeadersInit",function(){i=k.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),i.append(f),e.onClose=g,i.find(".dateTo").datepicker(e),e.defaultDate=l,e.onClose=h,i.find(".dateFrom").datepicker(e)}),b.closest("table").bind("filterReset",function(){b.find(".dateFrom, .dateTo").val("").datepicker("option","currentText",""),i.length&&i.find(".dateFrom, .dateTo").val("").datepicker("option","currentText","")}),j.val(e.from?e.to?e.from+" - "+e.to:">="+e.from:e.to?"<="+e.to:"")},html5Number:function(b,c,d){var e,e,i,f=a.extend({value:0,min:0,max:100,step:1,delayed:!0,disabled:!1,addToggle:!0,exactMatch:!0,compare:"",compareOptions:!1,skipTest:!1},d),g=a('').appendTo(b),h=f.skipTest||"number"===g.attr("type")&&"test"!==g.val(),j=[],k=b.closest("table")[0].config,l=function(a){var c=b.find(".number").val();b.find(".compare").val(a),b.find("input[type=hidden]").val(a+c).trigger("search",f.delayed).end(),j.length&&j.find(".compare").val(a)},m=function(a,c){var d=f.addToggle?b.find(".toggle").is(":checked"):!0,e=b.find(".compare").val()||f.compare;b.find("input[type=hidden]").val(!f.addToggle||d?(f.compare?f.compare:f.exactMatch?"=":"")+a:"").val(!f.addToggle||d?e+a:"").trigger("search",c?c:f.delayed).end().find(".number").val(a),b.find(".number").length&&(b.find(".number")[0].disabled=f.disabled||!d),j.length&&(j.find(".number").val(a)[0].disabled=f.disabled||!d,f.addToggle&&(j.find(".toggle")[0].checked=d))};if(g.remove(),h&&(i=f.addToggle?'
':""),f.compareOptions){i='",b.append(i).find(".compare").bind("change",function(){l(a(this).val())})}else i&&b.append(i);return h&&(e='',b.append(e+'').find(".toggle, .number").bind("change",function(){m(b.find(".number").val())}).closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed").closest("table").bind("filterReset",function(){f.addToggle&&(b.find(".toggle")[0].checked=!1,j.length&&(j.find(".toggle")[0].checked=!1)),m(b.find(".number").val())}),k.$table.bind("stickyHeadersInit",function(){j=k.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),f.compareOptions?j.append(i).find(".compare").bind("change",function(){l(a(this).val())}):j.append(i),j.append(e).find(".toggle, .number").bind("change",function(){m(j.find(".number").val())}),m(b.find(".number").val())}),m(b.find(".number").val())),h?b.find('input[type="hidden"]'):a('')},html5Range:function(b,c,d){var f=a.extend({value:0,min:0,max:100,step:1,delayed:!0,valueToHeader:!0,exactMatch:!0,compare:"",allText:"all",skipTest:!1},d),g=a('').appendTo(b),h=f.skipTest||"range"===g.attr("type")&&"test"!==g.val(),i=[],j=b.closest("table")[0].config,k=function(a,d){a=(a+"").replace(/[<>=]/g,"")||f.min;var e=" ("+(f.compare?f.compare+a:a==f.min?f.allText:a)+")";b.find("input[type=hidden]").val(f.compare?f.compare+a:a==f.min?"":(f.exactMatch?"=":"")+a).trigger("search",d?d:f.delayed).end().find(".range").val(a),b.closest("thead").find("th[data-column="+c+"]").find(".curvalue").html(e),i.length&&(i.find(".range").val(a),i.closest("thead").find("th[data-column="+c+"]").find(".curvalue").html(e))};return g.remove(),h&&(b.html('').closest("thead").find("th[data-column="+c+"]").addClass("filter-parsed").find(".tablesorter-header-inner").append(''),b.find(".range").bind("change",function(){k(this.value)}),b.find("input[type=hidden]").bind("change.tsfilter",function(){var a=this.value;a!==this.lastValue&&(this.lastValue=f.compare?f.compare+a:a==f.min?"":(f.exactMatch?"=":"")+a,this.value=this.lastValue,k(a))}),j.$table.bind("stickyHeadersInit",function(){i=j.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c).empty(),i.html('').find(".range").bind("change",function(){k(i.find(".range").val())}),k(b.find(".range").val())}),b.closest("table").bind("filterReset",function(){k(f.value)}),k(b.find(".range").val())),h?b.find('input[type="hidden"]'):a('')},html5Color:function(b,c,d){var e,f=a.extend({value:"#000000",disabled:!1,addToggle:!0,exactMatch:!0,valueToHeader:!1,skipTest:!1},d),g=a('').appendTo(b),h=f.skipTest||"color"===g.attr("type")&&"test"!==g.val(),i=[],j=b.closest("table")[0].config,k=function(a){a=a||f.value;var d=!0,e=" ("+a+")";f.addToggle&&(d=b.find(".toggle").is(":checked")),b.find(".colorpicker").length&&(b.find(".colorpicker").val(a)[0].disabled=f.disabled||!d),b.find("input[type=hidden]").val(d?a+(f.exactMatch?"=":""):"").trigger("search"),f.valueToHeader?b.closest("thead").find("th[data-column="+c+"]").find(".curcolor").html(e):b.find(".currentColor").html(e),i.length&&(i.find(".colorpicker").val(a)[0].disabled=f.disabled||!d,f.addToggle&&(i.find(".toggle")[0].checked=d),f.valueToHeader?i.closest("thead").find("th[data-column="+c+"]").find(".curcolor").html(e):i.find(".currentColor").html(e))};return g.remove(),h&&(e='
',e+=f.addToggle?'
':"",e+='',e+=(f.valueToHeader?"":'(#000000)')+"
",b.html(e),f.valueToHeader&&b.closest("thead").find("th[data-column="+c+"]").find(".tablesorter-header-inner").append(''),b.find(".toggle, .colorpicker").bind("change",function(){k(b.find(".colorpicker").val())}),b.find("input[type=hidden]").bind("change.tsfilter",function(){k(this.value)}),b.closest("table").bind("filterReset",function(){b.find(".toggle")[0].checked=!1,k(b.find(".colorpicker").val())}),j.$table.bind("stickyHeadersInit",function(){i=j.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(c),i.html(e).find(".toggle, .colorpicker").bind("change",function(){k(i.find(".colorpicker").val())}),k(i.find(".colorpicker").val())}),k(f.value)),h?b.find('input[type="hidden"]'):a('')}}}(jQuery); +;(function(k){k.tablesorter=k.tablesorter||{};k.tablesorter.filterFormatter={uiSpinner:function(b,e,h){var a=k.extend({min:0,max:100,step:1,value:1,delayed:!0,addToggle:!0,disabled:!1,exactMatch:!0,compare:""},h);h=k('').appendTo(b).bind("change.tsfilter",function(){c({value:this.value,delayed:!1})});var d=[],l=b.closest("table")[0].config,c=function(f){var g=!0,c,e=f&&f.value&&k.tablesorter.formatFloat((f.value+"").replace(/[><=]/g,""))||b.find(".spinner").val()|| a.value;a.addToggle&&(g=b.find(".toggle").is(":checked"));c=a.disabled||!g?"disable":"enable";b.find(".filter").val(g?(a.compare?a.compare:a.exactMatch?"=":"")+e:"").trigger("search",f&&"boolean"===typeof f.delayed?f.delayed:a.delayed).end().find(".spinner").spinner(c).val(e);d.length&&(d.find(".spinner").spinner(c).val(e),a.addToggle&&(d.find(".toggle")[0].checked=g))};a.oldcreate=a.create;a.oldspin=a.spin;a.create=function(b,g){c();"function"===typeof a.oldcreate&&a.oldcreate(b,g)};a.spin=function(b, g){c(g);"function"===typeof a.oldspin&&a.oldspin(b,g)};a.addToggle&&k('
').appendTo(b).find(".toggle").bind("change",function(){c()});b.closest("thead").find("th[data-column="+e+"]").addClass("filter-parsed");k('').val(a.value).appendTo(b).spinner(a).bind("change keyup",function(){c()});l.$table.bind("stickyHeadersInit",function(){d= l.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty();a.addToggle&&k('
').appendTo(d).find(".toggle").bind("change",function(){b.find(".toggle")[0].checked=this.checked;c()});k('').val(a.value).appendTo(d).spinner(a).bind("change keyup",function(){b.find(".spinner").val(this.value);c()})}); l.$table.bind("filterReset",function(){a.addToggle&&(b.find(".toggle")[0].checked=!1);c()});c();return h},uiSlider:function(b,e,h){var a=k.extend({value:0,min:0,max:100,step:1,range:"min",delayed:!0,valueToHeader:!1,exactMatch:!0,compare:"",allText:"all"},h);h=k('').appendTo(b).bind("change.tsfilter",function(){c({value:this.value})});var d=[],l=b.closest("table")[0].config,c=function(f){var c="undefined"!==typeof f?k.tablesorter.formatFloat((f.value+"").replace(/[><=]/g, ""))||a.min:a.value,h=a.compare+(a.compare?c:c===a.min?a.allText:c);a.valueToHeader?b.closest("thead").find("th[data-column="+e+"]").find(".curvalue").html(" ("+h+")"):b.find(".ui-slider-handle").addClass("value-popup").attr("data-value",h);b.find(".filter").val(a.compare?a.compare+c:c===a.min?"":(a.exactMatch?"=":"")+c).trigger("search",f&&"boolean"===typeof f.delayed?f.delayed:a.delayed).end().find(".slider").slider("value",c);d.length&&(d.find(".slider").slider("value",c),a.valueToHeader?d.closest("thead").find("th[data-column="+ e+"]").find(".curvalue").html(" ("+h+")"):d.find(".ui-slider-handle").addClass("value-popup").attr("data-value",h))};b.closest("thead").find("th[data-column="+e+"]").addClass("filter-parsed");a.valueToHeader&&b.closest("thead").find("th[data-column="+e+"]").find(".tablesorter-header-inner").append('');a.oldcreate=a.create;a.oldslide=a.slide;a.create=function(b,d){c();"function"===typeof a.oldcreate&&a.oldcreate(b,d)};a.slide=function(b,d){c(d);"function"===typeof a.oldslide&& a.oldslide(b,d)};k('
').appendTo(b).slider(a);l.$table.bind("filterReset",function(){b.find(".slider").slider("value",a.value);c()});l.$table.bind("stickyHeadersInit",function(){d=l.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty();k('
').val(a.value).appendTo(d).slider(a).bind("change keyup",function(){b.find(".slider").val(this.value);c()})});return h},uiRange:function(b,e,h){var a=k.extend({values:[0,100], min:0,max:100,range:!0,delayed:!0,valueToHeader:!1},h);h=k('').appendTo(b).bind("change.tsfilter",function(){var b=this.value.split(" - ");""===this.value&&(b=[a.min,a.max]);b&&b[1]&&c({values:b,delay:!1})});var d=[],l=b.closest("table")[0].config,c=function(c){var g=c&&c.values||a.values,h=g[0]+" - "+g[1],m=g[0]===a.min&&g[1]===a.max?"":h;a.valueToHeader?b.closest("thead").find("th[data-column="+e+"]").find(".currange").html(" ("+h+")"):b.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value", g[0]).end().eq(1).attr("data-value",g[1]);b.find(".filter").val(m).trigger("search",c&&"boolean"===typeof c.delayed?c.delayed:a.delayed).end().find(".range").slider("values",g);d.length&&(d.find(".range").slider("values",g),a.valueToHeader?d.closest("thead").find("th[data-column="+e+"]").find(".currange").html(" ("+h+")"):d.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",g[0]).end().eq(1).attr("data-value",g[1]))};b.closest("thead").find("th[data-column="+e+"]").addClass("filter-parsed"); a.valueToHeader&&b.closest("thead").find("th[data-column="+e+"]").find(".tablesorter-header-inner").append('');a.oldcreate=a.create;a.oldslide=a.slide;a.create=function(b,d){c();"function"===typeof a.oldcreate&&a.oldcreate(b,d)};a.slide=function(b,d){c(d);"function"===typeof a.oldslide&&a.oldslide(b,d)};k('
').appendTo(b).slider(a);l.$table.bind("filterReset",function(){b.find(".range").slider("values",a.values);c()});l.$table.bind("stickyHeadersInit", function(){d=l.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty();k('
').val(a.value).appendTo(d).slider(a).bind("change keyup",function(){b.find(".range").val(this.value);c()})});return h},uiDateCompare:function(b,e,h){var a=k.extend({defaultDate:"",cellText:"",changeMonth:!0,changeYear:!0,numberOfMonths:1,compare:"",compareOptions:!1},h);h=b.closest("thead").find("th[data-column="+e+"]");var d=k('').appendTo(b).bind("change.tsfilter", function(){var b=this.value;if(b)a.onClose(b)}),l,c,f=[],g=b.closest("table")[0].config,n=function(c){var d=(new Date(b.find(".date").datepicker("getDate"))).getTime();b.find(".compare").val(c);b.find(".dateCompare").val(c+d).trigger("search",a.delayed).end();f.length&&f.find(".compare").val(c)};h.addClass("filter-parsed");if(a.compareOptions){c='"; b.append(c).find(".compare").bind("change",function(){n(k(this).val())})}else a.cellText&&(c="",b.append(c));l='';k(l).appendTo(b);a.oldonClose=a.onClose;a.onClose=function(c,d){var g=(new Date(b.find(".date").datepicker("getDate"))).getTime()||"",e=b.find(".compare").val()||a.compare;b.find(".dateCompare").val(e+g).trigger("search").end().find(".date").datepicker("setDate", c);f.length&&f.find(".date").datepicker("setDate",c);"function"===typeof a.oldonClose&&a.oldonClose(c,d)};b.find(".date").datepicker(a);a.filterDate&&b.find(".date").datepicker("setDate",a.filterDate);g.$table.bind("filterReset",function(){b.find(".date").val("").datepicker("option","currentText","");f.length&&f.find(".date").val("").datepicker("option","currentText","")});g.$table.bind("stickyHeadersInit",function(){f=g.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty(); a.compareOptions?f.append(c).find(".compare").bind("change",function(){n(k(this).val())}):a.cellText&&f.append(c);f.append(l).find(".date").datepicker(a)});return d.val(a.defaultDate?a.defaultDate:"")},uiDatepicker:function(b,e,h){var a=k.extend({from:"",to:"",textFrom:"from",textTo:"to",changeMonth:!0,changeYear:!0,numberOfMonths:1},h),d,l,c,f=[];h=k('').appendTo(b).bind("change.tsfilter",function(){var a=this.value;a.match(" - ")?(a=a.split(" - "),b.find(".dateTo").val(a[1]), c(a[0])):a.match(">=")?c(a.replace(">=","")):a.match("<=")&&l(a.replace("<=",""))});var g=b.closest("table")[0].config;b.closest("thead").find("th[data-column="+e+"]").addClass("filter-parsed");d="';k(d).appendTo(b);a.oldonClose=a.onClose;var n=a.defaultDate=a.from||a.defaultDate;c=a.onClose=function(c,d){var g=(new Date(b.find(".dateFrom").datepicker("getDate"))).getTime()|| "",e=(new Date(b.find(".dateTo").datepicker("getDate"))).getTime()||"",g=g?e?g+" - "+e:">="+g:e?"<="+e:"";b.find(".dateRange").val(g).trigger("search").end().find(".dateTo").datepicker("option","minDate",c).end().find(".dateFrom").val(c);f.length&&f.find(".dateTo").datepicker("option","minDate",c).end().find(".dateFrom").val(c);"function"===typeof a.oldonClose&&a.oldonClose(c,d)};b.find(".dateFrom").datepicker(a);a.defaultDate=a.to||"+7d";l=a.onClose=function(c,d){var g=(new Date(b.find(".dateFrom").datepicker("getDate"))).getTime()|| "",e=(new Date(b.find(".dateTo").datepicker("getDate"))).getTime()||"",g=g?e?g+" - "+e:">="+g:e?"<="+e:"";b.find(".dateRange").val(g).trigger("search").end().find(".dateFrom").datepicker("option","maxDate",c).end().find(".dateTo").val(c);f.length&&f.find(".dateFrom").datepicker("option","maxDate",c).end().find(".dateTo").val(c);"function"===typeof a.oldonClose&&a.oldonClose(c,d)};b.find(".dateTo").datepicker(a);g.$table.bind("stickyHeadersInit",function(){f=g.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty(); f.append(d);a.onClose=l;f.find(".dateTo").datepicker(a);a.defaultDate=n;a.onClose=c;f.find(".dateFrom").datepicker(a)});b.closest("table").bind("filterReset",function(){b.find(".dateFrom, .dateTo").val("").datepicker("option","currentText","");f.length&&f.find(".dateFrom, .dateTo").val("").datepicker("option","currentText","")});return h.val(a.from?a.to?a.from+" - "+a.to:">="+a.from:a.to?"<="+a.to:"")},html5Number:function(b,e,h){var a,d=k.extend({value:0,min:0,max:100,step:1,delayed:!0,disabled:!1, addToggle:!0,exactMatch:!0,compare:"",compareOptions:!1,skipTest:!1},h);h=k('').appendTo(b);var l=d.skipTest||"number"===h.attr("type")&&"test"!==h.val(),c,f=[],g=b.closest("table")[0].config,n=function(a){var c=b.find(".number").val();b.find(".compare").val(a);b.find("input[type=hidden]").val(a+c).trigger("search",d.delayed).end();f.length&&f.find(".compare").val(a)},m=function(a,c){var g=d.addToggle?b.find(".toggle").is(":checked"):!0, e=b.find(".compare").val()||d.compare;b.find("input[type=hidden]").val(!d.addToggle||g?(e?e:d.exactMatch?"=":"")+a:"").trigger("search",c?c:d.delayed).end().find(".number").val(a);b.find(".number").length&&(b.find(".number")[0].disabled=d.disabled||!g);f.length&&(f.find(".number").val(a)[0].disabled=d.disabled||!g,d.addToggle&&(f.find(".toggle")[0].checked=g))};h.remove();l&&(c=d.addToggle?'
':"");if(d.compareOptions){c='";b.append(c).find(".compare").bind("change",function(){n(k(this).val())})}else c&&b.append(c);l&&(a='',b.append(a+'').find(".toggle, .number").bind("change",function(){m(b.find(".number").val())}).closest("thead").find("th[data-column="+ e+"]").addClass("filter-parsed").closest("table").bind("filterReset",function(){d.addToggle&&(b.find(".toggle")[0].checked=!1,f.length&&(f.find(".toggle")[0].checked=!1));m(b.find(".number").val())}),g.$table.bind("stickyHeadersInit",function(){f=g.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty();d.compareOptions?f.append(c).find(".compare").bind("change",function(){n(k(this).val())}):f.append(c);f.append(a).find(".toggle, .number").bind("change",function(){m(f.find(".number").val())}); m(b.find(".number").val())}),m(b.find(".number").val()));return l?b.find('input[type="hidden"]'):k('')},html5Range:function(b,e,h){var a=k.extend({value:0,min:0,max:100,step:1,delayed:!0,valueToHeader:!0,exactMatch:!0,compare:"",allText:"all",skipTest:!1},h);h=k('').appendTo(b);var d=a.skipTest||"range"===h.attr("type")&&"test"!==h.val(),l=[],c=b.closest("table")[0].config,f=function(c,d){c=(c+"").replace(/[<>=]/g,"")|| a.min;var f=" ("+(a.compare?a.compare+c:c==a.min?a.allText:c)+")";b.find("input[type=hidden]").val(a.compare?a.compare+c:c==a.min?"":(a.exactMatch?"=":"")+c).trigger("search",d?d:a.delayed).end().find(".range").val(c);b.closest("thead").find("th[data-column="+e+"]").find(".curvalue").html(f);l.length&&(l.find(".range").val(c),l.closest("thead").find("th[data-column="+e+"]").find(".curvalue").html(f))};h.remove();d&&(b.html('').closest("thead").find("th[data-column="+e+"]").addClass("filter-parsed").find(".tablesorter-header-inner").append(''),b.find(".range").bind("change",function(){f(this.value)}),b.find("input[type=hidden]").bind("change.tsfilter",function(){var b=this.value;b!==this.lastValue&&(this.value=this.lastValue=a.compare?a.compare+b:b==a.min?"":(a.exactMatch?"=":"")+b,f(b))}),c.$table.bind("stickyHeadersInit",function(){l=c.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e).empty(); l.html('').find(".range").bind("change",function(){f(l.find(".range").val())});f(b.find(".range").val())}),b.closest("table").bind("filterReset",function(){f(a.value)}),f(b.find(".range").val()));return d?b.find('input[type="hidden"]'):k('')},html5Color:function(b,e,h){var a,d=k.extend({value:"#000000",disabled:!1,addToggle:!0,exactMatch:!0,valueToHeader:!1,skipTest:!1},h);h=k('').appendTo(b); var l=d.skipTest||"color"===h.attr("type")&&"test"!==h.val(),c=[],f=b.closest("table")[0].config,g=function(a){a=a||d.value;var f=!0,g=" ("+a+")";d.addToggle&&(f=b.find(".toggle").is(":checked"));b.find(".colorpicker").length&&(b.find(".colorpicker").val(a)[0].disabled=d.disabled||!f);b.find("input[type=hidden]").val(f?a+(d.exactMatch?"=":""):"").trigger("search");d.valueToHeader?b.closest("thead").find("th[data-column="+e+"]").find(".curcolor").html(g):b.find(".currentColor").html(g);c.length&&(c.find(".colorpicker").val(a)[0].disabled= d.disabled||!f,d.addToggle&&(c.find(".toggle")[0].checked=f),d.valueToHeader?c.closest("thead").find("th[data-column="+e+"]").find(".curcolor").html(g):c.find(".currentColor").html(g))};h.remove();l&&(a='
',a+=d.addToggle?'
':"",a+='',a+=(d.valueToHeader?"":'(#000000)')+ "
",b.html(a),d.valueToHeader&&b.closest("thead").find("th[data-column="+e+"]").find(".tablesorter-header-inner").append(''),b.find(".toggle, .colorpicker").bind("change",function(){g(b.find(".colorpicker").val())}),b.find("input[type=hidden]").bind("change.tsfilter",function(){g(this.value)}),b.closest("table").bind("filterReset",function(){b.find(".toggle")[0].checked=!1;g(b.find(".colorpicker").val())}),f.$table.bind("stickyHeadersInit",function(){c=f.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(e); c.html(a).find(".toggle, .colorpicker").bind("change",function(){g(c.find(".colorpicker").val())});g(c.find(".colorpicker").val())}),g(d.value));return l?b.find('input[type="hidden"]'):k('')}}})(jQuery); \ No newline at end of file diff --git a/js/jquery.tablesorter.widgets.js b/js/jquery.tablesorter.widgets.js index cae8d19c..fe2d31d4 100644 --- a/js/jquery.tablesorter.widgets.js +++ b/js/jquery.tablesorter.widgets.js @@ -1,4 +1,4 @@ -/*! tableSorter 2.8+ widgets - updated 11/8/2013 +/*! tableSorter 2.8+ widgets - updated 11/9/2013 * * Column Styles * Column Filters @@ -526,7 +526,7 @@ ts.filter = { } }, init: function(table, c, wo) { - var indx, options, string, $header, column, filters, time; + var options, string, $header, column, filters, time; if (c.debug) { time = new Date(); } diff --git a/js/jquery.tablesorter.widgets.min.js b/js/jquery.tablesorter.widgets.min.js index b832a072..99f838a8 100644 --- a/js/jquery.tablesorter.widgets.min.js +++ b/js/jquery.tablesorter.widgets.min.js @@ -1,16 +1,17 @@ -/*! tableSorter 2.8+ widgets - updated 11/2/2013 */ -;(function(g){ -var d=g.tablesorter=g.tablesorter||{}; -d.themes={bootstrap:{table:"table table-bordered table-striped",header:"bootstrap-header",footerRow:"",footerCells:"",icons:"",sortNone:"bootstrap-icon-unsorted",sortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",sortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",active:"",hover:"",filterRow:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",header:"ui-widget-header ui-corner-all ui-state-default",footerRow:"", footerCells:"",icons:"ui-icon",sortNone:"ui-icon-carat-2-n-s",sortAsc:"ui-icon-carat-1-n",sortDesc:"ui-icon-carat-1-s",active:"ui-state-active",hover:"ui-state-hover",filterRow:"",even:"ui-widget-content",odd:"ui-state-default"}}; -d.storage=function(f,c,b,a){var e,d=!1;e={};var k=f.config,m=a&&a.id||g(f).attr(a&&a.group||"data-table-group")||f.id||g(".tablesorter").index(g(f));a=a&&a.url||g(f).attr(a&&a.page||"data-table-page")||k&&k.fixedUrl||window.location.pathname;if("localStorage"in window)try{window.localStorage.setItem("_tmptest", "temp"),d=!0,window.localStorage.removeItem("_tmptest")}catch(q){}g.parseJSON&&(d?e=g.parseJSON(localStorage[c]||"{}"):(e=document.cookie.split(/[;\s|=]/),f=g.inArray(c,e)+1,e=0!==f?g.parseJSON(e[f]||"{}"):{}));if((b||""===b)&&window.JSON&&JSON.hasOwnProperty("stringify"))e[a]||(e[a]={}),e[a][m]=b,d?localStorage[c]=JSON.stringify(e):(f=new Date,f.setTime(f.getTime()+31536E6),document.cookie=c+"="+JSON.stringify(e).replace(/\"/g,'"')+"; expires="+f.toGMTString()+"; path=/");else return e&&e[a]?e[a][m]: {}}; -d.addHeaderResizeEvent=function(f,c,b){b=g.extend({},{timer:250},b);var a=f.config,e=a.widgetOptions,d,k=function(){e.resize_flag=!0;d=[];a.$headers.each(function(){var a=g.data(this,"savedSizes")||[0,0],b=this.offsetWidth,c=this.offsetHeight;if(b!==a[0]||c!==a[1])g.data(this,"savedSizes",[b,c]),d.push(this)});d.length&&a.$table.trigger("resize",[d]);e.resize_flag=!1};a.$headers.each(function(){g.data(this,"savedSizes",[this.offsetWidth,this.offsetHeight])});clearInterval(e.resize_timer);if(c)return e.resize_flag= !1;e.resize_timer=setInterval(function(){e.resize_flag||k()},b.timer)}; -d.addWidget({id:"uitheme",priority:10,options:{uitheme:"jui"},format:function(f,c,b){var a,e,l,k,m=d.themes,q=c.$table,v="default"!==c.theme?c.theme:b.uitheme||"jui",h=m[m[v]?v:m[b.uitheme]?b.uitheme:"jui"],p=c.$headers,u="tr."+(b.stickyHeaders||"tablesorter-stickyHeader"),w=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;c.debug&&(a=new Date);q.hasClass("tablesorter-"+v)&&c.theme!==v&&f.hasInitialized||(""!==h.even&&(b.zebra[0]+=" "+ h.even),""!==h.odd&&(b.zebra[1]+=" "+h.odd),m=q.removeClass(""===c.theme?"":"tablesorter-"+c.theme).addClass("tablesorter-"+v+" "+h.table).find("tfoot"),m.length&&m.find("tr").addClass(h.footerRow).children("th, td").addClass(h.footerCells),p.addClass(h.header).filter(":not(.sorter-false)").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(a){g(this)["mouseenter"===a.type?"addClass":"removeClass"](h.hover)}),p.find(".tablesorter-wrapper").length||p.wrapInner('
'), c.cssIcon&&p.find("."+d.css.icon).addClass(h.icons),q.hasClass("hasFilters")&&p.find(".tablesorter-filter-row").addClass(h.filterRow));g.each(p,function(a){l=g(this);k=d.css.icon?l.find("."+d.css.icon):l;this.sortDisabled?(l.removeClass(w),k.removeClass(w+" tablesorter-icon "+h.icons)):(m=q.hasClass("hasStickyHeaders")?q.find(u).find("th").eq(a).add(l):l,e=l.hasClass(d.css.sortAsc)?h.sortAsc:l.hasClass(d.css.sortDesc)?h.sortDesc:l.hasClass(d.css.header)?h.sortNone:"",l[e===h.sortNone?"removeClass": "addClass"](h.active),k.removeClass(w).addClass(e))});c.debug&&d.benchmark("Applying "+v+" theme",a)},remove:function(f,c,b){f=c.$table;c="object"===typeof b.uitheme?"jui":b.uitheme||"jui";b="object"===typeof b.uitheme?b.uitheme:d.themes[d.themes.hasOwnProperty(c)?c:"jui"];var a=f.children("thead").children(),e=b.sortNone+" "+b.sortDesc+" "+b.sortAsc;f.removeClass("tablesorter-"+c+" "+b.table).find(d.css.header).removeClass(b.header);a.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(b.hover+ " "+e+" "+b.active).find(".tablesorter-filter-row").removeClass(b.filterRow);a.find(".tablesorter-icon").removeClass(b.icons)}}); -d.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(f,c,b){var a,e,l,k,m,q,v,h,p,u=c.$table,w=c.$tbodies,t=c.sortList,y=t.length,r=c.widgetColumns&&c.widgetColumns.hasOwnProperty("css")?c.widgetColumns.css||r:b&&b.hasOwnProperty("columns")?b.columns||r:r;q=r.length-1;v=r.join(" ");c.debug&&(m=new Date);for(p=0;p=]/g}},format:function(f, c,b){if(!c.$table.hasClass("hasFilters")&&(c.parsers||!c.parsers&&b.filter_serversideFiltering)){var a,e,l,k,m,q,v,h,p,u,w,t,y,r,x,s,n,C,D,E=d.formatFloat,N="",B=c.$headers,A=c.$table.addClass("hasFilters"),I=c.$tbodies,J=c.columns||c.$headers.filter("th").length,F,O,P,H=function(a){var e=g.isArray(a),s=e?a:d.getFilters(f),l=(s||[]).join("");e&&d.setFilters(A,s);b.filter_hideFilters&&A.find(".tablesorter-filter-row").trigger(""===l?"mouseleave":"mouseenter");if(N!==l||!1===a)if(A.trigger("filterStart", [s]),c.showProcessing)setTimeout(function(){Q(a,s,l);return!1},30);else return Q(a,s,l),!1},Q=function(K,k,q){var p,t,w,r,y,z,u,D,C,G;c.debug&&(D=new Date);for(l=0;l]=?/.test(m)){s=u=E(m.replace(b.filter_regex.nondigit,"").replace(b.filter_regex.operators,""),f);if(F[a]||"numeric"===c.parsers[a].type)x=c.parsers[a].format(""+m.replace(b.filter_regex.operators,""), f,B.eq(a),a),s=isNaN(s)&&""!==x&&!isNaN(x)?x:s;x=!F[a]&&"numeric"!==c.parsers[a].type||isNaN(s)||!c.cache[l].normalized[e]?isNaN(h)?E(h.replace(b.filter_regex.nondigit,""),f):E(h,f):c.cache[l].normalized[e][a];/>/.test(m)&&(z=/>=/.test(m)?x>=s:x>s);/C&&(z=u,u=C,C=z);z=x>=u&&x<=C||""===u||""===C?!0:!1}else/[\?|\*]/.test(m)||/\s+OR\s+/.test(k[a])? (s=m.replace(/\s+OR\s+/gi,"|"),!B.filter('[data-column="'+a+'"]:last').hasClass("filter-match")&&/\|/.test(s)&&(s="^("+s+")$"),z=RegExp(s.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(h)):(v=(h+n).indexOf(m),z=!b.filter_startsWith&&0<=v||b.filter_startsWith&&0===v);r=z?r?!0:!1:!1}p[e].style.display=r?"":"none";p.eq(e)[r?"removeClass":"addClass"](b.filter_filteredRow);if(w.length){if(c.pager&&c.pager.countChildRows||b.pager_countChildRows)w[r?"removeClass":"addClass"](b.filter_filteredRow);w[r? "show":"hide"]()}}d.processTbody(f,K,!1)}N=q;A.data("lastSearch",k);c.debug&&d.benchmark("Completed filter widget search",D);A.trigger("applyWidgets");A.trigger("filterEnd")},R=function(a,f,s){var m,h,n=[];a=parseInt(a,10);h=B.filter('[data-column="'+a+'"]:last');m='";for(l=0;l"+n[l]+"":"";A.find("thead").find('select.tablesorter-filter[data-column="'+ a+'"]')[f?"html":"append"](m)},L=function(c){for(a=0;a';for(a=0;a";c.$filters=g(n+="").appendTo(A.find("thead").eq(0)).find("td");for(a=0;a").appendTo(c.$filters.eq(a)):(b.filter_formatter&&g.isFunction(b.filter_formatter[a])?((n=b.filter_formatter[a](c.$filters.eq(a),a))&&0===n.length&&(n=c.$filters.eq(a).children("input")),n&&(0===n.parent().length||n.parent().length&&n.parent()[0]!==c.$filters[a])&&c.$filters.eq(a).append(n)):n=g('').appendTo(c.$filters.eq(a)),n&&n.attr("placeholder", r.data("placeholder")||r.attr("data-placeholder")||"")),n&&(n.addClass("tablesorter-filter "+b.filter_cssFilter).attr("data-column",a),C&&(n.addClass("disabled")[0].disabled=!0))}A.bind("addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(".tsfilter "),function(a,b){/(search|filterReset|filterEnd)/.test(a.type)||(a.stopPropagation(),L(!0));"filterReset"===a.type&&M([]);"filterEnd"===a.type?L(!0):(b="search"===a.type?b:"updateComplete"===a.type? A.data("lastSearch"):"",M(b));return!1}).find("input.tablesorter-filter").bind("keyup search",function(a,c){if(27===a.which)this.value="";else if("number"===typeof b.filter_liveSearch&&this.value.lengtha.which&&8!==a.which&&!0===b.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===b.filter_liveSearch))return;M(c)});F=B.map(function(a){return d.getData?"parsed"===d.getData(B.filter('[data-column="'+a+'"]:last'), c.headers[a],"filter"):g(this).hasClass("filter-parsed")}).get();b.filter_reset&&g(document).delegate(b.filter_reset,"click.tsfilter",function(){A.trigger("filterReset")});if(b.filter_functions)for(D in b.filter_functions)if(b.filter_functions.hasOwnProperty(D)&&"string"===typeof D)if(n=B.filter('[data-column="'+D+'"]:last'),q="",!0===b.filter_functions[D]&&!n.hasClass("filter-false"))R(D);else if("string"===typeof D&&!n.hasClass("filter-false")){for(w in b.filter_functions[D])"string"===typeof w&& (q+=""===q?'":"",q+='");A.find("thead").find('select.tablesorter-filter[data-column="'+D+'"]').append(q)}L(!0);A.find("select.tablesorter-filter").bind("change search",function(a,b){H(b)});b.filter_hideFilters&&A.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){var b;t=g(this);clearTimeout(p);p=setTimeout(function(){/enter|over/.test(a.type)? t.removeClass("hideme"):g(document.activeElement).closest("tr")[0]!==t[0]&&(b=d.getFilters(f).join(""),""===b&&t.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(a){y=g(this).closest("tr");clearTimeout(p);p=setTimeout(function(){if(""===d.getFilters(f).join(""))y["focus"===a.type?"removeClass":"addClass"]("hideme")},200)});c.showProcessing&&A.bind("filterStart.tsfilter filterEnd.tsfilter",function(a,b){var c=b?A.find("."+d.css.header).filter("[data-column]").filter(function(){return""!== b[g(this).data("column")]}):"";d.isProcessing(A[0],"filterStart"===a.type,b?c:"")});c.debug&&d.benchmark("Applying Filter widget",O);A.bind("tablesorter-initialized",function(){if(q=d.getFilters(f)){for(a=0;ad.top&&fa.which&&8!==a.which||37<=a.which&&40>=a.which)){r=!0;a=g(this);var d=a.attr("data-column");c.$filters.find(".tablesorter-filter").eq(d).val(a.val()).trigger("search");setTimeout(function(){r=!1},b.filter_searchDelay)}});a.trigger("stickyHeadersInit")}},remove:function(f,c,b){c.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find(".tablesorter-stickyHeader").remove();b.$sticky&&b.$sticky.length&& b.$sticky.remove();g(".hasStickyHeaders").length||g(window).unbind("scroll.tsSticky resize.tsSticky");d.addHeaderResizeEvent(f,!1)}}); -d.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(f,c,b){if(!c.$table.hasClass("hasResizable")){c.$table.addClass("hasResizable");var a,e,l,k,m={},q,v,h,p,u=c.$table,w=0,t=null,y=null,r=20>Math.abs(u.parent().width()-u.width()),x=function(){d.storage&&t&&(m[t.index()]=t.width(),m[y.index()]=y.width(),t.width(m[t.index()]), y.width(m[y.index()]),!1!==b.resizable&&d.storage(f,"tablesorter-resizable",m));w=0;t=y=null;g(window).trigger("resize")};if(m=d.storage&&!1!==b.resizable?d.storage(f,"tablesorter-resizable"):{})for(k in m)!isNaN(k)&&k
');b.resizable_addLastColumn||(q=q.slice(0,-1));v=v?v.add(q):q});v.each(function(){a=g(this);k=parseInt(a.css("padding-right"),10)+10;e='
';a.find(".tablesorter-wrapper").append(e)}).bind("mousemove.tsresize", function(a){0!==w&&t&&(h=a.pageX-w,p=t.width(),t.width(p+h),t.width()!==p&&r&&y.width(y.width()-h),w=a.pageX)}).bind("mouseup.tsresize",function(){x()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown",function(a){t=g(a.target).closest("th");e=c.$headers.filter('[data-column="'+t.attr("data-column")+'"]');1
'),a.cssIcon&&p.find("."+e.css.icon).addClass(k.icons),q.hasClass("hasFilters")&&p.find(".tablesorter-filter-row").addClass(k.filterRow));l.each(p,function(a){g=l(this);h=e.css.icon?g.find("."+e.css.icon):g;this.sortDisabled?(g.removeClass(r),h.removeClass(r+" tablesorter-icon "+k.icons)):(n=q.hasClass("hasStickyHeaders")?q.find(x).find("th").eq(a).add(g):g,f= g.hasClass(e.css.sortAsc)?k.sortAsc:g.hasClass(e.css.sortDesc)?k.sortDesc:g.hasClass(e.css.header)?k.sortNone:"",g[f===k.sortNone?"removeClass":"addClass"](k.active),h.removeClass(r).addClass(f))});a.debug&&e.benchmark("Applying "+m+" theme",d)},remove:function(b,a,c){b=a.$table;a="object"===typeof c.uitheme?"jui":c.uitheme||"jui";c="object"===typeof c.uitheme?c.uitheme:e.themes[e.themes.hasOwnProperty(a)?a:"jui"];var d=b.children("thead").children(),f=c.sortNone+" "+c.sortDesc+" "+c.sortAsc;b.removeClass("tablesorter-"+ a+" "+c.table).find(e.css.header).removeClass(c.header);d.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(c.hover+" "+f+" "+c.active).find(".tablesorter-filter-row").removeClass(c.filterRow);d.find(".tablesorter-icon").removeClass(c.icons)}}); +e.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(b,a,c){var d,f,g,h,n,q,m,k,p,x=a.$table,r=a.$tbodies,s=a.sortList,u=s.length,w=a.widgetColumns&&a.widgetColumns.hasOwnProperty("css")?a.widgetColumns.css|| w:c&&c.hasOwnProperty("columns")?c.columns||w:w;q=w.length-1;m=w.join(" ");a.debug&&(n=new Date);for(p=0;p=]/g},types:{regex:function(b,a,c,d){if(e.filter.regex.regex.test(a)){var f;b=e.filter.regex.regex.exec(a);try{f=RegExp(b[1],b[2]).test(d)}catch(g){f=!1}return f}return null},exact:function(b,a,c,d){return a.replace(e.filter.regex.exact,"")==d?!0:null},notMatch:function(b,a,c,d,f,e,h,n){return/^\!/.test(a)? (a=a.replace("!",""),b=d.search(l.trim(a)),""===a?!0:!(n.filter_startsWith?0===b:0<=b)):null},operators:function(b,a,c,d,f,g,h,l,q){if(/^[<>]=?/.test(a)){var m,k;m=h.config;b=e.formatFloat(a.replace(e.filter.regex.operators,""),h);c=m.parsers[g];l=b;if(q[g]||"numeric"===c.type)m=c.format(""+a.replace(e.filter.regex.operators,""),h,m.$headers.eq(g),g),b="number"!==typeof b||""===m||isNaN(m)?b:m;m=!q[g]&&"numeric"!==c.type||isNaN(b)||!f?isNaN(d)?e.formatFloat(d.replace(e.filter.regex.nondigit,""),h): e.formatFloat(d,h):f;/>/.test(a)&&(k=/>=/.test(a)?m>=b:m>b);/m&&(a=l,l=m,m=a);return a>=l&&a<=m||""===l||""===m}return null},wild:function(b,a,c,d,f,e,h){return/[\?|\*]/.test(a)||/\s+OR\s+/.test(b)?(b=h.config,a=a.replace(/\s+OR\s+/gi, "|"),!b.$headers.filter('[data-column="'+e+'"]:last').hasClass("filter-match")&&/\|/.test(a)&&(a="^("+a+")$"),RegExp(a.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d)):null},fuzzy:function(b,a,c,d){if(/^~/.test(a)){b=0;c=d.length;var f=a.slice(1);for(a=0;a'+(g.data("placeholder")||g.attr("data-placeholder")||"")+"":"",d+='");a.$table.find("thead").find('select.tablesorter-filter[data-column="'+h+'"]').append(d)}e.filter.buildDefault(b,!0);a.$table.find("select.tablesorter-filter").bind("change search",function(a,c){e.filter.checkFilters(b,c)});c.filter_hideFilters&&e.filter.hideFilters(b, a,c);a.showProcessing&&a.$table.bind("filterStart.tsfilter filterEnd.tsfilter",function(c,d){g=d?a.$table.find("."+e.css.header).filter("[data-column]").filter(function(){return""!==d[l(this).data("column")]}):"";e.isProcessing(b,"filterStart"===c.type,d?g:"")});a.debug&&e.benchmark("Applying Filter widget",q);a.$table.bind("tablesorter-initialized pagerInitialized",function(){n=e.filter.setDefaults(b,a,c)||[];n.length&&e.setFilters(b,n,!0)});c.filter_Initialized=!0;a.$table.trigger("filterInit"); e.filter.checkFilters(b)},setDefaults:function(b,a,c){var d,f=[],e=a.columns;for(d=0;d';for(b=0;b";a.$filters=l(f+"").appendTo(a.$table.find("thead").eq(0)).find("td");for(b=0;b").appendTo(a.$filters.eq(b)):(c.filter_formatter&&l.isFunction(c.filter_formatter[b])?((f=c.filter_formatter[b](a.$filters.eq(b),b))&&0===f.length&&(f=a.$filters.eq(b).children("input")),f&&(0===f.parent().length||f.parent().length&&f.parent()[0]!== a.$filters[b])&&a.$filters.eq(b).append(f)):f=l('').appendTo(a.$filters.eq(b)),f&&f.attr("placeholder",d.data("placeholder")||d.attr("data-placeholder")||"")),f&&(f.addClass("tablesorter-filter "+c.filter_cssFilter).attr("data-column",b),g&&(f.addClass("disabled")[0].disabled=!0))},bindSearch:function(b,a){b=l(b)[0];var c,d=b.config.widgetOptions;a.bind("keyup search",function(a,g){if(27===a.which)this.value="";else if("number"===typeof d.filter_liveSearch&&this.value.length< d.filter_liveSearch&&""!==this.value||"keyup"===a.type&&(32>a.which&&8!==a.which&&!0===d.filter_liveSearch&&13!==a.which||37<=a.which&&40>=a.which||13!==a.which&&!1===d.filter_liveSearch))return;c=l(this).hasClass("tablesorter-filter")?g:[l(this).val()];e.filter.searching(b,g,c)})},checkFilters:function(b,a){var c=b.config,d=c.widgetOptions,f=l.isArray(a),g=f?a:e.getFilters(b),h=(g||[]).join("");f&&e.setFilters(b,g);d.filter_hideFilters&&c.$table.find(".tablesorter-filter-row").trigger(""===h?"mouseleave": "mouseenter");if(c.lastCombinedFilter!==h||!1===a)if(c.$table.trigger("filterStart",[g]),c.showProcessing)setTimeout(function(){e.filter.findRows(b,g,h);return!1},30);else return e.filter.findRows(b,g,h),!1},hideFilters:function(b,a,c){var d,f,g;a.$table.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(a){d=l(this);clearTimeout(g);g=setTimeout(function(){/enter|over/.test(a.type)?d.removeClass("hideme"):l(document.activeElement).closest("tr")[0]!==d[0]&&""=== e.getFilters(b).join("")&&d.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(a){f=l(this).closest("tr");clearTimeout(g);g=setTimeout(function(){if(""===e.getFilters(b).join(""))f["focus"===a.type?"removeClass":"addClass"]("hideme")},200)})},findRows:function(b,a,c){var d,f,g,h,n,q,m,k,p,x,r,s,u,w,y,A,B,C,z,E,v=b.config,t=v.widgetOptions,G=v.columns,D=v.$tbodies,H=["range","operators"],F=v.$headers.map(function(a){return e.getData?"parsed"===e.getData(v.$headers.filter('[data-column="'+ a+'"]:last'),v.headers[a],"filter"):l(this).hasClass("filter-parsed")}).get();v.debug&&(E=new Date);for(n=0;nH.indexOf(c))if(y=e(a[k],u,r,s,d,k,b,t,F),null!==y)return C=y,!1}),null!==C?A=C:(r=(s+x).indexOf(u),A=!t.filter_startsWith&&0<=r||t.filter_startsWith&&0===r));if(t.filter_anyMatch){if(z=A)break}else z=A?z:!1}g[h].style.display=z?"":"none";g.eq(h)[z?"removeClass":"addClass"](t.filter_filteredRow);if(p.length){if(v.pager&&v.pager.countChildRows||t.pager_countChildRows)p[z? "removeClass":"addClass"](t.filter_filteredRow);p.toggle(z)}}e.processTbody(b,q,!1)}v.lastCombinedFilter=c;v.lastSearch=a;v.$table.data("lastSearch",a);v.debug&&e.benchmark("Completed filter widget search",E);v.$table.trigger("applyWidgets");v.$table.trigger("filterEnd")},buildSelect:function(b,a,c,d){a=parseInt(a,10);var f,g,h;b=b.config;var n=b.widgetOptions,q=b.$tbodies,m=[],k=b.$headers.filter('[data-column="'+a+'"]:last'),p='";for(g=0;g"+m[d]+"":"";b.$table.find("thead").find('select.tablesorter-filter[data-column="'+a+'"]')[c?"html":"append"](p)},buildDefault:function(b,a){var c,d,f=b.config,g=f.widgetOptions,h=f.columns;for(c=0;cb.top&&eb.which&&8!==b.which||37<=b.which&&40>=b.which)){w=!0;b=l(this);var d=b.attr("data-column");a.$filters.find(".tablesorter-filter").eq(d).val(b.val()).trigger("search"); setTimeout(function(){w=!1},c.filter_searchDelay)}});d.trigger("stickyHeadersInit")}},remove:function(b,a,c){a.$table.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find(".tablesorter-stickyHeader").remove();c.$sticky&&c.$sticky.length&&c.$sticky.remove();l(".hasStickyHeaders").length||l(window).unbind("scroll.tsSticky resize.tsSticky");e.addHeaderResizeEvent(b,!1)}}); +e.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1},format:function(b, a,c){if(!a.$table.hasClass("hasResizable")){a.$table.addClass("hasResizable");var d,f,g,h,n={},q,m,k,p,x=a.$table,r=0,s=null,u=null,w=20>Math.abs(x.parent().width()-x.width()),y=function(){e.storage&&s&&(n[s.index()]=s.width(),n[u.index()]=u.width(),s.width(n[s.index()]),u.width(n[u.index()]),!1!==c.resizable&&e.storage(b,"tablesorter-resizable",n));r=0;s=u=null;l(window).trigger("resize")};if(n=e.storage&&!1!==c.resizable?e.storage(b,"tablesorter-resizable"):{})for(h in n)!isNaN(h)&&h
');c.resizable_addLastColumn|| (q=q.slice(0,-1));m=m?m.add(q):q});m.each(function(){d=l(this);h=parseInt(d.css("padding-right"),10)+10;f='
';d.find(".tablesorter-wrapper").append(f)}).bind("mousemove.tsresize",function(a){0!==r&&s&&(k=a.pageX-r,p=s.width(),s.width(p+k),s.width()!==p&&w&&u.width(u.width()-k),r=a.pageX)}).bind("mouseup.tsresize",function(){y()}).find(".tablesorter-resizer,.tablesorter-resizer-grip").bind("mousedown", function(b){s=l(b.target).closest("th");f=a.$headers.filter('[data-column="'+s.attr("data-column")+'"]');1