From 3afdd87a67e716d65a9bd06136c224653b46e9d8 Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@18797224-902f-48f8-a5cc-f745e15eee43> Date: Thu, 12 Jul 2007 20:09:09 +0000 Subject: [PATCH] This commit was manufactured by cvs2svn to create branch 'GECKO181_20070712_RELBRANCH'. git-svn-id: svn://10.0.0.236/branches/GECKO181_20070712_RELBRANCH@229835 18797224-902f-48f8-a5cc-f745e15eee43 --- .../src/atk/nsAccessibleHyperText.cpp | 24 + .../src/html/nsHTMLLinkAccessible.cpp | 23 +- .../src/html/nsHTMLLinkAccessible.h | 10 - .../src/html/nsHTMLSelectAccessible.cpp | 28 +- .../src/html/nsHTMLSelectAccessible.h | 1 + .../src/html/nsHTMLTextAccessible.cpp | 23 +- .../src/html/nsHTMLTextAccessible.h | 10 - .../accessible/src/msaa/nsAccessibleWrap.cpp | 8 +- .../src/xul/nsXULSelectAccessible.cpp | 6 +- mozilla/browser/app/module.ver | 4 +- .../components/bookmarks/content/bookmarks.js | 2 +- .../components/feeds/src/FeedWriter.js | 2 +- .../components/nsBrowserContentHandler.js | 22 + .../content/phishing-afterload-displayer.js | 4 + .../sessionstore/src/nsSessionStore.js | 1 + .../shell/src/nsWindowsShellService.cpp | 8 +- mozilla/browser/config/version.txt | 2 +- mozilla/browser/installer/removed-files.in | 1 + .../installer/windows/nsis/installer.nsi | 140 +- .../browser/installer/windows/nsis/shared.nsh | 7 +- .../browser/installer/windows/packages-static | 9 - mozilla/browser/locales/shipped-locales | 2 +- .../base/content/calendar-decorated-base.xml | 42 +- .../content/calendar-decorated-day-view.xml | 7 +- .../content/calendar-decorated-month-view.xml | 24 +- .../calendar-decorated-multiweek-view.xml | 22 +- .../content/calendar-decorated-week-view.xml | 7 +- .../base/content/calendar-event-dialog.xul | 5 +- .../base/content/calendar-minimonth-busy.js | 188 ++ .../base/content/calendar-month-view.xml | 41 +- .../base/content/calendar-multiday-view.xml | 232 ++- .../base/content/calendar-view-bindings.css | 5 + .../base/content/preferences/general.xul | 6 +- .../base/content/preferences/timezones.xul | 66 +- mozilla/calendar/base/jar.mn | 2 + mozilla/calendar/base/public/calICalendar.idl | 2 +- .../base/public/calIDecoratedView.idl | 5 + mozilla/calendar/base/src/calAlarmService.js | 97 +- .../calendar/base/src/calCalendarManager.js | 49 +- mozilla/calendar/base/src/calDateTime.cpp | 5 + .../calendar/base/src/calDateTimeFormatter.js | 3 +- mozilla/calendar/base/src/calICSService.cpp | 9 +- .../calendar/base/src/calRecurrenceInfo.js | 20 +- mozilla/calendar/base/src/calTodo.js | 5 +- mozilla/calendar/base/src/calUtils.js | 217 +++ mozilla/calendar/base/src/maketzdata.pl | 2 +- mozilla/calendar/base/src/tzdata.c | 2 +- .../themes/common/event-grippy-bottom.png | Bin 204 -> 179 bytes .../base/themes/common/event-grippy-left.png | Bin 228 -> 209 bytes .../base/themes/common/event-grippy-right.png | Bin 226 -> 210 bytes .../base/themes/common/event-grippy-top.png | Bin 201 -> 178 bytes .../base/themes/common/gradient-overlay.png | Bin 585 -> 280 bytes .../base/themes/common/shadow-bottom.png | Bin 211 -> 184 bytes .../base/themes/common/shadow-edge-left.png | Bin 177 -> 164 bytes .../base/themes/common/shadow-edge-right.png | Bin 179 -> 164 bytes .../base/themes/common/shadow-left.png | Bin 212 -> 205 bytes .../base/themes/common/shadow-right.png | Bin 207 -> 206 bytes .../themes/pinstripe/calendar-toolbar.css | 16 +- .../base/themes/pinstripe/calendar-views.css | 3 +- .../themes/pinstripe/mode-switch-icons.png | Bin 0 -> 13441 bytes .../themes/winstripe/calendar-toolbar.css | 32 +- .../base/themes/winstripe/calendar-views.css | 3 +- .../themes/winstripe/mode-switch-icons.png | Bin 0 -> 13441 bytes .../calendar/import-export/calHtmlExport.js | 7 + .../import-export/calMonthGridPrinter.js | 23 +- .../calendar/import-export/calWeekPrinter.js | 42 +- mozilla/calendar/installer/removed-files.in | 1 + .../installer/windows/packages-static | 2 - .../calendar/libical/src/libical/icalparser.c | 4 + mozilla/calendar/lightning/chrome.manifest | 3 +- .../calendar/lightning/content/agenda-tree.js | 27 +- .../lightning/content/calendar-management.js | 2 +- .../lightning/content/calendar-todo-list.xml | 15 +- .../lightning/content/customize-toolbar.js | 324 ++++ .../lightning/content/customize-toolbar.xul | 100 ++ .../lightning/content/imip-bar-overlay.xul | 4 +- .../calendar/lightning/content/imip-bar.js | 4 +- .../content/messenger-overlay-preferences.xul | 4 +- .../content/messenger-overlay-sidebar.js | 171 +- .../content/messenger-overlay-sidebar.xul | 270 ++- .../content/messenger-overlay-toolbar.js | 381 ++++ .../content/messenger-overlay-toolbar.xul | 219 +-- .../calendar/lightning/content/todo-list.js | 11 + mozilla/calendar/lightning/jar.mn | 4 +- .../lightning/themes/pinstripe/lightning.css | 128 ++ .../lightning/themes/winstripe/lightning.css | 128 ++ mozilla/calendar/locales/all-locales | 1 + .../en-US/chrome/calendar/calendar.dtd | 20 +- .../en-US/chrome/calendar/calendar.properties | 4 +- .../chrome/calendar/preferences/timezones.dtd | 33 +- .../en-US/chrome/calendar/wcap.properties | 34 +- .../en-US/chrome/lightning/lightning.dtd | 35 +- .../prototypes/sun-calendar-event-dialog.dtd | 1 + mozilla/calendar/locales/shipped-locales | 5 + ...endar-invitations-dialog-button-images.png | Bin 828 -> 796 bytes ...alendar-invitations-dialog-list-images.png | Bin 2242 -> 2150 bytes .../sun-calendar-event-dialog-attendees.png | Bin 5998 -> 5732 bytes .../sun-calendar-event-dialog-toolbar.png | Bin 84041 -> 79233 bytes .../pinstripe/sun-calendar-event-dialog.png | Bin 2305 -> 2153 bytes .../themes/pinstripe/timezone_-10h.png | Bin 6140 -> 1417 bytes .../themes/pinstripe/timezone_-11h.png | Bin 5738 -> 1261 bytes .../themes/pinstripe/timezone_-12h.png | Bin 5102 -> 579 bytes .../themes/pinstripe/timezone_-12h45.png | Bin 4987 -> 231 bytes .../themes/pinstripe/timezone_-1h.png | Bin 5235 -> 800 bytes .../themes/pinstripe/timezone_-2h.png | Bin 5306 -> 646 bytes .../themes/pinstripe/timezone_-3h.png | Bin 5907 -> 1300 bytes .../themes/pinstripe/timezone_-3h30.png | Bin 5088 -> 518 bytes .../themes/pinstripe/timezone_-4h.png | Bin 6342 -> 1455 bytes .../themes/pinstripe/timezone_-5h.png | Bin 5866 -> 1183 bytes .../themes/pinstripe/timezone_-6h.png | Bin 5480 -> 1022 bytes .../themes/pinstripe/timezone_-7h.png | Bin 5670 -> 1145 bytes .../themes/pinstripe/timezone_-8h.png | Bin 5642 -> 1035 bytes .../themes/pinstripe/timezone_-8h30.png | Bin 4983 -> 231 bytes .../themes/pinstripe/timezone_-9h.png | Bin 5724 -> 1137 bytes .../themes/pinstripe/timezone_-9h30.png | Bin 5080 -> 531 bytes .../themes/pinstripe/timezone_0h.png | Bin 5594 -> 1022 bytes .../themes/pinstripe/timezone_10h.png | Bin 6109 -> 1309 bytes .../themes/pinstripe/timezone_10h30.png | Bin 4983 -> 225 bytes .../themes/pinstripe/timezone_11h.png | Bin 6143 -> 1373 bytes .../themes/pinstripe/timezone_11h30.png | Bin 4989 -> 232 bytes .../themes/pinstripe/timezone_12h.png | Bin 7267 -> 1677 bytes .../themes/pinstripe/timezone_12h45.png | Bin 4986 -> 229 bytes .../themes/pinstripe/timezone_13h.png | Bin 5060 -> 528 bytes .../themes/pinstripe/timezone_14h.png | Bin 5141 -> 613 bytes .../themes/pinstripe/timezone_1h.png | Bin 6225 -> 1377 bytes .../themes/pinstripe/timezone_2h.png | Bin 6457 -> 1494 bytes .../themes/pinstripe/timezone_3h.png | Bin 6258 -> 1421 bytes .../themes/pinstripe/timezone_3h30.png | Bin 5290 -> 776 bytes .../themes/pinstripe/timezone_4h.png | Bin 6149 -> 1328 bytes .../themes/pinstripe/timezone_4h30.png | Bin 5159 -> 724 bytes .../themes/pinstripe/timezone_5h.png | Bin 6537 -> 1545 bytes .../themes/pinstripe/timezone_5h30.png | Bin 5478 -> 912 bytes .../themes/pinstripe/timezone_5h45.png | Bin 6457 -> 1531 bytes .../themes/pinstripe/timezone_6h.png | Bin 6457 -> 1531 bytes .../themes/pinstripe/timezone_6h30.png | Bin 5219 -> 759 bytes .../themes/pinstripe/timezone_7h.png | Bin 6454 -> 1537 bytes .../themes/pinstripe/timezone_8h.png | Bin 6995 -> 1697 bytes .../themes/pinstripe/timezone_9h.png | Bin 6551 -> 1554 bytes .../themes/pinstripe/timezone_9h30.png | Bin 5162 -> 570 bytes .../themes/pinstripe/timezone_map.png | Bin 50356 -> 15288 bytes ...endar-invitations-dialog-button-images.png | Bin 828 -> 796 bytes ...alendar-invitations-dialog-list-images.png | Bin 2242 -> 2150 bytes .../sun-calendar-event-dialog-attendees.png | Bin 5998 -> 5732 bytes .../sun-calendar-event-dialog-toolbar.png | Bin 77917 -> 73760 bytes .../winstripe/sun-calendar-event-dialog.png | Bin 2305 -> 2153 bytes .../themes/winstripe/timezone_-10h.png | Bin 6140 -> 1417 bytes .../themes/winstripe/timezone_-11h.png | Bin 5738 -> 1261 bytes .../themes/winstripe/timezone_-12h.png | Bin 5102 -> 579 bytes .../themes/winstripe/timezone_-12h45.png | Bin 4987 -> 231 bytes .../themes/winstripe/timezone_-1h.png | Bin 5235 -> 800 bytes .../themes/winstripe/timezone_-2h.png | Bin 5306 -> 646 bytes .../themes/winstripe/timezone_-3h.png | Bin 5907 -> 1300 bytes .../themes/winstripe/timezone_-3h30.png | Bin 5088 -> 518 bytes .../themes/winstripe/timezone_-4h.png | Bin 6342 -> 1455 bytes .../themes/winstripe/timezone_-5h.png | Bin 5866 -> 1183 bytes .../themes/winstripe/timezone_-6h.png | Bin 5480 -> 1022 bytes .../themes/winstripe/timezone_-7h.png | Bin 5670 -> 1145 bytes .../themes/winstripe/timezone_-8h.png | Bin 5642 -> 1035 bytes .../themes/winstripe/timezone_-8h30.png | Bin 4983 -> 231 bytes .../themes/winstripe/timezone_-9h.png | Bin 5724 -> 1137 bytes .../themes/winstripe/timezone_-9h30.png | Bin 5080 -> 531 bytes .../themes/winstripe/timezone_0h.png | Bin 5594 -> 1022 bytes .../themes/winstripe/timezone_10h.png | Bin 6109 -> 1309 bytes .../themes/winstripe/timezone_10h30.png | Bin 4983 -> 225 bytes .../themes/winstripe/timezone_11h.png | Bin 6143 -> 1373 bytes .../themes/winstripe/timezone_11h30.png | Bin 4989 -> 232 bytes .../themes/winstripe/timezone_12h.png | Bin 7267 -> 1677 bytes .../themes/winstripe/timezone_12h45.png | Bin 4986 -> 229 bytes .../themes/winstripe/timezone_13h.png | Bin 5060 -> 528 bytes .../themes/winstripe/timezone_14h.png | Bin 5141 -> 613 bytes .../themes/winstripe/timezone_1h.png | Bin 6225 -> 1377 bytes .../themes/winstripe/timezone_2h.png | Bin 6457 -> 1494 bytes .../themes/winstripe/timezone_3h.png | Bin 6258 -> 1421 bytes .../themes/winstripe/timezone_3h30.png | Bin 5290 -> 776 bytes .../themes/winstripe/timezone_4h.png | Bin 6149 -> 1328 bytes .../themes/winstripe/timezone_4h30.png | Bin 5159 -> 724 bytes .../themes/winstripe/timezone_5h.png | Bin 6537 -> 1545 bytes .../themes/winstripe/timezone_5h30.png | Bin 5478 -> 912 bytes .../themes/winstripe/timezone_5h45.png | Bin 6457 -> 1531 bytes .../themes/winstripe/timezone_6h.png | Bin 6457 -> 1531 bytes .../themes/winstripe/timezone_6h30.png | Bin 5219 -> 759 bytes .../themes/winstripe/timezone_7h.png | Bin 6454 -> 1537 bytes .../themes/winstripe/timezone_8h.png | Bin 6995 -> 1697 bytes .../themes/winstripe/timezone_9h.png | Bin 6551 -> 1554 bytes .../themes/winstripe/timezone_9h30.png | Bin 5162 -> 570 bytes .../themes/winstripe/timezone_map.png | Bin 50356 -> 15288 bytes .../wcap/lightning-wcap/Makefile.in | 3 + .../wcap/lightning-wcap/install.rdf | 2 +- .../sun-calendar-event-dialog-attendees.xml | 169 +- .../sun-calendar-event-dialog-attendees.xul | 1 - ...lendar-event-dialog-recurrence-preview.xml | 2 + .../sun-calendar-event-dialog-recurrence.xml | 8 +- .../sun-calendar-event-dialog-recurrence.xul | 1 - .../sun-calendar-event-dialog-reminder.xul | 1 - .../sun-calendar-event-dialog-timezone.xul | 67 +- .../wcap/sun-calendar-event-dialog.css | 17 +- .../wcap/sun-calendar-event-dialog.js | 38 +- .../wcap/sun-calendar-event-dialog.xul | 4 +- .../wcap/sun-messenger-overlay-sidebar.xul | 14 +- .../prototypes/wcap/wcap-enabler/Makefile.in | 3 + .../prototypes/wcap/wcap-enabler/install.rdf | 2 +- .../composite/calCompositeCalendar.js | 4 +- .../gdata/components/calGoogleCalendar.js | 42 +- .../components/calGoogleCalendarModule.js | 4 +- .../gdata/components/calGoogleRequest.js | 6 +- .../gdata/components/calGoogleSession.js | 8 +- .../gdata/components/calGoogleUtils.js | 158 +- mozilla/calendar/providers/gdata/install.rdf | 12 +- .../calendar/providers/ics/calICSCalendar.js | 70 +- .../providers/storage/calStorageCalendar.js | 2 +- .../calendar/providers/storage/schema-4.sql | 100 ++ .../calendar/providers/storage/schema-5.sql | 106 ++ .../calendar/providers/storage/schema-6.sql | 106 ++ .../calendar/providers/storage/schema-7.sql | 166 ++ mozilla/calendar/providers/wcap/Makefile.in | 34 +- .../providers/wcap/calWcapCachedCalendar.js | 37 +- .../providers/wcap/calWcapCalendar.js | 37 +- .../providers/wcap/calWcapCalendarItems.js | 257 +-- .../providers/wcap/calWcapCalendarModule.js | 37 +- .../calendar/providers/wcap/calWcapErrors.js | 107 +- .../calendar/providers/wcap/calWcapRequest.js | 37 +- .../calendar/providers/wcap/calWcapSession.js | 210 ++- .../calendar/providers/wcap/calWcapUtils.js | 39 +- .../providers/wcap/public/Makefile.in | 34 +- .../wcap/public/calIWcapCalendar.idl | 37 +- .../providers/wcap/public/calIWcapErrors.idl | 37 +- .../providers/wcap/public/calIWcapRequest.idl | 37 +- .../resources/content/applicationUtil.js | 223 --- .../calendar/resources/content/calendar.js | 9 + .../resources/content/calendarManagement.js | 24 +- .../content/datetimepickers/minimonth.xml | 241 ++- .../resources/content/mouseoverPreviews.js | 187 +- .../resources/content/unifinderToDo.js | 5 + .../datetimepickers/datetimepickers.css | 6 +- .../classic/datetimepickers/minimonth.css | 16 +- mozilla/calendar/sunbird/app/module.ver | 4 +- .../sunbird/base/content/calendar-scripts.inc | 5 + .../sunbird/base/content/calendar.xul | 20 +- .../sunbird/base/content/credits.xhtml | 1 + mozilla/calendar/sunbird/config/version.txt | 2 +- .../themes/pinstripe/sunbird/calendar.css | 37 +- .../sunbird/datetimepickers/minimonth.css | 20 +- .../themes/winstripe/sunbird/calendar.css | 37 +- .../sunbird/datetimepickers/minimonth.css | 23 +- mozilla/camino/Camino.xcode/project.pbxproj | 144 +- mozilla/camino/Info-Camino.plist | 6 +- mozilla/camino/Info-CaminoStatic.plist | 6 +- mozilla/camino/Makefile.in | 15 +- .../PreferencePanes/Appearance/Appearance.h | 4 +- .../PreferencePanes/Appearance/Appearance.mm | 205 ++- .../camino/PreferencePanes/History/History.mm | 123 +- .../English.lproj/Navigation.nib/info.nib | 2 +- .../Navigation.nib/keyedobjects.nib | Bin 11271 -> 11255 bytes mozilla/camino/docs/Release Notes 1-0-5.rtf | 172 ++ mozilla/camino/installer/Makefile.in | 2 +- .../resources/application/ad_blocking.css | 35 +- .../{all-camino.js => all-camino.js.in} | 5 +- .../images/chrome/tab_menu_button.tif | Bin 0 -> 1410 bytes .../resources/images/chrome/tab_overflow.tif | Bin 470 -> 0 bytes .../images/chrome/tab_scroll_button_left.tif | Bin 0 -> 1482 bytes .../images/chrome/tab_scroll_button_right.tif | Bin 0 -> 1482 bytes .../BookmarkInfoPanel.nib/classes.nib | 4 +- .../BookmarkInfoPanel.nib/info.nib | 10 +- .../BookmarkInfoPanel.nib/keyedobjects.nib | Bin 14239 -> 14242 bytes .../BookmarksEditing.nib/info.nib | 8 +- .../BookmarksEditing.nib/keyedobjects.nib | Bin 27022 -> 27034 bytes .../English.lproj/BrowserWindow.nib/info.nib | 66 +- .../BrowserWindow.nib/keyedobjects.nib | Bin 32703 -> 32530 bytes .../localized/English.lproj/InfoPlist.strings | Bin 460 -> 472 bytes .../English.lproj/Localizable.strings | Bin 38176 -> 38106 bytes .../English.lproj/SearchURLList.plist | 2 +- .../camino/src/application/MainController.mm | 18 +- .../bookmarks/AddBookmarkDialogController.mm | 8 +- .../camino/src/bookmarks/AddressBookManager.m | 5 +- mozilla/camino/src/bookmarks/Bookmark.h | 22 +- mozilla/camino/src/bookmarks/Bookmark.mm | 191 +- mozilla/camino/src/bookmarks/BookmarkFolder.h | 19 +- .../camino/src/bookmarks/BookmarkFolder.mm | 175 +- .../bookmarks/BookmarkImportDlgController.mm | 2 +- .../src/bookmarks/BookmarkInfoController.h | 4 +- .../src/bookmarks/BookmarkInfoController.mm | 22 +- mozilla/camino/src/bookmarks/BookmarkItem.h | 44 +- mozilla/camino/src/bookmarks/BookmarkItem.mm | 82 +- .../camino/src/bookmarks/BookmarkManager.h | 2 +- .../camino/src/bookmarks/BookmarkManager.mm | 155 +- .../camino/src/bookmarks/BookmarkToolbar.h | 1 - .../camino/src/bookmarks/BookmarkToolbar.mm | 32 +- .../src/bookmarks/BookmarkViewController.h | 2 +- .../src/bookmarks/BookmarkViewController.mm | 30 +- .../camino/src/bookmarks/nsAboutBookmarks.mm | 2 +- .../camino/src/browser/BrowserContentViews.mm | 3 +- .../camino/src/browser/BrowserTabBarView.h | 12 +- .../camino/src/browser/BrowserTabBarView.mm | 408 +++-- mozilla/camino/src/browser/BrowserTabView.mm | 10 +- .../src/browser/BrowserWindowController.h | 11 +- .../src/browser/BrowserWindowController.mm | 59 +- mozilla/camino/src/browser/BrowserWrapper.h | 1 - mozilla/camino/src/browser/BrowserWrapper.mm | 24 +- .../camino/src/browser/RemoteDataProvider.h | 2 +- .../camino/src/browser/nsAlertController.mm | 2 + .../src/download/ProgressViewController.mm | 2 +- .../camino/src/embedding/CHBrowserListener.mm | 17 +- .../src/embedding/CHPermissionManager.h | 108 ++ .../src/embedding/CHPermissionManager.mm | 279 +++ .../src/extensions/ExtendedOutlineView.mm | 14 - mozilla/camino/src/extensions/NSDate+Utils.h | 6 - mozilla/camino/src/extensions/NSDate+Utils.m | 43 - .../src/extensions/NSPasteboard+Utils.mm | 6 +- .../camino/src/extensions/NSString+Utils.mm | 2 +- .../src/extensions/RolloverImageButton.m | 1 + mozilla/camino/src/find/FindDlgController.mm | 4 +- mozilla/camino/src/formfill/KeychainService.h | 16 +- .../camino/src/formfill/KeychainService.mm | 324 ++-- .../camino/src/history/HistoryDataSource.mm | 16 +- .../src/history/HistoryOutlineViewDelegate.mm | 98 ++ .../src/preferences/PreferenceManager.h | 4 +- mozilla/caps/src/nsPrincipal.cpp | 39 +- mozilla/caps/src/nsScriptSecurityManager.cpp | 36 +- mozilla/chrome/src/nsChromeRegistry.cpp | 7 +- mozilla/client.mk | 4 +- mozilla/config/milestone.txt | 2 +- mozilla/configure | 2 +- mozilla/configure.in | 2 +- mozilla/content/base/public/nsIContent.h | 27 +- mozilla/content/base/public/nsIDocument.h | 42 +- mozilla/content/base/src/nsContentUtils.cpp | 2 +- mozilla/content/base/src/nsDocument.cpp | 16 +- mozilla/content/base/src/nsDocument.h | 1 + mozilla/content/base/src/nsFrameLoader.cpp | 7 + mozilla/content/base/src/nsGenericElement.cpp | 186 +- mozilla/content/base/src/nsGenericElement.h | 8 + mozilla/content/base/src/nsXMLHttpRequest.cpp | 9 +- .../canvas/src/nsCanvasRenderingContext2D.cpp | 15 +- .../html/content/src/nsHTMLCanvasElement.cpp | 10 +- .../html/document/src/nsHTMLDocument.cpp | 161 +- .../html/document/src/nsHTMLDocument.h | 3 +- .../content/xbl/src/nsXBLPrototypeBinding.cpp | 7 +- .../content/xul/content/src/nsXULElement.cpp | 8 +- mozilla/directory/c-sdk/config/OpenBSD.mk | 12 +- mozilla/directory/c-sdk/configure.in | 9 +- mozilla/docshell/base/nsDocShell.cpp | 160 +- mozilla/docshell/base/nsDocShell.h | 16 +- mozilla/dom/public/base/nsPIDOMWindow.h | 30 +- mozilla/dom/src/base/nsDOMClassInfo.cpp | 52 +- mozilla/dom/src/base/nsGlobalWindow.cpp | 221 +-- mozilla/dom/src/base/nsGlobalWindow.h | 10 +- mozilla/dom/src/jsurl/nsJSProtocolHandler.cpp | 6 +- .../src/nsComposerCommandsUpdater.cpp | 26 +- .../composer/src/nsComposerCommandsUpdater.h | 6 +- .../editor/libeditor/base/PlaceholderTxn.cpp | 6 +- mozilla/editor/libeditor/base/nsEditor.cpp | 90 +- .../editor/libeditor/html/nsHTMLCSSUtils.cpp | 15 +- .../editor/libeditor/html/nsHTMLEditRules.cpp | 31 +- .../editor/libeditor/html/nsHTMLEditor.cpp | 22 +- .../editor/libeditor/text/nsTextEditRules.cpp | 9 +- .../browser/photon/tests/Makefile.in | 4 + .../browser/photon/tests/TestPhEmbed.cpp | 28 +- .../components/windowwatcher/src/Makefile.in | 1 + .../windowwatcher/src/nsWindowWatcher.cpp | 57 +- mozilla/extensions/cck/browser/install.rdf | 2 +- .../locales/en-US/chrome/cckWizard.dtd | 20 +- .../resources/content/cckwizard/bookmark.xul | 8 +- .../resources/content/cckwizard/cckwizard.js | 164 +- .../resources/content/cckwizard/cckwizard.xul | 7 +- .../resources/content/cckwizard/reg.xul | 2 +- .../content/cckwizard/srcfiles/cck.js.in | 20 + .../cckwizard/srcfiles/cckService.js.in | 7 +- .../cckwizard/srcfiles/install.rdf.mip.in | 2 +- .../src/nsSpatialNavigation.cpp | 115 +- .../src/nsSpatialNavigationPrivate.h | 1 + .../src/nsSpatialNavigationUtils.cpp | 7 +- .../source/xpath/XFormsFunctionCall.cpp | 40 +- .../source/xpath/XFormsFunctions.h | 8 +- .../source/xpath/nsIXFormsXPathEvaluator.h | 26 +- .../source/xpath/nsXFormsXPathEvaluator.cpp | 10 +- .../source/xpath/nsXFormsXPathEvaluator.h | 7 +- .../source/xpath/txXPathAtomList.h | 1 + mozilla/extensions/xforms/Makefile.in | 2 +- .../xforms/nsXFormsActionElement.cpp | 28 +- .../extensions/xforms/nsXFormsActionElement.h | 10 +- .../xforms/nsXFormsInsertDeleteElement.cpp | 691 ++++++-- .../xforms/nsXFormsModelElement.cpp | 29 +- .../xforms/nsXFormsSubmissionElement.cpp | 138 +- .../xforms/nsXFormsSubmissionElement.h | 1 + mozilla/extensions/xforms/nsXFormsUtils.cpp | 4 +- .../xforms/nsXFormsXPathAnalyzer.cpp | 12 +- .../extensions/xforms/nsXFormsXPathAnalyzer.h | 4 +- .../xforms/resources/content/xforms-xhtml.xml | 15 +- .../resources/locale/en-US/xforms.properties | 1 + mozilla/gfx/cairo/cairo/src/cairo-gstate.c | 2 +- .../gfx/cairo/cairo/src/cairo-os2-surface.c | 127 +- mozilla/gfx/cairo/cairo/src/cairo-pen.c | 5 +- mozilla/gfx/src/gtk/nsFontMetricsGTK.cpp | 25 +- mozilla/gfx/src/os2/nsImageOS2.cpp | 17 +- mozilla/gfx/src/windows/nsFontMetricsWin.cpp | 1 + mozilla/gfx/src/windows/nsImageWin.cpp | 4 + mozilla/js/src/jsapi.c | 29 + mozilla/js/src/jsapi.h | 19 + mozilla/js/src/jscpucfg.c | 5 + mozilla/js/src/jsfun.c | 13 +- mozilla/js/src/jsinterp.c | 16 +- mozilla/js/src/jsobj.c | 142 +- mozilla/js/src/jsobj.h | 4 + mozilla/js/src/jsopcode.c | 14 +- mozilla/js/src/jsprvtd.h | 1 - mozilla/js/src/jspubtd.h | 1 + mozilla/js/src/jsscope.c | 3 + .../js/src/xpconnect/src/XPCNativeWrapper.cpp | 17 +- mozilla/js/src/xpconnect/src/nsXPConnect.cpp | 21 +- .../js/src/xpconnect/src/xpccomponents.cpp | 11 + mozilla/js/src/xpconnect/src/xpcmodule.cpp | 4 +- mozilla/js/src/xpconnect/src/xpcprivate.h | 24 +- .../js/src/xpconnect/src/xpcthreadcontext.cpp | 75 +- .../src/xpconnect/src/xpcwrappedjsclass.cpp | 38 + .../xpconnect/src/xpcwrappednativejsops.cpp | 2 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 21 +- mozilla/layout/base/nsDocumentViewer.cpp | 3 + mozilla/layout/base/nsLayoutAtomList.h | 1 + mozilla/layout/build/nsContentDLF.cpp | 4 + mozilla/layout/forms/nsTextControlFrame.cpp | 29 +- mozilla/layout/forms/nsTextControlFrame.h | 6 +- mozilla/layout/generic/nsBlockFrame.cpp | 19 +- mozilla/layout/generic/nsBlockFrame.h | 11 +- mozilla/layout/generic/nsFrame.cpp | 3 +- mozilla/layout/generic/nsFrameList.cpp | 31 - mozilla/layout/generic/nsFrameList.h | 4 - mozilla/layout/generic/nsInlineFrame.cpp | 106 +- mozilla/layout/generic/nsInlineFrame.h | 11 + mozilla/layout/generic/nsLineLayout.h | 2 + mozilla/layout/generic/nsSelection.cpp | 2 +- mozilla/layout/style/nsRuleNode.cpp | 4 +- .../svg/base/src/nsSVGOuterSVGFrame.cpp | 13 + mozilla/layout/svg/base/src/nsSVGUtils.cpp | 22 + mozilla/layout/svg/base/src/nsSVGUtils.h | 10 + .../layout/svg/renderer/src/cairo/Makefile.in | 2 + .../src/cairo/nsSVGCairoGlyphGeometry.cpp | 10 +- .../src/cairo/nsSVGCairoPathGeometry.cpp | 8 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 4 +- .../layout/xul/base/src/nsLeafBoxFrame.cpp | 6 +- .../layout/xul/base/src/nsMenuPopupFrame.cpp | 4 +- .../xul/base/src/nsNativeScrollbarFrame.cpp | 8 +- .../xul/base/src/nsNativeScrollbarFrame.h | 2 +- mozilla/layout/xul/base/src/nsSliderFrame.cpp | 79 +- mozilla/layout/xul/base/src/nsSliderFrame.h | 12 +- .../layout/xul/base/src/nsSplitterFrame.cpp | 41 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 150 +- .../xul/base/src/tree/src/nsTreeBodyFrame.h | 23 +- .../xul/base/src/tree/src/nsTreeBoxObject.cpp | 7 +- mozilla/mail/app/module.ver | 4 +- mozilla/mail/app/profile/all-thunderbird.js | 4 +- mozilla/mail/base/content/credits.xhtml | 35 +- mozilla/mail/base/content/macMenuOverlay.xul | 8 +- .../src/nsSeamonkeyProfileMigrator.cpp | 51 +- .../mail/components/nsMailDefaultHandler.js | 33 +- .../components/preferences/downloadactions.js | 13 +- .../components/preferences/preferences.xul | 11 +- .../components/shell/nsMailWinIntegration.cpp | 14 +- mozilla/mail/config/version.txt | 2 +- .../mail/installer/windows/nsis/installer.nsi | 119 +- .../mail/installer/windows/nsis/shared.nsh | 16 +- mozilla/mail/license.html | 49 +- .../addrbook/resources/content/abDragDrop.js | 12 +- mozilla/mailnews/addrbook/src/nsVCard.cpp | 2 +- .../resources/content/am-identity-edit.js | 11 +- .../base/prefs/resources/content/am-junk.js | 20 +- .../base/prefs/resources/content/am-junk.xul | 2 - .../base/resources/content/mailWidgets.xml | 2 +- .../resources/content/msgHdrViewOverlay.js | 22 +- .../base/search/src/nsMsgSearchTerm.cpp | 5 +- mozilla/mailnews/base/src/nsMsgDBView.cpp | 2 +- .../mailnews/base/src/nsMsgPrintEngine.cpp | 4 +- .../base/util/nsImapMoveCoalescer.cpp | 5 + mozilla/mailnews/compose/src/nsMsgSend.cpp | 1 + .../palmsync/conduit/MozABConduitSync.cpp | 13 +- .../mailnews/extensions/palmsync/install.rdf | 2 +- .../imap/src/nsImapFlagAndUidState.cpp | 3 + .../mailnews/imap/src/nsImapMailFolder.cpp | 3 +- .../mailnews/local/src/nsLocalMailFolder.cpp | 37 +- mozilla/mailnews/local/src/nsParseMailbox.cpp | 51 +- mozilla/mailnews/local/src/nsParseMailbox.h | 2 + mozilla/mailnews/local/src/nsPop3Protocol.cpp | 87 +- mozilla/mailnews/mailnews.js | 2 + mozilla/minimo/chrome/content/minimo.js | 13 + mozilla/minimo/customization/all.js | 2 +- mozilla/modules/libimg/png/MOZCHANGES | 2 + mozilla/modules/libimg/png/pngrutil.c | 3 + .../libpr0n/decoders/icon/nsIconURI.cpp | 9 +- .../libpr0n/decoders/xbm/nsXBMDecoder.cpp | 14 +- .../plugin/base/src/ns4xPluginInstance.cpp | 67 + mozilla/netwerk/base/src/nsFileStreams.cpp | 16 +- mozilla/netwerk/base/src/nsURLHelperOS2.cpp | 2 + mozilla/netwerk/base/src/nsURLHelperOSX.cpp | 2 + mozilla/netwerk/base/src/nsURLHelperUnix.cpp | 2 + mozilla/netwerk/base/src/nsURLHelperWin.cpp | 2 + mozilla/netwerk/cookie/public/nsICookie2.idl | 9 + mozilla/netwerk/cookie/src/nsCookie.cpp | 7 +- mozilla/netwerk/cookie/src/nsCookie.h | 8 +- .../netwerk/cookie/src/nsCookieService.cpp | 176 +- mozilla/netwerk/cookie/src/nsCookieService.h | 6 +- mozilla/nsprpub/pr/include/prinit.h | 4 +- mozilla/rdf/base/src/nsRDFXMLDataSource.cpp | 33 +- mozilla/rdf/chrome/src/nsChromeRegistry.cpp | 17 + .../ssl/src/nsCertVerificationThread.cpp | 6 +- .../manager/ssl/src/nsNSSCertificateDB.cpp | 8 +- .../security/manager/ssl/src/nsNSSIOLayer.cpp | 3 + .../security/manager/ssl/src/nsNSSIOLayer.h | 4 + .../security/manager/ssl/src/nsSSLThread.cpp | 122 +- .../security/nss/lib/ckfw/builtins/Makefile | 4 +- .../security/nss/lib/ckfw/builtins/certdata.c | 1535 ++++++++++++++--- .../nss/lib/ckfw/builtins/certdata.txt | 1201 ++++++++++++- .../security/nss/lib/ckfw/builtins/nssckbi.h | 4 +- .../commandlines/public/Makefile.in | 1 + .../public/nsICommandLineValidator.idl | 70 + .../commandlines/src/nsCommandLine.cpp | 64 +- mozilla/toolkit/components/nsDefaultCLH.js | 1 - .../passwordmgr/base/nsPasswordManager.cpp | 2 +- mozilla/toolkit/content/license.html | 49 +- mozilla/toolkit/library/Makefile.in | 2 +- .../mozapps/installer/windows/nsis/common.nsh | 166 +- .../content/pluginInstallerDatasource.js | 30 +- .../plugins/content/pluginInstallerService.js | 7 +- .../plugins/content/pluginInstallerWizard.js | 7 +- .../mozapps/update/src/nsUpdateService.js.in | 15 +- mozilla/toolkit/xre/nsAppRunner.cpp | 113 +- mozilla/toolkit/xre/nsXREDirProvider.cpp | 21 +- mozilla/view/src/nsView.cpp | 9 +- mozilla/widget/src/beos/nsAppShell.cpp | 11 +- mozilla/widget/src/beos/nsAppShell.h | 4 +- mozilla/widget/src/beos/nsDragService.cpp | 3 + mozilla/widget/src/beos/nsDragService.h | 6 +- mozilla/widget/src/beos/nsSwitchToUIThread.h | 31 + mozilla/widget/src/beos/nsToolkit.cpp | 1 - mozilla/widget/src/beos/nsToolkit.h | 4 - mozilla/widget/src/beos/nsWindow.cpp | 556 +++--- mozilla/widget/src/beos/nsWindow.h | 54 +- mozilla/widget/src/cocoa/nsChildView.mm | 61 +- mozilla/widget/src/photon/nsDragService.cpp | 2 +- mozilla/widget/src/photon/nsWidget.cpp | 3 +- mozilla/widget/src/windows/nsWindow.cpp | 113 -- mozilla/xpcom/build/nsXPCOMCID.h | 7 + mozilla/xpcom/threads/Makefile.in | 1 + mozilla/xpcom/threads/nsEventQueue.cpp | 35 + .../xpcom/threads/nsIEventQueueListener.idl | 66 + mozilla/xpcom/threads/nsThread.cpp | 14 +- .../global/resources/content/license.html | 49 +- mozilla/xpinstall/src/nsXPInstallManager.cpp | 17 + 546 files changed, 13726 insertions(+), 5336 deletions(-) create mode 100644 mozilla/calendar/base/content/calendar-minimonth-busy.js create mode 100644 mozilla/calendar/base/themes/pinstripe/mode-switch-icons.png create mode 100644 mozilla/calendar/base/themes/winstripe/mode-switch-icons.png create mode 100644 mozilla/calendar/lightning/content/customize-toolbar.js create mode 100644 mozilla/calendar/lightning/content/customize-toolbar.xul create mode 100644 mozilla/calendar/lightning/content/messenger-overlay-toolbar.js create mode 100755 mozilla/calendar/providers/storage/schema-4.sql create mode 100755 mozilla/calendar/providers/storage/schema-5.sql create mode 100755 mozilla/calendar/providers/storage/schema-6.sql create mode 100755 mozilla/calendar/providers/storage/schema-7.sql create mode 100644 mozilla/camino/docs/Release Notes 1-0-5.rtf rename mozilla/camino/resources/application/{all-camino.js => all-camino.js.in} (96%) create mode 100644 mozilla/camino/resources/images/chrome/tab_menu_button.tif delete mode 100644 mozilla/camino/resources/images/chrome/tab_overflow.tif create mode 100644 mozilla/camino/resources/images/chrome/tab_scroll_button_left.tif create mode 100644 mozilla/camino/resources/images/chrome/tab_scroll_button_right.tif create mode 100644 mozilla/camino/src/embedding/CHPermissionManager.h create mode 100644 mozilla/camino/src/embedding/CHPermissionManager.mm create mode 100644 mozilla/toolkit/components/commandlines/public/nsICommandLineValidator.idl create mode 100644 mozilla/xpcom/threads/nsIEventQueueListener.idl diff --git a/mozilla/accessible/src/atk/nsAccessibleHyperText.cpp b/mozilla/accessible/src/atk/nsAccessibleHyperText.cpp index 9620f8db07f..321502401ce 100644 --- a/mozilla/accessible/src/atk/nsAccessibleHyperText.cpp +++ b/mozilla/accessible/src/atk/nsAccessibleHyperText.cpp @@ -91,6 +91,8 @@ void nsAccessibleHyperText::Shutdown() PRBool nsAccessibleHyperText::GetAllTextChildren(nsPresContext *aPresContext, nsIFrame *aCurFrame, nsIDOMNode* aNode, PRBool &bSave) { + NS_ENSURE_TRUE(mTextChildren, PR_FALSE); + while (aCurFrame) { nsIAtom* frameType = aCurFrame->GetType(); @@ -143,6 +145,8 @@ PRInt32 nsAccessibleHyperText::GetIndex() nsIDOMNode* nsAccessibleHyperText::FindTextNodeByOffset(PRInt32 aOffset, PRInt32& aBeforeLength) { + NS_ENSURE_TRUE(mTextChildren, nsnull); + aBeforeLength = 0; PRUint32 index, count; @@ -183,6 +187,8 @@ nsresult nsAccessibleHyperText::GetTextHelper(EGetTextType aType, nsAccessibleTe /* attribute long caretOffset; */ NS_IMETHODIMP nsAccessibleHyperText::GetCaretOffset(PRInt32 *aCaretOffset) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aCaretOffset = 0; PRInt32 charCount, caretOffset; @@ -209,6 +215,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetCaretOffset(PRInt32 *aCaretOffset) NS_IMETHODIMP nsAccessibleHyperText::SetCaretOffset(PRInt32 aCaretOffset) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + PRInt32 beforeLength; nsIDOMNode* domNode = FindTextNodeByOffset(aCaretOffset, beforeLength); if (domNode) { @@ -222,6 +230,8 @@ NS_IMETHODIMP nsAccessibleHyperText::SetCaretOffset(PRInt32 aCaretOffset) /* readonly attribute long characterCount; */ NS_IMETHODIMP nsAccessibleHyperText::GetCharacterCount(PRInt32 *aCharacterCount) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aCharacterCount = 0; PRInt32 charCount; @@ -240,6 +250,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetCharacterCount(PRInt32 *aCharacterCount) /* readonly attribute long selectionCount; */ NS_IMETHODIMP nsAccessibleHyperText::GetSelectionCount(PRInt32 *aSelectionCount) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aSelectionCount = 0; PRInt32 selCount; @@ -258,6 +270,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetSelectionCount(PRInt32 *aSelectionCount) /* AString getText (in long startOffset, in long endOffset); */ NS_IMETHODIMP nsAccessibleHyperText::GetText(PRInt32 aStartOffset, PRInt32 aEndOffset, nsAString & aText) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + if (aEndOffset == -1) GetCharacterCount(&aEndOffset); @@ -392,6 +406,8 @@ NS_IMETHODIMP nsAccessibleHyperText::RemoveSelection(PRInt32 aSelectionNum) // ------- nsIAccessibleHyperText --------------- /* readonly attribute long links; */NS_IMETHODIMP nsAccessibleHyperText::GetLinks(PRInt32 *aLinks) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aLinks = 0; PRUint32 index, count; @@ -409,6 +425,8 @@ NS_IMETHODIMP nsAccessibleHyperText::RemoveSelection(PRInt32 aSelectionNum) /* nsIAccessibleHyperLink getLink (in long index); */ NS_IMETHODIMP nsAccessibleHyperText::GetLink(PRInt32 aIndex, nsIAccessibleHyperLink **aLink) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + PRUint32 index, count, linkCount = 0; mTextChildren->GetLength(&count); for (index = 0; index < count; index++) { @@ -456,6 +474,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetLink(PRInt32 aIndex, nsIAccessibleHyperL /* long getLinkIndex (in long charIndex); */ NS_IMETHODIMP nsAccessibleHyperText::GetLinkIndex(PRInt32 aCharIndex, PRInt32 *aLinkIndex) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aLinkIndex = -1; PRInt32 beforeLength_unused; PRUint32 nodeIndex; @@ -476,6 +496,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetLinkIndex(PRInt32 aCharIndex, PRInt32 *a /* long getSelectedLinkIndex (); */ NS_IMETHODIMP nsAccessibleHyperText::GetSelectedLinkIndex(PRInt32 *aSelectedLinkIndex) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *aSelectedLinkIndex = -1; PRUint32 count; @@ -503,6 +525,8 @@ NS_IMETHODIMP nsAccessibleHyperText::GetSelectedLinkIndex(PRInt32 *aSelectedLink nsresult nsAccessibleHyperText::GetBounds(nsIWeakReference *aWeakShell, PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height) { + NS_ENSURE_TRUE(mTextChildren, NS_ERROR_FAILURE); + *x = *y = *width = *height = 0; nsRect unionRectTwips; diff --git a/mozilla/accessible/src/html/nsHTMLLinkAccessible.cpp b/mozilla/accessible/src/html/nsHTMLLinkAccessible.cpp index 2bd062826f1..d8df4807a7b 100644 --- a/mozilla/accessible/src/html/nsHTMLLinkAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLLinkAccessible.cpp @@ -44,7 +44,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsHTMLLinkAccessible, nsLinkableAccessible) nsHTMLLinkAccessible::nsHTMLLinkAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell, nsIFrame *aFrame): -nsLinkableAccessible(aDomNode, aShell), mFrame(aFrame) +nsLinkableAccessible(aDomNode, aShell) { } @@ -81,24 +81,3 @@ NS_IMETHODIMP nsHTMLLinkAccessible::GetState(PRUint32 *aState) return NS_OK; } - -nsIFrame* nsHTMLLinkAccessible::GetFrame() -{ - if (mWeakShell) { - if (!mFrame) { - mFrame = nsLinkableAccessible::GetFrame(); - } - return mFrame; - } - return nsnull; -} - -NS_IMETHODIMP nsHTMLLinkAccessible::FireToolkitEvent(PRUint32 aEvent, - nsIAccessible *aTarget, - void *aData) -{ - if (aEvent == nsIAccessibleEvent::EVENT_HIDE) { - mFrame = nsnull; // Invalidate cached frame - } - return nsLinkableAccessible::FireToolkitEvent(aEvent, aTarget, aData); -} diff --git a/mozilla/accessible/src/html/nsHTMLLinkAccessible.h b/mozilla/accessible/src/html/nsHTMLLinkAccessible.h index 95bb4af17fd..2e231ab2e03 100644 --- a/mozilla/accessible/src/html/nsHTMLLinkAccessible.h +++ b/mozilla/accessible/src/html/nsHTMLLinkAccessible.h @@ -52,16 +52,6 @@ public: NS_IMETHOD GetName(nsAString& _retval); NS_IMETHOD GetRole(PRUint32 *_retval); NS_IMETHOD GetState(PRUint32 *_retval); - - // nsPIAccessNode - NS_IMETHOD_(nsIFrame *) GetFrame(void); - - // nsPIAccessible - NS_IMETHOD FireToolkitEvent(PRUint32 aEvent, nsIAccessible *aTarget, - void *aData); - -private: - nsIFrame *mFrame; }; #endif diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp index 2c350a2aad9..77fe4331cfc 100644 --- a/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.cpp @@ -804,13 +804,26 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetRole(PRUint32 *_retval) NS_IMETHODIMP nsHTMLComboboxAccessible::Shutdown() { - nsHTMLSelectableAccessible::Shutdown(); + // Need to hold these locally while we call Shutdown() on them. + nsCOMPtr textFieldAcc(do_QueryInterface(mComboboxTextFieldAccessible)); + nsCOMPtr buttonAcc(do_QueryInterface(mComboboxButtonAccessible)); + nsCOMPtr listAcc(do_QueryInterface(mComboboxListAccessible)); + if (listAcc) { + listAcc->Shutdown(); + NS_ASSERTION(mComboboxTextFieldAccessible == nsnull, "why didn't InvalidateChildren clear this?"); + } + if (buttonAcc) { + buttonAcc->Shutdown(); + } + if (textFieldAcc) { + textFieldAcc->Shutdown(); + } mComboboxTextFieldAccessible = nsnull; mComboboxButtonAccessible = nsnull; mComboboxListAccessible = nsnull; - return NS_OK; + return nsHTMLSelectableAccessible::Shutdown(); } NS_IMETHODIMP nsHTMLComboboxAccessible::Init() @@ -889,6 +902,7 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetFirstChild(nsIAccessible **aFirstChil *aFirstChild = mFirstChild; } else { + NS_ASSERTION(!mComboboxTextFieldAccessible, "I already have a text field accessible!"); nsHTMLComboboxTextFieldAccessible* accessible = new nsHTMLComboboxTextFieldAccessible(this, mDOMNode, mWeakShell); *aFirstChild = accessible; @@ -901,6 +915,14 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetFirstChild(nsIAccessible **aFirstChil return NS_OK; } +NS_IMETHODIMP nsHTMLComboboxAccessible::InvalidateChildren() +{ + mComboboxTextFieldAccessible = nsnull; + mComboboxButtonAccessible = nsnull; + mComboboxListAccessible = nsnull; + return nsAccessible::InvalidateChildren(); +} + NS_IMETHODIMP nsHTMLComboboxAccessible::GetDescription(nsAString& aDescription) { // Use description of currently focused option @@ -980,6 +1002,7 @@ NS_IMETHODIMP nsHTMLComboboxTextFieldAccessible::GetNextSibling(nsIAccessible ** *aNextSibling = accessible; if (!*aNextSibling) return NS_ERROR_FAILURE; + mNextSibling = *aNextSibling; accessible->Init(); } NS_ADDREF(*aNextSibling); @@ -1235,6 +1258,7 @@ NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetNextSibling(nsIAccessible **aNe *aNextSibling = accessible; if (!*aNextSibling) return NS_ERROR_OUT_OF_MEMORY; + mNextSibling = *aNextSibling; accessible->Init(); } NS_ADDREF(*aNextSibling); diff --git a/mozilla/accessible/src/html/nsHTMLSelectAccessible.h b/mozilla/accessible/src/html/nsHTMLSelectAccessible.h index e5d57cb99fb..9e3e91a93c0 100644 --- a/mozilla/accessible/src/html/nsHTMLSelectAccessible.h +++ b/mozilla/accessible/src/html/nsHTMLSelectAccessible.h @@ -205,6 +205,7 @@ public: NS_IMETHOD GetDescription(nsAString& aDescription); NS_IMETHOD Shutdown(); NS_IMETHOD Init(); + NS_IMETHOD InvalidateChildren(); protected: already_AddRefed GetFocusedOptionAccessible(); diff --git a/mozilla/accessible/src/html/nsHTMLTextAccessible.cpp b/mozilla/accessible/src/html/nsHTMLTextAccessible.cpp index 3332ca75565..791994b3b86 100644 --- a/mozilla/accessible/src/html/nsHTMLTextAccessible.cpp +++ b/mozilla/accessible/src/html/nsHTMLTextAccessible.cpp @@ -49,7 +49,7 @@ #include "nsISelectionController.h" nsHTMLTextAccessible::nsHTMLTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell, nsIFrame *aFrame): -nsTextAccessibleWrap(aDomNode, aShell), mFrame(aFrame) +nsTextAccessibleWrap(aDomNode, aShell) { } @@ -76,27 +76,6 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetName(nsAString& aName) return rv; } -nsIFrame* nsHTMLTextAccessible::GetFrame() -{ - if (!mWeakShell) { - return nsnull; - } - if (!mFrame) { - mFrame = nsTextAccessible::GetFrame(); - } - return mFrame; -} - -NS_IMETHODIMP nsHTMLTextAccessible::FireToolkitEvent(PRUint32 aEvent, - nsIAccessible *aTarget, - void *aData) -{ - if (aEvent == nsIAccessibleEvent::EVENT_HIDE) { - mFrame = nsnull; // Invalidate cached frame - } - return nsTextAccessibleWrap::FireToolkitEvent(aEvent, aTarget, aData); -} - NS_IMETHODIMP nsHTMLTextAccessible::GetState(PRUint32 *aState) { nsTextAccessible::GetState(aState); diff --git a/mozilla/accessible/src/html/nsHTMLTextAccessible.h b/mozilla/accessible/src/html/nsHTMLTextAccessible.h index 22b41361fd4..abfea964a85 100644 --- a/mozilla/accessible/src/html/nsHTMLTextAccessible.h +++ b/mozilla/accessible/src/html/nsHTMLTextAccessible.h @@ -53,16 +53,6 @@ public: // nsIAccessible NS_IMETHOD GetName(nsAString& _retval); NS_IMETHOD GetState(PRUint32 *aState); - - // nsPIAccessNode - NS_IMETHOD_(nsIFrame *) GetFrame(void); - - // nsPIAccessible - NS_IMETHOD FireToolkitEvent(PRUint32 aEvent, nsIAccessible *aTarget, - void *aData); - -private: - nsIFrame *mFrame; // Only valid if node is not shut down (mWeakShell != null) }; class nsHTMLHRAccessible : public nsLeafAccessible diff --git a/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp b/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp index d5bf110b279..a0860f47dd8 100644 --- a/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp +++ b/mozilla/accessible/src/msaa/nsAccessibleWrap.cpp @@ -251,7 +251,9 @@ STDMETHODIMP nsAccessibleWrap::get_accChild( nsCOMPtr childAccessible; GetChildAt(varChild.lVal - 1, getter_AddRefs(childAccessible)); - *ppdispChild = NativeAccessible(childAccessible); + if (childAccessible) { + *ppdispChild = NativeAccessible(childAccessible); + } return (*ppdispChild)? S_OK: E_FAIL; } @@ -1015,6 +1017,10 @@ NS_IMETHODIMP nsAccessibleWrap::GetNativeInterface(void **aOutAccessible) IDispatch *nsAccessibleWrap::NativeAccessible(nsIAccessible *aXPAccessible) { + if (!aXPAccessible) { + return NULL; + } + nsCOMPtr accObject(do_QueryInterface(aXPAccessible)); if (accObject) { void* hwnd; diff --git a/mozilla/accessible/src/xul/nsXULSelectAccessible.cpp b/mozilla/accessible/src/xul/nsXULSelectAccessible.cpp index c3b837609d7..d7b003aded2 100644 --- a/mozilla/accessible/src/xul/nsXULSelectAccessible.cpp +++ b/mozilla/accessible/src/xul/nsXULSelectAccessible.cpp @@ -182,11 +182,7 @@ NS_IMETHODIMP nsXULSelectableAccessible::RefSelection(PRInt32 aIndex, nsIAccessi xulSelect->GetSelectedItem(getter_AddRefs(tempDOMNode)); if (tempDOMNode) { - nsCOMPtr tempAccess; - accService->GetAccessibleInWeakShell(tempDOMNode, mWeakShell, getter_AddRefs(tempAccess)); - *_retval = tempAccess; - NS_ADDREF(*_retval); - return NS_OK; + return accService->GetAccessibleInWeakShell(tempDOMNode, mWeakShell, _retval); } return NS_ERROR_FAILURE; diff --git a/mozilla/browser/app/module.ver b/mozilla/browser/app/module.ver index bdab6f54cb3..bbb211d7969 100644 --- a/mozilla/browser/app/module.ver +++ b/mozilla/browser/app/module.ver @@ -1,7 +1,7 @@ WIN32_MODULE_COMPANYNAME=Mozilla Corporation WIN32_MODULE_COPYRIGHT=©Firefox and Mozilla Developers, according to the MPL 1.1/GPL 2.0/LGPL 2.1 licenses, as applicable. -WIN32_MODULE_PRODUCTVERSION=2,0,0,4 -WIN32_MODULE_PRODUCTVERSION_STRING=2.0.0.4pre +WIN32_MODULE_PRODUCTVERSION=2,0,0,5 +WIN32_MODULE_PRODUCTVERSION_STRING=2.0.0.5pre WIN32_MODULE_TRADEMARKS=Firefox is a Trademark of The Mozilla Foundation. WIN32_MODULE_DESCRIPTION=Firefox WIN32_MODULE_PRODUCTNAME=Firefox diff --git a/mozilla/browser/components/bookmarks/content/bookmarks.js b/mozilla/browser/components/bookmarks/content/bookmarks.js index 398198f3e20..6fc348fb885 100644 --- a/mozilla/browser/components/bookmarks/content/bookmarks.js +++ b/mozilla/browser/components/bookmarks/content/bookmarks.js @@ -1662,7 +1662,7 @@ var BookmarksUtils = { if (aSelection.length > 1) gBkmkTxnSvc.endBatch(); if (aSelection.length > kBATCH_LIMIT && aAction != "move") - BMDS.beginUpdateBatch(); + BMDS.endUpdateBatch(); return true; }, diff --git a/mozilla/browser/components/feeds/src/FeedWriter.js b/mozilla/browser/components/feeds/src/FeedWriter.js index 24ddcb5d056..36fcb812d62 100755 --- a/mozilla/browser/components/feeds/src/FeedWriter.js +++ b/mozilla/browser/components/feeds/src/FeedWriter.js @@ -285,7 +285,7 @@ FeedWriter.prototype = { var entryContainer = this._document.createElementNS(HTML_NS, "div"); entryContainer.className = "entry"; - // If the entry has a title, make it a like + // If the entry has a title, make it a link if (entry.title) { var a = this._document.createElementNS(HTML_NS, "a"); a.appendChild(this._document.createTextNode(entry.title.plainText())); diff --git a/mozilla/browser/components/nsBrowserContentHandler.js b/mozilla/browser/components/nsBrowserContentHandler.js index c0c6905833f..42d782a3313 100644 --- a/mozilla/browser/components/nsBrowserContentHandler.js +++ b/mozilla/browser/components/nsBrowserContentHandler.js @@ -61,6 +61,7 @@ const nsIWindowWatcher = Components.interfaces.nsIWindowWatcher; const nsICategoryManager = Components.interfaces.nsICategoryManager; const nsIWebNavigationInfo = Components.interfaces.nsIWebNavigationInfo; const nsIBrowserSearchService = Components.interfaces.nsIBrowserSearchService; +const nsICommandLineValidator = Components.interfaces.nsICommandLineValidator; const NS_BINDING_ABORTED = 0x804b0002; const NS_ERROR_WONT_HANDLE_CONTENT = 0x805d0001; @@ -301,6 +302,7 @@ var nsBrowserContentHandler = { !iid.equals(nsICommandLineHandler) && !iid.equals(nsIBrowserHandler) && !iid.equals(nsIContentHandler) && + !iid.equals(nsICommandLineValidator) && !iid.equals(nsIFactory)) throw Components.errors.NS_ERROR_NO_INTERFACE; @@ -604,6 +606,21 @@ var nsBrowserContentHandler = { request.cancel(NS_BINDING_ABORTED); }, + /* nsICommandLineValidator */ + validate : function bch_validate(cmdLine) { + // Other handlers may use osint so only handle the osint flag if the url + // flag is also present and the command line is valid. + var osintFlagIdx = cmdLine.findFlag("osint", false); + var urlFlagIdx = cmdLine.findFlag("url", false); + if (urlFlagIdx > -1 && (osintFlagIdx > -1 || + cmdLine.state == nsICommandLine.STATE_REMOTE_EXPLICIT)) { + var urlParam = cmdLine.getArgument(urlFlagIdx + 1); + if (cmdLine.length != urlFlagIdx + 2 || /firefoxurl:/.test(urlParam)) + throw NS_ERROR_ABORT; + cmdLine.handleFlag("osint", false) + } + }, + /* nsIFactory */ createInstance: function bch_CI(outer, iid) { if (outer != null) @@ -866,6 +883,9 @@ var Module = { catMan.addCategoryEntry("command-line-handler", "x-default", dch_contractID, true, true); + catMan.addCategoryEntry("command-line-validator", + "b-browser", + bch_contractID, true, true); }, unregisterSelf : function mod_unregself(compMgr, location, type) { @@ -880,6 +900,8 @@ var Module = { "m-browser", true); catMan.deleteCategoryEntry("command-line-handler", "x-default", true); + catMan.deleteCategoryEntry("command-line-validator", + "b-browser", true); }, canUnload: function(compMgr) { diff --git a/mozilla/browser/components/safebrowsing/content/phishing-afterload-displayer.js b/mozilla/browser/components/safebrowsing/content/phishing-afterload-displayer.js index 3fc2ada3d94..e874b78066d 100644 --- a/mozilla/browser/components/safebrowsing/content/phishing-afterload-displayer.js +++ b/mozilla/browser/components/safebrowsing/content/phishing-afterload-displayer.js @@ -172,6 +172,10 @@ PROT_PhishMsgDisplayerBase.prototype.getMeOutOfHereUrl_ = function() { try { url = prefs.getComplexValue("browser.startup.homepage", Ci.nsIPrefLocalizedString).data; + // If url is a pipe-delimited set of pages, just take the first one. + // This will need to change once bug 221445 is fixed. + if (url.indexOf("|") != -1) + url = url.split("|")[0]; } catch(e) { G_Debug(this, "Couldn't get homepage pref: " + e); } diff --git a/mozilla/browser/components/sessionstore/src/nsSessionStore.js b/mozilla/browser/components/sessionstore/src/nsSessionStore.js index b66906a8a33..d970bd1cee2 100644 --- a/mozilla/browser/components/sessionstore/src/nsSessionStore.js +++ b/mozilla/browser/components/sessionstore/src/nsSessionStore.js @@ -315,6 +315,7 @@ SessionStoreService.prototype = { delete aBrowser.parentNode.__SS_data; }); }); + this._lastWindowClosed = null; this._clearDisk(); // also clear all data about closed tabs for (ix in this._windows) { diff --git a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp index 53a2d50c8dc..f04b8ec5e54 100644 --- a/mozilla/browser/components/shell/src/nsWindowsShellService.cpp +++ b/mozilla/browser/components/shell/src/nsWindowsShellService.cpp @@ -151,7 +151,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey, // // HKCU\SOFTWARE\Classes\FirefoxHTML\ // DefaultIcon (default) REG_SZ ,1 -// shell\open\command (default) REG_SZ -url "%1" -requestPending +// shell\open\command (default) REG_SZ -requestPending -osint -url "%1" // shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,, // shell\open\ddeexec NoActivateHandler REG_SZ // \Application (default) REG_SZ Firefox @@ -163,7 +163,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey, // EditFlags REG_DWORD 2 // FriendlyTypeName REG_SZ URL // DefaultIcon (default) REG_SZ ,1 -// shell\open\command (default) REG_SZ -url "%1" -requestPending +// shell\open\command (default) REG_SZ -requestPending -osint -url "%1" // shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,, // shell\open\ddeexec NoActivateHandler REG_SZ // \Application (default) REG_SZ Firefox @@ -177,7 +177,7 @@ OpenKeyForWriting(HKEY aStartKey, const char* aKeyName, HKEY* aKey, // // HKCU\SOFTWARE\Classes\\ // DefaultIcon (default) REG_SZ ,1 -// shell\open\command (default) REG_SZ -url "%1" -requestPending +// shell\open\command (default) REG_SZ -requestPending -osint -url "%1" // shell\open\ddeexec (default) REG_SZ "%1",,0,0,,,, // shell\open\ddeexec NoActivateHandler REG_SZ // \Application (default) REG_SZ Firefox @@ -232,7 +232,7 @@ typedef struct { #define CLS_HTML "FirefoxHTML" #define CLS_URL "FirefoxURL" #define VAL_FILE_ICON "%APPPATH%,1" -#define VAL_OPEN "%APPPATH% -url \"%1\" -requestPending" +#define VAL_OPEN "%APPPATH% -requestPending -osint -url \"%1\"" #define MAKE_KEY_NAME1(PREFIX, MID) \ PREFIX MID diff --git a/mozilla/browser/config/version.txt b/mozilla/browser/config/version.txt index 7c279fe1d08..78cea6d9627 100644 --- a/mozilla/browser/config/version.txt +++ b/mozilla/browser/config/version.txt @@ -1 +1 @@ -2.0.0.4pre +2.0.0.5pre diff --git a/mozilla/browser/installer/removed-files.in b/mozilla/browser/installer/removed-files.in index f33cf13a5d1..cecac2628fa 100644 --- a/mozilla/browser/installer/removed-files.in +++ b/mozilla/browser/installer/removed-files.in @@ -7,6 +7,7 @@ chrome/app-chrome.manifest chrome/overlayinfo/ chrome/m3ffxtbr.manifest chrome/m3ffxtbr.jar +defaults/existing-profile-defaults.js defaults/pref/all.js defaults/pref/security-prefs.js defaults/pref/winpref.js diff --git a/mozilla/browser/installer/windows/nsis/installer.nsi b/mozilla/browser/installer/windows/nsis/installer.nsi index 41978ce6436..ae09dc710f6 100755 --- a/mozilla/browser/installer/windows/nsis/installer.nsi +++ b/mozilla/browser/installer/windows/nsis/installer.nsi @@ -80,6 +80,7 @@ Var fhUninstallLog !insertmacro WordReplace !insertmacro GetSize !insertmacro GetParameters +!insertmacro GetParent !insertmacro GetOptions !insertmacro GetRoot !insertmacro DriveSpace @@ -107,7 +108,7 @@ VIAddVersionKey "FileDescription" "${BrandShortName} Installer" !insertmacro CanWriteToInstallDir !insertmacro CheckDiskSpace !insertmacro AddHandlerValues -!insertmacro DisplayCopyErrMsg +!insertmacro GetSingleInstallPath !include shared.nsh @@ -189,37 +190,57 @@ Section "-Application" Section1 SetDetailsPrint textonly DetailPrint $(STATUS_CLEANUP) SetDetailsPrint none - SetOutPath $INSTDIR ; Try to delete the app's main executable and if we can't delete it try to ; close the app. This allows running an instance that is located in another ; directory and prevents the launching of the app during the installation. - ClearErrors + ; A copy of the executable is placed in a temporary directory so it can be + ; copied back in the case where a specific file is checked / found to be in + ; use that would prevent a successful install. + + ; Create a temporary backup directory. + GetTempFileName $TmpVal "$TEMP" + ${DeleteFile} $TmpVal + SetOutPath $TmpVal + ${If} ${FileExists} "$INSTDIR\${FileMainEXE}" - ${DeleteFile} "$INSTDIR\${FileMainEXE}" - ${EndIf} - ${If} ${Errors} ClearErrors - ${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL) - ; Try to delete it again to prevent launching the app while we are - ; installing. - ClearErrors - ${DeleteFile} "$INSTDIR\${FileMainEXE}" + CopyFiles /SILENT "$INSTDIR\${FileMainEXE}" "$TmpVal\${FileMainEXE}" + Delete "$INSTDIR\${FileMainEXE}" ${If} ${Errors} ClearErrors - ; Try closing the app a second time ${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL) - retry: + ; Try to delete it again to prevent launching the app while we are + ; installing. ClearErrors - ${DeleteFile} "$INSTDIR\${FileMainEXE}" + CopyFiles /SILENT "$INSTDIR\${FileMainEXE}" "$TmpVal\${FileMainEXE}" + Delete "$INSTDIR\${FileMainEXE}" ${If} ${Errors} - ; Fallback to the FileError_NoIgnore error with retry/cancel options - ${DisplayCopyErrMsg} "${FileMainEXE}" - GoTo retry + ClearErrors + ; Try closing the app a second time + ${CloseApp} "true" $(WARN_APP_RUNNING_INSTALL) + StrCpy $R1 "${FileMainEXE}" + Call CheckInUse ${EndIf} ${EndIf} ${EndIf} + StrCpy $R1 "freebl3.dll" + Call CheckInUse + + StrCpy $R1 "nssckbi.dll" + Call CheckInUse + + StrCpy $R1 "nspr4.dll" + Call CheckInUse + + StrCpy $R1 "xpicleanup.exe" + Call CheckInUse + + SetOutPath $INSTDIR + RmDir /r "$TmpVal" + ClearErrors + ; During an install Vista checks if a new entry is added under the uninstall ; registry key (e.g. ARP). When the same version of the app is installed on ; top of an existing install the key is deleted / added and the Program @@ -365,11 +386,8 @@ Section "-Application" Section1 ${EndIf} ${LogHeader} "Adding Additional Files" - ; Only for Firefox and only if they don't already exist - ; Check if QuickTime is installed and copy the contents of its plugins - ; directory into the app's plugins directory. Previously only the - ; nsIQTScriptablePlugin.xpt files was copied which is not enough to enable - ; QuickTime as a plugin. + ; Check if QuickTime is installed and copy the nsIQTScriptablePlugin.xpt from + ; its plugins directory into the app's components directory. ClearErrors ReadRegStr $R0 HKLM "Software\Apple Computer, Inc.\QuickTime" "InstallDir" ${Unless} ${Errors} @@ -377,12 +395,16 @@ Section "-Application" Section1 ${GetPathFromRegStr} Pop $R0 ${Unless} ${Errors} - GetFullPathName $R0 "$R0\Plugins" + GetFullPathName $R0 "$R0\Plugins\nsIQTScriptablePlugin.xpt" ${Unless} ${Errors} - ${LogHeader} "Copying QuickTime Plugin Files" - ${LogMsg} "Source Directory: $R0\Plugins" - StrCpy $R1 "$INSTDIR\plugins" - Call DoCopyFiles + ${LogHeader} "Copying QuickTime Scriptable Component" + CopyFiles /SILENT "$R0" "$INSTDIR\components" + ${If} ${Errors} + ${LogMsg} "** ERROR Installing File: $INSTDIR\components\nsIQTScriptablePlugin.xpt **" + ${Else} + ${LogMsg} "Installed File: $INSTDIR\components\nsIQTScriptablePlugin.xpt" + ${LogUninstall} "File: \components\nsIQTScriptablePlugin.xpt" + ${EndIf} ${EndUnless} ${EndUnless} ${EndUnless} @@ -539,7 +561,7 @@ Function installTalkback ; This will add it during install to the uninstall.log and retains the ; original disabled state from the installation. ${If} ${FileExists} "$R1\InstallDisabled" - CopyFiles "$R1\InstallDisabled" "$R0" + CopyFiles /SILENT "$R1\InstallDisabled" "$R0" ${EndIf} ; Remove the existing install of talkback RmDir /r "$R1" @@ -564,6 +586,31 @@ Function installTalkback ${EndIf} FunctionEnd +; Copies a file to a temporary backup directory and then checks if it is in use +; by attempting to delete the file. If the file is in use an error is displayed +; and the user is given the options to either retry or cancel. If cancel is +; selected then the files are restored. +Function CheckInUse + ${If} ${FileExists} "$INSTDIR\$R1" + retry: + ClearErrors + CopyFiles /SILENT "$INSTDIR\$R1" "$TmpVal\$R1" + ${Unless} ${Errors} + Delete "$INSTDIR\$R1" + ${EndUnless} + ${If} ${Errors} + StrCpy $0 "$INSTDIR\$R1" + ${WordReplace} "$(^FileError_NoIgnore)" "\r\n" "$\r$\n" "+*" $0 + MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "$0" IDRETRY retry + Delete "$TmpVal\$R1" + CopyFiles /SILENT "$TmpVal\*" "$INSTDIR\" + SetOutPath $INSTDIR + RmDir /r "$TmpVal" + Quit + ${EndIf} + ${EndIf} +FunctionEnd + ; Adds a section divider to the human readable log. Function WriteLogSeparator FileWrite $fhInstallLog "$\r$\n-------------------------------------------------------------------------------$\r$\n" @@ -645,8 +692,10 @@ Function CopyFile CreateDirectory "$R1$R3\$R7" ${If} ${Errors} ${LogMsg} "** ERROR Creating Directory: $R1$R3\$R7 **" - ${DisplayCopyErrMsg} "$R7" - GoTo retry + StrCpy $0 "$R1$R3\$R7" + ${WordReplace} "$(^FileError_NoIgnore)" "\r\n" "$\r$\n" "+*" $0 + MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "$0" IDRETRY retry + Quit ${Else} ${LogMsg} "Created Directory: $R1$R3\$R7" ${EndIf} @@ -657,25 +706,33 @@ Function CopyFile CreateDirectory "$R1$R3" ${If} ${Errors} ${LogMsg} "** ERROR Creating Directory: $R1$R3 **" - ${DisplayCopyErrMsg} "$R3" - GoTo retry + StrCpy $0 "$R1$R3" + ${WordReplace} "$(^FileError_NoIgnore)" "\r\n" "$\r$\n" "+*" $0 + MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "$0" IDRETRY retry + Quit ${Else} ${LogMsg} "Created Directory: $R1$R3" ${EndIf} ${EndUnless} ${If} ${FileExists} "$R1$R3\$R7" + ClearErrors Delete "$R1$R3\$R7" ${If} ${Errors} - ${DisplayCopyErrMsg} "$R7" - GoTo retry + ${LogMsg} "** ERROR Deleting File: $R1$R3\$R7 **" + StrCpy $0 "$R1$R3\$R7" + ${WordReplace} "$(^FileError_NoIgnore)" "\r\n" "$\r$\n" "+*" $0 + MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "$0" IDRETRY retry + Quit ${EndIf} ${EndIf} ClearErrors CopyFiles /SILENT $R9 "$R1$R3" ${If} ${Errors} ${LogMsg} "** ERROR Installing File: $R1$R3\$R7 **" - ${DisplayCopyErrMsg} "$R7" - GoTo retry + StrCpy $0 "$R1$R3\$R7" + ${WordReplace} "$(^FileError_NoIgnore)" "\r\n" "$\r$\n" "+*" $0 + MessageBox MB_RETRYCANCEL|MB_ICONQUESTION "$0" IDRETRY retry + Quit ${Else} ${LogMsg} "Installed File: $R1$R3\$R7" ${EndIf} @@ -844,6 +901,17 @@ Function leaveComponents FunctionEnd Function preDirectory + SetShellVarContext all ; Set SHCTX to HKLM + ${GetSingleInstallPath} "Software\Mozilla\${BrandFullNameInternal}" $R9 + ${If} $R9 == "false" + SetShellVarContext current ; Set SHCTX to HKCU + ${GetSingleInstallPath} "Software\Mozilla\${BrandFullNameInternal}" $R9 + ${EndIf} + + ${Unless} $R9 == "false" + StrCpy $INSTDIR "$R9" + ${EndUnless} + ${If} $InstallType != 4 ${CheckDiskSpace} $R9 ${If} $R9 != "false" diff --git a/mozilla/browser/installer/windows/nsis/shared.nsh b/mozilla/browser/installer/windows/nsis/shared.nsh index 5e9bf3bc996..824e1de147a 100755 --- a/mozilla/browser/installer/windows/nsis/shared.nsh +++ b/mozilla/browser/installer/windows/nsis/shared.nsh @@ -137,7 +137,7 @@ ${StrFilter} "$8" "+" "" "" $8 StrCpy $0 "SOFTWARE\Classes" - StrCpy $2 "$8 -url $\"%1$\" -requestPending" + StrCpy $2 "$8 -requestPending -osint -url $\"%1$\"" ; Associate the file handlers with FirefoxHTML WriteRegStr SHCTX "$0\.htm" "" "FirefoxHTML" @@ -171,8 +171,7 @@ ${StrFilter} "${FileMainEXE}" "+" "" "" $R9 StrCpy $0 "Software\Clients\StartMenuInternet\$R9" - ; Remove existing keys so we only have our settings - DeleteRegKey HKLM "$0" + WriteRegStr HKLM "$0" "" "${BrandFullName}" WriteRegStr HKLM "$0\DefaultIcon" "" "$8,0" @@ -351,7 +350,7 @@ ; Store the command to open the app with an url in a register for easy access. GetFullPathName /SHORT $8 "$INSTDIR\${FileMainEXE}" ${StrFilter} "$8" "+" "" "" $8 - StrCpy $1 "$8 -url $\"%1$\" -requestPending" + StrCpy $1 "$8 -requestPending -osint -url $\"%1$\"" ; Always set the file and protocol handlers since they may specify a ; different path and the path is used by Vista when setting associations. diff --git a/mozilla/browser/installer/windows/packages-static b/mozilla/browser/installer/windows/packages-static index e78cf104325..b7a1367cfeb 100644 --- a/mozilla/browser/installer/windows/packages-static +++ b/mozilla/browser/installer/windows/packages-static @@ -104,7 +104,6 @@ bin\components\fastfind.xpt bin\components\feeds.xpt bin\components\find.xpt bin\components\gfx.xpt -bin\components\helperAppDlg.xpt bin\components\history.xpt bin\components\htmlparser.xpt bin\components\imglib2.xpt @@ -116,7 +115,6 @@ bin\components\jsconsole.xpt bin\components\jsconsole-clhandler.js bin\components\jsd3250.dll bin\components\jsdservice.xpt -bin\components\jsurl.xpt bin\components\layout_base.xpt bin\components\layout_printing.xpt bin\components\layout_xul.xpt @@ -139,7 +137,6 @@ bin\components\necko_dns.xpt bin\components\necko_file.xpt bin\components\necko_ftp.xpt bin\components\necko_http.xpt -bin\components\necko_jar.xpt bin\components\necko_res.xpt bin\components\necko_socket.xpt bin\components\necko_viewsource.xpt @@ -149,12 +146,10 @@ bin\components\places.xpt bin\components\plugin.xpt bin\components\pref.xpt bin\components\prefetch.xpt -bin\components\prefmigr.xpt bin\components\profile.xpt bin\components\progressDlg.xpt bin\components\proxyObject.xpt bin\components\rdf.xpt -bin\components\related.xpt bin\components\satchel.xpt bin\components\saxparser.xpt bin\components\search.xpt @@ -168,7 +163,6 @@ bin\components\ucnative.xpt bin\components\uconv.xpt bin\components\unicharutil.xpt bin\components\uriloader.xpt -bin\components\util.xpt bin\components\wallet.xpt bin\components\walleteditor.xpt bin\components\walletpreview.xpt @@ -264,7 +258,6 @@ bin\res\ua.css bin\res\html.css bin\res\quirk.css bin\res\forms.css -bin\res\platform-forms.css bin\res\EditorOverride.css bin\res\table-add-column-after-active.gif bin\res\table-add-column-after-hover.gif @@ -304,7 +297,6 @@ bin\res\entityTables\* ; svg bin\gksvggdiplus.dll bin\res\svg.css -bin\res\svg.properties bin\components\dom_svg.xpt ; spellchecker (may not be present) @@ -325,7 +317,6 @@ bin\softokn3.dll bin\freebl3.chk bin\freebl3.dll bin\ssl3.dll -bin\chrome\pipnss.jar bin\chrome\pippki.jar bin\chrome\pippki.manifest diff --git a/mozilla/browser/locales/shipped-locales b/mozilla/browser/locales/shipped-locales index 4b3c67dc71f..90f0362caee 100644 --- a/mozilla/browser/locales/shipped-locales +++ b/mozilla/browser/locales/shipped-locales @@ -21,7 +21,7 @@ hu it ja-JP-mac osx ja win32 linux -ka +ka win32 linux ko ku lt diff --git a/mozilla/calendar/base/content/calendar-decorated-base.xml b/mozilla/calendar/base/content/calendar-decorated-base.xml index d0ff39ba451..5ff72d7d825 100644 --- a/mozilla/calendar/base/content/calendar-decorated-base.xml +++ b/mozilla/calendar/base/content/calendar-decorated-base.xml @@ -21,6 +21,7 @@ - the Initial Developer. All Rights Reserved. - - Contributor(s): + - Markus Adrario - - Alternatively, the contents of this file may be used under the terms of - either the GNU General Public License Version 2 or later (the "GPL"), or @@ -137,6 +138,7 @@ false + false false @@ -174,7 +176,7 @@ @@ -184,14 +186,13 @@ @@ -205,51 +206,61 @@ ]]> - + + + + + + @@ -263,8 +274,7 @@ diff --git a/mozilla/calendar/base/content/calendar-decorated-day-view.xml b/mozilla/calendar/base/content/calendar-decorated-day-view.xml index 462d873c3db..a4e7e080ca0 100644 --- a/mozilla/calendar/base/content/calendar-decorated-day-view.xml +++ b/mozilla/calendar/base/content/calendar-decorated-day-view.xml @@ -68,14 +68,15 @@ diff --git a/mozilla/calendar/base/content/calendar-decorated-month-view.xml b/mozilla/calendar/base/content/calendar-decorated-month-view.xml index 866447f2c39..ce976848b00 100644 --- a/mozilla/calendar/base/content/calendar-decorated-month-view.xml +++ b/mozilla/calendar/base/content/calendar-decorated-month-view.xml @@ -57,9 +57,7 @@ diff --git a/mozilla/calendar/base/content/calendar-decorated-multiweek-view.xml b/mozilla/calendar/base/content/calendar-decorated-multiweek-view.xml index 310c82e3772..3fb4884746f 100644 --- a/mozilla/calendar/base/content/calendar-decorated-multiweek-view.xml +++ b/mozilla/calendar/base/content/calendar-decorated-multiweek-view.xml @@ -58,9 +58,7 @@ @@ -272,9 +266,7 @@ daysOff.push(Number(i)); } } - var viewElem = document.getAnonymousElementByAttribute( - this, "anonid", "view-element"); - viewElem.daysOffArray = daysOff; + this.viewElem.daysOffArray = daysOff; ]]> diff --git a/mozilla/calendar/base/content/calendar-decorated-week-view.xml b/mozilla/calendar/base/content/calendar-decorated-week-view.xml index 309b500389a..3f28b9481e8 100644 --- a/mozilla/calendar/base/content/calendar-decorated-week-view.xml +++ b/mozilla/calendar/base/content/calendar-decorated-week-view.xml @@ -103,8 +103,9 @@ diff --git a/mozilla/calendar/base/content/calendar-event-dialog.xul b/mozilla/calendar/base/content/calendar-event-dialog.xul index c6f77a3f4ae..cc66898537c 100644 --- a/mozilla/calendar/base/content/calendar-event-dialog.xul +++ b/mozilla/calendar/base/content/calendar-event-dialog.xul @@ -65,7 +65,6 @@ - - - + + diff --git a/mozilla/calendar/prototypes/wcap/wcap-enabler/Makefile.in b/mozilla/calendar/prototypes/wcap/wcap-enabler/Makefile.in index 5244760f9bf..3914c5d844c 100644 --- a/mozilla/calendar/prototypes/wcap/wcap-enabler/Makefile.in +++ b/mozilla/calendar/prototypes/wcap/wcap-enabler/Makefile.in @@ -52,6 +52,9 @@ DEFINES += -DFIREFOX_VERSION=$(FIREFOX_VERSION) DEFINES += -DTARGET_PLATFORM=$(OS_TARGET)_$(TARGET_XPCOM_ABI) +LIGHTNING_VERSION := $(shell cat $(srcdir)/../../../sunbird/config/version.txt) +DEFINES += -DLIGHTNING_VERSION=$(LIGHTNING_VERSION) + PREF_JS_EXPORTS = $(srcdir)/wcap-enabler.js include $(topsrcdir)/config/rules.mk diff --git a/mozilla/calendar/prototypes/wcap/wcap-enabler/install.rdf b/mozilla/calendar/prototypes/wcap/wcap-enabler/install.rdf index ceb7737b74b..74f09cbeada 100644 --- a/mozilla/calendar/prototypes/wcap/wcap-enabler/install.rdf +++ b/mozilla/calendar/prototypes/wcap/wcap-enabler/install.rdf @@ -17,7 +17,7 @@ wcap-enabler@calendar.mozilla.org - 0.5 + @LIGHTNING_VERSION@ WCAP Enabler Enables support for the Sun Java System Calendar Server (WCAP) in the Lightning calendar extension. Mozilla Calendar Project diff --git a/mozilla/calendar/providers/composite/calCompositeCalendar.js b/mozilla/calendar/providers/composite/calCompositeCalendar.js index 3541f7db45c..7d8694b84a1 100644 --- a/mozilla/calendar/providers/composite/calCompositeCalendar.js +++ b/mozilla/calendar/providers/composite/calCompositeCalendar.js @@ -74,8 +74,8 @@ calCompositeCalendarObserverHelper.prototype = { this.notifyObservers("onEndBatch"); }, - onLoad: function() { - this.notifyObservers("onLoad"); + onLoad: function(calendar) { + this.notifyObservers("onLoad", [calendar]); }, onAddItem: function(aItem) { diff --git a/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js b/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js index 64c78675b46..5aac245707e 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleCalendar.js @@ -14,7 +14,7 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) + * Philipp Kewisch * Portions created by the Initial Developer are Copyright (C) 2006 * the Initial Developer. All Rights Reserved. * @@ -99,25 +99,12 @@ calGoogleCalendar.prototype = { /** * readonly attribute googleCalendarName * Google's Calendar name. This represents the in - * http://www.google.com/calendar/feeds//private/full + * http[s]://www.google.com/calendar/feeds//private/full */ get googleCalendarName() { return this.mCalendarName; }, - /** - * readonly attribute isDefaultCalendar - * Returns true if this is the default calendar of the user. - */ - get isDefaultCalendar() { - // If there is no session, use the non-default calendar identifier as a - // fallback. - return ((this.mSession && - this.mCalendarName == this.mSession.googleUser) || - (!this.mSession && - this.mCalendarName.indexOf("group.calendar.google.com") < 0)); - }, - /** * attribute session * An calGoogleSession Object that handles the session requests. @@ -240,17 +227,9 @@ calGoogleCalendar.prototype = { // Set internal Calendar Name this.mCalendarName = decodeURIComponent(matches[2]); - var ioService = Cc["@mozilla.org/network/io-service;1"]. - getService(Ci.nsIIOService); - - // Set normalized url. We need the full xml stream and private - // access. We need private visibility and full projection - this.mFullUri = ioService.newURI("http://www.google.com" + - "/calendar/feeds/" + - matches[2] + - "/private/full", - null, - null); + // Set normalized url. We need private visibility and full projection + this.mFullUri = aUri.clone(); + this.mFullUri.path = "/calendar/feeds/" + matches[2] + "/private/full"; // Remember the uri as it was passed, in case the calendar manager // relies on it. @@ -296,6 +275,9 @@ calGoogleCalendar.prototype = { this.findSession(); } + // Add the calendar to the item, for later use. + aItem.calendar = this; + this.mSession.addItem(this, aItem, this.addItem_response, @@ -351,7 +333,7 @@ calGoogleCalendar.prototype = { // to google. This saves network traffic. if (relevantFieldsMatch(aOldItem, aNewItem)) { LOG("Not requesting item modification for " + aOldItem.id + - "(" + aOldItem.title + "), relevant fields match"); + "(" + aOldItem.title + "), relevant fields match"); if (aListener != null) { aListener.onOperationComplete(this, @@ -369,6 +351,7 @@ calGoogleCalendar.prototype = { var extradata = { olditem: aOldItem, listener: aListener }; this.mSession.modifyItem(this, + aOldItem, aNewItem, this.modifyItem_response, extradata); @@ -565,8 +548,7 @@ calGoogleCalendar.prototype = { var item = this.general_response(Ci.calIOperationListener.MODIFY, aResult, aStatus, - aRequest.extraData.listener, - aRequest); + aRequest.extraData.listener); // Notify Observers if (item) { this.notifyObservers("onModifyItem", @@ -640,7 +622,7 @@ calGoogleCalendar.prototype = { this.general_response(Ci.calIOperationListener.GET, aResult, aStatus, - aRequest.extraData.listener); + aRequest.extraData); }, /** diff --git a/mozilla/calendar/providers/gdata/components/calGoogleCalendarModule.js b/mozilla/calendar/providers/gdata/components/calGoogleCalendarModule.js index 83625ca9d50..7a1ef80cbf7 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleCalendarModule.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleCalendarModule.js @@ -71,8 +71,8 @@ var calGoogleCalendarModule = { if (this.mUtilsLoaded) return; - const scripts = ["calGoogleCalendar.js", "calGoogleSession.js", - "calUtils.js", "calGoogleRequest.js", + const scripts = ["calUtils.js","calGoogleCalendar.js", + "calGoogleSession.js", "calGoogleRequest.js", "calGoogleUtils.js"]; var loader = Components.classes["@mozilla.org/moz/jssubscript-loader;1"] diff --git a/mozilla/calendar/providers/gdata/components/calGoogleRequest.js b/mozilla/calendar/providers/gdata/components/calGoogleRequest.js index 304d170a3f1..184ae61b0fe 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleRequest.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleRequest.js @@ -14,7 +14,7 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) + * Philipp Kewisch * Portions created by the Initial Developer are Copyright (C) 2006 * the Initial Developer. All Rights Reserved. * @@ -97,8 +97,6 @@ calGoogleRequest.prototype = { this.mUriString = "https://www.google.com/accounts/ClientLogin"; break; case this.META: - this.uri = "http://www.google.com/calendar/feeds/" + - encodeURIComponent(this.mSession.googleUser); // Fall through case this.GET: this.mMethod = "GET"; @@ -229,7 +227,7 @@ calGoogleRequest.prototype = { if (aSession) { this.mSession = aSession; if (this.mType == this.META) { - this.mUriString = "http://www.google.com/calendar/feeds/" + this.mUriString = aSession.uri.prePath + "/calendar/feeds/" + encodeURIComponent(aSession.googleUser); } } diff --git a/mozilla/calendar/providers/gdata/components/calGoogleSession.js b/mozilla/calendar/providers/gdata/components/calGoogleSession.js index 156283a8eaf..757339251d7 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleSession.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleSession.js @@ -431,13 +431,17 @@ calGoogleSession.prototype = { * * @param aCalendar An instance of calIGoogleCalendar this * request belongs to. - * @param aNewItem An instance of calIEvent to modify + * @param aOldItem The instance of calIEvent before + * modification. + * @param aNewItem The instance of calIEvent after + * modification. * @param aResponseListener The function in aCalendar to call at * completion. * @param aExtraData Extra data to be passed to the response * listener */ modifyItem: function cGS_modifyItem(aCalendar, + aOldItem, aNewItem, aResponseListener, aExtraData) { @@ -449,7 +453,7 @@ calGoogleSession.prototype = { this.googleFullName); request.type = request.MODIFY; - request.uri = getItemEditURI(aNewItem); + request.uri = getItemEditURI(aOldItem); request.setUploadData("application/atom+xml; charset=UTF-8", xmlEntry); request.setResponseListener(aCalendar, aResponseListener); request.extraData = aExtraData; diff --git a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js index 1c612c617a3..f43ece0ec44 100644 --- a/mozilla/calendar/providers/gdata/components/calGoogleUtils.js +++ b/mozilla/calendar/providers/gdata/components/calGoogleUtils.js @@ -14,8 +14,8 @@ * The Original Code is Google Calendar Provider code. * * The Initial Developer of the Original Code is - * Philipp Kewisch (mozilla@kewis.ch) - * Portions created by the Initial Developer are Copyright (C) 2006 + * Philipp Kewisch + * Portions created by the Initial Developer are Copyright (C) 2007 * the Initial Developer. All Rights Reserved. * * Contributor(s): @@ -493,6 +493,7 @@ function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) { if (aItem.alarmOffset) { var gdReminder = ; var alarmOffset = aItem.alarmOffset.clone(); + if (aItem.alarmRelated == Ci.calIItemBase.ALARM_RELATED_END) { // Google always uses an alarm offset related to the start time alarmOffset.addDuration(duration); @@ -500,7 +501,7 @@ function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) { // Google only accepts certain alarm values. Snap to them. See // http://code.google.com/p/google-gdata/issues/detail?id=55 - var alarmValues = [ 300, 600, 900, 1200, 1500, 1800, 2700, 3600, 7200, + const alarmValues = [ 300, 600, 900, 1200, 1500, 1800, 2700, 3600, 7200, 10800, 86400, 172800, 604800 ]; var discreteValue = alarmValues[alarmValues.length - 1] / 60; @@ -512,43 +513,26 @@ function ItemToXMLEntry(aItem, aAuthorEmail, aAuthorName) { } gdReminder.@minutes = discreteValue; + gdReminder.@method = "alert"; entry.gd::when.gd::reminder += gdReminder; } - if (!aItem.calendar.isDefaultCalendar) { - // On non-default calendars, alarms do not work as expected. This is - // an error on Google's side. We are going to work around with an - // extended property. After Google crippled alarm support, - // non-default calendars will work even better regarding alarms - at - // least in sunbird/lightning. See - // http://code.google.com/p/google-gdata/issues/detail?id=20 - - var gdExtendedReminder = ; - var alarmTime; - if (aItem.alarmOffset) { - alarmTime = aItem.startDate.clone(); - alarmTime.addDuration(aItem.alarmOffset); - } - - gdExtendedReminder.@name = "X-MOZ-ALARM-WORKAROUND"; - gdExtendedReminder.@value = toRFC3339(alarmTime); - - // Google has a bug where extendedProperty tags are not unset if the tag - // is missing from the event feed. Therefore, set the tag in any case. - entry.gd::extendedProperty += gdExtendedReminder; + // saved alarms + var otherAlarms = aItem.getProperty("X-GOOGLE-OTHERALARMS"); + for each (var alarm in otherAlarms) { + entry.gd::when.gd::reminder += new XML(alarm); } - // XXX Google currently only supports one reminder. Nevertheless, according - // to the Google Calendar API docs, snoozed events should be implemented by - // a second gd:reminder element with an absolute time. This issue is tracked - // at http://code.google.com/p/google-gdata/issues/detail?id=44 - // gd:extendedProperty (alarmLastAck) var gdAlarmLastAck = ; gdAlarmLastAck.@name = "X-MOZ-LASTACK"; gdAlarmLastAck.@value = toRFC3339(aItem.alarmLastAck); entry.gd::extendedProperty += gdAlarmLastAck; + // XXX Google now supports multiple alarms, but since the valid alarms are + // restricted to discrete values, using a normal alarm to snooze is pretty + // pointless. + // gd:extendedProperty (snooze time) var gdAlarmSnoozeTime = ; var itemSnoozeTime = aItem.getProperty("X-MOZ-SNOOZE-TIME"); @@ -658,7 +642,7 @@ function getItemEditURI(aItem) { * * @param aXMLEntry The xml data of the item * @param aTimezone The timezone the event is most likely in - * @param aCalendar The calendar the event will be added to. Can be null. + * @param aCalendar The calendar this item will belong to. * @return The calIEvent with the item data. */ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { @@ -681,8 +665,13 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { item.id = id.substring(id.lastIndexOf('/')+1); // link - item.setProperty("X-GOOGLE-EDITURL", - aXMLEntry.link.(@rel == 'edit').@href.toString()); + // Since Google doesn't set the edit url to be https if the request is + // https, we need to work around this here. + var editUrl = aXMLEntry.link.(@rel == 'edit').@href.toString(); + if (aCalendar.uri.schemeIs("https")) { + editUrl = editUrl.replace(/^http:/, "https:"); + } + item.setProperty("X-GOOGLE-EDITURL", editUrl); // title item.title = aXMLEntry.title.(@type == 'text'); @@ -730,49 +719,68 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { } // gd:reminder - var alarmOffset = Cc["@mozilla.org/calendar/duration;1"] - .createInstance(Ci.calIDuration); if (aXMLEntry.gd::originalEvent.toString().length > 0) { // If the item is an occurrence, we cannot change it until bug // 362650 has been fixed. For now, don't set alarms on // occurrences. continue; - } else if (when.gd::reminder.@absoluteTime.toString()) { - var absolute = fromRFC3339(when.gd::reminder.@absoluteTime, - aTimezone); - alarmOffset = startDate.subtractDate(absolute); - } else if (when.gd::reminder.@days.toString()) { - alarmOffset.days = -when.gd::reminder.@days; - } else if (when.gd::reminder.@hours.toString()) { - alarmOffset.hours = -when.gd::reminder.@hours; - } else if (when.gd::reminder.@minutes.toString()) { - // There is a bug in the Google API that always sets an alarm, - // even if you didn't specify it. The value is always -1. See - // http://code.google.com/p/google-gdata/issues/detail?id=43 - // As a workaround, ignore such reminders - if (when.gd::reminder.@minutes == "-1") { - continue; - } - alarmOffset.minutes = -when.gd::reminder.@minutes; - } else { - continue; } - alarmOffset.normalize(); - item.alarmOffset = alarmOffset; - item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_START; - } - // gd:extendedProperty (alarm workaround) - if (!aCalendar.isDefaultCalendar) { - var alarmTime = fromRFC3339(aXMLEntry.gd::extendedProperty - .(@name == "X-MOZ-ALARM-WORKAROUND") - .@value.toString(), aTimezone); - if (alarmTime) { - item.alarmOffset = alarmTime.subtractDate(item.startDate); - item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_START; - } else { - item.alarmOffset = null; + // Google's alarms are always related to the start + item.alarmRelated = Ci.calIItemBase.ALARM_RELATED_START; + + var lastAlarm; + var otherAlarms = []; + for each (var reminder in when.gd::reminder) { + // We are only intrested in "alert" reminders. Other types + // include sms and email alerts, but thats not the point here. + if (reminder.@method == "alert") { + var alarmOffset = Cc["@mozilla.org/calendar/duration;1"] + .createInstance(Ci.calIDuration); + + if (reminder.@absoluteTime.toString()) { + var absolute = fromRFC3339(reminder.@absoluteTime, + aTimezone); + alarmOffset = startDate.subtractDate(absolute); + } else if (reminder.@days.toString()) { + alarmOffset.days = -reminder.@days; + } else if (reminder.@hours.toString()) { + alarmOffset.hours = -reminder.@hours; + } else if (reminder.@minutes.toString()) { + alarmOffset.minutes = -reminder.@minutes; + } else { + continue; + } + alarmOffset.normalize(); + + // If there is more than one alarm, we could either take the + // alarm closest to the event or the alarm furthest to the + // event. Let the user decide (use a property) + var useClosest = getPrefSafe("calendar.google.alarmClosest", + true); + if (!item.alarmOffset || + (useClosest && + alarmOffset.compare(item.alarmOffset) > 0) || + (!useClosest && + alarmOffset.compare(item.alarmOffset) < 0)) { + + item.alarmOffset = alarmOffset; + if (lastAlarm) { + // If there was already an alarm, then it is now one + // of the other alarms. + otherAlarms.push(lastAlarm.toXMLString()); + } + lastAlarm = reminder; + // Don't push the reminder below, since we might be + // keeping this one as our item's alarmOffset. + continue; + } + } + otherAlarms.push(reminder.toXMLString()); } + + // Save other alarms that were set so we don't loose them + item.setProperty("X-GOOGLE-OTHERALARMS", otherAlarms); } // gd:extendedProperty (alarmLastAck) @@ -860,14 +868,6 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { "private").toUpperCase(); } - // updated - item.setProperty("LAST-MODIFIED", fromRFC3339(aXMLEntry.updated, - aTimezone)); - - // published - item.setProperty("CREATED", fromRFC3339(aXMLEntry.published, - aTimezone)); - // category var categories = new Array(); for each (var label in aXMLEntry.category.@label) { @@ -879,6 +879,14 @@ function XMLEntryToItem(aXMLEntry, aTimezone, aCalendar) { item.setProperty("X-GOOGLE-ITEM-IS-OCCURRENCE", aXMLEntry.gd::originalEvent.toString().length > 0); + // published + item.setProperty("CREATED", fromRFC3339(aXMLEntry.published, + aTimezone)); + + // updated (This must be set last!) + item.setProperty("LAST-MODIFIED", fromRFC3339(aXMLEntry.updated, + aTimezone)); + // TODO gd:recurrenceException: Enhancement tracked in bug 362650 // TODO gd:comments: Enhancement tracked in bug 362653 // TODO gd:who Enhancement tracked in bug 355226 diff --git a/mozilla/calendar/providers/gdata/install.rdf b/mozilla/calendar/providers/gdata/install.rdf index 81dc38eb285..e0f376b8588 100644 --- a/mozilla/calendar/providers/gdata/install.rdf +++ b/mozilla/calendar/providers/gdata/install.rdf @@ -38,9 +38,9 @@ - + {a62ef8ec-5fdc-40c2-873c-223b8a6925cc} - 0.1 + 0.2 2 {718e30fb-e89b-41dd-9da7-e25a45638b28} - 0.5pre - 0.6a* + 0.4a1 + 0.6a1 {3550f703-e582-4d05-9a08-453d09bdfdc6} - 2.0* + 2.0a1 3.0a1 @@ -76,5 +76,5 @@ Philipp Kewisch http://mozilla.kewis.ch/ chrome://gdata-provider/content/gcal.png - + diff --git a/mozilla/calendar/providers/ics/calICSCalendar.js b/mozilla/calendar/providers/ics/calICSCalendar.js index 88a79decb6c..3a3e5025ef5 100644 --- a/mozilla/calendar/providers/ics/calICSCalendar.js +++ b/mozilla/calendar/providers/ics/calICSCalendar.js @@ -170,12 +170,12 @@ calICSCalendar.prototype = { this.refresh(); }, - refresh: function() { - // Lock other changes to the item list. - this.lock(); - // set to prevent writing after loading, without any changes - this.loading = true; + refresh: function calICSCalendar_refresh() { + this.queue.push({action: 'refresh'}); + this.processQueue(); + }, + doRefresh: function calICSCalendar_doRefresh() { var ioService = Components.classes["@mozilla.org/network/io-service;1"] .getService(Components.interfaces.nsIIOService); @@ -189,6 +189,10 @@ calICSCalendar.prototype = { var streamLoader = Components.classes["@mozilla.org/network/stream-loader;1"] .createInstance(Components.interfaces.nsIStreamLoader); + + // Lock other changes to the item list. + this.lock(); + try { if (isOnBranch) { streamLoader.init(channel, this, this); @@ -268,7 +272,7 @@ calICSCalendar.prototype = { this.mObserver.onError(e.result, e.toString()); } this.mObserver.onEndBatch(); - this.mObserver.onLoad(); + this.mObserver.onLoad(this); // Now that all items have been stuffed into the memory calendar // we should add ourselves as observer. It is important that this @@ -358,8 +362,9 @@ calICSCalendar.prototype = { listener.serializer.addProperty(prop); } - this.getItems(calICalendar.ITEM_FILTER_TYPE_ALL | calICalendar.ITEM_FILTER_COMPLETED_ALL, - 0, null, null, listener); + // don't call this.getItems, because we are locked: + this.mMemoryCalendar.getItems(calICalendar.ITEM_FILTER_TYPE_ALL | calICalendar.ITEM_FILTER_COMPLETED_ALL, + 0, null, null, listener); }, // nsIStreamListener impl @@ -432,15 +437,18 @@ calICSCalendar.prototype = { }, getItem: function (aId, aListener) { - return this.mMemoryCalendar.getItem(aId, aListener); + this.queue.push({action:'get_item', id:aId, listener:aListener}); + this.processQueue(); }, getItems: function (aItemFilter, aCount, aRangeStart, aRangeEnd, aListener) { - return this.mMemoryCalendar.getItems(aItemFilter, aCount, - aRangeStart, aRangeEnd, - aListener); + this.queue.push({action:'get_items', + itemFilter:aItemFilter, count:aCount, + rangeStart:aRangeStart, rangeEnd:aRangeEnd, + listener:aListener}); + this.processQueue(); }, processQueue: function () @@ -448,23 +456,53 @@ calICSCalendar.prototype = { if (this.isLocked()) return; var a; - var hasItems = this.queue.length; + var writeICS = false; + var refreshAction = null; while ((a = this.queue.shift())) { switch (a.action) { case 'add': this.mMemoryCalendar.addItem(a.item, a.listener); + writeICS = true; break; case 'modify': this.mMemoryCalendar.modifyItem(a.newItem, a.oldItem, a.listener); + writeICS = true; break; case 'delete': this.mMemoryCalendar.deleteItem(a.item, a.listener); + writeICS = true; + break; + case 'get_item': + this.mMemoryCalendar.getItem(a.id, a.listener); + break; + case 'get_items': + this.mMemoryCalendar.getItems(a.itemFilter, a.count, + a.rangeStart, a.rangeEnd, + a.listener); + break; + case 'refresh': + refreshAction = a; break; } + if (refreshAction) { + // break queue processing here and wait for refresh to finish + // before processing further operations + break; + } } - if (hasItems) + if (writeICS) { + if (refreshAction) { + // reschedule the refresh for next round, after the file has been written; + // strictly we may not need to refresh once the file has been successfully + // written, but we don't know if that write will succeed. + this.queue.unshift(refreshAction); + } this.writeICS(); + } + else if (refreshAction) { + this.doRefresh(); + } }, lock: function () { @@ -740,9 +778,9 @@ calICSObserver.prototype = { this.mInBatch = false; }, - onLoad: function() { + onLoad: function(calendar) { for (var i = 0; i < this.mObservers.length; i++) - this.mObservers[i].onLoad(); + this.mObservers[i].onLoad(calendar); }, onAddItem: function(aItem) { for (var i = 0; i < this.mObservers.length; i++) diff --git a/mozilla/calendar/providers/storage/calStorageCalendar.js b/mozilla/calendar/providers/storage/calStorageCalendar.js index e06a03eb6aa..b46e4a20a95 100644 --- a/mozilla/calendar/providers/storage/calStorageCalendar.js +++ b/mozilla/calendar/providers/storage/calStorageCalendar.js @@ -843,7 +843,7 @@ calStorageCalendar.prototype = { // observeLoad: function () { for each (obs in this.mObservers) - obs.onLoad (); + obs.onLoad (this); }, observeBatchChange: function (aNewBatchMode) { diff --git a/mozilla/calendar/providers/storage/schema-4.sql b/mozilla/calendar/providers/storage/schema-4.sql new file mode 100755 index 00000000000..70f27c7183d --- /dev/null +++ b/mozilla/calendar/providers/storage/schema-4.sql @@ -0,0 +1,100 @@ +CREATE TABLE cal_calendar_schema_version ( + version INTEGER +); + +CREATE TABLE cal_calendars ( + id INTEGER PRIMARY KEY, + type STRING, + uri STRING +); + +CREATE TABLE cal_calendars_prefs ( + id INTEGER PRIMARY KEY, + calendar INTEGER, + name STRING, + value STRING +); + +CREATE TABLE cal_events ( + cal_id INTEGER, + id STRING, + time_created INTEGER, + last_modified INTEGER, + title STRING, + priority INTEGER, + privacy STRING, + ical_status STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + flags INTEGER, + event_start INTEGER, + event_start_tz VARCHAR, + event_end INTEGER, + event_end_tz VARCHAR, + event_stamp INTEGER, + alarm_time INTEGER, + alarm_time_tz VARCHAR +); + +CREATE TABLE cal_todos ( + cal_id INTEGER, + id STRING, + time_created INTEGER, + last_modified INTEGER, + title STRING, + priority INTEGER, + privacy STRING, + ical_status STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + flags INTEGER, + todo_entry INTEGER, + todo_entry_tz VARCHAR, + todo_due INTEGER, + todo_due_tz VARCHAR, + todo_completed INTEGER, + todo_completed_tz VARCHAR, + todo_complete INTEGER, + alarm_time INTEGER, + alarm_time_tz VARCHAR +); + +CREATE TABLE cal_attendees ( + item_id STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + attendee_id STRING, + common_name STRING, + rsvp INTEGER, + role STRING, + status STRING, + type STRING +); + +CREATE TABLE cal_recurrence ( + item_id STRING, + recur_index INTEGER, + recur_type STRING, + is_negative BOOLEAN, + dates STRING, + count INTEGER, + end_date INTEGER, + interval INTEGER, + second STRING, + minute STRING, + hour STRING, + day STRING, + monthday STRING, + yearday STRING, + weekno STRING, + month STRING, + setpos STRING +); + +CREATE TABLE cal_properties ( + item_id STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + key STRING, + value BLOB +); diff --git a/mozilla/calendar/providers/storage/schema-5.sql b/mozilla/calendar/providers/storage/schema-5.sql new file mode 100755 index 00000000000..21f1ddbc52c --- /dev/null +++ b/mozilla/calendar/providers/storage/schema-5.sql @@ -0,0 +1,106 @@ +CREATE TABLE cal_calendar_schema_version ( + version INTEGER +); + +CREATE TABLE cal_calendars ( + id INTEGER PRIMARY KEY, + type STRING, + uri STRING +); + +CREATE TABLE cal_calendars_prefs ( + id INTEGER PRIMARY KEY, + calendar INTEGER, + name STRING, + value STRING +); + +CREATE TABLE cal_events ( + cal_id INTEGER, + id STRING, + time_created INTEGER, + last_modified INTEGER, + title STRING, + priority INTEGER, + privacy STRING, + ical_status STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + flags INTEGER, + event_start INTEGER, + event_start_tz VARCHAR, + event_end INTEGER, + event_end_tz VARCHAR, + event_stamp INTEGER, + alarm_time INTEGER, + alarm_time_tz VARCHAR, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_todos ( + cal_id INTEGER, + id STRING, + time_created INTEGER, + last_modified INTEGER, + title STRING, + priority INTEGER, + privacy STRING, + ical_status STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + flags INTEGER, + todo_entry INTEGER, + todo_entry_tz VARCHAR, + todo_due INTEGER, + todo_due_tz VARCHAR, + todo_completed INTEGER, + todo_completed_tz VARCHAR, + todo_complete INTEGER, + alarm_time INTEGER, + alarm_time_tz VARCHAR, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_attendees ( + item_id STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + attendee_id STRING, + common_name STRING, + rsvp INTEGER, + role STRING, + status STRING, + type STRING +); + +CREATE TABLE cal_recurrence ( + item_id STRING, + recur_index INTEGER, + recur_type STRING, + is_negative BOOLEAN, + dates STRING, + count INTEGER, + end_date INTEGER, + interval INTEGER, + second STRING, + minute STRING, + hour STRING, + day STRING, + monthday STRING, + yearday STRING, + weekno STRING, + month STRING, + setpos STRING +); + +CREATE TABLE cal_properties ( + item_id STRING, + recurrence_id INTEGER, + recurrence_id_tz VARCHAR, + key STRING, + value BLOB +); diff --git a/mozilla/calendar/providers/storage/schema-6.sql b/mozilla/calendar/providers/storage/schema-6.sql new file mode 100755 index 00000000000..49160820cdb --- /dev/null +++ b/mozilla/calendar/providers/storage/schema-6.sql @@ -0,0 +1,106 @@ +CREATE TABLE cal_calendar_schema_version ( + version INTEGER +); + +CREATE TABLE cal_calendars ( + id INTEGER PRIMARY KEY, + type TEXT, + uri TEXT +); + +CREATE TABLE cal_calendars_prefs ( + id INTEGER PRIMARY KEY, + calendar INTEGER, + name TEXT, + value TEXT +); + +CREATE TABLE cal_events ( + cal_id INTEGER, + id TEXT, + time_created INTEGER, + last_modified INTEGER, + title TEXT, + priority INTEGER, + privacy TEXT, + ical_status TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + flags INTEGER, + event_start INTEGER, + event_start_tz TEXT, + event_end INTEGER, + event_end_tz TEXT, + event_stamp INTEGER, + alarm_time INTEGER, + alarm_time_tz TEXT, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_todos ( + cal_id INTEGER, + id TEXT, + time_created INTEGER, + last_modified INTEGER, + title TEXT, + priority INTEGER, + privacy TEXT, + ical_status TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + flags INTEGER, + todo_entry INTEGER, + todo_entry_tz TEXT, + todo_due INTEGER, + todo_due_tz TEXT, + todo_completed INTEGER, + todo_completed_tz TEXT, + todo_complete INTEGER, + alarm_time INTEGER, + alarm_time_tz TEXT, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_attendees ( + item_id TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + attendee_id TEXT, + common_name TEXT, + rsvp INTEGER, + role TEXT, + status TEXT, + type TEXT +); + +CREATE TABLE cal_recurrence ( + item_id TEXT, + recur_index INTEGER, + recur_type TEXT, + is_negative BOOLEAN, + dates TEXT, + count INTEGER, + end_date INTEGER, + interval INTEGER, + second TEXT, + minute TEXT, + hour TEXT, + day TEXT, + monthday TEXT, + yearday TEXT, + weekno TEXT, + month TEXT, + setpos TEXT +); + +CREATE TABLE cal_properties ( + item_id TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + key TEXT, + value BLOB +); diff --git a/mozilla/calendar/providers/storage/schema-7.sql b/mozilla/calendar/providers/storage/schema-7.sql new file mode 100755 index 00000000000..4208705c69d --- /dev/null +++ b/mozilla/calendar/providers/storage/schema-7.sql @@ -0,0 +1,166 @@ +CREATE TABLE cal_calendar_schema_version ( + version INTEGER +); + +CREATE TABLE cal_calendars ( + id INTEGER PRIMARY KEY, + type TEXT, + uri TEXT +); + +CREATE TABLE cal_calendars_prefs ( + -- + -- defines arbitrary preferences for a calendar + -- e.g. name, color, visibility status + -- + id INTEGER PRIMARY KEY, + calendar INTEGER, -- REFERENCES cal_calendars.id + name TEXT, + value TEXT +); + +CREATE TABLE cal_events ( + -- + -- defines an Event calendar component + -- + cal_id INTEGER, -- REFERENCES cal_calendars.id + + -- ItemBase bits + id TEXT, + time_created INTEGER, + last_modified INTEGER, + title TEXT, + priority INTEGER, + privacy TEXT, + + ical_status TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + + -- CAL_ITEM_FLAG_PRIVATE = 1 + -- CAL_ITEM_FLAG_HAS_ATTENDEES = 2 + -- CAL_ITEM_FLAG_HAS_PROPERTIES = 4 + -- CAL_ITEM_FLAG_EVENT_ALLDAY = 8 + -- CAL_ITEM_FLAG_HAS_RECURRENCE = 16 + -- CAL_ITEM_FLAG_HAS_EXCEPTIONS = 32 + flags INTEGER, + + -- Event bits + event_start INTEGER, + event_start_tz TEXT, + event_end INTEGER, + event_end_tz TEXT, + event_stamp INTEGER, + + -- Alarm bits + alarm_time INTEGER, + alarm_time_tz TEXT, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_todos ( + -- + -- defines a Todo/Task calendar component + -- + cal_id INTEGER, -- REFERENCES cal_calendars.id + + -- ItemBase bits + id TEXT, + time_created INTEGER, + last_modified INTEGER, + title TEXT, + priority INTEGER, + privacy TEXT, + + ical_status TEXT, + recurrence_id INTEGER, + recurrence_id_tz TEXT, + + -- CAL_ITEM_FLAG_PRIVATE = 1 + -- CAL_ITEM_FLAG_HAS_ATTENDEES = 2 + -- CAL_ITEM_FLAG_HAS_PROPERTIES = 4 + -- CAL_ITEM_FLAG_EVENT_ALLDAY = 8 + -- CAL_ITEM_FLAG_HAS_RECURRENCE = 16 + -- CAL_ITEM_FLAG_HAS_EXCEPTIONS = 32 + flags INTEGER, + + -- Todo bits + todo_entry INTEGER, -- date the todo is to be displayed + todo_entry_tz TEXT, + todo_due INTEGER, -- date the todo is due + todo_due_tz TEXT, + todo_completed INTEGER, -- date the todo is completed + todo_completed_tz TEXT, + todo_complete INTEGER, -- percent the todo is complete (0-100) + + -- Alarm bits + alarm_time INTEGER, + alarm_time_tz TEXT, + alarm_offset INTEGER, + alarm_related INTEGER, + alarm_last_ack INTEGER +); + +CREATE TABLE cal_attendees ( + -- + -- defines an "Attendee" within a calendar component + -- + item_id TEXT, -- REFERENCES cal_events.id respectively cal_todos.id + recurrence_id INTEGER, + recurrence_id_tz TEXT, + attendee_id TEXT, -- ID, e.g. "mailto:jsmith@host.com" + common_name TEXT, -- CN, e.g. "John Smith" or "jsmith@host.com" + rsvp INTEGER, -- RSVP expectation + role TEXT, -- participation role, e.g. "REQ-PARTICIPANT" + status TEXT, -- participation status + type TEXT +); + +CREATE TABLE cal_recurrence ( + -- + -- defines an "Recurrence Rule" within a calendar component + -- + item_id TEXT, -- REFERENCES cal_events.id respectively cal_todos.id + recur_index INTEGER, -- the index in the recurrence array of this thing + recur_type TEXT, -- values from calIRecurrenceInfo; if null, date-based + + is_negative BOOLEAN, + + -- + -- these are for date-based recurrence + -- + + dates TEXT, -- comma-separated list of dates + + -- + -- these are for rule-based recurrence + -- + count INTEGER, + end_date INTEGER, + interval INTEGER, + + -- components, comma-separated list or null + second TEXT, + minute TEXT, + hour TEXT, + day TEXT, + monthday TEXT, + yearday TEXT, + weekno TEXT, + month TEXT, + setpos TEXT +); + +CREATE TABLE cal_properties ( + -- + -- defines arbitrary property within a calendar component + -- e.g. DESCRIPTION, LOCATION, URL, + -- + item_id TEXT, -- REFERENCES cal_events.id respectively cal_todos.id + recurrence_id INTEGER, + recurrence_id_tz TEXT, + key TEXT, + value BLOB +); diff --git a/mozilla/calendar/providers/wcap/Makefile.in b/mozilla/calendar/providers/wcap/Makefile.in index 74e565d1f83..25b16372b93 100644 --- a/mozilla/calendar/providers/wcap/Makefile.in +++ b/mozilla/calendar/providers/wcap/Makefile.in @@ -1,27 +1,25 @@ -# # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ # -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. # -# The Original Code is mozilla.org code. +# The Original Code is Sun Microsystems code. # -# The Initial Developer of the Original Code is Sun Microsystems, Inc. -# Portions created by Sun Microsystems are Copyright (C) 2006 Sun -# Microsystems, Inc. All Rights Reserved. -# -# Original Author: Daniel Boelzle (daniel.boelzle@sun.com) +# The Initial Developer of the Original Code is +# Sun Microsystems, Inc. +# Portions created by the Initial Developer are Copyright (C) 2007 +# the Initial Developer. All Rights Reserved. # # Contributor(s): -# +# Daniel Boelzle # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +27,11 @@ # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the NPL, indicate your +# use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under -# the terms of any one of the NPL, the GPL or the LGPL. +# the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** diff --git a/mozilla/calendar/providers/wcap/calWcapCachedCalendar.js b/mozilla/calendar/providers/wcap/calWcapCachedCalendar.js index 3e661683676..fc443546209 100644 --- a/mozilla/calendar/providers/wcap/calWcapCachedCalendar.js +++ b/mozilla/calendar/providers/wcap/calWcapCachedCalendar.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/calWcapCalendar.js b/mozilla/calendar/providers/wcap/calWcapCalendar.js index 40f95244740..68b400ff1dd 100644 --- a/mozilla/calendar/providers/wcap/calWcapCalendar.js +++ b/mozilla/calendar/providers/wcap/calWcapCalendar.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/calWcapCalendarItems.js b/mozilla/calendar/providers/wcap/calWcapCalendarItems.js index 4d26be2e068..76f001103b2 100644 --- a/mozilla/calendar/providers/wcap/calWcapCalendarItems.js +++ b/mozilla/calendar/providers/wcap/calWcapCalendarItems.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -286,6 +285,12 @@ function diffProperty(newItem, oldItem, propName) { return val; } +const METHOD_PUBLISH = 1; +const METHOD_REQUEST = 2; +const METHOD_REPLY = 4; +const METHOD_CANCEL = 8; +const METHOD_UPDATE = 256; + calWcapCalendar.prototype.storeItem = function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc) { @@ -293,13 +298,13 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc var bIsEvent = isEvent(item); var bIsParent = isParent(item); - var bAttendeeReply = false; - var bOrgRequest = false; + var method = METHOD_PUBLISH; + var bNoSmtpNotify = false; var params = ""; var calId = this.calId; if (this.isInvitation(item)) { // REPLY - bAttendeeReply = true; + method = METHOD_REPLY; var att = getAttendeeByCalId(item.getAttendees({}), calId); if (att) { log("attendee: " + att.icalProperty.icalString, this); @@ -378,19 +383,30 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc } } + function getOrgId(item) { + return (item && item.organizer && item.organizer.id ? item.organizer.id : null); + } + var orgCalId = getCalId(item.organizer); + // xxx todo: mbu initially sets this ownerId: + if (!orgCalId) { + var orgId = getOrgId(item); + if (!orgId || (orgId == this.ownerId)) + orgCalId = calId; // patch to this calid + } + var attendees = item.getAttendees({}); if (attendees.length > 0) { - // xxx todo: why ever, X-S1CS-EMAIL is unsupported though documented - // for calprops... WTF. - bOrgRequest = true; + // xxx todo: why ever, X-S1CS-EMAIL is unsupported though documented for calprops... WTF. function encodeAttendees(atts) { - function stringSort(one, two) { + function attendeeSort(one, two) { + one = one.id; + two = two.id; if (one == two) return 0; return (one < two ? -1 : 1); } atts = atts.concat([]); - atts.sort(stringSort); + atts.sort(attendeeSort); var ret = ""; for (var i = 0; i < atts.length; ++i) { if (ret.length > 0) @@ -401,15 +417,30 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc } var attParam = encodeAttendees(attendees); if (!oldItem || attParam != encodeAttendees(oldItem.getAttendees({}))) { - params += ("&orgCalid=" + encodeURIComponent(calId)); params += ("&attendees=" + attParam); } - } - // else using just PUBLISH (method=1) + + if (orgCalId == calId) + method = METHOD_REQUEST; + else { + method = METHOD_UPDATE; + bNoSmtpNotify = true; + } + } // else using just PUBLISH else if (oldItem && oldItem.getAttendees({}).length > 0) { params += "&attendees="; // clear attendees } + if (orgCalId) { + if (!oldItem || (orgCalId != getCalId(oldItem.organizer))) + params += ("&orgCalid=" + encodeURIComponent(orgCalId)); + } + else { // might be a copy of an iTIP invitation: + var orgEmail = getOrgId(item); + if (!oldItem || (getOrgId(oldItem) != orgEmail)) + params += ("&orgEmail=" + encodeURIComponent(orgEmail)); + } + var val = item.title; if (!oldItem || val != oldItem.title) params += ("&summary=" + encodeURIComponent(val)); @@ -486,6 +517,8 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc for each (var att in attachements) { if (typeof(att) == "string") strings.push(encodeURIComponent(att)); + else if (att instanceof Components.interfaces.calIAttachment) + strings.push(encodeURIComponent(att.uri.spec)); else // xxx todo logError("only URLs supported as attachment, not: " + att, this_); } @@ -505,9 +538,9 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc var alarmParams = this.getAlarmParams(item); if (!oldItem || (this.getAlarmParams(oldItem) != alarmParams)) { - if (bOrgRequest && params.length == 0) { + if ((method == METHOD_REQUEST) && params.length == 0) { // assure no email notifications about this change: - params += "&smtp=0&smtpNotify=0"; + bNoSmtpNotify = true; } params += alarmParams; } @@ -546,12 +579,10 @@ function calWcapCalendar_storeItem(bAddItem, item, oldItem, request, netRespFunc params += ("&mod=1&rid=" + getIcalUTC(rid)); // THIS INSTANCE } - if (bOrgRequest) - params += "&method=2"; // REQUEST - else if (bAttendeeReply) - params += "&method=4"; // REPLY - // else PUBLISH (default) - + params += ("&method=" + method); + if (bNoSmtpNotify) { + params += "&smtp=0&smtpNotify=0¬ify=0"; + } params += "&replace=1"; // (update) don't append to any lists params += "&fetch=1&relativealarm=1&compressed=1&recurring=1"; params += "&emailorcalid=1&fmt-out=text%2Fcalendar"; @@ -747,6 +778,13 @@ function calWcapCalendar_deleteItem(item, listener) } params += ("&mod=1&rid=" + getIcalUTC(rid)); } + + var orgCalId = getCalId(item.organizer); + if (!orgCalId || (orgCalId != this.calId)) { + // item does not belong to this user, so son't notify: + params += "&smtp=0&smtpNotify=0¬ify=0"; + } + params += "&fmt-out=text%2Fxml"; this.issueNetworkRequest( @@ -954,79 +992,78 @@ calWcapCalendar.prototype.parseItems = function calWcapCalendar_parseItems( return items; }; -// calWcapCalendar.prototype.getItem = function( id, listener ) -// { -// // xxx todo: test -// // xxx todo: howto detect whether to call -// // fetchevents_by_id ot fetchtodos_by_id? -// // currently drag/drop is implemented for events only, -// // try events first, fallback to todos... in the future... -// this.log( ">>>>>>>>>>>>>>>> getItem() call!"); -// try { -// this.assureAccess(calIWcapCalendar.AC_COMP_READ); +calWcapCalendar.prototype.getItem = +function calWcapCalendar_getItem(id, listener) +{ + // xxx todo: test + // xxx todo: howto detect whether to call + // fetchevents_by_id ot fetchtodos_by_id? + // currently drag/drop is implemented for events only, + // try events first, fallback to todos... in the future... + + var this_ = this; + var request = new calWcapRequest( + function getItem_resp(request, err, item) { + if (listener) { + listener.onOperationComplete( + this_.superCalendar, getResultCode(err), + calIOperationListener.GET, + item.id, err ? err : item); + } + if (err) + this_.notifyError(err); + }, + log("getItem() call: id=" + id, this)); + + try { + if (!id) + throw new Components.Exception("no item id!"); + var params = "&relativealarm=1&compressed=1&recurring=1"; + params += "&emailorcalid=1&fmt-out=text%2Fcalendar&uid="; + params += encodeURIComponent(id); -// var this_ = this; -// var syncResponseFunc = function( wcapResponse ) { -// var icalRootComp = wcapResponse.data; // first statement, may throw -// var items = this_.parseItems( -// icalRootComp, -// calICalendar.ITEM_FILTER_ALL_ITEMS, -// 1, null, null ); -// if (items.length < 1) -// throw new Components.Exception("no such item!"); -// if (items.length > 1) { -// this_.notifyError( -// "unexpected number of items: " + items.length ); -// } -// item = items[0]; -// if (listener) { -// listener.onGetResult( -// this_.superCalendar, NS_OK, -// calIItemBase, -// log("getItem(): success.", this_), -// items.length, items ); -// listener.onOperationComplete( -// this_.superCalendar, NS_OK, -// calIOperationListener.GET, -// items.length == 1 ? items[0].id : null, null ); -// this_.log( "item delivered." ); -// } -// }; - -// var params = ("&relativealarm=1&compressed=1&recurring=1" + -// "&emailorcalid=1&fmt-out=text%2Fcalendar"); -// params += ("&uid=" + encodeURIComponent(id)); -// try { -// // xxx todo!!!! - -// // most common: event -// this.session.issueSyncRequest( -// this.getCommandUrl( "fetchevents_by_id" ) + params, -// stringToIcal, syncResponseFunc ); -// } -// catch (exc) { -// // try again, may be a task: -// this.session.issueSyncRequest( -// this.getCommandUrl( "fetchtodos_by_id" ) + params, -// stringToIcal, syncResponseFunc ); -// } -// } -// catch (exc) { -// if (listener != null) { -// listener.onOperationComplete( -// this.superCalendar, Components.results.NS_ERROR_FAILURE, -// calIOperationListener.GET, -// null, exc ); -// } -// if (getResultCode(exc) == calIWcapErrors.WCAP_LOGIN_FAILED) { -// // silently ignore login failed, no calIObserver UI: -// this.logError( "getItem() ignored: " + errorToString(exc) ); -// } -// else -// this.notifyError( exc ); -// } -// this.log( "getItem() returning." ); -// }; + function notifyResult(icalRootComp) { + var items = this_.parseItems(icalRootComp, calICalendar.ITEM_FILTER_ALL_ITEMS, 0, null, null); + if (items.length < 1) + throw new Components.Exception("no such item!"); + if (items.length > 1) + this_.notifyError("unexpected number of items: " + items.length); + if (listener) { + listener.onGetResult( + this_.superCalendar, NS_OK, + calIItemBase, log("getItem(): success. id=" + id, this_), + items.length, items); + } + request.execRespFunc(null, items[0]); + }; + // most common: try events first + this.issueNetworkRequest( + request, + function fetchEventById_resp(err, icalRootComp) { + if (err) { + if (getResultCode(err) != calIWcapErrors.WCAP_FETCH_EVENTS_BY_ID_FAILED) + throw err; + // try todos: + this_.issueNetworkRequest( + request, + function fetchTodosById_resp(err, icalRootComp) { + if (err) + throw err; + notifyResult(icalRootComp); + }, + stringToIcal, "fetchtodos_by_id", params, calIWcapCalendar.AC_COMP_READ); + } + else { + notifyResult(icalRootComp); + } + }, + stringToIcal, "fetchevents_by_id", params, calIWcapCalendar.AC_COMP_READ); + } + catch (exc) { + request.execRespFunc(exc); + } + return request; +}; function getItemFilterParams(itemFilter) { diff --git a/mozilla/calendar/providers/wcap/calWcapCalendarModule.js b/mozilla/calendar/providers/wcap/calWcapCalendarModule.js index 4eeee207a79..c23a00f4014 100644 --- a/mozilla/calendar/providers/wcap/calWcapCalendarModule.js +++ b/mozilla/calendar/providers/wcap/calWcapCalendarModule.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/calWcapErrors.js b/mozilla/calendar/providers/wcap/calWcapErrors.js index 353a095a904..993d3c31951 100644 --- a/mozilla/calendar/providers/wcap/calWcapErrors.js +++ b/mozilla/calendar/providers/wcap/calWcapErrors.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,14 +28,16 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ +const NS_ERROR_INVALID_ARG = Components.results.NS_ERROR_INVALID_ARG; + // // Common netwerk errors: // @@ -115,7 +116,7 @@ const g_nsNetErrorCodes = [ "The specified socket type could not be created." ]; -function netErrorToString( rc ) +function netErrorToString(rc) { if (!isNaN(rc) && getErrorModule(rc) == NS_ERROR_MODULE_NETWORK) { var i = 0; @@ -127,7 +128,8 @@ function netErrorToString( rc ) i += 2; } } - throw Components.results.NS_ERROR_INVALID_ARG; + throw new Components.Exception("No known network error code: " + rc.toString(0x10), + NS_ERROR_INVALID_ARG); } @@ -140,11 +142,11 @@ const g_wcapErrorCodes = [ /* 0 */ NS_OK, "Command successful.", /* 1 */ calIWcapErrors.WCAP_LOGIN_FAILED, "Login failed. Invalid session ID.", /* 2 */ calIWcapErrors.WCAP_LOGIN_OK_DEFAULT_CALENDAR_NOT_FOUND, "login.wcap was successful, but the default calendar for this user was not found. A new default calendar set to the userid was created.", - /* 3 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 4 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 5 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 3 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 4 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 5 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", /* 6 */ calIWcapErrors.WCAP_DELETE_EVENTS_BY_ID_FAILED, "WCAP_DELETE_EVENTS_BY_ID_FAILED", - /* 7 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 7 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", /* 8 */ calIWcapErrors.WCAP_SETCALPROPS_FAILED, "WCAP_SETCALPROPS_FAILED", /* 9 */ calIWcapErrors.WCAP_FETCH_EVENTS_BY_ID_FAILED, "WCAP_FETCH_EVENTS_BY_ID_FAILED", /* 10 */ calIWcapErrors.WCAP_CREATECALENDAR_FAILED, "WCAP_CREATECALENDAR_FAILED", @@ -233,18 +235,18 @@ const g_wcapErrorCodes = [ /* 87 */ calIWcapErrors.WCAP_ATTACHMENT_NOT_FOUND, "The attachent requested to be fetched or deleted from the server was not found.", /* / new by WCAP 4.0 */ - /* 88 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 89 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 90 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 91 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 92 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 93 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 94 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 95 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 96 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 97 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 98 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", - /* 99 */ Components.results.NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 88 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 89 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 90 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 91 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 92 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 93 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 94 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 95 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 96 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 97 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 98 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", + /* 99 */ NS_ERROR_INVALID_ARG, "No WCAP error code.", /* 11000 */ calIWcapErrors.WCAP_CDWP_ERR_MAX_CONNECTION_REACHED, "Maximum connections to back-end database reached. As connections are freed up, users can connect to the back-end.", /* 11001 */ calIWcapErrors.WCAP_CDWP_ERR_CANNOT_CONNECT, "Cannot connect to back-end server. Back-end machine might be down or DWP server is not up and running.", /* 11002 */ calIWcapErrors.WCAP_CDWP_ERR_CANNOT_RESOLVE_CALENDAR, "Front-end can’t resolve calendar to a particular back-end server.", @@ -256,35 +258,41 @@ const g_wcapErrorCodes = [ /* 11008 */ calIWcapErrors.WCAP_CDWP_ERR_CHECKVERSION_FAILED, "DWP version check failed." ]; -function wcapErrorToString( rc ) +function wcapErrorToString(rc) { - if (isNaN(rc)) - throw Components.results.NS_ERROR_INVALID_ARG; + if (isNaN(rc)) { + throw new Components.Exception("No known WCAP error code: " + rc.toString(0x10), + NS_ERROR_INVALID_ARG); + } if (rc == calIWcapErrors.WCAP_NO_ERRNO) return "No WCAP errno (missing X-NSCP-WCAP-ERRNO)."; var index = (rc - calIWcapErrors.WCAP_ERROR_BASE + 1); if (index >= 1 && index <= 108 && - g_wcapErrorCodes[index * 2] != Components.results.NS_ERROR_INVALID_ARG) + g_wcapErrorCodes[index * 2] != NS_ERROR_INVALID_ARG) { return g_wcapErrorCodes[(index * 2) + 1]; } - throw Components.results.NS_ERROR_INVALID_ARG; + throw new Components.Exception("No known WCAP error code: " + rc.toString(0x10), + NS_ERROR_INVALID_ARG); } function getWcapErrorCode(errno) { + if (errno == -5000) // semantically same error + errno = 59; var index = -1; if (errno >= -1 && errno <= 81) index = (errno + 1); else if (errno >= 11000 && errno <= 11008) index = (errno - 11000 + 100 + 1); if (index >= 0 && - g_wcapErrorCodes[index * 2] != Components.results.NS_ERROR_INVALID_ARG) + g_wcapErrorCodes[index * 2] != NS_ERROR_INVALID_ARG) { return g_wcapErrorCodes[index * 2]; } - throw Components.results.NS_ERROR_INVALID_ARG; + throw new Components.Exception("No known WCAP error no: " + errno, + NS_ERROR_INVALID_ARG); } function getWcapXmlErrno(xml) @@ -315,14 +323,7 @@ function checkWcapErrno(errno, expectedErrno) if (expectedErrno === undefined) expectedErrno = 0; // i.e. Command successful. if (errno !== undefined && errno != expectedErrno) { - var rc; - try { - rc = getWcapErrorCode(errno); - } - catch (exc) { - throw new Components.Exception( - "No WCAP error no.", Components.results.NS_ERROR_INVALID_ARG); - } + var rc = getWcapErrorCode(errno); throw new Components.Exception(wcapErrorToString(rc), rc); } } @@ -366,7 +367,7 @@ function errorToString(err) case null: case NS_OK: return "NS_OK"; - case Components.results.NS_ERROR_INVALID_ARG: + case NS_ERROR_INVALID_ARG: return "NS_ERROR_INVALID_ARG"; case Components.results.NS_ERROR_NO_INTERFACE: return "NS_ERROR_NO_INTERFACE"; diff --git a/mozilla/calendar/providers/wcap/calWcapRequest.js b/mozilla/calendar/providers/wcap/calWcapRequest.js index 247213fac7d..9ef12b3089b 100644 --- a/mozilla/calendar/providers/wcap/calWcapRequest.js +++ b/mozilla/calendar/providers/wcap/calWcapRequest.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/calWcapSession.js b/mozilla/calendar/providers/wcap/calWcapSession.js index 49feeb64ac0..24514234f4a 100644 --- a/mozilla/calendar/providers/wcap/calWcapSession.js +++ b/mozilla/calendar/providers/wcap/calWcapSession.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -413,7 +412,7 @@ calWcapSession.prototype = { throw new Components.Exception( "missing X-NSCP-WCAP-SESSION-ID in\n" + str); } - sessionId = prop.value; + sessionId = prop.value; log("login succeeded: " + sessionId, this_); } catch (exc) { @@ -461,8 +460,7 @@ calWcapSession.prototype = { // set BEFORE notification // (about to go offline, nsIOService.cpp). // WTF. - url = (this.sessionUri.spec + "logout.wcap?fmt-out=text%2Fxml&id=" + - encodeURIComponent(this.m_sessionId)); + url = (this.sessionUri.spec + "logout.wcap?fmt-out=text%2Fxml&id=" + this.m_sessionId); this.m_sessionId = null; } this.m_credentials = null; @@ -568,42 +566,33 @@ calWcapSession.prototype = { throw err; this_.credentials.userPrefs = data; log("installed user prefs.", this_); - - this_.issueNetworkRequest_( - request, - function calprops_resp(err, data) { - if (err) - throw err; - // string to xml converter func without WCAP errno check: - if (!data || data.length == 0) { // assuming time-out - throw new Components.Exception( - "Login failed. Invalid session ID.", - calIWcapErrors.WCAP_LOGIN_FAILED); - } - var xml = getDomParser().parseFromString(data, "text/xml"); - var nodeList = xml.getElementsByTagName("iCal"); - for (var i = 0; i < nodeList.length; ++i) { - var node = nodeList.item(i); - var ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node); - if ((ar.length > 0) && (ar[0] == this_.defaultCalId)) { - checkWcapXmlErrno(node); - this_.defaultCalendar.m_calProps = node; - log("installed default cal props.", this_); - break; + + // set of subscribed calendars to be installed: + var calIds = {}; + calIds[this_.defaultCalId] = true; // assure default one is included once + if (getPref("calendar.wcap.subscriptions", false)) { + var list = this_.getUserPreferences("X-NSCP-WCAP-PREF-icsSubscribed"); + for each (var item in list) { + var ar = item.split(','); + // ',', '$' are not encoded. ',' can be handled here. WTF. + for each (var a in ar) { + var dollar = a.indexOf('$'); + if (dollar >= 0) { + var calId = a.substring(0, dollar); + if (calId != this_.defaultCalId) + calIds[calId] = true; } } - if (!this_.defaultCalendar.m_calProps) { - throw new Components.Exception( - "Login failed. Invalid session ID.", - calIWcapErrors.WCAP_LOGIN_FAILED); - } - }, - null, "search_calprops", - "&fmt-out=text%2Fxml&searchOpts=3&calid=1&search-string=" + - encodeURIComponent(this_.defaultCalId), - sessionId); - if (getPref("calendar.wcap.subscriptions", false)) - this_.installSubscribedCals(sessionId, request); + } + } + + if (getPref("calendar.wcap.no_get_calprops", false)) { + // hack around the get/search calprops mess: + this_.installCals_search_calprops(sessionId, calIds, request); + } + else { + this_.installCals_get_calprops(sessionId, calIds, request); + } }, stringToXml, "get_userprefs", "&fmt-out=text%2Fxml&userid=" + encodeURIComponent(this.credentials.userId), @@ -670,27 +659,73 @@ calWcapSession.prototype = { stringToIcal, "get_all_timezones", "&fmt-out=text%2Fcalendar", sessionId); }, - - installSubscribedCals: - function calWcapSession_installSubscribedCals(sessionId, request) + + installCals_get_calprops: + function calWcapSession_installCals_get_calprops(sessionId, calIds, request) { var this_ = this; - // user may have dangling users referred in his subscription list, so - // retrieve each by each, don't break: - var list = this.getUserPreferences("X-NSCP-WCAP-PREF-icsSubscribed"); - var calIds = {}; - for each (var item in list) { - var ar = item.split(','); - // ',', '$' are not encoded. ',' can be handled here. WTF. - for each (var a in ar) { - var dollar = a.indexOf('$'); - if (dollar >= 0) { - var calId = a.substring(0, dollar); - if (calId != this.defaultCalId) - calIds[calId] = true; + function calprops_resp(err, data) { + if (err) + throw err; + // string to xml converter func without WCAP errno check: + if (!data || data.length == 0) { // assuming time-out + throw new Components.Exception( + "Login failed. Invalid session ID.", + calIWcapErrors.WCAP_LOGIN_FAILED); + } + var xml = getDomParser().parseFromString(data, "text/xml"); + var nodeList = xml.getElementsByTagName("iCal"); + for (var i = 0; i < nodeList.length; ++i) { + var node = nodeList.item(i); + var ar = filterXmlNodes("X-NSCP-CALPROPS-RELATIVE-CALID", node); + if (ar.length > 0) { + var calId = ar[0]; + var cal = this_.m_subscribedCals[calId]; + if (!cal && calIds[calId]) { + try { + checkWcapXmlErrno(node); + if (calId == this_.defaultCalId) { + cal = this_.defaultCalendar; + if (!cal.m_calProps) { + cal.m_calProps = node; + log("installed default cal props.", this_); + } + } + else { + cal = createWcapCalendar(this_, node); + this_.m_subscribedCals[calId] = cal; + getCalendarManager().registerCalendar(cal); + log("installed subscribed calendar: " + calId, this_); + } + } + catch (exc) { // ignore but log any errors on subscribed calendars: + logError(exc, this_); + } + } } } + if (!this_.defaultCalendar.m_calProps) { // fallback to search_calprops: + logError("cannot get default calprops, trying search_calprops...", this_); + this_.installCals_search_calprops(sessionId, calIds, request); + } } + + var calidParam = ""; + for (var calId in calIds) { + if (calidParam.length > 0) + calidParam += ";"; + calidParam += encodeURIComponent(calId); + } + this_.issueNetworkRequest_(request, calprops_resp, + null, "get_calprops", + "&fmt-out=text%2Fxml&calid=" + calidParam, + sessionId); + }, + + installCals_search_calprops: + function calWcapSession_installCals_search_calprops(sessionId, calIds, request) + { + var this_ = this; var issuedSearchRequests = {}; for (var calId in calIds) { if (!this_.m_subscribedCals[calId]) { @@ -702,12 +737,16 @@ calWcapSession.prototype = { if (result.length < 1) throw Components.results.NS_ERROR_UNEXPECTED; for each (var cal in result) { + // user may have dangling users referred in his subscription list, so + // retrieve each by each, don't break: try { var calId = cal.calId; if (calIds[calId] && !this_.m_subscribedCals[calId]) { this_.m_subscribedCals[calId] = cal; - getCalendarManager().registerCalendar(cal); - log("installed subscribed calendar: " + calId, this_); + if (!cal.isDefaultCalendar) { + getCalendarManager().registerCalendar(cal); + log("installed subscribed calendar: " + calId, this_); + } } } catch (exc) { // ignore but log any errors on subscribed calendars: @@ -750,7 +789,8 @@ calWcapSession.prototype = { if (!g_bShutdown) { for each (var cal in subscribedCals) { try { - getCalendarManager().unregisterCalendar(cal); + if (!cal.isDefaultCalendar) + getCalendarManager().unregisterCalendar(cal); } catch (exc) { this.notifyError(exc); @@ -762,9 +802,9 @@ calWcapSession.prototype = { getCommandUrl: function calWcapSession_getCommandUrl(wcapCommand, params, sessionId) { var url = this.sessionUri.spec; - url += (wcapCommand + ".wcap?appid=mozilla-calendar"); + url += (wcapCommand + ".wcap?appid=mozilla-calendar&id="); + url += sessionId; url += params; - url += ("&id=" + encodeURIComponent(sessionId)); return url; }, @@ -860,7 +900,14 @@ calWcapSession.prototype = { get defaultCalId() { var list = this.getUserPreferences("X-NSCP-WCAP-PREF-icsCalendar"); - return (list.length > 0 ? list[0] : this.credentials.userId); + var id = null; + for each (var item in list) { + if (item.length > 0) { + id = item; + break; + } + } + return (id ? id : this.credentials.userId); }, get isLoggedIn() { @@ -954,8 +1001,13 @@ calWcapSession.prototype = { var calId = ar[0]; var cal = this_.m_subscribedCals[calId]; if (!cal) { - if (calId == this_.defaultCalId) + if (calId == this_.defaultCalId) { cal = this_.defaultCalendar; + if (!cal.m_calProps) { + cal.m_calProps = node; + log("installed default cal props.", this_); + } + } else cal = createWcapCalendar(this_, node); } diff --git a/mozilla/calendar/providers/wcap/calWcapUtils.js b/mozilla/calendar/providers/wcap/calWcapUtils.js index 474d759fe14..63c16422baf 100644 --- a/mozilla/calendar/providers/wcap/calWcapUtils.js +++ b/mozilla/calendar/providers/wcap/calWcapUtils.js @@ -1,27 +1,26 @@ -/* -*- Mode: javascript; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ @@ -84,7 +83,7 @@ function initLogging() logError(exc, "init logging"); } } - log("################################# NEW LOG #################################", + log("################################# NEW LOG (0.5) #################################", "init logging"); } if (!g_logPrefObserver) { diff --git a/mozilla/calendar/providers/wcap/public/Makefile.in b/mozilla/calendar/providers/wcap/public/Makefile.in index 65bbc01c792..1b949b1e4a6 100644 --- a/mozilla/calendar/providers/wcap/public/Makefile.in +++ b/mozilla/calendar/providers/wcap/public/Makefile.in @@ -1,27 +1,25 @@ -# # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # -# The contents of this file are subject to the Mozilla Public -# License Version 1.1 (the "License"); you may not use this file -# except in compliance with the License. You may obtain a copy of -# the License at http://www.mozilla.org/MPL/ +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.mozilla.org/MPL/ # -# Software distributed under the License is distributed on an "AS -# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or -# implied. See the License for the specific language governing -# rights and limitations under the License. +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. # -# The Original Code is mozilla.org code. +# The Original Code is Sun Microsystems code. # -# The Initial Developer of the Original Code is Sun Microsystems, Inc. -# Portions created by Sun Microsystems are Copyright (C) 2006 Sun -# Microsystems, Inc. All Rights Reserved. -# -# Original Author: Daniel Boelzle (daniel.boelzle@sun.com) +# The Initial Developer of the Original Code is +# Sun Microsystems, Inc. +# Portions created by the Initial Developer are Copyright (C) 2007 +# the Initial Developer. All Rights Reserved. # # Contributor(s): -# +# Daniel Boelzle # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +27,11 @@ # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the NPL, indicate your +# use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under -# the terms of any one of the NPL, the GPL or the LGPL. +# the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** diff --git a/mozilla/calendar/providers/wcap/public/calIWcapCalendar.idl b/mozilla/calendar/providers/wcap/public/calIWcapCalendar.idl index 602796de7fa..5fb54b94e09 100644 --- a/mozilla/calendar/providers/wcap/public/calIWcapCalendar.idl +++ b/mozilla/calendar/providers/wcap/public/calIWcapCalendar.idl @@ -1,27 +1,26 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/public/calIWcapErrors.idl b/mozilla/calendar/providers/wcap/public/calIWcapErrors.idl index b1643a177bd..f0e0cc4b1ab 100644 --- a/mozilla/calendar/providers/wcap/public/calIWcapErrors.idl +++ b/mozilla/calendar/providers/wcap/public/calIWcapErrors.idl @@ -1,27 +1,26 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/providers/wcap/public/calIWcapRequest.idl b/mozilla/calendar/providers/wcap/public/calIWcapRequest.idl index cc157ae4592..d33e955cb29 100755 --- a/mozilla/calendar/providers/wcap/public/calIWcapRequest.idl +++ b/mozilla/calendar/providers/wcap/public/calIWcapRequest.idl @@ -1,27 +1,26 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* ***** BEGIN LICENSE BLOCK ***** - * Version: NPL 1.1/GPL 2.0/LGPL 2.1 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * - * The contents of this file are subject to the Mozilla Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/MPL/ + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * http://www.mozilla.org/MPL/ * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. * - * The Original Code is mozilla.org code. + * The Original Code is Sun Microsystems code. * - * The Initial Developer of the Original Code is Sun Microsystems, Inc. - * Portions created by Sun Microsystems are Copyright (C) 2006 Sun - * Microsystems, Inc. All Rights Reserved. - * - * Original Author: Daniel Boelzle (daniel.boelzle@sun.com) + * The Initial Developer of the Original Code is + * Sun Microsystems, Inc. + * Portions created by the Initial Developer are Copyright (C) 2007 + * the Initial Developer. All Rights Reserved. * * Contributor(s): - * + * Daniel Boelzle * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -29,11 +28,11 @@ * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the NPL, indicate your + * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under - * the terms of any one of the NPL, the GPL or the LGPL. + * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ diff --git a/mozilla/calendar/resources/content/applicationUtil.js b/mozilla/calendar/resources/content/applicationUtil.js index f382a3abd41..ac3cb404cfd 100644 --- a/mozilla/calendar/resources/content/applicationUtil.js +++ b/mozilla/calendar/resources/content/applicationUtil.js @@ -74,18 +74,6 @@ function toJavaScriptConsole() toOpenWindowByType("global:console", "chrome://global/content/console.xul"); } -#ifndef MOZ_SUNBIRD -function toMessengerWindow() -{ - toOpenWindowByType("mail:3pane", "chrome://messenger/content/messenger.xul"); -} - -function toAddressBook() -{ - toOpenWindowByType("mail:addressbook", "chrome://messenger/content/addressbook/addressbook.xul"); -} -#endif - function launchBrowser(UrlToGoTo) { if (!UrlToGoTo) { @@ -183,217 +171,6 @@ function goOpenAddons() window.openDialog(EMURL, "", EMFEATURES); } - -function showElement(elementId) -{ - try { - document.getElementById(elementId).removeAttribute("hidden"); - } catch (e) { - dump("showElement: Couldn't remove hidden attribute from " + elementId + "\n"); - } -} - - -function hideElement(elementId) -{ - try { - document.getElementById(elementId).setAttribute("hidden", "true"); - } catch (e) { - dump("hideElement: Couldn't set hidden attribute on " + elementId + "\n"); - } -} - - -function enableElement(elementId) -{ - try { - //document.getElementById(elementId).setAttribute("disabled", "false"); - - // call remove attribute beacuse some widget code checks for the presense of a - // disabled attribute, not the value. - document.getElementById(elementId).removeAttribute("disabled"); - } catch (e) { - dump("enableElement: Couldn't remove disabled attribute on " + elementId + "\n"); - } -} - - -function disableElement(elementId) -{ - try { - document.getElementById(elementId).setAttribute( "disabled", "true"); - } catch (e) { - dump("disableElement: Couldn't set disabled attribute to true on " + - elementId + "\n"); - } -} - - -/** -* Helper function for filling the form, -* Set the value of a property of a XUL element -* -* PARAMETERS -* elementId - ID of XUL element to set -* newValue - value to set property to ( if undefined no change is made ) -* propertyName - OPTIONAL name of property to set, default is "value", -* use "checked" for radios & checkboxes, "data" for -* drop-downs -*/ -function setElementValue(elementId, newValue, propertyName) -{ - var undefined; - - if (newValue !== undefined) { - var field = document.getElementById(elementId); - - if (newValue === false) { - try { - field.removeAttribute(propertyName); - } catch (e) { - dump("setFieldValue: field.removeAttribute couldn't remove " + - propertyName + " from " + elementId + " e: " + e + "\n"); - } - } else if (propertyName) { - try { - field.setAttribute(propertyName, newValue); - } catch (e) { - dump("setFieldValue: field.setAttribute couldn't set " + - propertyName + " from " + elementId + " to " + newValue + - " e: " + e + "\n"); - } - } else { - field.value = newValue; - } - } -} - - -/** -* Helper function for getting data from the form, -* Get the value of a property of a XUL element -* -* PARAMETERS -* elementId - ID of XUL element to get from -* propertyName - OPTIONAL name of property to set, default is "value", -* use "checked" for radios & checkboxes, "data" for -* drop-downs -* RETURN -* newValue - value of property -*/ -function getElementValue(elementId, propertyName) -{ - var field = document.getElementById(elementId); - - if (propertyName) - return field[propertyName]; - return field.value; -} - - -function processEnableCheckbox(checkboxId, elementId) -{ - if (document.getElementById(checkboxId).checked) - enableElement(elementId); - else - disableElement(elementId); -} - - -/* - * Enable/disable button if there are children in a listbox - */ -function updateListboxDeleteButton(listboxId, buttonId) -{ - if ( document.getElementById(listboxId).getRowCount() > 0 ) - enableElement(buttonId); - else - disableElement(buttonId); -} - - -/* - * Update plural singular menu items - */ -function updateMenuLabels(lengthFieldId, menuId ) -{ - var field = document.getElementById(lengthFieldId); - var menu = document.getElementById(menuId); - - // figure out whether we should use singular or plural - var length = field.value; - - var newLabelNumber; - - // XXX This assumes that "0 days, minutes, etc." is plural in other languages. - if ( ( Number(length) == 0 ) || ( Number(length) > 1 ) ) - newLabelNumber = "label2" - else - newLabelNumber = "label1" - - // see what we currently show and change it if required - var oldLabelNumber = menu.getAttribute("labelnumber"); - - if ( newLabelNumber != oldLabelNumber ) { - // remember what we are showing now - menu.setAttribute("labelnumber", newLabelNumber); - - // update the menu items - var items = menu.getElementsByTagName("menuitem"); - - for( var i = 0; i < items.length; ++i ) { - var menuItem = items[i]; - var newLabel = menuItem.getAttribute(newLabelNumber); - menuItem.label = newLabel; - menuItem.setAttribute("label", newLabel); - } - - // force the menu selection to redraw - var saveSelectedIndex = menu.selectedIndex; - menu.selectedIndex = -1; - menu.selectedIndex = saveSelectedIndex; - } -} - - -/** Select value in menuList. Throws string if no such value. **/ - -function menuListSelectItem(menuListId, value) -{ - var menuList = document.getElementById(menuListId); - var index = menuListIndexOf(menuList, value); - if (index != -1) { - menuList.selectedIndex = index; - } else { - throw "menuListSelectItem: No such Element: "+value; - } -} - - -/** Find index of menuitem with the given value, or return -1 if not found. **/ - -function menuListIndexOf(menuList, value) -{ - var items = menuList.menupopup.childNodes; - var index = -1; - for ( var i = 0; i < items.length; i++ ) { - var element = items[i]; - if (element.nodeName == "menuitem") - index++; - if (element.getAttribute("value") == value) - return index; - } - return -1; // not found -} - -function hasPositiveIntegerValue(elementId) -{ - var value = document.getElementById(elementId).value; - if (value && (parseInt(value) == value) && value > 0) - return true; - return false; -} - /** * We recreate the View > Toolbars menu each time it is opened to include any * user-created toolbars. diff --git a/mozilla/calendar/resources/content/calendar.js b/mozilla/calendar/resources/content/calendar.js index 930be413c84..509e45e4e48 100644 --- a/mozilla/calendar/resources/content/calendar.js +++ b/mozilla/calendar/resources/content/calendar.js @@ -102,6 +102,15 @@ function calendarInit() deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay); } + // showCompleted is false by default + if (document.getElementById("hide-completed-checkbox").checked == false) { + var deck = document.getElementById("view-deck") + for each (view in deck.childNodes) { + view.showCompleted = true; + } + deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay); + } + // set up the unifinder prepareCalendarUnifinder(); diff --git a/mozilla/calendar/resources/content/calendarManagement.js b/mozilla/calendar/resources/content/calendarManagement.js index 2f5fb24163d..c378d5978cb 100644 --- a/mozilla/calendar/resources/content/calendarManagement.js +++ b/mozilla/calendar/resources/content/calendarManagement.js @@ -188,6 +188,16 @@ function onCalendarCheckboxClick(event) { // clicked the checkbox cell + // XXX Fix for bug #350323, needs improvement. + // If the user clicks with the mouse on a checkbox, the timer which + // adds the selected calendar to the composite calendar is cancelled. + // Otherwise it's not possible for the user to add/remove calendars + // to/from the composite calendar by clicking on the checkbox. + if (gCalendarListSelectTimeout) { + clearTimeout(gCalendarListSelectTimeout); + gCalendarListSelectTimeout = null; + } + var cal = event.target.calendar; if (checkElem.getAttribute('checked') == "true") { getCompositeCalendar().removeCalendar(cal.uri); @@ -261,12 +271,24 @@ function setCalendarManagerUI() } } +var gCalendarListSelectTimeout; function onCalendarListSelect() { + // XXX Fix for bug #350323, needs improvement. + // Set up a timer, which schedules adding the selected calendar to the + // composite calendar. + gCalendarListSelectTimeout = setTimeout(calendarListSelectHandler, 400); +} + +function calendarListSelectHandler() { var selectedCalendar = getSelectedCalendarOrNull(); if (!selectedCalendar) { return; } - getCompositeCalendar().defaultCalendar = selectedCalendar; + var compositeCalendar = getCompositeCalendar(); + if (!compositeCalendar.getCalendar(selectedCalendar.uri)) { + compositeCalendar.addCalendar(selectedCalendar); + } + compositeCalendar.defaultCalendar = selectedCalendar; } function initCalendarManager() diff --git a/mozilla/calendar/resources/content/datetimepickers/minimonth.xml b/mozilla/calendar/resources/content/datetimepickers/minimonth.xml index 513cf94e71e..3ff430bc75c 100644 --- a/mozilla/calendar/resources/content/datetimepickers/minimonth.xml +++ b/mozilla/calendar/resources/content/datetimepickers/minimonth.xml @@ -133,9 +133,12 @@ + @@ -143,6 +146,11 @@ + + + @@ -153,6 +161,16 @@ + + + + + + null + + + + + + + 2; })) { + for (var endPrefix = 0; endPrefix < minLength; endPrefix++) { + var c = dayList[0][endPrefix]; + if (dayList.some(function(dayAbbr) { + return dayAbbr[endPrefix] != c; })) { + if (endPrefix > 0) { + for (i = 0; i < dayList.length; i++) // trim prefix chars. + dayList[i] = dayList[i].substring(endPrefix); + } break; } } } - dayList[i] = dayList[i].substring(0,foundMatch) + // 3. trim each day abbreviation to 1 char if unique, else 2 chars. + for (i = 0; i < dayList.length; i++) { + var foundMatch = 1; + for (j = 0; j < dayList.length; j++) { + if (i != j) { + if (dayList[i].substring(0,1) == dayList[j].substring(0,1)) { + foundMatch = 2; + break; + } + } + } + dayList[i] = dayList[i].substring(0,foundMatch) + } } - + for (var column = 0; column < header.childNodes.length; column++) { header.childNodes[column].setAttribute( "value", dayList[column]); } @@ -304,8 +399,8 @@ // Update the year popup var years = this.kYearList; var year = new Date(aDate); - year.setFullYear(aDate.getFullYear() - (years.length%2 + 1)); - for (i = 0; i < years.length; i++) { + year.setFullYear(Math.max(1, aDate.getFullYear() - parseInt(years.length / 2) + 1)); + for (var i = 1; i < years.length - 1; i++) { years[i].setAttribute("value", year.getFullYear()); years[i].setAttribute("current", "false"); if (year.getFullYear() == aDate.getFullYear()) @@ -320,10 +415,17 @@ // get today's date var today = new Date(); + this.mDayMap = {}; + for (var k = 1; k < calbox.childNodes.length; k++) { var row = calbox.childNodes[k]; for (i = 0; i < 7; i++) { var day = row.childNodes[i]; + var ymd = date.getFullYear() + "-" + + date.getMonth() + "-" + + date.getDate(); + this.mDayMap[ymd] = day; + if (aDate.getMonth() != date.getMonth()) { day.setAttribute("othermonth", "true"); } else { @@ -347,6 +449,10 @@ day.calendar = this; day.setAttribute("value", date.getDate()); date.setDate(date.getDate() + 1); + + if (monthChanged) { + this.resetAttributesForDate(day.date); + } } } if (monthChanged) this.fireEvent('monthchange'); @@ -407,52 +513,51 @@ - - + + + + - //get a list of events for this month. - var monthEvents = - this.eventSource.getEventsForMonth( this.getSelectedDate() ); - var arrayOfDates = new Array(); - - for( var eventIndex = 0; eventIndex < monthEvents.length; ++eventIndex ) - { - var calendarEventDisplay = monthEvents[ eventIndex ]; - var eventDate = new Date( calendarEventDisplay.displayDate ); - - //add them to an array - arrayOfDates[ eventDate.getDate() ] = true; - } - document.getElementById( "lefthandcalendar" ).setBusyDates( arrayOfDates ); - */ - var aDate = new Date(); - aDate.setDate( 1 ); - // Update the calendar - var calbox = document.getAnonymousNodes(this)[0].childNodes[1]; - - // weekStart day is set by preference - var firstWeekday = (7 + aDate.getDay() - this.weekStart) % 7; - var date = new Date(aDate.getTime()); - date.setDate(date.getDate() - firstWeekday); - - for (var k = 1; k < calbox.childNodes.length; k++) { - var row = calbox.childNodes[k]; - for (var i = 0; i < 7; i++) { - var day = row.childNodes[i]; - if (aDate.getMonth() == date.getMonth() && - arrayOfDates[ date.getDate() ] == true ) { - day.setAttribute("busy", "true"); - } else { - day.removeAttribute("busy"); + + + + allowedAttributes) { + switch (aBox.attributes[allowedAttributes].nodeName) { + case "selected": + case "othermonth": + case "today": + case "value": + case "class": + case "flex": + allowedAttributes++; + break; + default: + aBox.removeAttribute(aBox.attributes[allowedAttributes].nodeName); + break; } + } + } - // next date of month, may increment month - date.setDate(date.getDate() + 1); + if (aDate) { + var box = this.getBoxForDate(aDate); + if (box) { + removeForBox(box); + } + } else { + for (var k = 1; k < this.kDaysOfMonthBox.childNodes.length; k++) { + for (var i = 0; i < 7; i++) { + removeForBox(this.kDaysOfMonthBox.childNodes[k].childNodes[i]); + } } } ]]> @@ -550,7 +655,7 @@ this.showMonth(aMainDate); } else if (!sameDate) { // select day only - var day = this._findDay(aDate); + var day = this.getBoxForDate(aDate); if (this.mSelected) { this.mSelected.removeAttribute("selected"); } @@ -562,25 +667,6 @@ - - - - - - - @@ -640,7 +726,10 @@ break; case this.kYearPopup: this.hidePopupList(); - this.switchYear(element.getAttribute("value")); + var value = element.getAttribute("value"); + if (value) { + this.switchYear(value); + } break; } } diff --git a/mozilla/calendar/resources/content/mouseoverPreviews.js b/mozilla/calendar/resources/content/mouseoverPreviews.js index 48bc1441baf..21db4310a58 100644 --- a/mozilla/calendar/resources/content/mouseoverPreviews.js +++ b/mozilla/calendar/resources/content/mouseoverPreviews.js @@ -22,9 +22,9 @@ * Mike Potter * Chris Charabaruk * Colin Phillips - * Karl Guertin + * Karl Guertin * Mike Norton - * ArentJan Banck + * ArentJan Banck * Eric Belhaire * * Alternatively, the contents of this file may be used under the terms of @@ -41,20 +41,21 @@ * * ***** END LICENSE BLOCK ***** */ -/** Code which generates event and task (todo) preview tooltips/titletips - when the mouse hovers over either the event list, the task list, or - an event or task box in one of the grid views. - - (Portions of this code were previously in calendar.js and unifinder.js, - some of it duplicated.) -**/ +/** + * Code which generates event and task (todo) preview tooltips/titletips + * when the mouse hovers over either the event list, the task list, or + * an event or task box in one of the grid views. + * + * (Portions of this code were previously in calendar.js and unifinder.js, + * some of it duplicated.) + */ /** PUBLIC -* -* This changes the mouseover preview based on the start and end dates -* of an occurrence of a (one-time or recurring) calEvent or calToDo. -* Used by all grid views. -*/ + * + * This changes the mouseover preview based on the start and end dates + * of an occurrence of a (one-time or recurring) calEvent or calToDo. + * Used by all grid views. + */ function onMouseOverItem( occurrenceBoxMouseEvent ) { @@ -106,25 +107,46 @@ function onMouseOverTaskTree( toolTip, mouseEvent ) return false; } -/* -** add newContentBox, -*/ +/** + * Removes old content from tooltip, adds new content box to tooltip, + * then resizes the tooltip to the size of the new content box. + * + * @param tooltip The tooltip to modify. + * @param holderBox The box element containing the new content. + */ function setToolTipContent(toolTip, holderBox) { - while (toolTip.hasChildNodes()) + while (toolTip.hasChildNodes()) { toolTip.removeChild( toolTip.firstChild ); + } + toolTip.appendChild( holderBox ); + var width = holderBox.boxObject.width; + var height = holderBox.boxObject.height; + + // workaround bug 369225 (aspect: tooltip may not shrink height) + toolTip.sizeTo(0,0); + // workaround bug 369225 (aspect: tooltip height too short) + // Add top and bottom border and padding to workaround bug where bottom + // tooltip border disappears if wrapped description below header grid. + height += 1 + 2 + 2 + 1; + + toolTip.sizeTo(width, height); } /** -* Called when a user hovers over a todo element and the text for the mouse over is changed. -*/ + * Called when a user hovers over a todo element and the text for the mouse over is changed. + */ function getPreviewForTask( toDoItem ) { if( toDoItem ) { const vbox = document.createElement( "vbox" ); + vbox.setAttribute("class", "tooltipBox"); + // tooltip appears above or below pointer, so may have as little as + // one half the screen height available (avoid top going off screen). + vbox.maxHeight = Math.floor(screen.height / 2); boxInitializeHeaderGrid(vbox); var hasHeader = false; @@ -195,13 +217,13 @@ function getPreviewForTask( toDoItem ) var description = toDoItem.getProperty("DESCRIPTION"); if (description) { - // display up to 4 description lines like body of message below headers - if (hasHeader) - boxAppendText(vbox, ""); - - boxAppendLines(vbox, description, 4); + // display wrapped description lines like body of message below headers + if (hasHeader) { + boxAppendBodySeparator(vbox); + } + boxAppendBody(vbox, description); } - + return ( vbox ); } else @@ -211,15 +233,19 @@ function getPreviewForTask( toDoItem ) } /** -* Called when mouse moves over a different, or -* when mouse moves over event in event list. -* The instStartDate is date of instance displayed at event box -* (recurring or multiday events may be displayed by more than one event box -* for different days), or null if should compute next instance from now. -*/ + * Called when mouse moves over a different, or + * when mouse moves over event in event list. + * The instStartDate is date of instance displayed at event box + * (recurring or multiday events may be displayed by more than one event box + * for different days), or null if should compute next instance from now. + */ function getPreviewForEvent( event, instStartDate, instEndDate ) { const vbox = document.createElement( "vbox" ); + vbox.setAttribute("class", "tooltipBox"); + // tooltip appears above or below pointer, so may have as little as + // one half the screen height available (avoid top going off screen). + vbox.maxHeight = Math.floor(screen.height / 2); boxInitializeHeaderGrid(vbox); if (event) @@ -260,9 +286,9 @@ function getPreviewForEvent( event, instStartDate, instEndDate ) var description = event.getProperty("DESCRIPTION"); if (description) { - // display up to 4 description lines, like body of message below headers - boxAppendText(vbox, ""); - boxAppendLines(vbox, description, 4); + boxAppendBodySeparator(vbox); + // display wrapped description lines, like body of message below headers + boxAppendBody(vbox, description); } return ( vbox ); @@ -310,8 +336,24 @@ function getToDoStatusString(iCalToDo) } } -/** PRIVATE: Append 1 line of text to box inside an xul description node containing a single text node **/ -function boxAppendText(box, textString) +/** + * PRIVATE: Append a separator, a thin space between header and body. + * + * @param vbox box to which to append separator. + */ +function boxAppendBodySeparator(vbox) { + const separator = document.createElement("separator"); + separator.setAttribute("class", "tooltipBodySeparator"); + vbox.appendChild(separator); +} + +/** + * PRIVATE: Append description to box for body text. Text may contain + * paragraphs; line indent and line breaks will be preserved by CSS. + * @param box box to which to append body + * @param textString text of body + */ +function boxAppendBody(box, textString) { var textNode = document.createTextNode(textString); var xulDescription = document.createElement("description"); @@ -319,32 +361,11 @@ function boxAppendText(box, textString) xulDescription.appendChild(textNode); box.appendChild(xulDescription); } -/** PRIVATE: Append multiple lines of text to box, each line inside an xul description node containing a single text node **/ -function boxAppendLines(vbox, textString, maxLineCount) -{ - if (!maxLineCount) - maxLineCount = 4; - // trim trailing whitespace - var end = textString.length; - for (; end > 0; end--) - if (" \t\r\n".indexOf(textString.charAt(end - 1)) == -1) - break; - textString = textString.substring(0, end); - - var lines = textString.split("\n"); - var lineCount = lines.length; - if( lineCount > maxLineCount ) { - lineCount = maxLineCount; - lines[ maxLineCount ] = "..." ; - } - - for (var i = 0; i < lineCount; i++) { - boxAppendText(vbox, lines[i]); - } -} -/** PRIVATE: Use dateFormatter to format date and time. - Append date to box inside an xul description node containing a single text node. **/ +/** + * PRIVATE: Use dateFormatter to format date and time, + * and to header grid append a row containing localized Label: date. + */ function boxAppendLabeledDateTime(box, labelProperty, date) { var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"] @@ -353,8 +374,15 @@ function boxAppendLabeledDateTime(box, labelProperty, date) var formattedDateTime = dateFormatter.formatDateTime(date); boxAppendLabeledText(box, labelProperty, formattedDateTime); } -/** PRIVATE: Use dateFormatter to format date and time interval. - Append interval to box inside an xul description node containing a single text node. **/ + +/** + * PRIVATE: Use dateFormatter to format date and time interval, + * and to header grid append a row containing localized Label: interval. + * @param box contains header grid. + * @param labelProperty name of property for localized field label. + * @param start calDateTime of start of time interval. + * @param end calDateTime of end of time interval. + */ function boxAppendLabeledDateTimeInterval(box, labelProperty, start, end) { var dateFormatter = Components.classes["@mozilla.org/calendar/datetime-formatter;1"] @@ -371,15 +399,24 @@ function boxAppendLabeledDateTimeInterval(box, labelProperty, start, end) } } +/** + * PRIVATE: create empty 2-column grid for header fields, + * and append it to box. + */ function boxInitializeHeaderGrid(box) { var grid = document.createElement("grid"); + grid.setAttribute("class", "tooltipHeaderGrid"); var rows; { var columns = document.createElement("columns"); { - columns.appendChild(document.createElement("column")); - columns.appendChild(document.createElement("column")); + var labelColumn = document.createElement("column"); + labelColumn.setAttribute("class", "tooltipLabelColumn"); + columns.appendChild(labelColumn); + var valueColumn = document.createElement("column"); + valueColumn.setAttribute("class", "tooltipValueColumn"); + columns.appendChild(valueColumn); } grid.appendChild(columns); rows = document.createElement("rows"); @@ -388,6 +425,13 @@ function boxInitializeHeaderGrid(box) box.appendChild(grid); } +/** + * PRIVATE: To headers grid, append a row containing Label: value, + * where label is localized text for labelProperty. + * @param box box containing headers grid + * @param labelProperty name of property for localized name of header + * @param textString value of header field. + */ function boxAppendLabeledText(box, labelProperty, textString) { var labelText = calGetString('calendar', labelProperty); @@ -402,6 +446,7 @@ function boxAppendLabeledText(box, labelProperty, textString) } } +/** PRIVATE: create element for field label (for header grid). **/ function createTooltipHeaderLabel(text) { var label = document.createElement("label"); @@ -410,6 +455,7 @@ function createTooltipHeaderLabel(text) return label; } +/** PRIVATE: create element for field value (for header grid). **/ function createTooltipHeaderDescription(text) { var label = document.createElement("description"); @@ -418,9 +464,11 @@ function createTooltipHeaderDescription(text) return label; } -/** If now is during an occurrence, return the ocurrence. - Else if now is before an ocurrence, return the next ocurrence. - Otherwise return the previous ocurrence. **/ +/** + * If now is during an occurrence, return the ocurrence. + * Else if now is before an ocurrence, return the next ocurrence. + * Otherwise return the previous ocurrence. + */ function getCurrentNextOrPreviousRecurrence(calendarEvent) { if (!calendarEvent.recurrenceInfo) { @@ -443,4 +491,3 @@ function getCurrentNextOrPreviousRecurrence(calendarEvent) } return occ; } - diff --git a/mozilla/calendar/resources/content/unifinderToDo.js b/mozilla/calendar/resources/content/unifinderToDo.js index 82a68c68644..cc229f638ea 100644 --- a/mozilla/calendar/resources/content/unifinderToDo.js +++ b/mozilla/calendar/resources/content/unifinderToDo.js @@ -190,6 +190,11 @@ function toDoUnifinderRefresh() filter |= ccalendar.ITEM_FILTER_TYPE_TODO; ccalendar.getItems(filter, 0, null, null, refreshListener); + var deck = document.getElementById("view-deck") + for each (view in deck.childNodes) { + view.showCompleted = !hideCompleted; + } + deck.selectedPanel.goToDay(deck.selectedPanel.selectedDay); } function getToDoFromEvent( event ) diff --git a/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css b/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css index be5af1b14e9..2364739680c 100644 --- a/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css +++ b/mozilla/calendar/resources/skin/classic/datetimepickers/datetimepickers.css @@ -156,7 +156,8 @@ grid[anonid="time-picker-five-minute-grid"] { border-top : 1px solid ThreeDShadow; border-left : 1px solid ThreeDShadow; border-right : 1px solid ThreeDShadow; - background-color : #ffffff; + background-color : Window; + color : WindowText; } @@ -197,7 +198,8 @@ grid[anonid="time-picker-one-minute-grid"] { border-top : 1px solid ThreeDShadow; border-left : 1px solid ThreeDShadow; border-right : 1px solid ThreeDShadow; - background-color : #ffffff; + background-color : Window; + color : WindowText; } /* box in one-minute grid elements */ diff --git a/mozilla/calendar/resources/skin/classic/datetimepickers/minimonth.css b/mozilla/calendar/resources/skin/classic/datetimepickers/minimonth.css index 46fc87f3d3c..ca59ad42701 100755 --- a/mozilla/calendar/resources/skin/classic/datetimepickers/minimonth.css +++ b/mozilla/calendar/resources/skin/classic/datetimepickers/minimonth.css @@ -18,7 +18,9 @@ * Portions created by the Initial Developer are Copyright (C) 2001 * the Initial Developer. All Rights Reserved. * - * Contributor(s): Matthew Willis (mattwillis@gmail.com) + * Contributor(s): + * Matthew Willis (mattwillis@gmail.com) + * Philipp Kewisch * * Alternatively, the contents of this file may be used under the terms of * either the GNU General Public License Version 2 or later (the "GPL"), or @@ -127,11 +129,7 @@ } .minimonth-day[othermonth="true"] { - color: GrayText; -} - -.minimonth-day[budy="true"] { - font-weight: bold; + color: #b2b2b2; } .minimonth-day[today="true"] { @@ -143,7 +141,7 @@ color: HighlightText; } -.minimonth-day[busy="true"] { +.minimonth-day[busy] { font-weight: bold; } @@ -158,8 +156,10 @@ } .minimonth-list { - padding: 2px 4px; + padding-left: 1em; + padding-right: 1em; } + .minimonth-list[current="true"] { font-weight: bold; } diff --git a/mozilla/calendar/sunbird/app/module.ver b/mozilla/calendar/sunbird/app/module.ver index 726e12cc301..e47e6319413 100644 --- a/mozilla/calendar/sunbird/app/module.ver +++ b/mozilla/calendar/sunbird/app/module.ver @@ -1,7 +1,7 @@ WIN32_MODULE_COMPANYNAME=Mozilla WIN32_MODULE_COPYRIGHT=©Sunbird and Mozilla Developers, according to the MPL 1.1/GPL 2.0/LGPL 2.1 licenses, as applicable. -WIN32_MODULE_FILEVERSION=0,4,9,0 -WIN32_MODULE_FILEVERSION_STRING=0.5pre +WIN32_MODULE_PRODUCTVERSION=0,6,9,0 +WIN32_MODULE_PRODUCTVERSION_STRING=0.7pre WIN32_MODULE_TRADEMARKS=Sunbird is a trademark of the Mozilla Foundation. WIN32_MODULE_DESCRIPTION=Sunbird WIN32_MODULE_PRODUCTNAME=Sunbird diff --git a/mozilla/calendar/sunbird/base/content/calendar-scripts.inc b/mozilla/calendar/sunbird/base/content/calendar-scripts.inc index 76cd3cad70f..2310ff040c2 100644 --- a/mozilla/calendar/sunbird/base/content/calendar-scripts.inc +++ b/mozilla/calendar/sunbird/base/content/calendar-scripts.inc @@ -26,6 +26,7 @@ # Dan Parent # ArentJan Banck # Eric Belhaire +# Philipp Kewisch # # Alternatively, the contents of this file may be used under the terms of # either the GNU General Public License Version 2 or later (the "GPL"), or @@ -80,3 +81,7 @@