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
/
pbbDecisionDialog.js
< prev
next >
Wrap
Text File
|
2006-01-06
|
2KB
|
60 lines
var gPrefService = Components.classes["@mozilla.org/preferences-service;1"]
.getService(Components.interfaces.nsIPrefService);
gPrefService = gPrefService.getBranch(null);
// MERC - JC: Check the visibility checkbox and update site control settings
function setDialogPref()
{
// Determine whether the button is checked
checkboxCheck();
// Get the passed-in parameter and update SC settings
var args = window.arguments[0];
args.doupdate = true;
}
// MERC - JC: Populate the dialog content.
function initPBBDialog()
{
// Handle to xul description element to display controlling site name
var theSite = document.getElementById("pbbSCModSite");
if (!theSite)
return;
// Get the controlling site by calling a function
// in another javascript file...
var args = window.arguments[0];
theSite.setAttribute("value", args.site);
}
// MERC - JC: Cancelling the action means deactivating the dialog
// if the checkbox is checked and NOT updating site controls
function cancelAction()
{
// Even though you cancel, still check the visibility pref
checkboxCheck();
// Get the passed-in parameter and update SC settings
var args = window.arguments[0];
args.doupdate = false;
}
function checkboxCheck()
{
try {
// Determine whether the button is checked
// checked = true
var hideDialog = document.getElementById("pbbSCcheckbox").checked;
if (hideDialog) {
gPrefService.setBoolPref("show.popupblockbutton.dialog",false);
} else {
gPrefService.setBoolPref("show.popupblockbutton.dialog",true);
}
} catch(ex) { dump("Exception in pbbDecisionDialog.js: checkboxCheck\n"); }
}