0 | 0 |
/**
|
1 | |
* @license RequireJS text 2.0.10 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
|
|
1 |
* @license RequireJS text 2.0.11 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
|
2 | 2 |
* Available via the MIT or new BSD license.
|
3 | 3 |
* see: http://github.com/requirejs/text for details
|
4 | 4 |
*/
|
|
22 | 22 |
masterConfig = (module.config && module.config()) || {};
|
23 | 23 |
|
24 | 24 |
text = {
|
25 | |
version: '2.0.10',
|
|
25 |
version: '2.0.11',
|
26 | 26 |
|
27 | 27 |
strip: function (content) {
|
28 | 28 |
//Strips <?xml ...?> declarations so that external SVG and XML
|
|
161 | 161 |
|
162 | 162 |
// Do not bother with the work if a build and text will
|
163 | 163 |
// not be inlined.
|
164 | |
if (config.isBuild && !config.inlineText) {
|
|
164 |
if (config && config.isBuild && !config.inlineText) {
|
165 | 165 |
onLoad();
|
166 | 166 |
return;
|
167 | 167 |
}
|
168 | 168 |
|
169 | |
masterConfig.isBuild = config.isBuild;
|
|
169 |
masterConfig.isBuild = config && config.isBuild;
|
170 | 170 |
|
171 | 171 |
var parsed = text.parseName(name),
|
172 | 172 |
nonStripName = parsed.moduleName +
|
|
256 | 256 |
}
|
257 | 257 |
callback(file);
|
258 | 258 |
} catch (e) {
|
259 | |
errback(e);
|
|
259 |
if (errback) {
|
|
260 |
errback(e);
|
|
261 |
}
|
260 | 262 |
}
|
261 | 263 |
};
|
262 | 264 |
} else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
|
|
285 | 287 |
//visible via console output in the browser.
|
286 | 288 |
if (xhr.readyState === 4) {
|
287 | 289 |
status = xhr.status;
|
288 | |
if (status > 399 && status < 600) {
|
|
290 |
if ((status > 399 && status < 600) || status === 0) {
|
289 | 291 |
//An http 4xx or 5xx error. Signal an error.
|
290 | 292 |
err = new Error(url + ' HTTP status: ' + status);
|
291 | 293 |
err.xhr = xhr;
|
292 | |
errback(err);
|
|
294 |
if (errback) {
|
|
295 |
errback(err);
|
|
296 |
}
|
293 | 297 |
} else {
|
294 | 298 |
callback(xhr.responseText);
|
295 | 299 |
}
|
|
346 | 350 |
typeof Components !== 'undefined' && Components.classes &&
|
347 | 351 |
Components.interfaces)) {
|
348 | 352 |
//Avert your gaze!
|
349 | |
Cc = Components.classes,
|
|
353 |
Cc = Components.classes;
|
350 | 354 |
Ci = Components.interfaces;
|
351 | 355 |
Components.utils['import']('resource://gre/modules/FileUtils.jsm');
|
352 | 356 |
xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);
|