2016-05-12 19:32:12 -07:00
|
|
|
define(function () {
|
2016-10-17 22:06:48 -07:00
|
|
|
'use strict';
|
2016-05-12 19:32:12 -07:00
|
|
|
|
|
|
|
return {
|
|
|
|
|
|
|
|
load: function (url, req, load, config) {
|
|
|
|
|
2016-10-17 22:06:48 -07:00
|
|
|
if (url.indexOf('://') === -1) {
|
2016-05-12 19:32:12 -07:00
|
|
|
url = config.baseUrl + url;
|
|
|
|
}
|
|
|
|
|
2016-05-13 11:28:05 -07:00
|
|
|
if (config.urlArgs) {
|
|
|
|
url += config.urlArgs(url, url);
|
|
|
|
}
|
2016-05-12 19:32:12 -07:00
|
|
|
|
|
|
|
var xhr = new XMLHttpRequest();
|
|
|
|
xhr.open('GET', url, true);
|
|
|
|
|
|
|
|
xhr.onload = function (e) {
|
|
|
|
load(this.response);
|
|
|
|
};
|
|
|
|
|
|
|
|
xhr.send();
|
|
|
|
},
|
|
|
|
|
|
|
|
normalize: function (name, normalize) {
|
|
|
|
return normalize(name);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
});
|