home *** CD-ROM | disk | FTP | other *** search
/ PC World 2006 December / PCWorld_2006-12_cd.bin / komunikace / netscape / nsb-install-8-1-2.exe / chrome / browser.jar / content / browser / securityslider.js < prev    next >
Text File  |  2006-01-06  |  3KB  |  89 lines

  1.  
  2. function CheckSecuritySlider() {
  3.   var securitySlider = document.getElementById('securitySlider');
  4.   var secBtnMarker = document.getElementById('securitycenter-marker');
  5.   if(securitySlider) {
  6.     if(securitySlider.status == "sliding") {
  7.       setTimeout("CheckSecuritySlider()", 30);
  8.     }
  9.     else {
  10.       reshuffleToolbars(true);
  11.       // BC: 9/28/2005: Changed the arrow to show open/close, more css control.
  12.       if (secBtnMarker.getAttribute('class') == 'open') {
  13.         secBtnMarker.setAttribute('class', 'close');
  14.       } else {
  15.         secBtnMarker.setAttribute('class', 'open');
  16.       }
  17.     }
  18.   }
  19. }
  20.  
  21. function ToggleSecuritySuite(movingDirection) {
  22.     var securitySlider = document.getElementById('securitySlider');
  23.     if(securitySlider) {
  24.       if(!movingDirection) {
  25.         movingDirection = securitySlider.position == "center"? "left" : "center";
  26.       }
  27.       else if(movingDirection == securitySlider.position) {
  28.         return;
  29.       }
  30.  
  31.       if(movingDirection == "center") {
  32.         securitySlider.start(null, movingDirection, 30, 1.5, 1, 100);
  33.       }
  34.       else {
  35.       securitySlider.start(null, movingDirection, 30, 1, 20, 20);
  36.       }
  37.       CheckSecuritySlider();
  38.     }
  39. }
  40.  
  41. function OpenSecurityCenter() {
  42.     // MERC (rpaul) quick function to open security center tab of site control preferences
  43.     var prefs = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);
  44.     if (prefs)
  45.             prefs.setCharPref("browser.sitecontrols.prefs", "prefsTab");
  46.  
  47.     openPrefs(PREF_SITECONTROLS);
  48. }
  49.  
  50. var currentSecurityButtonPopup = null;
  51. function CloseCurrentSecurityButtonPopup() {
  52.   try {
  53.     if(currentSecurityButtonPopup) {
  54.       document.getElementById(currentSecurityButtonPopup).hidePopup();
  55.       currentSecurityButtonPopup = null;     
  56.     } 
  57.   }
  58.   catch(ex) {
  59.   }
  60. }
  61.  
  62. function OpenSecurityButtonPopup(popupId) {
  63. //  if(currentSecurityButtonPopup) {
  64. //    CloseCurrentSecurityButtonPopup();
  65. //  }
  66.  
  67.   //balloonhelp.CancelBalloonHelpShow();
  68.   var chMenu = document.getElementById(popupId);
  69.   chMenu.showPopup(document.getElementById('securitySlider'),-1,-1,'popup','bottomright','topright');
  70.   //currentSecurityButtonPopup = popupId;
  71. }
  72.  
  73. function SecurityButtonBalloon(popupId, aButton, balloonTitle, balloonDesc) {
  74.   if(currentSecurityButtonPopup) {
  75.     // either balloon help or the drop down can show up, but not both
  76.     if(currentSecurityButtonPopup == popupId) {
  77.       // current button has an popup open, do not show the balloon
  78.       return;
  79.     }
  80.     else {
  81.       CloseCurrentSecurityButtonPopup();
  82.     }
  83.   }
  84.   
  85.   // the slider has some internal shifting effect for popups, so we need to adjust the offset of the popup position
  86.   balloonhelp.ShowBalloonHelpDelayed('',aButton,balloonTitle,balloonDesc, null, null, document.getElementById('securitySlider'), 0-240, 10);
  87. }
  88.  
  89.