home *** CD-ROM | disk | FTP | other *** search
/ Your Business Pak / BusinessPak2.iso / Netscape / CD / as.z / asw.jar / main.js < prev    next >
Text File  |  1998-10-15  |  4KB  |  153 lines

  1. /* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. var captureString="";
  19. var    thePath = "";
  20.  
  21. function go( msg )
  22. {
  23.     if ( msg == thePath )
  24.         return checkData();
  25.     return false;
  26. }
  27.  
  28.  
  29.  
  30. function doGo()
  31. {
  32.     parent.controls.go( "Next" );
  33. }
  34.  
  35.  
  36.  
  37. function setPath( msg )
  38. {
  39.     thePath = msg;
  40.     setTimeout( "doGo()", 1 );
  41. }
  42.  
  43.  
  44.  
  45. function checkData()
  46. {
  47.     return true;
  48. }
  49.  
  50. function doAbout()
  51. {
  52.     parent.controls.go( "About" );
  53. }
  54.  
  55. function captureKeys( e )
  56. {
  57.     captureString = captureString + String.fromCharCode( e.which );
  58.     if ( captureString.length > 5 )
  59.         captureString = captureString.substring( captureString.length - 5,captureString.length );
  60.     if ( captureString == "about" )
  61.     {
  62.         captureString="";
  63.         setTimeout( "doAbout()", 1 );
  64.     }
  65.     return true;
  66. }
  67.  
  68. function loadData()
  69. {
  70.     var cleanFlag = false;
  71.     var configuredFlag = false;
  72.     var newProfileFlag = false;
  73.     var configFilename = "";
  74.  
  75.     netscape.security.PrivilegeManager.enablePrivilege( "AccountSetup" );
  76.  
  77.     var acctSetupFile = parent.parent.globals.getAcctSetupFilename( self );
  78.     var editMode = parent.parent.globals.document.vars.editMode.value;
  79.     if ( editMode != null && editMode != "" )
  80.         editMode = editMode.toLowerCase();
  81.  
  82.     if ( editMode != "yes" )
  83.     {
  84.         document.onkeydown = captureKeys;
  85.     
  86.         // get platform
  87.     
  88.         var thePlatform = parent.parent.globals.getPlatform();
  89.     
  90.         //var profileDir = parent.parent.globals.document.setupPlugin.GetCurrentProfileDirectory();
  91.         var profileDir = parent.parent.globals.currentProfileDirectory;
  92.         parent.parent.globals.debug("****Priofile Dir = " + profileDir);
  93.         if ( profileDir != null && profileDir != "" )
  94.         {
  95.             if ( thePlatform == "Macintosh" )                // Macintosh support
  96.                 configFilename = profileDir + "Configuration";
  97.             else                                        // Windows support
  98.                 configFilename = profileDir + "CONFIG.INI";
  99.     
  100.             // if a MUC file exists:  re-using Account Setup against a profile that's been configured
  101.             // else, if "account_setup.upgraded" is true, but no MUC:  upgrade from 3.x or earlier
  102.     
  103.             var accountName = parent.parent.globals.document.setupPlugin.GetNameValuePair( configFilename, "Account", "Account" );
  104.             if ( accountName != null && accountName != "" && accountName != "Untitled" && accountName != "None" )
  105.                 configuredFlag = true;
  106.             else
  107.             {
  108.                 var profileName = parent.parent.globals.document.setupPlugin.GetCurrentProfileName();
  109.                 if ( profileName != null )
  110.                 {
  111.                     profileName = profileName.toUpperCase();
  112.                     if ( profileName == '911' || profileName == 'USER1' )
  113.                         cleanFlag=true;
  114.                     else
  115.                         newProfileFlag=true;
  116.                 }
  117.             }
  118.         }
  119.     
  120.         // ensure that some descriptive layer is shown
  121.     
  122.         if ( cleanFlag == false && configuredFlag == false && newProfileFlag == false )
  123.             cleanFlag = true;
  124.     
  125.         if ( document && document.layers )
  126.         {
  127.             document.layers[ "Clean_Installation" ].visibility = ( ( cleanFlag == true ) ? "show" : "hide" );
  128.             document.layers[ "Profile_Configured" ].visibility = ( ( configuredFlag == true ) ? "show" : "hide" );
  129.             document.layers[ "Profile_Manager_Entrance" ].visibility = ( ( newProfileFlag == true ) ? "show" : "hide" );            
  130.         }
  131.     
  132.         parent.parent.globals.loadUserInput();
  133.     }
  134.     
  135.     
  136.     if ( document && document.layers )
  137.     {
  138.         document.layers[ "buttontext" ].visibility = "show";
  139.             
  140.         var showIntroScreens = parent.parent.globals.document.setupPlugin.GetNameValuePair( acctSetupFile, "Mode Selection", "Show_Intro_Screens" );
  141.         document.layers[ "Intro_Screens" ].visibility = ( ( showIntroScreens == "yes" ) ? "show" : "hide" );
  142.     }
  143.  
  144.     if ( parent && parent.controls && parent.controls.generateControls )
  145.         parent.controls.generateControls();
  146. }
  147.  
  148.  
  149.  
  150. function saveData()
  151. {
  152. }
  153.