From 43cde2aaedfda1c975e50e0dce25f849445bb566 Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Wed, 28 Mar 2001 21:16:44 +0000 Subject: [PATCH] Fixed plaintext editor bugs 69536, 69540, 69544, 69547, 73674, 71702. r=brade, sr=kin git-svn-id: svn://10.0.0.236/trunk@90680 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/ComposerCommands.js | 19 +- .../composer/content/TextEditorAppShell.xul | 112 ++++++----- mozilla/editor/ui/composer/content/editor.js | 178 ++++++++++-------- mozilla/editor/ui/composer/content/editor.xul | 6 +- .../ui/composer/content/editorOverlay.xul | 9 +- 5 files changed, 196 insertions(+), 128 deletions(-) diff --git a/mozilla/editor/ui/composer/content/ComposerCommands.js b/mozilla/editor/ui/composer/content/ComposerCommands.js index 142bc9c39e7..cfa0ababbce 100644 --- a/mozilla/editor/ui/composer/content/ComposerCommands.js +++ b/mozilla/editor/ui/composer/content/ComposerCommands.js @@ -190,9 +190,7 @@ function GetEditorController() if (!interfaceRequestor) continue; commandManager = interfaceRequestor.getInterface(Components.interfaces.nsIControllerCommandManager); - } catch(ex) { - dump("failed to get command manager number "+i+"\n"); - } + } catch(ex) {} if (commandManager) return commandManager; @@ -296,7 +294,9 @@ var nsSaveCommand = { FinishHTMLSource(); // In editor.js var doSaveAs = window.editorShell.editorDocument.location == "about:blank"; - return window.editorShell.saveDocument(doSaveAs, false, "text/html"); + var result = window.editorShell.saveDocument(doSaveAs, false, window.gDefaultSaveMimeType); + window._content.focus(); + return result; } return false; } @@ -314,7 +314,9 @@ var nsSaveAsCommand = if (window.editorShell) { FinishHTMLSource(); - return window.editorShell.saveDocument(true, false, "text/html"); + var result = window.editorShell.saveDocument(true, false, window.gDefaultSaveMimeType); + window._content.focus(); + return result; } return false; } @@ -332,7 +334,9 @@ var nsExportToTextCommand = if (window.editorShell) { FinishHTMLSource(); - return window.editorShell.saveDocument(true, true, "text/plain"); + var result = window.editorShell.saveDocument(true, true, "text/plain"); + window._content.focus(); + return result; } return false; } @@ -351,7 +355,7 @@ var nsSaveAsCharsetCommand = window.openDialog("chrome://editor/content/EditorSaveAsCharset.xul","_blank", "chrome,close,titlebar,modal") if (window.ok) { - window.ok = window.editorShell.saveDocument(true, false, "text/html"); + window.ok = window.editorShell.saveDocument(true, false, window.gDefaultSaveMimeType); } window._content.focus(); return window.ok; @@ -800,6 +804,7 @@ var nsPagePropertiesCommand = doCommand: function(aCommand) { window.openDialog("chrome://editor/content/EdPageProps.xul","_blank", "chrome,close,titlebar,modal", ""); + window._content.focus(); } }; diff --git a/mozilla/editor/ui/composer/content/TextEditorAppShell.xul b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul index 68717b7a4ee..7b8b25e18b2 100644 --- a/mozilla/editor/ui/composer/content/TextEditorAppShell.xul +++ b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul @@ -24,10 +24,13 @@ --> + + - + + @@ -36,39 +39,52 @@ xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" onload="TextEditorOnLoad()" onunload="EditorShutdown()" - title="Plaintext Editor" + onclose="return EditorCanClose()" + onfocus="EditorOnFocus()" + contenttitlesettting="true" + title="" titlemodifier="&textEditorWindow.titlemodifier;" titlemenuseparator="&editorWindow.titlemodifiermenuseparator;" windowtype="composer:text" align="vertical" width="640" height="480" screenX="10" screenY="10" - persist="screenX screenY width height" + persist="screenX screenY width height sizemode" >