home *** CD-ROM | disk | FTP | other *** search
/ Clickx 65 / Clickx 65.iso / software / internet / xmarks / xmarks-3.1.1.xpi / chrome / content / foxmarks-resetpin.js < prev    next >
Encoding:
JavaScript  |  2009-05-05  |  880 b   |  34 lines

  1. /* 
  2.  Copyright 2008 Foxmarks Inc.
  3.  
  4.  foxmarks-resetpin.js: handles the UI for the ResetPIN dialog. 
  5.   
  6.  */
  7.  
  8. function onResetPINOK()
  9. {
  10.     var pin = document.getElementById("newpin").value;
  11.     var pin2 = document.getElementById("newpin2").value;
  12.  
  13.     if(!pin || pin.length < 4 || pin.length > 255){
  14.         FoxmarksAlert(Bundle().GetStringFromName("error.pinWrongSize"));
  15.         return false;
  16.     }
  17.  
  18.     if(!pin2 || pin != pin2){
  19.         FoxmarksAlert(Bundle().GetStringFromName("error.pinNoMatch"));
  20.         return false;
  21.     }
  22.     if(pin == gSettings.password){
  23.         FoxmarksAlert(Bundle().GetStringFromName("error.pinEqualsPassword"));
  24.         return false;
  25.     }
  26.  
  27.     gSettings.pin = pin;
  28.     gSettings.rememberPin = document.getElementById("rememberPin").checked;
  29.     gSettings.setMustUpload("passwords", true);
  30.     window.arguments[0].doSync = true;
  31.     return true;
  32. }
  33.  
  34.