From b2c37cd95d719e6e894b8b29de174c762ec25c60 Mon Sep 17 00:00:00 2001 From: "daniel.boelzle%sun.com" Date: Tue, 5 Feb 2008 22:55:11 +0000 Subject: [PATCH] Bug 415081 Get rid of lightning-wcap.xpi; r=philipp git-svn-id: svn://10.0.0.236/trunk@244959 18797224-902f-48f8-a5cc-f745e15eee43 --- .../lightning/content/lightning-scripts.inc | 3 +- .../content/messenger-overlay-sidebar.js | 81 +++++++++++- .../content/messenger-overlay-sidebar.xul | 5 + mozilla/calendar/lightning/jar.mn | 2 - .../wcap/lightning-wcap/Makefile.in | 69 ---------- .../wcap/lightning-wcap/install.rdf | 31 ----- .../wcap/sun-messenger-overlay-sidebar.js | 121 ------------------ .../wcap/sun-messenger-overlay-sidebar.xul | 57 --------- .../prototypes/wcap/wcap-enabler/Makefile.in | 60 --------- .../prototypes/wcap/wcap-enabler/install.rdf | 27 ---- .../wcap/wcap-enabler/wcap-enabler.js | 43 ------- .../resources/content/calendarCreation.js | 8 -- .../calendar/sunbird/app/profile/sunbird.js | 2 - mozilla/extensions/lightning/Makefile.in | 2 - .../lightning/linux/tinder-config.pl | 2 +- .../lightning/macosx/tinder-config.pl | 2 +- .../lightning/win32/tinder-config.pl | 2 +- 17 files changed, 86 insertions(+), 431 deletions(-) delete mode 100644 mozilla/calendar/prototypes/wcap/lightning-wcap/Makefile.in delete mode 100644 mozilla/calendar/prototypes/wcap/lightning-wcap/install.rdf delete mode 100644 mozilla/calendar/prototypes/wcap/sun-messenger-overlay-sidebar.js delete mode 100644 mozilla/calendar/prototypes/wcap/sun-messenger-overlay-sidebar.xul delete mode 100644 mozilla/calendar/prototypes/wcap/wcap-enabler/Makefile.in delete mode 100644 mozilla/calendar/prototypes/wcap/wcap-enabler/install.rdf delete mode 100644 mozilla/calendar/prototypes/wcap/wcap-enabler/wcap-enabler.js diff --git a/mozilla/calendar/lightning/content/lightning-scripts.inc b/mozilla/calendar/lightning/content/lightning-scripts.inc index 8a64fd8097b..c1e5efdbfe8 100755 --- a/mozilla/calendar/lightning/content/lightning-scripts.inc +++ b/mozilla/calendar/lightning/content/lightning-scripts.inc @@ -46,6 +46,7 @@ diff --git a/mozilla/calendar/lightning/content/messenger-overlay-sidebar.js b/mozilla/calendar/lightning/content/messenger-overlay-sidebar.js index 3e3bc30709d..0a34ea52687 100644 --- a/mozilla/calendar/lightning/content/messenger-overlay-sidebar.js +++ b/mozilla/calendar/lightning/content/messenger-overlay-sidebar.js @@ -252,11 +252,8 @@ function ltnOnLoad(event) // Make sure we update ourselves if the program stays open over midnight scheduleMidnightUpdate(refreshUIBits); - if (getPrefSafe("calendar.prototypes.wcap", false)) { - document.loadOverlay( - "chrome://lightning/content/sun-messenger-overlay-sidebar.xul", - null); - } + scheduleInvitationsUpdate(FIRST_DELAY_STARTUP, REPEAT_DELAY); + getCalendarManager().addObserver(gInvitationsCalendarManagerObserver); // Set up the command controller from calendar-common-sets.js injectCalendarCommandController(); @@ -448,6 +445,7 @@ function LtnObserveDisplayDeckChange(event) { } function ltnFinish() { + getCalendarManager().removeObserver(gInvitationsCalendarManagerObserver); getCompositeCalendar().removeObserver(agendaTreeView.calendarObserver); unloadCalendarManager(); @@ -747,6 +745,79 @@ function removeMenuElements(aRoot, aModeValue) { } } +// == invitations link +const FIRST_DELAY_STARTUP = 100; +const FIRST_DELAY_RESCHEDULE = 100; +const FIRST_DELAY_REGISTER = 10000; +const FIRST_DELAY_UNREGISTER = 0; +const REPEAT_DELAY = 180000; + +var gInvitationsOperationListener = { + onOperationComplete: function sBOL_onOperationComplete(aCalendar, + aStatus, + aOperationType, + aId, + aDetail) { + if (!Components.isSuccessCode(aStatus)) { + var invitationsBox = document.getElementById("invitations"); + invitationsBox.setAttribute("hidden", "true"); + } + }, + + onGetResult: function sBOL_onGetResult(aCalendar, + aStatus, + aItemType, + aDetail, + aCount, + aItems) { + if (!Components.isSuccessCode(aStatus)) { + return; + } + var invitationsBox = document.getElementById("invitations"); + var value = invitationsLabel + " (" + aCount + ")"; + invitationsBox.setAttribute("value", value); + invitationsBox.removeAttribute("hidden"); + } +}; + +var gInvitationsCalendarManagerObserver = { + mSideBar: this, + + onCalendarRegistered: function cMO_onCalendarRegistered(aCalendar) { + this.mSideBar.rescheduleInvitationsUpdate(FIRST_DELAY_REGISTER, + REPEAT_DELAY); + }, + + onCalendarUnregistering: function cMO_onCalendarUnregistering(aCalendar) { + this.mSideBar.rescheduleInvitationsUpdate(FIRST_DELAY_UNREGISTER, + REPEAT_DELAY); + }, + + onCalendarDeleting: function cMO_onCalendarDeleting(aCalendar) { + } +}; + +function scheduleInvitationsUpdate(firstDelay, repeatDelay) { + getInvitationsManager().scheduleInvitationsUpdate(firstDelay, + repeatDelay, + gInvitationsOperationListener); +} + +function rescheduleInvitationsUpdate(firstDelay, repeatDelay) { + getInvitationsManager().cancelInvitationsUpdate(); + scheduleInvitationsUpdate(firstDelay, repeatDelay); +} + +function openInvitationsDialog() { + getInvitationsManager().cancelInvitationsUpdate(); + getInvitationsManager().openInvitationsDialog( + gInvitationsOperationListener, + function oiD_callback() { + scheduleInvitationsUpdate(FIRST_DELAY_RESCHEDULE, + REPEAT_DELAY); + }); +} + SelectMessage = function(messageUri) { document.getElementById("switch2mail").doCommand(); gSelectMessage(messageUri); diff --git a/mozilla/calendar/lightning/content/messenger-overlay-sidebar.xul b/mozilla/calendar/lightning/content/messenger-overlay-sidebar.xul index dff2a7884ef..492a77f4435 100644 --- a/mozilla/calendar/lightning/content/messenger-overlay-sidebar.xul +++ b/mozilla/calendar/lightning/content/messenger-overlay-sidebar.xul @@ -50,6 +50,7 @@ %dtd1; %dtd2; %dtd3; + %dtd4; %messengerDTD; ]> @@ -481,6 +482,10 @@ collapsable="true" persist="collapsed"/> +