From 828f177c6088575dd0383967da6e93647246f9a3 Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Tue, 19 Dec 2006 20:59:17 +0000 Subject: [PATCH] Monotone-Parent: 3a8c861a24282c4e8828e312e58b52573eb971e6 Monotone-Revision: a48e56be9dc4f4c17d6374ea074196e8073e8842 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-12-19T20:59:17 Monotone-Branch: ca.inverse.sogo --- UI/Contacts/French.lproj/Localizable.strings | 2 +- UI/WebServerResources/SchedulerUI.css | 5 +- UI/WebServerResources/SchedulerUI.js | 69 ++++++++++---------- 3 files changed, 39 insertions(+), 37 deletions(-) diff --git a/UI/Contacts/French.lproj/Localizable.strings b/UI/Contacts/French.lproj/Localizable.strings index e06489747..ae004fa63 100644 --- a/UI/Contacts/French.lproj/Localizable.strings +++ b/UI/Contacts/French.lproj/Localizable.strings @@ -17,7 +17,7 @@ "Name" = "Nom"; "OfficePhone" = "Bureau"; "Organisation" = "Société"; -"Phone" = "Téléphone" +"Phone" = "Téléphone"; "Phones" = "Téléphones"; "Postal" = "Professionnelle"; "Save" = "Sauvegarder"; diff --git a/UI/WebServerResources/SchedulerUI.css b/UI/WebServerResources/SchedulerUI.css index 8947cae94..8ba18ae1c 100644 --- a/UI/WebServerResources/SchedulerUI.css +++ b/UI/WebServerResources/SchedulerUI.css @@ -61,8 +61,9 @@ UL#uixselector-calendarsList-display margin: 0px; } UL#uixselector-calendarsList-display LI.denied -{ background: #f00; - color: #000; } +{ background: #fefefe; + font-style: italic; + color: #f33; } UL#tasksList { position: absolute; diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 023f60f5d..fb21b69f8 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -923,6 +923,28 @@ function updateCalendarsList(method) if (method == "removal") updateCalendarStatus(); + + http = createHTTPClient(); + http.url = ApplicationBaseURL + "checkRights"; + http.open("GET", http.url, false /* not async */); + http.send(""); + if (http.status == 200 + && http.responseText.length > 0) { + rights = http.responseText.split(","); + var list = $("uixselector-calendarsList-display").childNodesWithTag("li"); + for (var i = 0; i < list.length; i++) { + var input = list[i].childNodesWithTag("input")[0]; + if (rights[i] == "1") { + list[i].removeClassName("denied"); + input.disabled = false; + } + else { + input.checked = false; + input.disabled = true; + list[i].addClassName("denied"); + } + } + } } } @@ -940,23 +962,27 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail) uids.value += ',' + contactId; else uids.value = contactId; - var names = $('uixselector-calendarsList-display'); + var names = $("uixselector-calendarsList-display"); names.innerHTML += ('
  • ' - + ' ' + + ' uid="' + contactId + '">' + + ' ' + ' ' + contactName + '
  • '); var listElems = names.childNodesWithTag("li"); - var input = listElems.childNodesWithTag("input")[0]; + var i = (listElems.length - 1); + var colorDef = indexColor(i); + log("colorDef: " + colorDef); + var input = listElems[i].childNodesWithTag("input")[0]; + listElems[i].addEventListener("click", onRowClick, false); + var colorBox = listElems[i].childNodesWithTag("span")[0]; + log("colorBox: " + colorBox); + colorBox.style.backgroundColor = colorDef + ";"; input.addEventListener("change", updateCalendarStatus, false); var styles = document.getElementsByTagName("style"); styles[0].innerHTML += ('.ownerIs' + contactId + ' {' + ' background-color: ' - + indexColor(listElems.length - 1) + + colorDef + ' !important; }'); } } @@ -1042,35 +1068,10 @@ function initCalendarContactsSelector() { updateCalendarStatus(); selector.changeNotification = updateCalendarsList; - var rights; - var http = createHTTPClient(); - if (http) { -// log ("url: " + url); - // TODO: add parameter to signal that we are only interested in OK - http.url = ApplicationBaseURL + "checkRights"; - http.open("GET", http.url, false /* not async */); - http.send(""); - if (http.status == 200 - && http.responseText.length > 0) - rights = http.responseText.split(","); - } - var list = $("uixselector-calendarsList-display").childNodesWithTag("li"); for (var i = 0; i < list.length; i++) { var input = list[i].childNodesWithTag("input")[0]; - if (rights) { - if (rights[i] == "1") { - input.addEventListener("change", updateCalendarStatus, false); - list[i].removeClassName("denied"); - } - else { - input.checked = false; - input.disabled = true; - list[i].addClassName("denied"); - } - } else { - input.addEventListener("change", updateCalendarStatus, false); - } + input.addEventListener("change", updateCalendarStatus, false); } }