Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Minify library.

  • Loading branch information...
commit ce39952c94e2aeb50afc22417c1785e6121d32eb 1 parent 7b21f80
@alexandernst alexandernst authored
Showing with 10 additions and 5 deletions.
  1. +8 −3 dist/backbone.paginator.js
  2. +2 −2 dist/backbone.paginator.min.js
View
11 dist/backbone.paginator.js
@@ -1,4 +1,4 @@
-/*! backbone.paginator - v0.1.54 - 5/8/2012
+/*! backbone.paginator - v0.1.54 - 5/9/2012
* http://github.com/addyosmani/backbone.paginator
* Copyright (c) 2012 Addy Osmani; Licensed MIT */
@@ -116,7 +116,10 @@ Backbone.Paginator = (function ( Backbone, _, $ ) {
if (direction === 'desc') {
- if( ac.match(/[\d\.]*/) && bc.match(/[\d\.]*/) ) {
+ if((!ac.match(/[^\d\.]/) && ac.match(/[\d\.]*/)) &&
+ (!bc.match(/[^\d\.]/) && bc.match(/[\d\.]*/))
+ ){
+
if( (ac - 0) < (bc - 0) ) {
return 1;
}
@@ -134,7 +137,9 @@ Backbone.Paginator = (function ( Backbone, _, $ ) {
} else {
- if( ac.match(/[\d\.]*/) && bc.match(/[\d\.]*/) ) {
+ if((!ac.match(/[^\d\.]/) && ac.match(/[\d\.]*/)) &&
+ (!bc.match(/[^\d\.]/) && bc.match(/[\d\.]*/))
+ ){
if( (ac - 0) < (bc - 0) ) {
return -1;
}
View
4 dist/backbone.paginator.min.js
@@ -1,4 +1,4 @@
-/*! backbone.paginator - v0.1.54 - 5/8/2012
+/*! backbone.paginator - v0.1.54 - 5/9/2012
* http://github.com/addyosmani/backbone.paginator
* Copyright (c) 2012 Addy Osmani; Licensed MIT */
-Backbone.Paginator=function(a,b,c){"use strict";var d={};d.version="0.15",d.clientPager=a.Collection.extend({sync:function(a,d,g){var h={};h[this.perPageAttribute]=this.perPage,h[this.skipAttribute]=this.page*this.perPage,h[this.orderAttribute]=this.sortField,h[this.customAttribute1]=this.customParam1,h[this.formatAttribute]=this.format,h[this.customAttribute2]=this.customParam2,h[this.queryAttribute]=this.query;var i=b.extend({type:"GET",dataType:"jsonp",jsonpCallback:"callback",data:decodeURIComponent(c.param(h)),url:e(this,"url")||f(),processData:!1},g);return c.ajax(i)},nextPage:function(){this.page=++this.page,this.pager()},previousPage:function(){this.page=--this.page||1,this.pager()},goTo:function(a){a!==undefined&&(this.page=parseInt(a,10),this.pager())},howManyPer:function(a){a!==undefined&&(this.displayPerPage=parseInt(a,10),this.page=1,this.pager())},setSort:function(a,b){a!==undefined&&b!==undefined&&this.pager(a,b)},pager:function(a,b,c,d){var e=this,f=this.displayPerPage,g=(e.page-1)*f,h=g+f;e.origModels===undefined&&(e.origModels=e.models),e.models=e.origModels,a&&(e.models=e._sort(e.models,a,b)),d&&(e.models=e._filter(e.models,c,d)),e.reset(e.models.slice(g,h))},_sort:function(a,b,c){return a=a.sort(function(a,d){var e=a.get(b),f=d.get(b);if(!e||!f)return 0;e=e.toString().toLowerCase(),f=f.toString().toLowerCase();if(c==="desc")if(e.match(/[\d\.]*/)&&f.match(/[\d\.]*/)){if(e-0<f-0)return 1;if(e-0>f-0)return-1}else{if(e<f)return 1;if(e>f)return-1}else if(e.match(/[\d\.]*/)&&f.match(/[\d\.]*/)){if(e-0<f-0)return-1;if(e-0>f-0)return 1}else{if(e<f)return-1;if(e>f)return 1}return 0}),a},_filter:function(a,c,d){if(b.isString(c)){var e=c;c=[],c.push(e)}if(d==="")return a;d=new RegExp(d,"im");var f=[];return b.each(a,function(a){b.each(c,function(b){var c=a.get(b);c&&a.get(b).toString().match(d)&&f.push(a)})}),f},info:function(){var a=this,b={},c=a.origModels?a.origModels.length:a.length,d=Math.ceil(c/a.displayPerPage);return b={totalRecords:c,page:a.page,perPage:this.displayPerPage,totalPages:d,lastPage:d,lastPagem1:d-1,previous:!1,next:!1,page_set:[],startRecord:(a.page-1)*this.displayPerPage+1,endRecord:Math.min(c,a.page*this.displayPerPage)},a.page>1&&(b.prev=a.page-1),a.page<b.totalPages&&(b.next=a.page+1),b.pageSet=a.setPagination(b),a.information=b,b},setPagination:function(a){var b=[],c=0,d=0,e=3,f=e*2,g=Math.ceil(a.totalRecords/a.perPage),h=-1;if(g>1)if(g<7+f)for(c=1,d=g;c<=d;c++)b.push(c);else if(g>5+f)if(a.page<1+f)for(c=1,d=4+f;c<d;c++)b.push(c);else if(g-f>a.page&&a.page>f)for(c=a.page-e;c<=a.page+e;c++)b.push(c);else for(c=g-(2+f);c<=g;c++)b.push(c);return b}}),d.requestPager=a.Collection.extend({sync:function(a,d,g){var h={},i;return h[this.perPageAttribute]=this.perPage,h[this.skipAttribute]=this.page*this.perPage,h[this.orderAttribute]=this.sortField,h[this.customAttribute1]=this.customParam1,h[this.formatAttribute]=this.format,h[this.customAttribute2]=this.customParam2,h[this.queryAttribute]=this.query,i=b.extend({type:"GET",dataType:"jsonp",jsonpCallback:"callback",data:decodeURIComponent(c.param(h)),url:e(this,"url")||f(),processData:!1},g),c.ajax(i)},requestNextPage:function(){this.page!==undefined&&(this.page+=1,this.pager())},requestPreviousPage:function(){this.page!==undefined&&(this.page-=1,this.pager())},updateOrder:function(a){a!==undefined&&(this.sortField=a,this.pager())},goTo:function(a){a!==undefined&&(this.page=parseInt(a,10),this.pager())},howManyPer:function(a){a!==undefined&&(this.page=this.firstPage,this.perPage=a,this.pager())},sort:function(){},info:function(){var a={page:this.page,firstPage:this.firstPage,totalPages:this.totalPages,lastPage:this.totalPages,perPage:this.perPage};return this.information=a,a},pager:function(){this.fetch({})}});var e=function(a,c){return!a||!a[c]?null:b.isFunction(a[c])?a[c]():a[c]},f=function(){throw new Error('A "url" property or function must be specified')};return d}(Backbone,_,jQuery);
+Backbone.Paginator=function(a,b,c){"use strict";var d={};d.version="0.15",d.clientPager=a.Collection.extend({sync:function(a,d,g){var h={};h[this.perPageAttribute]=this.perPage,h[this.skipAttribute]=this.page*this.perPage,h[this.orderAttribute]=this.sortField,h[this.customAttribute1]=this.customParam1,h[this.formatAttribute]=this.format,h[this.customAttribute2]=this.customParam2,h[this.queryAttribute]=this.query;var i=b.extend({type:"GET",dataType:"jsonp",jsonpCallback:"callback",data:decodeURIComponent(c.param(h)),url:e(this,"url")||f(),processData:!1},g);return c.ajax(i)},nextPage:function(){this.page=++this.page,this.pager()},previousPage:function(){this.page=--this.page||1,this.pager()},goTo:function(a){a!==undefined&&(this.page=parseInt(a,10),this.pager())},howManyPer:function(a){a!==undefined&&(this.displayPerPage=parseInt(a,10),this.page=1,this.pager())},setSort:function(a,b){a!==undefined&&b!==undefined&&this.pager(a,b)},pager:function(a,b,c,d){var e=this,f=this.displayPerPage,g=(e.page-1)*f,h=g+f;e.origModels===undefined&&(e.origModels=e.models),e.models=e.origModels,a&&(e.models=e._sort(e.models,a,b)),d&&(e.models=e._filter(e.models,c,d)),e.reset(e.models.slice(g,h))},_sort:function(a,b,c){return a=a.sort(function(a,d){var e=a.get(b),f=d.get(b);if(!e||!f)return 0;e=e.toString().toLowerCase(),f=f.toString().toLowerCase();if(c==="desc")if(!e.match(/[^\d\.]/)&&e.match(/[\d\.]*/)&&!f.match(/[^\d\.]/)&&f.match(/[\d\.]*/)){if(e-0<f-0)return 1;if(e-0>f-0)return-1}else{if(e<f)return 1;if(e>f)return-1}else if(!e.match(/[^\d\.]/)&&e.match(/[\d\.]*/)&&!f.match(/[^\d\.]/)&&f.match(/[\d\.]*/)){if(e-0<f-0)return-1;if(e-0>f-0)return 1}else{if(e<f)return-1;if(e>f)return 1}return 0}),a},_filter:function(a,c,d){if(b.isString(c)){var e=c;c=[],c.push(e)}if(d==="")return a;d=new RegExp(d,"im");var f=[];return b.each(a,function(a){b.each(c,function(b){var c=a.get(b);c&&a.get(b).toString().match(d)&&f.push(a)})}),f},info:function(){var a=this,b={},c=a.origModels?a.origModels.length:a.length,d=Math.ceil(c/a.displayPerPage);return b={totalRecords:c,page:a.page,perPage:this.displayPerPage,totalPages:d,lastPage:d,lastPagem1:d-1,previous:!1,next:!1,page_set:[],startRecord:(a.page-1)*this.displayPerPage+1,endRecord:Math.min(c,a.page*this.displayPerPage)},a.page>1&&(b.prev=a.page-1),a.page<b.totalPages&&(b.next=a.page+1),b.pageSet=a.setPagination(b),a.information=b,b},setPagination:function(a){var b=[],c=0,d=0,e=3,f=e*2,g=Math.ceil(a.totalRecords/a.perPage),h=-1;if(g>1)if(g<7+f)for(c=1,d=g;c<=d;c++)b.push(c);else if(g>5+f)if(a.page<1+f)for(c=1,d=4+f;c<d;c++)b.push(c);else if(g-f>a.page&&a.page>f)for(c=a.page-e;c<=a.page+e;c++)b.push(c);else for(c=g-(2+f);c<=g;c++)b.push(c);return b}}),d.requestPager=a.Collection.extend({sync:function(a,d,g){var h={},i;return h[this.perPageAttribute]=this.perPage,h[this.skipAttribute]=this.page*this.perPage,h[this.orderAttribute]=this.sortField,h[this.customAttribute1]=this.customParam1,h[this.formatAttribute]=this.format,h[this.customAttribute2]=this.customParam2,h[this.queryAttribute]=this.query,i=b.extend({type:"GET",dataType:"jsonp",jsonpCallback:"callback",data:decodeURIComponent(c.param(h)),url:e(this,"url")||f(),processData:!1},g),c.ajax(i)},requestNextPage:function(){this.page!==undefined&&(this.page+=1,this.pager())},requestPreviousPage:function(){this.page!==undefined&&(this.page-=1,this.pager())},updateOrder:function(a){a!==undefined&&(this.sortField=a,this.pager())},goTo:function(a){a!==undefined&&(this.page=parseInt(a,10),this.pager())},howManyPer:function(a){a!==undefined&&(this.page=this.firstPage,this.perPage=a,this.pager())},sort:function(){},info:function(){var a={page:this.page,firstPage:this.firstPage,totalPages:this.totalPages,lastPage:this.totalPages,perPage:this.perPage};return this.information=a,a},pager:function(){this.fetch({})}});var e=function(a,c){return!a||!a[c]?null:b.isFunction(a[c])?a[c]():a[c]},f=function(){throw new Error('A "url" property or function must be specified')};return d}(Backbone,_,jQuery);
Please sign in to comment.
Something went wrong with that request. Please try again.