home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 May / 05_02.iso / software / nis / files / NIS / NIS.MSI / fwUI.dll / HTML / MODIFYRULE.JS < prev    next >
Encoding:
Text File  |  2001-12-01  |  2.6 KB  |  105 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.     // Change the relative top pos of .topitembtntxt based on the browser version
  22.     if(g_IEVer >= 5)
  23.         g_TopItemBtnText.style.top = "-1px";
  24.     else 
  25.         g_TopItemBtnText.style.top = "-7px";
  26.  
  27.     var args = window.dialogArguments;
  28.  
  29.     xmlRules = args;
  30.     var appName = xmlRules.selectSingleNode("/*/ApplicationDescription");
  31.     if (null != appName)
  32.     {
  33.         ruleDoc.init(args, "Application");
  34.     }
  35.     else
  36.     {
  37.         ruleDoc.init(args, "UnknownB");
  38.     }
  39.  
  40.     TabAction.style.borderBottomWidth = 0;
  41.     TabAction.focus();
  42.  
  43. }
  44.  
  45. function GetStyleSheet(ruleName)
  46. {
  47.     var Rules = new Array();
  48.     var styleCount = 0;
  49.     for(var ssIndex = 0; ssIndex < document.styleSheets.length; ssIndex++)
  50.     {
  51.         styleSheet = document.styleSheets[ssIndex];
  52.         for(var rIndex=0; rIndex < styleSheet.rules.length; rIndex++)
  53.         {
  54.             rule=styleSheet.rules[rIndex]
  55.             if(rule.selectorText == ("." + ruleName) || rule.selectorText == ruleName)
  56.             {
  57.                 Rules[styleCount] = rule
  58.                 styleCount++;
  59.             }
  60.         }
  61.     }
  62.     return Rules;
  63. }
  64.  
  65.  
  66. function putBordersBack()
  67. {
  68.     TabAction.style.borderBottomWidth = 1;
  69.     TabAction.style.borderBottomStyle = "solid"; // This tab is not underlined by default.
  70.     TabAction.style.borderBottomColor = "black";
  71.     TabConnections.style.borderBottomWidth = 1;
  72.     TabComputers.style.borderBottomWidth = 1;
  73.     TabCommunication.style.borderBottomWidth = 1;
  74.     TabTracking.style.borderBottomWidth = 1;
  75.     TabTitle.style.borderBottomWidth = 1;
  76. }
  77.  
  78. function switchTab(ctrl, dest, group)
  79. {
  80.     var badpage = ruleDoc.validateAll(); 
  81.  
  82.     if (!badpage)
  83.     {
  84.     //
  85.     // Remove bottom border from selected tab. But first,
  86.     // make sure all the other ones have bottom border.
  87.     //
  88.         putBordersBack();
  89.         ctrl.style.borderBottomWidth = 0;
  90.         ruleDoc.SetPage(dest);
  91.     }
  92.  
  93. }
  94.  
  95. function applyChanges()
  96. {
  97.     var badpage = ruleDoc.validateAll(); 
  98.  
  99.     if (!badpage)
  100.     {
  101.         window.returnValue = ruleDoc.saveRule();
  102.         window.navigate("res://closeme.xyz");
  103.     }
  104. }
  105.