kopia lustrzana https://github.com/c9/core
simplify pluginManager and cleanup
rodzic
ee1495074b
commit
7c18a7e598
|
@ -19,6 +19,7 @@ module.exports = function(options) {
|
||||||
options.workspaceDir = normalize(options.workspaceDir);
|
options.workspaceDir = normalize(options.workspaceDir);
|
||||||
options.installPath = normalize(options.installPath);
|
options.installPath = normalize(options.installPath);
|
||||||
options.home = normalize(options.home);
|
options.home = normalize(options.home);
|
||||||
|
options.sourceDir = options.sourceDir && normalize(options.sourceDir);
|
||||||
|
|
||||||
var workspaceDir = options.workspaceDir;
|
var workspaceDir = options.workspaceDir;
|
||||||
var debug = options.debug !== undefined ? options.debug : false;
|
var debug = options.debug !== undefined ? options.debug : false;
|
||||||
|
@ -63,7 +64,8 @@ module.exports = function(options) {
|
||||||
projectName: options.projectName || "Project",
|
projectName: options.projectName || "Project",
|
||||||
configName: options.configName,
|
configName: options.configName,
|
||||||
standalone: options.standalone,
|
standalone: options.standalone,
|
||||||
dashboardUrl: options.dashboardUrl
|
dashboardUrl: options.dashboardUrl,
|
||||||
|
sourceDir: options.sourceDir,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
packagePath: "plugins/c9.core/settings",
|
packagePath: "plugins/c9.core/settings",
|
||||||
|
|
|
@ -78,6 +78,9 @@ module.exports = function(config, optimist) {
|
||||||
if (argv.hosted)
|
if (argv.hosted)
|
||||||
config.client_config = "default-hosted";
|
config.client_config = "default-hosted";
|
||||||
|
|
||||||
|
if (!argv.hosted)
|
||||||
|
config.sourceDir = path.dirname(__dirname);
|
||||||
|
|
||||||
config.workspaceDir = baseProc;
|
config.workspaceDir = baseProc;
|
||||||
config.settingDir = argv["setting-path"];
|
config.settingDir = argv["setting-path"];
|
||||||
config.projectName = path.basename(baseProc);
|
config.projectName = path.basename(baseProc);
|
||||||
|
|
|
@ -80,17 +80,8 @@ define(function(require, exports, module) {
|
||||||
if (!plugin.registered)
|
if (!plugin.registered)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!ignoreDeps && getDependencies(plugin.name).length) {
|
if (!ignoreDeps && getDependents(plugin.name).length)
|
||||||
//@todo this should be moved to whoever is calling this.
|
|
||||||
// if (!silent)
|
|
||||||
// util.alert(
|
|
||||||
// "Could not disable extension",
|
|
||||||
// "Extension is still in use",
|
|
||||||
// "This extension cannot be disabled, because it is still in use by the following plugins:<br /><br />"
|
|
||||||
// + " - " + usedBy.join("<br /> - ")
|
|
||||||
// + "<br /><br /> Please disable those plugins first.");
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
if (!keep)
|
if (!keep)
|
||||||
plugins.splice(plugins.indexOf(plugin), 1);
|
plugins.splice(plugins.indexOf(plugin), 1);
|
||||||
|
@ -108,7 +99,7 @@ define(function(require, exports, module) {
|
||||||
emit("unregister", { plugin: plugin });
|
emit("unregister", { plugin: plugin });
|
||||||
}
|
}
|
||||||
|
|
||||||
function getDependencies(pluginName) {
|
function getDependents(pluginName) {
|
||||||
var usedBy = [];
|
var usedBy = [];
|
||||||
|
|
||||||
// Check for dependencies needing this plugin
|
// Check for dependencies needing this plugin
|
||||||
|
@ -284,7 +275,7 @@ define(function(require, exports, module) {
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
getDependencies: getDependencies,
|
getDependents: getDependents,
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
define(function(require, module, exports) {
|
define(function(require, module, exports) {
|
||||||
main.consumes = ["Plugin", "ui", "Document", "dialog.alert", "settings"];
|
main.consumes = ["Plugin", "ui", "Document", "dialog.alert"];
|
||||||
main.provides = ["Tab"];
|
main.provides = ["Tab"];
|
||||||
return main;
|
return main;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
define(function(require, exports, module) {
|
define(function(require, exports, module) {
|
||||||
main.consumes = [
|
main.consumes = [
|
||||||
"Plugin", "c9", "util", "settings", "ui", "layout", "findreplace",
|
"Plugin", "c9", "util", "settings", "ui", "layout",
|
||||||
"find", "anims", "menus", "tabManager", "commands", "tooltip",
|
"find", "anims", "menus", "tabManager", "commands", "tooltip",
|
||||||
"tree", "apf", "console", "preferences", "dialog.question",
|
"tree", "apf", "console", "preferences", "dialog.question",
|
||||||
"tree.favorites", "save"
|
"tree.favorites", "save"
|
||||||
|
@ -27,6 +27,7 @@ define(function(require, exports, module) {
|
||||||
var find = imports.find;
|
var find = imports.find;
|
||||||
var save = imports.save;
|
var save = imports.save;
|
||||||
var question = imports["dialog.question"].show;
|
var question = imports["dialog.question"].show;
|
||||||
|
var apf = imports.apf;
|
||||||
|
|
||||||
var markup = require("text!./findinfiles.xml");
|
var markup = require("text!./findinfiles.xml");
|
||||||
var lib = require("plugins/c9.ide.find.replace/libsearch");
|
var lib = require("plugins/c9.ide.find.replace/libsearch");
|
||||||
|
|
Plik diff jest za duży
Load Diff
|
@ -9,32 +9,6 @@ define(function(require, exports, module) {
|
||||||
oop.inherits(DataProvider, TreeData);
|
oop.inherits(DataProvider, TreeData);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
|
|
||||||
this.getChildren = function(node) {
|
|
||||||
var children = node.items;
|
|
||||||
var ch = children && children[0] && children[0];
|
|
||||||
if (ch) {
|
|
||||||
var d = (node.$depth + 1) || 0;
|
|
||||||
children.forEach(function(n) {
|
|
||||||
n.$depth = d;
|
|
||||||
n.parent = node;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.$sortNodes && !node.$sorted) {
|
|
||||||
children && this.sort(children);
|
|
||||||
}
|
|
||||||
return children;
|
|
||||||
};
|
|
||||||
|
|
||||||
// this.getRowIndent = function(p){
|
|
||||||
// return !p.className ? 2 : p.className == "package" ? 1 : 0;
|
|
||||||
// }
|
|
||||||
|
|
||||||
this.hasChildren = function(node) {
|
|
||||||
return node.items && node.items.length;
|
|
||||||
};
|
|
||||||
|
|
||||||
this.getCaptionHTML = function(node) {
|
this.getCaptionHTML = function(node) {
|
||||||
if (!node.name) return "";
|
if (!node.name) return "";
|
||||||
return node.name.replace(this.reKeyword, "<strong>$1</strong>");
|
return node.name.replace(this.reKeyword, "<strong>$1</strong>");
|
||||||
|
|
|
@ -4,3 +4,10 @@
|
||||||
.bk-window.dialog-updater .bk-win-footer {
|
.bk-window.dialog-updater .bk-win-footer {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
.serviceButton {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
.serviceButton:hover, .serviceButtonActive {
|
||||||
|
color: @preferences-intro-link-color;
|
||||||
|
text-decoration : underline;
|
||||||
|
}
|
|
@ -14,7 +14,7 @@
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
window.isLocalVersion = nRequire ? true : false;
|
window.isLocalVersion = nRequire ? true : false;
|
||||||
window.require = undefined;
|
window.require = window.module = undefined;
|
||||||
</script>
|
</script>
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
|
||||||
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
<link rel="icon" type="image/x-icon" href="favicon.ico" />
|
||||||
|
|
Ładowanie…
Reference in New Issue