mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 21:17:03 +00:00
48 lines
1.0 KiB
JavaScript
48 lines
1.0 KiB
JavaScript
|
|
makeExportsGlobal();
|
|
|
|
var rootNode = new StaticResourceNode("", NULL, StaticResourceNode.DirectoryType, YES),
|
|
cwd = FILE.cwd();
|
|
#ifndef COMMONJS
|
|
rootNode.nodeAtSubPath(FILE.dirname(cwd), YES);
|
|
rootNode.resolveSubPath(cwd, StaticResourceNode.DirectoryType, function(cwdNode)
|
|
{
|
|
|
|
var includePaths = exports.includePaths(),
|
|
index = 0,
|
|
count = includePaths.length;
|
|
|
|
for (; index < count; ++index)
|
|
cwdNode.nodeAtSubPath(FILE.normal(includePaths[index]), YES);
|
|
#ifdef BROWSER
|
|
OBJJ_MAIN_FILE = "main.j";
|
|
|
|
fileImporterForPath(cwd)("main.j", YES, function()
|
|
{
|
|
afterDocumentLoad(main);
|
|
});
|
|
#endif
|
|
});
|
|
#endif
|
|
|
|
#ifdef BROWSER
|
|
function afterDocumentLoad(/*Function*/ aFunction)
|
|
{
|
|
if (documentLoaded)
|
|
return aFunction();
|
|
|
|
if (window.addEventListener)
|
|
window.addEventListener("load", aFunction, NO);
|
|
|
|
else if (window.attachEvent)
|
|
window.attachEvent("onload", aFunction);
|
|
}
|
|
|
|
var documentLoaded = NO;
|
|
|
|
afterDocumentLoad(function()
|
|
{
|
|
documentLoaded = YES;
|
|
});
|
|
#endif
|