/
artoo.js
52 lines (45 loc) · 976 Bytes
/
artoo.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
;(function(undefined) {
'use strict';
/**
* artoo core
* ===========
*
* The main artoo namespace and its vital properties.
*/
// Checking whether a body exists
var body;
if ('document' in this) {
body = document.getElementsByTagName('body')[0];
if (!body) {
body = document.createElement('body');
document.documentElement.appendChild(body);
}
}
// Main object
var artoo = {
// Standard properties
$: {},
jquery: {
applyPlugins: function() {
artoo.jquery.plugins.map(function(p) {
p(artoo.$);
});
},
plugins: []
},
mountNode: body,
stylesheets: {},
templates: {},
// Emitter shim properties
_enabled: true,
_children: [],
_handlers: {},
_handlersAll: []
};
// Non-writable version
Object.defineProperty(artoo, 'version', {
value: '0.3.3'
});
// Exporting to global scope
this.artoo = artoo;
}).call(this);