SoObjects/Appointments/GNUmakefile

Monotone-Parent: 18c8420c0a0c752ea4dd761f934a473b321568f8
Monotone-Revision: b2699a981cd5458fbd1da1a9a72992020a29a4fc

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2006-12-14T21:20:13
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2006-12-14 21:20:13 +00:00
parent 87dd80e801
commit dc40718409
51 changed files with 1420 additions and 969 deletions
+31 -12
View File
@@ -498,14 +498,13 @@ function onConfirmContactSelection(tag)
var contactsList = $("contactsList");
var rows = contactsList.getSelectedRows();
for (i = 0; i < rows.length; i++)
{
var cid = rows[i].getAttribute("contactid");
var cname = '' + rows[i].getAttribute("contactname");
var email = '' + rows[i].cells[1].innerHTML;
opener.window.addContact(tag, currentContactFolderName + '/' + cname,
cid, cname, email);
}
for (i = 0; i < rows.length; i++) {
var cid = rows[i].getAttribute("contactid");
var cname = '' + rows[i].getAttribute("contactname");
var email = '' + rows[i].cells[1].innerHTML;
opener.window.addContact(tag, currentContactFolderName + '/' + cname,
cid, cname, email);
}
if (selector && selector.changeNotification
&& selectorList.value != initialValues)
@@ -604,13 +603,13 @@ function refreshContacts(contactId) {
function onAddressBookAdd(node) {
var selector = $("contactFolders");
var selectorUrl = '?popup=YES&selectorId=contactFolders';
var selectorURL = '?popup=YES&selectorId=contactFolders';
urlstr = ApplicationBaseURL;
if (urlstr[urlstr.length-1] != '/')
urlstr += '/';
urlstr += ("../../" + UserLogin + "/Contacts/"
+ contactSelectorAction + selectorUrl);
+ contactSelectorAction + selectorURL);
// log (urlstr);
var w = window.open(urlstr, "Addressbook",
"width=640,height=400,resizable=1,scrollbars=0");
@@ -660,9 +659,29 @@ function configureDragHandles() {
function configureContactFolders() {
var contactFolders = $("contactFolders");
if (contactFolders) {
if (contactFolders)
contactFolders.addEventListener("selectionchange", onFolderSelectionChange, false);
}
}
function onAccessRightsMenuEntryMouseUp(event) {
var folders = $("contactFolders");
var selected = folders.getSelectedNodes()[0];
var external = selected.getAttribute("external-addressbook");
var title = this.innerHTML;
if (external)
url = UserFolderURL + "../" + external + "/Contacts/personal/acl";
else
url = ApplicationBaseURL + selected.getAttribute("id") + "/acl";
openAclWindow(url, title);
}
function initializeMenus() {
var menus = new Array("contactFoldersMenu", "contactMenu", "searchMenu");
initMenusNamed(menus);
var menuEntry = $("accessRightsMenuEntry");
menuEntry.addEventListener("mouseup", onAccessRightsMenuEntryMouseUp, false);
}
var initContacts = {
+36
View File
@@ -141,3 +141,39 @@ HTMLElement.prototype.getSelectedNodesId = function() {
return selArray;
}
HTMLElement.prototype.onContextMenu = function(event) {
var popup = this.sogoContextMenu;
if (document.currentPopupMenu)
hideMenu(event, document.currentPopupMenu);
var menuTop = event.pageY;
var menuLeft = event.pageX;
var heightDiff = (window.innerHeight
- (menuTop + popup.offsetHeight));
if (heightDiff < 0)
menuTop += heightDiff;
var leftDiff = (window.innerWidth
- (menuLeft + popup.offsetWidth));
if (leftDiff < 0)
menuLeft -= popup.offsetWidth;
popup.style.top = menuTop + "px;";
popup.style.left = menuLeft + "px;";
popup.style.visibility = "visible;";
// setupMenuTarget(popup, event.target);
bodyOnClick = "" + document.body.getAttribute("onclick");
document.body.setAttribute("onclick", "onBodyClick(event);");
document.currentPopupMenu = popup;
// event.cancelBubble = true;
// event.returnValue = false;
}
HTMLElement.prototype.attachMenu = function(menuName) {
this.sogoContextMenu = $(menuName);
this.addEventListener("contextmenu", this.onContextMenu, true);
}
+11 -3
View File
@@ -487,7 +487,7 @@ function messageListCallback(http)
log ("ajax fuckage");
}
function onMessageContextMenu(event, element)
function onMessageContextMenu(event)
{
var menu = $('messageListMenu');
menu.addEventListener("hideMenu", onMessageContextMenuHide, false);
@@ -498,8 +498,8 @@ function onMessageContextMenu(event, element)
for (var i = 0; i < selectedNodes.length; i++)
deselectNode (selectedNodes[i]);
topNode.menuSelectedRows = selectedNodes;
topNode.menuSelectedEntry = element;
selectNode(element);
topNode.menuSelectedEntry = this;
selectNode(this);
}
function onMessageContextMenuHide(event)
@@ -1003,4 +1003,12 @@ var initMailer = {
}
}
function initializeMenus() {
var menus = new Array("accountIconMenu", "inboxIconMenu", "trashIconMenu",
"mailboxIconMenu", "addressMenu", "messageListMenu",
"messageContentMenu", "label-menu", "mailboxes-menu",
"mark-menu", "searchMenu");
initMenusNamed(menus);
}
window.addEventListener("load", initMailer, false);
+9 -5
View File
@@ -12,11 +12,15 @@ var SOGODragAndDropSourceInterface = {
this.addEventListener("mousedown", this.dragGestureMouseDownHandler, false);
},
dragGestureMouseDownHandler: function (event) {
// log("mousedown");
document._dragGestureStartPoint = new Array(event.clientX, event.clientY);
document._currentMouseGestureObject = this;
window.addEventListener("mousemove", this.dragGestureMouseMoveHandler, false);
window.addEventListener("mouseup", this.dragGestureMouseUpHandler, false);
if (event.button == 0) {
document._dragGestureStartPoint = new Array(event.clientX,
event.clientY);
document._currentMouseGestureObject = this;
window.addEventListener("mousemove", this.dragGestureMouseMoveHandler,
false);
window.addEventListener("mouseup", this.dragGestureMouseUpHandler,
false);
}
},
dragGestureMouseUpHandler: function (event) {
log("mouseup");
+45 -15
View File
@@ -3,7 +3,6 @@ var sortKey = '';
var listFilter = 'view_today';
var CalendarBaseURL = ApplicationBaseURL;
var listOfSelection = null;
var hideCompletedTasks = 0;
@@ -478,12 +477,11 @@ function calendarDisplayCallback(http)
if (http.callbackData["hour"])
hour = http.callbackData["hour"];
var contentView;
log ("currentView: " + currentView);
if (currentView == "monthview")
contentView = $("calendarContent");
else {
scrollDayView(hour);
log("cbtest1");
// log("cbtest1");
contentView = $("daysView");
}
var appointments = document.getElementsByClassName("appointment", contentView);
@@ -507,7 +505,7 @@ function calendarDisplayCallback(http)
clickableCells[j].addEventListener("dblclick",
onClickableCellsDblClick, false);
}
log("cbtest1");
// log("cbtest1");
}
else
log ("ajax fuckage");
@@ -610,7 +608,7 @@ function _loadTasksHref(href) {
}
function onHeaderClick(event) {
log("onHeaderClick: " + this.link);
// log("onHeaderClick: " + this.link);
_loadAppointmentHref(this.link);
event.preventDefault();
@@ -947,14 +945,6 @@ function updateCalendarsList(method)
updateCalendarStatus();
}
function initCalendarContactsSelector(selId)
{
var selector = $(selId);
inhibitMyCalendarEntry();
updateCalendarStatus();
selector.changeNotification = updateCalendarsList;
}
function addContact(tag, fullContactName, contactId, contactName, contactEmail)
{
var uids = $('uixselector-calendarsList-uidList');
@@ -1002,7 +992,7 @@ function onChangeCalendar(list) {
}
function validateBrowseURL(input) {
var button = $("browseUrlBtn");
var button = $("browseURLBtn");
if (input.value.length) {
if (!button.enabled)
@@ -1011,7 +1001,7 @@ function validateBrowseURL(input) {
disableAnchor(button);
}
function browseUrl(anchor, event) {
function browseURL(anchor, event) {
if (event.button == 0) {
var input = $("url");
var url = input.value;
@@ -1022,6 +1012,32 @@ function browseUrl(anchor, event) {
return false;
}
function initializeMenus() {
var menus = new Array("monthListMenu", "yearListMenu",
"appointmentsListMenu", "calendarsMenu", "searchMenu");
initMenusNamed(menus);
var calendarsList = $("calendarsList");
calendarsList.attachMenu("calendarsMenu");
var accessRightsMenuEntry = $("accessRightsMenuEntry");
accessRightsMenuEntry.addEventListener("mouseup",
onAccessRightsMenuEntryMouseUp,
false);
}
function onAccessRightsMenuEntryMouseUp(event) {
var folders = $("uixselector-calendarsList-display");
var selected = folders.getSelectedNodes()[0];
var uid = selected.getAttribute("uid");
if (uid == UserLogin)
url = ApplicationBaseURL + "acl";
else
url = UserFolderURL + "../" + uid + "/Calendar/acl";
openAclWindow(url, uid);
}
function configureDragHandles() {
var handle = $("verticalDragHandle");
if (handle) {
@@ -1037,3 +1053,17 @@ function configureDragHandles() {
handle.lowerBlock=$("calendarView");
}
}
function initCalendarContactsSelector() {
var selector = $("calendarsList");
inhibitMyCalendarEntry();
updateCalendarStatus();
selector.changeNotification = updateCalendarsList;
}
function initCalendars() {
if (!document.body.hasClassName("popup"))
initCalendarContactsSelector();
}
window.addEventListener("load", initCalendars, false);
+55 -9
View File
@@ -149,10 +149,10 @@ function sanitizeMailTo(dirtyMailTo) {
}
function openMailComposeWindow(url) {
w = window.open(url, null,
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
var w = window.open(url, null,
"width=680,height=520,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
w.focus();
return w;
@@ -367,6 +367,7 @@ function acceptMultiSelect(node) {
function onRowClick(event) {
var node = event.target;
if (node.tagName == 'TD')
node = node.parentNode;
@@ -754,17 +755,17 @@ function initCriteria()
function onContactAdd(node)
{
var selector = null;
var selectorUrl = '?popup=YES';
var selectorURL = '?popup=YES';
if (node) {
selector = node.parentNode.parentNode;
selectorUrl += ("&selectorId=" + selector.getAttribute("id"));
selectorURL += ("&selectorId=" + selector.getAttribute("id"));
}
urlstr = ApplicationBaseURL;
if (urlstr[urlstr.length-1] != '/')
urlstr += '/';
urlstr += ("../../" + UserLogin + "/Contacts/"
+ contactSelectorAction + selectorUrl);
+ contactSelectorAction + selectorURL);
// log (urlstr);
var w = window.open(urlstr, "Addressbook",
"width=640,height=400,resizable=1,scrollbars=0");
@@ -834,15 +835,45 @@ function initTabs()
}
}
function initMenusNamed(menuDivNames) {
for (var i = 0; i < menuDivNames.length; i++) {
var menuDIV = $(menuDivNames[i]);
if (menuDIV)
initMenu(menuDIV);
else
log("menu named '" + menuDivNames[i] + "' not found");
}
}
function initMenu(menuDIV) {
var lis = menuDIV.childNodesWithTag("ul")[0].childNodesWithTag("li");
for (var j = 0; j < lis.length; j++)
lis[j].addEventListener("mousedown", listRowMouseDownHandler, false);
var subMenus = menuDIV.childNodesWithTag("div");
for (var i = 0; i < subMenus.length; i++)
initMenu(subMenus[i]);
}
function onTabMouseDown(event) {
event.cancelBubble = true;
return false;
event.preventDefault();
}
function openExternalLink(anchor) {
return false;
}
function openAclWindow(url, objectTitle) {
var w = window.open(url, "aclWindow",
"width=300,height=300,resizable=1,scrollbars=1,toolbar=0,"
+ "location=0,directories=0,status=0,menubar=0"
+ ",copyhistory=0");
w.focus();
w.title = "Poil: " + objectTitle;
return w;
}
function onTabClick(event) {
var node = event.target;
@@ -932,7 +963,10 @@ function indexColor(number) {
var onLoadHandler = {
handleEvent: function (event) {
queryParameters = parseQueryParameters('' + window.location);
initLogConsole();
if (!document.body.hasClassName("popup")) {
initLogConsole();
initializeMenus();
}
initTabs();
configureDragHandles();
configureSortableTableHeaders();
@@ -960,6 +994,14 @@ function onLinkBannerClick() {
checkAjaxRequestsState();
}
function onRightsAdministrationClick(event) {
var url = ApplicationBaseURL;
if (!url)
url = UserFolderURL;
openAclWindow(url+ "/acls");
event.preventDefault();
}
function configureLinkBanner() {
var linkBanner = $("linkBanner");
if (linkBanner) {
@@ -969,6 +1011,7 @@ function configureLinkBanner() {
false);
anchors[i].addEventListener("click", onLinkBannerClick, false);
}
anchors[4].addEventListener("click", onRightsAdministrationClick, false);
if (anchors.length > 6)
anchors[6].addEventListener("click", toggleLogConsole, true);
}
@@ -980,6 +1023,9 @@ window.addEventListener("load", onLoadHandler, false);
function configureDragHandles() {
}
function initializeMenus() {
}
function onHeaderClick(event) {
window.alert("generic headerClick");
}