rem: var previousMode = EditorDisplayMode; 
add: var previousMode = gEditorDisplayMode; 
context: function SetEditMode(mode){  if (gIsHTMLEditor)  {    var bodyNode = editorShell.editorDocument.getElementsByTagName("body").item(0);    if (!bodyNode)    {      dump("SetEditMode: We don't have a body node!\n");      return;    }    // Switch the UI mode before inserting contents    //   so user can't type in source window while new window is being filled    var previousMode = EditorDisplayMode;    if (!SetDisplayMode(mode))      return;    if (mode == DisplayModeSource)    {      // Get the current contents and output into the SourceWindow      if (bodyNode)      {        var childCount = bodyNode.childNodes.length;        if( childCount)        {          // KLUDGE until we have an output flag that strips out <body> and </body> for us          //var sourceContent = editorShell.GetContentsAs("text/html", gOutputBodyOnly);          //gSourceContentWindow.value = sourceContent.replace(/<body>/,"").replace(/<\/body>/,"");          gSourceContentWindow.value = editorShell.GetContentsAs("text/html", gOutputBodyOnly);          gSourceContentWindow.focus();          setTimeout("gSourceContentWindow.focus()", 10);          return;        }      }      // If we fall through, revert to previous node      SetDisplayMode(PreviousNonSourceDisplayMode);    }    else if (previousMode == DisplayModeSource)     {      // We are comming from edit source mode,      //   so transfer that back into the document      editorShell.SelectAll();      editorShell.InsertSource(gSourceContentWindow.value);      // Clear out the source editor buffer      gSourceContentWindow.value = "";      // reset selection to top of doc (wish we could preserve it!)      if (bodyNode)        editorShell.editorSelection.collapse(bodyNode, 0);      gContentWindow.focus();      setTimeout("gContentWindow.focus()", 10);    }  }}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/9a3e6237275e80d5e47235ea02622d2e8003692c/editor.js/clean/editor/ui/composer/content/editor.js