backbone.base-router
Advanced tools
Comparing version 1.0.0 to 1.1.0
{ | ||
"name": "backbone.base-router", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"homepage": "https://github.com/jmeas/backbone.base-router", | ||
@@ -30,5 +30,5 @@ "authors": [ | ||
"dependencies": { | ||
"backbone": "1.1.1 - 1.1.2", | ||
"underscore": "1.4.4 - 1.7.0" | ||
"backbone": "1.1.1 - 1.2.1", | ||
"underscore": "1.4.4 - 1.8.3" | ||
} | ||
} |
@@ -0,1 +1,5 @@ | ||
### [1.1.0](https://github.com/jmeas/backbone.radio/releases/tag/1.1.0) | ||
- Updated dependencies to include the latest Backbone and Underscore versions. | ||
### [1.0.0](https://github.com/jmeas/backbone.radio/releases/tag/v1.0.0) | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Backbone.BaseRouter v1.0.0 | ||
// Backbone.BaseRouter v1.1.0 | ||
(function(root, factory) { | ||
@@ -50,3 +50,3 @@ if (typeof define === 'function' && define.amd) { | ||
this.routeParams[origRoute] = this._extractRouteParams(routeStr); | ||
this.routeParams[origRoute] = _.invoke(routeStr.match(NAMED_PARAM), 'slice', 1); | ||
@@ -84,12 +84,2 @@ // Begin setting up our routeData, | ||
_extractRouteParams: function(route) { | ||
var namedParams = []; | ||
route.replace(NAMED_PARAM, function(match, optional) { | ||
namedParams.push(match.substr(1)); | ||
}); | ||
return namedParams; | ||
}, | ||
// Decodes the Url query string parameters & and returns them | ||
@@ -96,0 +86,0 @@ // as an object. Supports empty parameters, but not array-like |
@@ -1,4 +0,4 @@ | ||
// Backbone.BaseRouter v1.0.0 | ||
// Backbone.BaseRouter v1.1.0 | ||
!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,d=/\+/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):(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){return a?b.reduce(a.split("&"),function(a,c){var e=c.replace(d," ").split("="),f=e[0],g=e[1];return f=decodeURIComponent(f),g=void 0===g?null:decodeURIComponent(g),a[f]?b.isArray(a[f])?a[f].push(g):a[f]=[a[f],g]:a[f]=g,a},{}):{}},_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,d=/\+/g;return a.BaseRouter=a.Router.extend({constructor:function(){this.routeParams={},a.Router.prototype.constructor.apply(this,arguments)},onNavigate:function(a){},route:function(d,e){var f,g;b.isRegExp(d)?(f=d,g=""+d):(f=this._routeToRegExp(d),g=d),this.routeParams[d]=b.invoke(g.match(c),"slice",1);var h={route:f,router:this,linked:e};b.isRegExp(d)||(h.originalRoute=d);var i=this;return a.history.route(f,function(a,b){var c=i._extractParameters(f,a),d=c.pop();b&&(h.navOptions=b),h.query=i._getQueryParameters(d),h.params=i._getNamedParams(g,c),h.uriFragment=a,i.onNavigate(h)}),this},_getQueryParameters:function(a){return a?b.reduce(a.split("&"),function(a,c){var e=c.replace(d," ").split("="),f=e[0],g=e[1];return f=decodeURIComponent(f),g=void 0===g?null:decodeURIComponent(g),a[f]?b.isArray(a[f])?a[f].push(g):a[f]=[a[f],g]:a[f]=g,a},{}):{}},_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": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A better starting point for a new Backbone Router.", | ||
@@ -50,5 +50,5 @@ "main": "dist/backbone.base-router.js", | ||
"dependencies": { | ||
"backbone": "1.1.1 - 1.1.2", | ||
"underscore": "1.4.4 - 1.7.0" | ||
"backbone": "1.1.1 - 1.2.1", | ||
"underscore": "1.4.4 - 1.8.3" | ||
} | ||
} |
@@ -32,3 +32,3 @@ // | ||
this.routeParams[origRoute] = this._extractRouteParams(routeStr); | ||
this.routeParams[origRoute] = _.invoke(routeStr.match(NAMED_PARAM), 'slice', 1); | ||
@@ -66,12 +66,2 @@ // Begin setting up our routeData, | ||
_extractRouteParams: function(route) { | ||
var namedParams = []; | ||
route.replace(NAMED_PARAM, function(match, optional) { | ||
namedParams.push(match.substr(1)); | ||
}); | ||
return namedParams; | ||
}, | ||
// Decodes the Url query string parameters & and returns them | ||
@@ -78,0 +68,0 @@ // as an object. Supports empty parameters, but not array-like |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
53848
928
+ Addedbackbone@1.2.1(transitive)
+ Addedunderscore@1.8.3(transitive)
- Removedbackbone@1.1.2(transitive)
- Removedunderscore@1.7.0(transitive)
Updatedbackbone@1.1.1 - 1.2.1
Updatedunderscore@1.4.4 - 1.8.3