Bug 1608610 - Pre-process calendar buttons for mail toolbar. r=Fallen
authorPaul Morris <paul@thunderbird.net>
Tue, 14 Jan 2020 13:58:20 -0500
changeset 37238 df845a3dbec6eed3199082683b2af39083a6192c
parent 37237 65d67acb5b16961642faa0b965c56a3a944b0234
child 37239 001eb334f82a2cdcb50403d25230edbfc22455a8
push id2552
push userclokep@gmail.com
push dateMon, 10 Feb 2020 21:24:16 +0000
treeherdercomm-beta@f95a6f4408a3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersFallen
bugs1608610
Bug 1608610 - Pre-process calendar buttons for mail toolbar. r=Fallen
calendar/lightning/content/calendar-buttons-mail-toolbar.inc.xhtml
calendar/lightning/content/messenger-overlay-sidebar.xhtml
calendar/lightning/jar.mn
mail/base/content/mainMailToolbox.inc.xhtml
new file mode 100644
--- /dev/null
+++ b/calendar/lightning/content/calendar-buttons-mail-toolbar.inc.xhtml
@@ -0,0 +1,35 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+<!-- CALENDAR TOOLBAR BUTTONS FOR MAIL TOOLBAR -->
+<toolbarbutton id="lightning-button-calendar"
+               class="toolbarbutton-1"
+               label="&lightning.toolbar.calendar.label;"
+               tooltiptext="&lightning.toolbar.calendar.tooltip;"
+               command="new_calendar_tab"/>
+<toolbarbutton id="lightning-button-tasks"
+               class="toolbarbutton-1"
+               label="&lightning.toolbar.task.label;"
+               tooltiptext="&lightning.toolbar.task.tooltip;"
+               command="new_task_tab"/>
+<toolbarbutton is="toolbarbutton-menu-button" id="extractEventButton"
+               type="menu-button"
+               class="toolbarbutton-1"
+               label="&calendar.extract.event.button;"
+               tooltiptext="&calendar.extract.event.button.tooltip;"
+               oncommand="calendarExtract.extractFromEmail(true);">
+  <menupopup id="extractEventLocaleList"
+             oncommand="calendarExtract.extractWithLocale(event, true);"
+             onpopupshowing="calendarExtract.onShowLocaleMenu(event.target);"/>
+</toolbarbutton>
+<toolbarbutton is="toolbarbutton-menu-button" id="extractTaskButton"
+               type="menu-button"
+               class="toolbarbutton-1"
+               label="&calendar.extract.task.button;"
+               tooltiptext="&calendar.extract.task.button.tooltip;"
+               oncommand="calendarExtract.extractFromEmail(false);">
+  <menupopup id="extractTaskLocaleList"
+             oncommand="calendarExtract.extractWithLocale(event, false);"
+             onpopupshowing="calendarExtract.onShowLocaleMenu(event.target);"/>
+</toolbarbutton>
--- a/calendar/lightning/content/messenger-overlay-sidebar.xhtml
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xhtml
@@ -4,50 +4,16 @@
    - License, v. 2.0. If a copy of the MPL was not distributed with this
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <overlay id="ltnSidebarOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:html="http://www.w3.org/1999/xhtml">
 
-  <!-- CALENDAR TOOLBAR BUTTONS FOR MAIL TOOLBAR -->
-  <toolbarpalette id="MailToolbarPalette">
-    <toolbarbutton id="lightning-button-calendar"
-                   class="toolbarbutton-1"
-                   label="&lightning.toolbar.calendar.label;"
-                   tooltiptext="&lightning.toolbar.calendar.tooltip;"
-                   command="new_calendar_tab"/>
-    <toolbarbutton id="lightning-button-tasks"
-                   class="toolbarbutton-1"
-                   label="&lightning.toolbar.task.label;"
-                   tooltiptext="&lightning.toolbar.task.tooltip;"
-                   command="new_task_tab"/>
-    <toolbarbutton is="toolbarbutton-menu-button" id="extractEventButton"
-                   type="menu-button"
-                   class="toolbarbutton-1"
-                   label="&calendar.extract.event.button;"
-                   tooltiptext="&calendar.extract.event.button.tooltip;"
-                   oncommand="calendarExtract.extractFromEmail(true);">
-      <menupopup id="extractEventLocaleList"
-                 oncommand="calendarExtract.extractWithLocale(event, true);"
-                 onpopupshowing="calendarExtract.onShowLocaleMenu(event.target);"/>
-    </toolbarbutton>
-    <toolbarbutton is="toolbarbutton-menu-button" id="extractTaskButton"
-                   type="menu-button"
-                   class="toolbarbutton-1"
-                   label="&calendar.extract.task.button;"
-                   tooltiptext="&calendar.extract.task.button.tooltip;"
-                   oncommand="calendarExtract.extractFromEmail(false);">
-      <menupopup id="extractTaskLocaleList"
-                 oncommand="calendarExtract.extractWithLocale(event, false);"
-                 onpopupshowing="calendarExtract.onShowLocaleMenu(event.target);"/>
-    </toolbarbutton>
-  </toolbarpalette>
-
   <!-- CALENDAR MENUS -->
   <menupopup id="menu_FilePopup">
     <menu id="menu_Open"
           mode="calendar"
           label="&lightning.menupopup.open.label;"
           accesskey="&lightning.menupopup.open.accesskey;"
           insertafter="menu_New">
       <menupopup id="menu_OpenPopup">
--- a/calendar/lightning/jar.mn
+++ b/calendar/lightning/jar.mn
@@ -8,16 +8,17 @@ lightning.jar:
 % override chrome://messagebody/skin/calendar-event-dialog-attendees.png chrome://calendar-common/skin/calendar-event-dialog-attendees.png
 % overlay chrome://messenger/content/messenger.xhtml chrome://lightning/content/messenger-overlay-sidebar.xhtml
 % overlay chrome://communicator/content/pref/preferences.xhtml chrome://lightning/content/suite-overlay-preferences.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % overlay about:addons chrome://lightning/content/suite-overlay-addons.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % overlay chrome://mozapps/content/extensions/extensions.xhtml chrome://lightning/content/suite-overlay-addons.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % overlay chrome://lightning/content/messenger-overlay-sidebar.xhtml chrome://lightning/content/suite-overlay-sidebar.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % override chrome://lightning-common/skin/accountCentral.css chrome://lightning-common/skin/suite-accountCentral.css application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % content lightning %content/
+    content/calendar-buttons-mail-toolbar.inc.xhtml        (content/calendar-buttons-mail-toolbar.inc.xhtml)
     content/calendar-commands.inc.xhtml                    (content/calendar-commands.inc.xhtml)
     content/calendar-context-menus-and-tooltips.inc.xhtml  (content/calendar-context-menus-and-tooltips.inc.xhtml)
     content/calendar-keys.inc.xhtml                        (content/calendar-keys.inc.xhtml)
     content/calendar-status-bar.inc.xhtml                  (content/calendar-status-bar.inc.xhtml)
     content/calendar-tab-panels.inc.xhtml                  (content/calendar-tab-panels.inc.xhtml)
     content/calendar-today-pane.inc.xhtml                  (content/calendar-today-pane.inc.xhtml)
     content/html-item-editing/lightning-item-iframe.html   (content/html-item-editing/lightning-item-iframe.html)
     content/html-item-editing/react-code.js                (content/html-item-editing/react-code.js)
--- a/mail/base/content/mainMailToolbox.inc.xhtml
+++ b/mail/base/content/mainMailToolbox.inc.xhtml
@@ -402,16 +402,17 @@
         </menupopup>
       </menulist>
     </toolbaritem>
 
     <toolbarbutton id="button-addons" class="toolbarbutton-1"
                    label="&addons.label;"
                    tooltiptext="&addonsButton.tooltip;"
                    oncommand="openAddonsMgr();"/>
+#include ../../../calendar/lightning/content/calendar-buttons-mail-toolbar.inc.xhtml
   </toolbarpalette>
 
   <!-- If changes are made to the default set of toolbar buttons, you may need to rev the id
        of mail-bar in order to force the new default items to show up for users who customized their toolbar
        in earlier versions. Bumping the id means users will have to re-customize their toolbar!
   -->
 
   <toolbar is="customizable-toolbar" id="mail-bar3"