mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-08-21 14:43:31 +00:00
merge of '32ac613ce54828e76c41d1e1457a982917bf0b8e'
and 'bee60405e7b87d3e239c75247535e09b1a7e0943' Monotone-Parent: 32ac613ce54828e76c41d1e1457a982917bf0b8e Monotone-Parent: bee60405e7b87d3e239c75247535e09b1a7e0943 Monotone-Revision: 49f34fbd1c71d08a025aff7ebece50001773fa8e Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-05-25T15:46:07 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -91,7 +91,7 @@ function contactsListCallback(http) {
|
||||
function onContactFoldersContextMenu(event) {
|
||||
var menu = $("contactFoldersMenu");
|
||||
Event.observe(menu, "hideMenu", onContactFoldersContextMenuHide, false);
|
||||
onMenuClick(event, "contactFoldersMenu");
|
||||
popupMenu(event, "contactFoldersMenu", this);
|
||||
|
||||
var topNode = $("contactFolders");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -105,7 +105,7 @@ function onContactFoldersContextMenu(event) {
|
||||
function onContactContextMenu(event, element) {
|
||||
var menu = $("contactMenu");
|
||||
Event.observe(menu, "hideMenu", onContactContextMenuHide, false);
|
||||
onMenuClick(event, "contactMenu");
|
||||
popupMenu(event, "contactMenu", element);
|
||||
|
||||
var topNode = $("contactsList");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -235,31 +235,23 @@ function onContactRowDblClick(event, node) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuEditContact(event, node) {
|
||||
var node = getParentMenu(node).menuTarget.parentNode;
|
||||
var contactId = node.getAttribute('id');
|
||||
function onMenuEditContact(event) {
|
||||
var contactId = document.menuTarget.getAttribute('id');
|
||||
|
||||
openContactWindow(null,
|
||||
URLForFolderID(currentContactFolder)
|
||||
+ "/" + contactId + "/edit");
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuWriteToContact(event, node) {
|
||||
var node = getParentMenu(node).menuTarget.parentNode;
|
||||
var contactId = node.getAttribute('id');
|
||||
function onMenuWriteToContact(event) {
|
||||
var contactId = document.menuTarget.getAttribute('id');
|
||||
|
||||
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
|
||||
+ "/" + contactId + "/write");
|
||||
|
||||
return false;
|
||||
openMailComposeWindow(ApplicationBaseURL + currentContactFolder
|
||||
+ "/" + contactId + "/write");
|
||||
}
|
||||
|
||||
function onMenuDeleteContact(event, node) {
|
||||
uixDeleteSelectedContacts(node);
|
||||
|
||||
return false;
|
||||
function onMenuDeleteContact(event) {
|
||||
uixDeleteSelectedContacts(this);
|
||||
}
|
||||
|
||||
function onToolbarEditSelectedContacts(event) {
|
||||
@@ -594,9 +586,8 @@ function configureContactFolders() {
|
||||
if (contactFolders) {
|
||||
Event.observe(contactFolders, "selectionchange", onFolderSelectionChange, false);
|
||||
var lis = contactFolders.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++) {
|
||||
for (var i = 0; i < lis.length; i++)
|
||||
setEventsOnContactFolder(lis[i]);
|
||||
}
|
||||
|
||||
lookupDeniedFolders();
|
||||
contactFolders.setStyle({ visibility: 'visible' });
|
||||
@@ -612,21 +603,27 @@ function setEventsOnContactFolder(node) {
|
||||
Event.observe(node, "contextmenu", onContactFoldersContextMenu, false);
|
||||
}
|
||||
|
||||
function onAccessRightsMenuEntryMouseUp(event) {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var title = this.innerHTML;
|
||||
var url = URLForFolderID(selected.getAttribute("id"))
|
||||
function onMenuSharing(event) {
|
||||
var folders = $("contactFolders");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var title = this.innerHTML;
|
||||
var url = URLForFolderID(selected.getAttribute("id"));
|
||||
|
||||
openAclWindow(url + "/acls", title);
|
||||
openAclWindow(url + "/acls", title);
|
||||
}
|
||||
|
||||
function initializeMenus() {
|
||||
var menus = new Array("contactFoldersMenu", "contactMenu", "searchMenu");
|
||||
initMenusNamed(menus);
|
||||
menus["menuIds"] = new Array("contactFoldersMenu", "contactMenu",
|
||||
"searchMenu");
|
||||
menus["contactFoldersMenu"] = new Array(null, "-", null,
|
||||
null, "-", null, "-",
|
||||
onMenuSharing);
|
||||
menus["contactMenu"] = new Array(onMenuEditContact, "-",
|
||||
onMenuWriteToContact, null, "-",
|
||||
onMenuDeleteContact);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
var menuEntry = $("accessRightsMenuEntry");
|
||||
Event.observe(menuEntry, "mouseup", onAccessRightsMenuEntryMouseUp, false);
|
||||
initMenus();
|
||||
}
|
||||
|
||||
function configureSearchField() {
|
||||
|
||||
@@ -1,178 +1,236 @@
|
||||
Element.addMethods({
|
||||
|
||||
addInterface: function(element, objectInterface) {
|
||||
element = $(element);
|
||||
Object.extend(element, objectInterface);
|
||||
if (element.bind)
|
||||
element.bind();
|
||||
},
|
||||
|
||||
childNodesWithTag: function(element, tagName) {
|
||||
element = $(element);
|
||||
var matchingNodes = new Array();
|
||||
var tagName = tagName.toUpperCase();
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
if (typeof(element.childNodes[i]) == "object"
|
||||
&& element.childNodes[i].tagName
|
||||
&& element.childNodes[i].tagName.toUpperCase() == tagName)
|
||||
matchingNodes.push(element.childNodes[i]);
|
||||
}
|
||||
if (navigator.vendor == "Apple Computer, Inc." || navigator.vendor == "KDE") { // WebCore/KHTML
|
||||
/*
|
||||
Crossbrowser HTMLElement Prototyping
|
||||
Copyright (C) 2005 Jason Davis, http://www.browserland.org
|
||||
Additional thanks to Brothercake, http://www.brothercake.com
|
||||
|
||||
return matchingNodes;
|
||||
},
|
||||
This code is licensed under the LGPL:
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
*/
|
||||
|
||||
getParentWithTagName: function(element, tagName) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
tagName = tagName.toUpperCase();
|
||||
|
||||
currentElement = currentElement.parentNode;
|
||||
while (currentElement
|
||||
&& currentElement.tagName != tagName) {
|
||||
currentElement = currentElement.parentNode;
|
||||
}
|
||||
|
||||
return currentElement;
|
||||
},
|
||||
|
||||
cascadeLeftOffset: function(element) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
(function(c) {
|
||||
for (var i in c)
|
||||
window["HTML" + i + "Element"] = document.createElement(c[ i ]).constructor;
|
||||
})({
|
||||
Html: "html", Head: "head", Link: "link", Title: "title", Meta: "meta",
|
||||
Base: "base", IsIndex: "isindex", Style: "style", Body: "body", Form: "form",
|
||||
Select: "select", OptGroup: "optgroup", Option: "option", Input: "input",
|
||||
TextArea: "textarea", Button: "button", Label: "label", FieldSet: "fieldset",
|
||||
Legend: "legend", UList: "ul", OList: "ol", DList: "dl", Directory: "dir",
|
||||
Menu: "menu", LI: "li", Div: "div", Paragraph: "p", Heading: "h1", Quote: "q",
|
||||
Pre: "pre", BR: "br", BaseFont: "basefont", Font: "font", HR: "hr", Mod: "ins",
|
||||
Anchor: "a", Image: "img", Object: "object", Param: "param", Applet: "applet",
|
||||
Map: "map", Area: "area", Script: "script", Table: "table", TableCaption: "caption",
|
||||
TableCol: "col", TableSection: "tbody", TableRow: "tr", TableCell: "td",
|
||||
FrameSet: "frameset", Frame: "frame", IFrame: "iframe"
|
||||
});
|
||||
|
||||
var offset = 0;
|
||||
while (currentElement) {
|
||||
offset += currentElement.offsetLeft;
|
||||
currentElement = currentElement.getParentWithTagName("div");
|
||||
}
|
||||
|
||||
return offset;
|
||||
},
|
||||
|
||||
cascadeTopOffset: function(element) {
|
||||
element = $(element);
|
||||
var currentElement = element;
|
||||
var offset = 0;
|
||||
|
||||
var i = 0;
|
||||
while (currentElement
|
||||
&& currentElement instanceof HTMLElement) {
|
||||
offset += currentElement.offsetTop;
|
||||
currentElement = currentElement.parentNode;
|
||||
i++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
},
|
||||
|
||||
dump: function(element, additionalInfo, additionalKeys) {
|
||||
element = $(element);
|
||||
var id = element.getAttribute("id");
|
||||
var nclass = element.getAttribute("class");
|
||||
function HTMLElement() {}
|
||||
//HTMLElement.prototype = HTMLHtmlElement.__proto__.__proto__;
|
||||
var HTMLDocument = document.constructor;
|
||||
var HTMLCollection = document.links.constructor;
|
||||
var HTMLOptionsCollection = document.createElement("select").options.constructor;
|
||||
var Text = document.createTextNode("").constructor;
|
||||
//var Node = Text;
|
||||
|
||||
var str = element.tagName;
|
||||
if (id)
|
||||
str += "; id = " + id;
|
||||
if (nclass)
|
||||
str += "; class = " + nclass;
|
||||
|
||||
if (additionalInfo)
|
||||
str += "; " + additionalInfo;
|
||||
|
||||
if (additionalKeys)
|
||||
for (var i = 0; i < additionalKeys.length; i++) {
|
||||
var value = element.getAttribute(additionalKeys[i]);
|
||||
if (value)
|
||||
str += "; " + additionalKeys[i] + " = " + value;
|
||||
}
|
||||
|
||||
log (str);
|
||||
},
|
||||
// More efficient for Safari 2
|
||||
function Document() {}
|
||||
function Event() {}
|
||||
function HTMLCollection() {}
|
||||
function HTMLElement() {}
|
||||
function Node() {}
|
||||
Document.prototype = window["[[DOMDocument]]"];
|
||||
Event.prototype = window["[[DOMEvent]]"];
|
||||
HTMLCollection.prototype = window["[[HTMLCollection.prototype]]"];
|
||||
HTMLElement.prototype = window["[[DOMElement.prototype]]"];
|
||||
Node.prototype = window["[[DOMNode.prototype]]"];
|
||||
}
|
||||
|
||||
getSelectedNodes: function(element) {
|
||||
element = $(element);
|
||||
var selArray = new Array();
|
||||
/* custom extensions to the DOM api */
|
||||
HTMLElement.prototype.addInterface = function(objectInterface) {
|
||||
Object.extend(this, objectInterface);
|
||||
if (this.bind)
|
||||
this.bind();
|
||||
}
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
node = element.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node);
|
||||
}
|
||||
|
||||
return selArray;
|
||||
},
|
||||
|
||||
getSelectedNodesId: function(element) {
|
||||
element = $(element);
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < element.childNodes.length; i++) {
|
||||
node = element.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node.getAttribute("id"));
|
||||
}
|
||||
|
||||
return selArray;
|
||||
},
|
||||
HTMLElement.prototype.childNodesWithTag = function(tagName) {
|
||||
var matchingNodes = new Array();
|
||||
var tagName = tagName.toUpperCase();
|
||||
|
||||
onContextMenu: function(element, event) {
|
||||
element = $(element);
|
||||
var popup = element.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;";
|
||||
|
||||
bodyOnClick = "" + document.body.getAttribute("onclick");
|
||||
document.body.setAttribute("onclick", "onBodyClick(event);");
|
||||
document.currentPopupMenu = popup;
|
||||
},
|
||||
|
||||
attachMenu: function(element, menuName) {
|
||||
element = $(element);
|
||||
element.sogoContextMenu = $(menuName);
|
||||
element.addEventListener("contextmenu", element.onContextMenu, true);
|
||||
},
|
||||
|
||||
select: function(element) {
|
||||
element = $(element);
|
||||
element.addClassName('_selected');
|
||||
},
|
||||
|
||||
deselect: function(element) {
|
||||
element = $(element);
|
||||
element.removeClassName('_selected');
|
||||
},
|
||||
|
||||
deselectAll: function(element) {
|
||||
element = $(element);
|
||||
var nodes;
|
||||
if (element.tagName == 'TABLE')
|
||||
nodes = element.getSelectedRows();
|
||||
else
|
||||
nodes = element.childNodes;
|
||||
for (var i = 0; i < nodes.length; i++) {
|
||||
var node = nodes.item(i);
|
||||
if (node.nodeType == 1)
|
||||
node.deselect();
|
||||
}
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
if (typeof(this.childNodes[i]) == "object"
|
||||
&& this.childNodes[i].tagName
|
||||
&& this.childNodes[i].tagName.toUpperCase() == tagName)
|
||||
matchingNodes.push(this.childNodes[i]);
|
||||
}
|
||||
|
||||
}); // Element.addMethods
|
||||
return matchingNodes;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.addClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute("class");
|
||||
|
||||
position = classStr.indexOf(className, 0);
|
||||
if (position < 0) {
|
||||
classStr = classStr + ' ' + className;
|
||||
this.setAttribute('class', classStr);
|
||||
}
|
||||
}
|
||||
|
||||
HTMLElement.prototype.removeClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute('class');
|
||||
|
||||
position = classStr.indexOf(className, 0);
|
||||
while (position > -1) {
|
||||
classStr1 = classStr.substring(0, position);
|
||||
classStr2 = classStr.substring(position + 10, classStr.length);
|
||||
classStr = classStr1 + classStr2;
|
||||
position = classStr.indexOf(className, 0);
|
||||
}
|
||||
|
||||
this.setAttribute('class', classStr);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.hasClassName = function(className) {
|
||||
var classStr = '' + this.getAttribute('class');
|
||||
position = classStr.indexOf(className, 0);
|
||||
return (position > -1);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getParentWithTagName = function(tagName) {
|
||||
var currentElement = this;
|
||||
tagName = tagName.toUpperCase();
|
||||
|
||||
currentElement = currentElement.parentNode;
|
||||
while (currentElement
|
||||
&& currentElement.tagName != tagName) {
|
||||
currentElement = currentElement.parentNode;
|
||||
}
|
||||
|
||||
return currentElement;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.cascadeLeftOffset = function() {
|
||||
var currentElement = this;
|
||||
|
||||
var offset = 0;
|
||||
while (currentElement) {
|
||||
offset += currentElement.offsetLeft;
|
||||
currentElement = currentElement.getParentWithTagName("div");
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.cascadeTopOffset = function() {
|
||||
var currentElement = this;
|
||||
var offset = 0;
|
||||
|
||||
var i = 0;
|
||||
|
||||
while (currentElement
|
||||
&& currentElement instanceof HTMLElement) {
|
||||
offset += currentElement.offsetTop;
|
||||
currentElement = currentElement.parentNode;
|
||||
i++;
|
||||
}
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.dump = function(additionalInfo, additionalKeys) {
|
||||
var id = this.getAttribute("id");
|
||||
var nclass = this.getAttribute("class");
|
||||
|
||||
var str = this.tagName;
|
||||
if (id)
|
||||
str += "; id = " + id;
|
||||
if (nclass)
|
||||
str += "; class = " + nclass;
|
||||
|
||||
if (additionalInfo)
|
||||
str += "; " + additionalInfo;
|
||||
|
||||
if (additionalKeys)
|
||||
for (var i = 0; i < additionalKeys.length; i++) {
|
||||
var value = this.getAttribute(additionalKeys[i]);
|
||||
if (value)
|
||||
str += "; " + additionalKeys[i] + " = " + value;
|
||||
}
|
||||
|
||||
log (str);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getSelectedNodes = function() {
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node);
|
||||
}
|
||||
|
||||
return selArray;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.getSelectedNodesId = function() {
|
||||
var selArray = new Array();
|
||||
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1
|
||||
&& isNodeSelected(node))
|
||||
selArray.push(node.getAttribute("id"));
|
||||
}
|
||||
|
||||
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;";
|
||||
|
||||
bodyOnClick = "" + document.body.getAttribute("onclick");
|
||||
document.body.setAttribute("onclick", "onBodyClick(event);");
|
||||
document.currentPopupMenu = popup;
|
||||
}
|
||||
|
||||
HTMLElement.prototype.attachMenu = function(menuName) {
|
||||
this.sogoContextMenu = $(menuName);
|
||||
Event.observe(this, "contextmenu", this.onContextMenu);
|
||||
}
|
||||
|
||||
HTMLElement.prototype.select = function() {
|
||||
this.addClassName('_selected');
|
||||
}
|
||||
|
||||
HTMLElement.prototype.deselect = function() {
|
||||
this.removeClassName('_selected');
|
||||
}
|
||||
|
||||
HTMLElement.prototype.deselectAll = function () {
|
||||
for (var i = 0; i < this.childNodes.length; i++) {
|
||||
var node = this.childNodes.item(i);
|
||||
if (node.nodeType == 1)
|
||||
node.deselect();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,15 @@ String.prototype.trim = function() {
|
||||
return this.replace(/(^\s+|\s+$)/g, '');
|
||||
}
|
||||
|
||||
String.prototype.repeat = function(count) {
|
||||
var newString = "";
|
||||
for (var i = 0; i < count; i++) {
|
||||
newString += this;
|
||||
}
|
||||
|
||||
return newString;
|
||||
}
|
||||
|
||||
String.prototype.capitalize = function() {
|
||||
return this.replace(/\w+/g,
|
||||
function(a) {
|
||||
|
||||
@@ -4,6 +4,10 @@ var currentMessages = new Array();
|
||||
var maxCachedMessages = 20;
|
||||
var cachedMessages = new Array();
|
||||
var currentMailbox = '';
|
||||
|
||||
var usersRightsWindowHeight = 320;
|
||||
var usersRightsWindowWidth = 400;
|
||||
|
||||
/* mail list */
|
||||
|
||||
function openMessageWindow(msguid, url) {
|
||||
@@ -113,6 +117,14 @@ function openAddressbook(sender) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuSharing(event) {
|
||||
var folderID = document.menuTarget.getAttribute("dataname");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
event.preventDefault();
|
||||
|
||||
openAclWindow(urlstr);
|
||||
}
|
||||
|
||||
/* mail list DOM changes */
|
||||
|
||||
function markMailInWindow(win, msguid, markread) {
|
||||
@@ -1059,13 +1071,14 @@ function initializeMenus() {
|
||||
"messageContentMenu", "label-menu",
|
||||
"mark-menu");
|
||||
menus["accountIconMenu"] = new Array(null, null, null, null, null, null,
|
||||
null, null, null, null);
|
||||
null, null, null, onMenuSharing);
|
||||
menus["inboxIconMenu"] = new Array(null, null, null, "-", null, null,
|
||||
null, "-", null, null);
|
||||
null, "-", null, onMenuSharing);
|
||||
menus["trashIconMenu"] = new Array(null, null, null, "-", null, null, null,
|
||||
null, "-", null, null);
|
||||
null, "-", null, onMenuSharing);
|
||||
menus["mailboxIconMenu"] = new Array(null, null, null, "-", null, null,
|
||||
null, null, null, "-", null, null);
|
||||
null, null, null, "-", null,
|
||||
onMenuSharing);
|
||||
menus["addressMenu"] = new Array(newContactFromEmail, newEmailTo, null);
|
||||
menus["messageListMenu"] = new Array(onMenuOpenMessage, "-",
|
||||
onMenuReplyToSender,
|
||||
|
||||
@@ -23,28 +23,36 @@ var usersRightsWindowHeight = 250;
|
||||
var usersRightsWindowWidth = 502;
|
||||
|
||||
function newEvent(sender, type) {
|
||||
var day = sender.getAttribute("day");
|
||||
if (!day)
|
||||
day = currentDay;
|
||||
var day = sender.getAttribute("day");
|
||||
if (!day)
|
||||
day = currentDay;
|
||||
|
||||
var user = UserLogin;
|
||||
if (sender.parentNode.getAttribute("id") != "toolbar"
|
||||
&& currentView == "multicolumndayview" && type == "event")
|
||||
user = sender.parentNode.parentNode.getAttribute("user");
|
||||
var user = UserLogin;
|
||||
if (sender.parentNode.getAttribute("id") != "toolbar"
|
||||
&& currentView == "multicolumndayview" && type == "event")
|
||||
user = sender.parentNode.parentNode.getAttribute("user");
|
||||
|
||||
var hour = sender.getAttribute("hour");
|
||||
var urlstr = UserFolderURL + "../" + user + "/Calendar/new" + type;
|
||||
var params = new Array();
|
||||
if (day)
|
||||
params.push("day=" + day);
|
||||
if (hour)
|
||||
params.push("hm=" + hour);
|
||||
if (params.length > 0)
|
||||
urlstr += "?" + params.join("&");
|
||||
var hour = sender.getAttribute("hour");
|
||||
var urlstr = UserFolderURL + "../" + user + "/Calendar/new" + type;
|
||||
var params = new Array();
|
||||
if (day)
|
||||
params.push("day=" + day);
|
||||
if (hour)
|
||||
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 */
|
||||
}
|
||||
|
||||
window.open(urlstr, "", "width=490,height=470,resizable=0");
|
||||
function onMenuNewEventClick(event) {
|
||||
newEvent(this, "event");
|
||||
}
|
||||
|
||||
return false; /* stop following the link */
|
||||
function onMenuNewTaskClick(event) {
|
||||
newEvent(this, "task");
|
||||
}
|
||||
|
||||
function _editEventId(id, owner) {
|
||||
@@ -549,7 +557,7 @@ function onAppointmentContextMenu(event, element) {
|
||||
var menu = $("appointmentsListMenu");
|
||||
|
||||
Event.observe(menu, "hideMenu", onAppointmentContextMenuHide);
|
||||
onMenuClick(event, "appointmentsListMenu");
|
||||
popupMenu(event, "appointmentsListMenu", element);
|
||||
|
||||
var topNode = $("appointmentsList");
|
||||
var selectedNodes = topNode.getSelectedRows();
|
||||
@@ -714,22 +722,20 @@ function popupMonthMenu(event, menuId) {
|
||||
}
|
||||
}
|
||||
|
||||
function onMonthMenuItemClick(node) {
|
||||
var month = '' + node.getAttribute("month");
|
||||
function onMonthMenuItemClick(event) {
|
||||
var month = '' + this.getAttribute("month");
|
||||
var year = '' + $("yearLabel").innerHTML;
|
||||
|
||||
changeDateSelectorDisplay(year+month+"01", true);
|
||||
|
||||
return false;
|
||||
changeDateSelectorDisplay(year + month + "01", true);
|
||||
|
||||
// event.cancelBubble();
|
||||
}
|
||||
|
||||
function onYearMenuItemClick(node) {
|
||||
function onYearMenuItemClick(event) {
|
||||
var month = '' + $("monthLabel").getAttribute("month");;
|
||||
var year = '' + node.innerHTML;
|
||||
var year = '' + this.innerHTML;
|
||||
|
||||
changeDateSelectorDisplay(year+month+"01", true);
|
||||
|
||||
return false;
|
||||
changeDateSelectorDisplay(year + month + "01", true);
|
||||
}
|
||||
|
||||
function onSearchFormSubmit() {
|
||||
@@ -977,22 +983,46 @@ function browseURL(anchor, event) {
|
||||
}
|
||||
|
||||
function initializeMenus() {
|
||||
var menus = new Array("monthListMenu", "yearListMenu",
|
||||
"appointmentsListMenu", "calendarsMenu", "searchMenu");
|
||||
menus["menuIds"] = new Array("monthListMenu", "yearListMenu",
|
||||
"appointmentsListMenu",
|
||||
"calendarsMenu",
|
||||
"searchMenu");
|
||||
var dateMenu = new Array();
|
||||
for (var i = 0; i < 12; i++)
|
||||
dateMenu.push(onMonthMenuItemClick);
|
||||
menus["monthListMenu"] = dateMenu;
|
||||
|
||||
$("calendarSelector").attachMenu("calendarsMenu");
|
||||
dateMenu = new Array();
|
||||
for (var i = 0; i < 11; i++)
|
||||
dateMenu.push(onYearMenuItemClick);
|
||||
menus["yearListMenu"] = dateMenu;
|
||||
|
||||
var accessRightsMenuEntry = $("accessRightsMenuEntry");
|
||||
Event.observe(accessRightsMenuEntry, "mouseup", onAccessRightsMenuEntryMouseUp);
|
||||
menus["appointmentsListMenu"] = new Array(onMenuNewEventClick, "-",
|
||||
onMenuNewTaskClick,
|
||||
editEvent, deleteEvent, "-",
|
||||
onSelectAll, "-",
|
||||
null, null);
|
||||
menus["calendarsMenu"] = new Array(null, null, "-", null, null, "-",
|
||||
null, "-", onMenuSharing);
|
||||
menus["searchMenu"] = new Array(setSearchCriteria);
|
||||
|
||||
initMenus();
|
||||
var selector = $("calendarSelector");
|
||||
if (selector)
|
||||
selector.attachMenu("calendarsMenu");
|
||||
}
|
||||
|
||||
function onAccessRightsMenuEntryMouseUp(event) {
|
||||
function onMenuSharing(event) {
|
||||
var folders = $("calendarList");
|
||||
var selected = folders.getSelectedNodes()[0];
|
||||
var folderID = selected.getAttribute("id");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
/* FIXME: activation of the context menu should preferable select the entry
|
||||
above which the event has occured */
|
||||
if (selected) {
|
||||
var folderID = selected.getAttribute("id");
|
||||
var urlstr = URLForFolderID(folderID) + "/acls";
|
||||
|
||||
openAclWindow(urlstr);
|
||||
openAclWindow(urlstr);
|
||||
}
|
||||
}
|
||||
|
||||
function configureDragHandles() {
|
||||
|
||||
@@ -119,15 +119,20 @@ function onOpenUserRights(event) {
|
||||
|
||||
function onAclLoadHandler() {
|
||||
defaultUserID = $("defaultUserID").value;
|
||||
Event.observe($("defaultRolesBtn"), "click", openRightsForDefaultUser);
|
||||
var defaultRolesBtn = $("defaultRolesBtn");
|
||||
if (defaultRolesBtn)
|
||||
Event.observe(defaultRolesBtn, "click", openRightsForDefaultUser);
|
||||
var ul = $("userList");
|
||||
var lis = ul.childNodesWithTag("li");
|
||||
for (var i = 0; i < lis.length; i++)
|
||||
setEventsOnUserNode(lis[i]);
|
||||
|
||||
var buttons = $("userSelectorButtons").childNodesWithTag("a");
|
||||
Event.observe(buttons[0], "click", onUserAdd);
|
||||
Event.observe(buttons[1], "click", onUserRemove);
|
||||
var buttonArea = $("userSelectorButtons");
|
||||
if (buttonArea) {
|
||||
var buttons = buttonArea.childNodesWithTag("a");
|
||||
Event.observe(buttons[0], "click", onUserAdd);
|
||||
Event.observe(buttons[1], "click", onUserRemove);
|
||||
}
|
||||
|
||||
this.userRightsHeight = window.opener.getUsersRightsWindowHeight();
|
||||
this.userRightsWidth = window.opener.getUsersRightsWindowWidth();
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
DIV.title
|
||||
{ color: #000;
|
||||
vertical-align: bottom;
|
||||
padding-top: 15px;
|
||||
padding-left: 1em;
|
||||
height: 33px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #555; }
|
||||
|
||||
DIV.title SPAN.value
|
||||
{ margin-left: 1em;
|
||||
font-size: 18px;
|
||||
font-weight: bold; }
|
||||
|
||||
DIV.calendarUserRights
|
||||
{ margin: 1em;}
|
||||
|
||||
DIV.calendarUserRights > TABLE
|
||||
{ background-color: #fff;
|
||||
width: 45em;
|
||||
color: #999;
|
||||
border-collapse: collapse;
|
||||
border-bottom: 1px solid #fff;
|
||||
border-right: 1px solid #fff;
|
||||
border-top: 2px solid #222;
|
||||
border-left: 2px solid #222;
|
||||
-moz-border-top-colors: #9c9a94 #000 transparent;
|
||||
-moz-border-left-colors: #9c9a94 #000 transparent; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TR.permissions TH
|
||||
{ color: #00f;
|
||||
/* background-color: #ddd;
|
||||
*/ border-bottom: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TH
|
||||
{ width: 15em; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD.eventType
|
||||
{ width: 5em;
|
||||
text-align: right;
|
||||
border-right: 1px solid #999; }
|
||||
|
||||
DIV.calendarUserRights > TABLE TD
|
||||
{ text-align: center;
|
||||
border-top: 1px solid #cecbff; }
|
||||
|
||||
DIV.buttons
|
||||
{ text-align: right;
|
||||
margin: 1em; }
|
||||
@@ -0,0 +1,9 @@
|
||||
function onCancelClick(event) {
|
||||
window.close();
|
||||
}
|
||||
|
||||
function initACLButtons() {
|
||||
$("cancelButton").addEventListener("click", onCancelClick, false);
|
||||
}
|
||||
|
||||
window.addEventListener("load", initACLButtons, false);
|
||||
@@ -218,8 +218,6 @@ DIV#toolbar
|
||||
white-space: nowrap;
|
||||
overflow: auto; }
|
||||
|
||||
BODY.popup { min-width: 400px; }
|
||||
|
||||
BODY.popup DIV#toolbar
|
||||
{ border-top: 0px; }
|
||||
|
||||
|
||||
@@ -573,8 +573,14 @@ function log(message) {
|
||||
logWindow = logWindow.opener;
|
||||
}
|
||||
var logConsole = logWindow.document.getElementById("logConsole");
|
||||
if (logConsole)
|
||||
logConsole.innerHTML += message.replace("<", "<", "g") + '<br />' + "\n";
|
||||
if (logConsole) {
|
||||
var logMessage = message.replace("<", "<", "g");
|
||||
logMessage = logMessage.replace("\r\n", "<br />\n", "g");
|
||||
logMessage = logMessage.replace("\n", "<br />\n", "g");
|
||||
logMessage = logMessage.replace(" ", " ", "g");
|
||||
logMessage += '<br />' + "\n";
|
||||
logConsole.innerHTML += logMessage;
|
||||
}
|
||||
}
|
||||
|
||||
function backtrace() {
|
||||
@@ -684,10 +690,9 @@ function popupSearchMenu(event) {
|
||||
function setSearchCriteria(event) {
|
||||
searchValue = $("searchValue");
|
||||
searchCriteria = $("searchCriteria");
|
||||
|
||||
var node = event.target;
|
||||
searchValue.setAttribute("ghost-phrase", node.innerHTML);
|
||||
searchCriteria = node.getAttribute('id');
|
||||
|
||||
searchValue.setAttribute("ghost-phrase", this.innerHTML);
|
||||
// searchCriteria = this.getAttribute('id');
|
||||
}
|
||||
|
||||
function checkSearchValue(event) {
|
||||
@@ -910,7 +915,8 @@ function initMenus() {
|
||||
var menuId = menus["menuIds"][i];
|
||||
var callbacks = menus[menuId];
|
||||
var menuDIV = $(menuId);
|
||||
initMenu(menuDIV, callbacks);
|
||||
if (menuDIV)
|
||||
initMenu(menuDIV, callbacks);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1077,11 +1083,11 @@ function indexColor(number) {
|
||||
|
||||
var onLoadHandler = function (event) {
|
||||
queryParameters = parseQueryParameters('' + window.location);
|
||||
if (!$(document.body).hasClassName("popup")) {
|
||||
if (!document.body.hasClassName("popup")) {
|
||||
initLogConsole();
|
||||
initializeMenus();
|
||||
initCriteria();
|
||||
}
|
||||
initializeMenus();
|
||||
initTabs();
|
||||
configureDragHandles();
|
||||
configureSortableTableHeaders();
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 54 B |
Reference in New Issue
Block a user