diff --git a/UI/WebServerResources/ContactsUI.js b/UI/WebServerResources/ContactsUI.js index e5423bbc8..0bcb56450 100644 --- a/UI/WebServerResources/ContactsUI.js +++ b/UI/WebServerResources/ContactsUI.js @@ -997,7 +997,7 @@ function onWindowResize(event) { } function initContacts(event) { - if (document.body.hasClassName("popup")) + if ($(document.body).hasClassName("popup")) configureSelectionButtons(); configureAbToolbar(); configureAddressBooks(); @@ -1013,12 +1013,12 @@ function initContacts(event) { TableKit.Resizable.init(table, {'trueResize' : true, 'keepWidth' : true}); } + onWindowResize.defer(); Event.observe(window, "resize", onWindowResize); - onWindowResize(null); // Default sort options sorting["attribute"] = "c_cn"; sorting["ascending"] = true; } -FastInit.addOnLoad(initContacts); +document.observe("dom:loaded", initContacts); diff --git a/UI/WebServerResources/MailerUI.js b/UI/WebServerResources/MailerUI.js index f90af8b2a..b9866d6a4 100644 --- a/UI/WebServerResources/MailerUI.js +++ b/UI/WebServerResources/MailerUI.js @@ -160,7 +160,7 @@ function markMailReadInWindow(win, msguid) { /* mail list reply */ function openMessageWindowsForSelection(action, firstOnly) { - if (document.body.hasClassName("popup")) { + if ($(document.body).hasClassName("popup")) { var url = window.location.href; var parts = url.split("/"); parts[parts.length-1] = action; @@ -897,7 +897,7 @@ function configureLinksInMessage() { var messageDiv = $('messageContent'); var mailContentDiv = document.getElementsByClassName('mailer_mailcontent', messageDiv)[0]; - if (!document.body.hasClassName("popup")) + if (!$(document.body).hasClassName("popup")) mailContentDiv.observe("contextmenu", onMessageContentMenu); var anchors = messageDiv.getElementsByTagName('a'); @@ -1454,8 +1454,9 @@ function initMailer(event) { initMailboxTree(); initMessageCheckTimer(); - /* Perform an expunge when leaving the webmail */ Event.observe(document, "keydown", onDocumentKeydown); + + /* Perform an expunge when leaving the webmail */ if (isSafari()) { $('calendarBannerLink').observe("click", onUnload); $('contactsBannerLink').observe("click", onUnload); @@ -1465,8 +1466,8 @@ function initMailer(event) { Event.observe(window, "beforeunload", onUnload); } + onWindowResize.defer(); Event.observe(window, "resize", onWindowResize); - onWindowResize(null); // Default sort options sorting["attribute"] = "date"; @@ -1712,6 +1713,8 @@ function onLoadMailboxesCallback(http) { updateStatusFolders(); } } + else + log ("onLoadMailboxesCallback " + http.status); } // var tree = $("mailboxTree"); diff --git a/UI/WebServerResources/SOGoRootPage.js b/UI/WebServerResources/SOGoRootPage.js index 7920f1317..b3fa3d2cb 100644 --- a/UI/WebServerResources/SOGoRootPage.js +++ b/UI/WebServerResources/SOGoRootPage.js @@ -23,7 +23,7 @@ function onLoginClick(event) { if (userName.length > 0) { startAnimation($("loginButton"), $("submit")); - + if (typeof(loginSuffix) != "undefined" && loginSuffix.length > 0 && !userName.endsWith(loginSuffix)) @@ -103,4 +103,4 @@ function onLoginCallback(http) { } } -FastInit.addOnLoad(initLogin); +document.observe("dom:loaded", initLogin); diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 985f388ec..ed5febbf2 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -41,6 +41,7 @@ function newEvent(sender, type) { params.push("hm=" + hour); if (params.length > 0) urlstr += "?" + params.join("&"); + window.open(urlstr, "", "width=490,height=470,resizable=0"); return false; /* stop following the link */ @@ -1110,7 +1111,8 @@ function calendarDisplayCallback(http) { refreshCalendarEvents(http.callbackData.scrollEvent); - var days = document.getElementsByClassName("day", contentView); + var days = contentView.select("DIV.day"); + if (currentView == "monthview") for (var i = 0; i < days.length; i++) { days[i].observe("click", onCalendarSelectDay); @@ -1121,20 +1123,19 @@ function calendarDisplayCallback(http) { days[i].observe("scroll", onBodyClickHandler); } else { - var headerDivs = $("calendarHeader").childNodesWithTag("div"); - var headerDaysLabels - = document.getElementsByClassName("day", headerDivs[0]); - var headerDays = document.getElementsByClassName("day", headerDivs[1]); - for (var i = 0; i < days.length; i++) { + var calendarHeader = $("calendarHeader"); + var headerDaysLabels = calendarHeader.select("DIV.dayLabels DIV.day"); + var headerDays = calendarHeader.select("DIV.days DIV.day"); + for (var i = 0; i < days.length; i++) { headerDays[i].hour = "allday"; headerDaysLabels[i].observe("mousedown", listRowMouseDownHandler); headerDays[i].observe("click", onCalendarSelectDay); headerDays[i].observe("dblclick", onClickableCellsDblClick); days[i].observe("click", onCalendarSelectDay); - var clickableCells - = document.getElementsByClassName("clickableHourCell", days[i]); + + var clickableCells = days[i].select("DIV.clickableHourCell"); for (var j = 0; j < clickableCells.length; j++) - clickableCells[j].observe("dblclick", onClickableCellsDblClick); + clickableCells[j].observe("dblclick", onClickableCellsDblClick); } } } @@ -1691,15 +1692,15 @@ function configureDragHandles() { var handle = $("verticalDragHandle"); if (handle) { handle.addInterface(SOGoDragHandlesInterface); - handle.leftBlock=$("leftPanel"); - handle.rightBlock=$("rightPanel"); + handle.leftBlock = $("leftPanel"); + handle.rightBlock = $("rightPanel"); } handle = $("rightDragHandle"); if (handle) { handle.addInterface(SOGoDragHandlesInterface); - handle.upperBlock=$("eventsListView"); - handle.lowerBlock=$("calendarView"); + handle.upperBlock = $("eventsListView"); + handle.lowerBlock = $("calendarView"); } } @@ -1975,7 +1976,7 @@ function initCalendars() { sorting["attribute"] = "start"; sorting["ascending"] = true; - if (!document.body.hasClassName("popup")) { + if (!$(document.body).hasClassName("popup")) { initDateSelectorEvents(); initCalendarSelector(); configureSearchField(); @@ -1986,8 +1987,8 @@ function initCalendars() { $(document.body).observe("click", onBodyClickHandler); } + onWindowResize.defer(); Event.observe(window, "resize", onWindowResize); - onWindowResize(null); } -FastInit.addOnLoad(initCalendars); +document.observe("dom:loaded", initCalendars); diff --git a/UI/WebServerResources/UIxAclEditor.js b/UI/WebServerResources/UIxAclEditor.js index d8ef9aa2b..ffbf03557 100644 --- a/UI/WebServerResources/UIxAclEditor.js +++ b/UI/WebServerResources/UIxAclEditor.js @@ -155,4 +155,4 @@ function onAclLoadHandler() { AclEditor['userRightsWidth'] = window.opener.getUsersRightsWindowWidth(); } -FastInit.addOnLoad(onAclLoadHandler); +document.observe("dom:loaded", onAclLoadHandler); diff --git a/UI/WebServerResources/UIxAppointmentEditor.js b/UI/WebServerResources/UIxAppointmentEditor.js index 1b3475caf..f37c9344e 100644 --- a/UI/WebServerResources/UIxAppointmentEditor.js +++ b/UI/WebServerResources/UIxAppointmentEditor.js @@ -418,4 +418,4 @@ function onAppointmentEditorLoad() { initializeAttendeesHref(); } -FastInit.addOnLoad(onAppointmentEditorLoad); +document.observe("dom:loaded", onAppointmentEditorLoad); diff --git a/UI/WebServerResources/UIxAttendeesEditor.js b/UI/WebServerResources/UIxAttendeesEditor.js index 1841c361e..c4425fa11 100644 --- a/UI/WebServerResources/UIxAttendeesEditor.js +++ b/UI/WebServerResources/UIxAttendeesEditor.js @@ -718,7 +718,7 @@ function onFreeBusyLoadHandler() { $$('TABLE#freeBusy TD.freeBusyData DIV').first().observe("scroll", onScroll); } -FastInit.addOnLoad(onFreeBusyLoadHandler); +document.observe("dom:loaded", onFreeBusyLoadHandler); /* Functions related to UIxTimeDateControl widget */ diff --git a/UI/WebServerResources/UIxCalUserRightsEditor.js b/UI/WebServerResources/UIxCalUserRightsEditor.js index 93672b759..2591e6b03 100644 --- a/UI/WebServerResources/UIxCalUserRightsEditor.js +++ b/UI/WebServerResources/UIxCalUserRightsEditor.js @@ -8,4 +8,4 @@ function initACLButtons() { $("cancelButton").observe("click", onCancelClick); } -FastInit.addOnLoad(initACLButtons); +document.observe("dom:loaded", initACLButtons); diff --git a/UI/WebServerResources/UIxCalendarProperties.js b/UI/WebServerResources/UIxCalendarProperties.js index 34dc7affb..2bf322a4a 100644 --- a/UI/WebServerResources/UIxCalendarProperties.js +++ b/UI/WebServerResources/UIxCalendarProperties.js @@ -45,4 +45,4 @@ function onColorPickerChoice(newColor) { calendarColor.value = newColor; } -FastInit.addOnLoad(onLoadCalendarProperties); +document.observe("dom:loaded", onLoadCalendarProperties); diff --git a/UI/WebServerResources/UIxColorPicker.js b/UI/WebServerResources/UIxColorPicker.js index 476ccf0e3..7116b06e9 100644 --- a/UI/WebServerResources/UIxColorPicker.js +++ b/UI/WebServerResources/UIxColorPicker.js @@ -8,4 +8,4 @@ function onChooseColor(newColor) { window.opener.onColorPickerChoice(newColor); } -FastInit.addOnLoad(onLoadColorPicker); +document.observe("dom:loaded", onLoadColorPicker); diff --git a/UI/WebServerResources/UIxComponentEditor.js b/UI/WebServerResources/UIxComponentEditor.js index ec7b68d49..57a0b3c65 100644 --- a/UI/WebServerResources/UIxComponentEditor.js +++ b/UI/WebServerResources/UIxComponentEditor.js @@ -153,4 +153,4 @@ function onPopupRecurrenceWindow(event) { return false; } -FastInit.addOnLoad(onComponentEditorLoad); +document.observe("dom:loaded", onComponentEditorLoad); diff --git a/UI/WebServerResources/UIxContactEditor.js b/UI/WebServerResources/UIxContactEditor.js index 65c65ff67..23b12d8ea 100644 --- a/UI/WebServerResources/UIxContactEditor.js +++ b/UI/WebServerResources/UIxContactEditor.js @@ -143,4 +143,4 @@ function initEditorForm() { $("cancelButton").observe("click", onEditorCancelClick); } -FastInit.addOnLoad(initEditorForm); +document.observe("dom:loaded", initEditorForm); diff --git a/UI/WebServerResources/UIxContactsUserFolders.js b/UI/WebServerResources/UIxContactsUserFolders.js index 2cb5ceb68..a766acdf6 100644 --- a/UI/WebServerResources/UIxContactsUserFolders.js +++ b/UI/WebServerResources/UIxContactsUserFolders.js @@ -234,4 +234,4 @@ function initUserFoldersWindow() { searchValue.focus(); } -FastInit.addOnLoad(initUserFoldersWindow); +document.observe("dom:loaded", initUserFoldersWindow); diff --git a/UI/WebServerResources/UIxContactsUserRightsEditor.js b/UI/WebServerResources/UIxContactsUserRightsEditor.js index 3dbe8afcb..b304b07ec 100644 --- a/UI/WebServerResources/UIxContactsUserRightsEditor.js +++ b/UI/WebServerResources/UIxContactsUserRightsEditor.js @@ -9,4 +9,4 @@ function initACLButtons() { button.observe("click", onCancelClick); } -FastInit.addOnLoad(initACLButtons); +document.observe("dom:loaded", initACLButtons); diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 4a17350c5..9df0ef9e2 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -262,7 +262,7 @@ function clickedEditorSave(sender) { document.pageform.action = "save"; document.pageform.submit(); - if (window.opener && window.open && !window.closed) + if (window.opener && window.opener.open && !window.opener.closed) window.opener.refreshFolderByType('draft'); return false; } @@ -569,7 +569,7 @@ function initMailEditor() { var subjectField = $$("div#subjectRow input").first(); initTabIndex($("addressList"), subjectField, textarea); - onWindowResize(null); + onWindowResize.defer(); Event.observe(window, "resize", onWindowResize); Event.observe(window, "beforeunload", onMailEditorClose); @@ -722,7 +722,7 @@ function onWindowResize(event) { // Resize address fields var addresslist = $('addressList'); - addresslist.setStyle({ width: ($(this).width() - attachmentswidth - 10) + 'px' }); + addresslist.setStyle({ width: ($(window).width() - attachmentswidth - 10) + 'px' }); // Set textarea position var hr = headerarea.select("hr").first(); @@ -752,4 +752,4 @@ function onMailEditorClose(event) { Event.stopObserving(window, "beforeunload", onMailEditorClose); } -FastInit.addOnLoad(initMailEditor); +document.observe("dom:loaded", initMailEditor); diff --git a/UI/WebServerResources/UIxMailPopupView.js b/UI/WebServerResources/UIxMailPopupView.js index 5c6b6c92c..9e3dd508b 100644 --- a/UI/WebServerResources/UIxMailPopupView.js +++ b/UI/WebServerResources/UIxMailPopupView.js @@ -54,4 +54,4 @@ function onMenuDeleteMessage(event) { return false; } -FastInit.addOnLoad(initPopupMailer); +document.observe("dom:loaded", initPopupMailer); diff --git a/UI/WebServerResources/UIxMailToSelection.js b/UI/WebServerResources/UIxMailToSelection.js index a61a26168..2f8cb5e41 100644 --- a/UI/WebServerResources/UIxMailToSelection.js +++ b/UI/WebServerResources/UIxMailToSelection.js @@ -191,4 +191,4 @@ function initMailToSelection() { currentIndex = lastIndex = $$("table#addressList tr").length - 2; } -FastInit.addOnLoad(initMailToSelection); +document.observe("dom:loaded", initMailToSelection); diff --git a/UI/WebServerResources/UIxMailUserRightsEditor.js b/UI/WebServerResources/UIxMailUserRightsEditor.js index bfd6e63dd..33aefa3ae 100644 --- a/UI/WebServerResources/UIxMailUserRightsEditor.js +++ b/UI/WebServerResources/UIxMailUserRightsEditor.js @@ -8,4 +8,4 @@ function initACLButtons() { $("cancelButton").observe("click", onCancelClick); } -FastInit.addOnLoad(initACLButtons); +document.observe("dom:loaded", initACLButtons); diff --git a/UI/WebServerResources/UIxOccurenceDialog.js b/UI/WebServerResources/UIxOccurenceDialog.js index 8c56377d2..557502f67 100644 --- a/UI/WebServerResources/UIxOccurenceDialog.js +++ b/UI/WebServerResources/UIxOccurenceDialog.js @@ -39,4 +39,4 @@ function onOccurenceDialogLoad() { cancelButton.observe("click", onCancelButtonClick); } -FastInit.addOnLoad(onOccurenceDialogLoad); +document.observe("dom:loaded", onOccurenceDialogLoad); diff --git a/UI/WebServerResources/UIxPreferences.js b/UI/WebServerResources/UIxPreferences.js index 6323cf099..8f977ca35 100644 --- a/UI/WebServerResources/UIxPreferences.js +++ b/UI/WebServerResources/UIxPreferences.js @@ -48,4 +48,4 @@ function onReplyPlacementListChange() { } } -FastInit.addOnLoad(initPreferences); +document.observe("dom:loaded", initPreferences); diff --git a/UI/WebServerResources/UIxRecurrenceEditor.js b/UI/WebServerResources/UIxRecurrenceEditor.js index e5a230082..a30ef240a 100644 --- a/UI/WebServerResources/UIxRecurrenceEditor.js +++ b/UI/WebServerResources/UIxRecurrenceEditor.js @@ -145,8 +145,8 @@ function initializeFormValues() { $('rangeAppointmentsField').value = parent$("range2").value; } else if (range == 2) { - $('endDate_date').value = parent$("range2").value; - $('endDate_date').disabled = false; + $('endDate_date').value = parent$("range2").value; + $('endDate_date').disabled = false; } $('rangeAppointmentsField').observe("click", function(event) { @@ -354,4 +354,4 @@ function onRecurrenceLoadHandler() { assignCalendar('endDate_date'); } -FastInit.addOnLoad(onRecurrenceLoadHandler); +document.observe("dom:loaded", onRecurrenceLoadHandler); diff --git a/UI/WebServerResources/UIxTaskEditor.js b/UI/WebServerResources/UIxTaskEditor.js index cbd09f99c..063c13537 100644 --- a/UI/WebServerResources/UIxTaskEditor.js +++ b/UI/WebServerResources/UIxTaskEditor.js @@ -311,4 +311,4 @@ function onTaskEditorLoad() { initializeStatusLine(); } -FastInit.addOnLoad(onTaskEditorLoad); +document.observe("dom:loaded", onTaskEditorLoad);