home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / 05_02.iso / software / nis / files / NIS / NIS.MSI / fwUI.dll / HTML / ADDRULEWIZ.JS < prev    next >
Encoding:
Text File  |  2001-12-01  |  3.5 KB  |  142 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    AddRuleWiz.js (Javascript file for AddRuleWiz.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11.     window.returnValue = null;
  12.  
  13. function init()
  14. {
  15.     NextB.disabled = "";
  16.     NextB.focus();
  17.  
  18.     var xmlArgument = window.dialogArguments;
  19.  
  20.     if (null != xmlArgument)
  21.     {
  22.         var Node = xmlArgument.selectSingleNode("/*/ApplicationDescription");
  23.  
  24.         if (null != Node)
  25.         {
  26.             // A note:  This code has been modified umpteen times.  AddRuleWiz expects to get
  27.             // ONE and ONLY ONE rule in the xmlArgument.  It will use this rule for its 
  28.             // defaults. 
  29.  
  30.             var xml =  xmlArgument.selectSingleNode("/*/Rule");
  31.             ruleDoc.init(xml, "Application", Node.nodeTypedValue);
  32.             return;
  33.         }
  34.  
  35.         if (xmlArgument.documentElement.nodeName == "SystemRules")
  36.         {
  37.             var xml = xmlArgument.selectSingleNode("/*/Rule");
  38.             ruleDoc.init(xml, "System", StrID("your_computer"));        
  39.             return;
  40.         }
  41.  
  42.         if (xmlArgument.documentElement.nodeName == "TrojanRules")
  43.         {
  44.             var xml = xmlArgument.selectSingleNode("/*/Rule");
  45.             ruleDoc.init(xml, "Trojan", StrID("Trojan"));
  46.             return;
  47.         }
  48.     }
  49. }
  50.  
  51. function BackB_OnClick()
  52. {
  53.     switch(ruleDoc.CurrPage)
  54.     {
  55.         // case "Action": // Do nothing
  56.         case "Direction":
  57.             ruleDoc.SetPage("Action");
  58.             BackB.disabled = "disabled";
  59.             tellMe.style.visibility = "";
  60.             break;
  61.         case "IP":
  62.             ruleDoc.SetPage("Direction");
  63.             tellMe.style.visibility = "";
  64.             break;
  65.         case "Ports":
  66.             ruleDoc.SetPage("IP");
  67.             tellMe.style.visibility = "";
  68.             break;
  69.         case "Logging":
  70.             ruleDoc.SetPage("Ports");
  71.             tellMe.style.visibility = "";
  72.             break;
  73.         case "Title":
  74.             ruleDoc.SetPage("Logging");
  75.             tellMe.style.visibility = "";
  76.             break;
  77.         case "Finished":
  78.             ruleDoc.SetPage("Title");
  79.             NextB.value = StrID("NextB");
  80.             tellMe.style.visibility = "";
  81.     }
  82. }
  83.  
  84. function NextB_OnClick()
  85. {
  86.     switch(ruleDoc.CurrPage)
  87.     {
  88.         case "Action":
  89.             if (ruleDoc.ActionValidate())
  90.             {
  91.                 ruleDoc.SetPage("Direction");
  92.                 BackB.disabled = "";
  93.                 tellMe.style.visibility = "";
  94.             }
  95.             break;
  96.         case "Direction":
  97.             if (ruleDoc.DirectionValidate())
  98.             {
  99.                 ruleDoc.SetPage("IP");
  100.                 tellMe.style.visibility = "";
  101.             }
  102.             break;
  103.         case "IP":
  104.                if (ruleDoc.IPValidate())
  105.             {
  106.                 ruleDoc.SetPage("Ports");
  107.                 tellMe.style.visibility = "";
  108.             }
  109.             break;
  110.         case "Ports":
  111.             if (ruleDoc.ProtocolAndPortValidate())
  112.             {
  113.                 ruleDoc.SetPage("Logging");
  114.                 tellMe.style.visibility = "";
  115.             }
  116.             break;
  117.         case "Logging":
  118.             ruleDoc.SetPage("Title");
  119.             tellMe.style.visibility = "";
  120.             break;
  121.         case "Title":
  122.             if (ruleDoc.TitleValidate())
  123.             {
  124.                 ruleDoc.SetPage("Finished");
  125.                 NextB.value = StrID("FinishB");
  126.                 ruleDoc.displayRuleData();
  127.                 tellMe.style.visibility = "hidden";
  128.             }
  129.             break;
  130.         case "Finished":
  131.         {
  132.             window.returnValue = ruleDoc.saveRule();
  133.             window.navigate("res://closeme.xyz");
  134.             break;
  135.         }
  136.     }
  137. }
  138.  
  139. function CancelB_OnClick()
  140. {
  141.     window.navigate("res://closeme.xyz");
  142. }