home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / toolkit.jar / content / mozapps / autofill / EditPasscardDialog.js < prev    next >
Text File  |  2005-07-29  |  1KB  |  35 lines

  1. var passcardObj;    // reference to first window argument
  2.  
  3. /**
  4.  * Init dialog
  5.  **/
  6. function StartupEditDlg()
  7. {
  8.     passcardObj = window.arguments[0];
  9.     if (passcardObj == null || passcardObj.passcard == null)
  10.         return;
  11.  
  12.     document.getElementById("edit-passcard-name").value = passcardObj.passcard.passcard;
  13.     document.getElementById("edit-passcard-userID").value = passcardObj.passcard.user;
  14.     document.getElementById("edit-passcard-password").value = passcardObj.passcard.password;
  15.     document.getElementById("edit-passcard-autologin").checked = parseInt(passcardObj.passcard.autologin) == 0 ? false : true;
  16.     document.getElementById("edit-passcard-protect").checked = parseInt(passcardObj.passcard.protect) == 0 ? false : true;
  17. }
  18.  
  19. /**
  20.  * Handle OK button
  21.  **/
  22. function onEditOK()
  23. {
  24.     if (passcardObj != null && passcardObj.passcard != null)
  25.     {
  26.         passcardObj.passcard.passcard = document.getElementById("edit-passcard-name").value;
  27.         passcardObj.passcard.user = document.getElementById("edit-passcard-userID").value;
  28.         passcardObj.passcard.password = document.getElementById("edit-passcard-password").value;
  29.         passcardObj.passcard.autologin = document.getElementById("edit-passcard-autologin").checked ? 1 : 0;
  30.         passcardObj.passcard.protect = document.getElementById("edit-passcard-protect").checked ? 1 : 0;
  31.         passcardObj.result = "OK";
  32.     }    
  33.     window.close();
  34. }
  35.