home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: ICMP-Popup.js (Javascript file for ICMP-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 getICMPInfo(row, item)
- {
- var nCol = 0;
- switch (item.toLowerCase())
- {
- case "checked":
- nCol = 0;
- break;
- case "value":
- nCol = 1;
- break;
- case "name":
- nCol = 2;
- break;
- }
- return ICMPList.MsgTypes.rows[row].cells[nCol];
- }
-
- 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 oMsgTypes = ICMPList.MsgTypes.rows;
- var nNumRecs = oMsgTypes.length;
-
- //
- // Is this the specified ports list?
- //
- if (PortType[0].checked)
- {
- //
- // Iterate over each service listed in our dialog.
- //
- for(var nElem = 0;
- nElem < nNumRecs;
- nElem++)
- {
- //
- // If the user checked this service (via the nested child INPUT tag), add it to our list.
- //
- if (getICMPInfo(nElem, "checked").children[0].checked)
- {
- if (IsValidPort(getICMPInfo(nElem, "value").innerText))
- addPort_limited(xmlOut.documentElement, getICMPInfo(nElem, "value").innerText);
- else
- {
- webWind.MsgBox(StrID("InvalidCommand"), UserManager.AppTitle, MB_OK | MB_ICONEXCLAMATION);
- 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.MsgBox(StrID("InvalidCommand"), UserManager.AppTitle, MB_OK | MB_ICONEXCLAMATION);
- 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.MsgBox(StrID("InvalidCommand"), UserManager.AppTitle, MB_OK | MB_ICONEXCLAMATION);
- Error = true;
- }
- }
-
- if (!Error)
- {
- window.returnValue = xmlOut;
- window.navigate("res://closeme.xyz");
- }
- }
-
- function CancelB_OnClickOrReset()
- {
- returnValue = null;
- window.navigate("res://closeme.xyz");
- }