home *** CD-ROM | disk | FTP | other *** search
/ GameStar 2005 October / Gamestar_77_2005-10_dvd.iso / Programy / nsb-install-8-0.exe / chrome / browser.jar / content / browser / clearHistoriesDecisionDialog.js < prev    next >
Encoding:
Text File  |  2005-07-29  |  1.5 KB  |  49 lines

  1. var gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
  2.                               .getService(Components.interfaces.nsIPrefService);
  3. gPrefService = gPrefService.getBranch(null);
  4.  
  5. // MERC (DP): Check the visibility checkbox and update site control settings
  6. function setDialogPref()
  7. {
  8.   // Determine whether the button is checked
  9.   checkboxCheck();
  10.  
  11.   // Get the passed-in parameter
  12.   var strobj = window.arguments[0];
  13.   
  14.   strobj.value = "true";
  15. }
  16.  
  17. // MERC (DP): Populate the dialog content.
  18. function initClearHistoriesDialog() 
  19. {  
  20.   // Handle to the browser object
  21.   var gbrowser = window.opener.document;
  22.  
  23.   // Handle to xul description element to display controlling site name
  24.   var descElem = document.getElementById("clearHistoriesinfoblurb");
  25.  
  26.   descElem.setAttribute("value", "You are about to permanently clear the following from your browser: " + window.arguments[1]
  27.                          + ". Are you sure you wish to proceed?");
  28. }
  29.  
  30. // MERC (DP): Cancelling the action means deactivating the dialog
  31. // if the checkbox is checked and NOT clearing histories
  32. function cancelAction()
  33. {
  34.   // Even though you cancel, still check the visibility pref
  35.   checkboxCheck();
  36. }
  37.  
  38. function checkboxCheck()
  39. {
  40.   // Determine whether the button is checked
  41.   // checked = true
  42.   var hideDialog = document.getElementById("clearHistoriescheckbox").checked;
  43.   
  44.   if (hideDialog) {
  45.     gPrefService.setBoolPref("clearhistories.button.dialog",true);
  46.   } else {
  47.     gPrefService.setBoolPref("clearhistories.button.dialog",false);
  48.   }
  49. }