Skip to content
Browse files

Introduce onXhrComplete that can be used for cleanup. Rev to 2.0.6. F…

…ixes #48
  • Loading branch information...
1 parent 0bb2eb0 commit a1949e5d27cc9b3448062559c937a96f30debe77 @jrburke jrburke committed
Showing with 11 additions and 3 deletions.
  1. +4 −0 README.md
  2. +1 −1 package.json
  3. +6 −2 text.js
View
4 README.md
@@ -154,6 +154,10 @@ requirejs.config({
//Overrides the creation of the XHR object. Return an XHR
//object from this function.
//Available in text.js 2.0.1 or later.
+ },
+ onXhrComplete: function (xhr, url) {
+ //Called whenever an XHR has completed its work. Useful
+ //if browser-specific xhr cleanup needs to be done.
}
}
}
View
2 package.json
@@ -1,6 +1,6 @@
{
"name": "text",
- "version": "2.0.5",
+ "version": "2.0.6",
"description": "An AMD loader plugin for loading text resources.",
"categories": [
"Loader plugins"
View
8 text.js
@@ -1,5 +1,5 @@
/**
- * @license RequireJS text 2.0.5+ Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
+ * @license RequireJS text 2.0.6 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/requirejs/text for details
*/
@@ -23,7 +23,7 @@ define(['module'], function (module) {
masterConfig = (module.config && module.config()) || {};
text = {
- version: '2.0.5+',
+ version: '2.0.6',
strip: function (content) {
//Strips <?xml ...?> declarations so that external SVG and XML
@@ -283,6 +283,10 @@ define(['module'], function (module) {
} else {
callback(xhr.responseText);
}
+
+ if (masterConfig.onXhrComplete) {
+ masterConfig.onXhrComplete(xhr, url);
+ }
}
};
xhr.send(null);

0 comments on commit a1949e5

Please sign in to comment.
Something went wrong with that request. Please try again.