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",
staticPrefix: staticPrefix + "/plugins/c9.ide.plugins",
defaultEnabled: devel
devel: devel
},
{
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
|| experimental.addExperiment(
"plugin-manager",
options.defaultEnabled,
options.devel,
"SDK/Plugin Manager"
);
@ -136,37 +136,39 @@ define(function(require, exports, module) {
// updateCommandsFromSettings();
// }, 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({
name: "reloadPlugin",
group: "Plugins",
exec: function(){
commands.exec("openpreferences", null, { panel: 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);
if (options.devel) {
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({
name: "reloadPlugin",
group: "Plugins",
exec: function(){
commands.exec("openpreferences", null, { panel: 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);
Object.keys(TEMPLATES).forEach(function(name){