home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / INSTBLDR.Z / asw.jar / main.js < prev    next >
Encoding:
Text File  |  1998-02-27  |  3.4 KB  |  143 lines

  1. var captureString="";
  2. var    thePath = "";
  3.  
  4. function go(msg)
  5. {
  6.     if (msg == thePath)    {
  7.         return(checkData());
  8.         }
  9.     return(false);
  10. }
  11.  
  12.  
  13.  
  14. function doGo()
  15. {
  16.     parent.controls.go("Next");
  17. }
  18.  
  19.  
  20.  
  21. function setPath(msg)
  22. {
  23.     thePath = msg;
  24.     setTimeout("doGo()",1);
  25. }
  26.  
  27.  
  28.  
  29. function checkData()
  30. {
  31.     return(true);
  32. }
  33.  
  34.  
  35.  
  36. function doAbout()
  37. {
  38.     parent.controls.go("About");
  39. }
  40.  
  41.  
  42.  
  43. function captureKeys(e)
  44. {
  45.     captureString = captureString + String.fromCharCode(e.which);
  46.     if (captureString.length>5)    captureString = captureString.substring(captureString.length-5,captureString.length);
  47.     if (captureString == "about")    {
  48.         captureString="";
  49.         setTimeout("doAbout()",1);
  50.         }
  51.     return(true);
  52. }
  53.  
  54.  
  55.  
  56. function loadData()
  57. {
  58.         var cleanFlag=false;
  59.         var configuredFlag=false;
  60.         var newProfileFlag=false;
  61.         var configFilename="";
  62.  
  63.         netscape.security.PrivilegeManager.enablePrivilege("AccountSetup");
  64.  
  65.  
  66.         var acctSetupFile = parent.parent.globals.getAcctSetupFilename(self);
  67.         var editMode = parent.parent.globals.document.vars.editMode.value;
  68.         if (editMode != null && editMode != "")    {
  69.             editMode = editMode.toLowerCase();
  70.             }
  71.  
  72.         if (editMode != "yes")    {
  73.             document.onkeydown = captureKeys;
  74.         
  75.             // get platform
  76.         
  77.             var thePlatform = new String(navigator.userAgent);
  78.             var x=thePlatform.indexOf("(")+1;
  79.             var y=thePlatform.indexOf(";",x+1);
  80.             thePlatform=thePlatform.substring(x,y);
  81.         
  82.             var profileDir = parent.parent.globals.document.setupPlugin.GetCurrentProfileDirectory();
  83.             if (profileDir != null && profileDir != "")    {
  84.                 if (thePlatform == "Macintosh")    {                // Macintosh support
  85.                     configFilename = profileDir + "Configuration";
  86.                     }
  87.                 else    {                                        // Windows support
  88.                     configFilename = profileDir + "CONFIG.INI";
  89.                     }
  90.         
  91.                 // if a MUC file exists:  re-using Account Setup against a profile that's been configured
  92.                 // else, if "account_setup.upgraded" is true, but no MUC:  upgrade from 3.x or earlier
  93.         
  94.                 var accountName = parent.parent.globals.document.setupPlugin.GetNameValuePair(configFilename,"Account", "Account");
  95.                 if (accountName != null && accountName != "" && accountName != "Untitled" && accountName != "None")    {
  96.                     configuredFlag=true;
  97.                     }
  98.                 else    {
  99.                     var profileName = parent.parent.globals.document.setupPlugin.GetCurrentProfileName();
  100.                     if (profileName != null)    {
  101.                         profileName = profileName.toUpperCase();
  102.                         if (profileName == '911' || profileName == 'USER1')    {
  103.                             cleanFlag=true;
  104.                             }
  105.                         else    {
  106.                             newProfileFlag=true;
  107.                             }
  108.                         }
  109.                     }
  110.                 }
  111.         
  112.             // ensure that some descriptive layer is shown
  113.         
  114.             if (cleanFlag==false && configuredFlag==false && newProfileFlag==false)    {
  115.                 cleanFlag=true;
  116.                 }
  117.         
  118.             if (document && document.layers)    {
  119.                 document.layers["Clean_Installation"].visibility = ((cleanFlag==true) ? "show":"hide");
  120.                 document.layers["Profile_Configured"].visibility = ((configuredFlag==true) ? "show":"hide");
  121.                 document.layers["Profile_Manager_Entrance"].visibility = ((newProfileFlag==true) ? "show":"hide");
  122.                 }
  123.         
  124.             parent.parent.globals.loadUserInput();
  125.     }
  126.     
  127.     
  128.  
  129.     if (document && document.layers)    {
  130.         document.layers["buttontext"].visibility = "show";
  131.         }
  132.  
  133.     if (parent && parent.controls && parent.controls.generateControls)    {
  134.         parent.controls.generateControls();
  135.         }
  136. }
  137.  
  138.  
  139.  
  140. function saveData()
  141. {
  142. }
  143.