Monotone-Parent: e9f80c69ee8be6db993d9c5dbe117db754ae55a1

Monotone-Revision: f308101c72372244428eb66d3f81a23140676912

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-10-11T20:54:43
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-10-11 20:54:43 +00:00
parent cbf3c15677
commit 25ab64ec7d
2 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,11 @@
2010-10-11 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* UI/WebServerResources/SOGoAutoCompletion.js:
(SOGoAutoCompletionInterface.performSearchCallback): when the
match string is not found in "completeEmail" (due to a match with a
non-displayed attribute), don't put emphasize anything
graphically.
* UI/WebServerResources/ContactsUI.js:
(onToolbarWriteToSelectedContacts): display an error message when
no contact is selected rather than composing a new message. Fixed

View File

@@ -175,17 +175,22 @@ var SOGoAutoCompletionInterface = {
var node = new Element('li', { 'address': completeEmail,
'uid': contact[this.uidField] });
var matchPosition = completeEmail.toLowerCase().indexOf(data.searchText.toLowerCase());
var matchBefore = completeEmail.substring(0, matchPosition);
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
if (matchPosition > -1) {
var matchBefore = completeEmail.substring(0, matchPosition);
var matchText = completeEmail.substring(matchPosition, matchPosition + data.searchText.length);
var matchAfter = completeEmail.substring(matchPosition + data.searchText.length);
node.appendChild(document.createTextNode(matchBefore));
node.appendChild(new Element('strong').update(matchText));
node.appendChild(document.createTextNode(matchAfter));
}
else {
node.appendChild(document.createTextNode(completeEmail));
}
list.appendChild(node);
if (contact['c_name'].endsWith (".vlf")) {
// Keep track of list containers
node.writeAttribute("container", contact['container']);
}
node.appendChild(document.createTextNode(matchBefore));
node.appendChild(new Element('strong').update(matchText));
node.appendChild(document.createTextNode(matchAfter));
if (contact["contactInfo"])
node.appendChild(document.createTextNode(" (" + contact["contactInfo"] + ")"));
$(node).observe("mousedown", this.onAddressResultClick.bindAsEventListener(this));