Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Not exporting it. Dur.

  • Loading branch information...
commit d902759bedcb9454e17ac206964a6565c67bcd42 1 parent 4ea013e
@anthonyshort authored
View
4 backbone.include.js
@@ -1,10 +1,10 @@
-/*! backbone.include - v0.1.3 - 2012-10-12
+/*! backbone.include - v0.1.4 - 2012-10-16
* https://github.com/anthonyshort/backbone.include
* Copyright (c) 2012 Anthony Short; Licensed MIT */
(function() {
- Backbone.Model.include = Backbone.Collection.include = Backbone.View.include = Backbone.Router.include = module.exports = function(obj) {
+ Backbone.Model.include = Backbone.Collection.include = Backbone.View.include = Backbone.Router.include = function(obj) {
var key, value, _ref;
for (key in obj) {
value = obj[key];
View
4 backbone.include.min.js
@@ -1,4 +1,4 @@
-/*! backbone.include - v0.1.3 - 2012-10-12
+/*! backbone.include - v0.1.4 - 2012-10-16
* https://github.com/anthonyshort/backbone.include
* Copyright (c) 2012 Anthony Short; Licensed MIT */
-(function(){Backbone.Model.include=Backbone.Collection.include=Backbone.View.include=Backbone.Router.include=module.exports=function(e){var t,n,r;for(t in e)n=e[t],t!=="included"&&(this.prototype[t]||(this.prototype[t]=n));return(r=e.included)!=null&&r.apply(this),this}}).call(this);
+(function(){Backbone.Model.include=Backbone.Collection.include=Backbone.View.include=Backbone.Router.include=function(e){var t,n,r;for(t in e)n=e[t],t!=="included"&&(this.prototype[t]||(this.prototype[t]=n));return(r=e.included)!=null&&r.apply(this),this}}).call(this);
View
2  component.json
@@ -1,6 +1,6 @@
{
"name": "backbone.include",
- "version": "0.1.3",
+ "version": "0.1.4",
"main": ".backbone.include.js",
"dependencies": {
"backbone": "~0.9.2"
View
19 lib/backbone.include.js
@@ -0,0 +1,19 @@
+(function() {
+
+ Backbone.Model.include = Backbone.Collection.include = Backbone.View.include = Backbone.Router.include = function(obj) {
+ var key, value, _ref;
+ for (key in obj) {
+ value = obj[key];
+ if (key !== 'included') {
+ if (!this.prototype[key]) {
+ this.prototype[key] = value;
+ }
+ }
+ }
+ if ((_ref = obj.included) != null) {
+ _ref.apply(this);
+ }
+ return this;
+ };
+
+}).call(this);
View
2  package.json
@@ -1,7 +1,7 @@
{
"name": "backbone.include",
"description": "Simple interface for mixins with Backbone",
- "version": "0.1.3",
+ "version": "0.1.4",
"homepage": "https://github.com/anthonyshort/backbone.include",
"author": {
"name": "Anthony Short",
View
2  src/backbone.include.coffee
@@ -4,7 +4,7 @@
# Copyright (c) 2012 Anthony Short
# Licensed under the MIT license.
-Backbone.Model.include = Backbone.Collection.include = Backbone.View.include = Backbone.Router.include = module.exports = (obj) ->
+Backbone.Model.include = Backbone.Collection.include = Backbone.View.include = Backbone.Router.include = (obj) ->
for key, value of obj when key not in ['included']
if not @::[key] then @::[key] = value
obj.included?.apply(this)

0 comments on commit d902759

Please sign in to comment.
Something went wrong with that request. Please try again.