Show extra menu items only in "devel" mode

pull/223/head
Lennart Kats 2015-11-29 16:58:02 +00:00
rodzic 6d0801d590
commit 1c5f6c115e
2 zmienionych plików z 34 dodań i 32 usunięć

Wyświetl plik

@ -93,7 +93,7 @@ module.exports = function(options) {
{ {
packagePath: "plugins/c9.ide.plugins/manager", packagePath: "plugins/c9.ide.plugins/manager",
staticPrefix: staticPrefix + "/plugins/c9.ide.plugins", staticPrefix: staticPrefix + "/plugins/c9.ide.plugins",
defaultEnabled: devel devel: devel
}, },
{ {
packagePath: "plugins/c9.ide.plugins/debug" packagePath: "plugins/c9.ide.plugins/debug"

Wyświetl plik

@ -101,7 +101,7 @@ define(function(require, exports, module) {
var ENABLED = c9.location.indexOf("debug=2") > -1 var ENABLED = c9.location.indexOf("debug=2") > -1
|| experimental.addExperiment( || experimental.addExperiment(
"plugin-manager", "plugin-manager",
options.defaultEnabled, options.devel,
"SDK/Plugin Manager" "SDK/Plugin Manager"
); );
@ -136,37 +136,39 @@ define(function(require, exports, module) {
// updateCommandsFromSettings(); // updateCommandsFromSettings();
// }, plugin); // }, plugin);
commands.addCommand({
name: "reloadLastPlugin",
bindKey: {mac: "F4", win: "F4"},
hint: "reload plugin last reloaded in plugin manager",
exec: function() {
var name = getLastReloaded();
if (!name)
return commands.exec("reloadPlugin", null, { panel: plugin });
reload(name);
}
}, plugin);
commands.addCommand({ if (options.devel) {
name: "reloadPlugin", commands.addCommand({
group: "Plugins", name: "reloadLastPlugin",
exec: function(){ bindKey: {mac: "F4", win: "F4"},
commands.exec("openpreferences", null, { panel: plugin }); hint: "reload plugin last reloaded in plugin manager",
} exec: function() {
}, plugin); var name = getLastReloaded();
if (!name)
menus.addItemByPath("Tools/~", new ui.divider(), 100000, plugin); return commands.exec("reloadPlugin", null, { panel: plugin });
menus.addItemByPath("Tools/Developer", null, 100100, plugin); reload(name);
}
menus.addItemByPath("Tools/Developer/Reload Built-in Plugin...", new ui.item({ }, plugin);
command: "reloadPlugin" commands.addCommand({
}), 1100, plugin); name: "reloadPlugin",
group: "Plugins",
menus.addItemByPath("Tools/Developer/Reload Last Plugin", new ui.item({ exec: function(){
command: "reloadLastPlugin", commands.exec("openpreferences", null, { panel: plugin });
isAvailable: getLastReloaded }
}), 1200, plugin); }, plugin);
menus.addItemByPath("Tools/~", new ui.divider(), 100000, plugin);
menus.addItemByPath("Tools/Developer", null, 100100, plugin);
menus.addItemByPath("Tools/Developer/Reload Built-in Plugin...", new ui.item({
command: "reloadPlugin"
}), 1100, plugin);
menus.addItemByPath("Tools/Developer/Reload Last Plugin", new ui.item({
command: "reloadLastPlugin",
isAvailable: getLastReloaded
}), 1200, plugin);
}
menus.addItemByPath("File/New Plugin", null, 210, plugin); menus.addItemByPath("File/New Plugin", null, 210, plugin);
Object.keys(TEMPLATES).forEach(function(name){ Object.keys(TEMPLATES).forEach(function(name){