rem: CollapseItem("editMenu", false); CollapseItem("insertMenu", false); CollapseItem("formatMenu", false); CollapseItem("tableMenu", false);  SetViewMenuForHTMLSource(false);  DisableItem("findButton", false); DisableItem("spellingButton", false); DisableItem("imageButton", false); DisableItem("hlineButton", false); DisableItem("tableButton", false); DisableItem("linkButton", false); DisableItem("namedAnchorButton", false); 
add: DisableMenusForHTMLSource(false); 
context: function SetDisplayMode(mode){  if (gIsHTMLEditor)  {    // Already in requested mode:    //  return false to indicate we didn't switch    if (mode == gEditorDisplayMode)      return false;    gEditorDisplayMode = mode;    // Save the last non-source mode so we can cancel source editing easily    if (mode != DisplayModeSource)      PreviousNonSourceDisplayMode = mode;        // Editorshell does the style sheet loading/unloading    editorShell.SetDisplayMode(mode);    // Set the UI states    gPreviewModeButton.setAttribute("selected",Number(mode == DisplayModePreview));    gNormalModeButton.setAttribute("selected",Number(mode == DisplayModeNormal));    gTagModeButton.setAttribute("selected",Number(mode == DisplayModeAllTags));    gSourceModeButton.setAttribute("selected", Number(mode == DisplayModeSource));    if (mode == DisplayModeSource)    {      // Switch to the sourceWindow (second in the deck)      gContentWindowDeck.setAttribute("index","1");      // Hide menus that are completely disabled      // Note: ShowMenuItem is implemented in EditorContextMenu.js      CollapseItem("editMenu", true);      CollapseItem("insertMenu", true);      CollapseItem("formatMenu", true);      CollapseItem("tableMenu", true);      // Collapse allitems in the view menu except mode switch items      SetViewMenuForHTMLSource(true);      DisableItem("viewToolbar", true);      DisableItem("viewSep1", true);      DisableItem("viewSep1", true);      DisableItem("composerCharsetMenu", true);      DisableItem("findButton", true);      DisableItem("spellingButton", true);      DisableItem("imageButton", true);      DisableItem("hlineButton", true);      DisableItem("tableButton", true);      DisableItem("linkButton", true);      DisableItem("namedAnchorButton", true);      //Hide the formating toolbar if not already hidden      gFormatToolbarHidden = gFormatToolbar.getAttribute("hidden");      if (gFormatToolbarHidden != "true")      {        gFormatToolbar.setAttribute("hidden", "true");      }      gSourceContentWindow.focus();    }    else     {      // Switch to the normal editor (first in the deck)      gContentWindowDeck.setAttribute("index","0");      // Restore menus and toolbars      CollapseItem("editMenu", false);      CollapseItem("insertMenu", false);      CollapseItem("formatMenu", false);      CollapseItem("tableMenu", false);      SetViewMenuForHTMLSource(false);      DisableItem("findButton", false);      DisableItem("spellingButton", false);      DisableItem("imageButton", false);      DisableItem("hlineButton", false);      DisableItem("tableButton", false);      DisableItem("linkButton", false);      DisableItem("namedAnchorButton", false);      if (gFormatToolbarHidden != "true")      {dump("Switching back to visible toolbar. gFormatToolbarHidden = "+gFormatToolbarHidden+"\n");        gFormatToolbar.setAttribute("hidden", gFormatToolbarHidden);      }      window._content.focus();    }    return true;  }}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/030de906de67de8bf4262d3a3d3be61891b65c21/editor.js/buggy/editor/ui/composer/content/editor.js