calendar/lightning/content/imip-bar-overlay.xul
author Clemens <clemens@gorilla-computing.de>
Mon, 12 Mar 2018 17:44:46 +0100
changeset 30466 9b22a733b765b9a50133661fdccba4e01c3d91de
parent 30440 5ae749bd1ed8dbb33e1995c60fdc13152c066752
child 30721 6bea4bcfa60f99e39f304ffc47e5abdc4752c86e
permissions -rw-r--r--
Bug 321434 - Location does not appear in multiday view event box. r/a=philipp MozReview-Commit-ID: 4BbeOscF0ec

<?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/. -->

<!DOCTYPE overlay [
    <!ENTITY % lightningDTD SYSTEM "chrome://lightning/locale/lightning.dtd">
    %lightningDTD;
]>

<?xml-stylesheet href="chrome://lightning/content/lightning-widgets.css" type="text/css"?>

<overlay xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <script type="application/javascript"
            src="chrome://lightning/content/lightning-utils.js"/>
    <script type="application/javascript"
            src="chrome://lightning/content/imip-bar.js"/>
    <script type="application/javascript"
            src="chrome://calendar/content/calendar-management.js"/>
    <script type="application/javascript"
            src="chrome://calendar/content/calendar-ui-utils.js"/>

    <vbox id="messagepanebox">
      <vbox id="singlemessage" insertbefore="msgHeaderView">
        <lightning-notification-bar id="imip-bar"
                                    collapsed="true"
                                    insertbefore="msgHeaderView"
                                    label="&lightning.imipbar.description;">

          <!-- Some Toolbox implementation notes:
             -
             - css style:
             - classes within toolbox are making use of existing TB css definitions - as used in
             - /comm-central/source/mail/base/content/msgHdrViewOverlay.xul, only icon defining
             - classes like imipAcceptButton are noted separately and OS specific within
             - skin/lightning.css (resp. the OS-specific theme folders)
             -
             - The toolbarbuttons will be adjusted dynamically in imip-bar.js based on their
             - content of menuitems. To avoid breaking this, the following should be considered
             - if adding/changing toolbarbutton definitions.
             - general:
             -    * the toolbarbuttons will appear in order of definition
             -      within the toolbar if visible
             -    * must be hidden by default
             -    * menuitem inside must not be hidden by default
             - simple button:
             -    * must not have a type attribute
             -    * may have menupopup/menuitem within (not displayed though)
             - dropdown only:
             -    * must have type=menu
             -    * should have a menupopup with at least one menuitem
             - smart-dropdown:
             -    * must have type=menu-button
             -    * should have a menupopup with at least one menuitem
             -    * bubbling up of events from menuitems to toolbarbutton must be prevented
             -      by adding a trailing "if (event.target.id == this.id) " to the respective
             -      ltnImipBar.executeAction(...)
             -    * toolbarbutton's oncommand should end with the first menuitem's oncommand
             -      to not break automated conforming
             -      e.g. "if (event.target.id == this.id) ltnImipBar.executeAction('ACCEPTED');"
             -      and "ltnImipBar.executeAction('ACCEPTED');"
             //-->
          <toolbox id="imip-view-toolbox"
                   class="inline-toolbox"
                   defaulticonsize="small"
                   minwidth="50px"
                   defaultlabelalign="end"
                   labelalign="end"
                   defaultmode="full"
                   inlinetoolbox="true">
            <toolbar id="imip-view-toolbar" class="inline-toolbar" align="start"
                     customizable="false" mode="full"
                     defaulticonsize="small" defaultmode="full">

              <!-- show event/invitation details -->
              <toolbarbutton id="imipDetailsButton"
                             label="&lightning.imipbar.btnDetails.label;"
                             tooltiptext="&lightning.imipbar.btnDetails.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipDetailsButton"
                             oncommand="ltnImipBar.executeAction('X-SHOWDETAILS')"
                             hidden="true"/>

              <!-- decline counter -->
              <toolbarbutton id="imipDeclineCounterButton"
                             label="&lightning.imipbar.btnDeclineCounter.label;"
                             tooltiptext="&lightning.imipbar.btnDeclineCounter.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipDeclineCounterButton"
                             oncommand="ltnImipBar.executeAction('X-DECLINECOUNTER')"
                             hidden="true"/>

              <!-- reschedule -->
              <toolbarbutton id="imipRescheduleButton"
                             label="&lightning.imipbar.btnReschedule.label;"
                             tooltiptext="&lightning.imipbar.btnReschedule.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipRescheduleButton"
                             oncommand="ltnImipBar.executeAction('X-RESCHEDULE')"
                             hidden="true"/>

              <!-- add published events -->
              <toolbarbutton id="imipAddButton"
                             label="&lightning.imipbar.btnAdd.label;"
                             tooltiptext="&lightning.imipbar.btnAdd.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipAddButton"
                             oncommand="ltnImipBar.executeAction()"
                             hidden="true"/>

              <!-- update published events and invitations -->
              <toolbarbutton id="imipUpdateButton"
                             label="&lightning.imipbar.btnUpdate.label;"
                             tooltiptext="&lightning.imipbar.btnUpdate.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipUpdateButton"
                             oncommand="ltnImipBar.executeAction()"
                             hidden="true"/>

              <!-- delete cancelled events from calendar -->
              <toolbarbutton id="imipDeleteButton"
                             label="&lightning.imipbar.btnDelete.label;"
                             tooltiptext="&lightning.imipbar.btnDelete.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipDeleteButton"
                             oncommand="ltnImipBar.executeAction()"
                             hidden="true"/>

              <!-- re-confirm partstat -->
              <toolbarbutton id="imipReconfirmButton"
                             label="&lightning.imipbar.btnReconfirm2.label;"
                             tooltiptext="&lightning.imipbar.btnReconfirm.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipReconfirmButton"
                             oncommand="ltnImipBar.executeAction()"
                             hidden="true"/>

              <!-- accept -->
              <toolbarbutton id="imipAcceptButton"
                             tooltiptext="&lightning.imipbar.btnAccept2.tooltiptext;"
                             label="&lightning.imipbar.btnAccept.label;"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('ACCEPTED', 'AUTO');"
                             type="menu-button"
                             class="imip-button toolbarbutton-1 msgHeaderView-button imipAcceptButton"
                             hidden="true">
                <menupopup id="imipAcceptDropdown">
                  <label id="imipAcceptButton_AcceptLabel"
                         class="imipAcceptLabel"
                         tooltiptext="&lightning.imipbar.btnAccept2.tooltiptext;"
                         value="&lightning.imipbar.btnAccept.label;"/>
                  <menuitem id="imipAcceptButton_Accept"
                            tooltiptext="&lightning.imipbar.btnSend.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('ACCEPTED', 'AUTO');"/>
                  <menuitem id="imipAcceptButton_AcceptDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSend.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('ACCEPTED', 'NONE');"/>
                  <separatpor flex="1" class="groove"/>
                  <label id="imipAcceptButton_TentativeLabel"
                         class="imipAcceptLabel"
                         tooltiptext="&lightning.imipbar.btnTentative2.tooltiptext;"
                         value="&lightning.imipbar.btnTentative.label;"/>
                  <menuitem id="imipAcceptButton_Tentative"
                            tooltiptext="&lightning.imipbar.btnSend.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'AUTO');"/>
                  <menuitem id="imipAcceptButton_TentativeDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSend.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- accept recurrences -->
              <toolbarbutton id="imipAcceptRecurrencesButton"
                             tooltiptext="&lightning.imipbar.btnAcceptRecurrences2.tooltiptext;"
                             label="&lightning.imipbar.btnAcceptRecurrences.label;"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('ACCEPTED', 'AUTO');"
                             type="menu-button"
                             class="imip-button toolbarbutton-1 msgHeaderView-button imipAcceptRecurrencesButton"
                             hidden="true">
                <menupopup id="imipAcceptRecurrencesDropdown">
                  <label id="imipAcceptRecurrencesButton_AcceptLabel"
                         class="imipAcceptLabel"
                         tooltiptext="&lightning.imipbar.btnAcceptRecurrences2.tooltiptext;"
                         value="&lightning.imipbar.btnAcceptRecurrences.label;"/>
                  <menuitem id="imipAcceptRecurrencesButton_Accept"
                            tooltiptext="&lightning.imipbar.btnSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('ACCEPTED', 'AUTO');"/>
                  <menuitem id="imipAcceptRecurrencesButton_AcceptDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('ACCEPTED', 'NONE');"/>
                  <separatpor flex="1" class="groove"/>
                  <label id="imipAcceptRecurrencesButton_TentativeLabel"
                         class="imipAcceptLabel"
                         tooltiptext="&lightning.imipbar.btnTentativeRecurrences2.tooltiptext;"
                         value="&lightning.imipbar.btnTentativeRecurrences.label;"/>
                  <menuitem id="imipAcceptRecurrencesButton_Tentative"
                            tooltiptext="&lightning.imipbar.btnSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'AUTO');"/>
                  <menuitem id="imipAcceptRecurrencesButton_TentativeDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- tentative; should only be used, if no imipMoreButton is used and
                 - imipDeclineButton/imipAcceptButton have no visible menuitems //-->
              <toolbarbutton id="imipTentativeButton"
                             label="&lightning.imipbar.btnTentative.label;"
                             tooltiptext="&lightning.imipbar.btnTentative2.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipTentativeButton"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('TENTATIVE', 'AUTO');"
                             type="menu-button"
                             hidden="true">
                <menupopup id="imipTentativeDropdown">
                  <menuitem id="imipTentativeButton_Tentative"
                            tooltiptext="&lightning.imipbar.btnSend.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'AUTO');"/>
                  <menuitem id="imipTentativeButton_TentativeDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSend.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- tentative recurrences; should only be used, if no imipMoreButton is used and
                 - imipDeclineRecurrencesButton/imipAcceptRecurrencesButton have no visible menuitems //-->
              <toolbarbutton id="imipTentativeRecurrencesButton"
                             label="&lightning.imipbar.btnTentativeRecurrences.label;"
                             tooltiptext="&lightning.imipbar.btnTentativeRecurrences2.tooltiptext;"
                             class="toolbarbutton-1 msgHeaderView-button imipTentativeRecurrencesButton"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('TENTATIVE', 'AUTO');"
                             type="menu-button"
                             hidden="true">
                <menupopup id="imipTentativeRecurrencesDropdown">
                  <menuitem id="imipTentativeRecurrencesButton_Tentative"
                            tooltiptext="&lightning.imipbar.btnSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'AUTO');"/>
                  <menuitem id="imipTentativeRecurrencesButton_TentativeDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('TENTATIVE', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- decline -->
              <toolbarbutton id="imipDeclineButton"
                             tooltiptext="&lightning.imipbar.btnDecline2.tooltiptext;"
                             label="&lightning.imipbar.btnDecline.label;"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('DECLINED', 'AUTO');"
                             type="menu-button"
                             class="toolbarbutton-1 msgHeaderView-button imipDeclineButton"
                             hidden="true">
                <menupopup id="imipDeclineDropdown">
                  <menuitem id="imipDeclineButton_Decline"
                            tooltiptext="&lightning.imipbar.btnSend.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('DECLINED', 'AUTO');"/>
                  <menuitem id="imipDeclineButton_DeclineDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSend.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('DECLINED', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- decline recurrences -->
              <toolbarbutton id="imipDeclineRecurrencesButton"
                             tooltiptext="&lightning.imipbar.btnDeclineRecurrences2.tooltiptext;"
                             label="&lightning.imipbar.btnDeclineRecurrences.label;"
                             oncommand="if (event.target.id == this.id) ltnImipBar.executeAction('DECLINED');"
                             type="menu-button"
                             class="toolbarbutton-1 msgHeaderView-button imipDeclineRecurrencesButton"
                             hidden="true">
                <menupopup id="imipDeclineRecurrencesDropdown">
                  <menuitem id="imipDeclineRecurrencesButton_DeclineAll"
                            tooltiptext="&lightning.imipbar.btnSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnSend.label;"
                            oncommand="ltnImipBar.executeAction('DECLINED');"/>
                  <menuitem id="imipDeclineRecurrencesButton_DeclineAllDontSend"
                            tooltiptext="&lightning.imipbar.btnDontSendSeries.tooltiptext;"
                            label="&lightning.imipbar.btnDontSend.label;"
                            oncommand="ltnImipBar.executeAction('DECLINED', 'NONE');"/>
                  <!-- add here more menuitem as needed -->
                </menupopup>
              </toolbarbutton>

              <!-- more options -->
              <toolbarbutton id="imipMoreButton"
                             type="menu"
                             tooltiptext="&lightning.imipbar.btnMore.tooltiptext;"
                             label="&lightning.imipbar.btnMore.label;"
                             class="toolbarbutton-1 msgHeaderView-button imipMoreButton"
                             hidden="true">
                <menupopup id="imipMoreDropdown">
                  <menuitem id="imipMoreButton_SaveCopy"
                            tooltiptext="&lightning.imipbar.btnSaveCopy.tooltiptext;"
                            label="&lightning.imipbar.btnSaveCopy.label;"
                            oncommand="ltnImipBar.executeAction('X-SAVECOPY');"/>
                  <!-- add here a menuitem as needed -->
                </menupopup>
              </toolbarbutton>
            </toolbar>
          </toolbox>
        </lightning-notification-bar>
      </vbox>
    </vbox>
</overlay>