This repository was archived by the owner on Apr 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 925
/
Copy pathdefault-local.js
144 lines (132 loc) · 5.69 KB
/
default-local.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
define(function(require, exports, module) {
var join = require("path").join;
module.exports = function(options) {
options.collab = false;
var config = require("./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;
};
});