Monotone-Parent: 4237da1c46aa8fc93100964f3c0b79c40b83ea1b
Monotone-Revision: 9a36073d1afa7838c5d2980e533a408ede5d3fdb Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2008-07-03T21:26:05 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
8d7bb2a170
commit
9b758a6875
1
NEWS
1
NEWS
|
@ -4,6 +4,7 @@
|
||||||
- fixed tab index in mail composition window
|
- fixed tab index in mail composition window
|
||||||
- fixed default privacy selection for new events
|
- fixed default privacy selection for new events
|
||||||
- fixed a bug where concurrent versions of SOGo would create the user's personal folders table twice
|
- fixed a bug where concurrent versions of SOGo would create the user's personal folders table twice
|
||||||
|
- added address completion in the web mail editor
|
||||||
|
|
||||||
0.9.0-20080520 (1.0 rc6)
|
0.9.0-20080520 (1.0 rc6)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var mailIsReply = <var:string value="isMailReply"/>;
|
var mailIsReply = <var:string value="isMailReply"/>;
|
||||||
</script>
|
</script>
|
||||||
|
<div class="menu" id="contactsMenu">
|
||||||
|
<ul></ul>
|
||||||
|
</div>
|
||||||
<div class="menu" id="attachmentsMenu">
|
<div class="menu" id="attachmentsMenu">
|
||||||
<ul>
|
<ul>
|
||||||
<li><var:string label:value="Open"/></li>
|
<li><var:string label:value="Open"/></li>
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
var resultsDiv;
|
var resultsDiv;
|
||||||
var address;
|
var address;
|
||||||
var delayedSearch = false;
|
|
||||||
var currentField;
|
|
||||||
var awaitingFreeBusyRequests = new Array();
|
var awaitingFreeBusyRequests = new Array();
|
||||||
var additionalDays = 2;
|
var additionalDays = 2;
|
||||||
|
|
||||||
|
@ -10,6 +8,9 @@ var dayEndHour = 18;
|
||||||
|
|
||||||
var attendeesEditor = {
|
var attendeesEditor = {
|
||||||
delay: 500,
|
delay: 500,
|
||||||
|
delayedSearch: false,
|
||||||
|
currentField: null,
|
||||||
|
selectedIndex: -1,
|
||||||
names: null,
|
names: null,
|
||||||
UIDs: null,
|
UIDs: null,
|
||||||
emails: null,
|
emails: null,
|
||||||
|
@ -44,9 +45,9 @@ function onContactKeydown(event) {
|
||||||
this.confirmedValue = null;
|
this.confirmedValue = null;
|
||||||
this.uid = null;
|
this.uid = null;
|
||||||
this.hasfreebusy = false;
|
this.hasfreebusy = false;
|
||||||
currentField = this;
|
attendeesEditor.currentField = this;
|
||||||
if (this.value.length > 0 && !delayedSearch) {
|
if (this.value.length > 0 && !attendeesEditor.delayedSearch) {
|
||||||
delayedSearch = true;
|
attendeesEditor.delayedSearch = true;
|
||||||
setTimeout("performSearch()", attendeesEditor.delay);
|
setTimeout("performSearch()", attendeesEditor.delay);
|
||||||
}
|
}
|
||||||
else if (this.value.length == 0) {
|
else if (this.value.length == 0) {
|
||||||
|
@ -54,26 +55,50 @@ function onContactKeydown(event) {
|
||||||
hideMenu(document.currentPopupMenu);
|
hideMenu(document.currentPopupMenu);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (this.confirmedValue)
|
else if (event.keyCode == 38) { // Up arrow
|
||||||
if (event.keyCode == 13) // Enter
|
if (attendeesEditor.selectedIndex > 0) {
|
||||||
$(this).setCaretTo(this.value.length);
|
var attendees = $('attendeesMenu').select("li");
|
||||||
|
attendees[attendeesEditor.selectedIndex--].removeClassName("selected");
|
||||||
|
this.value = attendees[attendeesEditor.selectedIndex].firstChild.nodeValue.trim();
|
||||||
|
attendees[attendeesEditor.selectedIndex].addClassName("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 40) { // Down arrow
|
||||||
|
var attendees = $('attendeesMenu').select("li");
|
||||||
|
if (attendees.size() - 1 > attendeesEditor.selectedIndex) {
|
||||||
|
if (attendeesEditor.selectedIndex >= 0)
|
||||||
|
attendees[attendeesEditor.selectedIndex].removeClassName("selected");
|
||||||
|
attendeesEditor.selectedIndex++;
|
||||||
|
this.value = attendees[attendeesEditor.selectedIndex].firstChild.nodeValue.trim();
|
||||||
|
attendees[attendeesEditor.selectedIndex].addClassName("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 13) {
|
||||||
|
preventDefault(event);
|
||||||
|
if (this.confirmedValue)
|
||||||
|
this.value = this.confirmedValue;
|
||||||
|
$(this).selectText(0, this.value.length);
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
attendeesEditor.selectedIndex = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function performSearch() {
|
function performSearch() {
|
||||||
if (currentField) {
|
if (attendeesEditor.currentField) {
|
||||||
if (document.contactLookupAjaxRequest) {
|
if (document.contactLookupAjaxRequest) {
|
||||||
// Abort any pending request
|
// Abort any pending request
|
||||||
document.contactLookupAjaxRequest.aborted = true;
|
document.contactLookupAjaxRequest.aborted = true;
|
||||||
document.contactLookupAjaxRequest.abort();
|
document.contactLookupAjaxRequest.abort();
|
||||||
}
|
}
|
||||||
if (currentField.value.trim().length > 0) {
|
if (attendeesEditor.currentField.value.trim().length > 0) {
|
||||||
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
||||||
+ escape(currentField.value) );
|
+ escape(attendeesEditor.currentField.value) );
|
||||||
document.contactLookupAjaxRequest =
|
document.contactLookupAjaxRequest =
|
||||||
triggerAjaxRequest(urlstr, performSearchCallback, currentField);
|
triggerAjaxRequest(urlstr, performSearchCallback, attendeesEditor.currentField);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delayedSearch = false;
|
attendeesEditor.delayedSearch = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function performSearchCallback(http) {
|
function performSearchCallback(http) {
|
||||||
|
@ -103,8 +128,8 @@ function performSearchCallback(http) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show popup menu
|
// Show popup menu
|
||||||
var offsetScroll = Element.cumulativeScrollOffset(currentField);
|
var offsetScroll = Element.cumulativeScrollOffset(attendeesEditor.currentField);
|
||||||
var offset = Element.cumulativeOffset(currentField);
|
var offset = Element.cumulativeOffset(attendeesEditor.currentField);
|
||||||
var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3;
|
var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3;
|
||||||
var height = 'auto';
|
var height = 'auto';
|
||||||
if (data.length > 5) {
|
if (data.length > 5) {
|
||||||
|
@ -136,12 +161,8 @@ function performSearchCallback(http) {
|
||||||
// The result matches email address, not user name
|
// The result matches email address, not user name
|
||||||
input.value += ' >> ' + completeEmail;
|
input.value += ' >> ' + completeEmail;
|
||||||
input.confirmedValue = completeEmail;
|
input.confirmedValue = completeEmail;
|
||||||
if (input.focussed) {
|
var end = input.value.length;
|
||||||
var end = input.value.length;
|
$(input).selectText(start, end);
|
||||||
$(input).selectText(start, end);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
input.value = contact["name"];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,11 +174,11 @@ function performSearchCallback(http) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function onAttendeeResultClick(event) {
|
function onAttendeeResultClick(event) {
|
||||||
if (currentField) {
|
if (attendeesEditor.currentField) {
|
||||||
currentField.uid = this.uid;
|
attendeesEditor.currentField.uid = this.uid;
|
||||||
currentField.value = this.firstChild.nodeValue.trim();
|
attendeesEditor.currentField.value = this.firstChild.nodeValue.trim();
|
||||||
currentField.confirmedValue = currentField.value;
|
attendeesEditor.currentField.confirmedValue = attendeesEditor.currentField.value;
|
||||||
currentField.blur(); // triggers checkAttendee function call
|
attendeesEditor.currentField.blur(); // triggers checkAttendee function call
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,7 +323,7 @@ function checkAttendee() {
|
||||||
this.setAttribute("modified", "0");
|
this.setAttribute("modified", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
currentField = null;
|
attendeesEditor.currentField = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function displayFreeBusyForNode(input) {
|
function displayFreeBusyForNode(input) {
|
||||||
|
@ -662,7 +683,7 @@ function onFreeBusyLoadHandler() {
|
||||||
synchronizeWithParent("startTime", "startTime");
|
synchronizeWithParent("startTime", "startTime");
|
||||||
synchronizeWithParent("endTime", "endTime");
|
synchronizeWithParent("endTime", "endTime");
|
||||||
|
|
||||||
initTimeWidgets(widgets);
|
initTimeWidgets(widgets);
|
||||||
initializeWindowButtons();
|
initializeWindowButtons();
|
||||||
prepareTableHeaders();
|
prepareTableHeaders();
|
||||||
prepareTableRows();
|
prepareTableRows();
|
||||||
|
|
|
@ -3,7 +3,11 @@ var signatureLength = 0;
|
||||||
|
|
||||||
var attachmentCount = 0;
|
var attachmentCount = 0;
|
||||||
var MailEditor = {
|
var MailEditor = {
|
||||||
addressBook: null
|
addressBook: null,
|
||||||
|
currentField: null,
|
||||||
|
selectedIndex: -1,
|
||||||
|
delay: 500,
|
||||||
|
delayedSearch: false
|
||||||
};
|
};
|
||||||
|
|
||||||
function onContactAdd() {
|
function onContactAdd() {
|
||||||
|
@ -285,12 +289,169 @@ function onTextMouseDown(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onContactKeydown(event) {
|
||||||
|
if (event.ctrlKey || event.metaKey) {
|
||||||
|
this.focussed = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (event.keyCode == 9) { // Tab
|
||||||
|
if (this.confirmedValue)
|
||||||
|
this.value = this.confirmedValue;
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 0
|
||||||
|
|| event.keyCode == 8 // Backspace
|
||||||
|
|| event.keyCode == 32 // Space
|
||||||
|
|| event.keyCode > 47) {
|
||||||
|
this.confirmedValue = null;
|
||||||
|
MailEditor.selectedIndex = -1;
|
||||||
|
MailEditor.currentField = this;
|
||||||
|
if (this.value.length > 0 && !MailEditor.delayedSearch) {
|
||||||
|
MailEditor.delayedSearch = true;
|
||||||
|
setTimeout("performSearch()", MailEditor.delay);
|
||||||
|
}
|
||||||
|
else if (this.value.length == 0) {
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 38) { // Up arrow
|
||||||
|
if (MailEditor.selectedIndex > 0) {
|
||||||
|
var contacts = $('contactsMenu').select("li");
|
||||||
|
contacts[MailEditor.selectedIndex--].removeClassName("selected");
|
||||||
|
this.value = contacts[MailEditor.selectedIndex].firstChild.nodeValue.trim();
|
||||||
|
contacts[MailEditor.selectedIndex].addClassName("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 40) { // Down arrow
|
||||||
|
var contacts = $('contactsMenu').select("li");
|
||||||
|
if (contacts.size() - 1 > MailEditor.selectedIndex) {
|
||||||
|
if (MailEditor.selectedIndex >= 0)
|
||||||
|
contacts[MailEditor.selectedIndex].removeClassName("selected");
|
||||||
|
MailEditor.selectedIndex++;
|
||||||
|
this.value = contacts[MailEditor.selectedIndex].firstChild.nodeValue.trim();
|
||||||
|
contacts[MailEditor.selectedIndex].addClassName("selected");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.keyCode == 13) {
|
||||||
|
preventDefault(event);
|
||||||
|
if (this.confirmedValue)
|
||||||
|
this.value = this.confirmedValue;
|
||||||
|
$(this).selectText(0, this.value.length);
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
MailEditor.selectedIndex = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function performSearch() {
|
||||||
|
// Perform address completion
|
||||||
|
if (MailEditor.currentField) {
|
||||||
|
if (document.contactLookupAjaxRequest) {
|
||||||
|
// Abort any pending request
|
||||||
|
document.contactLookupAjaxRequest.aborted = true;
|
||||||
|
document.contactLookupAjaxRequest.abort();
|
||||||
|
}
|
||||||
|
if (MailEditor.currentField.value.trim().length > 0) {
|
||||||
|
var urlstr = ( UserFolderURL + "Contacts/contactSearch?search="
|
||||||
|
+ escape(MailEditor.currentField.value) );
|
||||||
|
document.contactLookupAjaxRequest =
|
||||||
|
triggerAjaxRequest(urlstr, performSearchCallback, MailEditor.currentField);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MailEditor.delayedSearch = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function performSearchCallback(http) {
|
||||||
|
if (http.readyState == 4) {
|
||||||
|
var menu = $('contactsMenu');
|
||||||
|
var list = menu.down("ul");
|
||||||
|
|
||||||
|
var input = http.callbackData;
|
||||||
|
|
||||||
|
if (http.status == 200) {
|
||||||
|
var start = input.value.length; log(http.responseText);
|
||||||
|
var data = http.responseText.evalJSON(true);
|
||||||
|
if (data.length > 1) {
|
||||||
|
$(list.childNodesWithTag("li")).each(function(item) {
|
||||||
|
item.remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Populate popup menu
|
||||||
|
for (var i = 0; i < data.length; i++) {
|
||||||
|
var contact = data[i];
|
||||||
|
var completeEmail = contact["name"] + " <" + contact["email"] + ">";
|
||||||
|
var node = document.createElement("li");
|
||||||
|
list.appendChild(node);
|
||||||
|
node.uid = contact["uid"];
|
||||||
|
node.appendChild(document.createTextNode(completeEmail));
|
||||||
|
$(node).observe("mousedown", onAddressResultClick);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Show popup menu
|
||||||
|
var offsetScroll = Element.cumulativeScrollOffset(MailEditor.currentField);
|
||||||
|
var offset = Element.cumulativeOffset(MailEditor.currentField);
|
||||||
|
var top = offset[1] - offsetScroll[1] + node.offsetHeight + 3;
|
||||||
|
var height = 'auto';
|
||||||
|
if (data.length > 5) {
|
||||||
|
height = 5 * node.getHeight() + 'px';
|
||||||
|
}
|
||||||
|
menu.setStyle({ top: top + "px",
|
||||||
|
left: offset[0] + "px",
|
||||||
|
height: height,
|
||||||
|
visibility: "visible" });
|
||||||
|
menu.scrollTop = 0;
|
||||||
|
|
||||||
|
document.currentPopupMenu = menu;
|
||||||
|
$(document.body).observe("click", onBodyClickMenuHandler);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
|
||||||
|
if (data.length == 1) {
|
||||||
|
// Single result
|
||||||
|
var contact = data[0];
|
||||||
|
if (contact["uid"].length > 0)
|
||||||
|
input.uid = contact["uid"];
|
||||||
|
var completeEmail = contact["name"] + " <" + contact["email"] + ">";
|
||||||
|
if (contact["name"].substring(0, input.value.length).toUpperCase()
|
||||||
|
== input.value.toUpperCase())
|
||||||
|
input.value = completeEmail;
|
||||||
|
else
|
||||||
|
// The result matches email address, not user name
|
||||||
|
input.value += ' >> ' + completeEmail;
|
||||||
|
input.confirmedValue = completeEmail;
|
||||||
|
var end = input.value.length;
|
||||||
|
$(input).selectText(start, end);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
if (document.currentPopupMenu)
|
||||||
|
hideMenu(document.currentPopupMenu);
|
||||||
|
document.contactLookupAjaxRequest = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function onAddressResultClick(event) {
|
||||||
|
if (MailEditor.currentField) {
|
||||||
|
MailEditor.currentField.uid = this.uid;
|
||||||
|
MailEditor.currentField.value = this.firstChild.nodeValue.trim();
|
||||||
|
MailEditor.currentField.confirmedValue = currentField.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initTabIndex(addressList, subjectField, msgArea) {
|
function initTabIndex(addressList, subjectField, msgArea) {
|
||||||
|
|
||||||
var i = 1;
|
var i = 1;
|
||||||
addressList.select("input.textField").each(function (input) {
|
addressList.select("input.textField").each(function (input) {
|
||||||
if (!input.readAttribute("readonly"))
|
if (!input.readAttribute("readonly")) {
|
||||||
input.writeAttribute("tabindex", i++);
|
input.writeAttribute("tabindex", i++);
|
||||||
|
input.writeAttribute("autocomplete", "off");
|
||||||
|
input.observe("keydown", onContactKeydown); // bind listener for address completion
|
||||||
|
}
|
||||||
});
|
});
|
||||||
subjectField.writeAttribute("tabindex", i++);
|
subjectField.writeAttribute("tabindex", i++);
|
||||||
msgArea.writeAttribute("tabindex", i);
|
msgArea.writeAttribute("tabindex", i);
|
||||||
|
|
|
@ -81,10 +81,10 @@ function fancyAddRow(shouldEdit, text, type) {
|
||||||
addressList.insertBefore(row, lastChild);
|
addressList.insertBefore(row, lastChild);
|
||||||
|
|
||||||
if (shouldEdit) {
|
if (shouldEdit) {
|
||||||
input.setAttribute('autocomplete', 'off');
|
input.setAttribute("autocomplete", "off");
|
||||||
|
input.observe("keydown", onContactKeydown); // bind listener for address completion
|
||||||
input.focus();
|
input.focus();
|
||||||
input.select();
|
input.select();
|
||||||
input.setAttribute('autocomplete', 'on');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -354,7 +354,7 @@ UL.choiceMenu LI._chosen
|
||||||
UL.choiceMenu LI._chosen:hover
|
UL.choiceMenu LI._chosen:hover
|
||||||
{ list-style-image: url("menu-check-hover.gif"); }
|
{ list-style-image: url("menu-check-hover.gif"); }
|
||||||
|
|
||||||
.menu LI:hover, .menu LI.submenu-selected
|
.menu LI:hover, .menu LI.selected, .menu LI.submenu-selected
|
||||||
{ background-color: #4b6983;
|
{ background-color: #4b6983;
|
||||||
color: #fff; }
|
color: #fff; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue