home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / mozil06.zip / bin / chrome / messenger.jar / content / messenger / aw-done.js < prev    next >
Text File  |  2001-02-14  |  2KB  |  59 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  * The contents of this file are subject to the Netscape Public
  3.  * License Version 1.1 (the "License"); you may not use this file
  4.  * except in compliance with the License. You may obtain a copy of
  5.  * the License at http://www.mozilla.org/NPL/
  6.  * 
  7.  * Software distributed under the License is distributed on an "AS
  8.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  9.  * implied. See the License for the specific language governing
  10.  * rights and limitations under the License.
  11.  * 
  12.  * The Original Code is Mozilla Communicator client code, released
  13.  * March 31, 1998.
  14.  * 
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corporation. Portions created by Netscape are
  17.  * Copyright (C) 1998-1999 Netscape Communications Corporation. All
  18.  * Rights Reserved.
  19.  */
  20.  
  21. function onInit() {
  22.     var pageData = parent.wizardManager.WSM.PageData;
  23.  
  24.     var email = "";
  25.     if (pageData.identity && pageData.identity.email) {
  26.         // fixup the email
  27.         email = pageData.identity.email.value;
  28.         if (email.split('@').length < 2 && parent.gCurrentAccountData.domain)
  29.             email += "@" + parent.gCurrentAccountData.domain;
  30.     }
  31.     setDivTextFromForm("identity.email", email);
  32.  
  33.     var username="";
  34.     if (pageData.login && pageData.login.username)
  35.         username = pageData.login.username.value;
  36.     setDivTextFromForm("server.username", username);
  37. }
  38.  
  39. function setDivTextFromForm(divid, value) {
  40.  
  41.     // hide the .label if the div has no value
  42.     if (!value || value =="") {
  43.         var div = document.getElementById(divid + ".label");
  44.         div.setAttribute("hidden","true");
  45.         return;
  46.     }
  47.  
  48.     // otherwise fill in the .text element
  49.     div = document.getElementById(divid+".text");
  50.     if (!div) return;
  51.  
  52.     div.setAttribute("value", value);
  53. }
  54.  
  55. function setupAnother(event)
  56. {
  57.     window.alert("Unimplemented, see bug #19982");
  58. }
  59.