home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: Ports-Popup.js (Javascript file for Ports-Popup.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- function Page_OnLoad()
- {
- if (window.dialogArguments == "local") {
- RLocal.checked = true;
- RRemote.checked = false;
- }
- else
- {
- RLocal.checked = false;
- RRemote.checked = true;
- }
-
- OKB.focus();
- }
-
- function SelIndividual_OnClick()
- {
- Range.style.display = "none";
- List.style.display = "none";
- Individual.style.display = "";
- RPortRange.checked = false;
- RPortList.checked = false;
- RSinglePort.checked = true;
- }
-
- function SelList_OnClick()
- {
- Individual.style.display = "none";
- Range.style.display = "none";
- List.style.display = "";
- RPortRange.checked = false;
- RSinglePort.checked = false;
- RPortList.checked = true;
- }
-
- function SelRange_OnClick()
- {
- Individual.style.display = "none";
- List.style.display = "none";
- Range.style.display = "";
- RSinglePort.checked = false;
- RPortList.checked = false;
- RPortRange.checked = true;
- }
-
- function OKB_OnClick()
- {
- //
- // Prepare some variables to simplify access to objects.
- //
- var Error = false;
- var xmlOut = new ActiveXObject("Microsoft.XMLDOM");
- xmlOut.loadXML(RLocal.checked?"<LocalPorts/>":"<RemotePorts/>");
-
- var oKnownPortsList = KnownPorts.KnownPortsList;
-
- var nList_CheckboxOffset = 0;
- var nList_PortOffset = 1;
- //
- // Is this the specified ports list?
- //
- if (PortType[0].checked)
- {
- //
- // Iterate over each service listed in our dialog.
- //
- for(var i=0; i < oKnownPortsList.rows.length;i++)
- {
- if(oKnownPortsList.rows[i].cells[nList_CheckboxOffset].children[0].checked)
- {
- if(IsValidPort(oKnownPortsList.rows[i].cells[nList_PortOffset].innerText))
- addPort_limited(xmlOut.documentElement, oKnownPortsList.rows[i].cells[nList_PortOffset].innerText);
- else
- {
- webWind.MsgBox2(StrID("InvalidPort"), UserManager.AppTitle);
- Error = true;
- break;
- }
- }
- }
- }
- //
- // Is this individually specified ports?
- //
- else if (PortType[1].checked)
- {
- var aPort = EnterPorts.value.split(" ");
-
- //
- // Cycle through space delimited list and add each port.
- //
- for(var nElem = 0; nElem < aPort.length; nElem++)
- {
- //
- // Valid port?
- //
- if (IsValidPort(aPort[nElem]))
- {
- addPort_limited(xmlOut.documentElement, aPort[nElem]);
- }
- else
- {
- webWind.MsgBox2(StrID("InvalidPort"), UserManager.AppTitle);
- Error = true;
- break;
- }
-
- }
- }
- //
- // Is this a port range?
- //
- else if (PortType[2].checked)
- {
- if (IsValidPort(EnterStartPort.value) && IsValidPort(EnterEndPort.value))
- addPort_limited(xmlOut.documentElement, EnterStartPort.value + ":" + EnterEndPort.value);
- else
- {
- webWind.MsgBox2(StrID("InvalidPort"), UserManager.AppTitle);
- Error = true;
- }
- }
-
- if (!Error)
- {
- window.returnValue = xmlOut;
- window.navigate("res://closeme.xyz");
- }
- }
-
- function CancelB_OnClickOrReset()
- {
- returnValue = null;
- window.navigate("res://closeme.xyz");
- }
-