get-debug.js revision 7393d0cf318ebfc443f6337cfa6da43d4aff2fd7
/**
* NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed.
* @module get-nodejs
* @class GetNodeJS
*/
Y.Get = function() {
};
//Setup the default config base path
/**
* Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`
* @method escapeWinPath
* @protected
* @param {String} p The path to modify
* @return {String} The encoded path
*/
var escapeWinPath = function(p) {
return p.replace(/\\/g, '\\\\');
};
/**
* Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded
* into the YUI object
* @method _exec
* @private
* @param {String} data The JS to execute
* @param {String} url The path to the file that was parsed
* @param {Callback} cb The callback to execute when this is completed
* @param {Error} cb.err=null Error object
* @param {String} cb.url The URL that was just parsed
*/
dirName = '.';
fileName = 'remoteResource';
}
"var process = YUI.process;" +
"var require = function(file) {" +
" if (file.indexOf('./') === 0) {" +
" file = __dirname + file.replace('./', '/'); }" +
" return YUI.require(file); }; " +
data + " ;return YUI; })";
//var mod = "(function(YUI) { " + data + ";return YUI; })";
};
/**
* Fetches the content from a remote URL or a file from disc and passes the content
* off to `_exec` for parsing
* @method _include
* @private
* @param {Callback} cb The callback to fire once the content has been executed via `_exec`
*/
var self = this;
var cfg = {
};
if (err) {
} else {
}
});
} else {
//Needs to be in useSync
} else {
}
} else {
if (err) {
} else {
}
});
}
}
};
//Y.log('Get end: ' + cb.onEnd);
}
//Y.log('Get pass: ' + cb.onSuccess);
}
//Y.log('Get fail: ' + er);
}
};
/**
* Override for Get.script for loading local or remote YUI modules.
* @method js
* @param {Array|String} s The URL's to load into this context
* @param {Object} options Transaction options
*/
var A = Y.Array,
self = this,
check = function() {
if (c === l) {
}
};
for (i=0; i<l; i++) {
}
Y.Get._include(url, function(err, url) {
if (!Y.config) {
Y.config = {
debug: true
};
}
if (options.onProgress) {
options.onProgress.call(options.context || Y, url);
}
if (err) {
fail(options, err);
} else {
c++;
check();
}
});
}
};
/**
* Alias for `Y.Get.js`
* @method script
*/
Y.Get.script = Y.Get.js;
//Place holder for SS Dom access
Y.Get.css = function(s, cb) {
Y.log('Y.Get.css is not supported, just reporting that it has loaded but not fetching.', 'warn', 'get');
pass(cb);
};