home *** CD-ROM | disk | FTP | other *** search
- ////////////////////////////////////////////////////////////////////////////////////////////
- //
- // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
- //
- // NAME: modifyRule.js (Javascript file for modifyRule.HTM)
- //
- // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
- //
- ////////////////////////////////////////////////////////////////////////////////////////////
-
- window.dialogHeight = "478px";
- window.dialogWidth = "520px";
- window.returnValue = null;
- var currGroup = 1;
- var xmlRules = null;
- var g_TopItemBtnText = GetStyleSheet("topitembtn")[0];
- var g_IEVer = GetIEVersion();
-
- function init()
- {
- // If we need to include the Type tab, then we need to adjust the widths
- // of all buttons so they fit on one row.
- var widthAction = 10;
- var widthConnections = 19;
- var widthComputers = 17;
- var widthCommunications = 23;
- var widthTracking = 14;
- var widthTitle = 17;
-
- UserManager.WatchForFREIntegStart();
-
- if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
- {
- widthAction -= 1;
- widthConnections -= 3;
- widthComputers -= 1;
- widthTracking -= 2;
- widthTitle -= 1;
- }
-
- TabAction.style.width = widthAction + "%";
- TabConnections.style.width = widthConnections + "%";
- TabComputers.style.width = widthComputers + "%";
- TabTracking.style.width = widthTracking + "%";
- TabTitle.style.width = widthTitle + "%";
-
- // Change the relative top pos of .topitembtntxt based on the browser version
- if(g_IEVer >= 5)
- g_TopItemBtnText.style.top = "-1px";
- else
- g_TopItemBtnText.style.top = "-7px";
-
- var rule = window.dialogArguments;
-
- if ("" != rule.ApplicationDescription)
- {
- ruleDoc.init(rule, "Application",null,true);
- }
- else
- {
- ruleDoc.init(rule, "UnknownB",null,true);
- }
-
- // Re-Position the background bitmap.
-
- ruleDoc.document.body.style.backgroundPositionX = "165%";
- ruleDoc.document.body.style.backgroundPositionY = "51%";
-
- TabAction.style.borderBottomWidth = 0;
- TabAction.focus();
- }
-
- function UserManager_OnFREIntegratorStart()
- {
- window.navigate('res://closeme.xyz');
- }
-
- function GetStyleSheet(ruleName)
- {
- var Rules = new Array();
- var styleCount = 0;
- for(var ssIndex = 0; ssIndex < document.styleSheets.length; ssIndex++)
- {
- styleSheet = document.styleSheets[ssIndex];
- for(var rIndex=0; rIndex < styleSheet.rules.length; rIndex++)
- {
- rule=styleSheet.rules[rIndex]
- if(rule.selectorText == ("." + ruleName) || rule.selectorText == ruleName)
- {
- Rules[styleCount] = rule
- styleCount++;
- }
- }
- }
- return Rules;
- }
-
-
- function putBordersBack()
- {
- TabAction.style.borderBottomWidth = 1;
- TabAction.style.borderBottomStyle = "solid"; // This tab is not underlined by default.
- TabAction.style.borderBottomColor = "black";
- TabConnections.style.borderBottomWidth = 1;
- TabComputers.style.borderBottomWidth = 1;
- TabCommunication.style.borderBottomWidth = 1;
- TabTracking.style.borderBottomWidth = 1;
- TabTitle.style.borderBottomWidth = 1;
-
- if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
- TabType.style.borderBottomWidth = 1;
- }
-
- function switchTab(ctrl, dest, group)
- {
- var badpage = ruleDoc.validateAll();
-
- if (!badpage)
- {
- //
- // Remove bottom border from selected tab. But first,
- // make sure all the other ones have bottom border.
- //
- putBordersBack();
- ctrl.style.borderBottomWidth = 0;
- ruleDoc.SetPage(dest);
- window.focus();
- }
-
- }
-
- function applyChanges()
- {
- var badpage = ruleDoc.validateAll();
-
- if (!badpage)
- {
- window.returnValue = ruleDoc.saveRule();
- window.navigate("res://closeme.xyz");
- }
- }
-