Disable new plugin menu item when not sdk=1

pull/39/head^2
Ruben Daniels 2015-03-11 16:29:50 +00:00
rodzic bc2af84013
commit 9c6188fd38
2 zmienionych plików z 15 dodań i 8 usunięć

Wyświetl plik

@ -353,6 +353,10 @@ define(function(require, module, exports) {
* @readonly * @readonly
*/ */
get aml(){ return aml; }, get aml(){ return aml; },
/**
* @property {HTMLElement} container
*/
get container(){ return aml.$ext; },
/** /**
* The area that this panel is a part of. * The area that this panel is a part of.

Wyświetl plik

@ -100,6 +100,7 @@ define(function(require, exports, module) {
// var emit = plugin.getEmitter(); // var emit = plugin.getEmitter();
var HASSDK = c9.location.indexOf("sdk=0") === -1; var HASSDK = c9.location.indexOf("sdk=0") === -1;
var ENABLED = c9.location.indexOf("sdk=1") > -1;
var model, datagrid, filterbox; var model, datagrid, filterbox;
var btnUninstall, btnReport, btnReadme, btnCloud9; var btnUninstall, btnReport, btnReadme, btnCloud9;
@ -122,14 +123,16 @@ define(function(require, exports, module) {
// updateCommandsFromSettings(); // updateCommandsFromSettings();
// }, plugin); // }, plugin);
menus.addItemByPath("File/New Plugin", null, 210, plugin); if (ENABLED) {
Object.keys(TEMPLATES).forEach(function(name){ menus.addItemByPath("File/New Plugin", null, 210, plugin);
menus.addItemByPath("File/New Plugin/" + TEMPLATES[name], new ui.item({ Object.keys(TEMPLATES).forEach(function(name){
onclick: function(){ menus.addItemByPath("File/New Plugin/" + TEMPLATES[name], new ui.item({
createNewPlugin(name); onclick: function(){
} createNewPlugin(name);
}), 210, plugin); }
}); }), 210, plugin);
});
}
} }
var drawn; var drawn;