- added the ability to view the message source;
- no longer autocreate folders if we are not their owners;
- made compatible with PostgreSQL 8.2;
+- the months and years menus of the date selector would no longer appear;
xmlns:label="OGo:label"
id="dateSelector">
<div class="header">
- <a href="#"
- id="rightArrow"
- var:date="nextMonthAsString"
- onclick="return onDateSelectorGotoMonth(this);"
+ <a href="#" id="rightArrow" var:date="nextMonthAsString"
><img id="next" rsrc:src="arrow-rit-sharp.gif"
/></a>
- <a href="#"
- id="leftArrow"
- var:date="prevMonthAsString"
- onclick="return onDateSelectorGotoMonth(this);"
+ <a href="#" id="leftArrow" var:date="prevMonthAsString"
><img id="previous" rsrc:src="arrow-lft-sharp.gif" />
- </a><span id="monthLabel"
- onmousedown="return false;"
- var:month="headerMonthValue"
- onclick="popupMonthMenu(event, 'monthListMenu');"
- ><var:string value="headerMonthString"
- /></span><span id="yearLabel"
- onmousedown="return false;"
- onclick="popupMonthMenu(event, 'yearListMenu');"
- ><var:string value="headerYearString"
- /></span>
+ </a><span id="monthLabel" var:month="headerMonthValue"
+ ><var:string value="headerMonthString" /></span
+ ><span id="yearLabel"><var:string value="headerYearString" /></span>
</div>
<var:month-overview
var popup = element.sogoContextMenu;
if (document.currentPopupMenu)
- hideMenu(event, document.currentPopupMenu);
+ hideMenu(document.currentPopupMenu);
var menuTop = event.pageY;
var menuLeft = event.pageX;
function dateSelectorCallback(http) {
if (http.readyState == 4
&& http.status == 200) {
- document.dateSelectorAjaxRequest = null;
- var content = http.responseText;
- setDateSelectorContent(content);
- cachedDateSelectors[http.callbackData] = content;
+ document.dateSelectorAjaxRequest = null;
+ var content = http.responseText;
+ setDateSelectorContent(content);
+ cachedDateSelectors[http.callbackData] = content;
+ initDateSelectorEvents();
}
else
log ("dateSelectorCallback Ajax error");
}
function selectMonthInMenu(menu, month) {
- var entries = menu.childNodes[1].childNodesWithTag("LI");
- for (i = 0; i < entries.length; i++) {
- var entry = entries[i];
- var entryMonth = entry.getAttribute("month");
- if (entryMonth == month)
- entry.addClassName("currentMonth");
- else
- entry.removeClassName("currentMonth");
- }
+ var entries = menu.childNodes[1].childNodesWithTag("LI");
+ for (i = 0; i < entries.length; i++) {
+ var entry = entries[i];
+ var entryMonth = entry.getAttribute("month");
+ if (entryMonth == month)
+ entry.addClassName("currentMonth");
+ else
+ entry.removeClassName("currentMonth");
+ }
}
function selectYearInMenu(menu, month) {
}
}
-function popupMonthMenu(event, menuId) {
- var node = event.target;
-
+function popupMonthMenu(event) {
if (event.button == 0) {
- event.cancelBubble = true;
- event.returnValue = false;
-
- if (document.currentPopupMenu)
- hideMenu(event, document.currentPopupMenu);
+ var id = this.getAttribute("id");
+ if (id == "monthLabel")
+ menuId = "monthListMenu";
+ else
+ menuId = "yearListMenu";
var popup = $(menuId);
- var id = node.getAttribute("id");
if (id == "monthLabel")
- selectMonthInMenu(popup, node.getAttribute("month"));
+ selectMonthInMenu(popup, this.getAttribute("month"));
else
- selectYearInMenu(popup, node.innerHTML);
-
- var diff = (popup.offsetWidth - node.offsetWidth) /2;
+ selectYearInMenu(popup, this.innerHTML);
- popup.style.top = (node.offsetTop + 95) + "px";
- popup.style.left = (node.offsetLeft - diff) + "px";
- popup.style.visibility = "visible";
-
- bodyOnClick = "" + document.body.getAttribute("onclick");
- document.body.setAttribute("onclick", "onBodyClick('" + menuId + "');");
- document.currentPopupMenu = popup;
+ popupToolbarMenu(this, menuId);
+ Event.stop(event);
}
}
menus["yearListMenu"] = dateMenu;
menus["eventsListMenu"] = new Array(onMenuNewEventClick, "-",
- onMenuNewTaskClick,
- editEvent, deleteEvent, "-",
- onSelectAll, "-",
- null, null);
+ onMenuNewTaskClick,
+ editEvent, deleteEvent, "-",
+ onSelectAll, "-",
+ null, null);
menus["calendarsMenu"] = new Array(null, null, "-", null, null, "-",
null, "-", onMenuSharing);
menus["searchMenu"] = new Array(setSearchCriteria);
onEventContextMenu.bindAsEventListener(div));
}
+function initDateSelectorEvents() {
+ var arrow = $("rightArrow");
+ Event.observe(arrow, "click",
+ onDateSelectorGotoMonth.bindAsEventListener(arrow));
+ arrow = $("leftArrow");
+ Event.observe(arrow, "click",
+ onDateSelectorGotoMonth.bindAsEventListener(arrow));
+
+ var menuButton = $("monthLabel");
+ Event.observe(menuButton, "click",
+ popupMonthMenu.bindAsEventListener(menuButton));
+ menuButton = $("yearLabel");
+ Event.observe(menuButton, "click",
+ popupMonthMenu.bindAsEventListener(menuButton));
+}
+
function initCalendars() {
if (!document.body.hasClassName("popup")) {
+ initDateSelectorEvents();
initCalendarSelector();
configureSearchField();
configureLists();
}
function onSelectPrivacy(event) {
- popupToolbarMenu(event, "privacy-menu");
-
- return false;
+ if (event.button == 0) {
+ var node = event.target;
+ if (node.tagName != 'A')
+ node = node.getParentWithTagName("a");
+ node = node.childNodesWithTag("span")[0];
+
+ popupToolbarMenu(node, "privacy-menu");
+ Event.stop(event);
+// preventDefault(event);
+ }
}
function onPopupUrlWindow(event) {
initializeDocumentHref();
initializePrivacyMenu();
var list = $("calendarList");
- Event.observe(list, "change", onChangeCalendar.bindAsEventListener(list), false);
+ Event.observe(list, "change",
+ onChangeCalendar.bindAsEventListener(list),
+ false);
if (document.createEvent) {
var onSelectionChangeEvent = document.createEvent("Event");
onSelectionChangeEvent.initEvent("change", false, false);
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
for (var i = 0; i < menuItems.length; i++)
- Event.observe(menuItems[i], "mouseup", onMenuSetClassification.bindAsEventListener(menuItems[i]), false);
+ Event.observe(menuItems[i], "mouseup",
+ onMenuSetClassification.bindAsEventListener(menuItems[i]),
+ false);
}
addEvent(window, 'load', onComponentEditorLoad);
document.menuTarget = target;
if (document.currentPopupMenu)
- hideMenu(event, document.currentPopupMenu);
+ hideMenu(document.currentPopupMenu);
var popup = $(menuId);
var menuTop = event.pageY;
function onBodyClickMenuHandler(event) {
document.body.menuTarget = null;
- hideMenu(event, document.currentPopupMenu);
+ hideMenu(document.currentPopupMenu);
Event.stopObserving(document.body, "click", onBodyClickMenuHandler);
preventDefault(event);
}
-function hideMenu(event, menuNode) {
+function hideMenu(menuNode) {
var onHide;
-// log('hiding menu "' + menuNode.getAttribute('id') + '"');
if (menuNode.submenu) {
- hideMenu(event, menuNode.submenu);
+ hideMenu(menuNode.submenu);
menuNode.submenu = null;
}
var submenuNode = $(this.submenu);
var parentNode = getParentMenu(node);
if (parentNode.submenu)
- hideMenu(event, parentNode.submenu);
+ hideMenu(parentNode.submenu);
submenuNode.parentMenuItem = node;
submenuNode.parentMenu = parentNode;
parentNode.submenuItem = node;
&& menuX < itemX + submenuItem.offsetWidth
&& (menuY < itemY
|| menuY > (itemY + submenuItem.offsetHeight))) {
- hideMenu(event, parentMenu.submenu);
+ hideMenu(parentMenu.submenu);
parentMenu.submenu = null;
parentMenu.submenuItem = null;
parentMenu.setAttribute('onmousemove', null);
event.returnValue = false;
if (document.currentPopupMenu)
- hideMenu(event, document.currentPopupMenu);
+ hideMenu(document.currentPopupMenu);
var popup = $(menuId);
popup.setStyle({ top: this.offsetHeight + "px",
}
/* toolbar buttons */
-function popupToolbarMenu(event, menuId) {
- var toolbar = $("toolbar");
- var node = getTarget(event);
- if (node.tagName != 'A')
- node = node.getParentWithTagName("a");
- node = node.childNodesWithTag("span")[0];
-
- if (event.button == 0) {
- event.cancelBubble = true;
- event.returnValue = false;
-
- if (document.currentPopupMenu)
- hideMenu(event, document.currentPopupMenu);
-
- var popup = document.getElementById(menuId);
- var top = node.offsetTop + node.offsetHeight - 2;
- popup.setStyle({ top: top + "px",
- left: node.cascadeLeftOffset() + "px",
- visibility: "visible" });
-
- document.currentPopupMenu = popup;
- Event.observe(document.body, "click", onBodyClickMenuHandler);
- }
+function popupToolbarMenu(node, menuId) {
+ if (document.currentPopupMenu)
+ hideMenu(document.currentPopupMenu);
+
+ var popup = $(menuId);
+ var top = node.top + node.offsetHeight - 2;
+ popup.setStyle({ top: top + "px",
+ left: node.cascadeLeftOffset() + "px",
+ visibility: "visible" });
+
+ document.currentPopupMenu = popup;
+ Event.observe(document.body, "click", onBodyClickMenuHandler);
}
/* contact selector */