home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2004 July / APC0407D1.iso / powerkit / firewall / files / NPF2004.exe / Setup / ISCommon / APP / fwUI.dll / HTML / MODIFYRULE.JS < prev    next >
Encoding:
Text File  |  2003-09-06  |  3.7 KB  |  142 lines

  1. ////////////////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // PRODUCT: Norton Internet Security/Symantec Desktop Firewall
  4. //
  5. // NAME:    modifyRule.js (Javascript file for modifyRule.HTM)
  6. //
  7. // Copyright (c) 2001 by Symantec Corporation. All rights reserved.
  8. //
  9. ////////////////////////////////////////////////////////////////////////////////////////////
  10.  
  11.     window.dialogHeight = "478px";
  12.     window.dialogWidth = "520px";
  13.     window.returnValue = null;
  14.     var currGroup = 1;
  15.     var xmlRules = null;
  16.     var g_TopItemBtnText = GetStyleSheet("topitembtn")[0];
  17.     var g_IEVer = GetIEVersion();
  18.  
  19. function init()
  20. {
  21.     // If we need to include the Type tab, then we need to adjust the widths
  22.     // of all buttons so they fit on one row.
  23.     var widthAction = 10;
  24.     var widthConnections = 19;
  25.     var widthComputers = 17;
  26.     var widthCommunications = 23;
  27.     var widthTracking = 14;
  28.     var widthTitle = 17;
  29.  
  30.     UserManager.WatchForFREIntegStart();
  31.  
  32.     if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
  33.     {
  34.         widthAction -= 1;
  35.         widthConnections -= 3;
  36.         widthComputers -= 1;
  37.         widthTracking -= 2;
  38.         widthTitle -= 1;
  39.     }
  40.  
  41.     TabAction.style.width = widthAction + "%";
  42.     TabConnections.style.width = widthConnections + "%";
  43.     TabComputers.style.width = widthComputers + "%";
  44.     TabTracking.style.width = widthTracking + "%";
  45.     TabTitle.style.width = widthTitle + "%";
  46.  
  47.     // Change the relative top pos of .topitembtntxt based on the browser version
  48.     if(g_IEVer >= 5)
  49.         g_TopItemBtnText.style.top = "-1px";
  50.     else 
  51.         g_TopItemBtnText.style.top = "-7px";
  52.  
  53.     var rule = window.dialogArguments;
  54.  
  55.     if ("" != rule.ApplicationDescription)
  56.     {
  57.         ruleDoc.init(rule, "Application",null,true);
  58.     }
  59.     else
  60.     {
  61.         ruleDoc.init(rule, "UnknownB",null,true);
  62.     }
  63.  
  64.     // Re-Position the background bitmap.
  65.  
  66.     ruleDoc.document.body.style.backgroundPositionX = "165%";
  67.     ruleDoc.document.body.style.backgroundPositionY = "51%";
  68.  
  69.     TabAction.style.borderBottomWidth = 0;
  70.     TabAction.focus();
  71. }
  72.  
  73. function UserManager_OnFREIntegratorStart()
  74. {
  75.      window.navigate('res://closeme.xyz');
  76. }
  77.  
  78. function GetStyleSheet(ruleName)
  79. {
  80.     var Rules = new Array();
  81.     var styleCount = 0;
  82.     for(var ssIndex = 0; ssIndex < document.styleSheets.length; ssIndex++)
  83.     {
  84.         styleSheet = document.styleSheets[ssIndex];
  85.         for(var rIndex=0; rIndex < styleSheet.rules.length; rIndex++)
  86.         {
  87.             rule=styleSheet.rules[rIndex]
  88.             if(rule.selectorText == ("." + ruleName) || rule.selectorText == ruleName)
  89.             {
  90.                 Rules[styleCount] = rule
  91.                 styleCount++;
  92.             }
  93.         }
  94.     }
  95.     return Rules;
  96. }
  97.  
  98.  
  99. function putBordersBack()
  100. {
  101.     TabAction.style.borderBottomWidth = 1;
  102.     TabAction.style.borderBottomStyle = "solid"; // This tab is not underlined by default.
  103.     TabAction.style.borderBottomColor = "black";
  104.     TabConnections.style.borderBottomWidth = 1;
  105.     TabComputers.style.borderBottomWidth = 1;
  106.     TabCommunication.style.borderBottomWidth = 1;
  107.     TabTracking.style.borderBottomWidth = 1;
  108.     TabTitle.style.borderBottomWidth = 1;
  109.  
  110.     if(usingClientRules() && (UserManager.CurrentUserType == "UT_SUPERVISOR"))
  111.         TabType.style.borderBottomWidth = 1;
  112. }
  113.  
  114. function switchTab(ctrl, dest, group)
  115. {
  116.     var badpage = ruleDoc.validateAll(); 
  117.  
  118.     if (!badpage)
  119.     {
  120.     //
  121.     // Remove bottom border from selected tab. But first,
  122.     // make sure all the other ones have bottom border.
  123.     //
  124.         putBordersBack();
  125.         ctrl.style.borderBottomWidth = 0;
  126.         ruleDoc.SetPage(dest);
  127.         window.focus();
  128.     }
  129.  
  130. }
  131.  
  132. function applyChanges()
  133. {
  134.     var badpage = ruleDoc.validateAll(); 
  135.  
  136.     if (!badpage)
  137.     {
  138.         window.returnValue = ruleDoc.saveRule();
  139.         window.navigate("res://closeme.xyz");
  140.     }
  141. }
  142.