/*
* -----
* Screenshot Sender - __script_menu.js
* -----
* Menu creator for Screenshot Sender
* -----
*/
var ScriptMenu = function () {
this.ScriptMenu = '';
}
ScriptMenu.prototype = {
/*
Name: AddItem
Purpose: Add an item to the script menu
Parameters: sId - The id of the menu item
sLabel - The label of menu item
bEnabled - If the menu item will be enabled
Return: None
*/
"AddItem" : function (sId, sLabel, bEnabled) {
if (typeof bEnabled === 'undefined') bEnabled = true;
this.ScriptMenu += '<MenuEntry Id=\''+sId+'\' Enabled=\''+bEnabled+'\'>'+sLabel+'</MenuEntry>';
},
/*
Name: AddSubMenu
Purpose: Add a submenu to the menu
Parameters: sLabel - Submenu label
bEnabled - If the submenu is enabled or not
Return: None
*/
"AddSubMenu" : function (sLabel, bEnabled) {
if (typeof bEnabled === 'undefined') bEnabled = true;
this.ScriptMenu += '<SubMenu Label=\''+sLabel+'\' Enabled=\''+bEnabled+'\'>';
},
/*
Name: CloseSubMenu
Purpose: Close the currently open submenu
Parameters: None
Return: None
*/
"CloseSubMenu" : function () {
this.ScriptMenu += '</SubMenu>';
},
/*
Name: AddSeperator
Purpose: Creates a seperator in the menu
Parameters: None
Return: None
*/
"AddSeperator" : function () {
this.ScriptMenu += '<Separator />';
},
/*
Name: ExportMenu
Purpose: Export the xml formed menu
Parameters: None
Return: The menu in xml form
*/
"ExportMenu" : function () {
return '<ScriptMenu>'+this.ScriptMenu+'</ScriptMenu>';
}
}