Code Viewer

./Classes/__script_menu.js File Size: 3.15 KB

  1. /*
  2. * -----
  3. * Screenshot Sender - __script_menu.js
  4. * -----
  5. * Menu creator for Screenshot Sender
  6. * -----
  7. */
  8.  
  9. var ScriptMenu = function () {
  10.         this.ScriptMenu = '';
  11. }
  12.  
  13. ScriptMenu.prototype = {
  14.         /*
  15.                 Name:   AddItem
  16.                 Purpose:        Add an item to the script menu
  17.                 Parameters:     sId - The id of the menu item
  18.                                         sLabel - The label of menu item
  19.                                         bEnabled - If the menu item will be enabled
  20.                 Return: None
  21.         */
  22.         "AddItem" : function (sId, sLabel, bEnabled) {
  23.                 if (typeof bEnabled === 'undefined') bEnabled = true;
  24.                 this.ScriptMenu += '<MenuEntry Id=\''+sId+'\' Enabled=\''+bEnabled+'\'>'+sLabel+'</MenuEntry>';
  25.         },
  26.        
  27.         /*
  28.                 Name:   AddSubMenu
  29.                 Purpose:        Add a submenu to the menu
  30.                 Parameters:     sLabel - Submenu label
  31.                                         bEnabled - If the submenu is enabled or not
  32.                 Return: None
  33.         */
  34.         "AddSubMenu" : function (sLabel, bEnabled) {
  35.                 if (typeof bEnabled === 'undefined') bEnabled = true;
  36.                 this.ScriptMenu += '<SubMenu Label=\''+sLabel+'\' Enabled=\''+bEnabled+'\'>';
  37.         },
  38.        
  39.         /*
  40.                 Name:   CloseSubMenu
  41.                 Purpose:        Close the currently open submenu
  42.                 Parameters:     None
  43.                 Return: None
  44.         */
  45.         "CloseSubMenu" : function () {
  46.                 this.ScriptMenu += '</SubMenu>';
  47.         },
  48.        
  49.         /*
  50.                 Name:   AddSeperator
  51.                 Purpose:        Creates a seperator in the menu
  52.                 Parameters:     None
  53.                 Return: None
  54.         */
  55.         "AddSeperator" : function () {
  56.                 this.ScriptMenu += '<Separator />';
  57.         },
  58.        
  59.         /*
  60.                 Name:   ExportMenu
  61.                 Purpose:        Export the xml formed menu
  62.                 Parameters:     None
  63.                 Return: The menu in xml form
  64.         */
  65.         "ExportMenu" : function () {
  66.                 return '<ScriptMenu>'+this.ScriptMenu+'</ScriptMenu>';
  67.         }
  68.                
  69. }

Version

  • 5.0.0070_20100325_publicbeta1

Developers

Project Details

  • Folders8
  • Files122
  • Total Lines11,867
  • Repository Version70

User Count

  • 162