Bug 1508119 - Inline the calendar-views.xul overlay file. r=darktrojan
authorPaul Morris <paul@thunderbird.net>
Thu, 31 Oct 2019 14:37:39 -0400
changeset 37424 029af9f181ab30c1c16ffbb8054b98c7aef57588
parent 37423 b2f5e2c9055bbeecdace64905846797d4935aef2
child 37425 404de6eddbe0d7bc4049b38e82845880a96e3b08
push id396
push userclokep@gmail.com
push dateMon, 06 Jan 2020 23:11:57 +0000
reviewersdarktrojan
bugs1508119
Bug 1508119 - Inline the calendar-views.xul overlay file. r=darktrojan
calendar/base/content/calendar-views.xul
calendar/base/jar.mn
calendar/lightning/content/messenger-overlay-sidebar.xul
deleted file mode 100644
--- a/calendar/base/content/calendar-views.xul
+++ /dev/null
@@ -1,115 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/. -->
-
-<?xml-stylesheet href="chrome://calendar/skin/calendar-views.css" type="text/css"?>
-<?xml-stylesheet href="chrome://calendar-common/skin/calendar-alarms.css" type="text/css"?>
-<?xml-stylesheet href="chrome://calendar-common/skin/widgets/minimonth.css" type="text/css"?>
-<?xml-stylesheet href="chrome://calendar/skin/widgets/calendar-widgets.css" type="text/css"?>
-
-<!DOCTYPE overlay [
-  <!ENTITY % dtd1 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd1;
-  <!ENTITY % dtd2 SYSTEM "chrome://global/locale/global.dtd" > %dtd2;
-]>
-
-<overlay id="calendar-views-overlay"
-         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" xmlns:html="http://www.w3.org/1999/xhtml">
-  <script src="chrome://calendar/content/calendar-event-gripbar.js"/>
-  <vbox id="calendar-view-box" context="calendar-view-context-menu">
-    <hbox id="calendar-nav-control">
-      <vbox flex="1">
-        <hbox flex="1" class="navigation-inner-box" align="center">
-          <!-- If you are extending a view, add attributes to these
-               nodes for your view. i.e if your view has the id
-               "foobar-view", then you need to add the attribute
-               tooltiptext-foobar="..." -->
-          <hbox pack="center">
-            <toolbarbutton id="previous-view-button"
-                           class="view-navigation-button"
-                           type="prev"
-                           tooltiptext-day="&calendar.navigation.prevday.tooltip;"
-                           tooltiptext-week="&calendar.navigation.prevweek.tooltip;"
-                           tooltiptext-multiweek="&calendar.navigation.prevweek.tooltip;"
-                           tooltiptext-month="&calendar.navigation.prevmonth.tooltip;"
-                           command="calendar_view_prev_command"/>
-            <toolbarbutton id="today-view-button"
-                           class="today-navigation-button"
-                           label="&calendar.today.button.label;"
-                           tooltiptext-all="&calendar.today.button.tooltip;"
-                           command="calendar_view_today_command"/>
-            <toolbarbutton id="next-view-button"
-                           class="view-navigation-button"
-                           type="next"
-                           tooltiptext-day="&calendar.navigation.nextday.tooltip;"
-                           tooltiptext-week="&calendar.navigation.nextweek.tooltip;"
-                           tooltiptext-multiweek="&calendar.navigation.nextweek.tooltip;"
-                           tooltiptext-month="&calendar.navigation.nextmonth.tooltip;"
-                           command="calendar_view_next_command"/>
-          </hbox>
-          <label id="intervalDescription"
-                 class="view-header"
-                 crop="end"
-                 flex="1"
-                 pack="start"/>
-          <spacer flex="1"/>
-          <label id="calendarWeek"
-                 class="view-header"
-                 type="end"
-                 crop="start"/>
-        </hbox>
-        <hbox flex="1" class="navigation-bottombox"/>
-      </vbox>
-      <vbox id="view-tabbox" pack="end">
-        <radiogroup id="view-tabs"
-                    class="calview-tabs"
-                    orient="horizontal">
-          <radio id="calendar-day-view-button"
-                 label="&calendar.day.button.label;"
-                 tooltiptext="&calendar.day.button.tooltip;"
-                 class="calview"
-                 command="calendar_day-view_command"/>
-          <radio id="calendar-week-view-button"
-                 label="&calendar.week.button.label;"
-                 tooltiptext="&calendar.week.button.tooltip;"
-                 class="calview"
-                 command="calendar_week-view_command"/>
-          <radio id="calendar-multiweek-view-button"
-                 label="&calendar.multiweek.button.label;"
-                 tooltiptext="&calendar.multiweek.button.tooltip;"
-                 class="calview"
-                 command="calendar_multiweek-view_command"/>
-          <radio id="calendar-month-view-button"
-                 label="&calendar.month.button.label;"
-                 tooltiptext="&calendar.month.button.tooltip;"
-                 class="calview"
-                 command="calendar_month-view_command"/>
-        </radiogroup>
-        <box class="navigation-bottombox"/>
-      </vbox>
-      <vbox>
-        <vbox flex="1" class="navigation-spacer-box"/>
-        <hbox class="navigation-bottombox"/>
-      </vbox>
-    </hbox>
-    <deck flex="1"
-          id="view-deck"
-          persist="selectedIndex">
-      <!-- Note: the "id" attributes of the calendar panes **must** follow the
-           notation 'type + "-" + "view"', where "type" should refer to the
-           displayed time period as described in base/public/calICalendarView.idl -->
-      <calendar-day-view id="day-view" flex="1"
-                         context="calendar-view-context-menu"
-                         item-context="calendar-item-context-menu"/>
-      <calendar-week-view id="week-view" flex="1"
-                          context="calendar-view-context-menu"
-                          item-context="calendar-item-context-menu"/>
-      <calendar-multiweek-view id="multiweek-view" flex="1"
-                               context="calendar-view-context-menu"
-                               item-context="calendar-item-context-menu"/>
-      <calendar-month-view id="month-view" flex="1"
-                           context="calendar-view-context-menu"
-                           item-context="calendar-item-context-menu"/>
-    </deck>
-  </vbox>
-</overlay>
--- a/calendar/base/jar.mn
+++ b/calendar/base/jar.mn
@@ -33,17 +33,16 @@ calendar.jar:
     content/calendar-task-tree-view.js                          (content/calendar-task-tree-view.js)
     content/calendar-task-tree.js                               (content/calendar-task-tree.js)
     content/calendar-task-view.js                               (content/calendar-task-view.js)
     content/calendar-ui-utils.js                                (content/calendar-ui-utils.js)
     content/calendar-unifinder.js                               (content/calendar-unifinder.js)
     content/calendar-views-utils.js                             (content/calendar-views-utils.js)
     content/calendar-views.js                                   (content/calendar-views.js)
     content/calendar-editable-item.js                           (content/calendar-editable-item.js)
-    content/calendar-views.xul                                  (content/calendar-views.xul)
     content/calendar-alarm-dialog.js                            (content/dialogs/calendar-alarm-dialog.js)
     content/calendar-alarm-dialog.xul                           (content/dialogs/calendar-alarm-dialog.xul)
     content/calendar-conflicts-dialog.xul                       (content/dialogs/calendar-conflicts-dialog.xul)
     content/calendar-creation.js                                (content/dialogs/calendar-creation.js)
     content/calendar-dialog-utils.js                            (content/dialogs/calendar-dialog-utils.js)
     content/calendar-error-prompt.xul                           (content/dialogs/calendar-error-prompt.xul)
     content/calendar-error-prompt.js                            (content/dialogs/calendar-error-prompt.js)
     content/calendar-event-dialog-attendees-custom-elements.js  (content/dialogs/calendar-event-dialog-attendees-custom-elements.js)
--- a/calendar/lightning/content/messenger-overlay-sidebar.xul
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xul
@@ -24,17 +24,20 @@
 
 <?xml-stylesheet href="chrome://calendar/skin/today-pane.css" type="text/css"?>
 
 <?xml-stylesheet href="chrome://calendar/skin/calendar-unifinder.css" type="text/css"?>
 
 <?xml-stylesheet href="chrome://calendar/skin/calendar-task-tree.css" type="text/css"?>
 <?xml-stylesheet href="chrome://calendar/skin/calendar-task-view.css" type="text/css"?>
 
-<?xul-overlay href="chrome://calendar/content/calendar-views.xul"?>
+<?xml-stylesheet href="chrome://calendar/skin/calendar-views.css" type="text/css"?>
+<?xml-stylesheet href="chrome://calendar-common/skin/calendar-alarms.css" type="text/css"?>
+<?xml-stylesheet href="chrome://calendar-common/skin/widgets/minimonth.css" type="text/css"?>
+<?xml-stylesheet href="chrome://calendar/skin/widgets/calendar-widgets.css" type="text/css"?>
 
 <?xul-overlay href="chrome://lightning/content/lightning-toolbar.xul"?>
 <?xul-overlay href="chrome://lightning/content/lightning-menus.xul"?>
 
 <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">
@@ -107,16 +110,19 @@
   <script src="chrome://calendar/content/calendar-task-tree-view.js"/>
   <script src="chrome://calendar/content/calendar-task-tree.js"/>
   <script src="chrome://calendar/content/calendar-task-view.js"/>
   <script src="chrome://calendar/content/calendar-dialog-utils.js"/>
   <script src="chrome://calendar/content/calApplicationUtils.js"/>
   <script src="chrome://calendar/content/calendar-item-bindings.js"/>
   <script src="chrome://calendar/content/calendar-menus.js"/>
 
+  <!-- NEEDED FOR CALENDAR VIEWS -->
+  <script src="chrome://calendar/content/calendar-event-gripbar.js"/>
+
   <window id="messengerWindow">
     <commandset id="calendar_commands"
                 commandupdater="true"
                 events="calendar_commands"
                 oncommandupdate="calendarController.updateCommands()">
       <command id="agenda_delete_event_command" oncommand="agendaListbox.deleteSelectedItem(false);"/>
       <command id="agenda_edit_event_command" oncommand="agendaListbox.editSelectedItem(event);"/>
       <command id="switch2calendar"
@@ -1124,17 +1130,17 @@
 
         <splitter id="calsidebar_splitter"
                   collapse="before"
                   persist="state"
                   class="calendar-sidebar-splitter"/>
 
         <deck id="calendarDisplayDeck" flex="1">
           <!-- Events View ("Unifinder") -->
-          <vbox id="calendar-view-box">
+          <vbox id="calendar-view-box" context="calendar-view-context-menu">
             <vbox id="bottom-events-box" insertbefore="calendar-nav-control" persist="height">
               <hbox id="unifinder-searchBox" persist="collapsed">
                 <box align="center">
                   <menulist id="event-filter-menulist" value="P7D" persist="value">
                     <menupopup id="event-filter-menupopup" oncommand="refreshEventTree()">
                       <menuitem id="event-filter-all"
                                 label="&calendar.events.filter.all.label;"
                                 value="all"/>
@@ -1248,16 +1254,112 @@
             <splitter id="calendar-view-splitter"
                       insertbefore="calendar-nav-control"
                       resizebefore="closest"
                       resizeafter="farthest"
                       persist="state"
                       class="chromeclass-extrachrome sidebar-splitter calendar-splitter"
                       orient="vertical"
                       onmouseup="setTimeout(refreshEventTree, 10);"/>
+
+            <!-- Calendar Views -->
+            <hbox id="calendar-nav-control">
+              <vbox flex="1">
+                <hbox flex="1" class="navigation-inner-box" align="center">
+                  <!-- If you are extending a view, add attributes to these
+                       nodes for your view. i.e if your view has the id
+                       "foobar-view", then you need to add the attribute
+                       tooltiptext-foobar="..." -->
+                  <hbox pack="center">
+                    <toolbarbutton id="previous-view-button"
+                                   class="view-navigation-button"
+                                   type="prev"
+                                   tooltiptext-day="&calendar.navigation.prevday.tooltip;"
+                                   tooltiptext-week="&calendar.navigation.prevweek.tooltip;"
+                                   tooltiptext-multiweek="&calendar.navigation.prevweek.tooltip;"
+                                   tooltiptext-month="&calendar.navigation.prevmonth.tooltip;"
+                                   command="calendar_view_prev_command"/>
+                    <toolbarbutton id="today-view-button"
+                                   class="today-navigation-button"
+                                   label="&calendar.today.button.label;"
+                                   tooltiptext-all="&calendar.today.button.tooltip;"
+                                   command="calendar_view_today_command"/>
+                    <toolbarbutton id="next-view-button"
+                                   class="view-navigation-button"
+                                   type="next"
+                                   tooltiptext-day="&calendar.navigation.nextday.tooltip;"
+                                   tooltiptext-week="&calendar.navigation.nextweek.tooltip;"
+                                   tooltiptext-multiweek="&calendar.navigation.nextweek.tooltip;"
+                                   tooltiptext-month="&calendar.navigation.nextmonth.tooltip;"
+                                   command="calendar_view_next_command"/>
+                  </hbox>
+                  <label id="intervalDescription"
+                         class="view-header"
+                         crop="end"
+                         flex="1"
+                         pack="start"/>
+                  <spacer flex="1"/>
+                  <label id="calendarWeek"
+                         class="view-header"
+                         type="end"
+                         crop="start"/>
+                </hbox>
+                <hbox flex="1" class="navigation-bottombox"/>
+              </vbox>
+              <vbox id="view-tabbox" pack="end">
+                <radiogroup id="view-tabs"
+                            class="calview-tabs"
+                            orient="horizontal">
+                  <radio id="calendar-day-view-button"
+                         label="&calendar.day.button.label;"
+                         tooltiptext="&calendar.day.button.tooltip;"
+                         class="calview"
+                         command="calendar_day-view_command"/>
+                  <radio id="calendar-week-view-button"
+                         label="&calendar.week.button.label;"
+                         tooltiptext="&calendar.week.button.tooltip;"
+                         class="calview"
+                         command="calendar_week-view_command"/>
+                  <radio id="calendar-multiweek-view-button"
+                         label="&calendar.multiweek.button.label;"
+                         tooltiptext="&calendar.multiweek.button.tooltip;"
+                         class="calview"
+                         command="calendar_multiweek-view_command"/>
+                  <radio id="calendar-month-view-button"
+                         label="&calendar.month.button.label;"
+                         tooltiptext="&calendar.month.button.tooltip;"
+                         class="calview"
+                         command="calendar_month-view_command"/>
+                </radiogroup>
+                <box class="navigation-bottombox"/>
+              </vbox>
+              <vbox>
+                <vbox flex="1" class="navigation-spacer-box"/>
+                <hbox class="navigation-bottombox"/>
+              </vbox>
+            </hbox>
+            <deck flex="1"
+                  id="view-deck"
+                  persist="selectedIndex">
+              <!-- Note: the "id" attributes of the calendar panes **must** follow the
+                   notation 'type + "-" + "view"', where "type" should refer to the
+                   displayed time period as described in base/public/calICalendarView.idl -->
+              <calendar-day-view id="day-view" flex="1"
+                                 context="calendar-view-context-menu"
+                                 item-context="calendar-item-context-menu"/>
+              <calendar-week-view id="week-view" flex="1"
+                                  context="calendar-view-context-menu"
+                                  item-context="calendar-item-context-menu"/>
+              <calendar-multiweek-view id="multiweek-view" flex="1"
+                                       context="calendar-view-context-menu"
+                                       item-context="calendar-item-context-menu"/>
+              <calendar-month-view id="month-view" flex="1"
+                                   context="calendar-view-context-menu"
+                                   item-context="calendar-item-context-menu"/>
+            </deck>
           </vbox>
           <!-- Tasks View -->
           <vbox id="calendar-task-box" flex="1"
                 onselect="taskDetailsView.onSelect(event);">
             <hbox id="task-addition-box" align="center">
               <box align="center" flex="1">
                 <toolbarbutton id="calendar-add-task-button"
                                label="&calendar.newtask.button.label;"