backbone.base-router
Advanced tools
Comparing version 0.4.0 to 0.4.1
{ | ||
"name": "backbone.base-router", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"homepage": "https://github.com/jmeas/backbone.base-router", | ||
@@ -5,0 +5,0 @@ "authors": [ |
@@ -0,1 +1,5 @@ | ||
### [0.4.1](https://github.com/jmeas/backbone.radio/releases/tag/v0.4.1) | ||
- **Bug fix**: Uses the constructor on the Router's prototype | ||
### [0.4.0](https://github.com/jmeas/backbone.radio/releases/tag/v0.4.0) | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Backbone.BaseRouter v0.4.0 | ||
// Backbone.BaseRouter v0.4.1 | ||
(function(root, factory) { | ||
@@ -29,3 +29,3 @@ if (typeof define === 'function' && define.amd) { | ||
this.routeParams = {}; | ||
Backbone.Router.constructor.apply(this, arguments); | ||
Backbone.Router.prototype.constructor.apply(this, arguments); | ||
}, | ||
@@ -32,0 +32,0 @@ |
@@ -1,4 +0,4 @@ | ||
// Backbone.BaseRouter v0.4.0 | ||
// Backbone.BaseRouter v0.4.1 | ||
!function(a,b){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(a,c){return b(a,c)});else if("undefined"!=typeof exports){var c=require("backbone"),d=require("underscore");module.exports=b(c,d)}else b(a.Backbone,a._)}(this,function(a,b){"use strict";var c=/(\(\?)?:\w+/g;return a.BaseRouter=a.Router.extend({constructor:function(){this.routeParams={},a.Router.constructor.apply(this,arguments)},onNavigate:function(){},route:function(c,d){var e,f;b.isRegExp(c)?(e=c,f=c.toString()):(e=this._routeToRegExp(c),f=c),this.routeParams[c]=this._extractRouteParams(f);var g={route:e,router:this,linked:d};b.isRegExp(c)||(g.originalRoute=c);var h=this;return a.history.route(e,function(a,b){var c=h._extractParameters(e,a),d=c.pop();b&&(g.navOptions=b),g.query=h._getQueryParameters(d),g.params=h._getNamedParams(f,c),g.uriFragment=a,h.onNavigate(g)}),this},_extractRouteParams:function(a){var b=[];return a.replace(c,function(a){b.push(a.substr(1))}),b},_getQueryParameters:function(a){if(!a)return{};for(var b,c=/([^&=]+)=?([^&]*)/g,d={};b=c.exec(a);)d[this._decodeParams(b[1])]=this._decodeParams(b[2]);return d},_decodeParams:function(a){return decodeURIComponent(a.replace(/\+/g," "))},_getNamedParams:function(a,c){if(!c.length)return{};var d=this.routeParams[a],e=c.slice(0,d.length);return b.object(b.zip(d,e))}}),a.BaseRouter}); | ||
!function(a,b){if("function"==typeof define&&define.amd)define(["backbone","underscore"],function(a,c){return b(a,c)});else if("undefined"!=typeof exports){var c=require("backbone"),d=require("underscore");module.exports=b(c,d)}else b(a.Backbone,a._)}(this,function(a,b){"use strict";var c=/(\(\?)?:\w+/g;return a.BaseRouter=a.Router.extend({constructor:function(){this.routeParams={},a.Router.prototype.constructor.apply(this,arguments)},onNavigate:function(){},route:function(c,d){var e,f;b.isRegExp(c)?(e=c,f=c.toString()):(e=this._routeToRegExp(c),f=c),this.routeParams[c]=this._extractRouteParams(f);var g={route:e,router:this,linked:d};b.isRegExp(c)||(g.originalRoute=c);var h=this;return a.history.route(e,function(a,b){var c=h._extractParameters(e,a),d=c.pop();b&&(g.navOptions=b),g.query=h._getQueryParameters(d),g.params=h._getNamedParams(f,c),g.uriFragment=a,h.onNavigate(g)}),this},_extractRouteParams:function(a){var b=[];return a.replace(c,function(a){b.push(a.substr(1))}),b},_getQueryParameters:function(a){if(!a)return{};for(var b,c=/([^&=]+)=?([^&]*)/g,d={};b=c.exec(a);)d[this._decodeParams(b[1])]=this._decodeParams(b[2]);return d},_decodeParams:function(a){return decodeURIComponent(a.replace(/\+/g," "))},_getNamedParams:function(a,c){if(!c.length)return{};var d=this.routeParams[a],e=c.slice(0,d.length);return b.object(b.zip(d,e))}}),a.BaseRouter}); | ||
//# sourceMappingURL=backbone.base-router.min.js.map |
{ | ||
"name": "backbone.base-router", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "A better starting point for a new Backbone Router.", | ||
@@ -5,0 +5,0 @@ "main": "dist/backbone.base-router.js", |
@@ -11,3 +11,3 @@ // | ||
this.routeParams = {}; | ||
Backbone.Router.constructor.apply(this, arguments); | ||
Backbone.Router.prototype.constructor.apply(this, arguments); | ||
}, | ||
@@ -14,0 +14,0 @@ |
Sorry, the diff of this file is not supported yet
52100