Merge pull request +15198 from c9/ide-configs

Move ide configs into subfolder
This commit is contained in:
Harutyun Amirjanyan 2017-02-10 00:04:00 +04:00 committed by GitHub
commit 9d9bfce0b9
19 changed files with 276 additions and 1159 deletions

View File

@ -6,6 +6,7 @@
require("amd-loader");
require("c9/setup_paths")
require("c9/inline-mocha")(module);
var assert = require("assert");
@ -25,9 +26,11 @@ describe("client config consistency", function(){
});
});
fs.readdirSync(root + "/configs").forEach(function(name) {
if (!/client-(workspace|ssh|default)/.test(name)) return;
fs.readdirSync(root + "/configs").filter(function(name) {
return /client-(workspace|ssh|default)/.test(name);
}).concat(
fs.readdirSync(root + "/configs/ide").map(function(n) { return "ide/" + n })
).forEach(function(name) {
it("should not have missing plugins in config " + name, function(next) {
fetchClientOptions(function(err, clientOptions) {
if (err) return next();

View File

@ -1,140 +0,0 @@
var join = require("path").join;
module.exports = function(options) {
options.collab = false;
var config = require("./client-default")(options);
return module.exports.makeLocal(config, options);
};
module.exports.makeLocal = function(config, options) {
var c9Ws = options.remoteWorkspace; // true when opening c9 workspace as local
var root = options.workspaceDir;
var nodeBin = options.nodeBin || ["node"];
var settingDir = options.settingDir || options.installPath;
if (!c9Ws) {
// Local version
options.local = true;
options.projectName = root.substr(root.lastIndexOf("/") + 1);
options.debug = 2;
options.env = "local";
options.defaultTheme = "dark";
}
for (var i = config.length - 1; i >= 0; i--) {
// if (config[i].packagePath == "plugins/c9.cli.bridge/bridge")
// config[i].port = 55556;
if (config[i].packagePath == "plugins/c9.ide.welcome/welcome" && !c9Ws) {
config[i].intro =
"Welcome to your brand new Cloud9. Use this welcome screen "
+ "to tweak the look & feel of the Cloud9 user interface. "
+ "If you prefer a more advanced IDE experience, you can choose "
+ "to change the layout below. "
+ "\n\n"
+ "On the right you can find videos and documentation for Cloud9 "
+ "IDE. Happy Coding!";
}
// else if (config[i].packagePath == "plugins/c9.ide.login/login") {
// config.splice(i, 1);
// }
else if (config[i].packagePath == "plugins/c9.ide.run/run" && !c9Ws) {
config[i].runnerPath = join(settingDir, "/runners");
}
else if (config[i].packagePath == "plugins/c9.ide.ui/menus") {
config[i].autoInit = false;
}
else if (config[i].packagePath == "plugins/c9.ide.save/autosave") {
config[i].slowChangeTimeout = 500;
}
else if (config[i].packagePath == "plugins/c9.ide.run.build/build" && !c9Ws) {
config[i].builderPath = join(settingDir, "/builders");
}
else if (config[i].packagePath == "plugins/c9.ide.editors/metadata" && !c9Ws) {
config[i].path = join(settingDir, "/metadata");
config[i].changeCheckInterval = 2000;
}
else if (config[i].packagePath == "plugins/c9.core/c9") {
config[i].local = true;
}
else if (config[i].packagePath == "plugins/c9.ide.clipboard/html5")
config[i].packagePath = "plugins/c9.ide.local/clipboard";
else if (config[i].packagePath == "plugins/c9.ide.configuration/configure")
config[i].pathFromFavorite = true;
else if (config[i].packagePath == "plugins/c9.core/settings" && !c9Ws) {
// todo: Don't show console when opening a file?
// config[i].template = ;
config[i].projectConfigPath = join(settingDir, "");
config[i].userConfigPath = join(settingDir, "");
config[i].stateConfigPath = join(settingDir, "");
} else if (config[i].packagePath == "plugins/c9.ide.info/info" && c9Ws) {
config[i].packagePath = "plugins/c9.ide.local/info";
} else if (config[i].packagePath == "plugins/c9.ide.ui/menus" && c9Ws) {
config[i].autoInit = false;
} else if (config[i].packagePath == "plugins/c9.ide.tree/tree") {
config[i].defaultExpanded = !config.hosted;
} else if (config[i].packagePath == "plugins/c9.ide.errorhandler/raygun_error_handler") {
// TODO fix cycle introduced by local/info and raygun_error_handler
config[i].packagePath = "plugins/c9.ide.errorhandler/simple_error_handler";
}
}
// Add local modules
var includes = [{
packagePath: "plugins/c9.ide.local/local",
options: options,
}, {
packagePath: "plugins/c9.ide.local/windowframe",
staticPrefix: options.staticPrefix + "/plugins/c9.ide.local"
}, {
packagePath: "plugins/c9.ide.local/update",
host: options.update && options.update.host || "localhost", // "update.c9.io",
port: options.update && options.update.port || "8888", // "443"
path: options.update && options.update.path,
protocol: options.update && options.update.protocol,
installPath: options.correctedInstallPath,
bashBin: options.bashBin,
nodeBin: nodeBin
}, {
packagePath: "plugins/c9.ide.local/projectmanager"
}, {
packagePath: "plugins/c9.ide.local/open"
}, {
packagePath: "plugins/c9.ide.local/nativemenus"
}, !c9Ws && {
packagePath: "plugins/c9.ide.local/info",
installPath: options.correctedInstallPath,
settingDir: settingDir,
cookie: options.user.cookie,
user: {
id: options.user.id,
name: options.user.name,
fullname: options.user.fullname,
email: options.user.email,
},
project: {
id: options.project.id,
name: options.project.name,
contents: options.project.contents,
descr: options.project.descr
}
},
c9Ws && "plugins/c9.ide.analytics/mock_analytics",
].filter(Boolean);
var excludes = c9Ws ? {
"plugins/c9.ide.analytics/analytics": true,
} : {
"plugins/c9.ide.newresource/open": true,
"plugins/c9.ide.info/info": true,
// "plugins/c9.ide.login/login": true,
"plugins/c9.ide.download/download": true
};
config = config.concat(includes).filter(function (p) {
return !excludes[p] && !excludes[p.packagePath];
});
return config;
};

View File

@ -1,45 +0,0 @@
"use strict";
module.exports = function(options) {
var plugins = require("./client-default")(options);
// TODO: cleanup unneeded plugins?
var includes = [];
var excludes = {};
plugins.forEach(function(p) {
if (p.packagePath && p.packagePath.indexOf("c9.core/settings") >= 0) {
p.settings = "defaults";
p.template = {
user: {},
project: {},
state: {
console: {
"@maximized": true,
type: "pane",
nodes: []
}
}
};
}
else if (p.packagePath == "plugins/c9.ide.console/console") {
p.defaultState = {
type: "pane",
nodes: [{
type: "tab",
editorType: "terminal",
active: "true"
}]
};
}
});
plugins = plugins
.concat(includes)
.filter(function (p) {
return !excludes[p] && !excludes[p.packagePath];
});
return plugins;
};

View File

@ -1,922 +0,0 @@
var assert = require("assert");
module.exports = function(options) {
assert(options.staticPrefix, "Option 'staticPrefix' must be set");
assert(options.workspaceDir, "Option 'workspaceDir' must be set");
assert(options.workspaceId, "Option 'workspaceId' must be set");
assert(options.workspaceName, "Option 'workspaceName' must be set");
assert(options.home, "Option 'home' must be set");
assert(options.platform, "Option 'platform' must be set");
// normalize workspacedir and home paths
function normalize(path) {
path = path.replace(/([^/])\/$/, "$1");
if (options.platform == "win32")
path = path.replace(/\\/g, "/");
return path;
}
options.workspaceDir = normalize(options.workspaceDir);
options.installPath = normalize(options.installPath);
options.home = normalize(options.home);
var workspaceDir = options.workspaceDir;
var debug = options.debug !== undefined ? options.debug : false;
var collab = options.collab;
var packaging = options.packaging;
var staticPrefix = options.staticPrefix;
var nodeBin = options.nodeBin || ["node"];
var nodePath = options.nodePath || "";
var runners = options.runners || {};
var builders = options.builders || {};
var hosted = !options.local && !options.dev;
var devel = options.standalone && !options.local || options.mode === "devel" || options.mode == "onlinedev" || options.dev;
var localExtendFiles = options.localExtend || options.standalone;
var plugins = [
// C9
{
packagePath: "plugins/c9.core/c9",
startdate: new Date(),
version: options.manifest.version + " (" + options.manifest.revision + ")",
debug: debug,
workspaceId: options.workspaceId,
workspaceDir: workspaceDir,
name: options.workspaceName,
readonly: options.readonly,
isAdmin: options.isAdmin,
staticUrl: staticPrefix,
hosted: hosted,
hostname: options.appHostname,
local: options.local,
env: options.env || "devel",
home: options.home,
platform: options.platform,
arch: options.arch,
installed: options.installed,
projectId: options.project.id,
projectName: options.projectName || "Project",
configName: options.configName,
standalone: options.standalone,
dashboardUrl: options.dashboardUrl
},
{
packagePath: "plugins/c9.core/settings",
settings: options.settings,
userConfigPath: options.settingDir,
hosted: hosted
},
"plugins/c9.core/ext",
{
packagePath: "plugins/c9.core/http-xhr",
debug: !options.packed
},
// {
// packagePath: "plugins/c9.core/client",
// baseUrl: options.apiUrl
// },
"plugins/c9.core/util",
{
packagePath: "plugins/c9.ide.plugins/loader",
plugins: options.plugins || [],
loadFromDisk: options.standalone
},
{
packagePath: "plugins/c9.ide.plugins/installer",
updates: options.pluginUpdates || []
},
{
packagePath: "plugins/c9.ide.plugins/manager",
staticPrefix: staticPrefix + "/plugins/c9.ide.plugins",
devel: devel
},
{
packagePath: "plugins/c9.ide.plugins/debug"
},
{
packagePath: "plugins/c9.ide.plugins/packages"
},
{
packagePath: "plugins/c9.ide.plugins/test",
staticPrefix: staticPrefix + "/plugins/c9.ide.plugins"
},
// VFS
"plugins/c9.vfs.client/vfs.ping",
"plugins/c9.vfs.client/vfs.log",
{
packagePath: "plugins/c9.vfs.client/vfs_client",
debug: debug,
installPath: options.installPath,
dashboardUrl: options.dashboardUrl,
accountUrl: options.accountUrl,
rejectUnauthorized: options.rejectUnauthorized
},
{
packagePath: "plugins/c9.vfs.client/endpoint",
readonly: options.readonly,
region: options.region,
pid: options.project.id,
servers: options.vfsServers,
updateServers: hosted,
strictRegion: options.strictRegion
|| options.mode === "beta" && "beta",
ignoreProtocolVersion: options.ignoreProtocolVersion,
},
{
packagePath: "plugins/c9.ide.auth/auth",
accessToken: options.accessToken || "token",
ideBaseUrl: options.ideBaseUrl,
apiUrl: options.apiUrl,
userId: options.user.id
},
{
packagePath: "plugins/c9.core/api",
apiUrl: options.apiUrl,
projectId: options.project.id
},
// Editors
"plugins/c9.ide.editors/document",
{
packagePath: "plugins/c9.ide.editors/editors",
defaultEditor: "ace"
},
"plugins/c9.ide.editors/editor",
"plugins/c9.ide.editors/imgview",
{
packagePath: "plugins/c9.ide.imgeditor/imgeditor",
staticPrefix: staticPrefix + "/plugins/c9.ide.imgeditor"
},
"plugins/c9.ide.editors/urlview",
// "plugins/c9.ide.editors/htmlview",
"plugins/c9.ide.editors/tab",
{
packagePath: "plugins/c9.ide.editors/tabmanager",
loadFilesAtInit: false
},
{
packagePath: "plugins/c9.ide.editors/metadata"
},
"plugins/c9.ide.editors/pane",
"plugins/c9.ide.editors/undomanager",
"plugins/c9.ide.newresource/newresource",
"plugins/c9.ide.newresource/open",
"plugins/c9.ide.undo/undo",
{
packagePath: "plugins/c9.ide.closeconfirmation/closeconfirmation",
defaultValue: options.local
},
{
packagePath: "plugins/c9.ide.openfiles/openfiles",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
defaultShow: options.local
},
{
packagePath: "plugins/c9.ide.metrics/metrics",
hosted: hosted
},
// Ace && Commands
"plugins/c9.ide.keys/commands",
"plugins/c9.ide.keys/editor",
{
packagePath: "plugins/c9.ide.ace/ace",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
workerPrefix: options.workerPrefix
},
"plugins/c9.ide.ace/themes",
"plugins/c9.ide.ace.stripws/stripws",
"plugins/c9.ide.ace.repl/editor",
// "plugins/c9.ide.ace.split/split",
{
packagePath: "plugins/c9.ide.ace.gotoline/gotoline",
staticPrefix: staticPrefix + "/plugins/c9.ide.ace.gotoline"
},
{
packagePath: "plugins/c9.ide.ace.statusbar/statusbar",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
"plugins/c9.ide.ace.keymaps/keymaps",
"plugins/c9.ide.ace.keymaps/cli",
"plugins/c9.ide.ace.emmet/emmet",
// Find
{
packagePath: "plugins/c9.ide.find/find",
basePath: workspaceDir
},
{
packagePath: "plugins/c9.ide.find/find.nak",
ignore: "",
useHttp: true,
basePath: workspaceDir,
installPath: options.installPath,
nak: options.nakBin || "~/.c9/node_modules/nak/bin/nak",
node: options.nodeBin,
local: options.local,
},
{
packagePath: "plugins/c9.ide.find.infiles/findinfiles",
staticPrefix: staticPrefix + "/plugins/c9.ide.find.infiles"
},
{
packagePath: "plugins/c9.ide.find.replace/findreplace",
staticPrefix: staticPrefix + "/plugins/c9.ide.find.replace"
},
// UI
{
packagePath: "plugins/c9.ide.ui/ui",
staticPrefix: staticPrefix + "/plugins/c9.ide.ui"
},
"plugins/c9.ide.ui/anims",
"plugins/c9.ide.ui/tooltip",
{
packagePath: "plugins/c9.ide.ui/menus",
autoInit: !options.local
},
"plugins/c9.ide.ui/forms",
{
packagePath: "plugins/c9.ide.ui/widgets.list",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
"plugins/c9.ide.ui/widgets.tree",
"plugins/c9.ide.ui/widgets.datagrid",
"plugins/c9.ide.ui/widgets.terminal",
"plugins/c9.ide.ui/focus",
"plugins/c9.ide.ui/lib_apf",
"plugins/c9.ide.dialog/dialog",
"plugins/c9.ide.dialog.common/alert",
"plugins/c9.ide.dialog.common/alert_internal",
"plugins/c9.ide.dialog.common/confirm",
"plugins/c9.ide.dialog.common/filechange",
"plugins/c9.ide.dialog.common/fileoverwrite",
"plugins/c9.ide.dialog.common/fileremove",
"plugins/c9.ide.dialog.common/info",
"plugins/c9.ide.dialog.common/question",
"plugins/c9.ide.dialog.common/upsell",
{
packagePath: "plugins/c9.ide.dialog.common/error",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
{
packagePath: "plugins/c9.ide.dialog.common/notification",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
{
packagePath: "plugins/c9.ide.dialog.login/login",
noLogout: !options.local
},
"plugins/c9.ide.dialog.file/file",
"plugins/c9.ide.dialog.wizard/wizard",
// VFS
"plugins/c9.fs/proc",
"plugins/c9.fs/proc.apigen", // used only by disabled deploy plugins
"plugins/c9.fs/net",
{
packagePath: "plugins/c9.fs/fs",
baseProc: workspaceDir
},
"plugins/c9.fs/fs.errors",
"plugins/c9.fs/fs.cache.xml",
{
packagePath: "plugins/c9.ide.readonly/access_control",
dashboardUrl: options.dashboardUrl,
readonly: options.readonly
},
// Watcher
"plugins/c9.ide.threewaymerge/threewaymerge",
"plugins/c9.ide.watcher/watcher",
{
packagePath: "plugins/c9.ide.watcher/gui",
collab: collab
},
// Language
{
packagePath: "plugins/c9.ide.language/language",
workspaceDir: workspaceDir,
staticPrefix: staticPrefix,
workerPrefix: options.CORSWorkerPrefix // "/static/standalone/worker"
},
"plugins/c9.ide.language.core/keyhandler",
"plugins/c9.ide.language.core/complete",
"plugins/c9.ide.language.core/quickfix",
"plugins/c9.ide.language.core/marker",
"plugins/c9.ide.language.core/refactor",
"plugins/c9.ide.language.core/tooltip",
"plugins/c9.ide.language.core/jumptodef",
"plugins/c9.ide.language/worker_util_helper",
{
packagePath: "plugins/c9.ide.language.generic/generic",
mode_completer: options.ssh,
},
"plugins/c9.ide.language.css/css",
"plugins/c9.ide.language.html/html",
"plugins/c9.ide.language.javascript/javascript",
"plugins/c9.ide.language.javascript.immediate/immediate",
"plugins/c9.ide.language.javascript.infer/jsinfer",
{
packagePath: "plugins/c9.ide.language.javascript.tern/tern",
plugins: [
{
name: "angular",
path: "tern/plugin/angular",
enabled: true,
hidden: false,
},
{
name: "doc_comment",
path: "tern/plugin/doc_comment",
enabled: true,
hidden: true,
},
{
name: "es_modules",
path: "tern/plugin/es_modules",
enabled: true,
hidden: true,
},
{
name: "modules",
path: "tern/plugin/modules",
enabled: true,
hidden: true,
},
{
name: "node",
path: "tern/plugin/node",
enabled: true,
hidden: false,
},
{
name: "requirejs",
path: "tern/plugin/requirejs",
enabled: true,
hidden: false,
},
{
name: "architect_resolver",
path: "./architect_resolver_worker",
enabled: true,
hidden: true,
},
],
defs: [{
name: "ecma5",
enabled: true,
experimental: false,
firstClass: true,
path: "lib/tern/defs/ecma5.json"
}, {
name: "jQuery",
enabled: true,
experimental: false,
path: "lib/tern/defs/jquery.json"
}, {
name: "browser",
enabled: true,
experimental: false,
firstClass: true,
path: "lib/tern/defs/browser.json"
}, {
name: "underscore",
enabled: false,
experimental: false,
path: "lib/tern/defs/underscore.json"
}, {
name: "chai",
enabled: false,
experimental: false,
path: "lib/tern/defs/chai.json"
}]
},
"plugins/c9.ide.language.javascript.tern/ui",
"plugins/c9.ide.language.javascript.tern/architect_resolver",
"plugins/c9.ide.language.javascript.eslint/eslint",
{
packagePath: "plugins/c9.ide.language.python/python",
pythonPath: "/usr/local/lib/python2.7/dist-packages:/usr/local/lib/python3.4/dist-packages:/usr/local/lib/python3.5/dist-packages",
},
"plugins/c9.ide.language.go/go",
{
packagePath: "plugins/c9.ide.language.jsonalyzer/jsonalyzer",
workspaceDir: workspaceDir,
homeDir: options.home,
bashBin: options.bashBin,
useCollab: collab,
useSend: !collab && (options.local || options.standalone),
maxServerCallInterval: 2000
},
// Run
{
packagePath: "plugins/c9.ide.run/run",
base: workspaceDir,
staticPrefix: staticPrefix + "/plugins/c9.ide.run",
tmux: options.tmux,
runners: runners,
installPath: options.correctedInstallPath,
local: options.local
},
{
packagePath: "plugins/c9.ide.run/gui",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
defaultConfigs: {}
},
{
packagePath: "plugins/c9.ide.run.build/build",
base: workspaceDir,
builders: builders
},
{
packagePath: "plugins/c9.ide.run.build/gui"
},
// "plugins/c9.ide.run.debug/debuggers/sourcemap",
{
packagePath: "plugins/c9.ide.run.debug/debuggers/debugger",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
{
packagePath: "plugins/c9.ide.run.debug/debuggers/v8/v8debugger",
basePath: workspaceDir
},
{
packagePath: "plugins/c9.ide.run.debug/debuggers/socket",
nodeBin: nodeBin
},
"plugins/c9.ide.run.debug/breakpoints",
"plugins/c9.ide.run.debug/debugpanel",
"plugins/c9.ide.run.debug/callstack",
{
packagePath: "plugins/c9.ide.immediate/immediate",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
"plugins/c9.ide.immediate/evaluator",
"plugins/c9.ide.immediate/evaluators/browserjs",
"plugins/c9.ide.immediate/evaluators/debugnode",
"plugins/c9.ide.immediate/evaluators/bash",
"plugins/c9.ide.run.debug/variables",
"plugins/c9.ide.run.debug/watches",
"plugins/c9.ide.run.debug/liveinspect",
"plugins/c9.ide.run.debug.xdebug/xdebug",
"plugins/c9.ide.run.debug/debuggers/gdb/gdbdebugger",
"plugins/c9.ide.run.debug.ikpdb/ikpdb",
// Console
{
packagePath: "plugins/c9.ide.terminal/terminal",
tmux: options.tmux,
root: workspaceDir,
tmpdir: options.tmpdir,
shell: options.shell || "",
staticPrefix: staticPrefix + "/plugins/c9.ide.terminal",
installPath: options.correctedInstallPath
},
{
packagePath: "plugins/c9.ide.terminal/predict_echo"
},
{
packagePath: "plugins/c9.ide.terminal/link_handler",
previewUrl: options.previewUrl
},
{
packagePath: "plugins/c9.ide.terminal.monitor/monitor",
bashBin: options.bashBin
},
{
packagePath: "plugins/c9.ide.terminal.monitor/message_view",
staticPrefix: options.staticPrefix + "/plugins/c9.ide.layout.classic"
},
"plugins/c9.ide.terminal/opentermhere",
{
packagePath: "plugins/c9.ide.run/output",
staticPrefix: options.staticPrefix + "/plugins/c9.ide.layout.classic",
tmux: options.tmux,
basePath: workspaceDir
},
{
packagePath: "plugins/c9.ide.console/console",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
defaultState: options.project.scmurl ? {
type: "pane",
nodes: [{
type: "tab",
editorType: "terminal",
active: "true",
document: {
changed: false,
meta: {
timestamp: Date.now()
},
filter: true,
title: "bash - \"Cloning ...\"",
tooltip: "bash - \"Cloning ...\"",
terminal: {
id: "clone",
cwd: ""
}
}
}, {
type: "tab",
editorType: "immediate",
document: {
title: "Immediate"
}
}]
} : null
},
// Layout & Panels
{
packagePath: "plugins/c9.ide.layout.classic/layout",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
dashboardUrl: options.dashboardUrl,
cdn: options.useCdn
},
"plugins/c9.ide.theme.flat/flat-light",
"plugins/c9.ide.theme.flat/flat-dark",
{
packagePath: "plugins/c9.ide.layout.classic/preload",
themePrefix: options.themePrefix,
defaultTheme: options.defaultTheme || "dark"
},
{
packagePath: "plugins/c9.ide.tree/tree",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
defaultExpanded: true
},
{
packagePath: "plugins/c9.ide.tree/favorites",
startEmpty: options.local,
alwaysScope: options.local,
realRoot: true,
home: options.local ? options.home : "~"
},
{
packagePath: "plugins/c9.ide.upload/dragdrop",
treeAsPane: options.local
},
{
packagePath: "plugins/c9.ide.upload/upload",
staticPrefix: staticPrefix + "/plugins/c9.ide.upload"
},
{
packagePath: "plugins/c9.ide.upload/upload_manager",
workerPrefix: "plugins/c9.ide.upload"
},
{
packagePath: "plugins/c9.ide.upload/upload_progress",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
{
packagePath: "plugins/c9.ide.navigate/navigate",
loadListAtInit: false
},
{
packagePath: "plugins/c9.ide.keys/panel"
},
{
packagePath: "plugins/c9.ide.language.core/outline",
staticPrefix: staticPrefix + "/plugins/c9.ide.language"
},
{
packagePath: "plugins/c9.ide.panels/panels",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
defaultActiveLeft: "tree"
},
"plugins/c9.ide.panels/panel",
"plugins/c9.ide.panels/area",
"plugins/c9.ide.processlist/processlist",
// Installer
{
packagePath: "plugins/c9.ide.installer/gui",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic",
},
"plugins/c9.automate/automate",
"plugins/c9.ide.installer/commands/centos",
"plugins/c9.ide.installer/commands/darwin",
"plugins/c9.ide.installer/commands/bash",
"plugins/c9.ide.installer/commands/npm",
"plugins/c9.ide.installer/commands/npm-g",
"plugins/c9.ide.installer/commands/pip",
"plugins/c9.ide.installer/commands/gem",
"plugins/c9.ide.installer/commands/zip",
"plugins/c9.ide.installer/commands/symlink",
"plugins/c9.ide.installer/commands/message",
{
packagePath: "plugins/c9.ide.installer/commands/tar.gz",
bashBin: options.bashBin
},
"plugins/c9.ide.installer/commands/ubuntu",
{
packagePath: "plugins/c9.ide.installer/installer",
homeDir: options.homeDir,
installSelfCheck: true,
installPath: options.installPath
},
// Previewer
{
packagePath: "plugins/c9.ide.preview/preview",
staticPrefix: staticPrefix + "/plugins/c9.ide.preview",
defaultPreviewer: "preview.browser",
previewUrl: options.previewUrl,
local: options.local
},
"plugins/c9.ide.preview/previewer",
"plugins/c9.ide.preview/previewers/raw",
{
packagePath: "plugins/c9.ide.preview.browser/browser",
local: options.local,
staticPrefix: staticPrefix + "/plugins/c9.ide.preview.browser"
},
{
packagePath: "plugins/c9.ide.preview.markdown/markdown",
staticPrefix: staticPrefix,
htmlPath: "/plugins/c9.ide.preview.markdown/markdown.html",
local: options.local
},
"plugins/c9.ide.remote/manager",
"plugins/c9.ide.remote/documents/htmldocument",
"plugins/c9.ide.remote/documents/cssdocument",
"plugins/c9.ide.remote/documents/jsdocument",
{
packagePath: "plugins/c9.ide.remote/transports/postmessage",
previewBaseUrl: options.previewBaseUrl
},
// "plugins/c9.ide.remote/transports/debugger",
// "plugins/c9.ide.remote/transports/websocket",
// Formatters
"plugins/c9.ide.format/format",
"plugins/c9.ide.format/formatters/jsbeautify",
// Other
"plugins/c9.ide.download/download",
{
packagePath: "plugins/c9.ide.info/info",
installPath: options.installPath,
user: {
id: options.user.id,
name: options.user.name,
fullname: options.user.fullname,
email: options.user.email,
date_add: options.user.date_add,
active: options.user.active,
c9version: options.user.c9version,
premium: options.user.premium,
region: options.user.region,
},
project: {
id: options.project.id,
name: options.project.name,
contents: options.project.contents,
descr: options.project.descr,
remote: options.project.remote,
premium: options.project.premium,
}
},
{
packagePath: "plugins/c9.ide.welcome/welcome",
staticPrefix: staticPrefix + "/plugins/c9.ide.welcome",
intro: "Welcome to Cloud9. Use this welcome screen "
+ "to tweak the look & feel of the Cloud9 user interface. ",
checkOS: true
},
{
packagePath: "plugins/c9.cli.bridge/bridge",
startBridge: options.startBridge
},
{
packagePath: "plugins/c9.cli.bridge/bridge_commands",
basePath: workspaceDir
},
{
packagePath: "plugins/c9.ide.help/help",
staticPrefix: staticPrefix + "/plugins/c9.ide.help",
hosted: hosted
},
{
packagePath: "plugins/c9.ide.guide/guide",
staticPrefix: staticPrefix + "/plugins/c9.ide.guide"
},
{
packagePath: "plugins/c9.ide.guide/default"
},
{
packagePath: "plugins/c9.ide.configuration/configure",
dashboardUrl: options.dashboardUrl,
},
"plugins/c9.ide.save/save",
"plugins/c9.ide.recentfiles/recentfiles",
{
packagePath: "plugins/c9.ide.save/autosave"
},
{
packagePath: "plugins/c9.ide.clipboard/clipboard",
local: options.local
},
{
packagePath: "plugins/c9.ide.clipboard/html5"
},
"plugins/c9.ide.behaviors/tabs",
// {
// packagePath: "plugins/c9.ide.behaviors/dashboard",
// staticPrefix : staticPrefix + "/plugins/c9.ide.behaviors"
// },
{
packagePath: "plugins/c9.ide.behaviors/page",
staticPrefix: staticPrefix + "/plugins/c9.ide.behaviors"
},
{
packagePath: "plugins/c9.ide.preferences/preferences",
staticPrefix: staticPrefix + "/plugins/c9.ide.preferences"
},
"plugins/c9.ide.preferences/preferencepanel",
{
packagePath: "plugins/c9.ide.preferences/general",
installPath: options.installPath,
local: options.local
},
{
packagePath: "plugins/c9.ide.preferences/project",
basePath: workspaceDir,
local: options.local
},
"plugins/c9.ide.preferences/experimental",
{
packagePath: "plugins/c9.ide.login/login",
staticPrefix: staticPrefix + "/plugins/c9.ide.login",
ideBaseUrl: options.ideBaseUrl,
dashboardUrl: options.dashboardUrl,
accountUrl: options.accountUrl,
local: options.local
},
{
packagePath: "plugins/c9.ide.pubsub/pubsub-client",
},
{
packagePath: "plugins/c9.ide.collab/notifications/bubble",
staticPrefix: staticPrefix + "/plugins/c9.ide.collab/notifications"
},
"plugins/c9.ide.behaviors/zentabs",
// Test
{
packagePath: "plugins/c9.ide.test/test"
},
"plugins/c9.ide.test/testpanel",
"plugins/c9.ide.test/testrunner",
{
packagePath: "plugins/c9.ide.test/all",
staticPrefix: staticPrefix + "/plugins/c9.ide.test"
},
"plugins/c9.ide.test/results",
"plugins/c9.ide.test/coverage",
"plugins/c9.ide.test/coverageview",
"plugins/c9.ide.test.mocha/mocha",
// git integration v2
// {
// packagePath: "plugins/c9.ide.scm/scm.commit",
// staticPrefix: staticPrefix + "/plugins/c9.ide.scm"
// },
// "plugins/c9.ide.scm/scm",
// "plugins/c9.ide.scm/scm.branches",
// "plugins/c9.ide.scm/dialog.localchanges",
// "plugins/c9.ide.scm/scm.log",
// "plugins/c9.ide.scm/git",
// "plugins/c9.ide.scm/diff.split",
// "plugins/c9.ide.scm/diff.unified",
// // git integration v1
"plugins/c9.ide.scm/v1/scm",
"plugins/c9.ide.scm/v1/scmpanel",
"plugins/c9.ide.scm/v1/detail",
"plugins/c9.ide.scm/v1/log",
"plugins/c9.ide.scm/v1/git",
"plugins/c9.ide.scm/v1/editor",
// git integration
"plugins/c9.ide.scm/mergetool"
];
if (packaging || !devel) {
plugins.push({
packagePath: "plugins/c9.ide.errorhandler/raygun_error_handler",
version: options.manifest.version,
revision: options.manifest.revision,
apiKey: options.raygun.apiKey
});
}
if (packaging || devel) {
plugins.push({
packagePath: "plugins/c9.ide.errorhandler/simple_error_handler",
version: options.manifest.version,
revision: options.manifest.revision
});
}
if (!hosted) {
plugins.push(
"plugins/c9.ide.analytics/mock_analytics",
"plugins/c9.ide.services/linked-services-mock"
);
}
// Collab
if (packaging || !collab) {
plugins.push(
"plugins/c9.ide.language.jsonalyzer/mock_collab"
);
}
if (packaging || collab) {
plugins.push(
{
packagePath: "plugins/c9.ide.collab/connect",
enable: collab,
debug: debug,
localServerFile: localExtendFiles,
nodeBin: nodeBin,
nodePath: nodePath,
basePath: workspaceDir
},
"plugins/c9.ide.collab/collab",
"plugins/c9.ide.collab/collabpanel",
{
packagePath: "plugins/c9.ide.collab/workspace",
hosted: hosted,
isAdmin: options.isAdmin
},
"plugins/c9.ide.collab/util",
{
packagePath: "plugins/c9.ide.collab/ot/document",
minDelay: 500,
maxDelay: 10000
},
{
packagePath: "plugins/c9.ide.collab/cursor_layer",
staticPrefix: staticPrefix + "/plugins/c9.ide.collab"
},
"plugins/c9.ide.collab/author_layer",
{
packagePath: "plugins/c9.ide.collab/timeslider/timeslider",
staticPrefix: staticPrefix + "/plugins/c9.ide.collab/timeslider"
},
// Collab panels
{
packagePath: "plugins/c9.ide.collab/notifications/notifications",
hosted: hosted,
isAdmin: options.isAdmin
},
"plugins/c9.ide.collab/members/members_panel",
{
packagePath: "plugins/c9.ide.collab/share/share",
previewUrl: options.previewUrl,
local: options.local
},
{
packagePath: "plugins/c9.ide.collab/members/members",
staticPrefix: staticPrefix + "/plugins/c9.ide.layout.classic"
},
{
packagePath: "plugins/c9.ide.collab/chat/chat",
staticPrefix: staticPrefix + "/plugins/c9.ide.collab/chat"
},
"plugins/c9.ide.format/formatters/custom");
}
if (options.platform !== "win32") {
plugins.push({
packagePath: "plugins/c9.ide.language.codeintel/codeintel",
preinstalled: hosted && !options.ssh,
paths: {
php: ".:./vendor",
},
});
}
return plugins;
};

View File

@ -251,7 +251,7 @@ var server = {
getPlugins : function(options, cb, restoreWindow) {
var windowConfig = options.windowConfig || {};
var configPath = join(__dirname, "../configs/client-default-local.js");
var configPath = join(__dirname, "../configs/ide/default-local.js");
var settingsPath = join(__dirname, "../settings/local.js");
var themeDir = join(__dirname, "../build/standalone/skin/" +
(windowConfig.isRemote ? "full" : "default-local"));

View File

@ -36,6 +36,28 @@ var net = require("../lib/net");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var config = require("../config");
function $workerBlob(workerUrl) {
// workerUrl can be protocol relative
// importScripts only takes fully qualified urls
var script = "importScripts('" + net.qualifyURL(workerUrl) + "');";
try {
return new Blob([script], {"type": "application/javascript"});
} catch (e) { // Backwards-compatibility
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
var blobBuilder = new BlobBuilder();
blobBuilder.append(script);
return blobBuilder.getBlob("application/javascript");
}
}
function createWorker(workerUrl) {
var blob = $workerBlob(workerUrl);
var URL = window.URL || window.webkitURL;
var blobURL = URL.createObjectURL(blob);
// calling URL.revokeObjectURL before worker is terminated breaks it on IE Edge
return new Worker(blobURL);
}
var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, importScripts) {
this.$sendDeltaQueue = this.$sendDeltaQueue.bind(this);
this.changeListener = this.changeListener.bind(this);
@ -58,23 +80,7 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, impor
});
}
try {
this.$worker = new Worker(workerUrl);
} catch(e) {
if (e instanceof window.DOMException) {
// Likely same origin problem. Use importScripts from a shim Worker
var blob = this.$workerBlob(workerUrl);
var URL = window.URL || window.webkitURL;
var blobURL = URL.createObjectURL(blob);
this.$worker = new Worker(blobURL);
setTimeout(function() { // IE EDGE needs a timeout here
URL.revokeObjectURL(blobURL);
});
} else {
throw e;
}
}
this.$worker = createWorker(workerUrl);
if (importScripts) {
this.send("importScripts", importScripts);
}
@ -189,20 +195,6 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl, impor
this.emit("change", {data: q});
};
this.$workerBlob = function(workerUrl) {
// workerUrl can be protocol relative
// importScripts only takes fully qualified urls
var script = "importScripts('" + net.qualifyURL(workerUrl) + "');";
try {
return new Blob([script], {"type": "application/javascript"});
} catch (e) { // Backwards-compatibility
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
var blobBuilder = new BlobBuilder();
blobBuilder.append(script);
return blobBuilder.getBlob("application/javascript");
}
};
}).call(WorkerClient.prototype);
@ -260,5 +252,7 @@ UIWorkerClient.prototype = WorkerClient.prototype;
exports.UIWorkerClient = UIWorkerClient;
exports.WorkerClient = WorkerClient;
exports.createWorker = createWorker;
});

View File

@ -14,7 +14,7 @@ function getInlineDeps(fn) {
fn.toString().replace(commentRegExp, "")
.replace(cjsRequireRegExp, function (match, dep, index, str) {
var i = index;
while (str.charCodeAt(i-=1) <= 32) {}
while (str.charCodeAt(i -= 1) <= 32) {}
if (str.charAt(i) !== ".")
deps.push(dep);
});
@ -293,10 +293,15 @@ var config = require.config = function(cfg) {
if (cfg.baseUrlLoadBalancers)
config.baseUrlLoadBalancers = cfg.baseUrlLoadBalancers;
};
config.packages = Object.create(null);
config.paths = Object.create(null);
config.baseUrl = "";
config.useCache = false;
require.resetConfig = function() {
config.packages = Object.create(null);
config.paths = Object.create(null);
config.baseUrl = "";
config.useCache = false;
};
require.resetConfig();
define.undef = require.undef = function(module, recursive) {
if (recursive) {
@ -503,7 +508,9 @@ function checkCache() {
ideCache = ideCache_;
return ideCache.keys();
}).then(function(keys) {
baseUrl = host + config.baseUrl;
baseUrl = config.baseUrl;
if (baseUrl[0] == "/")
baseUrl = host + baseUrl;
var val = keys.map(function(r) {
var url = r.url;
if (url.startsWith(baseUrl))
@ -520,7 +527,7 @@ function checkCache() {
var checked = 0;
var buffer = "";
var toDelete = [];
post("/static/__check__", val, function(t) {
post(baseUrl + "__check__", val, function(t) {
var e = t.slice(checked);
checked = t.length;
var parts = (buffer + e).split("\n");

View File

@ -15,7 +15,7 @@ function compress(sources, opts) {
return literals.push(pkg.source);
}
if (pkg.file) console.log("Adding '" + pkg.file + "'.");
// if (pkg.file) console.log("Adding '" + pkg.file + "'.");
toplevel = UglifyJS.parse(pkg.source, {
filename: (pkg.file || pkg.id).replace(new RegExp("^" + opts.basepath + "/"), ""), //@todo remove prefix

View File

@ -329,6 +329,8 @@ function resolveModulePath(id, pathMap) {
tail = testPath.substr(i) + tail;
testPath = testPath.slice(0, i);
}
if (!testPath && pathMap["/"])
return pathMap["/"] + tail;
return id;
}

11
node_modules/c9/setup_paths.js generated vendored
View File

@ -23,5 +23,14 @@ modules._resolveFilename = function(request, parent) {
if (parent.paths.indexOf(p) === -1)
parent.paths.push(p);
});
return oldResolve(request, parent);
try {
return oldResolve(request, parent);
} catch (e) {
// handle client- -> ide/ rename for configs
if (/client-[^\\\/]+$/.test(path.basename(request))) {
request = request.replace(/\/client-([^\\\/]+)$/, "/ide/$1");
return oldResolve(request, parent);
}
throw e;
}
};

View File

@ -1,3 +1,3 @@
<audio style="display: none;" id="chatNotif" preload="true" src="/static/plugins/c9.ide.collab/chat/sounds/chat_notif.mp3"></audio>
<audio style="display: none;" id="chatNotif"></audio>
<div id="chatThrob"></div>
<div id="chatCounter"></div>

View File

@ -363,6 +363,7 @@ define(function(require, exports, module) {
chatThrob = $("chatThrob");
chatCounter = $("chatCounter");
chatNotif = $("chatNotif");
chatNotif.src = staticPrefix + "/sounds/chat_notif.mp3";
chatThrob.addEventListener("click", function () {
chatThrob.style.display = "none";
@ -383,7 +384,7 @@ define(function(require, exports, module) {
plugin.on("unload", function() {
loaded = false;
drawn = false;
drawn = nonPanelDrawn = false;
});
/***** Register and define API *****/

View File

@ -17,6 +17,8 @@ define(function(require, exports, module) {
var showError = imports["dialog.error"].show;
var prefs = imports.preferences;
var createWorker = require("ace/worker/worker_client").createWorker;
/***** Initialization *****/
var plugin = new Plugin("Ajax.org", main.consumes);
@ -521,7 +523,7 @@ define(function(require, exports, module) {
hash.counter = 0;
function hash(data, callback) {
if (!worker) {
worker = new Worker('/static/lib/rusha/rusha.min.js');
worker = createWorker((options.staticPrefix || "/static") + "/lib/rusha/rusha.min.js");
worker.addEventListener("message", function(e) {
// @todo security?

View File

@ -22,6 +22,7 @@ define(function(require, exports, module) {
var commands = imports.commands;
var WorkerClient = require("ace/worker/worker_client").WorkerClient;
var UIWorkerClient = require("ace/worker/worker_client").UIWorkerClient;
var net = require("ace/lib/net");
var async = require("async");
@ -190,7 +191,7 @@ define(function(require, exports, module) {
["treehugger", "ace", "c9", "plugins", "acorn", "tern"],
id,
"LanguageWorker",
"/static/lib/ace/lib/ace/worker/worker.js",
(options.staticPrefix || "/static") + "/lib/ace/lib/ace/worker/worker.js",
path && [path]
);
} catch (e) {
@ -208,7 +209,7 @@ define(function(require, exports, module) {
};
}
worker.call("setStaticPrefix", [options.staticPrefix || c9.staticUrl || "/static"]);
worker.call("setStaticPrefix", [net.qualifyURL(options.staticPrefix || c9.staticUrl || "/static")]);
if (document.location.hostname.match(/c9.dev|cloud9beta.com|localhost|127.0.0.1/))
worker.call("setDebug", [true]);

View File

@ -1,12 +1,11 @@
define(function(require, exports, module) {
main.consumes = ["Plugin", "http", "ui", "settings"];
main.consumes = ["Plugin", "ui", "settings"];
main.provides = ["layout.preload"];
return main;
function main(options, imports, register) {
var settings = imports.settings;
var Plugin = imports.Plugin;
var http = imports.http;
var ui = imports.ui;
var async = require("async");

View File

@ -132,6 +132,11 @@ define(function(require, exports, module) {
);
}
statics.addStatics([{
path: __dirname + "/../../configs/ide",
mount: "/configs/ide"
}]);
statics.addStatics([{
path: __dirname + "/www",
mount: "/"

View File

@ -59,7 +59,7 @@ function main(options, imports, register) {
}
if (config[0] != "/")
config = path.join(__dirname, "/../../configs/client-" + config);
config = path.join(__dirname, "/../../configs/ide/" + config);
if (config.slice(-3) !== ".js")
config += ".js";

View File

@ -89,6 +89,11 @@ function plugin(options, imports, register) {
source: "query",
optional: true
},
config: {
type: "number",
source: "query",
optional: true
},
}
}, function(req, res, next) {
@ -112,6 +117,8 @@ function plugin(options, imports, register) {
opts.options.debug = req.params.debug !== undefined;
res.setHeader("Cache-Control", "no-cache, no-store");
if (req.params.config == 1)
return res.json(getConfig(configName, opts));
res.render(__dirname + "/views/standalone.html.ejs", {
architectConfig: getConfig(configName, opts),
configName: configName,

View File

@ -0,0 +1,194 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Cloud9</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<link rel="stylesheet" type="text/css" href="./plugins/c9.ide.layout.classic/loading-flat.css" />
<div id="loadingcontainer" class="">
<div id="loadingide">
<div class="cool-message"></div>
<div class="status" style="display:none"><div class="spinner"></div></div>
<div id="content" class="loading-progress">
</div>
<div class="footer">
<a href="https://docs.c9.io">Documentation</a> |
<a href="http://status.c9.io">Server Status</a> |
<a href="http://support.c9.io">Support</a>
</div>
</div>
</div>
<script>
var loadingIde = document.querySelector("#loadingide");
document.body.className = "loading " + loadingIde.className;
var messages = [
"Share your code by sharing your workspace URL.",
"Test your code in different browsers with the Sauce Labs plugin.",
"Each workspace is its own Ubuntu virtual machine.",
"Run 'dpkg -l' in the terminal to see all packages installed.",
"Remember to run your code on port 8080, 8081, or 8082.",
"Use the Collaborate panel when collaborating for optimal teamwork.",
"It's better up here.",
"Happy coding!",
"Everything as you left it.",
"Thank you Ada Lovelace!",
"POST /desktop/era",
"Try using VIM mode!",
"Not your grandmother's IDE",
"Makes your laptop cooler"
];
var mac_keybindings = [
"Press Ctrl-Option-Right to select the next instance of a word.",
"Press Cmd-. to show all keyboard commands.",
"To rename a variable, highlight it then press Option-Cmd-R.",
"Press Option-W to close your current IDE tab.",
"Press Cmd-D to delete the current line of code",
"Press Option-Tab to go to the next IDE tab.",
"Press Option-Shift-T to reopen a tab you closed.",
"Press Option-T to open a new terminal at any time.",
"Press Cmd-E to search for a file by name.",
"Press Cmd-Shift-E to search for a function by name.",
"Press Option-S to switch between a terminal and an editor.",
];
var win_keybindings = [
"Press Ctrl-Alt-Right to select the next instance of a word.",
"Press Ctrl-. to show all keyboard commands.",
"To rename a variable, highlight it then press Ctrl-Alt-R.",
"Press Alt-W to close your current IDE tab.",
"Press Ctrl-D to delete the current line of code",
"Press Alt-Shift-T to reopen a tab you closed.",
"Press Alt-T to open a new terminal at any time.",
"Press Ctrl-E to search for a file by name.",
"Press Ctrl-Shift-E to search for a function by name.",
"Press Alt-S to switch between a terminal and an editor.",
];
var isMac = (navigator.platform == "MacIntel" || navigator.platform == "Macintosh" || navigator.platform == "MacPPC");
var platform_keybindings = isMac ? mac_keybindings : win_keybindings;
messages = messages.concat(platform_keybindings);
var idx = Math.floor(Math.random() * messages.length);
if (idx == messages.length) idx = messages.length - 1;
var msg = messages[idx];
if (~location.hash.indexOf("create")) {
msg = "Creating Your New Workspace";
location.hash = location.hash.replace(/&?create/, "");
}
document.querySelector("#loadingide .cool-message").innerHTML = msg;
setTimeout(function(){
var s = document.querySelector("#loadingide .status");
if (s) s.style.display = "block";
}, 2000);
window.hideLoader = function(){
var loader = document.getElementById("loadingcontainer");
loader.parentNode.removeChild(loader);
document.body.className = document.body.className.replace("loading " + loadingIde.className, "");
};
</script>
<script src="/static/mini_require.js"></script>
<script src="/configs/require_config.js"></script>
<script>
var start = Date.now();
var plugins;
require(["lib/architect/architect", "text!/ide.html?config=1"], function (architect, pluginJSON) {
plugins = JSON.parse(pluginJSON);
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){
if (name == "plugin.loader" || name == "plugin.installer"
|| name == "plugin.debug" || name == "plugin.manager"
|| name == "plugin.test")
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(){
var vfs = app.services.vfs;
var c9 = app.services.c9;
c9.ready();
c9.totalLoadTime = Date.now() - start;
console.warn("Total Load Time: ", Date.now() - start);
if (window.hideLoader) {
if (vfs.connected)
window.hideLoader();
else {
vfs.once("connect", function(){
window.hideLoader();
});
}
}
}
}, function loadError(mod) {
if (mod.id === "plugins/c9.ide.clipboard/html5")
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.");
});
});
</script>
</body>
</html>