aboutsummaryrefslogtreecommitdiff
path: root/point/libs/requirejs/require.js
diff options
context:
space:
mode:
Diffstat (limited to 'point/libs/requirejs/require.js')
-rw-r--r--point/libs/requirejs/require.js2080
1 files changed, 2080 insertions, 0 deletions
diff --git a/point/libs/requirejs/require.js b/point/libs/requirejs/require.js
new file mode 100644
index 0000000..f3a55b2
--- /dev/null
+++ b/point/libs/requirejs/require.js
@@ -0,0 +1,2080 @@
1/** vim: et:ts=4:sw=4:sts=4
2 * @license RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
3 * Available via the MIT or new BSD license.
4 * see: http://github.com/jrburke/requirejs for details
5 */
6//Not using strict: uneven strict support in browsers, #392, and causes
7//problems with requirejs.exec()/transpiler plugins that may not be strict.
8/*jslint regexp: true, nomen: true, sloppy: true */
9/*global window, navigator, document, importScripts, setTimeout, opera */
10
11var requirejs, require, define;
12(function (global) {
13 var req, s, head, baseElement, dataMain, src,
14 interactiveScript, currentlyAddingScript, mainScript, subPath,
15 version = '2.1.14',
16 commentRegExp = /(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,
17 cjsRequireRegExp = /[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,
18 jsSuffixRegExp = /\.js$/,
19 currDirRegExp = /^\.\//,
20 op = Object.prototype,
21 ostring = op.toString,
22 hasOwn = op.hasOwnProperty,
23 ap = Array.prototype,
24 apsp = ap.splice,
25 isBrowser = !!(typeof window !== 'undefined' && typeof navigator !== 'undefined' && window.document),
26 isWebWorker = !isBrowser && typeof importScripts !== 'undefined',
27 //PS3 indicates loaded and complete, but need to wait for complete
28 //specifically. Sequence is 'loading', 'loaded', execution,
29 // then 'complete'. The UA check is unfortunate, but not sure how
30 //to feature test w/o causing perf issues.
31 readyRegExp = isBrowser && navigator.platform === 'PLAYSTATION 3' ?
32 /^complete$/ : /^(complete|loaded)$/,
33 defContextName = '_',
34 //Oh the tragedy, detecting opera. See the usage of isOpera for reason.
35 isOpera = typeof opera !== 'undefined' && opera.toString() === '[object Opera]',
36 contexts = {},
37 cfg = {},
38 globalDefQueue = [],
39 useInteractive = false;
40
41 function isFunction(it) {
42 return ostring.call(it) === '[object Function]';
43 }
44
45 function isArray(it) {
46 return ostring.call(it) === '[object Array]';
47 }
48
49 /**
50 * Helper function for iterating over an array. If the func returns
51 * a true value, it will break out of the loop.
52 */
53 function each(ary, func) {
54 if (ary) {
55 var i;
56 for (i = 0; i < ary.length; i += 1) {
57 if (ary[i] && func(ary[i], i, ary)) {
58 break;
59 }
60 }
61 }
62 }
63
64 /**
65 * Helper function for iterating over an array backwards. If the func
66 * returns a true value, it will break out of the loop.
67 */
68 function eachReverse(ary, func) {
69 if (ary) {
70 var i;
71 for (i = ary.length - 1; i > -1; i -= 1) {
72 if (ary[i] && func(ary[i], i, ary)) {
73 break;
74 }
75 }
76 }
77 }
78
79 function hasProp(obj, prop) {
80 return hasOwn.call(obj, prop);
81 }
82
83 function getOwn(obj, prop) {
84 return hasProp(obj, prop) && obj[prop];
85 }
86
87 /**
88 * Cycles over properties in an object and calls a function for each
89 * property value. If the function returns a truthy value, then the
90 * iteration is stopped.
91 */
92 function eachProp(obj, func) {
93 var prop;
94 for (prop in obj) {
95 if (hasProp(obj, prop)) {
96 if (func(obj[prop], prop)) {
97 break;
98 }
99 }
100 }
101 }
102
103 /**
104 * Simple function to mix in properties from source into target,
105 * but only if target does not already have a property of the same name.
106 */
107 function mixin(target, source, force, deepStringMixin) {
108 if (source) {
109 eachProp(source, function (value, prop) {
110 if (force || !hasProp(target, prop)) {
111 if (deepStringMixin && typeof value === 'object' && value && !isArray(value) && !isFunction(value) && !(value instanceof RegExp)) {
112
113 if (!target[prop]) {
114 target[prop] = {};
115 }
116 mixin(target[prop], value, force, deepStringMixin);
117 } else {
118 target[prop] = value;
119 }
120 }
121 });
122 }
123 return target;
124 }
125
126 //Similar to Function.prototype.bind, but the 'this' object is specified
127 //first, since it is easier to read/figure out what 'this' will be.
128 function bind(obj, fn) {
129 return function () {
130 return fn.apply(obj, arguments);
131 };
132 }
133
134 function scripts() {
135 return document.getElementsByTagName('script');
136 }
137
138 function defaultOnError(err) {
139 throw err;
140 }
141
142 //Allow getting a global that is expressed in
143 //dot notation, like 'a.b.c'.
144 function getGlobal(value) {
145 if (!value) {
146 return value;
147 }
148 var g = global;
149 each(value.split('.'), function (part) {
150 g = g[part];
151 });
152 return g;
153 }
154
155 /**
156 * Constructs an error with a pointer to an URL with more information.
157 * @param {String} id the error ID that maps to an ID on a web page.
158 * @param {String} message human readable error.
159 * @param {Error} [err] the original error, if there is one.
160 *
161 * @returns {Error}
162 */
163 function makeError(id, msg, err, requireModules) {
164 var e = new Error(msg + '\nhttp://requirejs.org/docs/errors.html#' + id);
165 e.requireType = id;
166 e.requireModules = requireModules;
167 if (err) {
168 e.originalError = err;
169 }
170 return e;
171 }
172
173 if (typeof define !== 'undefined') {
174 //If a define is already in play via another AMD loader,
175 //do not overwrite.
176 return;
177 }
178
179 if (typeof requirejs !== 'undefined') {
180 if (isFunction(requirejs)) {
181 //Do not overwrite an existing requirejs instance.
182 return;
183 }
184 cfg = requirejs;
185 requirejs = undefined;
186 }
187
188 //Allow for a require config object
189 if (typeof require !== 'undefined' && !isFunction(require)) {
190 //assume it is a config object.
191 cfg = require;
192 require = undefined;
193 }
194
195 function newContext(contextName) {
196 var inCheckLoaded, Module, context, handlers,
197 checkLoadedTimeoutId,
198 config = {
199 //Defaults. Do not set a default for map
200 //config to speed up normalize(), which
201 //will run faster if there is no default.
202 waitSeconds: 7,
203 baseUrl: './',
204 paths: {},
205 bundles: {},
206 pkgs: {},
207 shim: {},
208 config: {}
209 },
210 registry = {},
211 //registry of just enabled modules, to speed
212 //cycle breaking code when lots of modules
213 //are registered, but not activated.
214 enabledRegistry = {},
215 undefEvents = {},
216 defQueue = [],
217 defined = {},
218 urlFetched = {},
219 bundlesMap = {},
220 requireCounter = 1,
221 unnormalizedCounter = 1;
222
223 /**
224 * Trims the . and .. from an array of path segments.
225 * It will keep a leading path segment if a .. will become
226 * the first path segment, to help with module name lookups,
227 * which act like paths, but can be remapped. But the end result,