home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: AddRuleWiz.js (Javascript file for AddRuleWiz.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- window.returnValue = null;
-
- function init()
- {
- NextB.disabled = "";
- NextB.focus();
-
- var xmlArgument = window.dialogArguments;
-
- if (null != xmlArgument)
- {
- var Node = xmlArgument.selectSingleNode("/*/ApplicationDescription");
-
- if (null != Node)
- {
- // A note: This code has been modified umpteen times. AddRuleWiz expects to get
- // ONE and ONLY ONE rule in the xmlArgument. It will use this rule for its
- // defaults.
-
- var xml = xmlArgument.selectSingleNode("/*/Rule");
- ruleDoc.init(xml, "Application", Node.nodeTypedValue);
- return;
- }
-
- if (xmlArgument.documentElement.nodeName == "SystemRules")
- {
- var xml = xmlArgument.selectSingleNode("/*/Rule");
- ruleDoc.init(xml, "System", StrID("your_computer"));
- return;
- }
-
- if (xmlArgument.documentElement.nodeName == "TrojanRules")
- {
- var xml = xmlArgument.selectSingleNode("/*/Rule");
- ruleDoc.init(xml, "Trojan", StrID("Trojan"));
- return;
- }
- }
- }
-
- function BackB_OnClick()
- {
- switch(ruleDoc.CurrPage)
- {
- // case "Action": // Do nothing
- case "Direction":
- ruleDoc.SetPage("Action");
- BackB.disabled = "disabled";
- tellMe.style.visibility = "";
- break;
- case "IP":
- ruleDoc.SetPage("Direction");
- tellMe.style.visibility = "";
- break;
- case "Ports":
- ruleDoc.SetPage("IP");
- tellMe.style.visibility = "";
- break;
- case "Logging":
- ruleDoc.SetPage("Ports");
- tellMe.style.visibility = "";
- break;
- case "Title":
- ruleDoc.SetPage("Logging");
- tellMe.style.visibility = "";
- break;
- case "Finished":
- ruleDoc.SetPage("Title");
- NextB.value = StrID("NextB");
- tellMe.style.visibility = "";
- }
- }
-
- function NextB_OnClick()
- {
- switch(ruleDoc.CurrPage)
- {
- case "Action":
- if (ruleDoc.ActionValidate())
- {
- ruleDoc.SetPage("Direction");
- BackB.disabled = "";
- tellMe.style.visibility = "";
- }
- break;
- case "Direction":
- if (ruleDoc.DirectionValidate())
- {
- ruleDoc.SetPage("IP");
- tellMe.style.visibility = "";
- }
- break;
- case "IP":
- if (ruleDoc.IPValidate())
- {
- ruleDoc.SetPage("Ports");
- tellMe.style.visibility = "";
- }
- break;
- case "Ports":
- if (ruleDoc.ProtocolAndPortValidate())
- {
- ruleDoc.SetPage("Logging");
- tellMe.style.visibility = "";
- }
- break;
- case "Logging":
- ruleDoc.SetPage("Title");
- tellMe.style.visibility = "";
- break;
- case "Title":
- if (ruleDoc.TitleValidate())
- {
- ruleDoc.SetPage("Finished");
- NextB.value = StrID("FinishB");
- ruleDoc.displayRuleData();
- tellMe.style.visibility = "hidden";
- }
- break;
- case "Finished":
- {
- window.returnValue = ruleDoc.saveRule();
- window.navigate("res://closeme.xyz");
- break;
- }
- }
- }
-
- function CancelB_OnClick()
- {
- window.navigate("res://closeme.xyz");
- }