r.js fix
This commit is contained in:
parent
c52d1b2030
commit
59acd23d2c
2 changed files with 14 additions and 5 deletions
|
|
@ -23,7 +23,7 @@ exports.get = function (url, callback) {
|
||||||
|
|
||||||
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
|
var progIds = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
|
||||||
|
|
||||||
exports.createXhr = function () {
|
exports.createXhr = function() {
|
||||||
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
//Would love to dump the ActiveX crap in here. Need IE 6 to die first.
|
||||||
var xhr, i, progId;
|
var xhr, i, progId;
|
||||||
if (typeof XMLHttpRequest !== "undefined") {
|
if (typeof XMLHttpRequest !== "undefined") {
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,21 @@
|
||||||
/**
|
/**
|
||||||
* Extremely simplified version of the requireJS text plugin
|
* Extremely simplified version of the requireJS text plugin
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
(function() {
|
||||||
|
|
||||||
|
var globalRequire = require;
|
||||||
|
|
||||||
define(function (require, exports, module) {
|
define(function (require, exports, module) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
var net = require("ace/lib/net");
|
|
||||||
|
|
||||||
exports.load = function (name, req, onLoad, config) {
|
exports.load = function (name, req, onLoad, config) {
|
||||||
net.get(req.toUrl(name), onLoad);
|
if (req.isBrowser)
|
||||||
|
require("ace/lib/net").get(req.toUrl(name), onLoad);
|
||||||
|
else
|
||||||
|
//Using special require.nodeRequire, something added by r.js.
|
||||||
|
globalRequire.nodeRequire('fs').readFileSync(req.toUrl(name), 'utf8');
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
Loading…
Add table
Add a link
Reference in a new issue