home *** CD-ROM | disk | FTP | other *** search
- var gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- gPrefService = gPrefService.getBranch(null);
-
- // MERC (DP): Check the visibility checkbox and update site control settings
- function setDialogPref()
- {
- // Determine whether the button is checked
- checkboxCheck();
-
- // Get the passed-in parameter
- var strobj = window.arguments[0];
-
- strobj.value = "true";
- }
-
- // MERC (DP): Populate the dialog content.
- function initClearHistoriesDialog()
- {
- // Handle to the browser object
- var gbrowser = window.opener.document;
-
- // Handle to xul description element to display controlling site name
- var descElem = document.getElementById("clearHistoriesinfoblurb");
-
- descElem.setAttribute("value", "You are about to permanently clear the following from your browser: " + window.arguments[1]
- + ". Are you sure you wish to proceed?");
- }
-
- // MERC (DP): Cancelling the action means deactivating the dialog
- // if the checkbox is checked and NOT clearing histories
- function cancelAction()
- {
- // Even though you cancel, still check the visibility pref
- checkboxCheck();
- }
-
- function checkboxCheck()
- {
- // Determine whether the button is checked
- // checked = true
- var hideDialog = document.getElementById("clearHistoriescheckbox").checked;
-
- if (hideDialog) {
- gPrefService.setBoolPref("clearhistories.button.dialog",true);
- } else {
- gPrefService.setBoolPref("clearhistories.button.dialog",false);
- }
- }