forked from ender-js/ender-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ender-js/ender-js into plugin-compat
Conflicts: ender.js
- Loading branch information
Showing
5 changed files
with
83 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,86 @@ | ||
/*! | ||
* Ender-JS: open module JavaScript framework (client-lib) | ||
* Ender: open module JavaScript framework (client-lib) | ||
* copyright Dustin Diaz & Jacob Thornton 2011 (@ded @fat) | ||
* https://ender.no.de | ||
* http://ender.no.de | ||
* License MIT | ||
*/ | ||
!function (context) { | ||
|
||
// a global object for node.js module compatiblity | ||
// ============================================ | ||
|
||
context['global'] = context; | ||
context['global'] = context | ||
|
||
// Implements simple module system | ||
// losely based on CommonJS Modules spec v1.1.1 | ||
// ============================================ | ||
|
||
var modules = {}; | ||
var modules = {} | ||
, old = context.$ | ||
|
||
function require (identifier) { | ||
var module = modules[identifier] || window[identifier]; | ||
if (!module) throw new Error("Requested module '" + identifier + "' has not been defined."); | ||
return module; | ||
var module = modules[identifier] || window[identifier] | ||
if (!module) throw new Error("Requested module '" + identifier + "' has not been defined.") | ||
return module | ||
} | ||
|
||
function provide (name, what) { | ||
return modules[name] = what; | ||
return (modules[name] = what) | ||
} | ||
|
||
context['provide'] = provide; | ||
context['require'] = require; | ||
context['provide'] = provide | ||
context['require'] = require | ||
|
||
// Implements Ender's $ global access object | ||
// ========================================= | ||
|
||
function aug(o, o2) { | ||
for (var k in o2) { | ||
k != 'noConflict' && k != '_VERSION' && (o[k] = o2[k]); | ||
} | ||
return o; | ||
for (var k in o2) k != 'noConflict' && k != '_VERSION' && (o[k] = o2[k]) | ||
return o | ||
} | ||
|
||
function boosh(s, r, els) { | ||
// string || node || nodelist || window | ||
// string || node || nodelist || window | ||
if (ender._select && (typeof s == 'string' || s.nodeName || s.length && 'item' in s || s == window)) { | ||
els = ender._select(s, r); | ||
els.selector = s; | ||
} else { | ||
els = isFinite(s.length) ? s : [s]; | ||
} | ||
return aug(els, boosh); | ||
els = ender._select(s, r) | ||
els.selector = s | ||
} else els = isFinite(s.length) ? s : [s] | ||
return aug(els, boosh) | ||
} | ||
|
||
function ender(s, r) { | ||
return boosh(s, r); | ||
return boosh(s, r) | ||
} | ||
|
||
aug(ender, { | ||
_VERSION: '0.2.5', | ||
ender: function (o, chain) { | ||
aug(chain ? boosh : ender, o); | ||
}, | ||
fn: boosh // for easy compat with jQuery plugins | ||
}); | ||
_VERSION: '0.3.4' | ||
, fn: boosh // for easy compat to jQuery plugins | ||
, ender: function (o, chain) { | ||
aug(chain ? boosh : ender, o) | ||
} | ||
, _select: function (s, r) { | ||
return (r || document).querySelectorAll(s) | ||
} | ||
}) | ||
|
||
aug(boosh, { | ||
forEach: function (fn, scope, i) { | ||
// opt out of native forEach so we can intentionally call our own scope | ||
// defaulting to the current item and be able to return self | ||
for (i = 0, l = this.length; i < l; ++i) { | ||
i in this && fn.call(scope || this[i], this[i], i, this); | ||
} | ||
for (i = 0, l = this.length; i < l; ++i) i in this && fn.call(scope || this[i], this[i], i, this) | ||
// return self for chaining | ||
return this; | ||
return this | ||
}, | ||
$: ender // handy reference to self | ||
}); | ||
}) | ||
|
||
var old = context.$; | ||
ender.noConflict = function () { | ||
context.$ = old; | ||
return this; | ||
}; | ||
context.$ = old | ||
return this | ||
} | ||
|
||
(typeof module !== 'undefined') && module.exports && (module.exports = ender); | ||
if (typeof module !== 'undefined' && module.exports) module.exports = ender | ||
// use subscript notation as extern for Closure compilation | ||
context['ender'] = context['$'] = context['ender'] || ender; | ||
context['ender'] = context['$'] = context['ender'] || ender | ||
|
||
}(this); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
require('smoosh').config({ | ||
"JAVASCRIPT": { | ||
"DIST_DIR": "./" | ||
, "ender": ["./ender.js"] | ||
} | ||
, "JSHINT_OPTS": { | ||
"boss": true | ||
, "forin": false | ||
, "curly": false | ||
, "debug": false | ||
, "devel": false | ||
, "evil": false | ||
, "regexp": false | ||
, "undef": false | ||
, "sub": true | ||
, "white": false | ||
, "indent": 2 | ||
, "whitespace": true | ||
, "asi": true | ||
, "laxbreak": true | ||
, "eqeqeq": false | ||
, "eqnull": true | ||
} | ||
}).run().analyze() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
{ | ||
"name": "ender-js", | ||
"description": "no-library library", | ||
"version": "0.3.1", | ||
"authors": ["Dustin Diaz <@ded>", "Jacob Thornton <@fat>"], | ||
"keywords": ["ender", "modules", "library", "framework", "packager"], | ||
"main": "./ender.js", | ||
"homepage": "http://ender.no.de", | ||
"engines": { | ||
"node": ">= 0.4.0" | ||
} | ||
"name": "ender-js" | ||
, "description": "no-library library" | ||
, "version": "0.3.4" | ||
, "keywords": ["ender", "modules", "library", "framework", "packager"] | ||
, "main": "./ender.js" | ||
, "homepage": "http://ender.no.de" | ||
, "engines": { | ||
"node": ">= 0.4.0" | ||
} | ||
, "authors": [ | ||
"Dustin Diaz <dustin@dustindiaz.com> (http://dustindiaz.com)" | ||
, "Jacob Thornton <jacobthornton@gmail.com> (https://github.com/fat)" | ||
] | ||
, "devDependencies": { | ||
"smoosh": "*" | ||
} | ||
, "scripts": { | ||
"make": "node make.js" | ||
} | ||
} |