2015-02-10 19:41:24 +00:00
<!doctype html>
<html>
<head>
<meta charset="utf-8">
2016-01-05 14:09:32 +00:00
<meta id="page-data"
data-static-prefix="<%= staticPrefix %>"
data-architect-config="<%= JSON.stringify(architectConfig, null, 2) %>"
>
2015-02-10 19:41:24 +00:00
<title>Cloud9</title>
2016-01-05 14:09:32 +00:00
2015-02-10 19:41:24 +00:00
<script>
// For node-webkit
var nRequire = window.require;
window.nativeRequire = function(path){
var oldRequire = window.require;
window.require = nRequire;
var obj = window.require(path);
window.require = oldRequire;
return obj;
}
window.isLocalVersion = nRequire ? true : false;
window.require = undefined;
</script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
2015-11-19 11:01:50 +00:00
<% include ../../c9.ide.server/views/load-screen.ejs %>
2015-02-10 19:41:24 +00:00
<% if (packed) { %>
<script src="/static/<%=version%>/config/<%=configName%>.js"></script>
<% } else { %>
2015-04-12 18:09:32 +00:00
<script src="/static/mini_require.js"></script>
2015-02-10 19:41:24 +00:00
<script src="/configs/require_config.js"></script>
<% } %>
<script>
2016-01-05 14:09:32 +00:00
var data = document.getElementById("page-data").dataset;
var plugins = JSON.parse(data.architectConfig);
2015-11-19 11:01:50 +00:00
var start = Date.now();
2015-02-10 19:41:24 +00:00
<% if (packed) { %>
require.MODULE_LOAD_URL = "/static/standalone/modules"
<% } %>
if (isLocalVersion)
nativeRequire("nw.gui").Window.get().show();
require(["lib/architect/architect"], function (architect) {
plugins.push({
consumes: [],
provides: ["auth.bootstrap"],
setup: function(options, imports, register) {
register(null, {
"auth.bootstrap": {
login: function(callback) { callback(); }
}
});
}
});
architect.resolveConfig(plugins, function (err, config) {
if (err) throw err;
var errored;
var app = architect.createApp(config, function(err, app){
if (err) {
errored = true;
console.error(err.stack);
alert(err);
}
});
app.lut = {};
app.on("error", function(err){
console.error(err.stack);
if (!errored)
alert(err);
});
app.on("service", function(name, plugin, options){
2015-04-20 23:51:50 +00:00
if (name == "plugin.loader" || name == "plugin.installer"
|| name == "plugin.debug" || name == "plugin.manager"
|| name == "plugin.test")
2015-02-10 19:41:24 +00:00
plugin.architect = app;
if (!plugin.name)
plugin.name = name;
if (options)
app.lut[(options.packagePath || "").replace(/^.*\/home\/.c9\//, "")] = options;
});
app.on("ready", function(){
if (app.services.configure)
app.services.configure.services = app.services;
window.app = app.services;
window.app.__defineGetter__("_ace", function(){
return this.tabManager.focussedTab.editor.ace;
});
Object.keys(window.app).forEach(function(n) {
if (/[^\w]/.test(n))
window.app[n.replace(/[^\w]/, "_") + "_"] = window.app[n];
});
done();
});
// For Development only
function done(){
app.services.c9.ready();
app.services.c9.totalLoadTime = Date.now() - start;
console.warn("Total Load Time: ", Date.now() - start);
2015-11-19 19:39:26 +00:00
if (window.hideLoader)
window.hideLoader();
2015-02-10 19:41:24 +00:00
}
2015-12-09 09:14:54 +00:00
}, function loadError(mod) {
if (mod.id === "plugins/c9.ide.clipboard/html5")
2015-12-09 11:20:11 +00:00
return alert("Unable to load html5.js.\n\nThis may be caused by a false positive in your virus scanner. Please try reloading with ?packed=1 added to the URL.");
2015-02-10 19:41:24 +00:00
});
});
</script>
</body>
2015-12-09 11:20:11 +00:00
</html>