home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: iw-AboutPrivacyControl.js (Javascript file for iw-AboutPrivacyControl.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- function OnTabOverAdd()
- {
- // Last Control Tab over to the <back, next, close> button.
- // Compare it with the Tab Key Code
- var VK_TAB = 9;
- if (window.event.keyCode == VK_TAB && (window.event.shiftKey != true))
- {
- if(Back1.disabled == true)
- window.parent.frames("bottom",0).focus();
- }
- }
-
- function OnTabOverModify()
- {
- // Last Control Tab over to the <back, next, close> button.
- var VK_TAB = 9;
- if (window.event.keyCode == VK_TAB && (window.event.shiftKey != true))
- window.parent.frames("bottom",0).focus();
- }
-
- function OnReverseTab()
- {
- // Reverse Tab go back to navigation page
- var VK_TAB = 9;
- if (window.event.keyCode == VK_TAB && (window.event.shiftKey == true))
- window.parent.frames("contents",0).focus();
- }
-
-
- function AddConfidential()
- {
- var iMaxDisplayChar = 13;
- var iMaxDiplayTotal = iMaxDisplayChar + 3;
-
- var txtArray = new Array(1);
- txtArray[0]=StrID("AddConfid");
- // var strConfInfo = window.showModalDialog("iw-AddConfid.htm", txtArray,'dialogWidth: 460px; dialogHeight:350px; center: yes; status: no');
- var strConfInfo = webWind.showModalDialog("res://IntroWiz.exe/iw-AddConfid.htm", 438, 288, txtArray);
-
- if(strConfInfo != null)
- {
- if (strConfInfo[3]==StrID("Reload"))
- {
- // Reload the entire page if we are modifying a value that exist
- ConfigInfo.AddConfInfo(strConfInfo[0], strConfInfo[1], strConfInfo[2]); // Add to the real data
- ReloadListBox();
- }
- else
- {
- ListA.OnClick = OnClick;
- ListA.OnDblClick = ModifyConfidential;
- ListA.SetColumnCount(3);
- ListA.SetColumnWidth(0, "34%");
- ListA.SetColumnWidth(1, "34%");
- ListA.SetColumnWidth(2, "32%");
- var pRow = null;
- pRow = ListA.InsertRow(-1);
-
- // If string is larger than max we will only display max chars + ..
- if (strConfInfo[0].length > iMaxDiplayTotal)
- strTrimmedField1 = strConfInfo[0].substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField1 = strConfInfo[0];
-
- // Now display the truncated string if necessary
- ListA.SetCellTextPtr(pRow, 0, strTrimmedField1);
-
- ListA.SetCellTextPtr(pRow, 1, strConfInfo[1]);
-
- if (strConfInfo[2].length > iMaxDiplayTotal)
- strTrimmedField2 = strConfInfo[2].substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField2 = strConfInfo[2];
-
- ListA.SetCellTextPtr(pRow, 2, strTrimmedField2); // Add to the UI
- ConfigInfo.AddConfInfo(strConfInfo[0], strConfInfo[1], strConfInfo[2]); // Add to the real data
- }
- }
- }
-
- function RemoveConfidential()
- {
- // MessageBox() Flags
- var MB_OK = 0x00000000;
- var MB_OKCANCEL = 0x00000001;
- var MB_ABORTRETRYIGNORE = 0x00000002;
- var MB_YESNOCANCEL = 0x00000003;
- var MB_YESNO = 0x00000004;
- var MB_RETRYCANCEL = 0x00000005;
-
- var MB_ICONHAND = 0x00000010;
- var MB_ICONQUESTION = 0x00000020;
- var MB_ICONEXCLAMATION = 0x00000030;
- var MB_ICONASTERISK = 0x00000040;
-
- var MB_USERICON = 0x00000080;
- var MB_ICONWARNING = MB_ICONEXCLAMATION;
- var MB_ICONERROR = MB_ICONHAND;
-
- var MB_ICONINFORMATION = MB_ICONASTERISK;
- var MB_ICONSTOP = MB_ICONHAND;
-
- var IDOK = 1;
- var IDCANCEL = 2;
- var IDABORT = 3;
- var IDRETRY = 4;
- var IDIGNORE = 5;
- var IDYES = 6;
- var IDNO = 7;
-
- var retVal = webWind.MsgBox(StrID("RemoveConfInfoWarning"), StrID("Confirm"), MB_YESNO | MB_ICONQUESTION);
-
- if (retVal == IDYES)
- {
- var iConfInfoCount = ConfigInfo.ConfInfoCount;
- var iRow = ListA.GetCurSel();
- var strName;
- var strType;
-
- ConfigInfo.SetStartData();
- for (var i = 0; i < iConfInfoCount; i++)
- {
-
- // Found a match
- if (i == iRow - 1)
- {
- strName = ConfigInfo.strDesc;
- strType = ConfigInfo.strType;
- break;
- }
-
- ConfigInfo.GetNextData();
- }
-
- ListA.DeleteRow(iRow); // Delete from (ListControl Box)
- ConfigInfo.DeleteConfInfo(strName, strType); // Delete for real from data
-
- ToggleModifyState(false);
- ToggleRemoveState(false);
- }
- else
- return;
- }
-
- function ModifyConfidential()
- {
- var iMaxDisplayChar = 13;
- var iMaxDiplayTotal = iMaxDisplayChar + 3;
-
- var strParams = new Array(4);
- var iConfInfoCount = ConfigInfo.ConfInfoCount;
- var iRow = ListA.GetCurSel();
-
- ConfigInfo.SetStartData();
-
- var strName;
- var strData
-
- ConfigInfo.SetStartData();
- for (var i = 0; i < iConfInfoCount; i++)
- {
-
- // Found a match
- if (i == iRow - 1)
- {
- strName = ConfigInfo.strDesc;
- strData = ConfigInfo.strData;
- break;
- }
-
- ConfigInfo.GetNextData();
- }
-
- strParams[0]= StrID("ModifyConfid");
- strParams[1]= strName;
- strParams[2]= ListA.GetCellText(iRow, 1);
- strParams[3]= strData;
-
- var strConfInfo = webWind.showModalDialog("res://IntroWiz.exe/iw-AddConfid.htm", 438, 288, strParams);
-
- if(strConfInfo != null)
- {
-
- if (strConfInfo[3]=="Reload")
- {
- // Reload the entire page if we are modifying a value that exist
- ConfigInfo.DeleteConfInfo(strParams[1], strParams[2]); // Delete from real data
- ConfigInfo.AddConfInfo(strConfInfo[0], strConfInfo[1], strConfInfo[2]); // Add to the real data
- ReloadListBox();
-
- }
- else
- {
- var strTrimmedField1;
- var strTrimmedField2;
-
- ListA.DeleteRow(iRow); // Delete from (ListControl Box)
- ConfigInfo.DeleteConfInfo(strParams[1], strParams[2]); // Delete from real data
-
- var pRow = null;
- pRow = ListA.InsertRow(-1); // Append to the end
-
- // If string is larger than max we will only display max chars + ..
- if (strConfInfo[0].length > iMaxDiplayTotal)
- strTrimmedField1 = strConfInfo[0].substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField1 = strConfInfo[0];
-
- // Now display the truncated string if necessary
- ListA.SetCellTextPtr(pRow, 0, strTrimmedField1);
-
- ListA.SetCellTextPtr(pRow, 1, strConfInfo[1]);
-
- if (strConfInfo[2].length > iMaxDiplayTotal)
- strTrimmedField2 = strConfInfo[2].substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField2 = strConfInfo[2];
-
- ListA.SetCellTextPtr(pRow, 2, strTrimmedField2); // Add to the UI
- ConfigInfo.AddConfInfo(strConfInfo[0], strConfInfo[1], strConfInfo[2]); // Add to the real data
-
- ToggleModifyState(false);
- ToggleRemoveState(false);
- }
- }
- }
-
- function LaunchExample()
- {
- event.cancelBubble = true;
- event.returnValue = false;
- webWind.showModalDialog("res://IntroWiz.exe/iw-confid_examples.htm", 480, 270);
- }
-
- function OnLoad()
- {
-
- LaunchConfExample.focus();
- var parentwnd = window.parent.frames("contents",0);
- if(parentwnd)
- {
- window.NISTitleName.innerText=WrapNisum.ProductName;;
- }
-
- ToggleModifyState(false);
- ToggleRemoveState(false);
-
- ListA.OnClick = OnClick;
- ListA.OnDblClick = ModifyConfidential;
-
- ReloadListBox();
-
-
- }
-
- function ToggleRemoveState(bState)
- {
- if(bState==true)
- {
- Back1.disabled = false;
- }
- else
- {
- Back1.disabled = true;
- }
-
-
- }
-
-
- function ToggleModifyState(bState)
- {
- if(bState==true)
- {
- Back2.disabled = false;
- }
- else
- {
- Back2.disabled = true;
- }
-
- }
-
- function OnClick(nRow)
- {
- ToggleModifyState(true);
- ToggleRemoveState(true);
- }
-
- // New Function to reload the list
- function ReloadListBox()
- {
- var txtArray = new Array(3);
- var iMaxDisplayChar = 13;
- var iMaxDiplayTotal = iMaxDisplayChar + 3;
-
- ListA.DeleteAllRows();
- ListA.SetColumnCount(3);
- ListA.SetColumnWidth(0, "34%");
- ListA.SetColumnWidth(1, "34%");
- ListA.SetColumnWidth(2, "32%");
-
- var strCurrentDesc;
- var strCurrentType;
- var strCurrentData;
-
- var strTrimmedField1;
- var strTrimmedField2;
- var pRow = null;
- pRow = ListA.InsertRow(-1);
-
- var iConfInfoCount = ConfigInfo.ConfInfoCount;
-
- // Call COM Object to get the correct amount of data
- ConfigInfo.SetStartData();
- for (var i = 0; i < iConfInfoCount; i++)
- {
- var pRow = null;
- pRow = ListA.InsertRow(-1);
-
- strCurrentDesc = ConfigInfo.strDesc;
- strCurrentType = ConfigInfo.strType;
- strCurrentData = ConfigInfo.strData;
-
- // If string is larger than max we will only display max chars + ..
- if (strCurrentDesc.length > iMaxDiplayTotal)
- strTrimmedField1 = strCurrentDesc.substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField1 = strCurrentDesc;
-
- // Now display the truncated string if necessary
- ListA.SetCellTextPtr(pRow, 0, strTrimmedField1);
-
- ListA.SetCellTextPtr(pRow, 1, strCurrentType);
-
- if (strCurrentData.length > iMaxDiplayTotal)
- strTrimmedField2 = strCurrentData.substr(0, iMaxDisplayChar) + "...";
- else
- strTrimmedField2 = strCurrentData;
-
- ListA.SetCellTextPtr(pRow, 2, strTrimmedField2);
-
- ConfigInfo.GetNextData();
- }
-
- ToggleModifyState(false);
- ToggleRemoveState(false);
- }
-
- function OnKeyDownHandler()
- {
- // Last Control Tab over to the <back, next, close> button.
- var VK_ESCAPE = 27;
-
- if (window.event.keyCode == VK_ESCAPE)
- {
- // Escape key.. We want to exit out of the wizard..
- parent.window.navigate("res://closeme.xyz");
-
- }
-
- }