Attachment #8675414: Part 3: Changed behaviour of font size increase/decrease buttons (v1b) for bug #769604

View | Details | Raw Unified | Return to bug 769604
Collapse All | Expand All

(-)a/editor/ui/composer/content/ComposerCommands.js (-2 / +121 lines)
Line     Link Here 
 Lines 22-37   function SetupHTMLEditorCommands() Link Here 
22
22
23
  commandTable.registerCommand("cmd_renderedHTMLEnabler", nsDummyHTMLCommand);
23
  commandTable.registerCommand("cmd_renderedHTMLEnabler", nsDummyHTMLCommand);
24
24
25
  commandTable.registerCommand("cmd_grid",  nsGridCommand);
25
  commandTable.registerCommand("cmd_grid",  nsGridCommand);
26
26
27
  commandTable.registerCommand("cmd_listProperties",  nsListPropertiesCommand);
27
  commandTable.registerCommand("cmd_listProperties",  nsListPropertiesCommand);
28
  commandTable.registerCommand("cmd_pageProperties",  nsPagePropertiesCommand);
28
  commandTable.registerCommand("cmd_pageProperties",  nsPagePropertiesCommand);
29
  commandTable.registerCommand("cmd_colorProperties", nsColorPropertiesCommand);
29
  commandTable.registerCommand("cmd_colorProperties", nsColorPropertiesCommand);
30
  commandTable.registerCommand("cmd_increaseFontStep", nsIncreaseFontCommand);
31
  commandTable.registerCommand("cmd_decreaseFontStep", nsDecreaseFontCommand);
30
  commandTable.registerCommand("cmd_advancedProperties", nsAdvancedPropertiesCommand);
32
  commandTable.registerCommand("cmd_advancedProperties", nsAdvancedPropertiesCommand);
31
  commandTable.registerCommand("cmd_objectProperties",   nsObjectPropertiesCommand);
33
  commandTable.registerCommand("cmd_objectProperties",   nsObjectPropertiesCommand);
32
  commandTable.registerCommand("cmd_removeNamedAnchors", nsRemoveNamedAnchorsCommand);
34
  commandTable.registerCommand("cmd_removeNamedAnchors", nsRemoveNamedAnchorsCommand);
33
  commandTable.registerCommand("cmd_editLink",        nsEditLinkCommand);
35
  commandTable.registerCommand("cmd_editLink",        nsEditLinkCommand);
34
36
35
  commandTable.registerCommand("cmd_form",          nsFormCommand);
37
  commandTable.registerCommand("cmd_form",          nsFormCommand);
36
  commandTable.registerCommand("cmd_inputtag",      nsInputTagCommand);
38
  commandTable.registerCommand("cmd_inputtag",      nsInputTagCommand);
37
  commandTable.registerCommand("cmd_inputimage",    nsInputImageCommand);
39
  commandTable.registerCommand("cmd_inputimage",    nsInputImageCommand);
 Lines 256-273   function goUpdateCommandState(command) Link Here 
256
      case "cmd_absPos":
258
      case "cmd_absPos":
257
        pokeMultiStateUI(command, params);
259
        pokeMultiStateUI(command, params);
258
        break;
260
        break;
259
261
260
      case "cmd_decreaseZIndex":
262
      case "cmd_decreaseZIndex":
261
      case "cmd_increaseZIndex":
263
      case "cmd_increaseZIndex":
262
      case "cmd_indent":
264
      case "cmd_indent":
263
      case "cmd_outdent":
265
      case "cmd_outdent":
264
      case "cmd_increaseFont":
266
      case "cmd_increaseFontStep":
265
      case "cmd_decreaseFont":
267
      case "cmd_decreaseFontStep":
266
      case "cmd_removeStyles":
268
      case "cmd_removeStyles":
267
      case "cmd_smiley":
269
      case "cmd_smiley":
268
        break;
270
        break;
269
271
270
      default: dump("no update for command: " +command+"\n");
272
      default: dump("no update for command: " +command+"\n");
271
    }
273
    }
272
  }
274
  }
273
  catch (e) { dump("An error occurred updating the "+command+" command: \n"+e+"\n"); }
275
  catch (e) { dump("An error occurred updating the "+command+" command: \n"+e+"\n"); }
 Lines 3096-3111   var nsColorPropertiesCommand = Link Here 
3096
  doCommand: function(aCommand)
3098
  doCommand: function(aCommand)
3097
  {
3099
  {
3098
    window.openDialog("chrome://editor/content/EdColorProps.xul","_blank", "chrome,close,titlebar,modal", "");
3100
    window.openDialog("chrome://editor/content/EdColorProps.xul","_blank", "chrome,close,titlebar,modal", "");
3099
    UpdateDefaultColors();
3101
    UpdateDefaultColors();
3100
  }
3102
  }
3101
};
3103
};
3102
3104
3103
//-----------------------------------------------------------------------------------
3105
//-----------------------------------------------------------------------------------
3106
// Helper function
3107
3108
function getFontSizeIndex()
3109
{
3110
  var firstHas = { value: false };
3111
  var anyHas = { value: false };
3112
  var allHas = { value: false };
3113
  var sizeWasFound = false;
3114
3115
  var fontSize = EditorGetTextProperty("font", "size", null, firstHas, anyHas, allHas);
3116
  var setIndex = -1;
3117
3118
  if (allHas.value)
3119
  {
3120
    switch (fontSize)
3121
    {
3122
    case "-3":
3123
    case "-2":
3124
    case "0":
3125
    case "1":
3126
      // x-small.
3127
      setIndex = 0;
3128
      break;
3129
    case "-1":
3130
    case "2":
3131
      // small.
3132
      setIndex = 1;
3133
      break;
3134
    case "3":
3135
      // medium.
3136
      setIndex = 2;
3137
      break;
3138
    case "+1":
3139
    case "4":
3140
      // large.
3141
      setIndex = 3;
3142
      break;
3143
    case "+2":
3144
    case "5":
3145
      // x-large.
3146
      setIndex = 4;
3147
      break;
3148
    case "+3":
3149
    case "+4":
3150
    case "6":
3151
    case "7":
3152
      // xx-large.
3153
      setIndex = 5;
3154
    }
3155
  }
3156
3157
  sizeWasFound = anyHas.value || (setIndex >= 0);
3158
3159
  // If the element has no size attribute and no size was found at all,
3160
  // we assume "medium" size. This is highly problematic since
3161
  // CSS sizes are not recognised and will show as "medium" as well.
3162
  // Currently we can't distinguish between "no attribute" which
3163
  // can imply "medium" and "CSS attribute present" which should not
3164
  // imply "medium".
3165
  if (!sizeWasFound)
3166
    setIndex = 2;
3167
3168
  return setIndex;
3169
}
3170
//-----------------------------------------------------------------------------------
3171
var nsIncreaseFontCommand =
3172
{
3173
  isCommandEnabled: function(aCommand, dummy)
3174
  {
3175
    var enabled = (IsDocumentEditable() && IsEditingRenderedHTML());
3176
    if (!enabled)
3177
      return false;
3178
3179
    var setIndex = getFontSizeIndex();
3180
    return (setIndex >= 0 && setIndex < 5);
3181
  },
3182
3183
  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
3184
  doCommandParams: function(aCommand, aParams, aRefCon) {},
3185
3186
  doCommand: function(aCommand)
3187
  {
3188
    var setIndex = getFontSizeIndex();
3189
    if (setIndex < 0 || setIndex >= 5)
3190
      return;
3191
    var sizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' ];
3192
    EditorSetFontSize(sizes[setIndex+1]);
3193
  }
3194
};
3195
3196
//-----------------------------------------------------------------------------------
3197
var nsDecreaseFontCommand =
3198
{
3199
  isCommandEnabled: function(aCommand, dummy)
3200
  {
3201
    var enabled = (IsDocumentEditable() && IsEditingRenderedHTML());
3202
    if (!enabled)
3203
      return false;
3204
3205
    var setIndex = getFontSizeIndex();
3206
    return (setIndex > 0);
3207
  },
3208
3209
  getCommandStateParams: function(aCommand, aParams, aRefCon) {},
3210
  doCommandParams: function(aCommand, aParams, aRefCon) {},
3211
3212
  doCommand: function(aCommand)
3213
  {
3214
    var setIndex = getFontSizeIndex();
3215
    if (setIndex <= 0)
3216
      return;
3217
    var sizes = ['x-small', 'small', 'medium', 'large', 'x-large', 'xx-large' ];
3218
    EditorSetFontSize(sizes[setIndex-1]);
3219
  }
3220
};
3221
3222
//-----------------------------------------------------------------------------------
3104
var nsRemoveNamedAnchorsCommand =
3223
var nsRemoveNamedAnchorsCommand =
3105
{
3224
{
3106
  isCommandEnabled: function(aCommand, dummy)
3225
  isCommandEnabled: function(aCommand, dummy)
3107
  {
3226
  {
3108
    // We could see if there's any link in selection, but it doesn't seem worth the work!
3227
    // We could see if there's any link in selection, but it doesn't seem worth the work!
3109
    return (IsDocumentEditable() && IsEditingRenderedHTML());
3228
    return (IsDocumentEditable() && IsEditingRenderedHTML());
3110
  },
3229
  },
3111
3230
(-)a/editor/ui/composer/content/editor.js (-56 / +2 lines)
Line     Link Here 
 Lines 971-987   function initFontSizeMenu(menuPopup, ful Link Here 
971
  {
971
  {
972
    var children = menuPopup.childNodes;
972
    var children = menuPopup.childNodes;
973
    if (!children) return;
973
    if (!children) return;
974
974
975
    var firstHas = { value: false };
975
    var firstHas = { value: false };
976
    var anyHas = { value: false };
976
    var anyHas = { value: false };
977
    var allHas = { value: false };
977
    var allHas = { value: false };
978
978
979
    var sizeWasFound = false;
980
    var smallFound = false;
979
    var smallFound = false;
981
    var bigFound = false;
980
    var bigFound = false;
982
981
983
    // we need to set or clear the checkmark for each menu item since the selection
982
    // we need to set or clear the checkmark for each menu item since the selection
984
    // may be in a new location from where it was when the menu was previously opened
983
    // may be in a new location from where it was when the menu was previously opened
985
984
986
    // First 2 items add <small> and <big> tags
985
    // First 2 items add <small> and <big> tags
987
    // While it would be better to show the number of levels,
986
    // While it would be better to show the number of levels,
 Lines 991-1077   function initFontSizeMenu(menuPopup, ful Link Here 
991
990
992
    EditorGetTextProperty("big", "", "", firstHas, anyHas, allHas);
991
    EditorGetTextProperty("big", "", "", firstHas, anyHas, allHas);
993
    bigFound = anyHas.value;
992
    bigFound = anyHas.value;
994
993
995
    // Fixed size items start after menu separator depending on whether it is
994
    // Fixed size items start after menu separator depending on whether it is
996
    // a full menu.
995
    // a full menu.
997
    var menuIndex = fullMenu ? 3 : 0;
996
    var menuIndex = fullMenu ? 3 : 0;
998
997
999
    var fontSize = EditorGetTextProperty("font", "size", null, firstHas, anyHas, allHas);
998
    var setIndex = getFontSizeIndex();
1000
    // dump(fontSize + " " + anyHas.value + " " + allHas.value + "\n");
1001
    sizeWasFound = anyHas.value;
1002
    var setIndex = -1;
1003
1004
    if (allHas.value)
1005
    {
1006
      switch (fontSize)
1007
      {
1008
      case "-3":
1009
      case "-2":
1010
      case "0":
1011
      case "1":
1012
        // x-small.
1013
        setIndex = 0;
1014
        break;
1015
      case "-1":
1016
      case "2":
1017
        // small.
1018
        setIndex = 1;
1019
        break;
1020
      case "3":
1021
        // medium.
1022
        setIndex = 2;
1023
        break;
1024
      case "+1":
1025
      case "4":
1026
        // large.
1027
        setIndex = 3;
1028
        break;
1029
      case "+2":
1030
      case "5":
1031
        // x-large.
1032
        setIndex = 4;
1033
        break;
1034
      case "+3":
1035
      case "+4":
1036
      case "6":
1037
      case "7":
1038
        // xx-large/
1039
        setIndex = 5;
1040
      }
1041
    }
1042
1043
    sizeWasFound |= (setIndex >= 0);
1044
1045
    // If the element has no size attribute and no size was found at all,
1046
    // we assume "medium" size. This is highly problematic since
1047
    // CSS sizes are not recognised and will show as "medium" as well.
1048
    // Currently we can't distinguish between "no attribute" which
1049
    // can imply "medium" and "CSS attribute present" which should not
1050
    // imply "medium".
1051
    if (!sizeWasFound)
1052
      setIndex = 2;
1053
999
1054
    var lastItem = children.length - 1;
1000
    var lastItem = children.length - 1;
1055
    if (setIndex >= 0)
1001
    if (setIndex >= 0)
1056
    {
1002
    {
1057
      children[menuIndex + setIndex].setAttribute("checked", true);
1003
      children[menuIndex + setIndex].setAttribute("checked", true);
1058
    }
1004
    }
1059
    else
1005
    else
1060
    {
1006
    {
1061
      // In case of mixed, clear all items.
1007
      // In case of mixed, clear all items.
1062
      for (var i = menuIndex; i < lastItem; i++)
1008
      for (var i = menuIndex; i < lastItem; i++)
1063
        children[i].setAttribute("checked", false);
1009
        children[i].setAttribute("checked", false);
1064
    }
1010
    }
1065
1011
1066
    // Show "small"/"big" indicator.
1012
    // Show "small"/"big" indicator.
1067
    var htmlInfo = "";
1013
    var htmlInfo = "";
1068
    if (smallFound)
1014
    if (smallFound)
1069
      htmlInfo += "<small>";
1015
      htmlInfo = "<small>";
1070
    if (bigFound)
1016
    if (bigFound)
1071
      htmlInfo += "<big>";
1017
      htmlInfo += "<big>";
1072
1018
1073
    if (htmlInfo != "")
1019
    if (htmlInfo != "")
1074
    {
1020
    {
1075
      children[lastItem].setAttribute("hidden", false);
1021
      children[lastItem].setAttribute("hidden", false);
1076
      children[lastItem].setAttribute("label", "HTML: " + htmlInfo);
1022
      children[lastItem].setAttribute("label", "HTML: " + htmlInfo);
1077
      children[lastItem].setAttribute("checked", true);
1023
      children[lastItem].setAttribute("checked", true);
(-)a/editor/ui/composer/content/editorOverlay.xul (-10 / +10 lines)
Line     Link Here 
 Lines 89-115    Link Here 
89
         command="cmd_removeLinks"
89
         command="cmd_removeLinks"
90
         modifiers="accel, shift"/>
90
         modifiers="accel, shift"/>
91
    <key id="removenamedanchorskb"
91
    <key id="removenamedanchorskb"
92
         key="&formatRemoveNamedAnchors2.key;"
92
         key="&formatRemoveNamedAnchors2.key;"
93
         command="cmd_removeNamedAnchors"
93
         command="cmd_removeNamedAnchors"
94
         modifiers="accel, shift"/>
94
         modifiers="accel, shift"/>
95
    <key id="decreasefontsizekb"
95
    <key id="decreasefontsizekb"
96
         key="&decrementFontSize.key;"
96
         key="&decrementFontSize.key;"
97
         command="cmd_decreaseFont"
97
         command="cmd_decreaseFontStep"
98
         modifiers="accel"/>
98
         modifiers="accel"/>
99
    <key id="increasefontsizekb"
99
    <key id="increasefontsizekb"
100
         key="&incrementFontSize.key;"
100
         key="&incrementFontSize.key;"
101
         command="cmd_increaseFont"
101
         command="cmd_increaseFontStep"
102
         modifiers="accel"/>
102
         modifiers="accel"/>
103
    <key key="&incrementFontSize.key;"
103
    <key key="&incrementFontSize.key;"
104
         command="cmd_increaseFont"
104
         command="cmd_increaseFontStep"
105
         modifiers="accel,shift"/>
105
         modifiers="accel,shift"/>
106
    <key key="&incrementFontSize.key2;"
106
    <key key="&incrementFontSize.key2;"
107
         command="cmd_increaseFont"
107
         command="cmd_increaseFontStep"
108
         modifiers="accel"/>
108
         modifiers="accel"/>
109
109
110
    <key id="insertlinkkb"
110
    <key id="insertlinkkb"
111
         key="&insertLinkCmd.key;"
111
         key="&insertLinkCmd.key;"
112
         command="cmd_link"
112
         command="cmd_link"
113
         modifiers="accel"/>
113
         modifiers="accel"/>
114
  </keyset>
114
  </keyset>
115
115
 Lines 223-240    Link Here 
223
    <command id="cmd_backgroundColor" state=""/>
223
    <command id="cmd_backgroundColor" state=""/>
224
    <command id="cmd_highlight"       state="transparent"  oncommand="EditorSelectColor('Highlight', event);"/>
224
    <command id="cmd_highlight"       state="transparent"  oncommand="EditorSelectColor('Highlight', event);"/>
225
    <command id="cmd_fontSize"                         oncommand="goDoCommand('cmd_fontSize')"/>
225
    <command id="cmd_fontSize"                         oncommand="goDoCommand('cmd_fontSize')"/>
226
    <command id="cmd_align"           state=""/>
226
    <command id="cmd_align"           state=""/>
227
    <command id="cmd_absPos"          state=""        oncommand="goDoCommand('cmd_absPos')"/>
227
    <command id="cmd_absPos"          state=""        oncommand="goDoCommand('cmd_absPos')"/>
228
    <command id="cmd_increaseZIndex"  state=""        oncommand="goDoCommand('cmd_increaseZIndex')"/>
228
    <command id="cmd_increaseZIndex"  state=""        oncommand="goDoCommand('cmd_increaseZIndex')"/>
229
    <command id="cmd_decreaseZIndex"  state=""        oncommand="goDoCommand('cmd_decreaseZIndex')"/>
229
    <command id="cmd_decreaseZIndex"  state=""        oncommand="goDoCommand('cmd_decreaseZIndex')"/>
230
    <command id="cmd_advancedProperties"              oncommand="goDoCommand('cmd_advancedProperties')"/>
230
    <command id="cmd_advancedProperties"              oncommand="goDoCommand('cmd_advancedProperties')"/>
231
    <command id="cmd_increaseFont"                    oncommand="goDoCommand('cmd_increaseFont')"/>
231
    <command id="cmd_increaseFontStep"                oncommand="goDoCommand('cmd_increaseFontStep')"/>
232
    <command id="cmd_decreaseFont"                    oncommand="goDoCommand('cmd_decreaseFont')"/>
232
    <command id="cmd_decreaseFontStep"                oncommand="goDoCommand('cmd_decreaseFontStep')"/>
233
    <command id="cmd_removeStyles"                    oncommand="goDoCommand('cmd_removeStyles')"/>
233
    <command id="cmd_removeStyles"                    oncommand="goDoCommand('cmd_removeStyles')"/>
234
    <command id="cmd_removeLinks"                     oncommand="goDoCommand('cmd_removeLinks')"/>
234
    <command id="cmd_removeLinks"                     oncommand="goDoCommand('cmd_removeLinks')"/>
235
    <command id="cmd_removeNamedAnchors"              oncommand="goDoCommand('cmd_removeNamedAnchors')"/>
235
    <command id="cmd_removeNamedAnchors"              oncommand="goDoCommand('cmd_removeNamedAnchors')"/>
236
  </commandset>
236
  </commandset>
237
237
238
  <!-- commands updated only when the menu gets created -->
238
  <!-- commands updated only when the menu gets created -->
239
  <commandset id="composerListMenuItems"
239
  <commandset id="composerListMenuItems"
240
          commandupdater="true"
240
          commandupdater="true"
 Lines 445-468    Link Here 
445
    <!-- Font size submenu -->
445
    <!-- Font size submenu -->
446
    <menu id="fontSizeMenu" label="&fontSizeMenu.label;"
446
    <menu id="fontSizeMenu" label="&fontSizeMenu.label;"
447
          accesskey="&fontSizeMenu.accesskey;"
447
          accesskey="&fontSizeMenu.accesskey;"
448
          position="2">
448
          position="2">
449
      <menupopup id="fontSizeMenuPopup" onpopupshowing="initFontSizeMenu(this, true)">
449
      <menupopup id="fontSizeMenuPopup" onpopupshowing="initFontSizeMenu(this, true)">
450
      <menuitem id="menu_decreaseFontSize"
450
      <menuitem id="menu_decreaseFontSize"
451
                label="&decreaseFontSize.label;"
451
                label="&decreaseFontSize.label;"
452
                accesskey="&decreaseFontSize.accesskey;"
452
                accesskey="&decreaseFontSize.accesskey;"
453
                command="cmd_decreaseFont"
453
                command="cmd_decreaseFontStep"
454
                type="radio"
454
                type="radio"
455
                name="1"
455
                name="1"
456
                key="decreasefontsizekb"/>
456
                key="decreasefontsizekb"/>
457
      <menuitem id="menu_increaseFontSize"
457
      <menuitem id="menu_increaseFontSize"
458
                label="&increaseFontSize.label;"
458
                label="&increaseFontSize.label;"
459
                accesskey="&increaseFontSize.accesskey;"
459
                accesskey="&increaseFontSize.accesskey;"
460
                command="cmd_increaseFont"
460
                command="cmd_increaseFontStep"
461
                type="radio"
461
                type="radio"
462
                name="1" key="increasefontsizekb"/>
462
                name="1" key="increasefontsizekb"/>
463
        <menuseparator id="fontSizeMenuAfterIncreaseFontSizeSeparator"/>
463
        <menuseparator id="fontSizeMenuAfterIncreaseFontSizeSeparator"/>
464
        <menuitem id="menu_x-small"
464
        <menuitem id="menu_x-small"
465
                  label="&size-tinyCmd.label;"
465
                  label="&size-tinyCmd.label;"
466
                  accesskey="&size-tinyCmd.accesskey;"
466
                  accesskey="&size-tinyCmd.accesskey;"
467
                  oncommand="EditorSetFontSize('x-small')"
467
                  oncommand="EditorSetFontSize('x-small')"
468
                  type="radio"
468
                  type="radio"
 Lines 1166-1186    Link Here 
1166
                oncommand="EditorSetFontSize('xx-large')"/>
1166
                oncommand="EditorSetFontSize('xx-large')"/>
1167
      <menuitem id="toobarmenu_fontSize_smallBigInfo"
1167
      <menuitem id="toobarmenu_fontSize_smallBigInfo"
1168
                type="radio" name="2" disabled="true" hidden="true"/>
1168
                type="radio" name="2" disabled="true" hidden="true"/>
1169
    </menupopup>
1169
    </menupopup>
1170
  </toolbarbutton>
1170
  </toolbarbutton>
1171
  <toolbarbutton id="DecreaseFontSizeButton"
1171
  <toolbarbutton id="DecreaseFontSizeButton"
1172
                 class="formatting-button"
1172
                 class="formatting-button"
1173
                 tooltiptext="&decreaseFontSizeToolbarCmd.tooltip;"
1173
                 tooltiptext="&decreaseFontSizeToolbarCmd.tooltip;"
1174
                 command="cmd_decreaseFont"/>
1174
                 command="cmd_decreaseFontStep"/>
1175
  <toolbarbutton id="IncreaseFontSizeButton"
1175
  <toolbarbutton id="IncreaseFontSizeButton"
1176
                 class="formatting-button"
1176
                 class="formatting-button"
1177
                 tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"
1177
                 tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"
1178
                 command="cmd_increaseFont"/>
1178
                 command="cmd_increaseFontStep"/>
1179
  <toolbarbutton id="boldButton"
1179
  <toolbarbutton id="boldButton"
1180
                 class="formatting-button"
1180
                 class="formatting-button"
1181
                 tooltiptext="&boldToolbarCmd.tooltip;"
1181
                 tooltiptext="&boldToolbarCmd.tooltip;"
1182
                 type="checkbox"
1182
                 type="checkbox"
1183
                 autoCheck="false"
1183
                 autoCheck="false"
1184
                 command="cmd_bold">
1184
                 command="cmd_bold">
1185
    <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
1185
    <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
1186
  </toolbarbutton>
1186
  </toolbarbutton>
(-)a/mail/components/compose/content/MsgComposeCommands.js (-2 / +2 lines)
Line     Link Here 
 Lines 987-1004   function updateComposeItems() Link Here 
987
    goUpdateCommand("cmd_rewrap");
987
    goUpdateCommand("cmd_rewrap");
988
988
989
    // Insert Menu
989
    // Insert Menu
990
    if (gMsgCompose && gMsgCompose.composeHTML)
990
    if (gMsgCompose && gMsgCompose.composeHTML)
991
    {
991
    {
992
      goUpdateCommand("cmd_renderedHTMLEnabler");
992
      goUpdateCommand("cmd_renderedHTMLEnabler");
993
      goUpdateCommand("cmd_fontColor");
993
      goUpdateCommand("cmd_fontColor");
994
      goUpdateCommand("cmd_backgroundColor");
994
      goUpdateCommand("cmd_backgroundColor");
995
      goUpdateCommand("cmd_decreaseFont");
995
      goUpdateCommand("cmd_decreaseFontStep");
996
      goUpdateCommand("cmd_increaseFont");
996
      goUpdateCommand("cmd_increaseFontStep");
997
      goUpdateCommand("cmd_bold");
997
      goUpdateCommand("cmd_bold");
998
      goUpdateCommand("cmd_italic");
998
      goUpdateCommand("cmd_italic");
999
      goUpdateCommand("cmd_underline");
999
      goUpdateCommand("cmd_underline");
1000
      goUpdateCommand("cmd_ul");
1000
      goUpdateCommand("cmd_ul");
1001
      goUpdateCommand("cmd_ol");
1001
      goUpdateCommand("cmd_ol");
1002
      goUpdateCommand("cmd_indent");
1002
      goUpdateCommand("cmd_indent");
1003
      goUpdateCommand("cmd_outdent");
1003
      goUpdateCommand("cmd_outdent");
1004
      goUpdateCommand("cmd_align");
1004
      goUpdateCommand("cmd_align");
(-)a/mail/components/compose/content/editorOverlay.xul (-12 / +12 lines)
Line     Link Here 
 Lines 26-48    Link Here 
26
26
27
    <key id="increaseindentkb"  key="&increaseIndent.key;"  observes="cmd_indent"  modifiers="accel"/>
27
    <key id="increaseindentkb"  key="&increaseIndent.key;"  observes="cmd_indent"  modifiers="accel"/>
28
    <key id="decreaseindentkb"  key="&decreaseIndent.key;"  observes="cmd_outdent"  modifiers="accel"/>
28
    <key id="decreaseindentkb"  key="&decreaseIndent.key;"  observes="cmd_outdent"  modifiers="accel"/>
29
29
30
    <key id="removestyleskb"       key="&formatRemoveStyles.key;"   observes="cmd_removeStyles"  modifiers="accel, shift"/>
30
    <key id="removestyleskb"       key="&formatRemoveStyles.key;"   observes="cmd_removeStyles"  modifiers="accel, shift"/>
31
    <key id="removestyleskb2"      key=" "   observes="cmd_removeStyles"  modifiers="accel"/>
31
    <key id="removestyleskb2"      key=" "   observes="cmd_removeStyles"  modifiers="accel"/>
32
    <key id="removelinkskb"        key="&formatRemoveLinks.key;"    observes="cmd_removeLinks"  modifiers="accel, shift"/>
32
    <key id="removelinkskb"        key="&formatRemoveLinks.key;"    observes="cmd_removeLinks"  modifiers="accel, shift"/>
33
    <key id="removenamedanchorskb" key="&formatRemoveNamedAnchors2.key;"    observes="cmd_removeNamedAnchors"  modifiers="accel, shift"/>
33
    <key id="removenamedanchorskb" key="&formatRemoveNamedAnchors2.key;"    observes="cmd_removeNamedAnchors"  modifiers="accel, shift"/>
34
    <key id="decreasefontsizekb"   key="&decrementFontSize.key;"    observes="cmd_decreaseFont"  modifiers="accel"/>
34
    <key id="decreasefontsizekb"   key="&decrementFontSize.key;"    observes="cmd_decreaseFontStep"  modifiers="accel"/>
35
    <key                           key="&decrementFontSize.key;"    observes="cmd_decreaseFont"  modifiers="accel, shift"/>
35
    <key                           key="&decrementFontSize.key;"    observes="cmd_decreaseFontStep"  modifiers="accel, shift"/>
36
    <key                           key="&decrementFontSize.key2;"   observes="cmd_decreaseFont"  modifiers="accel"/>
36
    <key                           key="&decrementFontSize.key2;"   observes="cmd_decreaseFontStep"  modifiers="accel"/>
37
37
38
    <key id="increasefontsizekb"   key="&incrementFontSize.key;"    observes="cmd_increaseFont"  modifiers="accel"/>
38
    <key id="increasefontsizekb"   key="&incrementFontSize.key;"    observes="cmd_increaseFontStep"  modifiers="accel"/>
39
    <key                           key="&incrementFontSize.key;"    observes="cmd_increaseFont"  modifiers="accel, shift"/>
39
    <key                           key="&incrementFontSize.key;"    observes="cmd_increaseFontStep"  modifiers="accel, shift"/>
40
    <key                           key="&incrementFontSize.key2;"   observes="cmd_increaseFont"  modifiers="accel"/>
40
    <key                           key="&incrementFontSize.key2;"   observes="cmd_increaseFontStep"  modifiers="accel"/>
41
41
42
    <key id="insertlinkkb"         key="&insertLinkCmd.key;"           observes="cmd_link"          modifiers="accel"/>
42
    <key id="insertlinkkb"         key="&insertLinkCmd.key;"           observes="cmd_link"          modifiers="accel"/>
43
  </keyset>
43
  </keyset>
44
44
45
  <!-- commands updated when the editor gets created -->
45
  <!-- commands updated when the editor gets created -->
46
  <commandset id="commonEditorMenuItems"
46
  <commandset id="commonEditorMenuItems"
47
          commandupdater="true"
47
          commandupdater="true"
48
          events="create"
48
          events="create"
 Lines 152-169    Link Here 
152
    <command id="cmd_align"           state=""/>
152
    <command id="cmd_align"           state=""/>
153
153
154
    <command id="cmd_absPos"          state=""        oncommand="goDoCommand('cmd_absPos')"/>
154
    <command id="cmd_absPos"          state=""        oncommand="goDoCommand('cmd_absPos')"/>
155
    <command id="cmd_increaseZIndex"  state=""        oncommand="goDoCommand('cmd_increaseZIndex')"/>
155
    <command id="cmd_increaseZIndex"  state=""        oncommand="goDoCommand('cmd_increaseZIndex')"/>
156
    <command id="cmd_decreaseZIndex"  state=""        oncommand="goDoCommand('cmd_decreaseZIndex')"/>
156
    <command id="cmd_decreaseZIndex"  state=""        oncommand="goDoCommand('cmd_decreaseZIndex')"/>
157
157
158
    <command id="cmd_advancedProperties"              oncommand="goDoCommand('cmd_advancedProperties')"/>
158
    <command id="cmd_advancedProperties"              oncommand="goDoCommand('cmd_advancedProperties')"/>
159
159
160
    <command id="cmd_increaseFont"                    oncommand="goDoCommand('cmd_increaseFont')"/>
160
    <command id="cmd_increaseFontStep"                oncommand="goDoCommand('cmd_increaseFontStep')"/>
161
    <command id="cmd_decreaseFont"                    oncommand="goDoCommand('cmd_decreaseFont')"/>
161
    <command id="cmd_decreaseFontStep"                oncommand="goDoCommand('cmd_decreaseFontStep')"/>
162
162
163
    <command id="cmd_removeStyles"                    oncommand="goDoCommand('cmd_removeStyles')"/>
163
    <command id="cmd_removeStyles"                    oncommand="goDoCommand('cmd_removeStyles')"/>
164
    <command id="cmd_removeLinks"                     oncommand="goDoCommand('cmd_removeLinks')"/>
164
    <command id="cmd_removeLinks"                     oncommand="goDoCommand('cmd_removeLinks')"/>
165
    <command id="cmd_removeNamedAnchors"              oncommand="goDoCommand('cmd_removeNamedAnchors')"/>
165
    <command id="cmd_removeNamedAnchors"              oncommand="goDoCommand('cmd_removeNamedAnchors')"/>
166
  </commandset>
166
  </commandset>
167
167
168
  <!-- commands updated only when the menu gets created -->
168
  <!-- commands updated only when the menu gets created -->
169
  <commandset id="composerListMenuItems"
169
  <commandset id="composerListMenuItems"
 Lines 315-338    Link Here 
315
    <menu id="fontSizeMenu" label="&fontSizeMenu.label;"
315
    <menu id="fontSizeMenu" label="&fontSizeMenu.label;"
316
          accesskey="&fontSizeMenu.accesskey;"
316
          accesskey="&fontSizeMenu.accesskey;"
317
          position="2">
317
          position="2">
318
      <menupopup id="fontSizeMenuPopup" onpopupshowing="initFontSizeMenu(this, true)">
318
      <menupopup id="fontSizeMenuPopup" onpopupshowing="initFontSizeMenu(this, true)">
319
        <menuitem id="menu_decreaseFontSize"
319
        <menuitem id="menu_decreaseFontSize"
320
                  label="&decreaseFontSize.label;"
320
                  label="&decreaseFontSize.label;"
321
                  accesskey="&decreaseFontSize.accesskey;"
321
                  accesskey="&decreaseFontSize.accesskey;"
322
                  key="decreasefontsizekb"
322
                  key="decreasefontsizekb"
323
                  observes="cmd_decreaseFont"
323
                  observes="cmd_decreaseFontStep"
324
                  type="radio"
324
                  type="radio"
325
                  name="1"/>
325
                  name="1"/>
326
        <menuitem id="menu_increaseFontSize"
326
        <menuitem id="menu_increaseFontSize"
327
                  label="&increaseFontSize.label;"
327
                  label="&increaseFontSize.label;"
328
                  accesskey="&increaseFontSize.accesskey;"
328
                  accesskey="&increaseFontSize.accesskey;"
329
                  key="increasefontsizekb"
329
                  key="increasefontsizekb"
330
                  observes="cmd_increaseFont"
330
                  observes="cmd_increaseFontStep"
331
                  type="radio"
331
                  type="radio"
332
                  name="1"/>
332
                  name="1"/>
333
        <menuseparator id="fontSizeMenuAfterIncreaseFontSizeSeparator"/>
333
        <menuseparator id="fontSizeMenuAfterIncreaseFontSizeSeparator"/>
334
        <menuitem id="menu_size-x-small"
334
        <menuitem id="menu_size-x-small"
335
                  label="&size-tinyCmd.label;"
335
                  label="&size-tinyCmd.label;"
336
                  accesskey="&size-tinyCmd.accesskey;"
336
                  accesskey="&size-tinyCmd.accesskey;"
337
                  oncommand="EditorSetFontSize('x-small')"
337
                  oncommand="EditorSetFontSize('x-small')"
338
                  type="radio"
338
                  type="radio"
 Lines 984-1004    Link Here 
984
                oncommand="EditorSetFontSize('xx-large')"/>
984
                oncommand="EditorSetFontSize('xx-large')"/>
985
      <menuitem id="toobarmenu_fontSize_smallBigInfo"
985
      <menuitem id="toobarmenu_fontSize_smallBigInfo"
986
                type="radio" name="2" disabled="true" hidden="true"/>
986
                type="radio" name="2" disabled="true" hidden="true"/>
987
    </menupopup>
987
    </menupopup>
988
  </toolbarbutton>
988
  </toolbarbutton>
989
  <toolbarbutton id="DecreaseFontSizeButton"
989
  <toolbarbutton id="DecreaseFontSizeButton"
990
                 class="formatting-button"
990
                 class="formatting-button"
991
                 tooltiptext="&decreaseFontSizeToolbarCmd.tooltip;"
991
                 tooltiptext="&decreaseFontSizeToolbarCmd.tooltip;"
992
                 observes="cmd_decreaseFont"/>
992
                 observes="cmd_decreaseFontStep"/>
993
  <toolbarbutton id="IncreaseFontSizeButton"
993
  <toolbarbutton id="IncreaseFontSizeButton"
994
                 class="formatting-button"
994
                 class="formatting-button"
995
                 tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"
995
                 tooltiptext="&increaseFontSizeToolbarCmd.tooltip;"
996
                 observes="cmd_increaseFont"/>
996
                 observes="cmd_increaseFontStep"/>
997
  <toolbarbutton id="boldButton"
997
  <toolbarbutton id="boldButton"
998
                 class="formatting-button"
998
                 class="formatting-button"
999
                 tooltiptext="&boldToolbarCmd.tooltip;"
999
                 tooltiptext="&boldToolbarCmd.tooltip;"
1000
                 type="checkbox"
1000
                 type="checkbox"
1001
                 autoCheck="false"
1001
                 autoCheck="false"
1002
                 observes="cmd_bold">
1002
                 observes="cmd_bold">
1003
    <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
1003
    <observes element="cmd_bold" type="checkbox" attribute="state" onbroadcast="onButtonUpdate(this.parentNode, 'cmd_bold')"/>
1004
  </toolbarbutton>
1004
  </toolbarbutton>
(-)a/suite/mailnews/compose/MsgComposeCommands.js (-2 / +2 lines)
Line     Link Here 
 Lines 598-615   function updateComposeItems() Link Here 
598
  try {
598
  try {
599
    // Edit Menu
599
    // Edit Menu
600
    goUpdateCommand("cmd_rewrap");
600
    goUpdateCommand("cmd_rewrap");
601
601
602
    // Insert Menu
602
    // Insert Menu
603
    if (gMsgCompose && gMsgCompose.composeHTML)
603
    if (gMsgCompose && gMsgCompose.composeHTML)
604
    {
604
    {
605
      goUpdateCommand("cmd_renderedHTMLEnabler");
605
      goUpdateCommand("cmd_renderedHTMLEnabler");
606
      goUpdateCommand("cmd_decreaseFont");
606
      goUpdateCommand("cmd_decreaseFontStep");
607
      goUpdateCommand("cmd_increaseFont");
607
      goUpdateCommand("cmd_increaseFontStep");
608
      goUpdateCommand("cmd_bold");
608
      goUpdateCommand("cmd_bold");
609
      goUpdateCommand("cmd_italic");
609
      goUpdateCommand("cmd_italic");
610
      goUpdateCommand("cmd_underline");
610
      goUpdateCommand("cmd_underline");
611
      goUpdateCommand("cmd_ul");
611
      goUpdateCommand("cmd_ul");
612
      goUpdateCommand("cmd_ol");
612
      goUpdateCommand("cmd_ol");
613
      goUpdateCommand("cmd_indent");
613
      goUpdateCommand("cmd_indent");
614
      goUpdateCommand("cmd_outdent");
614
      goUpdateCommand("cmd_outdent");
615
      goUpdateCommand("cmd_align");
615
      goUpdateCommand("cmd_align");

Return to bug 769604