home *** CD-ROM | disk | FTP | other *** search
/ Online Praxis 1998 March / Image.iso / CD-ROM / NETSCAPE / CCK / ASE.Z / ias.js < prev    next >
Encoding:
Text File  |  1997-08-21  |  3.1 KB  |  99 lines

  1. <!--  to hide script contents from old browsers
  2.  
  3. // the file that includes this must also include settings.js!
  4.  
  5. function refreshIASList()
  6. {
  7.     parent.iasglobals.debug("ias.js: refreshing list");
  8.     formName = "IASCONFIGSELECT";
  9.     fillSelectListWithConfigFiles(formName, "iasSiteList", ".IAS", true);
  10. }
  11.  
  12. function setIASList(inFileName)
  13. {    
  14.     formName = "IASCONFIGSELECT";
  15.     setSelectList(formName, "iasSiteList", inFileName);
  16.  
  17. }
  18.  
  19.  
  20. //this is the onLoad event handler
  21. function loadData()
  22. {
  23.     if (parent.iasglobals && parent.iasglobals.getText)
  24.     {
  25.         refreshIASList();
  26.     
  27.         var openerConfigName = parent.iasglobals.GetNameValuePair("ACCTSET.INI", "New Acct Mode", "RegServer");
  28.         if ((openerConfigName != null) && (openerConfigName != ""))
  29.         {
  30.             setIASList(openerConfigName);
  31.             parent.iasglobals.readFileData(openerConfigName);
  32.         }
  33.     }
  34.     else
  35.         setTimeout("loadData()",500);
  36.     
  37. }
  38.  
  39. function saveData()
  40. {
  41.     //do nothing
  42. }
  43.  
  44. function setSelectList(formName, selectListName, inValue)
  45. {
  46.     if (inValue != null)
  47.     { 
  48.          for (var i = (document[formName][selectListName].length - 1); i >= 0 ; i--)
  49.          {
  50.              if(inValue.toString() == (document[formName][selectListName].options[i].value.toString()))
  51.              {
  52.                  //parent.iasglobals.debug("Found select list Match (" + i + ")(" + inValue + ")");
  53.                  document[formName][selectListName].options[i].selected = true;
  54.              }
  55.          }
  56.     }    
  57. }
  58.  
  59. function fillSelectListWithConfigFiles(formName, selectListName, fileSuffix, offerNew)
  60. {
  61.     var curConfigName = "";
  62.     var curConfigDescription = "";
  63.  
  64.     //blank out old list
  65.     for (var i = (document[formName][selectListName].length -1); i >= 0 ; i--)
  66.     {
  67.         document[formName][selectListName].options[i] = null;
  68.     }    
  69.     
  70.     //make a blank so the user can choose nothing
  71.     document[formName][selectListName].options[0] = new Option("< None Selected >","",false, false); 
  72.     
  73.     //Only offer a new if we said so
  74.     if (offerNew == true)
  75.         document[formName][selectListName].options[1] = new Option("< New Configuration >","_new_",false, false); 
  76.  
  77.     // Get a list of the files in the Config folder
  78.     fileList = parent.iasglobals.getFileListFromConfigFolder(fileSuffix);
  79.     
  80.     //parent.iasglobals.debug( "filelist: " + fileList);
  81.     
  82.     if (fileList != null)    {
  83.         for (var i=0; i<fileList.length; i++)    {
  84.                 curConfigName             = parent.iasglobals.GetNameValuePair(fileList[i], "Dial-In Configuration", "SiteName");
  85.                 curConfigDescription     = parent.iasglobals.GetNameValuePair(fileList[i], "Dial-In Configuration", "Description");
  86.  
  87.                 if ((curConfigName != null)  && (curConfigName != ""))
  88.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(curConfigName,fileList[i], false, false);
  89.                 else if ((curConfigDescription != null) && (curConfigDescription != ""))
  90.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(curConfigDescription,fileList[i], false, false);
  91.                 else
  92.                     document[formName][selectListName].options[document[formName][selectListName].length] = new Option(fileList[i],fileList[i], false, false);
  93.                     
  94.             }
  95.         }
  96. }
  97.  
  98. // end hiding contents from old browsers  -->
  99.