mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-06 15:46:23 +00:00
Monotone-Parent: df2b66af0afb7884e01b50efd6f7e99acf0743fa
Monotone-Revision: 1804bb2fc333899fed4fa062ac489b8006f6b8a4 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2007-11-19T21:07:54 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,160 +1,170 @@
|
||||
function onPopupAttendeesWindow(event) {
|
||||
if (event)
|
||||
preventDefault(event);
|
||||
window.open(ApplicationBaseURL + "/editAttendees", null,
|
||||
"width=803,height=573");
|
||||
if (event)
|
||||
preventDefault(event);
|
||||
window.open(ApplicationBaseURL + "/editAttendees", null,
|
||||
"width=803,height=573");
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function onSelectPrivacy(event) {
|
||||
if (event.button == 0 || (isSafari() && event.button == 1)) {
|
||||
var node = getTarget(event);
|
||||
if (node.tagName != 'BUTTON')
|
||||
node = $(node).up("button");
|
||||
popupToolbarMenu(node, "privacy-menu");
|
||||
Event.stop(event);
|
||||
// preventDefault(event);
|
||||
}
|
||||
if (event.button == 0 || (isSafari() && event.button == 1)) {
|
||||
var node = getTarget(event);
|
||||
if (node.tagName != 'BUTTON')
|
||||
node = $(node).up("button");
|
||||
popupToolbarMenu(node, "privacy-menu");
|
||||
Event.stop(event);
|
||||
// preventDefault(event);
|
||||
}
|
||||
}
|
||||
|
||||
function onPopupUrlWindow(event) {
|
||||
if (event)
|
||||
preventDefault(event);
|
||||
if (event)
|
||||
preventDefault(event);
|
||||
|
||||
var urlInput = document.getElementById("url");
|
||||
var newUrl = window.prompt(labels["Target:"], urlInput.value);
|
||||
if (newUrl != null) {
|
||||
var documentHref = $("documentHref");
|
||||
var documentLabel = $("documentLabel");
|
||||
if (documentHref.childNodes.length > 0) {
|
||||
documentHref.childNodes[0].nodeValue = newUrl;
|
||||
if (newUrl.length > 0)
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
else
|
||||
documentLabel.setStyle({ display: "none" });
|
||||
}
|
||||
else {
|
||||
documentHref.appendChild(document.createTextNode(newUrl));
|
||||
if (newUrl.length > 0)
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
}
|
||||
urlInput.value = newUrl;
|
||||
}
|
||||
var urlInput = document.getElementById("url");
|
||||
var newUrl = window.prompt(labels["Target:"], urlInput.value);
|
||||
if (newUrl != null) {
|
||||
var documentHref = $("documentHref");
|
||||
var documentLabel = $("documentLabel");
|
||||
if (documentHref.childNodes.length > 0) {
|
||||
documentHref.childNodes[0].nodeValue = newUrl;
|
||||
if (newUrl.length > 0)
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
else
|
||||
documentLabel.setStyle({ display: "none" });
|
||||
}
|
||||
else {
|
||||
documentHref.appendChild(document.createTextNode(newUrl));
|
||||
if (newUrl.length > 0)
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
}
|
||||
urlInput.value = newUrl;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function onPopupDocumentWindow(event) {
|
||||
var documentUrl = $("url");
|
||||
var documentUrl = $("url");
|
||||
|
||||
preventDefault(event);
|
||||
window.open(documentUrl.value, "SOGo_Document");
|
||||
preventDefault(event);
|
||||
window.open(documentUrl.value, "SOGo_Document");
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function onMenuSetClassification(event) {
|
||||
event.cancelBubble = true;
|
||||
event.cancelBubble = true;
|
||||
|
||||
var classification = this.getAttribute("classification");
|
||||
if (this.parentNode.chosenNode)
|
||||
this.parentNode.chosenNode.removeClassName("_chosen");
|
||||
this.addClassName("_chosen");
|
||||
this.parentNode.chosenNode = this;
|
||||
var classification = this.getAttribute("classification");
|
||||
if (this.parentNode.chosenNode)
|
||||
this.parentNode.chosenNode.removeClassName("_chosen");
|
||||
this.addClassName("_chosen");
|
||||
this.parentNode.chosenNode = this;
|
||||
|
||||
// log("classification: " + classification);
|
||||
var privacyInput = document.getElementById("privacy");
|
||||
privacyInput.value = classification;
|
||||
// log("classification: " + classification);
|
||||
var privacyInput = document.getElementById("privacy");
|
||||
privacyInput.value = classification;
|
||||
}
|
||||
|
||||
function onChangeCalendar(event) {
|
||||
var calendars = $("calendarFoldersList").value.split(",");
|
||||
var form = document.forms["editform"];
|
||||
var urlElems = form.getAttribute("action").split("/");
|
||||
var choice = calendars[this.value];
|
||||
urlElems[urlElems.length-3] = choice;
|
||||
form.setAttribute("action", urlElems.join("/"));
|
||||
var calendars = $("calendarFoldersList").value.split(",");
|
||||
var form = document.forms["editform"];
|
||||
var urlElems = form.getAttribute("action").split("/");
|
||||
var choice = calendars[this.value];
|
||||
urlElems[urlElems.length-3] = choice;
|
||||
form.setAttribute("action", urlElems.join("/"));
|
||||
}
|
||||
|
||||
function refreshAttendees() {
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesNames = $("attendeesNames");
|
||||
var attendeesHref = $("attendeesHref");
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesNames = $("attendeesNames");
|
||||
var attendeesHref = $("attendeesHref");
|
||||
var organizerListLabel = $("organizerListLabel");
|
||||
|
||||
for (var i = 0; i < attendeesHref.childNodes.length; i++)
|
||||
attendeesHref.removeChild(attendeesHref.childNodes[i]);
|
||||
log ("label: "+ organizerListLabel);
|
||||
for (var i = 0; i < attendeesHref.childNodes.length; i++)
|
||||
attendeesHref.removeChild(attendeesHref.childNodes[i]);
|
||||
|
||||
if (attendeesNames.value.length > 0) {
|
||||
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
|
||||
attendeesLabel.setStyle({ display: "block" });
|
||||
}
|
||||
else
|
||||
attendeesLabel.setStyle({ display: "none" });
|
||||
if (attendeesNames.value.length > 0) {
|
||||
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
|
||||
attendeesLabel.setStyle({ display: "block" });
|
||||
if (organizerListLabel)
|
||||
organizerListLabel.setStyle({ display: "block" });
|
||||
}
|
||||
else {
|
||||
attendeesLabel.setStyle({ display: "none" });
|
||||
if (organizerListLabel)
|
||||
organizerListLabel.setStyle({ display: "none" });
|
||||
}
|
||||
}
|
||||
|
||||
function initializeAttendeesHref() {
|
||||
var attendeesHref = $("attendeesHref");
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesNames = $("attendeesNames");
|
||||
var attendeesHref = $("attendeesHref");
|
||||
var attendeesLabel = $("attendeesLabel");
|
||||
var attendeesNames = $("attendeesNames");
|
||||
var organizerListLabel = $("organizerListLabel");
|
||||
|
||||
Event.observe(attendeesHref, "click", onPopupAttendeesWindow, false);
|
||||
if (attendeesNames.value.length > 0) {
|
||||
attendeesHref.setStyle({ textDecoration: "underline", color: "#00f" });
|
||||
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
|
||||
attendeesLabel.setStyle({ display: "block" });
|
||||
}
|
||||
Event.observe(attendeesHref, "click", onPopupAttendeesWindow, false);
|
||||
if (attendeesNames.value.length > 0) {
|
||||
if (organizerListLabel)
|
||||
organizerListLabel.setStyle({ display: "block" });
|
||||
attendeesHref.setStyle({ textDecoration: "underline", color: "#00f" });
|
||||
attendeesHref.appendChild(document.createTextNode(attendeesNames.value));
|
||||
attendeesLabel.setStyle({ display: "block" });
|
||||
}
|
||||
}
|
||||
|
||||
function initializeDocumentHref() {
|
||||
var documentHref = $("documentHref");
|
||||
var documentLabel = $("documentLabel");
|
||||
var documentUrl = $("url");
|
||||
var documentHref = $("documentHref");
|
||||
var documentLabel = $("documentLabel");
|
||||
var documentUrl = $("url");
|
||||
|
||||
Event.observe(documentHref, "click", onPopupDocumentWindow, false);
|
||||
documentHref.setStyle({ textDecoration: "underline", color: "#00f" });
|
||||
if (documentUrl.value.length > 0) {
|
||||
documentHref.appendChild(document.createTextNode(documentUrl.value));
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
}
|
||||
Event.observe(documentHref, "click", onPopupDocumentWindow, false);
|
||||
documentHref.setStyle({ textDecoration: "underline", color: "#00f" });
|
||||
if (documentUrl.value.length > 0) {
|
||||
documentHref.appendChild(document.createTextNode(documentUrl.value));
|
||||
documentLabel.setStyle({ display: "block" });
|
||||
}
|
||||
|
||||
var changeUrlButton = $("changeUrlButton");
|
||||
Event.observe(changeUrlButton, "click", onPopupUrlWindow, false);
|
||||
var changeUrlButton = $("changeUrlButton");
|
||||
Event.observe(changeUrlButton, "click", onPopupUrlWindow, false);
|
||||
}
|
||||
|
||||
function initializePrivacyMenu() {
|
||||
var privacy = $("privacy").value.toUpperCase();
|
||||
if (privacy.length > 0) {
|
||||
var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
|
||||
var menuEntries = $(privacyMenu).childNodesWithTag("li");
|
||||
var chosenNode;
|
||||
if (privacy == "CONFIDENTIAL")
|
||||
chosenNode = menuEntries[1];
|
||||
else if (privacy == "PRIVATE")
|
||||
chosenNode = menuEntries[2];
|
||||
else
|
||||
chosenNode = menuEntries[0];
|
||||
privacyMenu.chosenNode = chosenNode;
|
||||
$(chosenNode).addClassName("_chosen");
|
||||
}
|
||||
var privacy = $("privacy").value.toUpperCase();
|
||||
if (privacy.length > 0) {
|
||||
var privacyMenu = $("privacy-menu").childNodesWithTag("ul")[0];
|
||||
var menuEntries = $(privacyMenu).childNodesWithTag("li");
|
||||
var chosenNode;
|
||||
if (privacy == "CONFIDENTIAL")
|
||||
chosenNode = menuEntries[1];
|
||||
else if (privacy == "PRIVATE")
|
||||
chosenNode = menuEntries[2];
|
||||
else
|
||||
chosenNode = menuEntries[0];
|
||||
privacyMenu.chosenNode = chosenNode;
|
||||
$(chosenNode).addClassName("_chosen");
|
||||
}
|
||||
}
|
||||
|
||||
function onComponentEditorLoad(event) {
|
||||
if (!$("statusPercent"))
|
||||
initializeAttendeesHref();
|
||||
initializeDocumentHref();
|
||||
initializePrivacyMenu();
|
||||
var list = $("calendarList");
|
||||
Event.observe(list, "mousedown",
|
||||
onChangeCalendar.bindAsEventListener(list),
|
||||
false);
|
||||
list.fire("mousedown");
|
||||
if (!$("statusPercent"))
|
||||
initializeAttendeesHref();
|
||||
initializeDocumentHref();
|
||||
initializePrivacyMenu();
|
||||
var list = $("calendarList");
|
||||
Event.observe(list, "mousedown",
|
||||
onChangeCalendar.bindAsEventListener(list),
|
||||
false);
|
||||
list.fire("mousedown");
|
||||
|
||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
Event.observe(menuItems[i], "mousedown",
|
||||
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
||||
false);
|
||||
var menuItems = $("itemPrivacyList").childNodesWithTag("li");
|
||||
for (var i = 0; i < menuItems.length; i++)
|
||||
Event.observe(menuItems[i], "mousedown",
|
||||
onMenuSetClassification.bindAsEventListener(menuItems[i]),
|
||||
false);
|
||||
}
|
||||
|
||||
FastInit.addOnLoad(onComponentEditorLoad);
|
||||
|
||||
Reference in New Issue
Block a user