use nsIUserInfo (if it exists, it doesn't on mac and windows yet) to pre-populate the users email address and full name.

This commit is contained in:
sspitzer%netscape.com 2000-03-12 08:20:13 +00:00
Родитель fc97b0207e
Коммит 8719055576
1 изменённых файлов: 28 добавлений и 1 удалений

Просмотреть файл

@ -86,7 +86,8 @@ function validateEmail() {
function onInit()
{
checkForDomain();
checkForFullName();
checkForEmail();
}
// retrieve the current domain from the parent wizard window,
@ -110,3 +111,29 @@ function checkForDomain()
}
}
function checkForFullName() {
var name = document.getElementById("fullName");
if (name.value=="") {
try {
var userInfo = Components.classes["component://netscape/userinfo"].getService(Components.interfaces.nsIUserInfo);
name.value = userInfo.fullname;
}
catch (ex) {
// dump ("checkForFullName failed: " + ex + "\n");
}
}
}
function checkForEmail() {
var email = document.getElementById("email");
if (email.value=="") {
try {
var userInfo = Components.classes["component://netscape/userinfo"].getService(Components.interfaces.nsIUserInfo);
email.value = userInfo.emailAddress;
}
catch (ex) {
// dump ("checkForEmail failed: " + ex + "\n");
}
}
}