From 8c7826c103807b716d311be6a3e9f943fceff6b3 Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sat, 17 Mar 2012 22:18:11 -0500 Subject: [PATCH] updated pager minified version --- README.markdown | 5 +++++ addons/pager/jquery.tablesorter.pager.js | 2 +- addons/pager/jquery.tablesorter.pager.min.js | 4 ++-- changelog.txt | 6 ++++++ docs/example-pager.html | 5 +++++ package.json | 2 +- 6 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.markdown b/README.markdown index 9b694c7d..84d99ed3 100644 --- a/README.markdown +++ b/README.markdown @@ -34,6 +34,11 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt). +#### Version 2.1.3.1 (3/17/2012) + +* Merged in bug fixes contributed by [Rozwell](https://github.com/rozwell). Thanks! +* Updated pager minified version, along with version numbers. + #### Version 2.1.3 (3/12/2012) * Added `usNumberFormat` option. diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js index ae1ad0de..5c182311 100644 --- a/addons/pager/jquery.tablesorter.pager.js +++ b/addons/pager/jquery.tablesorter.pager.js @@ -1,6 +1,6 @@ /* * tablesorter pager plugin - * updated 3/16/2012 + * updated 3/17/2012 */ (function($) { diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js index 4484168d..17cccb84 100644 --- a/addons/pager/jquery.tablesorter.pager.min.js +++ b/addons/pager/jquery.tablesorter.pager.min.js @@ -1,3 +1,3 @@ -/* tablesorter pager plugin minified - updated 3/16/2012 */ +/* tablesorter pager plugin minified - updated 3/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:!0,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0};var n=this,i=function(c,b){var a=c.cssDisabled,e=!!b;c.updateArrows&&(c.container[c.totalRows< c.size?"addClass":"removeClass"](a),d(c.cssFirst+","+c.cssPrev,c.container)[e||0===c.page?"addClass":"removeClass"](a),d(c.cssNext+","+c.cssLast,c.container)[e||c.page===c.totalPages-1?"addClass":"removeClass"](a))},t=function(c,b){if(0')},o=function(c,b){var a, e=d("tr:not(."+c.config.cssChildRow+")",c.tBodies[0]),g=e.length,f=b.page*b.size,j=f+b.size;j>g&&(j=g);for(a=0;a=f&&a'+(e?e.message+" ("+e.name+")":"No rows found")+"",m=a.ajaxProcessing(c)||[0,[]],s=m[1]||[],p=s.length,q=m[2];if(0";for(g=0;g"+s[c][g]+"";l+=""}q&&q.length===n&&(f=h.hasClass("hasStickyHeaders"),j=h.find("."+(a.widgetOptions&&a.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),h.find("thead tr.tablesorter-header th").each(function(a){var b=d(this), b=b.find("span").length?b.find("span:first"):b;b.html(q[a]);f&&j.length&&(b=j.find("th").eq(a),b=b.find("span").length?b.find("span:first"):b,b.html(q[a]));i+=""+q[a]+""}),h.find("tfoot").html(""+i+""));e?h.find("thead").append(o):k.html(l);a.temp.remove();h.trigger("update");a.totalRows=m[0]||0;a.totalPages=Math.ceil(a.totalRows/a.size);t(b,a);r(b,a);h.trigger("pagerChange",a)}},v=function(c,b){var a=d(c),e=b.ajaxUrl.replace(/\{page\}/g,b.page).replace(/\{size\}/g,b.size);""!== e&&(b.temp=d("
",{id:"tablesorterPagerLoading",width:a.outerWidth(!0),height:a.outerHeight(!0)}),a.before(b.temp),d(document).ajaxError(function(a,d,e,h){u(null,c,b,h)}),d.getJSON(e,function(a){u(a,c,b)}))},m=function(c,b,a){var e,g,f,j=d(c.tBodies[0]),h=b.length;e=a.page*a.size;var i=e+a.size;if(!(1>h)){d(c).trigger("pagerChange",a);if(a.removeRows){i>b.length&&(i=b.length);for(d(c.tBodies[0]).empty();e=a.totalPages&&(a.page=a.totalPages-1,k(c,a));t(c,a);a.isDisabled||r(c,a)}},w=function(c,b){b.ajax?i(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(),m(c,c.config.rowsCopy,b));d(b.cssPageSize,b.container).addClass(b.cssDisabled)[0].disabled=!0},k=function(c,b){if(!b.isDisabled){if(0>b.page||b.page>b.totalPages-1)b.page=0;d.data(c,"pagerLastPage",b.page);b.ajax? v(c,b):m(c,c.config.rowsCopy,b)}},x=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)},y=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")||0;b.size=d.data(c,"pagerLastSize")||parseInt(e.val(),10);b.totalPages=Math.ceil(b.totalRows/b.size);a&&(d("table").trigger("update"),x(c,b.size,b),p(c,b),r(c,b))};n.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),m(c,b,a))};n.construct=function(c){return this.each(function(){var b=this.config,a=b.pager=d.extend({},d.tablesorterPager.defaults,c),e=this,g=d(e),f=d(a.container).show();b.appender=n.appender;y(e,a,!1);"string"===typeof a.ajaxUrl?(a.ajax=!0,v(e,a)):(a.ajax=!1,d(this).trigger("appendCache"),p(e,a));d(a.cssFirst,f).unbind("click.pager").bind("click.pager", function(){if(!d(this).hasClass(a.cssDisabled)){a.page=0;k(e,a)}return false});d(a.cssNext,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page++;if(a.page>=a.totalPages-1)a.page=a.totalPages-1;k(e,a)}return false});d(a.cssPrev,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page--;if(a.page<=0)a.page=0;k(e,a)}return false});d(a.cssLast,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page= a.totalPages-1;k(e,a)}return false});d(a.cssPageSize,f).unbind("change.pager").bind("change.pager",function(){d(a.cssPageSize,f).val(d(this).val());if(!d(this).hasClass(a.cssDisabled)){x(e,parseInt(d(this).val(),10),a);var b=d(e.tBodies[0]);b.find("tr.pagerSavedHeightSpacer").remove();d.data(e,"pagerSavedHeight",b.height());r(e,a);d.data(e,"pagerLastSize",a.size)}return false});g.unbind("disable.pager enable.pager destroy.pager").bind("disable.pager",function(){w(e,a)}).bind("enable.pager",function(){y(e, a,true)}).bind("destroy.pager",function(){w(e,a);a.container.hide();e.config.appender=null;d(e).unbind("destroy.pager sortEnd.pager enable.pager disable.pager")})})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery); +(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:!0,cssNext:".next",cssPrev:".prev",cssFirst:".first",cssLast:".last",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssDisabled:"disabled",totalRows:0,totalPages:0};var n=this,i=function(c,b){var a=c.cssDisabled,e=!!b;c.updateArrows&&(c.container[c.totalRows< c.size?"addClass":"removeClass"](a),d(c.cssFirst+","+c.cssPrev,c.container)[e||0===c.page?"addClass":"removeClass"](a),d(c.cssNext+","+c.cssLast,c.container)[e||c.page===c.totalPages-1?"addClass":"removeClass"](a))},t=function(c,b){if(0')},o=function(c,b){var a, e=d("tr:not(."+c.config.cssChildRow+")",c.tBodies[0]),g=e.length,f=b.page*b.size,j=f+b.size;j>g&&(j=g);for(a=0;a=f&&a'+(e?e.message+" ("+e.name+")":"No rows found")+"",m=a.ajaxProcessing(c)||[0,[]],s=m[1]||[],p=s.length,q=m[2];if(0";for(g=0;g"+s[c][g]+"";l+=""}q&&q.length===n&&(f=h.hasClass("hasStickyHeaders"),j=h.find("."+(a.widgetOptions&&a.widgetOptions.stickyHeaders||"tablesorter-stickyheader")),h.find("thead tr.tablesorter-header th").each(function(a){var b= d(this),b=b.find("span").length?b.find("span:first"):b;b.html(q[a]);f&&j.length&&(b=j.find("th").eq(a),b=b.find("span").length?b.find("span:first"):b,b.html(q[a]));i+=""+q[a]+""}),h.find("tfoot").html(""+i+""));e?h.find("thead").append(o):k.html(l);a.temp.remove();h.trigger("update");a.totalRows=m[0]||0;a.totalPages=Math.ceil(a.totalRows/a.size);t(b,a);r(b,a);h.trigger("pagerChange",a)}},v=function(c,b){var a=d(c),e=b.ajaxUrl.replace(/\{page\}/g,b.page).replace(/\{size\}/g,b.size); ""!==e&&(b.temp=d("
",{id:"tablesorterPagerLoading",width:a.outerWidth(!0),height:a.outerHeight(!0)}),a.before(b.temp),d(document).ajaxError(function(a,d,e,h){u(null,c,b,h)}),d.getJSON(e,function(a){u(a,c,b)}))},m=function(c,b,a){var e,g,f,j=d(c.tBodies[0]),h=b.length;e=a.page*a.size;var i=e+a.size;if(!(1>h)){d(c).trigger("pagerChange",a);if(a.removeRows){i>b.length&&(i=b.length);for(d(c.tBodies[0]).empty();e=a.totalPages&&(a.page=a.totalPages-1,k(c,a));t(c,a);a.isDisabled||r(c,a)}},w=function(c,b){b.ajax?i(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(),m(c,c.config.rowsCopy,b));d(b.cssPageSize,b.container).addClass(b.cssDisabled)[0].disabled=!0},k=function(c,b){if(!b.isDisabled){if(0>b.page||b.page>b.totalPages-1)b.page=0;d.data(c,"pagerLastPage",b.page);b.ajax? v(c,b):m(c,c.config.rowsCopy,b)}},x=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)},y=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(b.totalRows/b.size);a&&(d(c).trigger("update"),x(c,b.size,b),p(c,b),r(c,b))}; n.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),m(c,b,a))};n.construct=function(c){return this.each(function(){var b=this.config,a=b.pager=d.extend({},d.tablesorterPager.defaults,c),e=this,g=d(e),f=d(a.container).show();b.appender=n.appender;y(e,a,!1);"string"===typeof a.ajaxUrl?(a.ajax=!0,v(e,a)):(a.ajax=!1,d(this).trigger("appendCache"),p(e,a));d(a.cssFirst,f).unbind("click.pager").bind("click.pager", function(){if(!d(this).hasClass(a.cssDisabled)){a.page=0;k(e,a)}return false});d(a.cssNext,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page++;if(a.page>=a.totalPages-1)a.page=a.totalPages-1;k(e,a)}return false});d(a.cssPrev,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page--;if(a.page<=0)a.page=0;k(e,a)}return false});d(a.cssLast,f).unbind("click.pager").bind("click.pager",function(){if(!d(this).hasClass(a.cssDisabled)){a.page= a.totalPages-1;k(e,a)}return false});d(a.cssPageSize,f).unbind("change.pager").bind("change.pager",function(){d(a.cssPageSize,f).val(d(this).val());if(!d(this).hasClass(a.cssDisabled)){x(e,parseInt(d(this).val(),10),a);var b=d(e.tBodies[0]);b.find("tr.pagerSavedHeightSpacer").remove();d.data(e,"pagerSavedHeight",b.height());r(e,a);d.data(e,"pagerLastSize",a.size)}return false});g.unbind("disable.pager enable.pager destroy.pager").bind("disable.pager",function(){w(e,a)}).bind("enable.pager",function(){y(e, a,true)}).bind("destroy.pager",function(){w(e,a);a.container.hide();e.config.appender=null;d(e).unbind("destroy.pager sortEnd.pager enable.pager disable.pager")})})}}});d.fn.extend({tablesorterPager:d.tablesorterPager.construct})})(jQuery); diff --git a/changelog.txt b/changelog.txt index 1964aff6..41af79f3 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,11 @@ TableSorter Change Log +Version 2.1.3.1 (3/17/2012) +============================ + +* Merged in bug fixes contributed by [Rozwell](https://github.com/rozwell). Thanks! +* Updated pager minified version, along with version numbers. + Version 2.1.3 (3/12/2012) ============================ diff --git a/docs/example-pager.html b/docs/example-pager.html index a0b529a5..9aff762c 100644 --- a/docs/example-pager.html +++ b/docs/example-pager.html @@ -558,6 +558,11 @@ div.tablesorterPager input {

Pager Change Log

+

Version 2.1.3.1 (3/17/2012)

+
    +
  • Rozwell contributed some bug fixes that occur when cssPageSize is not set. Thanks for sharing!
  • +
+

Version 2.1

  • Ajax: diff --git a/package.json b/package.json index 34f4081b..6b67c339 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tablesorter", - "version": "2.1.3", + "version": "2.1.3.1", "title": "tablesorter", "author": { "name": "Christian Bach",