kopia lustrzana https://github.com/c9/core
fix readonly mode
rodzic
0d7243ee6f
commit
ed1c33addb
|
@ -98,7 +98,7 @@
|
||||||
"c9.ide.preview.browser": "#c50007ebbc",
|
"c9.ide.preview.browser": "#c50007ebbc",
|
||||||
"c9.ide.preview.markdown": "#ab8d30ad9f",
|
"c9.ide.preview.markdown": "#ab8d30ad9f",
|
||||||
"c9.ide.pubsub": "#a85fb27eca",
|
"c9.ide.pubsub": "#a85fb27eca",
|
||||||
"c9.ide.readonly": "#f6f07bbe42",
|
"c9.ide.readonly": "#c699cb172b",
|
||||||
"c9.ide.recentfiles": "#7c099abf40",
|
"c9.ide.recentfiles": "#7c099abf40",
|
||||||
"c9.ide.remote": "#301d2ab519",
|
"c9.ide.remote": "#301d2ab519",
|
||||||
"c9.ide.processlist": "#bc11818bb5",
|
"c9.ide.processlist": "#bc11818bb5",
|
||||||
|
|
|
@ -91,13 +91,8 @@ function plugin(options, imports, register) {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}, function(req, res, next) {
|
}, function(req, res, next) {
|
||||||
var configType = null;
|
|
||||||
if (req.params.workspacetype)
|
|
||||||
configType = "workspace-" + req.params.workspacetype;
|
|
||||||
else if (req.params.devel)
|
|
||||||
configType = "devel";
|
|
||||||
|
|
||||||
var configName = getConfigName(configType, options);
|
var configName = getConfigName(req.params, options);
|
||||||
|
|
||||||
var collab = options.collab && req.params.collab !== 0 && req.params.nocollab != 1;
|
var collab = options.collab && req.params.collab !== 0 && req.params.nocollab != 1;
|
||||||
var opts = extend({}, options);
|
var opts = extend({}, options);
|
||||||
|
@ -118,7 +113,7 @@ function plugin(options, imports, register) {
|
||||||
opts.options.debug = req.params.debug !== undefined;
|
opts.options.debug = req.params.debug !== undefined;
|
||||||
res.setHeader("Cache-Control", "no-cache, no-store");
|
res.setHeader("Cache-Control", "no-cache, no-store");
|
||||||
res.render(__dirname + "/views/standalone.html.ejs", {
|
res.render(__dirname + "/views/standalone.html.ejs", {
|
||||||
architectConfig: getConfig(configType, opts),
|
architectConfig: getConfig(configName, opts),
|
||||||
configName: configName,
|
configName: configName,
|
||||||
packed: opts.packed,
|
packed: opts.packed,
|
||||||
version: opts.version
|
version: opts.version
|
||||||
|
@ -284,8 +279,12 @@ function plugin(options, imports, register) {
|
||||||
|
|
||||||
function getConfigName(requested, options) {
|
function getConfigName(requested, options) {
|
||||||
var name;
|
var name;
|
||||||
if (requested) {
|
if (requested && requested.workspacetype) {
|
||||||
name = requested;
|
name = requested.workspacetype;
|
||||||
|
if (name == "readonly" || name == "ro")
|
||||||
|
name = "default-ro";
|
||||||
|
else
|
||||||
|
name = "workspace-" + name;
|
||||||
}
|
}
|
||||||
else if (options.workspaceType) {
|
else if (options.workspaceType) {
|
||||||
name = "workspace-" + options.workspaceType;
|
name = "workspace-" + options.workspaceType;
|
||||||
|
@ -307,8 +306,8 @@ function getConfigName(requested, options) {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfig(requested, options) {
|
function getConfig(configName, options) {
|
||||||
var filename = __dirname + "/../../configs/client-" + getConfigName(requested, options) + ".js";
|
var filename = __dirname + "/../../configs/client-" + configName + ".js";
|
||||||
|
|
||||||
var installPath = options.settingDir || options.installPath || "";
|
var installPath = options.settingDir || options.installPath || "";
|
||||||
var workspaceDir = options.options.workspaceDir;
|
var workspaceDir = options.options.workspaceDir;
|
||||||
|
|
Ładowanie…
Reference in New Issue