simplify pluginManager and cleanup

pull/125/merge
nightwing 2017-02-13 00:04:05 +04:00
rodzic ee1495074b
commit 7c18a7e598
9 zmienionych plików z 830 dodań i 560 usunięć

Wyświetl plik

@ -19,6 +19,7 @@ module.exports = function(options) {
options.workspaceDir = normalize(options.workspaceDir);
options.installPath = normalize(options.installPath);
options.home = normalize(options.home);
options.sourceDir = options.sourceDir && normalize(options.sourceDir);
var workspaceDir = options.workspaceDir;
var debug = options.debug !== undefined ? options.debug : false;
@ -63,7 +64,8 @@ module.exports = function(options) {
projectName: options.projectName || "Project",
configName: options.configName,
standalone: options.standalone,
dashboardUrl: options.dashboardUrl
dashboardUrl: options.dashboardUrl,
sourceDir: options.sourceDir,
},
{
packagePath: "plugins/c9.core/settings",

Wyświetl plik

@ -78,6 +78,9 @@ module.exports = function(config, optimist) {
if (argv.hosted)
config.client_config = "default-hosted";
if (!argv.hosted)
config.sourceDir = path.dirname(__dirname);
config.workspaceDir = baseProc;
config.settingDir = argv["setting-path"];
config.projectName = path.basename(baseProc);
@ -88,7 +91,7 @@ module.exports = function(config, optimist) {
config.startBridge = startBridge;
if (testing && argv.k)
require("child_process").exec("tmux -L cloud91.9 kill-server", function(){});
require("child_process").exec("tmux -L cloud91.9 kill-server", function() {});
var isLocalhost = host == "localhost" || host == "127.0.0.1";
if (!/:/.test(argv.auth) && !isLocalhost) {

Wyświetl plik

@ -80,17 +80,8 @@ define(function(require, exports, module) {
if (!plugin.registered)
return;
if (!ignoreDeps && getDependencies(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.");
if (!ignoreDeps && getDependents(plugin.name).length)
return false;
}
if (!keep)
plugins.splice(plugins.indexOf(plugin), 1);
@ -108,7 +99,7 @@ define(function(require, exports, module) {
emit("unregister", { plugin: plugin });
}
function getDependencies(pluginName) {
function getDependents(pluginName) {
var usedBy = [];
// Check for dependencies needing this plugin
@ -284,7 +275,7 @@ define(function(require, exports, module) {
/**
*
*/
getDependencies: getDependencies,
getDependents: getDependents,
/**
*

Wyświetl plik

@ -1,5 +1,5 @@
define(function(require, module, exports) {
main.consumes = ["Plugin", "ui", "Document", "dialog.alert", "settings"];
main.consumes = ["Plugin", "ui", "Document", "dialog.alert"];
main.provides = ["Tab"];
return main;

Wyświetl plik

@ -1,6 +1,6 @@
define(function(require, exports, module) {
main.consumes = [
"Plugin", "c9", "util", "settings", "ui", "layout", "findreplace",
"Plugin", "c9", "util", "settings", "ui", "layout",
"find", "anims", "menus", "tabManager", "commands", "tooltip",
"tree", "apf", "console", "preferences", "dialog.question",
"tree.favorites", "save"
@ -27,6 +27,7 @@ define(function(require, exports, module) {
var find = imports.find;
var save = imports.save;
var question = imports["dialog.question"].show;
var apf = imports.apf;
var markup = require("text!./findinfiles.xml");
var lib = require("plugins/c9.ide.find.replace/libsearch");

Wyświetl plik

@ -9,32 +9,6 @@ define(function(require, exports, module) {
oop.inherits(DataProvider, TreeData);
(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) {
if (!node.name) return "";
return node.name.replace(this.reKeyword, "<strong>$1</strong>");

Wyświetl plik

@ -4,3 +4,10 @@
.bk-window.dialog-updater .bk-win-footer {
display: none;
}
.serviceButton {
cursor: default;
}
.serviceButton:hover, .serviceButtonActive {
color: @preferences-intro-link-color;
text-decoration : underline;
}

Wyświetl plik

@ -14,7 +14,7 @@
return obj;
}
window.isLocalVersion = nRequire ? true : false;
window.require = undefined;
window.require = window.module = undefined;
</script>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />