backbone.intercept
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "backbone.intercept", | ||
"main": "dist/backbone.intercept.js", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"homepage": "https://github.com/jmeas/backbone.intercept", | ||
@@ -37,3 +37,3 @@ "authors": [ | ||
"underscore": ">=1.3.3 <=1.8.3", | ||
"backbone": ">=0.9.9 <=1.2.1" | ||
"backbone": ">=0.9.9 <=1.2.3" | ||
}, | ||
@@ -40,0 +40,0 @@ "devDependencies": { |
@@ -0,1 +1,5 @@ | ||
### [0.4.2](https://github.com/jmeas/backbone.intercept/releases/tag/0.4.2) | ||
- Updated Bower to support the latest Backbone, too! | ||
### [0.4.1](https://github.com/jmeas/backbone.intercept/releases/tag/0.4.1) | ||
@@ -2,0 +6,0 @@ |
@@ -1,2 +0,2 @@ | ||
// Backbone.Intercept v0.4.1 | ||
// Backbone.Intercept v0.4.2 | ||
(function(root, factory) { | ||
@@ -21,3 +21,3 @@ if (typeof define === 'function' && define.amd) { | ||
VERSION: '0.4.1', | ||
VERSION: '0.4.2', | ||
@@ -24,0 +24,0 @@ rootSelector: 'body', |
@@ -1,4 +0,4 @@ | ||
// Backbone.Intercept v0.4.1 | ||
// Backbone.Intercept v0.4.2 | ||
!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";return a.Intercept={VERSION:"0.4.1",rootSelector:"body",defaults:{trigger:!0,links:!0,forms:!0},start:function(a){a=b.defaults(a||{},this.defaults),a.links&&this._getRootElement().on("click.backboneIntercept","a",b.bind(this._interceptLinks,this)),a.forms&&this._getRootElement().on("submit.backboneIntercept",b.bind(this._interceptForms,this))},stop:function(){this._getRootElement().off(".backboneIntercept")},navigate:function(b,c){a.history.navigate(b,c)},_getRootElement:function(){return this._body?this._body:(this._body=a.$(this.rootSelector),this._body)},_interceptForms:function(a){a.target&&a.target.action||a.preventDefault()},_interceptLinks:function(b){if(1===b.which){var c=a.$(b.currentTarget),d=c.attr("href");if(d){var e=this._getAttr(c,"bypass");if(void 0===e||"false"===e){var f={trigger:this.defaults.trigger},g=this._getAttr(c,"trigger");if("false"===g?f.trigger=!1:"true"===g&&(f.trigger=!0),!/^#|javascript:|mailto:|(?:\w+:)?\/\//.test(d)){b.preventDefault();var h=c[0].pathname.replace(/^\//,"")+c[0].search;this.navigate&&this.navigate(h,f)}}}}},_getAttr:function(a,b){var c=a.attr(b);if(void 0!==c)return c;var d=a.attr("data-"+b);return void 0!==d?d:void 0}},a.Intercept}); | ||
!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";return a.Intercept={VERSION:"0.4.2",rootSelector:"body",defaults:{trigger:!0,links:!0,forms:!0},start:function(a){a=b.defaults(a||{},this.defaults),a.links&&this._getRootElement().on("click.backboneIntercept","a",b.bind(this._interceptLinks,this)),a.forms&&this._getRootElement().on("submit.backboneIntercept",b.bind(this._interceptForms,this))},stop:function(){this._getRootElement().off(".backboneIntercept")},navigate:function(b,c){a.history.navigate(b,c)},_getRootElement:function(){return this._body?this._body:(this._body=a.$(this.rootSelector),this._body)},_interceptForms:function(a){a.target&&a.target.action||a.preventDefault()},_interceptLinks:function(b){if(1===b.which){var c=a.$(b.currentTarget),d=c.attr("href");if(d){var e=this._getAttr(c,"bypass");if(void 0===e||"false"===e){var f={trigger:this.defaults.trigger},g=this._getAttr(c,"trigger");if("false"===g?f.trigger=!1:"true"===g&&(f.trigger=!0),!/^#|javascript:|mailto:|(?:\w+:)?\/\//.test(d)){b.preventDefault();var h=c[0].pathname.replace(/^\//,"")+c[0].search;this.navigate&&this.navigate(h,f)}}}}},_getAttr:function(a,b){var c=a.attr(b);if(void 0!==c)return c;var d=a.attr("data-"+b);return void 0!==d?d:void 0}},a.Intercept}); | ||
//# sourceMappingURL=backbone.intercept.min.js.map |
{ | ||
"name": "backbone.intercept", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Automatically manage link clicks and form submissions within Backbone applications.", | ||
@@ -5,0 +5,0 @@ "main": "dist/backbone.intercept.js", |
48822