mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-25 08:02:44 +00:00
Monotone-Parent: 30024333fa104bcd0ddc578e486dad24227bbd3c
Monotone-Revision: 14ff365d11c0291a1eee9188cca51f506f40b9bc Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-09-26T18:44:42 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
2006-09-26 Wolfgang Sourdeau <wsourdeau@inverse.ca>
|
||||
|
||||
* UI/WebServerResources/UIxContactEditor.js: imitate the
|
||||
Thunderbird address book by completing the display name with the
|
||||
content of the first and last name fields, until the display name
|
||||
is modified manually.
|
||||
|
||||
* UI/WebServerResources/generic.js: added a "trim" method to the
|
||||
String class.
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
02111-1307, USA.
|
||||
*/
|
||||
|
||||
var displayNameChanged = false;
|
||||
|
||||
function unescapeCallbackParameter(s) {
|
||||
if(!s || s.length == 0)
|
||||
@@ -100,3 +101,42 @@ function submitContact(thisForm) {
|
||||
window.close();
|
||||
}
|
||||
}
|
||||
|
||||
function showCoords(node) {
|
||||
node = $("givenName");
|
||||
window.alert("x: " + node.cascadeLeftOffset()
|
||||
+ ";y: " + node.cascadeTopOffset()
|
||||
+ ";width: " + window.innerWidth
|
||||
+ ";height: " + window.innerHeight);
|
||||
}
|
||||
|
||||
function onFnKeyDown() {
|
||||
var fn = $("fn");
|
||||
fn.onkeydown = null;
|
||||
displayNameChanged = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function onFnNewValue(event) {
|
||||
if (!displayNameChanged) {
|
||||
var sn = $("sn").value.trim();
|
||||
var givenName = $("givenName").value.trim();
|
||||
|
||||
var fullName = givenName;
|
||||
if (fullName && sn)
|
||||
fullName += ' ';
|
||||
fullName += sn;
|
||||
|
||||
$("fn").value = fullName;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function initEditorForm() {
|
||||
displayNameChanged = ($("fn").value.length > 0);
|
||||
$("fn").onkeydown = onFnKeyDown;
|
||||
$("sn").onkeyup = onFnNewValue;
|
||||
$("givenName").onkeyup = onFnNewValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user