From a17f9d67dfb8669c37a894eafc46b8ed14817f77 Mon Sep 17 00:00:00 2001 From: "akkana%netscape.com" Date: Thu, 27 May 1999 22:21:48 +0000 Subject: [PATCH] Add plaintext editor as an option in browser and editor menus git-svn-id: svn://10.0.0.236/trunk@33014 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/EditorAppShell.xul | 5 +- .../ui/composer/content/EditorCommands.js | 40 ++- .../editor/ui/composer/content/Makefile.in | 1 + .../composer/content/TextEditorAppShell.xul | 283 ++++++++++++++++++ .../content/debugQATextEditorShell.xul | 283 ++++++++++++++++++ mozilla/xpfe/browser/src/navigator.js | 16 + mozilla/xpfe/browser/src/navigator.xul | 2 + 7 files changed, 627 insertions(+), 3 deletions(-) create mode 100644 mozilla/editor/ui/composer/content/TextEditorAppShell.xul create mode 100644 mozilla/suite/debugQA/content/debugQATextEditorShell.xul diff --git a/mozilla/editor/ui/composer/content/EditorAppShell.xul b/mozilla/editor/ui/composer/content/EditorAppShell.xul index 03e65b80016..0430ddd0059 100644 --- a/mozilla/editor/ui/composer/content/EditorAppShell.xul +++ b/mozilla/editor/ui/composer/content/EditorAppShell.xul @@ -20,7 +20,7 @@ + onload="EditorStartup('html')" onunload="EditorShutdown()" title="Editor"> @@ -122,6 +122,9 @@ + + + diff --git a/mozilla/editor/ui/composer/content/EditorCommands.js b/mozilla/editor/ui/composer/content/EditorCommands.js index a2027854d93..f9d64aff741 100644 --- a/mozilla/editor/ui/composer/content/EditorCommands.js +++ b/mozilla/editor/ui/composer/content/EditorCommands.js @@ -6,7 +6,7 @@ var editorName = "EditorAppCore" + ( new Date() ).getTime().toString(); var appCore = null; var toolbar; -function EditorStartup() +function EditorStartup(editorType) { dump("Doing Startup...\n"); @@ -24,7 +24,7 @@ function EditorStartup() appCore.setWebShellWindow(window); appCore.setToolbarWindow(window) - appCore.setEditorType("html"); + appCore.setEditorType(editorType); appCore.setContentWindow( window.frames[0] ); // Get url for editor content @@ -90,6 +90,42 @@ function EditorOpen() } } +function EditorNewPlaintext() +{ + dump("In EditorNewPlaintext..\n"); + + core = XPAppCoresManager.Find("toolkitCore"); + if ( !core ) { + core = new ToolkitCore(); + if ( core ) { + core.Init("toolkitCore"); + } + } + if ( core ) { + core.ShowWindowWithArgs( "chrome://editor/content/TextEditorAppShell.xul", window, "chrome://editor/content/EditorInitPagePlain.html" ); + } else { + dump("Error; can't create toolkitCore\n"); + } +} + +function EditorNewBrowser() +{ + dump("In EditorNewPlaintext..\n"); + + core = XPAppCoresManager.Find("toolkitCore"); + if ( !core ) { + core = new ToolkitCore(); + if ( core ) { + core.Init("toolkitCore"); + } + } + if ( core ) { + core.ShowWindowWithArgs( "chrome://navigator/", window, "" ); + } else { + dump("Error; can't create toolkitCore\n"); + } +} + function EditorSave() { dump("In EditorSave...\n"); diff --git a/mozilla/editor/ui/composer/content/Makefile.in b/mozilla/editor/ui/composer/content/Makefile.in index 17146f28812..a17ba8007d0 100644 --- a/mozilla/editor/ui/composer/content/Makefile.in +++ b/mozilla/editor/ui/composer/content/Makefile.in @@ -29,6 +29,7 @@ include $(topsrcdir)/config/rules.mk EXPORT_RESOURCE_CONTENT = \ $(srcdir)/EditorAppShell.xul \ $(srcdir)/EditorCommands.js \ + $(srcdir)/TextEditorAppShell.xul \ $(srcdir)/EditorInitPage.html \ $(srcdir)/EditorInitPagePlain.html \ $(NULL) diff --git a/mozilla/editor/ui/composer/content/TextEditorAppShell.xul b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul new file mode 100644 index 00000000000..893823dceda --- /dev/null +++ b/mozilla/editor/ui/composer/content/TextEditorAppShell.xul @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//-- Bug? If any other popups placed after this, they don't get used + + + + + + + + + + + diff --git a/mozilla/suite/debugQA/content/debugQATextEditorShell.xul b/mozilla/suite/debugQA/content/debugQATextEditorShell.xul new file mode 100644 index 00000000000..893823dceda --- /dev/null +++ b/mozilla/suite/debugQA/content/debugQATextEditorShell.xul @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + +]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +//-- Bug? If any other popups placed after this, they don't get used + + + + + + + + + + + diff --git a/mozilla/xpfe/browser/src/navigator.js b/mozilla/xpfe/browser/src/navigator.js index 32b38347886..e7cba406004 100644 --- a/mozilla/xpfe/browser/src/navigator.js +++ b/mozilla/xpfe/browser/src/navigator.js @@ -272,6 +272,22 @@ } } + function BrowserNewTextEditorWindow() + { + core = XPAppCoresManager.Find("toolkitCore"); + if ( !core ) { + core = new ToolkitCore(); + if ( core ) { + core.Init("toolkitCore"); + } + } + if ( core ) { + core.ShowWindowWithArgs( "chrome://editor/content/TextEditorAppShell.xul", window, "chrome://editor/content/EditorInitPagePlain.html" ); + } else { + dump("Error; can't create toolkitCore\n"); + } + } + function BrowserEditPage(url) { core = XPAppCoresManager.Find("toolkitCore"); diff --git a/mozilla/xpfe/browser/src/navigator.xul b/mozilla/xpfe/browser/src/navigator.xul index 11b8df59f5d..6f1ff3776f9 100644 --- a/mozilla/xpfe/browser/src/navigator.xul +++ b/mozilla/xpfe/browser/src/navigator.xul @@ -137,6 +137,7 @@ + @@ -468,6 +469,7 @@ +