kopia lustrzana https://github.com/c9/core
Merge remote-tracking branch 'origin/master' into newclient-dockerlike-deploy
rodzic
c8ed575dfd
commit
aa0001632a
|
@ -47,6 +47,7 @@ node_modules/kaefer/node_modules/
|
||||||
!node_modules/logicblox
|
!node_modules/logicblox
|
||||||
!node_modules/connect-architect
|
!node_modules/connect-architect
|
||||||
!node_modules/pty.js
|
!node_modules/pty.js
|
||||||
|
node_modules/pty.js/.npmignore
|
||||||
!node_modules/ui
|
!node_modules/ui
|
||||||
!node_modules/react-bootstrap
|
!node_modules/react-bootstrap
|
||||||
!node_modules/oldclient
|
!node_modules/oldclient
|
||||||
|
|
|
@ -1223,8 +1223,11 @@ define(function(require, exports, module) {
|
||||||
tabs.getTabs().forEach(function(tab) {
|
tabs.getTabs().forEach(function(tab) {
|
||||||
if (tab.editorType == "ace") {
|
if (tab.editorType == "ace") {
|
||||||
var c9Session = tab.document.getSession();
|
var c9Session = tab.document.getSession();
|
||||||
if (c9Session && c9Session.session)
|
if (c9Session && c9Session.session) {
|
||||||
detectSyntax(c9Session, tab.path);
|
var syntax = getSyntax(c9Session, tab.path);
|
||||||
|
if (syntax)
|
||||||
|
c9Session.setOption("syntax", syntax);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, 50);
|
}, 50);
|
||||||
|
@ -1239,6 +1242,7 @@ define(function(require, exports, module) {
|
||||||
modes.byCaption[opts.caption] = opts;
|
modes.byCaption[opts.caption] = opts;
|
||||||
modes.byName[name] = opts;
|
modes.byName[name] = opts;
|
||||||
|
|
||||||
|
opts.order = opts.order || 0;
|
||||||
if (!opts.extensions)
|
if (!opts.extensions)
|
||||||
opts.extensions = "";
|
opts.extensions = "";
|
||||||
|
|
||||||
|
|
|
@ -116,18 +116,19 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var config = [];
|
var config = [];
|
||||||
var count = list.length;
|
var loadConfig = function(){
|
||||||
|
architect.loadAdditionalPlugins(config, function(err){
|
||||||
function next(name){
|
if (err) console.error(err);
|
||||||
if (!name) {
|
});
|
||||||
if (--count === 0) finish();
|
};
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
async.each(list, function(name, next){
|
||||||
var resourceHolder = new Plugin();
|
var resourceHolder = new Plugin();
|
||||||
var resourceVersion = "";
|
var resourceVersion = "";
|
||||||
|
|
||||||
resourceHolder.on("load", function(){ load(); });
|
resourceHolder.on("load", function(){
|
||||||
|
if (inited) load();
|
||||||
|
});
|
||||||
|
|
||||||
resourceHolder.freezePublicAPI({
|
resourceHolder.freezePublicAPI({
|
||||||
get version(){ return resourceVersion },
|
get version(){ return resourceVersion },
|
||||||
|
@ -156,9 +157,11 @@ define(function(require, exports, module) {
|
||||||
var base = join(String(c9.projectId),
|
var base = join(String(c9.projectId),
|
||||||
"plugins", auth.accessToken);
|
"plugins", auth.accessToken);
|
||||||
|
|
||||||
|
// Configure Require.js
|
||||||
var pathConfig = {};
|
var pathConfig = {};
|
||||||
|
|
||||||
pathConfig["plugins/" + name] = host + join(base, name);
|
pathConfig["plugins/" + name] = host + join(base, name);
|
||||||
|
requirejs.config({ paths: pathConfig });
|
||||||
|
|
||||||
// Add the plugin to the config
|
// Add the plugin to the config
|
||||||
Object.keys(options.plugins).forEach(function(path){
|
Object.keys(options.plugins).forEach(function(path){
|
||||||
var pluginPath = name + "/" + path;
|
var pluginPath = name + "/" + path;
|
||||||
|
@ -173,8 +176,7 @@ define(function(require, exports, module) {
|
||||||
config.push(cfg);
|
config.push(cfg);
|
||||||
});
|
});
|
||||||
|
|
||||||
requirejs.config({paths: pathConfig});
|
// Set version for package manager
|
||||||
|
|
||||||
resourceHolder.version = options.version;
|
resourceHolder.version = options.version;
|
||||||
|
|
||||||
// Start the installer if one is included
|
// Start the installer if one is included
|
||||||
|
@ -226,30 +228,29 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
load();
|
|
||||||
}
|
|
||||||
|
|
||||||
function finish(){
|
load();
|
||||||
|
}, function(){
|
||||||
if (!config.length) return;
|
if (!config.length) return;
|
||||||
|
|
||||||
// Load config
|
// Load config
|
||||||
if (installer.sessions.length) {
|
if (installer.sessions.length) {
|
||||||
installer.on("stop", function(err){
|
installer.on("stop", function listen(err){
|
||||||
if (err)
|
if (err)
|
||||||
return console.error(err);
|
return console.error(err);
|
||||||
finish();
|
|
||||||
|
if (!installer.sessions.length) {
|
||||||
|
loadConfig();
|
||||||
|
installer.off("stop", listen);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
architect.loadAdditionalPlugins(config, function(err){
|
loadConfig();
|
||||||
if (err) console.error(err);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
list.forEach(next);
|
|
||||||
}
|
|
||||||
|
|
||||||
function processModules(path, data, plugin){
|
function processModules(path, data, plugin){
|
||||||
var parallel = [];
|
var parallel = [];
|
||||||
|
|
||||||
|
@ -326,10 +327,10 @@ define(function(require, exports, module) {
|
||||||
});
|
});
|
||||||
|
|
||||||
services.ace.defineSyntax({
|
services.ace.defineSyntax({
|
||||||
name: join(pluginName, "modes", path),
|
name: path,
|
||||||
caption: mode.caption,
|
caption: mode.caption,
|
||||||
extensions: (mode.extensions || "").trim()
|
extensions: (mode.extensions || "").trim()
|
||||||
.replace(/\s*,\s*/g, "|")
|
.replace(/\s*,\s*/g, "|").replace(/(^|\|)\./g, "$1")
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case "outline":
|
case "outline":
|
||||||
|
|
|
@ -57,8 +57,11 @@ define(function(require, exports, module) {
|
||||||
if (loadFromDisk) {
|
if (loadFromDisk) {
|
||||||
fs.readdir("~/.c9/plugins", function(error, files){
|
fs.readdir("~/.c9/plugins", function(error, files){
|
||||||
files.forEach(function(f) {
|
files.forEach(function(f) {
|
||||||
if (!/^[_.]/.test(f.name))
|
if (!/^[_.]/.test(f.name)) {
|
||||||
loadOne({packageName: f.name}, false);
|
fs.exists("~/.c9/plugins/" + f.name + "/__installed__.js", function(exists) {
|
||||||
|
if (exists) loadOne({packageName: f.name}, false);
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue