From 28dc46ae746d3f31807f027713a49035e6a10eae Mon Sep 17 00:00:00 2001 From: "cmanske%netscape.com" Date: Fri, 11 Aug 2000 03:20:47 +0000 Subject: [PATCH] More editor UI bug fixes: 47653, 47688, 47693, 47687. r=sfraser git-svn-id: svn://10.0.0.236/trunk@76083 18797224-902f-48f8-a5cc-f745e15eee43 --- .../ui/composer/content/ComposerCommands.js | 1 - mozilla/editor/ui/composer/content/editor.js | 81 +++------- mozilla/editor/ui/composer/content/editor.xul | 2 +- .../ui/composer/locale/en-US/editor.dtd | 2 +- .../composer/locale/en-US/pref-composer.dtd | 4 +- .../ui/dialogs/content/EdDialogCommon.js | 2 +- .../ui/dialogs/content/EdInsertTable.js | 17 ++- .../ui/dialogs/content/EdInsertTable.xul | 4 +- .../editor/ui/dialogs/content/EdLinkProps.js | 34 +++-- .../editor/ui/dialogs/content/EdLinkProps.xul | 6 +- .../ui/dialogs/content/EdNamedAnchorProps.js | 17 ++- .../ui/dialogs/content/EdNamedAnchorProps.xul | 4 +- .../editor/ui/dialogs/content/EdPageProps.js | 10 +- .../editor/ui/dialogs/content/EdTableProps.js | 141 +++++++----------- .../ui/dialogs/content/EdTableProps.xul | 12 +- .../locale/en-US/EdNamedAnchorProperties.dtd | 1 - .../locale/en-US/EditorColorProperties.dtd | 2 +- .../locale/en-US/EditorLinkProperties.dtd | 3 +- .../locale/en-US/EditorPageProperties.dtd | 2 +- .../locale/en-US/EditorSaveAsCharset.dtd | 2 +- .../locale/en-US/EditorTableProperties.dtd | 5 +- 21 files changed, 167 insertions(+), 185 deletions(-) diff --git a/mozilla/editor/ui/composer/content/ComposerCommands.js b/mozilla/editor/ui/composer/content/ComposerCommands.js index 660ed7956a9..c9b4f57c1eb 100644 --- a/mozilla/editor/ui/composer/content/ComposerCommands.js +++ b/mozilla/editor/ui/composer/content/ComposerCommands.js @@ -725,7 +725,6 @@ var nsObjectPropertiesCommand = element.nodeName == "table" || element.nodeName == "td" || element.nodeName == "a")) -// window.editorShell.GetSelectedElement("href"))); } return false; }, diff --git a/mozilla/editor/ui/composer/content/editor.js b/mozilla/editor/ui/composer/content/editor.js index 12dc583fea8..55a0736a913 100644 --- a/mozilla/editor/ui/composer/content/editor.js +++ b/mozilla/editor/ui/composer/content/editor.js @@ -893,28 +893,7 @@ function SetDisplayMode(mode) // 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); + DisableMenusForHTMLSource(true); //Hide the formating toolbar if not already hidden gFormatToolbarHidden = gFormatToolbar.getAttribute("hidden"); @@ -931,20 +910,7 @@ function SetDisplayMode(mode) 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); + DisableMenusForHTMLSource(false); if (gFormatToolbarHidden != "true") { @@ -959,8 +925,28 @@ dump("Switching back to visible toolbar. gFormatToolbarHidden = "+gFormatToolbar } // We disable all items in View menu except Edit mode and sidebar items -function SetViewMenuForHTMLSource(disable) +function DisableMenusForHTMLSource(disable) { + // Disable toolbar buttons + DisableItem("findButton", disable); + DisableItem("spellingButton", disable); + DisableItem("imageButton", disable); + DisableItem("hlineButton", disable); + DisableItem("tableButton", disable); + DisableItem("linkButton", disable); + DisableItem("namedAnchorButton", disable); + + // Top-level menus that we completely hide + CollapseItem("insertMenu", disable); + CollapseItem("formatMenu", disable); + CollapseItem("tableMenu", disable); + + // Edit menu items + DisableItem("menu_find", disable); + DisableItem("menu_findnext", disable); + DisableItem("menu_checkspelling", disable); + + // Disable all items in the view menu except mode switch items var viewMenu = document.getElementById("viewMenu"); // menuitems are children of the menupopup child var children = viewMenu.firstChild.childNodes; @@ -978,27 +964,6 @@ function SetViewMenuForHTMLSource(disable) } } -function DisableMenuItem(id, disable) -{ -dump("DisableMenuItem: item id="+id+": "+disable+"\n"); - var item = document.getElementById(id); - if (item) - { - if(disable != (item.getAttribute("disabled") == true)) - { - if (disable) - item.setAttribute("disabled", disable); - else - { -dump("Remove disable\n"); - item.removeAttribute("disabled"); - } - } - } - else - dump("DisableMenuItem: item id="+id+" not found\n"); -} - function EditorToggleParagraphMarks() { var menuItem = document.getElementById("viewParagraphMarks"); diff --git a/mozilla/editor/ui/composer/content/editor.xul b/mozilla/editor/ui/composer/content/editor.xul index e6170ff9d52..661f2580d62 100644 --- a/mozilla/editor/ui/composer/content/editor.xul +++ b/mozilla/editor/ui/composer/content/editor.xul @@ -154,7 +154,7 @@