- Code: Select all
traceln("Start loading HideSettingsPlugin Plugin")
function HideSettingsPlugin(path) {
this.rootPath = path;
}
// chain HideSettingsPlugin with proper inheritance - classical in javascript
HideSettingsPlugin.prototype = new Plugin()
HideSettingsPlugin.prototype.constructor = HideSettingsPlugin;
HideSettingsPlugin.prototype.doBuildMenus = function() {
Menu.Top.$$Settings.visible = false;
}
HideSettingsPlugin.prototype.onPageKey = function(page, key)
{
if(page.markupFileName == "villa_home.xml" && !Menu.Top.$$Settings.visible && key == "23" && page.getParam("current_node_name") != "$$Settings" && page.getParam("root_node_name") == "") {
Menu.Top.$$Settings.visible = true;
page.redraw(true); // force redraw
}
}
// create our plugin with baseParg pointing to current script path
// global variables scriptName, scriptLocation and scriptFullPath are available, no need to do the following
HideSettingsPlugin.instance = new HideSettingsPlugin(scriptPath)
// register our plugin with Ext
Plugin.registerPlugin(HideSettingsPlugin.instance)
Edit 1: Pressing "Options" shows the Settings. Power Off -> On sequence, using remote, hide Settings.





