This commit is contained in:
Fabian Jakobs 2012-01-02 17:32:53 +01:00
commit 59acd23d2c
2 changed files with 14 additions and 5 deletions

View file

@ -23,7 +23,7 @@ exports.get = function (url, callback) {
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.
var xhr, i, progId;
if (typeof XMLHttpRequest !== "undefined") {

View file

@ -38,12 +38,21 @@
/**
* Extremely simplified version of the requireJS text plugin
*/
(function() {
var globalRequire = require;
define(function (require, exports, module) {
"use strict";
var net = require("ace/lib/net");
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');
};
});
});
})();