home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: DeleteRuleSelectLocations.js (Javascript file for DeleteRuleSelectLocations.HTM)
- //
- // Copyright (c) 2003 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- window.returnValue = null;
-
- function OnLoad()
- {
- // Set the title...
- window.title = UserManager.ProductName;
-
- var bLAIsOn = RLevel.LocationAwarenessEnabled;
- if(bLAIsOn)
- {
- LocationAwarenessIsOffText.innerText = " ";
- }
-
- UILocationsLoad(window.dialogArguments);
- UILocation_UpdateOKButtonState();
- }
-
- function UILocationsLoad(aStrLocations)
- {
- // Setup the list control
- locationList.OnClick = locationList_OnClick;
- locationList.OnDblClick = locationList_OnDblClick;
- locationList.OnSpace = locationList_OnSpace;
-
- // populate list
- DeleteRuleSelectLocations_Body.style.cursor = "wait";
-
- // var bCheckDefault = !RLevel.LocationAwarenessEnabled;
- // var bCheckActive = RLevel.LocationAwarenessEnabled;
- // Location_PopulateListBox(locationList,bCheckDefault,bCheckActive);
-
- // Setup the list control
- locationList.SetTableClass("ListBoxClass");
- locationList.SetColumnCount(2);
- locationList.SetColumnWidth(0, "15px");
- locationList.SetColumnWidth(1, "100px");
-
- locationList.DeleteAllRows();
-
- for(var i = 0; i < aStrLocations.length; i++)
- {
- var pRow = locationList.InsertRow(-1);
- var Enabled = "checked=yes";
-
- var checkboxString = "<input type=checkbox " + Enabled + ">";
- locationList.SetCellTextPtr(pRow, 0, checkboxString);
-
- var divID = "";
- var TextToAdd = "<div " + divID + " style='margin-top:6;margin-bottom:6'>" + aStrLocations[i] + "</div>";
- locationList.SetCellTextPtr(pRow, 1, TextToAdd);
- }
-
- DeleteRuleSelectLocations_Body.style.cursor = "";
- }
-
- function OKB_OnClick()
- {
- var arrayLocations = Location_GetListBoxSelectedItems(locationList);
- arrayLocations.length ? window.returnValue = arrayLocations : window.returnValue = null;
- window.navigate("res://closeme.xyz");
- }
-
- function CancelB_OnClick()
- {
- window.returnValue = null; // this should alredy be set, but let's make sure
- window.navigate("res://closeme.xyz");
- }
-
- function locationList_OnSpace()
- {
- var nCurSel = locationList.GetCurSel();
- var bEnable = false;
-
- if(nCurSel < 0)
- {
- return;
- }
-
- // Swap the state of the check box for this item
- var CheckBox = locationList.GetCellPtr(nCurSel, 0).children[0];
- CheckBox.checked = !CheckBox.checked;
- UILocation_UpdateOKButtonState();
- }
-
- function locationList_OnClick()
- {
- UILocation_UpdateOKButtonState();
- }
-
- function locationList_OnDblClick()
- {
- var nCurSel = locationList.GetCurSel();
- var bEnable = false;
-
- if(nCurSel < 0)
- {
- return;
- }
-
- // Swap the state of the check box for this item
- var CheckBox = locationList.GetCellPtr(nCurSel, 0).children[0];
- CheckBox.checked = !CheckBox.checked;
- UILocation_UpdateOKButtonState();
- }
-
- function UILocation_SelectAll()
- {
- Location_SelectAllListBoxItems(locationList, true);
- UILocation_UpdateOKButtonState();
- }
-
- function UILocation_DeselectAll()
- {
- Location_SelectAllListBoxItems(locationList, false);
- UILocation_UpdateOKButtonState();
- }
-
- function UILocation_UpdateOKButtonState()
- {
- var arrayLocations = Location_GetListBoxSelectedItems(locationList);
- arrayLocations.length ? OKB.disabled = false : OKB.disabled = true;
- }
-