Skip to content

Commit

Permalink
Added RequireJS AMD support
Browse files Browse the repository at this point in the history
- Still assigns bonzo to window and module.exports
  when appropriate.

- Added a few bytes :(
  • Loading branch information
ryanflorence committed Sep 11, 2011
1 parent 2ae9941 commit 9e8e2e0
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
15 changes: 10 additions & 5 deletions bonzo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@
* https://github.com/ded/bonzo
* License MIT
*/
!function (context, win) {

var doc = context.document
(function (name, definition){
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports = definition()
else this[name] = definition()
})('bonzo', function() {
var context = this
, win = window
, doc = context.document
, html = doc.documentElement
, parentNode = 'parentNode'
, query = null
Expand Down Expand Up @@ -606,6 +611,6 @@
return this
}

if (typeof module !== 'undefined') module.exports = bonzo; else context['bonzo'] = bonzo
return bonzo;
});

}(this, window)
2 changes: 1 addition & 1 deletion bonzo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions src/bonzo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
!function (context, win) {

var doc = context.document
(function (name, definition){
if (typeof define == 'function') define(definition)
else if (typeof module != 'undefined' && module.exports) module.exports = definition()
else this[name] = definition()
})('bonzo', function() {
var context = this
, win = window
, doc = context.document
, html = doc.documentElement
, parentNode = 'parentNode'
, query = null
Expand Down Expand Up @@ -601,6 +606,6 @@
return this
}

if (typeof module !== 'undefined') module.exports = bonzo; else context['bonzo'] = bonzo
return bonzo;
});

}(this, window)

0 comments on commit 9e8e2e0

Please sign in to comment.