Fix bug 461121 - Thunderbird3: Move Invitations link into status bar. r=dbo
authorPhilipp Kewisch <mozilla@kewis.ch>
Wed, 22 Oct 2008 17:15:58 +0200
changeset 688 cccbb31e47b652b7f0ae2f63706964621b362258
parent 687 de33142e73f51cdac07ef77f8c493c710317462b
child 689 90692f79a317e232176a568f676a0d17ad0d5ee6
push id615
push usermozilla@kewis.ch
push dateWed, 22 Oct 2008 15:17:43 +0000
treeherdercomm-central@cccbb31e47b6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbo
bugs461121
Fix bug 461121 - Thunderbird3: Move Invitations link into status bar. r=dbo
calendar/base/content/calendar-common-sets.xul
calendar/base/content/calendar-invitations-manager.js
calendar/lightning/content/lightning-scripts.inc
calendar/lightning/content/messenger-overlay-sidebar.js
calendar/lightning/content/messenger-overlay-sidebar.xul
calendar/lightning/themes/pinstripe/lightning.css
calendar/lightning/themes/winstripe/lightning.css
calendar/locales/en-US/chrome/lightning/lightning.dtd
calendar/locales/en-US/chrome/lightning/lightning.properties
--- a/calendar/base/content/calendar-common-sets.xul
+++ b/calendar/base/content/calendar-common-sets.xul
@@ -104,17 +104,16 @@
     <command id="calendar_toggle_tasks_in_view_command" persist="checked" oncommand="toggleTasksInView()"/>
     <command id="calendar_toggle_show_completed_in_view_command" persist="checked" oncommand="toggleShowCompletedInView()"/>
     <command id="calendar_toggle_minimonthpane_command" oncommand="document.getElementById('minimonth-pane').togglePane(event)"/>
     <command id="calendar_toggle_calendarlist_command" oncommand="document.getElementById('calendar-list-pane').togglePane(event)"/>
     <command id="calendar_task_filter_command" oncommand="taskViewUpdate(event.explicitOriginalTarget.getAttribute('value'))"/>
     <command id="calendar_toggle_filter_command" oncommand="document.getElementById('task-filter-pane').togglePane(event)"/>
     <command id="calendar_toggle_todaypane_command"
              oncommand="document.getElementById('today-pane-panel').togglePane(event); TodayPane.setTodayHeader()"/>
-    <command id="calendar_toggle_invitations_command" oncommand="document.getElementById('invitations-pane').togglePane(event)"/>
     <command id="calendar_view_next_command" oncommand="moveView(1)"/>
     <command id="calendar_view_prev_command" oncommand="moveView(-1)"/>
 
     <command id="calendar_go_to_today_command" oncommand="goToDate(now())"/>
   </commandset>
 
   <keyset id="calendar-keys">
   #ifdef XP_MACOSX
--- a/calendar/base/content/calendar-invitations-manager.js
+++ b/calendar/base/content/calendar-invitations-manager.js
@@ -217,21 +217,21 @@ InvitationsManager.prototype = {
         var args = new Object();
         args.onLoadOperationListener = onLoadOpListener;
         args.queue = new Array();
         args.finishedCallBack = finishedCallBack;
         args.requestManager = gInvitationsRequestManager;
         args.invitationsManager = this;
         // the dialog will reset this to auto when it is done loading
         window.setCursor("wait");
-        // open the dialog modally
+        // open the dialog
         window.openDialog(
             "chrome://calendar/content/calendar-invitations-dialog.xul",
             "_blank",
-            "chrome,titlebar,modal,resizable",
+            "chrome,titlebar,resizable",
             args);
     },
 
     processJobQueue: function IM_processJobQueue(queue,
                                                  jobQueueFinishedCallBack) {
         // TODO: undo/redo
         function operationListener(mgr, queueCallback, oldItem_) {
             this.mInvitationsManager = mgr;
--- a/calendar/lightning/content/lightning-scripts.inc
+++ b/calendar/lightning/content/lightning-scripts.inc
@@ -49,10 +49,9 @@
 <script type="application/javascript" src="chrome://calendar/content/calendar-invitations-manager.js"/>
 <script type="application/javascript">
     var calendarmenulabel = "&lightning.calendar.label;";
     var calendarmenuaccesskey = "&lightning.calendar.accesskey;";
     var messagemenulabel = "&msgMenu.label;";
     var messagemenuaccesskey = "&msgMenu.accesskey;";
     var tasksmenulabel = "&lightning.tasks.label;";
     var tasksmenuaccesskey = "&lightning.tasks.accesskey;";
-    var invitationsLabel = "&lightning.sidebar.invitations.label;";
 </script>
--- a/calendar/lightning/content/messenger-overlay-sidebar.js
+++ b/calendar/lightning/content/messenger-overlay-sidebar.js
@@ -607,23 +607,22 @@ const FIRST_DELAY_UNREGISTER = 0;
 var gInvitationsOperationListener = {
     mCount: 0,
 
     onOperationComplete: function sBOL_onOperationComplete(aCalendar,
                                                            aStatus,
                                                            aOperationType,
                                                            aId,
                                                            aDetail) {
+        let invitationsBox = document.getElementById("calendar-invitations-panel");
         if (Components.isSuccessCode(aStatus)) {
-            var invitationsBox = document.getElementById("invitations");
-            var value = invitationsLabel + " (" + this.mCount + ")"; // XXX l10n-unfriendly
-            invitationsBox.setAttribute("value", value);
-            invitationsBox.removeAttribute("hidden");
+            let value = ltnGetString("lightning", "invitationsLink.label", [this.mCount]);
+            document.getElementById("calendar-invitations-label").value = value;
+            setElementValue(invitationsBox, this.mCount < 1 && "true", "hidden");
         } else {
-            var invitationsBox = document.getElementById("invitations");
             invitationsBox.setAttribute("hidden", "true");
         }
         this.mCount = 0;
     },
 
     onGetResult: function sBOL_onGetResult(aCalendar,
                                            aStatus,
                                            aItemType,
--- a/calendar/lightning/content/messenger-overlay-sidebar.xul
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xul
@@ -289,22 +289,16 @@
                 accesskey="&calendar.tasks.view.filtertasks.accesskey;"
                 command="calendar_toggle_filter_command"/>
       <menuitem id="tasks-view-calendarlist"
                 type="checkbox"
                 mode="calendar,task"
                 label="&calendar.tasks.view.calendarlist.label;"
                 accesskey="&calendar.tasks.view.calendarlist.accesskey;"
                 command="calendar_toggle_calendarlist_command"/>
-      <menuitem id="view-invitations"
-                type="checkbox"
-                mode="mail,calendar,task"
-                label="&lightning.sidebar.invitations.label;"
-                accesskey="&lightning.sidebar.invitations.accesskey;"
-                command="calendar_toggle_invitations_command"/>
       <menuseparator id="before-today-pane"/>
       <menu id="today-pane-menu"
             label="&calendar.context.button.label;"
             accesskey="&calendar.context.button.accesskey;">
         <menupopup>
           <menuitem id="ltnShowTodayPane-2"
                     label="&todaypane.showTodayPane.label;"
                     accesskey="&todaypane.showTodayPane.accesskey;"
@@ -532,24 +526,16 @@
             <modevbox id="calendar-listtree-pane" flex="1" mode="calendar,task" broadcaster="modeBroadcaster"
                       refcontrol="calendar-list-header">
               
               <tree id="calendar-list-tree-widget"  class="task-tree-subpane"
                 flex="1"/>
             </modevbox>
         </modevbox>
         </vbox>
-        <modehbox id="invitations-pane" mode="calendar,task"
-              broadcaster="modeBroadcaster" refcontrol="calendar_toggle_invitations_command">
-      <label id="invitations"
-             class="text-link calendar-invitations-sidebar-label"
-             value="&lightning.sidebar.invitations.label;"
-             onclick="openInvitationsDialog();"/>
-      <spacer flex="1"/>
-    </modehbox>
   </vbox>
 
       <splitter id="calsidebar_splitter" collapse="before" persist="state"/>
       
       <deck id="calendarDisplayDeck" flex="1">
   <vbox id="calendar-view-box" context="calendar-view-context-menu">
     <deck flex="1"
           id="view-deck"
@@ -587,10 +573,20 @@
       <toolbarbutton id="calendar-status-todaypane-button"
                      doubleimage="true"
                      type="checkbox"
                      label="&todaypane.statusButton.label;"
                      tooltiptext="&calendar.todaypane.button.tooltip;"
                      observes="calendar_toggle_todaypane_command"
                      command="calendar_toggle_todaypane_command"/>
     </statusbarpanel>
+    <statusbarpanel id="calendar-invitations-panel"
+                    insertbefore="unreadMessageCount,totalMessageCount"
+                    oncommand="openInvitationsDialog()">
+      <label id="calendar-invitations-label"
+             class="text-link"
+             onclick="openInvitationsDialog()"
+             onkeypress="if (event.keyCode == event.VK_ENTER ||
+                             event.keyCode == event.VK_RETURN) {
+                             openInvitationsDialog()"/>
+    </statusbarpanel>
   </statusbar>
 </overlay>
--- a/calendar/lightning/themes/pinstripe/lightning.css
+++ b/calendar/lightning/themes/pinstripe/lightning.css
@@ -104,26 +104,16 @@ radio[pane=paneLightning] {
 }
 
 
 /* Lightning sidebar background in calendar and task mode */
 #ltnSidebar {
   background-color: -moz-field;  
 }
 
-#invitations-pane {
-  border-top: 1px solid ThreeDShadow !important;
-  background-color: -moz-dialog;  
-}
-
-.calendar-invitations-sidebar-label {
-  margin-top: 2px;
-  margin-bottom: 2px;
-}
-
 .task-tree-subpane {
   -moz-margin-start: 12px;
 }
 
 /* Today pane button in status bar */
 #calendar-status-todaypane-button,
 #calendar-status-todaypane-button[checked="true"] {
   min-width: 0;
--- a/calendar/lightning/themes/winstripe/lightning.css
+++ b/calendar/lightning/themes/winstripe/lightning.css
@@ -104,26 +104,16 @@ radio[pane=paneLightning] {
 }
 
 
 /* Lightning sidebar background in calendar and task mode */
 #ltnSidebar {
   background-color: -moz-field;  
 }
 
-#invitations-pane {
-  border-top: 1px solid ThreeDShadow !important;
-  background-color: -moz-dialog;  
-}
-
-.calendar-invitations-sidebar-label {
-  margin-top: 2px;
-  margin-bottom: 2px;
-}
-
 /* Today pane button in status bar */
 #calendar-status-todaypane-button,
 #calendar-status-todaypane-button[checked="true"] {
   min-width: 0;
   min-height: 0;
   -moz-appearance: none;
   -moz-border-radius: 3px;
   padding: 0.2pt 2px !important;
--- a/calendar/locales/en-US/chrome/lightning/lightning.dtd
+++ b/calendar/locales/en-US/chrome/lightning/lightning.dtd
@@ -57,18 +57,16 @@
 <!ENTITY lightning.menupopup.open.label               "Open">
 <!ENTITY lightning.menupopup.open.accesskey           "O">
 <!ENTITY lightning.menupopup.open.message.label       "Saved Message…">
 <!ENTITY lightning.menupopup.open.message.accesskey   "M">
 <!ENTITY lightning.menupopup.open.calendar.label      "Calendar File…">
 <!ENTITY lightning.menupopup.open.calendar.accesskey  "C">
 
 <!-- Messenger Sidebar -->
-<!ENTITY lightning.sidebar.invitations.label "Invitations">
-<!ENTITY lightning.sidebar.invitations.accesskey "I">
 <!ENTITY lightning.calendar.label            "Calendar">
 <!ENTITY lightning.calendar.accesskey        "C">
 <!ENTITY lightning.tasks.label               "Tasks">
 <!ENTITY lightning.tasks.accesskey           "T">
 
 <!-- Mode Toolbar -->
 <!ENTITY lightning.toolbar.mail.label         "Mail">
 <!ENTITY lightning.toolbar.mail.accesskey     "M">
--- a/calendar/locales/en-US/chrome/lightning/lightning.properties
+++ b/calendar/locales/en-US/chrome/lightning/lightning.properties
@@ -74,8 +74,10 @@ imipNoIdentity=None
 
 itipReplySubject=Event Invitation Reply: %1$S
 itipReplyBodyAccept=%1$S has accepted your event invitation.
 itipReplyBodyDecline=%1$S has declined your event invitation.
 itipRequestSubject=Event Invitation: %1$S
 itipRequestBody=%1$S has invited you to %2$S
 itipCancelSubject=Event Canceled: %1$S
 itipCancelBody=%1$S has canceled this event: « %2$S »
+
+invitationsLink.label=Invitations: %1$S