home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: wiz-ALEs.js (Javascript file for wiz-ALEs.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- IE4 = document.all;
- ///////////////////////////////////////////////////////
- /////////new alert params /////////////////////////////
- ///////////////////////////////////////////////////////
- //icon:
- // 0 = no icon
- // 1 = error
- // 2 = question
- // 3 = alert
- // 4 = info
- //
- //buts:
- // 0 = ok
- // 1 = ok, cancel
- // 2 = abort, retry, cancel
- // 3 = yes, no, cancel
- // 4 = yes, no
- // 5 = retry, cancel
- //
- //defbut
- // 0 = first
- // 1 = second
- // 2 = third
- //
- //mods:
- // 0 = app modal
- // 1 = system modal
- function newAlert(mess, title, icon, buts, defbut, mods)
- {
- if(IE4)
- makeMsgBox(title, mess, icon, buts, defbut, mods)
- else
- alert(mess);
- }
-
- function driveList_OnSpace(nRow)
- {
- //
- // Swap the state of the check box for this item
- //
- var CheckBox = driveList.GetCellPtr(nRow, 0).children[0];
- CheckBox.checked = !CheckBox.checked;
- }
-
- function initDriveList()
- {
- driveList.OnSpace = driveList_OnSpace;
- driveList.DeleteAllRows();
- driveList.SetColumnCount(2);
- driveList.SetColumnWidth(0, "50px");
- driveList.SetColumnWidth(1, "83px");
-
- var szDrives = NetScan.DriveList;
-
- for(var i = 0; i < szDrives.length; ++i)
- {
- var pRow = driveList.InsertRow(-1);
- driveList.SetCellTextPtr(pRow, 0, "<input type=\"checkbox\" checked OnClick=\"parent.CheckBox_OnClick()\">");
- driveList.SetCellTextPtr(pRow, 1, szDrives.substring(i, i+1) + ":\\");
- }
-
- }
-
- function CheckBox_OnClick()
- {
- // Get a count of checked items... if zero are checked, disable the next btn
- var nCount = driveList.GetRowCount();
-
- var nChecked = 0;
- for(var nRow = 0; nRow < nCount; ++nRow)
- {
- var CheckBox = driveList.GetCellPtr(nRow, 0).children[0];
- if(CheckBox.checked)
- {
- nChecked++;
- }
- }
-
- if(nChecked == 0)
- NextBtn.disabled = true;
- else
- NextBtn.disabled = false;
- }
-
- function saveDriveList()
- {
- var nCount = driveList.GetRowCount();
-
- szDrives = "";
- for(var nRow = 0; nRow < nCount; ++nRow)
- {
- var CheckBox = driveList.GetCellPtr(nRow, 0).children[0];
- if(CheckBox.checked)
- {
- szDrives += driveList.GetCellPtr(nRow, 1).innerText.substring(0, 1);
- }
- }
-
- NetScan.DriveList = szDrives;
- }
-
- function NextBtn_OnClick()
- {
- // Find the active page, back to front (if we are not disabled)
- if(PageC.style.display == "")
- {
- ConfigInfo.AleScanRun = true;
- returnValue = "";
- // save the items in the list
- FoundList.MergeItems();
- window.navigate("res://closeme.xyz");
- }
-
- if(PageB.style.display == "")
- {
- PageB.style.display = "none";
- PageC.style.display = "";
-
- FixBtnText(true);
- window.focus();
-
- // setup PageC
- if(g_bFoundListLoaded)
- FoundList.FileList = NetScan.FileList;
- }
-
- if(PageA.style.display == "")
- {
- PageA.style.display = "none";
- PageB.style.display = "";
-
- // setup PageB
- NextBtn.disabled = true;
- Cancel.disabled = true;
- StopBtn.disabled = false;
-
- ScanDone.style.display = "none";
- ScanStopped.style.display = "none"
- Scanning.style.display = "";
- Filename.style.display = "";
- ScanFound.innerHTML = "0";
- SetProgress(0);
- pctdone.innerHTML = "0% Complete";
-
- saveDriveList();
- NetScan.StartScan();
-
- FixBtnText(false);
- }
- }
-
-
- function SetProgress(nPct)
- {
- // We must special case 0 otherwise we get "invalid property"... arrrgggg!
- var nRemain = 100 - nPct;
-
- if(nPct > 0)
- {
- ProgDone.style.display = "";
- ProgDone.width = nPct + "%";
- }
- else
- {
- ProgDone.style.display = "none";
- }
-
- if(nRemain > 0)
- {
- ProgRemain.style.display = "";
- ProgRemain.width = nRemain + "%";
- }
- else
- {
- ProgRemain.style.display = "none";
- }
- }
-
- function Elipse_Path(nMaxLen, szPath)
- {
- var szItems = szPath.split("\\");
- var nItem = 0;
- var nLastStart = 1;
- var szOutput = szPath;
- while(szOutput.length > nMaxLen)
- {
- szOutput = szItems[0];
- szOutput = szOutput + "\\" + "...";
-
- for(nItem = nLastStart; nItem < szItems.length; nItem++)
- {
- szOutput = szOutput + "\\" + szItems[nItem];
- }
-
- nLastStart++;
- }
-
- return szOutput;
- }
-
- function CheckUserType()
- {
- var type = UserManager.CurrentUserType;
- if(type != "UT_SUPERVISOR")
- {
- newAlert(StrID("ALEScanSupervisor"), UserManager.AppTitle, 3, 0, 0, 0);
- window.navigate("res://closeme.xyz");
- }
- }
-
- function OnAdd()
- {
- FoundList.Add();
- }
-
- function OnModify()
- {
- FoundList.Modify();
- }
-
- function OnRemove()
- {
- FoundList.Delete();
- }
-
- function OnCheckAll()
- {
- FoundList.SelectAll();
- }
-
- function OnUncheckAll()
- {
- FoundList.UnselectAll();
- }
-
- 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..
- window.navigate("res://closeme.xyz");
-
- }
-
- }