Bug 639694 - Move EditModeToolbar from editorOverlay
authorIan Neal <iann_cvs@blueyonder.co.uk>
Fri, 11 Mar 2011 00:52:13 +0000
changeset 7320 25d7a188c85d603ec25a67d3bd15f049e5f670f1
parent 7319 83d38f9f13c6fe4672b1d0ff0b11776e0cb4b92b
child 7321 34e60fad24e71709f9d8f4eef519e41329b80b78
push idunknown
push userunknown
push dateunknown
bugs639694
Bug 639694 - Move EditModeToolbar from editorOverlay r=neil/standard8
editor/ui/composer/content/editor.xul
editor/ui/composer/content/editorOverlay.xul
editor/ui/locales/en-US/chrome/composer/editor.dtd
editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
mail/components/compose/content/editorOverlay.xul
--- a/editor/ui/composer/content/editor.xul
+++ b/editor/ui/composer/content/editor.xul
@@ -148,20 +148,41 @@
         <menupopup id="view_toolbars_popup"> 
           <menuitem id="viewComposerToolbar" label="&compositionToolbarCmd.label;" type="checkbox" accesskey="&compositionToolbarCmd.accesskey;" command="cmd_viewCompToolbar"  />
           <menuitem id="viewFormatToolbar"   label="&formattingToolbarCmd.label;"  type="checkbox" accesskey="&formattingToolbarCmd.accesskey;"  command="cmd_viewFormatToolbar" />
           <menuitem id="viewEditModeToolbar" label="&editmodeToolbarCmd.label;"    type="checkbox" accesskey="&editmodeToolbarCmd.accesskey;"    command="cmd_viewEditModeToolbar" />
           <menuitem id="menu_showTaskbar"/>
         </menupopup>
       </menu>
       <menuseparator id="viewSep1"/>
-      <menuitem id="viewNormalMode" checked="true"/>
-      <menuitem id="viewAllTagsMode"/>
-      <menuitem id="viewSourceMode"/>
-      <menuitem id="viewPreviewMode"/>
+      <menuitem id="viewNormalMode"
+                type="radio"
+                group="mode"
+                checked="true"
+                label="&NormalMode.label;"
+                accesskey="&NormalMode.accesskey;"
+                command="cmd_NormalMode"/>
+      <menuitem id="viewAllTagsMode"
+                type="radio"
+                group="mode"
+                label="&AllTagsMode.label;"
+                accesskey="&AllTagsMode.accesskey;"
+                command="cmd_AllTagsMode"/>
+      <menuitem id="viewSourceMode"
+                type="radio"
+                group="mode"
+                label="&HTMLSourceMode.label;"
+                accesskey="&HTMLSourceMode.accesskey;"
+                command="cmd_HTMLSourceMode"/>
+      <menuitem id="viewPreviewMode"
+                type="radio"
+                group="mode"
+                label="&PreviewMode.label;"
+                accesskey="&PreviewMode.accesskey;"
+                command="cmd_PreviewMode"/>
       <menuseparator id="viewSep2"/>
       <menu id = "composerCharsetMenu" />
     </menupopup>
     </menu>
  
     <menu id="insertMenu"/>
 
     <menu id="formatMenu" label="&formatMenu.label;" accesskey="&formatMenu.accesskey;">
@@ -290,23 +311,45 @@
                 context="editorContentContext" flex="1" tooltip="aHTMLTooltip"/>
       </stack>
       <vbox>
         <label id="doctype-text" crop="right"/>
         <editor type="content" id="content-source" context="editorSourceContext" flex="1"/>
       </vbox>
     </deck>
 
-    <hbox id="EditModeToolbar" align="center" hidden="false" persist="collapsed">
-      <tabs id="EditModeTabs" class="tabs-bottom" flex="1">
-        <tab id="NormalModeButton"/>
-        <tab id="TagModeButton"/>
-        <tab id="SourceModeButton"/>
-        <tab id="PreviewModeButton"/>
-    </tabs>
+    <!-- Edit Mode toolbar -->
+    <hbox id="EditModeToolbar"
+          persist="collapsed">
+      <tabs id="EditModeTabs"
+            class="tabs-bottom"
+            flex="1"
+            onselect="this.selectedItem.doCommand();">
+        <tab id="NormalModeButton"
+             class="tab-bottom edit-mode"
+             label="&NormalModeTab.label;"
+             tooltiptext="&NormalMode.tooltip;"
+             command="cmd_NormalMode"/>
+        <tab id="TagModeButton"
+             class="tab-bottom edit-mode"
+             label="&AllTagsModeTab.label;"
+             tooltiptext="&AllTagsMode.tooltip;"
+             command="cmd_AllTagsMode"/>
+        <tab id="SourceModeButton"
+             class="tab-bottom edit-mode"
+             label="&HTMLSourceModeTab.label;"
+             tooltiptext="&HTMLSourceMode.tooltip;"
+             dir="&HTMLSourceModeTab.dir;"
+             command="cmd_HTMLSourceMode"/>
+        <tab id="PreviewModeButton"
+             class="tab-bottom edit-mode"
+             label="&PreviewModeTab.label;"
+             tooltiptext="&PreviewMode.tooltip;"
+             command="cmd_PreviewMode"/>
+      </tabs>
     </hbox>
 
   </vbox> <!-- appcontent -->
 </hbox><!-- sidebar-parent -->
 
     <!-- Some of this is from globarOverlay.xul -->
     <statusbar class="chromeclass-status" id="status-bar">
       <statusbarpanel id="component-bar"/>
--- a/editor/ui/composer/content/editorOverlay.xul
+++ b/editor/ui/composer/content/editorOverlay.xul
@@ -146,20 +146,16 @@
     <command id="cmd_label"            oncommand="goDoCommand('cmd_label')"/>
     <command id="cmd_fieldset"         oncommand="goDoCommand('cmd_fieldset')"/>
     <command id="cmd_isindex"          oncommand="goDoCommand('cmd_isindex')"/>
     <command id="cmd_objectProperties" oncommand="goDoCommand('cmd_objectProperties')"/>
     <command id="cmd_insertChars"      oncommand="goDoCommand('cmd_insertChars')"    label="&insertCharsCmd.label;"/>
     <command id="cmd_insertHTMLWithDialog" oncommand="goDoCommand('cmd_insertHTMLWithDialog')"  label="&insertHTMLCmd.label;"/>
     <command id="cmd_insertBreak"      oncommand="goDoCommand('cmd_insertBreak')"/>
     <command id="cmd_insertBreakAll"   oncommand="goDoCommand('cmd_insertBreakAll')"/>
-    <command id="cmd_NormalMode"       oncommand="goDoCommand('cmd_NormalMode')"     label="&NormalMode.label;"/>
-    <command id="cmd_AllTagsMode"      oncommand="goDoCommand('cmd_AllTagsMode')"    label="&AllTagsMode.label;"/>
-    <command id="cmd_HTMLSourceMode"   oncommand="goDoCommand('cmd_HTMLSourceMode')"/>
-    <command id="cmd_PreviewMode"      oncommand="goDoCommand('cmd_PreviewMode')"    label="&PreviewMode.label;"/>
 
     <!-- only used in context popup menu -->
     <command id="cmd_editLink"         oncommand="goDoCommand('cmd_editLink')"/>
 
     <!-- dummy command used just to disable things in non-HTML modes -->
     <command id="cmd_renderedHTMLEnabler"/>
   </commandset>
   
@@ -437,38 +433,16 @@
                 accesskey="&enableInlineSpellChecker.accesskey;"
                 oncommand="InlineSpellCheckerUI.enabled = !InlineSpellCheckerUI.enabled"/>
       <menuseparator id="menu_prefsSep"/>
       <menuitem id="menu_preferences"     observes="cmd_preferences"/>
       <!-- Note: other Edit items (menu_validate, menu_publishSettings) are inserted from composerOverlay.xul -->
     </menupopup>
   </menu>
 
-  <menuitem id="viewNormalMode"
-            type="radio"
-            group="mode"
-            accesskey="&NormalMode.accesskey;"
-            observes="cmd_NormalMode"/>
-  <menuitem id="viewAllTagsMode"
-            type="radio"
-            group="mode"
-            accesskey="&AllTagsMode.accesskey;"
-            observes="cmd_AllTagsMode"/>
-  <menuitem id="viewSourceMode"
-            type="radio"
-            group="mode"
-            label="&HTMLSourceMode.label;"
-            accesskey="&HTMLSourceMode.accesskey;"
-            observes="cmd_HTMLSourceMode"/>
-  <menuitem id="viewPreviewMode"
-            type="radio"
-            group="mode"
-            accesskey="&PreviewMode.accesskey;"
-            observes="cmd_PreviewMode"/>
-
   <menupopup id = "composerCharsetMenuPopup"  onpopupshowing="updateCharsetPopupMenu(this)" />
 
   <!-- Insert menu -->
   <menu id="insertMenu"
         label="&insertMenu.label;"
         accesskey="&insertMenu.accesskey;">
     <menupopup id="insertMenuPopup">
       <menuitem id="insertImage"
@@ -1381,26 +1355,15 @@
                  class="formatting-button"
                  tooltiptext="&layerSendToBack.tooltip;"
                  observes="cmd_decreaseZIndex"/>
   <toolbarbutton id="increaseZIndexButton"
                  class="formatting-button"
                  tooltiptext="&layerBringToFront.tooltip;"
                  observes="cmd_increaseZIndex"/>
 
-  <!-- Edit Mode toolbar -->
-  <tabs id="EditModeTabs" onselect="this.selectedItem.doCommand()"/>
-  <tab id="NormalModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="1" label="&NormalModeTab.label;"  oncommand="goDoCommand('cmd_NormalMode');"
-          tooltiptext="&NormalMode.tooltip;"/>
-  <tab id="TagModeButton"      class="tab-bottom edit-mode _plain" type="text" selected="0" label="&AllTagsMode.label;"    oncommand="goDoCommand('cmd_AllTagsMode');"
-          tooltiptext="&AllTagsMode.tooltip;"/>
-  <tab id="SourceModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="0" label="&SourceMode.label;"     oncommand="goDoCommand('cmd_HTMLSourceMode');"
-          tooltiptext="&HTMLSourceMode.tooltip;" dir="&SourceTabDirection;"/>
-  <tab id="PreviewModeButton"  class="tab-bottom edit-mode _plain" type="text" selected="0" label="&PreviewMode.label;"    oncommand="goDoCommand('cmd_PreviewMode');"
-          tooltiptext="&PreviewMode.tooltip;"/>
-
   <!-- Paste as quotation is used by mail compose,
        but in composer it has to go in the debug menu
    -->
   <menuitem id="menu_pasteQuote" accesskey="&pasteAsQuotationCmd.accesskey;"
             command="cmd_pasteQuote" key="pastequotationkb"/>
 
 </overlay>
--- a/editor/ui/locales/en-US/chrome/composer/editor.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editor.dtd
@@ -53,8 +53,32 @@
 <!ENTITY formattingToolbarCmd.label "Format Toolbar">
 <!ENTITY formattingToolbarCmd.accesskey "F">
 <!ENTITY editmodeToolbarCmd.label "Edit Mode Toolbar">
 <!ENTITY editmodeToolbarCmd.accesskey "E">
 
 <!-- Format menu items -->
 <!ENTITY formatMenu.label "Format">
 <!ENTITY formatMenu.accesskey "o">
+
+<!-- Display Mode toolbar and View menu items -->
+<!ENTITY NormalModeTab.label "Normal">
+<!ENTITY NormalMode.label "Normal Edit Mode">
+<!ENTITY NormalMode.accesskey "N">
+<!ENTITY NormalMode.tooltip "Show table borders and named anchors">
+<!ENTITY AllTagsModeTab.label "HTML Tags">
+<!ENTITY AllTagsMode.label "HTML Tags">
+<!ENTITY AllTagsMode.accesskey "a">
+<!ENTITY AllTagsMode.tooltip "Display icons for all HTML tags">
+<!-- LOCALIZATION NOTE: (HTMLSourceModeTab.dir, HTMLSourceModeTab.label)
+     Do NOT translate text for 'HTMLSourceModeTab.dir', use latin "ltr" if
+     you want the <html> image to left of the 'HTMLSourceModeTab.label' text,
+     or use latin "rtl" if you want this image to the right of text. You do
+     not need to include HTML in the label 'HTMLSourceModeTab.label' -->
+<!ENTITY HTMLSourceModeTab.dir "ltr">
+<!ENTITY HTMLSourceModeTab.label "Source">
+<!ENTITY HTMLSourceMode.label "HTML Source">
+<!ENTITY HTMLSourceMode.accesskey "H">
+<!ENTITY HTMLSourceMode.tooltip "Edit HTML source">
+<!ENTITY PreviewModeTab.label "Preview">
+<!ENTITY PreviewMode.label "Preview">
+<!ENTITY PreviewMode.accesskey "P">
+<!ENTITY PreviewMode.tooltip "Display as WYSIWYG (as in the browser)">
--- a/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
+++ b/editor/ui/locales/en-US/chrome/composer/editorOverlay.dtd
@@ -446,42 +446,16 @@
 <!ENTITY indentToolbarCmd.tooltip "Indent text (move right)">
 <!ENTITY AlignPopupButton.tooltip "Choose text alignment">
 <!ENTITY InsertPopupButton.tooltip "Insert a Link, Anchor, Image, Horizontal Line, or Table">
 <!ENTITY alignLeftButton.tooltip "Align text along left margin">
 <!ENTITY alignCenterButton.tooltip "Align text centered">
 <!ENTITY alignRightButton.tooltip "Align text along right margin">
 <!ENTITY alignJustifyButton.tooltip "Align text along left and right margins">
 
-<!-- Display Mode toolbar and View menu items -->
-<!ENTITY NormalModeTab.label "Normal">
-<!ENTITY NormalMode.label "Normal Edit Mode">
-<!ENTITY NormalMode.accesskey "n">
-<!ENTITY NormalMode.tooltip "Show table borders and named anchors">
-<!ENTITY AllTagsMode.label "HTML Tags">
-<!ENTITY AllTagsMode.accesskey "A">
-<!ENTITY AllTagsMode.tooltip "Display icons for all HTML tags">
-
-<!ENTITY HTMLSourceMode.label "HTML Source">
-<!-- Toolbar has an image with "HTML" text, so don't include it in the string -->
-<!ENTITY SourceMode.label "Source">
-<!ENTITY HTMLSourceMode.accesskey "h">
-<!ENTITY HTMLSourceMode.tooltip "Edit HTML source">
-<!ENTITY PreviewMode.label "Preview">
-<!ENTITY PreviewMode.accesskey "p">
-<!ENTITY PreviewMode.tooltip "Display as WYSIWYG (as in the browser)">
-
-<!-- LOCALIZATION NOTE: Do NOT translate text for 'SourceTabDirection'
-     Use latin "ltr" if you want the <html> image to left of the 
-     'SourceMode.label' text defined above,
-     or use latin "rtl" if you want this image to the right of text
-     This is the value of the HTML 'dir' attribute
--->
-<!ENTITY SourceTabDirection "ltr">
-
 <!-- Structure Toolbar Context Menu items -->
 <!ENTITY structSelect.label         "Select">
 <!ENTITY structSelect.accesskey     "s">
 <!ENTITY structRemoveTag.label      "Remove tag">
 <!ENTITY structRemoveTag.accesskey  "r">
 <!ENTITY structChangeTag.label      "Change tag">
 <!ENTITY structChangeTag.accesskey  "c">
 
--- a/mail/components/compose/content/editorOverlay.xul
+++ b/mail/components/compose/content/editorOverlay.xul
@@ -113,20 +113,16 @@
     <command id="cmd_fieldset"         oncommand="goDoCommand('cmd_fieldset')"/>
     <command id="cmd_isindex"          oncommand="goDoCommand('cmd_isindex')"/>
     <command id="cmd_objectProperties" oncommand="goDoCommand('cmd_objectProperties')"/>
     <command id="cmd_insertChars"      oncommand="goDoCommand('cmd_insertChars')"    label="&insertCharsCmd.label;"/>
     <command id="cmd_insertHTMLWithDialog" oncommand="goDoCommand('cmd_insertHTMLWithDialog')"  label="&insertHTMLCmd.label;"/>
 
     <command id="cmd_insertBreak"      oncommand="goDoCommand('cmd_insertBreak')"/>
     <command id="cmd_insertBreakAll"   oncommand="goDoCommand('cmd_insertBreakAll')"/>
-    <command id="cmd_NormalMode"       oncommand="goDoCommand('cmd_NormalMode')"     label="&NormalMode.label;"/>
-    <command id="cmd_AllTagsMode"      oncommand="goDoCommand('cmd_AllTagsMode')"    label="&AllTagsMode.label;"/>
-    <command id="cmd_HTMLSourceMode"   oncommand="goDoCommand('cmd_HTMLSourceMode')"/>
-    <command id="cmd_PreviewMode"      oncommand="goDoCommand('cmd_PreviewMode')"    label="&PreviewMode.label;"/>
 
     <!-- only used in context popup menu -->
     <command id="cmd_editLink"         oncommand="goDoCommand('cmd_editLink')"/>
 
     <!-- dummy command used just to disable things in non-HTML modes -->
     <command id="cmd_renderedHTMLEnabler"/>
   </commandset>
   
@@ -1125,25 +1121,15 @@
   <toolbarbutton id="absolutePositionButton" type="checkbox" tooltiptext="&layer.tooltip;" observes="cmd_absPos">
     <observes element="cmd_absPos" attribute="state" onbroadcast="onStateButtonUpdate(this.parentNode, 'cmd_absPos', 'absolute')"/>
   </toolbarbutton>
   <toolbarbutton id="decreaseZIndexButton" observes="cmd_decreaseZIndex"
                  tooltiptext="&layerSendToBack.tooltip;"/>
   <toolbarbutton id="increaseZIndexButton" observes="cmd_increaseZIndex"
                  tooltiptext="&layerBringToFront.tooltip;"/>
 
-  <!-- Edit Mode toolbar -->
-  <tab id="NormalModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="1" label="&NormalModeTab.label;"  oncommand="goDoCommand('cmd_NormalMode');"
-          tooltiptext="&NormalMode.tooltip;"/>
-  <tab id="TagModeButton"      class="tab-bottom edit-mode _plain" type="text" selected="0" label="&AllTagsMode.label;"    oncommand="goDoCommand('cmd_AllTagsMode');"
-          tooltiptext="&AllTagsMode.tooltip;"/>
-  <tab id="SourceModeButton"   class="tab-bottom edit-mode _plain" type="text" selected="0" label="&SourceMode.label;"     oncommand="goDoCommand('cmd_HTMLSourceMode');"
-          tooltiptext="&HTMLSourceMode.tooltip;" dir="&SourceTabDirection;"/>
-  <tab id="PreviewModeButton"  class="tab-bottom edit-mode _plain" type="text" selected="0" label="&PreviewMode.label;"    oncommand="goDoCommand('cmd_PreviewMode');"
-          tooltiptext="&PreviewMode.tooltip;"/>
-
   <!-- Paste as quotation is used by mail compose,
        but in composer it has to go in the debug menu
    -->
   <menuitem id="menu_pasteQuote" accesskey="&pasteAsQuotationCmd.accesskey;"
             command="cmd_pasteQuote" key="pastequotationkb"/>
 
 </overlay>