kopia lustrzana https://github.com/c9/core
fix gce workspaces
rodzic
110724d95e
commit
8371d3f4e7
|
@ -1,7 +1,8 @@
|
||||||
/*global requirejs*/
|
/*global requirejs*/
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
main.consumes = [
|
main.consumes = [
|
||||||
"app", "ext", "c9", "Plugin", "proc", "fs", "vfs", "dialog.error"
|
"app", "ext", "c9", "Plugin", "proc", "fs", "vfs", "dialog.error",
|
||||||
|
"util"
|
||||||
];
|
];
|
||||||
main.provides = ["pluginManager", "plugin.manager", "plugin.debug"];
|
main.provides = ["pluginManager", "plugin.manager", "plugin.debug"];
|
||||||
return main;
|
return main;
|
||||||
|
@ -39,6 +40,18 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
var disabledPlugins = Object.create(null);
|
var disabledPlugins = Object.create(null);
|
||||||
var packages = Object.create(null);
|
var packages = Object.create(null);
|
||||||
|
|
||||||
|
function load() {
|
||||||
|
if (options.hasOwnProperty("loadFromDisk")) {
|
||||||
|
var loadDefaultPlugins = function() {
|
||||||
|
loadPackage(options.loadFromDisk, function(err) {
|
||||||
|
if (err) return showError(err);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
if (vfs.connected) loadDefaultPlugins();
|
||||||
|
vfs.once("connect", loadDefaultPlugins);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/***** Methods *****/
|
/***** Methods *****/
|
||||||
|
|
||||||
|
@ -325,6 +338,8 @@ define(function(require, exports, module) {
|
||||||
var err = new Error("Didn't provide " + id + "/" + options.packageName);
|
var err = new Error("Didn't provide " + id + "/" + options.packageName);
|
||||||
return addError("Error loading plugin", err);
|
return addError("Error loading plugin", err);
|
||||||
}
|
}
|
||||||
|
if (Array.isArray(json))
|
||||||
|
json = { plugins: json };
|
||||||
if (json.name && json.name != name)
|
if (json.name && json.name != name)
|
||||||
name = json.name;
|
name = json.name;
|
||||||
getPluginsFromPackage(json, callback);
|
getPluginsFromPackage(json, callback);
|
||||||
|
@ -680,6 +695,7 @@ define(function(require, exports, module) {
|
||||||
/***** Lifecycle *****/
|
/***** Lifecycle *****/
|
||||||
|
|
||||||
plugin.on("load", function() {
|
plugin.on("load", function() {
|
||||||
|
load();
|
||||||
});
|
});
|
||||||
plugin.on("unload", function() {
|
plugin.on("unload", function() {
|
||||||
disabledPlugins = null;
|
disabledPlugins = null;
|
||||||
|
|
Ładowanie…
Reference in New Issue