backbone-callbacks
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -1,2 +0,2 @@ | ||
/* backbone-callbacks - v0.1.2 - 2012-06-13 */ | ||
(function(a){var b=a._||require("underscore")._,c=a.Backbone||require("backbone"),d=function(a,c){return function(){var d=b.toArray(arguments),e=d[d.length-1];if(typeof e=="function"){d.splice(-1,1),d.length===0&&d.push({}),d.length===1&&a==="save"&&d.push({});var f=d[d.length-1];f.success=function(a,b){e(null,b)},f.error=function(a,b){e(b,null)}}return c.apply(this,d)}};typeof module!="undefined"&&typeof module.exports!="undefined"?module.exports=d:a.BackboneCallbacks=d,d.attach=function(a){b.each(["save","destroy","fetch"],function(b){a.Model.prototype[b]=new d(b,a.Model.prototype[b])}),b.each(["fetch"],function(b){a.Collection.prototype[b]=new d(b,a.Collection.prototype[b])})}})(this); | ||
/* backbone-callbacks - v0.1.3 - 2012-06-25 */ | ||
(function(a){var b=a._||require("underscore")._,c=a.Backbone||require("backbone"),d=function(a,c){return function(){var d=b.toArray(arguments),e=d[d.length-1];if(typeof e=="function"){d.splice(-1,1),d.length===0&&d.push({}),d.length===1&&a==="save"&&d.push({});var f=d[d.length-1];f.success=function(a,b){e(null,b)},f.error=function(a,b){e(b,null)}}return c.apply(this,d)}};typeof module!="undefined"&&typeof module.exports!="undefined"?module.exports=d:a.BackboneCallbacks=d,d.attach=function(a){b.each(["save","destroy","fetch"],function(b){a.Model.prototype[b]=new d(b,a.Model.prototype[b])}),b.each(["fetch"],function(b){a.Collection.prototype[b]=new d(b,a.Collection.prototype[b])})},d.attach(c)})(this); |
@@ -85,5 +85,9 @@ // BackboneCallbacks.js (c) 2012 Loren West and other contributors | ||
/** | ||
* Attach the shims to the specified Backbone library | ||
* Attach the shims to a clean Backbone library | ||
* | ||
* var Backbone = require('backbone'); | ||
* Backbone-callbacks works automatically for the global Backbone. If you have | ||
* a clean version of Backbone (via Backbone.noConflict()) you can manually | ||
* attach the backbone-callbacks functionality using this method. | ||
* | ||
* var Backbone = require('backbone').noConflict(); | ||
* require('backbone-callbacks').attach(Backbone); | ||
@@ -106,2 +110,5 @@ * | ||
// Automatically attach the shims to the global Backbone library | ||
BackboneCallbacks.attach(Backbone); | ||
}(this)); |
@@ -1,4 +0,9 @@ | ||
0.1.2 / | ||
0.1.3 / 2012-06-25 | ||
=================== | ||
* Automatically calling attach() on the global Backbone class | ||
0.1.2 / 2012-06-13 | ||
=================== | ||
* Assuring a null response on error | ||
@@ -5,0 +10,0 @@ * Better browser compatibility |
{ | ||
"name": "backbone-callbacks", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"main": "./backbone-callbacks.js", | ||
@@ -5,0 +5,0 @@ "description": "Anonymous callback style interface for Backbone.js async methods", |
@@ -28,10 +28,3 @@ ## Anonymous callback interface for Backbone.js async methods | ||
2) Attach the interfaces to Backbone in your initialization script: | ||
2) Include the library in your application. Load it after Backbone.js on the browser, or require('backbone-callbacks') in Node.js | ||
// In a browser... | ||
BackboneCallbacks.attach(Backbone); | ||
// In node.js... | ||
var Backbone = require('backbone'); | ||
require('backbone-callbacks').attach(Backbone); | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11844
224
30