Codebase list libjs-requirejs-text / 0777fd9
Rollup of changes: Fixes #66, fixes #77, fixes #85 jrburke 10 years ago
3 changed file(s) with 15 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
55 The "New" BSD License:
66 ----------------------
77
8 Copyright (c) 2010-2011, The Dojo Foundation
8 Copyright (c) 2010-2014, The Dojo Foundation
99 All rights reserved.
1010
1111 Redistribution and use in source and binary forms, with or without
3636 MIT License
3737 -----------
3838
39 Copyright (c) 2010-2011, The Dojo Foundation
39 Copyright (c) 2010-2014, The Dojo Foundation
4040
4141 Permission is hereby granted, free of charge, to any person obtaining a copy
4242 of this software and associated documentation files (the "Software"), to deal
00 {
11 "name": "text",
2 "version": "2.0.10",
2 "version": "2.0.11",
33 "description": "An AMD loader plugin for loading text resources.",
44 "categories": [
55 "Loader plugins"
00 /**
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.
22 * Available via the MIT or new BSD license.
33 * see: http://github.com/requirejs/text for details
44 */
2222 masterConfig = (module.config && module.config()) || {};
2323
2424 text = {
25 version: '2.0.10',
25 version: '2.0.11',
2626
2727 strip: function (content) {
2828 //Strips <?xml ...?> declarations so that external SVG and XML
161161
162162 // Do not bother with the work if a build and text will
163163 // not be inlined.
164 if (config.isBuild && !config.inlineText) {
164 if (config && config.isBuild && !config.inlineText) {
165165 onLoad();
166166 return;
167167 }
168168
169 masterConfig.isBuild = config.isBuild;
169 masterConfig.isBuild = config && config.isBuild;
170170
171171 var parsed = text.parseName(name),
172172 nonStripName = parsed.moduleName +
256256 }
257257 callback(file);
258258 } catch (e) {
259 errback(e);
259 if (errback) {
260 errback(e);
261 }
260262 }
261263 };
262264 } else if (masterConfig.env === 'xhr' || (!masterConfig.env &&
285287 //visible via console output in the browser.
286288 if (xhr.readyState === 4) {
287289 status = xhr.status;
288 if (status > 399 && status < 600) {
290 if ((status > 399 && status < 600) || status === 0) {
289291 //An http 4xx or 5xx error. Signal an error.
290292 err = new Error(url + ' HTTP status: ' + status);
291293 err.xhr = xhr;
292 errback(err);
294 if (errback) {
295 errback(err);
296 }
293297 } else {
294298 callback(xhr.responseText);
295299 }
346350 typeof Components !== 'undefined' && Components.classes &&
347351 Components.interfaces)) {
348352 //Avert your gaze!
349 Cc = Components.classes,
353 Cc = Components.classes;
350354 Ci = Components.interfaces;
351355 Components.utils['import']('resource://gre/modules/FileUtils.jsm');
352356 xpcIsWindows = ('@mozilla.org/windows-registry-key;1' in Cc);