Skip to content
Browse files

fixed disabled pager elements - issue #157

  • Loading branch information...
1 parent 5c9ee38 commit e5b196bd7a937fa95d987f4c980074fa3870809c @Mottie committed Oct 17, 2012
View
BIN README.markdown
Binary file not shown.
View
6 addons/pager/jquery.tablesorter.pager.js
@@ -1,6 +1,6 @@
/*!
* tablesorter pager plugin
- * updated 10/15/2012
+ * updated 10/17/2012
*/
/*jshint browser:true, jquery:true */
;(function($) {
@@ -324,7 +324,9 @@
renderTable(table, table.config.rowsCopy, c);
}
// disable size selector
- $(c.cssPageSize, c.container).addClass(c.cssDisabled)[0].disabled = true;
+ $(c.container).find(c.cssPageSize + ',' + c.cssGoto).each(function(){
+ $(this).addClass(c.cssDisabled)[0].disabled = true;
+ });
},
moveToPage = function(table, c) {
View
4 addons/pager/jquery.tablesorter.pager.min.js
@@ -1,2 +1,2 @@
-/*! tablesorter pager plugin minified - updated 10/15/2012 */
-;(function(d){d.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,ajaxProcessing:function(){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,fixedHeight:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0};var p=this,r=function(c,b){var a= c.cssDisabled,e=!!b,f=Math.min(c.totalPages,c.filteredPages);c.updateArrows&&(d(c.cssFirst+","+c.cssPrev,c.container)[e||0===c.page?"addClass":"removeClass"](a),d(c.cssNext+","+c.cssLast,c.container)[e||c.page===f-1?"addClass":"removeClass"](a))},t=function(c,b){var a,e,f;a=d(c).hasClass("hasFilters");b.filteredRows=a?d(c).find("tbody tr:not(.filtered)").length:b.totalRows;b.filteredPages=a?Math.ceil(b.filteredRows/b.size):b.totalPages;if(0<Math.min(b.totalPages,b.filteredPages)&&(f=b.size*b.page> b.filteredRows,b.startRow=f?1:b.size*b.page+1,b.page=f?0:b.page,b.endRow=Math.min(b.filteredRows,b.totalRows,b.size*(b.page+1)),e=d(b.cssPageDisplay,b.container),a=b.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(a){return{"{page}":b.page+1,"{filteredRows}":b.filteredRows,"{filteredPages}":b.filteredPages,"{totalPages}":b.totalPages,"{startRow}":b.startRow,"{endRow}":b.endRow,"{totalRows}":b.totalRows}[a]}),e[0]&&(e["INPUT"===e[0].tagName?"val": "html"](a),d(b.cssGoto,b.container).length))){f="";e=Math.min(b.totalPages,b.filteredPages);for(a=1;a<=e;a++)f+="<option>"+a+"</option>";d(b.cssGoto,b.container).html(f).val(b.page+1)}r(b);b.initialized&&d(c).trigger("pagerComplete",b)},u=function(c,b){var a,e=d(c.tBodies[0]);if(b.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),a=d.data(c,"pagerSavedHeight")))a-=e.height(),5<a&&(d.data(c,"pagerLastSize")===b.size&&e.find("tr:visible").length<b.size)&&e.append('<tr class="pagerSavedHeightSpacer remove-me" style="height:'+ a+'px;"></tr>')},s=function(c,b){var a=d(c.tBodies[0]);a.find("tr.pagerSavedHeightSpacer").remove();d.data(c,"pagerSavedHeight",a.height());u(c,b);d.data(c,"pagerLastSize",b.size)},q=function(c,b){if(!b.ajaxUrl){var a,e=d("tr:not(."+c.config.cssChildRow+")",c.tBodies),f=e.length,g=b.page*b.size,i=g+b.size,h=0;for(a=0;a<f;a++)/filtered/.test(e[a].className)||(e[a].style.display=h>=g&&h<i?"":"none",h++)}},w=function(c,b){b.size=parseInt(d(b.cssPageSize,b.container).val(),10)||b.size;d.data(c,"pagerLastSize", b.size);r(b);b.removeRows||(q(c,b),d(c).bind("sortEnd.pager filterEnd.pager",function(){q(c,b)}))},x=function(c,b,a,e){if("function"===typeof a.ajaxProcessing){var f,g,i,h,j=d(b),l=b.config,q=d(b.tBodies).filter(":not(."+l.cssInfoBlock+")"),p=j.find("thead th").length,n="",r='<tr class="'+l.selectorRemove+'"><td style="text-align: center;" colspan="'+p+'">'+(e?e.message+" ("+e.name+")":"No rows found")+"</td></tr>",k=a.ajaxProcessing(c)||[0,[]],v=k[1]||[],s=v.length,m=k[2];if(0<s)for(c=0;c<s;c++){n+= "<tr>";for(f=0;f<v[c].length;f++)n+="<td>"+v[c][f]+"</td>";n+="</tr>"}m&&m.length===p&&(g=j.hasClass("hasStickyHeaders"),h=j.find("."+(l.widgetOptions&&l.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),i=j.find("tfoot tr:first").children(),j.find("th."+l.cssHeader).each(function(a){var b=d(this),c;b.find("."+l.cssIcon).length?(c=b.find("."+l.cssIcon).clone(!0),b.find(".tablesorter-header-inner").html(m[a]).append(c),g&&h.length&&(c=h.find("th").eq(a).find("."+l.cssIcon).clone(!0),h.find("th").eq(a).find(".tablesorter-header-inner").html(m[a]).append(c))): (b.find(".tablesorter-header-inner").html(m[a]),h.find("th").eq(a).find(".tablesorter-header-inner").html(m[a]));i.eq(a).html(m[a]);g&&h.length&&(b=h.find("th").eq(a),b=b.find("span").length?b.find("span:first"):b,b.html(m[a]))}));e?j.find("thead").append(r):q.html(n);a.temp.remove();a.initialized&&j.trigger("update");a.totalRows=k[0]||0;a.totalPages=Math.ceil(a.totalRows/a.size);t(b,a);u(b,a);a.initialized&&j.trigger("pagerChange",a)}a.initialized||(a.initialized=!0,d(b).trigger("pagerInitialized", a))},y=function(c,b){var a=d(c),e=b.ajaxUrl.replace(/\{page\}/g,b.page).replace(/\{size\}/g,b.size);""!==e&&(b.temp=d("<div/>",{"class":"tablesorter-processing",width:a.outerWidth(!0),height:a.outerHeight(!0)}),a.before(b.temp),d(document).ajaxError(function(a,d,e,h){x(null,c,b,h)}),d.getJSON(e,function(a){x(a,c,b)}))},k=function(c,b,a){var e,f,g,k=document.createDocumentFragment(),h=b.length;e=a.page*a.size;var j=e+a.size;if(!(1>h)){a.initialized&&d(c).trigger("pagerChange",a);if(a.removeRows){j> b.length&&(j=b.length);d(c.tBodies[0]).addClass("tablesorter-hidden");for(d.tablesorter.clearTableBody(c);e<j;e++){g=b[e];h=g.length;for(f=0;f<h;f++)k.appendChild(g[f])}c.tBodies[0].appendChild(k);d(c.tBodies[0]).removeClass("tablesorter-hidden")}else q(c,a);a.page>=a.totalPages&&(a.page=Math.min(a.totalPages,a.filteredPages)-1,i(c,a));t(c,a);a.isDisabled||u(c,a);d(c).trigger("applyWidgets")}},z=function(c,b){b.ajax?r(b,!0):(b.isDisabled=!0,d.data(c,"pagerLastPage",b.page),d.data(c,"pagerLastSize", b.size),b.page=0,b.size=b.totalRows,b.totalPages=1,d("tr.pagerSavedHeightSpacer",c.tBodies[0]).remove(),k(c,c.config.rowsCopy,b));d(b.cssPageSize,b.container).addClass(b.cssDisabled)[0].disabled=!0},i=function(c,b){if(!b.isDisabled){var a=Math.min(b.totalPages,b.filteredPages);if(0>b.page||b.page>a-1)b.page=0;d.data(c,"pagerLastPage",b.page);b.ajax?y(c,b):k(c,c.config.rowsCopy,b);b.initialized&&d(c).trigger("pageMoved",b)}},A=function(c,b,a){a.size=b;d.data(c,"pagerLastPage",a.page);d.data(c,"pagerLastSize", a.size);a.totalPages=Math.ceil(a.totalRows/a.size);i(c,a)},B=function(c,b,a){var e=d(b.cssPageSize,b.container).removeClass(b.cssDisabled).removeAttr("disabled");b.isDisabled=!1;b.page=d.data(c,"pagerLastPage")||b.page||0;b.size=d.data(c,"pagerLastSize")||parseInt(e.val(),10)||b.size;b.totalPages=Math.ceil(Math.min(b.totalPages,b.filteredPages)/b.size);a&&(d(c).trigger("update"),A(c,b.size,b),w(c,b),u(c,b))};p.appender=function(c,b){var a=c.config.pager;a.ajax||(c.config.rowsCopy=b,a.totalRows=b.length, a.size=d.data(c,"pagerLastSize")||a.size,a.totalPages=Math.ceil(a.totalRows/a.size),k(c,b,a))};p.construct=function(c){return this.each(function(){var b=this.config,a=b.pager=d.extend({},d.tablesorterPager.defaults,c),e=this,f=d(e),g=d(a.container).addClass("tablesorter-pager").show();b.appender=p.appender;a.initialized=!1;B(e,a,!1);"string"===typeof a.ajaxUrl?(a.ajax=!0,y(e,a)):(a.ajax=!1,d(this).trigger("appendCache",!0),w(e,a));d(e).hasClass("hasFilters")&&d(e).unbind("filterEnd.pager").bind("filterEnd.pager", function(){a.page=0;t(e,a);i(e,a);s(e,a)});d(a.cssGoto,g).length&&(d(a.cssGoto,g).bind("change",function(){a.page=d(this).val()-1;i(e,a)}),t(e,a));d(a.cssFirst,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page=0,i(e,a));return!1});d(a.cssNext,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page++,a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1),i(e,a));return!1}); d(a.cssPrev,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page--,0>=a.page&&(a.page=0),i(e,a));return!1});d(a.cssLast,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page=Math.min(a.totalPages,a.filteredPages)-1,i(e,a));return!1});d(a.cssPageSize,g).unbind("change.pager").bind("change.pager",function(){d(a.cssPageSize,g).val(d(this).val());d(this).hasClass(a.cssDisabled)||(A(e,parseInt(d(this).val(),10),a),s(e, a));return!1});f.unbind("disable.pager enable.pager destroy.pager update.pager").bind("disable.pager",function(){z(e,a)}).bind("enable.pager",function(){B(e,a,!0)}).bind("destroy.pager",function(){z(e,a);d(a.container).hide();e.config.appender=null;d(e).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager",function(){q(e,a)});a.ajax||(a.initialized=!0,d(e).trigger("pagerInitialized",a))})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery);
+/*! tablesorter pager plugin minified - updated 10/17/2012 */
+;(function(d){d.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,ajaxProcessing:function(){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,size:10,fixedHeight:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0};var s=this,m=function(c,b){var a= c.cssDisabled,e=!!b,f=Math.min(c.totalPages,c.filteredPages);c.updateArrows&&(d(c.cssFirst+","+c.cssPrev,c.container)[e||0===c.page?"addClass":"removeClass"](a),d(c.cssNext+","+c.cssLast,c.container)[e||c.page===f-1?"addClass":"removeClass"](a))},u=function(c,b){var a,e,f;a=d(c).hasClass("hasFilters");b.filteredRows=a?d(c).find("tbody tr:not(.filtered)").length:b.totalRows;b.filteredPages=a?Math.ceil(b.filteredRows/b.size):b.totalPages;if(0<Math.min(b.totalPages,b.filteredPages)&&(f=b.size*b.page> b.filteredRows,b.startRow=f?1:b.size*b.page+1,b.page=f?0:b.page,b.endRow=Math.min(b.filteredRows,b.totalRows,b.size*(b.page+1)),e=d(b.cssPageDisplay,b.container),a=b.output.replace(/\{(page|filteredRows|filteredPages|totalPages|startRow|endRow|totalRows)\}/gi,function(a){return{"{page}":b.page+1,"{filteredRows}":b.filteredRows,"{filteredPages}":b.filteredPages,"{totalPages}":b.totalPages,"{startRow}":b.startRow,"{endRow}":b.endRow,"{totalRows}":b.totalRows}[a]}),e[0]&&(e["INPUT"===e[0].tagName?"val": "html"](a),d(b.cssGoto,b.container).length))){f="";e=Math.min(b.totalPages,b.filteredPages);for(a=1;a<=e;a++)f+="<option>"+a+"</option>";d(b.cssGoto,b.container).html(f).val(b.page+1)}m(b);b.initialized&&d(c).trigger("pagerComplete",b)},v=function(c,b){var a,e=d(c.tBodies[0]);if(b.fixedHeight&&(e.find("tr.pagerSavedHeightSpacer").remove(),a=d.data(c,"pagerSavedHeight")))a-=e.height(),5<a&&(d.data(c,"pagerLastSize")===b.size&&e.find("tr:visible").length<b.size)&&e.append('<tr class="pagerSavedHeightSpacer remove-me" style="height:'+ a+'px;"></tr>')},t=function(c,b){var a=d(c.tBodies[0]);a.find("tr.pagerSavedHeightSpacer").remove();d.data(c,"pagerSavedHeight",a.height());v(c,b);d.data(c,"pagerLastSize",b.size)},n=function(c,b){if(!b.ajaxUrl){var a,e=d("tr:not(."+c.config.cssChildRow+")",c.tBodies),f=e.length,g=b.page*b.size,h=g+b.size,i=0;for(a=0;a<f;a++)/filtered/.test(e[a].className)||(e[a].style.display=i>=g&&i<h?"":"none",i++)}},w=function(c,b){b.size=parseInt(d(b.cssPageSize,b.container).val(),10)||b.size;d.data(c,"pagerLastSize", b.size);m(b);b.removeRows||(n(c,b),d(c).bind("sortEnd.pager filterEnd.pager",function(){n(c,b)}))},x=function(c,b,a,e){if("function"===typeof a.ajaxProcessing){var f,g,h,i,j=d(b),l=b.config,k=d(b.tBodies).filter(":not(."+l.cssInfoBlock+")"),n=j.find("thead th").length,p="",s='<tr class="'+l.selectorRemove+'"><td style="text-align: center;" colspan="'+n+'">'+(e?e.message+" ("+e.name+")":"No rows found")+"</td></tr>",m=a.ajaxProcessing(c)||[0,[]],r=m[1]||[],t=r.length,q=m[2];if(0<t)for(c=0;c<t;c++){p+= "<tr>";for(f=0;f<r[c].length;f++)p+="<td>"+r[c][f]+"</td>";p+="</tr>"}q&&q.length===n&&(g=j.hasClass("hasStickyHeaders"),i=j.find("."+(l.widgetOptions&&l.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),h=j.find("tfoot tr:first").children(),j.find("th."+l.cssHeader).each(function(a){var b=d(this),c;b.find("."+l.cssIcon).length?(c=b.find("."+l.cssIcon).clone(!0),b.find(".tablesorter-header-inner").html(q[a]).append(c),g&&i.length&&(c=i.find("th").eq(a).find("."+l.cssIcon).clone(!0),i.find("th").eq(a).find(".tablesorter-header-inner").html(q[a]).append(c))): (b.find(".tablesorter-header-inner").html(q[a]),i.find("th").eq(a).find(".tablesorter-header-inner").html(q[a]));h.eq(a).html(q[a])}));e?j.find("thead").append(s):k.html(p);a.temp.remove();j.trigger("update");a.totalRows=m[0]||0;a.totalPages=Math.ceil(a.totalRows/a.size);u(b,a);v(b,a);a.initialized&&j.trigger("pagerChange",a)}a.initialized||(a.initialized=!0,d(b).trigger("pagerInitialized",a))},y=function(c,b){var a=d(c),e=b.ajaxUrl?b.ajaxUrl.replace(/\{page\}/g,b.page).replace(/\{size\}/g,b.size): "",f=[],g=c.config.sortList,h=e.match(/\{sortList[\s+]?:[\s+]?(.*)\}/);h&&(h=h[1],d.each(g,function(a,b){f.push(h+"["+b[0]+"]="+b[1])}),e=e.replace(/\{sortList[\s+]?:[\s+]?(.*)\}/g,f.length?f.join("&"):h));""!==e&&(b.temp=d("<div/>",{"class":"tablesorter-processing",width:a.outerWidth(!0),height:a.outerHeight(!0)}),a.before(b.temp),d(document).ajaxError(function(a,d,e,f){x(null,c,b,f)}),d.getJSON(e,function(a){x(a,c,b)}))},r=function(c,b,a){var e,f,g,h=document.createDocumentFragment(),i=b.length; e=a.page*a.size;var j=e+a.size;if(!(1>i)){a.initialized&&d(c).trigger("pagerChange",a);if(a.removeRows){j>b.length&&(j=b.length);d(c.tBodies[0]).addClass("tablesorter-hidden");for(d.tablesorter.clearTableBody(c);e<j;e++){g=b[e];i=g.length;for(f=0;f<i;f++)h.appendChild(g[f])}c.tBodies[0].appendChild(h);d(c.tBodies[0]).removeClass("tablesorter-hidden")}else n(c,a);a.page>=a.totalPages&&(a.page=Math.min(a.totalPages,a.filteredPages)-1,k(c,a));u(c,a);a.isDisabled||v(c,a);d(c).trigger("applyWidgets")}}, z=function(c,b){b.ajax?m(b,!0):(b.isDisabled=!0,d.data(c,"pagerLastPage",b.page),d.data(c,"pagerLastSize",b.size),b.page=0,b.size=b.totalRows,b.totalPages=1,d("tr.pagerSavedHeightSpacer",c.tBodies[0]).remove(),r(c,c.config.rowsCopy,b));d(b.container).find(b.cssPageSize+","+b.cssGoto).each(function(){d(this).addClass(b.cssDisabled)[0].disabled=!0})},k=function(c,b){if(!b.isDisabled){var a=Math.min(b.totalPages,b.filteredPages);if(0>b.page||b.page>a-1)b.page=0;d.data(c,"pagerLastPage",b.page);b.ajax? y(c,b):r(c,c.config.rowsCopy,b);b.initialized&&d(c).trigger("pageMoved",b)}},A=function(c,b,a){a.size=b;d.data(c,"pagerLastPage",a.page);d.data(c,"pagerLastSize",a.size);a.totalPages=Math.ceil(a.totalRows/a.size);k(c,a)},B=function(c,b,a){var e=d(b.cssPageSize,b.container).removeClass(b.cssDisabled).removeAttr("disabled");b.isDisabled=!1;b.page=d.data(c,"pagerLastPage")||b.page||0;b.size=d.data(c,"pagerLastSize")||parseInt(e.val(),10)||b.size;b.totalPages=Math.ceil(Math.min(b.totalPages,b.filteredPages)/ b.size);a&&(d(c).trigger("update"),A(c,b.size,b),w(c,b),v(c,b))};s.appender=function(c,b){var a=c.config.pager;a.ajax||(c.config.rowsCopy=b,a.totalRows=b.length,a.size=d.data(c,"pagerLastSize")||a.size,a.totalPages=Math.ceil(a.totalRows/a.size),r(c,b,a))};s.construct=function(c){return this.each(function(){var b=this.config,a=b.pager=d.extend({},d.tablesorterPager.defaults,c),e=this,f=d(e),g=d(a.container).addClass("tablesorter-pager").show();b.appender=s.appender;a.initialized=!1;B(e,a,!1);"string"=== typeof a.ajaxUrl?(a.ajax=!0,y(e,a)):(a.ajax=!1,d(this).trigger("appendCache",!0),w(e,a));d(e).hasClass("hasFilters")&&d(e).unbind("filterEnd.pager").bind("filterEnd.pager",function(){a.page=0;u(e,a);k(e,a);t(e,a)});d(a.cssGoto,g).length&&(d(a.cssGoto,g).bind("change",function(){a.page=d(this).val()-1;k(e,a)}),u(e,a));d(a.cssFirst,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page=0,k(e,a));return!1});d(a.cssNext,g).unbind("click.pager").bind("click.pager", function(){d(this).hasClass(a.cssDisabled)||(a.page++,a.page>=Math.min(a.totalPages,a.filteredPages)-1&&(a.page=Math.min(a.totalPages,a.filteredPages)-1),k(e,a));return!1});d(a.cssPrev,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page--,0>=a.page&&(a.page=0),k(e,a));return!1});d(a.cssLast,g).unbind("click.pager").bind("click.pager",function(){d(this).hasClass(a.cssDisabled)||(a.page=Math.min(a.totalPages,a.filteredPages)-1,k(e,a));return!1});d(a.cssPageSize, g).unbind("change.pager").bind("change.pager",function(){d(a.cssPageSize,g).val(d(this).val());d(this).hasClass(a.cssDisabled)||(A(e,parseInt(d(this).val(),10),a),t(e,a));return!1});f.unbind("disable.pager enable.pager destroy.pager update.pager").bind("disable.pager",function(){z(e,a)}).bind("enable.pager",function(){B(e,a,!0)}).bind("destroy.pager",function(){z(e,a);d(a.container).hide();e.config.appender=null;d(e).unbind("destroy.pager sortEnd.pager filterEnd.pager enable.pager disable.pager")}).bind("update.pager", function(){n(e,a)});a.ajax||(a.initialized=!0,d(e).trigger("pagerInitialized",a))})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery);
View
2 docs/example-pager-ajax.html
@@ -143,7 +143,7 @@
<ul>
<li>This update to the pager plugin that interacts with a database via ajax was added in version 2.0.32 and can be applied to the original tablesorter.</li>
<li>The <code>ajaxUrl</code> and <code>ajaxProcessing</code> function are both required options for this interaction to work properly.</li>
- <li>The <code>ajaxUrl</code> contains a replaceable string to sent the requested page (<code>{page}</code>) and block size (<code>{size}</code>).</li>
+ <li>The <code>ajaxUrl</code> contains a replaceable string to sent the requested page (<code>{page}</code>), block size (<code>{size}</code>) or sort order (<code>{sortList:name}</code>).</li>
<li>The <code>ajaxProcessing</code> function must* return the data in the following format <code>[ total, rows, headers ]</code> - <span class="tip"><em>Modified</em></span> in 2.1.3:
<pre class="js"><code>[
// total # rows contained in the database
View
4 js/jquery.tablesorter.js
@@ -1,5 +1,5 @@
/*!
-* TableSorter 2.4.3 - Client-side table sorting with ease!
+* TableSorter 2.4.5 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
@@ -23,7 +23,7 @@
var ts = this;
- ts.version = "2.4";
+ ts.version = "2.4.5";
ts.parsers = [];
ts.widgets = [];
View
4 js/jquery.tablesorter.min.js
@@ -1,6 +1,6 @@
/*!
-* TableSorter 2.4.3 - Client-side table sorting with ease!
+* TableSorter 2.4.5 - Client-side table sorting with ease!
* Minified using UglifyJS (http://jscompress.com/)
* Copyright (c) 2007 Christian Bach
*/
-!function($){"use strict";$.extend({tablesorter:new function(){function log(a){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(a)}else{alert(a)}}function benchmark(a,b){log(a+" ("+((new Date).getTime()-b.getTime())+"ms)")}function getElementText(a,b,c){if(!b){return""}var d=a.config,e=d.textExtraction,f="";if(e==="simple"){if(d.supportsTextContent){f=b.textContent}else{f=$(b).text()}}else{if(typeof e==="function"){f=e(b,a,c)}else if(typeof e==="object"&&e.hasOwnProperty(c)){f=e[c](b,a,c)}else{f=d.supportsTextContent?b.textContent:$(b).text()}}return $.trim(f)}function detectParserForColumn(a,b,c,d){var e,f=ts.parsers.length,g=false,h="",i=true;while(h===""&&i){c++;if(b[c]){g=b[c].cells[d];h=getElementText(a,g,d);if(a.config.debug){log("Checking if value was empty on row "+c+", column: "+d+": "+h)}}else{i=false}}for(e=1;e<f;e++){if(ts.parsers[e].is(h,a,g)){return ts.parsers[e]}}return ts.parsers[0]}function buildParserCache(a,b){var c=a.config,d=$(a.tBodies).filter(":not(."+c.cssInfoBlock+")"),e,f,g,h,i,j,k,l="";if(d.length===0){return}e=d[0].rows;if(e[0]){f=[];g=e[0].cells.length;for(h=0;h<g;h++){i=b.filter(':not([colspan])[data-column="'+h+'"]:last,[colspan="1"][data-column="'+h+'"]:last');j=c.headers[h];k=ts.getParserById(ts.getData(i,j,"sorter"));c.empties[h]=ts.getData(i,j,"empty")||c.emptyTo||(c.emptyToBottom?"bottom":"top");c.strings[h]=ts.getData(i,j,"string")||c.stringTo||"max";if(!k){k=detectParserForColumn(a,e,-1,h)}if(c.debug){l+="column:"+h+"; parser:"+k.id+"; string:"+c.strings[h]+"; empty: "+c.empties[h]+"\n"}f.push(k)}}if(c.debug){log(l)}return f}function buildCache(a){var b=a.tBodies,c=a.config,d,e,f=c.parsers,g,h,i,j,k,l,m;c.cache={};if(c.debug){m=new Date}if(c.showProcessing){ts.isProcessing(a,true)}for(j=0;j<b.length;j++){c.cache[j]={row:[],normalized:[]};if(!$(b[j]).hasClass(c.cssInfoBlock)){d=b[j]&&b[j].rows.length||0;e=b[j].rows[0]&&b[j].rows[0].cells.length||0;for(h=0;h<d;++h){k=$(b[j].rows[h]);l=[];if(k.hasClass(c.cssChildRow)){c.cache[j].row[c.cache[j].row.length-1]=c.cache[j].row[c.cache[j].row.length-1].add(k);continue}c.cache[j].row.push(k);for(i=0;i<e;++i){g=getElementText(a,k[0].cells[i],i);l.push(f[i].format(g,a,k[0].cells[i],i))}l.push(c.cache[j].normalized.length);c.cache[j].normalized.push(l)}}}if(c.showProcessing){ts.isProcessing(a)}if(c.debug){benchmark("Building cache for "+d+" rows",m)}}function appendToTable(a,b){var c=a.config,d=a.tBodies,e=[],f=c.cache,g,h,i,j,k,l,m,n,o,p,q,r;if(c.debug){r=new Date}for(o=0;o<d.length;o++){k=$(d[o]);if(!k.hasClass(c.cssInfoBlock)){l=ts.processTbody(a,k,true);g=f[o].row;h=f[o].normalized;i=h.length;j=i?h[0].length-1:0;for(m=0;m<i;m++){q=h[m][j];e.push(g[q]);if(!c.appender||!c.removeRows){p=g[q].length;for(n=0;n<p;n++){l.append(g[q][n])}}}ts.processTbody(a,l,false)}}if(c.appender){c.appender(a,e)}if(c.debug){benchmark("Rebuilt table",r)}if(!b){ts.applyWidget(a)}$(a).trigger("sortEnd",a)}function computeThIndexes(a){var b=[],c={},d=$(a).find("thead:eq(0) tr, tfoot tr"),e,f,g,h,i,j,k,l,m,n,o,p;for(e=0;e<d.length;e++){j=d[e].cells;for(f=0;f<j.length;f++){i=j[f];k=i.parentNode.rowIndex;l=k+"-"+i.cellIndex;m=i.rowSpan||1;n=i.colSpan||1;if(typeof b[k]==="undefined"){b[k]=[]}for(g=0;g<b[k].length+1;g++){if(typeof b[k][g]==="undefined"){o=g;break}}c[l]=o;$(i).attr({"data-column":o});for(g=k;g<k+m;g++){if(typeof b[g]==="undefined"){b[g]=[]}p=b[g];for(h=o;h<o+n;h++){p[h]="x"}}}}return c}function formatSortingOrder(a){return/^d/i.test(a)||a===1}function buildHeaders(a){var b=computeThIndexes(a),c,d,e,f,g,h,i=a.config;i.headerList=[];if(i.debug){g=new Date}h=$(a).find(i.selectorHeaders).each(function(a){d=$(this);c=i.headers[a];e=i.cssIcon?'<i class="'+i.cssIcon+'"></i>':"";this.innerHTML='<div class="tablesorter-header-inner">'+this.innerHTML+e+"</div>";if(i.onRenderHeader){i.onRenderHeader.apply(d,[a])}this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(ts.getData(d,c,"sortInitialOrder")||i.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;if(ts.getData(d,c,"sorter")==="false"){this.sortDisabled=true;d.addClass("sorter-false")}else{d.removeClass("sorter-false")}this.lockedOrder=false;f=ts.getData(d,c,"lockedOrder")||false;if(typeof f!=="undefined"&&f!==false){this.order=this.lockedOrder=formatSortingOrder(f)?[1,1,1]:[0,0,0]}d.addClass(this.sortDisabled?"sorter-false":i.cssHeader);i.headerList[a]=this;d.parent().addClass(i.cssHeaderRow)});if(a.config.debug){benchmark("Built headers:",g);log(h)}return h}function setHeadersCss(a,b){var c,d,e,f,g=a.config,h=g.sortList,i=[g.cssDesc,g.cssAsc],j=$(a).find("tfoot tr").children().removeClass(i.join(" "));b.removeClass(i.join(" "));f=h.length;for(d=0;d<f;d++){if(h[d][1]!==2){c=b.not(".sorter-false").filter('[data-column="'+h[d][0]+'"]'+(f===1?":last":""));if(c.length){for(e=0;e<c.length;e++){if(!c[e].sortDisabled){c.eq(e).addClass(i[h[d][1]]);if(j.length){j.filter('[data-column="'+h[d][0]+'"]').eq(e).addClass(i[h[d][1]])}}}}}}}function fixColumnWidth(a){if(a.config.widthFixed&&$(a).find("colgroup").length===0){var b=$("<colgroup>"),c=$(a).width();$("tr:first td",a.tBodies[0]).each(function(){b.append($("<col>").css("width",parseInt($(this).width()/c*1e3,10)/10+"%"))});$(a).prepend(b)}}function updateHeaderSortCount(a,b){var c,d,e=a.config,f=e.headerList.length,g=b||e.sortList;e.sortList=[];$.each(g,function(a,b){c=[parseInt(b[0],10),parseInt(b[1],10)];d=e.headerList[c[0]];if(d){e.sortList.push(c);d.count=c[1]%(e.sortReset?3:2)}})}function getCachedSortType(a,b){return a&&a[b]?a[b].type||"":""}function multisort(table){var dynamicExp,sortWrapper,col,mx=0,dir=0,tc=table.config,sortList=tc.sortList,l=sortList.length,bl=table.tBodies.length,sortTime,i,j,k,c,cache,lc,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date}for(k=0;k<bl;k++){dynamicExp="sortWrapper = function(a,b) {";cache=tc.cache[k];lc=cache.normalized.length;for(i=0;i<l;i++){c=sortList[i][0];order=sortList[i][1];s=/n/i.test(getCachedSortType(tc.parsers,c))?"Numeric":"Text";s+=order===0?"":"Desc";e="e"+i;if(/Numeric/.test(s)&&tc.strings[c]){for(j=0;j<lc;j++){col=Math.abs(parseFloat(cache.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}if(typeof tc.string[tc.strings[c]]==="boolean"){dir=(order===0?1:-1)*(tc.string[tc.strings[c]]?-1:1)}else{dir=tc.strings[c]?tc.string[tc.strings[c]]||0:0}}dynamicExp+="var "+e+" = $.tablesorter.sort"+s+"(table,a["+c+"],b["+c+"],"+c+","+mx+","+dir+"); ";dynamicExp+="if ("+e+") { return "+e+"; } ";dynamicExp+="else { "}orgOrderCol=cache.normalized&&cache.normalized[0]?cache.normalized[0].length-1:0;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";cache.normalized.sort(eval(dynamicExp))}if(tc.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time",sortTime)}}function resortComplete(a,b){var c=a[0];a.trigger("updateComplete");if(typeof b==="function"){b(c)}}function checkResort(a,b,c){if(b!==false){a.trigger("sorton",[a[0].config.sortList,function(){resortComplete(a,c)}])}else{resortComplete(a,c)}}var ts=this;ts.version="2.4";ts.parsers=[];ts.widgets=[];ts.defaults={theme:"default",widthFixed:false,showProcessing:false,cancelSelection:true,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",usNumberFormat:true,delayInit:false,headers:{},ignoreCase:true,sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:false,sortReset:false,sortRestart:false,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:true,initialized:null,onRenderHeader:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerSortUp",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerSortDown",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:false,headerList:[],empties:{},strings:{},parsers:[]};ts.benchmark=benchmark;ts.construct=function(a){return this.each(function(){if(!this.tHead||this.tBodies.length===0||this.hasInitialized===true){return}var b,c,d=$(this),e,f,g,h="",i,j,k,l,m=$.metadata;this.hasInitialized=false;this.config={};e=$.extend(true,this.config,ts.defaults,a);$.data(this,"tablesorter",e);if(e.debug){$.data(this,"startoveralltimer",new Date)}e.supportsTextContent=$("<span>x</span>")[0].textContent==="x";e.supportsDataObject=parseFloat($.fn.jquery)>=1.4;e.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:true,bottom:false};if(!/tablesorter\-/.test(d.attr("class"))){h=e.theme!==""?" tablesorter-"+e.theme:""}d.addClass(e.tableClass+h);b=buildHeaders(this);e.parsers=buildParserCache(this,b);if(!e.delayInit){buildCache(this)}b.find("*").andSelf().filter(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(a,c){var m=this.tagName.match("TH|TD")?$(this):$(this).parents("th, td").filter(":last"),n=m[0];if((a.which||a.button)!==1){return false}if(a.type==="mousedown"){l=(new Date).getTime();return a.target.tagName==="INPUT"?"":!e.cancelSelection}if(c!==true&&(new Date).getTime()-l>250){return false}if(e.delayInit&&!e.cache){buildCache(d[0])}if(!n.sortDisabled){d.trigger("sortStart",d[0]);h=!a[e.sortMultiSortKey];n.count=(n.count+1)%(e.sortReset?3:2);if(e.sortRestart){f=n;b.each(function(){if(this!==f&&(h||!$(this).is("."+e.cssDesc+",."+e.cssAsc))){this.count=-1}})}f=n.column;if(h){e.sortList=[];if(e.sortForce!==null){i=e.sortForce;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}else{if(e.sortAppend&&e.sortList.length>1){if(ts.isValueInArray(e.sortAppend[0][0],e.sortList)){e.sortList.pop()}}if(ts.isValueInArray(f,e.sortList)){for(g=0;g<e.sortList.length;g++){j=e.sortList[g];k=e.headerList[j[0]];if(j[0]===f){j[1]=k.order[k.count];if(j[1]===2){e.sortList.splice(g,1);k.count=-1}}}}else{k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}}if(e.sortAppend!==null){i=e.sortAppend;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}d.trigger("sortBegin",d[0]);setTimeout(function(){setHeadersCss(d[0],b);multisort(d[0]);appendToTable(d[0])},1)}});if(e.cancelSelection){b.each(function(){this.onselectstart=function(){return false}})}d.unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").bind("update",function(a,c,f){$(e.selectorRemove,this).remove();e.parsers=buildParserCache(this,b);buildCache(this);checkResort(d,c,f)}).bind("updateCell",function(a,b,c,f){var g,h,i,j=this,k=$(this).find("tbody"),l=k.index($(b).parents("tbody").filter(":last")),m=$(b).parents("tr").filter(":last");if(k.length&&l>=0){h=k.eq(l).find("tr").index(m);i=b.cellIndex;g=j.config.cache[l].normalized[h].length-1;j.config.cache[l].row[j.config.cache[l].normalized[h][g]]=m;j.config.cache[l].normalized[h][i]=e.parsers[i].format(getElementText(j,b,i),j,b,i);checkResort(d,c,f)}}).bind("addRows",function(a,b,c,f){var h,i=b.filter("tr").length,j=[],k=b[0].cells.length,l=this,m=$(this).find("tbody").index(b.closest("tbody"));for(h=0;h<i;h++){for(g=0;g<k;g++){j[g]=e.parsers[g].format(getElementText(l,b[h].cells[g],g),l,b[h].cells[g],g)}j.push(e.cache[m].row.length);e.cache[m].row.push([b[h]]);e.cache[m].normalized.push(j);j=[]}checkResort(d,c,f)}).bind("sorton",function(a,c,d,e){$(this).trigger("sortStart",this);updateHeaderSortCount(this,c);setHeadersCss(this,b);multisort(this);appendToTable(this,e);if(typeof d==="function"){d(this)}}).bind("appendCache",function(a,b,c){appendToTable(this,c);if(typeof b==="function"){b(this)}}).bind("applyWidgetId",function(a,b){ts.getWidgetById(b).format(this,e,e.widgetOptions)}).bind("applyWidgets",function(a,b){ts.applyWidget(this,b)}).bind("refreshWidgets",function(a,b,c){ts.refreshWidgets(this,b,c)}).bind("destroy",function(a,b,c){ts.destroy(this,b,c)});if(e.supportsDataObject&&typeof d.data().sortlist!=="undefined"){e.sortList=d.data().sortlist}else if(m&&d.metadata()&&d.metadata().sortlist){e.sortList=d.metadata().sortlist}ts.applyWidget(this,true);if(e.sortList.length>0){d.trigger("sorton",[e.sortList,{},!e.initWidgets])}else if(e.initWidgets){ts.applyWidget(this)}fixColumnWidth(this);if(e.showProcessing){d.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(a){ts.isProcessing(d[0],a.type==="sortBegin")})}this.hasInitialized=true;if(e.debug){ts.benchmark("Overall initialization time",$.data(this,"startoveralltimer"))}d.trigger("tablesorter-initialized",this);if(typeof e.initialized==="function"){e.initialized(this)}})};ts.isProcessing=function(a,b,c){var d=a.config,e=c||$(a).find("."+d.cssHeader);if(b){if(d.sortList.length>0){e=e.filter(function(){return this.sortDisabled?false:ts.isValueInArray(parseFloat($(this).attr("data-column")),d.sortList)})}e.addClass(d.cssProcessing)}else{e.removeClass(d.cssProcessing)}};ts.processTbody=function(a,b,c){var d,e;if(c){b.before('<span class="tablesorter-savemyplace"/>');e=$.fn.detach?b.detach():b.remove();return e}e=$(a).find("span.tablesorter-savemyplace");b.insertAfter(e);e.remove()};ts.clearTableBody=function(a){$(a.tBodies).filter(":not(."+a.config.cssInfoBlock+")").empty()};ts.destroy=function(a,b,c){var d=$(a),e=a.config,f=d.find("thead:first");a.hasInitialized=false;f.find("tr:not(."+e.cssHeaderRow+")").remove();f.find(".tablesorter-resizer").remove();ts.refreshWidgets(a,true,true);d.removeData("tablesorter").unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+e.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(e.cssHeader+" "+e.cssAsc+" "+e.cssDesc).find(".tablesorter-header-inner").each(function(){if(e.cssIcon!==""){$(this).find("."+e.cssIcon).remove()}$(this).replaceWith($(this).contents())});if(b!==false){d.removeClass(e.tableClass)}if(typeof c==="function"){c(a)}};ts.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/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];ts.sortText=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo],g=ts.regex,h,i,j,k,l,m,n,o;if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:-f||-1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:f||1}if(typeof e.textSorter==="function"){return e.textSorter(b,c,a,d)}h=b.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");j=c.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");i=parseInt(b.match(g[2]),16)||h.length!==1&&b.match(g[1])&&Date.parse(b);k=parseInt(c.match(g[2]),16)||i&&c.match(g[1])&&Date.parse(c)||null;if(k){if(i<k){return-1}if(i>k){return 1}}o=Math.max(h.length,j.length);for(n=0;n<o;n++){l=isNaN(h[n])?h[n]||0:parseFloat(h[n])||0;m=isNaN(j[n])?j[n]||0:parseFloat(j[n])||0;if(isNaN(l)!==isNaN(m)){return isNaN(l)?1:-1}if(typeof l!==typeof m){l+="";m+=""}if(l<m){return-1}if(l>m){return 1}}return 0};ts.sortTextDesc=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo];if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:f||1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:-f||-1}if(typeof e.textSorter==="function"){return e.textSorter(c,b,a,d)}return ts.sortText(a,c,b)};ts.getTextValue=function(a,b,c){if(b){var d,e=a.length,f=b+c;for(d=0;d<e;d++){f+=a.charCodeAt(d)}return c*f}return 0};ts.sortNumeric=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:-h||-1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:h||1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return b-c};ts.sortNumericDesc=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:h||1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:-h||-1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return c-b};ts.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4",A:"\u00c1\u00c0\u00c2\u00c3\u00c4",c:"\u00e7",C:"\u00c7",e:"\u00e9\u00e8\u00ea\u00eb",E:"\u00c9\u00c8\u00ca\u00cb",i:"\u00ed\u00ec\u0130\u00ee\u00ef",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",S:"\u00df",u:"\u00fa\u00f9\u00fb\u00fc",U:"\u00da\u00d9\u00db\u00dc"};ts.replaceAccents=function(a){var b,c="[",d=ts.characterEquivalents;if(!ts.characterRegex){ts.characterRegexArray={};for(b in d){if(typeof b==="string"){c+=d[b];ts.characterRegexArray[b]=new RegExp("["+d[b]+"]","g")}}ts.characterRegex=new RegExp(c+"]")}if(ts.characterRegex.test(a)){for(b in d){if(typeof b==="string"){a=a.replace(ts.characterRegexArray[b],b)}}}return a};ts.isValueInArray=function(a,b){var c,d=b.length;for(c=0;c<d;c++){if(b[c][0]===a){return true}}return false};ts.addParser=function(a){var b,c=ts.parsers.length,d=true;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.id.toLowerCase()){d=false}}if(d){ts.parsers.push(a)}};ts.getParserById=function(a){var b,c=ts.parsers.length;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.toString().toLowerCase()){return ts.parsers[b]}}return false};ts.addWidget=function(a){ts.widgets.push(a)};ts.getWidgetById=function(a){var b,c,d=ts.widgets.length;for(b=0;b<d;b++){c=ts.widgets[b];if(c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase()){return c}}};ts.applyWidget=function(a,b){var c=a.config,d=c.widgetOptions,e=c.widgets.sort().reverse(),f,g,h,i=e.length;g=$.inArray("zebra",c.widgets);if(g>=0){c.widgets.splice(g,1);c.widgets.push("zebra")}if(c.debug){f=new Date}for(g=0;g<i;g++){h=ts.getWidgetById(e[g]);if(h){if(b===true&&h.hasOwnProperty("init")){h.init(a,h,c,d)}else if(!b&&h.hasOwnProperty("format")){h.format(a,c,d)}}}if(c.debug){benchmark("Completed "+(b===true?"initializing":"applying")+" widgets",f)}};ts.refreshWidgets=function(a,b,c){var d,e=a.config,f=e.widgets,g=ts.widgets,h=g.length;for(d=0;d<h;d++){if(g[d]&&g[d].id&&(b||$.inArray(g[d].id,f)<0)){if(e.debug){log("removing "+g[d].id)}if(g[d].hasOwnProperty("remove")){g[d].remove(a,e,e.widgetOptions)}}}if(c!==true){ts.applyWidget(a,b)}};ts.getData=function(a,b,c){var d="",e=$(a),f,g;if(!e.length){return""}f=$.metadata?e.metadata():false;g=" "+(e.attr("class")||"");if(typeof e.data(c)!=="undefined"||typeof e.data(c.toLowerCase())!=="undefined"){d+=e.data(c)||e.data(c.toLowerCase())}else if(f&&typeof f[c]!=="undefined"){d+=f[c]}else if(b&&typeof b[c]!=="undefined"){d+=b[c]}else if(g!==" "&&g.match(" "+c+"-")){d=g.match(new RegExp(" "+c+"-(\\w+)"))[1]||""}return $.trim(d)};ts.formatFloat=function(a,b){if(typeof a!=="string"||a===""){return a}if(b.config.usNumberFormat!==false){a=a.replace(/,/g,"")}else{a=a.replace(/[\s|\.]/g,"").replace(/,/g,".")}if(/^\s*\([.\d]+\)/.test(a)){a=a.replace(/^\s*\(/,"-").replace(/\)/,"")}var c=parseFloat(a);return isNaN(c)?$.trim(a):c};ts.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'\s]/g,"")):true}}});var ts=$.tablesorter;$.fn.extend({tablesorter:ts.construct});ts.addParser({id:"text",is:function(a,b,c){return true},format:function(a,b,c,d){var e=b.config;a=$.trim(e.ignoreCase?a.toLocaleLowerCase():a);return e.sortLocaleCompare?ts.replaceAccents(a):a},type:"text"});ts.addParser({id:"currency",is:function(a){return/^\(?[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"ipAddress",is:function(a){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(a)},format:function(a,b){var c,d=a.split("."),e="",f=d.length;for(c=0;c<f;c++){e+=("00"+d[c]).slice(-3)}return ts.formatFloat(e,b)},type:"numeric"});ts.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(a){return $.trim(a.replace(/(https?|ftp|file):\/\//,""))},type:"text"});ts.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},format:function(a,b){return ts.formatFloat(a!==""?(new Date(a.replace(/-/g,"/"))).getTime()||"":"",b)},type:"numeric"});ts.addParser({id:"percent",is:function(a){return/\d%\)?$/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/%/g,""),b)},type:"numeric"});ts.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4}|'?\d{2})\s+(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"shortDate",is:function(a){return/^(\d{2}|\d{4})[\/\-\,\.\s+]\d{2}[\/\-\.\,\s+](\d{2}|\d{4})$/.test(a)},format:function(a,b,c,d){var e=b.config,f=e.headerList[d],g=f.shortDateFormat;if(typeof g==="undefined"){g=f.shortDateFormat=ts.getData(f,e.headers[d],"dateFormat")||e.dateFormat}a=a.replace(/\s+/g," ").replace(/[\-|\.|\,]/g,"/");if(g==="mmddyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2")}else if(g==="ddmmyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1")}else if(g==="yyyymmdd"){a=a.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")}return ts.formatFloat((new Date(a)).getTime()||"",b)},type:"numeric"});ts.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"digit",is:function(a){return ts.isDigit(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"metadata",is:function(a){return false},format:function(a,b,c){var d=b.config,e=!d.parserMetadataName?"sortValue":d.parserMetadataName;return $(c).metadata()[e]},type:"numeric"});ts.addWidget({id:"zebra",format:function(a,b,c){var d,e,f,g,h,i,j,k,l=new RegExp(b.cssChildRow,"i"),m=$(a).children("tbody:not(."+b.cssInfoBlock+")");if(b.debug){i=new Date}for(j=0;j<m.length;j++){d=$(m[j]);k=d.children("tr").length;if(k>1){g=0;e=d.children("tr:visible");e.each(function(){f=$(this);if(!l.test(this.className)){g++}h=g%2===0;f.removeClass(c.zebra[h?1:0]).addClass(c.zebra[h?0:1])})}}if(b.debug){ts.benchmark("Applying Zebra widget",i)}},remove:function(a,b,c){var d,e,f=$(a).children("tbody:not(."+b.cssInfoBlock+")"),g=(b.widgetOptions.zebra||["even","odd"]).join(" ");for(d=0;d<f.length;d++){e=$.tablesorter.processTbody(a,$(f[d]),true);e.children().removeClass(g);$.tablesorter.processTbody(a,e,false)}}})}(jQuery);
+!function($){"use strict";$.extend({tablesorter:new function(){function log(a){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(a)}else{alert(a)}}function benchmark(a,b){log(a+" ("+((new Date).getTime()-b.getTime())+"ms)")}function getElementText(a,b,c){if(!b){return""}var d=a.config,e=d.textExtraction,f="";if(e==="simple"){if(d.supportsTextContent){f=b.textContent}else{f=$(b).text()}}else{if(typeof e==="function"){f=e(b,a,c)}else if(typeof e==="object"&&e.hasOwnProperty(c)){f=e[c](b,a,c)}else{f=d.supportsTextContent?b.textContent:$(b).text()}}return $.trim(f)}function detectParserForColumn(a,b,c,d){var e,f=ts.parsers.length,g=false,h="",i=true;while(h===""&&i){c++;if(b[c]){g=b[c].cells[d];h=getElementText(a,g,d);if(a.config.debug){log("Checking if value was empty on row "+c+", column: "+d+": "+h)}}else{i=false}}for(e=1;e<f;e++){if(ts.parsers[e].is(h,a,g)){return ts.parsers[e]}}return ts.parsers[0]}function buildParserCache(a,b){var c=a.config,d=$(a.tBodies).filter(":not(."+c.cssInfoBlock+")"),e,f,g,h,i,j,k,l="";if(d.length===0){return}e=d[0].rows;if(e[0]){f=[];g=e[0].cells.length;for(h=0;h<g;h++){i=b.filter(':not([colspan])[data-column="'+h+'"]:last,[colspan="1"][data-column="'+h+'"]:last');j=c.headers[h];k=ts.getParserById(ts.getData(i,j,"sorter"));c.empties[h]=ts.getData(i,j,"empty")||c.emptyTo||(c.emptyToBottom?"bottom":"top");c.strings[h]=ts.getData(i,j,"string")||c.stringTo||"max";if(!k){k=detectParserForColumn(a,e,-1,h)}if(c.debug){l+="column:"+h+"; parser:"+k.id+"; string:"+c.strings[h]+"; empty: "+c.empties[h]+"\n"}f.push(k)}}if(c.debug){log(l)}return f}function buildCache(a){var b=a.tBodies,c=a.config,d,e,f=c.parsers,g,h,i,j,k,l,m;c.cache={};if(c.debug){m=new Date}if(c.showProcessing){ts.isProcessing(a,true)}for(j=0;j<b.length;j++){c.cache[j]={row:[],normalized:[]};if(!$(b[j]).hasClass(c.cssInfoBlock)){d=b[j]&&b[j].rows.length||0;e=b[j].rows[0]&&b[j].rows[0].cells.length||0;for(h=0;h<d;++h){k=$(b[j].rows[h]);l=[];if(k.hasClass(c.cssChildRow)){c.cache[j].row[c.cache[j].row.length-1]=c.cache[j].row[c.cache[j].row.length-1].add(k);continue}c.cache[j].row.push(k);for(i=0;i<e;++i){g=getElementText(a,k[0].cells[i],i);l.push(f[i].format(g,a,k[0].cells[i],i))}l.push(c.cache[j].normalized.length);c.cache[j].normalized.push(l)}}}if(c.showProcessing){ts.isProcessing(a)}if(c.debug){benchmark("Building cache for "+d+" rows",m)}}function appendToTable(a,b){var c=a.config,d=a.tBodies,e=[],f=c.cache,g,h,i,j,k,l,m,n,o,p,q,r;if(c.debug){r=new Date}for(o=0;o<d.length;o++){k=$(d[o]);if(!k.hasClass(c.cssInfoBlock)){l=ts.processTbody(a,k,true);g=f[o].row;h=f[o].normalized;i=h.length;j=i?h[0].length-1:0;for(m=0;m<i;m++){q=h[m][j];e.push(g[q]);if(!c.appender||!c.removeRows){p=g[q].length;for(n=0;n<p;n++){l.append(g[q][n])}}}ts.processTbody(a,l,false)}}if(c.appender){c.appender(a,e)}if(c.debug){benchmark("Rebuilt table",r)}if(!b){ts.applyWidget(a)}$(a).trigger("sortEnd",a)}function computeThIndexes(a){var b=[],c={},d=$(a).find("thead:eq(0) tr, tfoot tr"),e,f,g,h,i,j,k,l,m,n,o,p;for(e=0;e<d.length;e++){j=d[e].cells;for(f=0;f<j.length;f++){i=j[f];k=i.parentNode.rowIndex;l=k+"-"+i.cellIndex;m=i.rowSpan||1;n=i.colSpan||1;if(typeof b[k]==="undefined"){b[k]=[]}for(g=0;g<b[k].length+1;g++){if(typeof b[k][g]==="undefined"){o=g;break}}c[l]=o;$(i).attr({"data-column":o});for(g=k;g<k+m;g++){if(typeof b[g]==="undefined"){b[g]=[]}p=b[g];for(h=o;h<o+n;h++){p[h]="x"}}}}return c}function formatSortingOrder(a){return/^d/i.test(a)||a===1}function buildHeaders(a){var b=computeThIndexes(a),c,d,e,f,g,h,i=a.config;i.headerList=[];if(i.debug){g=new Date}h=$(a).find(i.selectorHeaders).each(function(a){d=$(this);c=i.headers[a];e=i.cssIcon?'<i class="'+i.cssIcon+'"></i>':"";this.innerHTML='<div class="tablesorter-header-inner">'+this.innerHTML+e+"</div>";if(i.onRenderHeader){i.onRenderHeader.apply(d,[a])}this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(ts.getData(d,c,"sortInitialOrder")||i.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;if(ts.getData(d,c,"sorter")==="false"){this.sortDisabled=true;d.addClass("sorter-false")}else{d.removeClass("sorter-false")}this.lockedOrder=false;f=ts.getData(d,c,"lockedOrder")||false;if(typeof f!=="undefined"&&f!==false){this.order=this.lockedOrder=formatSortingOrder(f)?[1,1,1]:[0,0,0]}d.addClass(this.sortDisabled?"sorter-false":i.cssHeader);i.headerList[a]=this;d.parent().addClass(i.cssHeaderRow)});if(a.config.debug){benchmark("Built headers:",g);log(h)}return h}function setHeadersCss(a,b){var c,d,e,f,g=a.config,h=g.sortList,i=[g.cssDesc,g.cssAsc],j=$(a).find("tfoot tr").children().removeClass(i.join(" "));b.removeClass(i.join(" "));f=h.length;for(d=0;d<f;d++){if(h[d][1]!==2){c=b.not(".sorter-false").filter('[data-column="'+h[d][0]+'"]'+(f===1?":last":""));if(c.length){for(e=0;e<c.length;e++){if(!c[e].sortDisabled){c.eq(e).addClass(i[h[d][1]]);if(j.length){j.filter('[data-column="'+h[d][0]+'"]').eq(e).addClass(i[h[d][1]])}}}}}}}function fixColumnWidth(a){if(a.config.widthFixed&&$(a).find("colgroup").length===0){var b=$("<colgroup>"),c=$(a).width();$("tr:first td",a.tBodies[0]).each(function(){b.append($("<col>").css("width",parseInt($(this).width()/c*1e3,10)/10+"%"))});$(a).prepend(b)}}function updateHeaderSortCount(a,b){var c,d,e=a.config,f=e.headerList.length,g=b||e.sortList;e.sortList=[];$.each(g,function(a,b){c=[parseInt(b[0],10),parseInt(b[1],10)];d=e.headerList[c[0]];if(d){e.sortList.push(c);d.count=c[1]%(e.sortReset?3:2)}})}function getCachedSortType(a,b){return a&&a[b]?a[b].type||"":""}function multisort(table){var dynamicExp,sortWrapper,col,mx=0,dir=0,tc=table.config,sortList=tc.sortList,l=sortList.length,bl=table.tBodies.length,sortTime,i,j,k,c,cache,lc,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date}for(k=0;k<bl;k++){dynamicExp="sortWrapper = function(a,b) {";cache=tc.cache[k];lc=cache.normalized.length;for(i=0;i<l;i++){c=sortList[i][0];order=sortList[i][1];s=/n/i.test(getCachedSortType(tc.parsers,c))?"Numeric":"Text";s+=order===0?"":"Desc";e="e"+i;if(/Numeric/.test(s)&&tc.strings[c]){for(j=0;j<lc;j++){col=Math.abs(parseFloat(cache.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}if(typeof tc.string[tc.strings[c]]==="boolean"){dir=(order===0?1:-1)*(tc.string[tc.strings[c]]?-1:1)}else{dir=tc.strings[c]?tc.string[tc.strings[c]]||0:0}}dynamicExp+="var "+e+" = $.tablesorter.sort"+s+"(table,a["+c+"],b["+c+"],"+c+","+mx+","+dir+"); ";dynamicExp+="if ("+e+") { return "+e+"; } ";dynamicExp+="else { "}orgOrderCol=cache.normalized&&cache.normalized[0]?cache.normalized[0].length-1:0;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";cache.normalized.sort(eval(dynamicExp))}if(tc.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time",sortTime)}}function resortComplete(a,b){var c=a[0];a.trigger("updateComplete");if(typeof b==="function"){b(c)}}function checkResort(a,b,c){if(b!==false){a.trigger("sorton",[a[0].config.sortList,function(){resortComplete(a,c)}])}else{resortComplete(a,c)}}var ts=this;ts.version="2.4.5";ts.parsers=[];ts.widgets=[];ts.defaults={theme:"default",widthFixed:false,showProcessing:false,cancelSelection:true,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",usNumberFormat:true,delayInit:false,headers:{},ignoreCase:true,sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:false,sortReset:false,sortRestart:false,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:true,initialized:null,onRenderHeader:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerSortUp",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerSortDown",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:false,headerList:[],empties:{},strings:{},parsers:[]};ts.benchmark=benchmark;ts.construct=function(a){return this.each(function(){if(!this.tHead||this.tBodies.length===0||this.hasInitialized===true){return}var b,c,d=$(this),e,f,g,h="",i,j,k,l,m=$.metadata;this.hasInitialized=false;this.config={};e=$.extend(true,this.config,ts.defaults,a);$.data(this,"tablesorter",e);if(e.debug){$.data(this,"startoveralltimer",new Date)}e.supportsTextContent=$("<span>x</span>")[0].textContent==="x";e.supportsDataObject=parseFloat($.fn.jquery)>=1.4;e.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:true,bottom:false};if(!/tablesorter\-/.test(d.attr("class"))){h=e.theme!==""?" tablesorter-"+e.theme:""}d.addClass(e.tableClass+h);b=buildHeaders(this);e.parsers=buildParserCache(this,b);if(!e.delayInit){buildCache(this)}b.find("*").andSelf().filter(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(a,c){var m=this.tagName.match("TH|TD")?$(this):$(this).parents("th, td").filter(":last"),n=m[0];if((a.which||a.button)!==1){return false}if(a.type==="mousedown"){l=(new Date).getTime();return a.target.tagName==="INPUT"?"":!e.cancelSelection}if(c!==true&&(new Date).getTime()-l>250){return false}if(e.delayInit&&!e.cache){buildCache(d[0])}if(!n.sortDisabled){d.trigger("sortStart",d[0]);h=!a[e.sortMultiSortKey];n.count=(n.count+1)%(e.sortReset?3:2);if(e.sortRestart){f=n;b.each(function(){if(this!==f&&(h||!$(this).is("."+e.cssDesc+",."+e.cssAsc))){this.count=-1}})}f=n.column;if(h){e.sortList=[];if(e.sortForce!==null){i=e.sortForce;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}else{if(e.sortAppend&&e.sortList.length>1){if(ts.isValueInArray(e.sortAppend[0][0],e.sortList)){e.sortList.pop()}}if(ts.isValueInArray(f,e.sortList)){for(g=0;g<e.sortList.length;g++){j=e.sortList[g];k=e.headerList[j[0]];if(j[0]===f){j[1]=k.order[k.count];if(j[1]===2){e.sortList.splice(g,1);k.count=-1}}}}else{k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}}if(e.sortAppend!==null){i=e.sortAppend;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}d.trigger("sortBegin",d[0]);setTimeout(function(){setHeadersCss(d[0],b);multisort(d[0]);appendToTable(d[0])},1)}});if(e.cancelSelection){b.each(function(){this.onselectstart=function(){return false}})}d.unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").bind("update",function(a,c,f){$(e.selectorRemove,this).remove();e.parsers=buildParserCache(this,b);buildCache(this);checkResort(d,c,f)}).bind("updateCell",function(a,b,c,f){var g,h,i,j=this,k=$(this).find("tbody"),l=k.index($(b).parents("tbody").filter(":last")),m=$(b).parents("tr").filter(":last");if(k.length&&l>=0){h=k.eq(l).find("tr").index(m);i=b.cellIndex;g=j.config.cache[l].normalized[h].length-1;j.config.cache[l].row[j.config.cache[l].normalized[h][g]]=m;j.config.cache[l].normalized[h][i]=e.parsers[i].format(getElementText(j,b,i),j,b,i);checkResort(d,c,f)}}).bind("addRows",function(a,b,c,f){var h,i=b.filter("tr").length,j=[],k=b[0].cells.length,l=this,m=$(this).find("tbody").index(b.closest("tbody"));for(h=0;h<i;h++){for(g=0;g<k;g++){j[g]=e.parsers[g].format(getElementText(l,b[h].cells[g],g),l,b[h].cells[g],g)}j.push(e.cache[m].row.length);e.cache[m].row.push([b[h]]);e.cache[m].normalized.push(j);j=[]}checkResort(d,c,f)}).bind("sorton",function(a,c,d,e){$(this).trigger("sortStart",this);updateHeaderSortCount(this,c);setHeadersCss(this,b);multisort(this);appendToTable(this,e);if(typeof d==="function"){d(this)}}).bind("appendCache",function(a,b,c){appendToTable(this,c);if(typeof b==="function"){b(this)}}).bind("applyWidgetId",function(a,b){ts.getWidgetById(b).format(this,e,e.widgetOptions)}).bind("applyWidgets",function(a,b){ts.applyWidget(this,b)}).bind("refreshWidgets",function(a,b,c){ts.refreshWidgets(this,b,c)}).bind("destroy",function(a,b,c){ts.destroy(this,b,c)});if(e.supportsDataObject&&typeof d.data().sortlist!=="undefined"){e.sortList=d.data().sortlist}else if(m&&d.metadata()&&d.metadata().sortlist){e.sortList=d.metadata().sortlist}ts.applyWidget(this,true);if(e.sortList.length>0){d.trigger("sorton",[e.sortList,{},!e.initWidgets])}else if(e.initWidgets){ts.applyWidget(this)}fixColumnWidth(this);if(e.showProcessing){d.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(a){ts.isProcessing(d[0],a.type==="sortBegin")})}this.hasInitialized=true;if(e.debug){ts.benchmark("Overall initialization time",$.data(this,"startoveralltimer"))}d.trigger("tablesorter-initialized",this);if(typeof e.initialized==="function"){e.initialized(this)}})};ts.isProcessing=function(a,b,c){var d=a.config,e=c||$(a).find("."+d.cssHeader);if(b){if(d.sortList.length>0){e=e.filter(function(){return this.sortDisabled?false:ts.isValueInArray(parseFloat($(this).attr("data-column")),d.sortList)})}e.addClass(d.cssProcessing)}else{e.removeClass(d.cssProcessing)}};ts.processTbody=function(a,b,c){var d,e;if(c){b.before('<span class="tablesorter-savemyplace"/>');e=$.fn.detach?b.detach():b.remove();return e}e=$(a).find("span.tablesorter-savemyplace");b.insertAfter(e);e.remove()};ts.clearTableBody=function(a){$(a.tBodies).filter(":not(."+a.config.cssInfoBlock+")").empty()};ts.destroy=function(a,b,c){var d=$(a),e=a.config,f=d.find("thead:first");a.hasInitialized=false;f.find("tr:not(."+e.cssHeaderRow+")").remove();f.find(".tablesorter-resizer").remove();ts.refreshWidgets(a,true,true);d.removeData("tablesorter").unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+e.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(e.cssHeader+" "+e.cssAsc+" "+e.cssDesc).find(".tablesorter-header-inner").each(function(){if(e.cssIcon!==""){$(this).find("."+e.cssIcon).remove()}$(this).replaceWith($(this).contents())});if(b!==false){d.removeClass(e.tableClass)}if(typeof c==="function"){c(a)}};ts.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/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];ts.sortText=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo],g=ts.regex,h,i,j,k,l,m,n,o;if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:-f||-1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:f||1}if(typeof e.textSorter==="function"){return e.textSorter(b,c,a,d)}h=b.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");j=c.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");i=parseInt(b.match(g[2]),16)||h.length!==1&&b.match(g[1])&&Date.parse(b);k=parseInt(c.match(g[2]),16)||i&&c.match(g[1])&&Date.parse(c)||null;if(k){if(i<k){return-1}if(i>k){return 1}}o=Math.max(h.length,j.length);for(n=0;n<o;n++){l=isNaN(h[n])?h[n]||0:parseFloat(h[n])||0;m=isNaN(j[n])?j[n]||0:parseFloat(j[n])||0;if(isNaN(l)!==isNaN(m)){return isNaN(l)?1:-1}if(typeof l!==typeof m){l+="";m+=""}if(l<m){return-1}if(l>m){return 1}}return 0};ts.sortTextDesc=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo];if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:f||1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:-f||-1}if(typeof e.textSorter==="function"){return e.textSorter(c,b,a,d)}return ts.sortText(a,c,b)};ts.getTextValue=function(a,b,c){if(b){var d,e=a.length,f=b+c;for(d=0;d<e;d++){f+=a.charCodeAt(d)}return c*f}return 0};ts.sortNumeric=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:-h||-1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:h||1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return b-c};ts.sortNumericDesc=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:h||1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:-h||-1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return c-b};ts.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4",A:"\u00c1\u00c0\u00c2\u00c3\u00c4",c:"\u00e7",C:"\u00c7",e:"\u00e9\u00e8\u00ea\u00eb",E:"\u00c9\u00c8\u00ca\u00cb",i:"\u00ed\u00ec\u0130\u00ee\u00ef",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",S:"\u00df",u:"\u00fa\u00f9\u00fb\u00fc",U:"\u00da\u00d9\u00db\u00dc"};ts.replaceAccents=function(a){var b,c="[",d=ts.characterEquivalents;if(!ts.characterRegex){ts.characterRegexArray={};for(b in d){if(typeof b==="string"){c+=d[b];ts.characterRegexArray[b]=new RegExp("["+d[b]+"]","g")}}ts.characterRegex=new RegExp(c+"]")}if(ts.characterRegex.test(a)){for(b in d){if(typeof b==="string"){a=a.replace(ts.characterRegexArray[b],b)}}}return a};ts.isValueInArray=function(a,b){var c,d=b.length;for(c=0;c<d;c++){if(b[c][0]===a){return true}}return false};ts.addParser=function(a){var b,c=ts.parsers.length,d=true;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.id.toLowerCase()){d=false}}if(d){ts.parsers.push(a)}};ts.getParserById=function(a){var b,c=ts.parsers.length;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.toString().toLowerCase()){return ts.parsers[b]}}return false};ts.addWidget=function(a){ts.widgets.push(a)};ts.getWidgetById=function(a){var b,c,d=ts.widgets.length;for(b=0;b<d;b++){c=ts.widgets[b];if(c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase()){return c}}};ts.applyWidget=function(a,b){var c=a.config,d=c.widgetOptions,e=c.widgets.sort().reverse(),f,g,h,i=e.length;g=$.inArray("zebra",c.widgets);if(g>=0){c.widgets.splice(g,1);c.widgets.push("zebra")}if(c.debug){f=new Date}for(g=0;g<i;g++){h=ts.getWidgetById(e[g]);if(h){if(b===true&&h.hasOwnProperty("init")){h.init(a,h,c,d)}else if(!b&&h.hasOwnProperty("format")){h.format(a,c,d)}}}if(c.debug){benchmark("Completed "+(b===true?"initializing":"applying")+" widgets",f)}};ts.refreshWidgets=function(a,b,c){var d,e=a.config,f=e.widgets,g=ts.widgets,h=g.length;for(d=0;d<h;d++){if(g[d]&&g[d].id&&(b||$.inArray(g[d].id,f)<0)){if(e.debug){log("removing "+g[d].id)}if(g[d].hasOwnProperty("remove")){g[d].remove(a,e,e.widgetOptions)}}}if(c!==true){ts.applyWidget(a,b)}};ts.getData=function(a,b,c){var d="",e=$(a),f,g;if(!e.length){return""}f=$.metadata?e.metadata():false;g=" "+(e.attr("class")||"");if(typeof e.data(c)!=="undefined"||typeof e.data(c.toLowerCase())!=="undefined"){d+=e.data(c)||e.data(c.toLowerCase())}else if(f&&typeof f[c]!=="undefined"){d+=f[c]}else if(b&&typeof b[c]!=="undefined"){d+=b[c]}else if(g!==" "&&g.match(" "+c+"-")){d=g.match(new RegExp(" "+c+"-(\\w+)"))[1]||""}return $.trim(d)};ts.formatFloat=function(a,b){if(typeof a!=="string"||a===""){return a}if(b.config.usNumberFormat!==false){a=a.replace(/,/g,"")}else{a=a.replace(/[\s|\.]/g,"").replace(/,/g,".")}if(/^\s*\([.\d]+\)/.test(a)){a=a.replace(/^\s*\(/,"-").replace(/\)/,"")}var c=parseFloat(a);return isNaN(c)?$.trim(a):c};ts.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'\s]/g,"")):true}}});var ts=$.tablesorter;$.fn.extend({tablesorter:ts.construct});ts.addParser({id:"text",is:function(a,b,c){return true},format:function(a,b,c,d){var e=b.config;a=$.trim(e.ignoreCase?a.toLocaleLowerCase():a);return e.sortLocaleCompare?ts.replaceAccents(a):a},type:"text"});ts.addParser({id:"currency",is:function(a){return/^\(?[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"ipAddress",is:function(a){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(a)},format:function(a,b){var c,d=a.split("."),e="",f=d.length;for(c=0;c<f;c++){e+=("00"+d[c]).slice(-3)}return ts.formatFloat(e,b)},type:"numeric"});ts.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(a){return $.trim(a.replace(/(https?|ftp|file):\/\//,""))},type:"text"});ts.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},format:function(a,b){return ts.formatFloat(a!==""?(new Date(a.replace(/-/g,"/"))).getTime()||"":"",b)},type:"numeric"});ts.addParser({id:"percent",is:function(a){return/\d%\)?$/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/%/g,""),b)},type:"numeric"});ts.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4}|'?\d{2})\s+(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"shortDate",is:function(a){return/^(\d{2}|\d{4})[\/\-\,\.\s+]\d{2}[\/\-\.\,\s+](\d{2}|\d{4})$/.test(a)},format:function(a,b,c,d){var e=b.config,f=e.headerList[d],g=f.shortDateFormat;if(typeof g==="undefined"){g=f.shortDateFormat=ts.getData(f,e.headers[d],"dateFormat")||e.dateFormat}a=a.replace(/\s+/g," ").replace(/[\-|\.|\,]/g,"/");if(g==="mmddyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2")}else if(g==="ddmmyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1")}else if(g==="yyyymmdd"){a=a.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")}return ts.formatFloat((new Date(a)).getTime()||"",b)},type:"numeric"});ts.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"digit",is:function(a){return ts.isDigit(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"metadata",is:function(a){return false},format:function(a,b,c){var d=b.config,e=!d.parserMetadataName?"sortValue":d.parserMetadataName;return $(c).metadata()[e]},type:"numeric"});ts.addWidget({id:"zebra",format:function(a,b,c){var d,e,f,g,h,i,j,k,l=new RegExp(b.cssChildRow,"i"),m=$(a).children("tbody:not(."+b.cssInfoBlock+")");if(b.debug){i=new Date}for(j=0;j<m.length;j++){d=$(m[j]);k=d.children("tr").length;if(k>1){g=0;e=d.children("tr:visible");e.each(function(){f=$(this);if(!l.test(this.className)){g++}h=g%2===0;f.removeClass(c.zebra[h?1:0]).addClass(c.zebra[h?0:1])})}}if(b.debug){ts.benchmark("Applying Zebra widget",i)}},remove:function(a,b,c){var d,e,f=$(a).children("tbody:not(."+b.cssInfoBlock+")"),g=(b.widgetOptions.zebra||["even","odd"]).join(" ");for(d=0;d<f.length;d++){e=$.tablesorter.processTbody(a,$(f[d]),true);e.children().removeClass(g);$.tablesorter.processTbody(a,e,false)}}})}(jQuery)
View
2 js/jquery.tablesorter.widgets.js
@@ -1,4 +1,4 @@
-/*! tableSorter 2.4+ widgets - updated 10/13/2012
+/*! tableSorter 2.4+ widgets - updated 10/17/2012
*
* Column Styles
* Column Filters
View
11 js/jquery.tablesorter.widgets.min.js
@@ -1,11 +1,12 @@
-/*! tableSorter 2.4 widgets - updated 10/13/2012 */
+/*! tableSorter 2.4+ widgets - updated 10/17/2012 */
;(function(a){
a.tablesorter=a.tablesorter||{};
a.tablesorter.themes={bootstrap:{table:"table table-bordered table-striped",header:"bootstrap-header",icons:"",sortNone:"bootstrap-icon-unsorted",sortAsc:"icon-chevron-up",sortDesc:"icon-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",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"}};
a.tablesorter.storage=function(e,b,c){var d,i=!1;d={};var f=e.id||a(".tablesorter").index(a(e)),g=window.location.pathname;try{i=!!localStorage.getItem}catch(m){}a.parseJSON&&(i?d=a.parseJSON(localStorage[b])||{}:(d=document.cookie.split(/[;\s|=]/),e=a.inArray(b,d)+1,d=0!==e?a.parseJSON(d[e])||{}:{}));if(c&&JSON&&JSON.hasOwnProperty("stringify")){if(!d[g]||!d[g][f])d[g]||(d[g]={});d[g][f]= c;i?localStorage[b]=JSON.stringify(d):(e=new Date,e.setTime(e.getTime()+31536E6),document.cookie=b+"="+JSON.stringify(d).replace(/\"/g,'"')+"; expires="+e.toGMTString()+"; path=/")}else return d&&d.hasOwnProperty(g)&&d[g].hasOwnProperty(f)?d[g][f]:{}};
a.tablesorter.addWidget({id:"uitheme",format:function(e){var b,c,d,i,f=a(e),g=e.config,m=g.widgetOptions,n="object"===typeof m.uitheme?"jui":m.uitheme||"jui",h="object"===typeof m.uitheme&&!Object.prototype.toString.call(m.uitheme).test("Array")?m.uitheme: a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(n)?n:"jui"],l=a(g.headerList),p="tr."+(m.stickyHeaders||"tablesorter-stickyHeader"),q=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;g.debug&&(b=new Date);if(!f.hasClass("tablesorter-"+n)||g.theme===n||!e.hasInitialized)""!==h.even&&(m.zebra[0]+=" "+h.even),""!==h.odd&&(m.zebra[1]+=" "+h.odd),f.removeClass(""===g.theme?"":"tablesorter-"+g.theme).addClass("tablesorter-"+n+" "+h.table),g.theme="",l.addClass(h.header).filter(":not(.sorter-false)").hover(function(){a(this).addClass(h.hover)}, function(){a(this).removeClass(h.hover)}),l.find(".tablesorter-wrapper").length||l.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>'),g.cssIcon&&l.find("."+g.cssIcon).addClass(h.icons),f.hasClass("hasFilters")&&l.find(".tablesorter-filter-row").addClass(h.filterRow);a.each(l,function(b){d=a(this);i=g.cssIcon?d.find("."+g.cssIcon):d;this.sortDisabled?(d.removeClass(q),i.removeClass(q+" tablesorter-icon "+h.icons)):(f.hasClass("hasStickyHeaders")&& f.find(p).find("th").eq(b).add(d),c=d.hasClass(g.cssAsc)?h.sortDesc:d.hasClass(g.cssDesc)?h.sortAsc:d.hasClass(g.cssHeader)?h.sortNone:"",d[c===h.sortNone?"removeClass":"addClass"](h.active),i.removeClass(q).addClass(c))});g.debug&&a.tablesorter.benchmark("Applying "+n+" theme",b)},remove:function(e,b,c){var e=a(e),d="object"===typeof c.uitheme?"jui":c.uitheme||"jui",c="object"===typeof c.uitheme?c.uitheme:a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(d)?d:"jui"],i=e.children("thead").children(), f=c.sortNone+" "+c.sortDesc+" "+c.sortAsc;e.removeClass("tablesorter-"+d+" "+c.table).find(b.cssHeader).removeClass(c.header);i.unbind("mouseenter mouseleave").removeClass(c.hover+" "+f+" "+c.active).find(".tablesorter-filter-row").removeClass(c.filterRow);i.find(".tablesorter-icon").removeClass(c.icons)}});
a.tablesorter.addWidget({id:"columns",format:function(e){var b,c,d,i,f,g,m,n,h,l=a(e),p=e.config,q=p.widgetOptions,s=l.children("tbody:not(."+p.cssInfoBlock+")"),u=p.sortList,v=u.length,k=["primary", "secondary","tertiary"],k=p.widgetColumns&&p.widgetColumns.hasOwnProperty("css")?p.widgetColumns.css||k:q&&q.hasOwnProperty("columns")?q.columns||k:k;g=k.length-1;m=k.join(" ");p.debug&&(f=new Date);for(h=0;h<s.length;h++)b=a.tablesorter.processTbody(e,a(s[h]),!0),c=b.children("tr"),c.each(function(){i=a(this);if("none"!==this.style.display&&(d=i.children().removeClass(m),u&&u[0]&&(d.eq(u[0][0]).addClass(k[0]),1<v)))for(n=1;n<v;n++)d.eq(u[n][0]).addClass(k[n]||k[g])}),a.tablesorter.processTbody(e, b,!1);c=!1!==q.columns_thead?"thead tr":"";!1!==q.columns_tfoot&&(c+=(""===c?"":",")+"tfoot tr");if(c.length&&(i=l.find(c).children().removeClass(m),u&&u[0]&&(i.filter('[data-column="'+u[0][0]+'"]').addClass(k[0]),1<v)))for(n=1;n<v;n++)i.filter('[data-column="'+u[n][0]+'"]').addClass(k[n]||k[g]);p.debug&&a.tablesorter.benchmark("Applying Columns widget",f)},remove:function(e,b){var c,d,i=a(e).children("tbody:not(."+b.cssInfoBlock+")"),f=(b.widgetOptions.columns||["primary","secondary","tertiary"]).join(" "); for(c=0;c<i.length;c++)d=a.tablesorter.processTbody(e,a(i[c]),!0),d.children("tr").each(function(){a(this).children().removeClass(f)}),a.tablesorter.processTbody(e,d,!1)}});
-a.tablesorter.addWidget({id:"filter",format:function(e){if(e.config.parsers&&!a(e).hasClass("hasFilters")){var b,c,d,i,f,g,m,n,h,l,p,q,s,u,v,k,x,F="",z=a.tablesorter,r=e.config,B=a(r.headerList),j=r.widgetOptions,y=j.filter_cssFilter||"tablesorter-filter",t=a(e).addClass("hasFilters"),D=t.children("tbody:not(."+r.cssInfoBlock+ ")"),E=r.parsers.length,A=[/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,RegExp(r.cssChildRow),/undefined|number/,/(^[\"|\'|=])|([\"|\'|=]$)/,/[\"\'=]/g,/[^\w,. \-()]/g,/[<>=]/g],L=B.map(function(b){return z.getData?"parsed"===z.getData(B.filter('[data-column="'+b+'"]:last'),r.headers[b],"filter"):a(this).hasClass("filter-parsed")}).get(),G,H,C=function(b){var d=a.isArray(b),e=t.find("thead").eq(0).children("tr").find("select."+y+", input."+y),c=d?b:e.map(function(){return a(this).val()||""}).get(),f=(c|| []).join("");d&&e.each(function(c,d){a(d).val(b[c]||"")});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(F===f&&!1!==b))if(t.trigger("filterStart",[c]),r.showProcessing)setTimeout(function(){I(b,c,f);return!1},30);else return I(b,c,f),!1},I=function(g,i,h){var l,p,s,q,x,w,y;r.debug&&(y=new Date);for(d=0;d<D.length;d++){g=a.tablesorter.processTbody(e,a(D[d]),!0);l=g.children("tr");x=l.length;if(""===h)l.show().removeClass("filtered");else for(c= 0;c<x;c++)if(!A[1].test(l[c].className)){q=!0;s=l.eq(c).nextUntil("tr:not(."+r.cssChildRow+")");k=s.length&&(j&&j.hasOwnProperty("filter_childRows")&&"undefined"!==typeof j.filter_childRows?j.filter_childRows:1)?s.text():"";k=j.filter_ignoreCase?k.toLocaleLowerCase():k;p=l.eq(c).children("td");for(b=0;b<E;b++)if(i[b]){m=j.filter_useParsedData||L[b]?r.cache[d].normalized[c][b]:a.trim(p.eq(b).text());n=!A[2].test(typeof m)&&j.filter_ignoreCase?m.toLocaleLowerCase():m;w=q;f=j.filter_ignoreCase?i[b].toLocaleLowerCase(): i[b];if(j.filter_functions&&j.filter_functions[b])!0===j.filter_functions[b]?w=B.filter('[data-column="'+b+'"]:last').hasClass("filter-match")?0<=n.search(f):i[b]===m:"function"===typeof j.filter_functions[b]?w=j.filter_functions[b](m,r.cache[d].normalized[c][b],i[b],b):"function"===typeof j.filter_functions[b][i[b]]&&(w=j.filter_functions[b][i[b]](m,r.cache[d].normalized[c][b],i[b],b));else if(A[0].test(f)){u=A[0].exec(f);try{w=RegExp(u[1],u[2]).test(n)}catch(C){w=!1}}else A[3].test(f)&&n===f.replace(A[4], "")?w=!0:/^\!/.test(f)?(f=f.replace("!",""),v=n.search(a.trim(f)),w=""===f?!0:!(j.filter_startsWith?0===v:0<=v)):/^[<>]=?/.test(f)?(u=isNaN(n)?a.tablesorter.formatFloat(n.replace(A[5],""),e):a.tablesorter.formatFloat(n,e),v=a.tablesorter.formatFloat(f.replace(A[5],"").replace(A[6],""),e),/>/.test(f)&&(w=/>=/.test(f)?u>=v:u>v),/</.test(f)&&(w=/<=/.test(f)?u<=v:u<v)):/[\?|\*]/.test(f)?w=RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(n):(m=(n+k).indexOf(f),w=!j.filter_startsWith&&0<=m|| j.filter_startsWith&&0===m);q=w?q?!0:!1:!1}l[c].style.display=q?"":"none";l.eq(c)[q?"removeClass":"addClass"]("filtered");if(s.length)s[q?"show":"hide"]()}a.tablesorter.processTbody(e,g,!1)}F=h;r.debug&&z.benchmark("Completed filter widget search",y);t.trigger("applyWidgets");t.trigger("filterEnd")},J=function(b,f){var g,h=[],b=parseInt(b,10);g='<option value="">'+(B.filter('[data-column="'+b+'"]:last').attr("data-placeholder")||"")+"</option>";for(d=0;d<D.length;d++){i=r.cache[d].row.length;for(c= 0;c<i;c++)j.filter_useParsedData?h.push(""+r.cache[d].normalized[c][b]):(k=r.cache[d].row[c][0].cells[b])&&h.push(r.supportsTextContent?k.textContent:a(k).text())}h=a.grep(h,function(b,c){return a.inArray(b,h)===c});h=z.sortText?h.sort(function(a,c){return z.sortText(e,a,c,b)}):h.sort(!0);for(d=0;d<h.length;d++)g+='<option value="'+h[d]+'">'+h[d]+"</option>";t.find("thead").find("select."+y+'[data-column="'+b+'"]')[f?"html":"append"](g)},K=function(a){for(b=0;b<E;b++)k=B.filter('[data-column="'+b+ '"]:last'),k.hasClass("filter-select")&&(!k.hasClass("filter-false")&&!(j.filter_functions&&!0===j.filter_functions[b]))&&(j.filter_functions||(j.filter_functions={}),j.filter_functions[b]=!0,J(b,a))};r.debug&&(G=new Date);j.filter_ignoreCase=!1!==j.filter_ignoreCase;j.filter_useParsedData=!0===j.filter_useParsedData;if(!1!==j.filter_columnFilters){k='<tr class="tablesorter-filter-row">';for(b=0;b<E;b++)s=!1,s=B.filter('[data-column="'+b+'"]:last'),g=j.filter_functions&&j.filter_functions[b]&&"function"!== typeof j.filter_functions[b]||s.hasClass("filter-select"),k+="<td>",k=g?k+('<select data-column="'+b+'" class="'+y):k+('<input type="search" placeholder="'+(s.attr("data-placeholder")||"")+'" data-column="'+b+'" class="'+y),s=z.getData?"false"===z.getData(s[0],r.headers[b],"filter"):r.headers[b]&&r.headers[b].hasOwnProperty("filter")&&!1===r.headers[b].filter||s.hasClass("filter-false"),k+=s?' disabled" disabled':'"',k+=(g?"></select>":">")+"</td>";t.find("thead").eq(0).append(k+="</tr>")}t.bind(["addRows", "updateCell","update","appendCache","search"].join(".tsfilter "),function(a,b){"search"!==a.type&&K(!0);C("search"===a.type?b:"");return!1}).find("input."+y).bind("keyup search",function(a,b){if(!(32>a.which&&8!==a.which||37<=a.which&&40>=a.which)){if("undefined"!==typeof b)return C(b),!1;clearTimeout(H);H=setTimeout(function(){C()},j.filter_searchDelay||300)}});j.filter_reset&&a(j.filter_reset).length&&a(j.filter_reset).bind("click",function(){t.find("."+y).val("");C();return!1});if(j.filter_functions)for(x in j.filter_functions)if(j.filter_functions.hasOwnProperty(x)&& "string"===typeof x)if(k=B.filter('[data-column="'+x+'"]:last'),g="",!0===j.filter_functions[x]&&!k.hasClass("filter-false"))J(x);else if("string"===typeof x&&!k.hasClass("filter-false")){for(l in j.filter_functions[x])"string"===typeof l&&(g+=""===g?'<option value="">'+(k.attr("data-placeholder")||"")+"</option>":"",g+='<option value="'+l+'">'+l+"</option>");t.find("thead").find("select."+y+'[data-column="'+x+'"]').append(g)}K();t.find("select."+y).bind("change search",function(){C()});!0===j.filter_hideFilters&& t.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(b){var c;p=a(this);clearTimeout(h);h=setTimeout(function(){/enter|over/.test(b.type)?p.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==p[0]&&(c=t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""),""===c&&p.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(b){q=a(this).closest("tr");clearTimeout(h);h=setTimeout(function(){if(""=== t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""))q["focus"===b.type?"removeClass":"addClass"]("hideme")},200)});r.showProcessing&&t.bind("filterStart filterEnd",function(b,c){var d=c?t.find("."+r.cssHeader).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"";z.isProcessing(t[0],"filterStart"===b.type,c?d:"")});r.debug&&z.benchmark("Applying Filter widget",G);t.trigger("filterInit")}},remove:function(e,b, c){var d,i;d=a(e);b=d.children("tbody:not(."+b.cssInfoBlock+")");d.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(d=0;d<b.length;d++)i=a.tablesorter.processTbody(e,a(b[d]),!0),i.children().removeClass("filtered").show(),a.tablesorter.processTbody(e,i,!1);c.filterreset&&a(c.filter_reset).unbind("click")}});
-a.tablesorter.addWidget({id:"stickyHeaders",format:function(e){if(!a(e).hasClass("hasStickyHeaders")){var b= a(e).addClass("hasStickyHeaders"),c=e.config,d=c.widgetOptions,i=a(window),f=a(e).children("thead:first"),g=f.children("tr:not(.sticky-false)").children(),e=d.stickyHeaders||"tablesorter-stickyHeader",m=g.eq(0),n=b.find("tfoot"),h=f.clone().addClass(e).css({width:f.outerWidth(!0),position:"fixed",margin:0,top:0,visibility:"hidden",zIndex:1}),l=h.find("tr").children(),p="",q=0,s=function(){var c=navigator.userAgent;q=0;"collapse"!==b.css("border-collapse")&&!/webkit/i.test(c)&&(q=/msie/i.test(c)?parseInt(f.css("padding-left"), 10):parseInt(b.css("border-spacing"),10));h.css({left:f.offset().left-i.scrollLeft()-q,width:f.outerWidth()});l.each(function(b){b=g.eq(b);a(this).css({width:b.width(),height:b.height()})}).find(".tablesorter-header-inner").each(function(b){b=g.eq(b).find(".tablesorter-header-inner").width();a(this).width(b)})};h.find("tr.sticky-false").remove();l.find(".tablesorter-resizer").remove();b.bind("sortEnd.tsSticky",function(){g.each(function(b){b=l.eq(b);b.attr("class",a(this).attr("class"));c.cssIcon&& b.find("."+c.cssIcon).attr("class",a(this).find("."+c.cssIcon).attr("class"))})}).bind("pagerComplete.tsSticky",function(){s()});g.find("*").andSelf().filter(c.selectorSort).each(function(b){var c=a(this);l.eq(b).bind("mouseup",function(b){c.trigger(b,!0)}).bind("mousedown",function(){this.onselectstart=function(){return!1};return!1})});f.after(h);i.bind("scroll.tsSticky",function(){var a=m.offset(),c=i.scrollTop(),d=b.height()-(m.height()+(n.height()||0)),a=c>a.top&&c<a.top+d?"visible":"hidden"; h.css({left:f.offset().left-i.scrollLeft()-q,visibility:a});a!==p&&(s(),p=a)}).bind("resize.tsSticky",function(){s()})}},remove:function(e,b,c){e=a(e);c=c.stickyHeaders||"tablesorter-stickyHeader";e.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+c).remove();a(window).unbind("scroll.tsSticky resize.tsSticky")}});
-a.tablesorter.addWidget({id:"resizable",format:function(e){if(!a(e).hasClass("hasResizable")){a(e).addClass("hasResizable");var b,c,d,i,f,g=a(e), m=e.config,n=m.widgetOptions,h=0,l=null,p=null,q=function(){h=0;l=p=null;a(window).trigger("resize")};if(d=a.tablesorter.storage&&!1!==n.resizable?a.tablesorter.storage(e,"tablesorter-resizable"):{})for(c in d)!isNaN(c)&&c<m.headerList.length&&a(m.headerList[c]).width(d[c]);g.children("thead:first").find("tr").each(function(){i=a(this).children();a(this).find(".tablesorter-wrapper").length||i.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');i=i.slice(0, -1);f=f?f.add(i):i});f.each(function(){b=a(this);c=parseInt(b.css("padding-right"),10)+8;b.find(".tablesorter-wrapper").append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:16px;right:-'+c+'px;top:0;z-index:1;"></div>')}).bind("mousemove.tsresize",function(a){if(0!==h&&l){var b=a.pageX-h;l.width(l.width()+b);p.width(p.width()-b);h=a.pageX}}).bind("mouseup.tsresize",function(){a.tablesorter.storage&&l&&(d[l.index()]=l.width(),d[p.index()]=p.width(),!1!== n.resizable&&a.tablesorter.storage(e,"tablesorter-resizable",d));q()}).find(".tablesorter-resizer").bind("mousedown",function(b){l=a(b.target).parents("th:last");p=l.next();h=b.pageX});g.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize",function(){q()}).bind("contextmenu.tsresize",function(){a.tablesorter.resizableReset(e);var b=a.isEmptyObject?a.isEmptyObject(d):d==={};d={};return b})}},remove:function(e){a(e).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){a(this).find(".tablesorter-resizer").remove(); a(this).replaceWith(a(this).contents())});a.tablesorter.resizableReset(e)}});a.tablesorter.resizableReset=function(e){a(e.config.headerList).width("auto");a.tablesorter.storage(e,"tablesorter-resizable",{})};
-a.tablesorter.addWidget({id:"saveSort",init:function(a,b){b.format(a,!0)},format:function(e,b){var c,d,i=e.config;c=!1!==i.widgetOptions.saveSort;var f={sortList:i.sortList};i.debug&&(d=new Date);a(e).hasClass("hasSaveSort")?c&&(e.hasInitialized&&a.tablesorter.storage)&&(a.tablesorter.storage(e, "tablesorter-savesort",f),i.debug&&a.tablesorter.benchmark("saveSort widget: Saving last sort: "+i.sortList,d)):(a(e).addClass("hasSaveSort"),f="",a.tablesorter.storage&&(f=(c=a.tablesorter.storage(e,"tablesorter-savesort"))&&c.hasOwnProperty("sortList")&&a.isArray(c.sortList)?c.sortList:"",i.debug&&a.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',d)),b&&f&&0<f.length?i.sortList=f:e.hasInitialized&&(f&&0<f.length)&&a(e).trigger("sorton",[f]))},remove:function(e){a.tablesorter.storage(e, "tablesorter-savesort","")}})})(jQuery);
+a.tablesorter.addWidget({id:"filter",format:function(e){if(e.config.parsers&&!a(e).hasClass("hasFilters")){var b,c,d,i,f,g,m,n,h,l,p,q,s,u,v,k,x,F="",z=a.tablesorter,r=e.config,A=a(r.headerList),j=r.widgetOptions,y=j.filter_cssFilter||"tablesorter-filter",t=a(e).addClass("hasFilters"),D=t.children("tbody:not(."+r.cssInfoBlock+ ")"),E=r.parsers.length,B=[/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,RegExp(r.cssChildRow),/undefined|number/,/(^[\"|\'|=])|([\"|\'|=]$)/,/[\"\'=]/g,/[^\w,. \-()]/g,/[<>=]/g],L=A.map(function(b){return z.getData?"parsed"===z.getData(A.filter('[data-column="'+b+'"]:last'),r.headers[b],"filter"):a(this).hasClass("filter-parsed")}).get(),G,H,C=function(b){var d=a.isArray(b),e=t.find("thead").eq(0).children("tr").find("select."+y+", input."+y),c=d?b:e.map(function(){return a(this).val()||""}).get(),f=(c|| []).join("");d&&e.each(function(c,d){a(d).val(b[c]||"")});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(F===f&&!1!==b))if(t.trigger("filterStart",[c]),r.showProcessing)setTimeout(function(){I(b,c,f);return!1},30);else return I(b,c,f),!1},I=function(g,i,h){var l,p,s,q,x,w,y;r.debug&&(y=new Date);for(d=0;d<D.length;d++){g=a.tablesorter.processTbody(e,a(D[d]),!0);l=g.children("tr");x=l.length;if(""===h)l.show().removeClass("filtered");else for(c= 0;c<x;c++)if(!B[1].test(l[c].className)){q=!0;s=l.eq(c).nextUntil("tr:not(."+r.cssChildRow+")");k=s.length&&(j&&j.hasOwnProperty("filter_childRows")&&"undefined"!==typeof j.filter_childRows?j.filter_childRows:1)?s.text():"";k=j.filter_ignoreCase?k.toLocaleLowerCase():k;p=l.eq(c).children("td");for(b=0;b<E;b++)if(i[b]){m=j.filter_useParsedData||L[b]?r.cache[d].normalized[c][b]:a.trim(p.eq(b).text());n=!B[2].test(typeof m)&&j.filter_ignoreCase?m.toLocaleLowerCase():m;w=q;f=j.filter_ignoreCase?i[b].toLocaleLowerCase(): i[b];if(j.filter_functions&&j.filter_functions[b])!0===j.filter_functions[b]?w=A.filter('[data-column="'+b+'"]:last').hasClass("filter-match")?0<=n.search(f):i[b]===m:"function"===typeof j.filter_functions[b]?w=j.filter_functions[b](m,r.cache[d].normalized[c][b],i[b],b):"function"===typeof j.filter_functions[b][i[b]]&&(w=j.filter_functions[b][i[b]](m,r.cache[d].normalized[c][b],i[b],b));else if(B[0].test(f)){u=B[0].exec(f);try{w=RegExp(u[1],u[2]).test(n)}catch(C){w=!1}}else B[3].test(f)&&n===f.replace(B[4], "")?w=!0:/^\!/.test(f)?(f=f.replace("!",""),v=n.search(a.trim(f)),w=""===f?!0:!(j.filter_startsWith?0===v:0<=v)):/^[<>]=?/.test(f)?(u=isNaN(n)?a.tablesorter.formatFloat(n.replace(B[5],""),e):a.tablesorter.formatFloat(n,e),v=a.tablesorter.formatFloat(f.replace(B[5],"").replace(B[6],""),e),/>/.test(f)&&(w=/>=/.test(f)?u>=v:u>v),/</.test(f)&&(w=/<=/.test(f)?u<=v:u<v)):/[\?|\*]/.test(f)?w=RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(n):(m=(n+k).indexOf(f),w=!j.filter_startsWith&&0<=m|| j.filter_startsWith&&0===m);q=w?q?!0:!1:!1}l[c].style.display=q?"":"none";l.eq(c)[q?"removeClass":"addClass"]("filtered");if(s.length)s[q?"show":"hide"]()}a.tablesorter.processTbody(e,g,!1)}F=h;r.debug&&z.benchmark("Completed filter widget search",y);t.trigger("applyWidgets");t.trigger("filterEnd")},J=function(b,f){var g,h=[],b=parseInt(b,10);g='<option value="">'+(A.filter('[data-column="'+b+'"]:last').attr("data-placeholder")||"")+"</option>";for(d=0;d<D.length;d++){i=r.cache[d].row.length;for(c= 0;c<i;c++)j.filter_useParsedData?h.push(""+r.cache[d].normalized[c][b]):(k=r.cache[d].row[c][0].cells[b])&&h.push(r.supportsTextContent?k.textContent:a(k).text())}h=a.grep(h,function(b,c){return a.inArray(b,h)===c});h=z.sortText?h.sort(function(a,c){return z.sortText(e,a,c,b)}):h.sort(!0);for(d=0;d<h.length;d++)g+='<option value="'+h[d]+'">'+h[d]+"</option>";t.find("thead").find("select."+y+'[data-column="'+b+'"]')[f?"html":"append"](g)},K=function(a){for(b=0;b<E;b++)k=A.filter('[data-column="'+b+ '"]:last'),k.hasClass("filter-select")&&(!k.hasClass("filter-false")&&!(j.filter_functions&&!0===j.filter_functions[b]))&&(j.filter_functions||(j.filter_functions={}),j.filter_functions[b]=!0,J(b,a))};r.debug&&(G=new Date);j.filter_ignoreCase=!1!==j.filter_ignoreCase;j.filter_useParsedData=!0===j.filter_useParsedData;if(!1!==j.filter_columnFilters&&A.filter(".filter-false").length!==A.length){k='<tr class="tablesorter-filter-row">';for(b=0;b<E;b++)s=!1,s=A.filter('[data-column="'+b+'"]:last'),g=j.filter_functions&& j.filter_functions[b]&&"function"!==typeof j.filter_functions[b]||s.hasClass("filter-select"),k+="<td>",k=g?k+('<select data-column="'+b+'" class="'+y):k+('<input type="search" placeholder="'+(s.attr("data-placeholder")||"")+'" data-column="'+b+'" class="'+y),s=z.getData?"false"===z.getData(s[0],r.headers[b],"filter"):r.headers[b]&&r.headers[b].hasOwnProperty("filter")&&!1===r.headers[b].filter||s.hasClass("filter-false"),k+=s?' disabled" disabled':'"',k+=(g?"></select>":">")+"</td>";t.find("thead").eq(0).append(k+= "</tr>")}t.bind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter "),function(a,b){"search"!==a.type&&K(!0);C("search"===a.type?b:"");return!1}).find("input."+y).bind("keyup search",function(a,b){if(!(32>a.which&&8!==a.which||37<=a.which&&40>=a.which)){if("undefined"!==typeof b)return C(b),!1;clearTimeout(H);H=setTimeout(function(){C()},j.filter_searchDelay||300)}});j.filter_reset&&a(j.filter_reset).length&&a(j.filter_reset).bind("click",function(){t.find("."+y).val("");C(); return!1});if(j.filter_functions)for(x in j.filter_functions)if(j.filter_functions.hasOwnProperty(x)&&"string"===typeof x)if(k=A.filter('[data-column="'+x+'"]:last'),g="",!0===j.filter_functions[x]&&!k.hasClass("filter-false"))J(x);else if("string"===typeof x&&!k.hasClass("filter-false")){for(l in j.filter_functions[x])"string"===typeof l&&(g+=""===g?'<option value="">'+(k.attr("data-placeholder")||"")+"</option>":"",g+='<option value="'+l+'">'+l+"</option>");t.find("thead").find("select."+y+'[data-column="'+ x+'"]').append(g)}K();t.find("select."+y).bind("change search",function(){C()});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(b){var c;p=a(this);clearTimeout(h);h=setTimeout(function(){/enter|over/.test(b.type)?p.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==p[0]&&(c=t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""),""===c&&p.addClass("hideme"))}, 200)}).find("input, select").bind("focus blur",function(b){q=a(this).closest("tr");clearTimeout(h);h=setTimeout(function(){if(""===t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""))q["focus"===b.type?"removeClass":"addClass"]("hideme")},200)});r.showProcessing&&t.bind("filterStart filterEnd",function(b,c){var d=c?t.find("."+r.cssHeader).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"";z.isProcessing(t[0], "filterStart"===b.type,c?d:"")});r.debug&&z.benchmark("Applying Filter widget",G);t.trigger("filterInit")}},remove:function(e,b,c){var d,i;d=a(e);b=d.children("tbody:not(."+b.cssInfoBlock+")");d.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(d=0;d<b.length;d++)i=a.tablesorter.processTbody(e,a(b[d]),!0),i.children().removeClass("filtered").show(),a.tablesorter.processTbody(e,i,!1);c.filterreset&& a(c.filter_reset).unbind("click")}});
+a.tablesorter.addWidget({id:"stickyHeaders",format:function(e){if(!a(e).hasClass("hasStickyHeaders")){var b=a(e).addClass("hasStickyHeaders"),c=e.config,d=c.widgetOptions,i=a(window),f=a(e).children("thead:first"),g=f.children("tr:not(.sticky-false)").children(),e=d.stickyHeaders||"tablesorter-stickyHeader",m=g.eq(0),n=b.find("tfoot"),h=f.clone().addClass(e).css({width:f.outerWidth(!0),position:"fixed",margin:0,top:0,visibility:"hidden",zIndex:1}),l=h.find("tr").children(), p="",q=0,s=function(){var c=navigator.userAgent;q=0;"collapse"!==b.css("border-collapse")&&!/webkit/i.test(c)&&(q=/msie/i.test(c)?parseInt(f.css("padding-left"),10):parseInt(b.css("border-spacing"),10));h.css({left:f.offset().left-i.scrollLeft()-q,width:f.outerWidth()});l.each(function(b){b=g.eq(b);a(this).css({width:b.width(),height:b.height()})}).find(".tablesorter-header-inner").each(function(b){b=g.eq(b).find(".tablesorter-header-inner").width();a(this).width(b)})};h.find("tr.sticky-false").remove(); l.find(".tablesorter-resizer").remove();b.bind("sortEnd.tsSticky",function(){g.each(function(b){b=l.eq(b);b.attr("class",a(this).attr("class"));c.cssIcon&&b.find("."+c.cssIcon).attr("class",a(this).find("."+c.cssIcon).attr("class"))})}).bind("pagerComplete.tsSticky",function(){s()});g.find("*").andSelf().filter(c.selectorSort).each(function(b){var c=a(this);l.eq(b).bind("mouseup",function(b){c.trigger(b,!0)}).bind("mousedown",function(){this.onselectstart=function(){return!1};return!1})});f.after(h); i.bind("scroll.tsSticky",function(){var a=m.offset(),c=i.scrollTop(),d=b.height()-(m.height()+(n.height()||0)),a=c>a.top&&c<a.top+d?"visible":"hidden";h.css({left:f.offset().left-i.scrollLeft()-q,visibility:a});a!==p&&(s(),p=a)}).bind("resize.tsSticky",function(){s()})}},remove:function(e,b,c){e=a(e);c=c.stickyHeaders||"tablesorter-stickyHeader";e.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+c).remove();a(window).unbind("scroll.tsSticky resize.tsSticky")}});
+a.tablesorter.addWidget({id:"resizable",format:function(e){if(!a(e).hasClass("hasResizable")){a(e).addClass("hasResizable");var b,c,d,i,f,g=a(e),m=e.config,n=m.widgetOptions,h=0,l=null,p=null,q=function(){h=0;l=p=null;a(window).trigger("resize")};if(d=a.tablesorter.storage&&!1!==n.resizable?a.tablesorter.storage(e,"tablesorter-resizable"):{})for(c in d)!isNaN(c)&&c<m.headerList.length&&a(m.headerList[c]).width(d[c]);g.children("thead:first").find("tr").each(function(){i=a(this).children();a(this).find(".tablesorter-wrapper").length|| i.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');i=i.slice(0,-1);f=f?f.add(i):i});f.each(function(){b=a(this);c=parseInt(b.css("padding-right"),10)+8;b.find(".tablesorter-wrapper").append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:16px;right:-'+c+'px;top:0;z-index:1;"></div>')}).bind("mousemove.tsresize",function(a){if(0!==h&&l){var b=a.pageX-h;l.width(l.width()+b);p.width(p.width()-b);h=a.pageX}}).bind("mouseup.tsresize", function(){a.tablesorter.storage&&l&&(d[l.index()]=l.width(),d[p.index()]=p.width(),!1!==n.resizable&&a.tablesorter.storage(e,"tablesorter-resizable",d));q()}).find(".tablesorter-resizer").bind("mousedown",function(b){l=a(b.target).parents("th:last");p=l.next();h=b.pageX});g.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize",function(){q()}).bind("contextmenu.tsresize",function(){a.tablesorter.resizableReset(e);var b=a.isEmptyObject?a.isEmptyObject(d):d==={};d={};return b})}},remove:function(e){a(e).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){a(this).find(".tablesorter-resizer").remove(); a(this).replaceWith(a(this).contents())});a.tablesorter.resizableReset(e)}});a.tablesorter.resizableReset=function(e){a(e.config.headerList).width("auto");a.tablesorter.storage(e,"tablesorter-resizable",{})};
+a.tablesorter.addWidget({id:"saveSort",init:function(a,b){b.format(a,!0)},format:function(e,b){var c,d,i=e.config;c=!1!==i.widgetOptions.saveSort;var f={sortList:i.sortList};i.debug&&(d=new Date);a(e).hasClass("hasSaveSort")?c&&(e.hasInitialized&&a.tablesorter.storage)&&(a.tablesorter.storage(e, "tablesorter-savesort",f),i.debug&&a.tablesorter.benchmark("saveSort widget: Saving last sort: "+i.sortList,d)):(a(e).addClass("hasSaveSort"),f="",a.tablesorter.storage&&(f=(c=a.tablesorter.storage(e,"tablesorter-savesort"))&&c.hasOwnProperty("sortList")&&a.isArray(c.sortList)?c.sortList:"",i.debug&&a.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',d)),b&&f&&0<f.length?i.sortList=f:e.hasInitialized&&(f&&0<f.length)&&a(e).trigger("sorton",[f]))},remove:function(e){a.tablesorter.storage(e, "tablesorter-savesort","")}})
+})(jQuery);
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "tablesorter",
- "version": "2.4.4",
+ "version": "2.4.5",
"title": "tablesorter",
"author": {
"name": "Christian Bach",

0 comments on commit e5b196b

Please sign in to comment.
Something went wrong with that request. Please try again.