bloody hell. backing out the rest of popup manager because of a suspected Txul regression. bug 167929

This commit is contained in:
danm%netscape.com 2006-07-27 14:56:40 +00:00
parent 29363ec7de
commit e5bfd3c07f
2 changed files with 5 additions and 78 deletions

View File

@ -32,10 +32,7 @@
<![CDATA[
/******* THE FOLLOWING IS FOR THE TASKMENU OVERLAY *******/
// both are necessary. popupmanager is just a special case
// of permissionmanager but does extra work on add/remove
var permissionmanager;
var popupmanager;
// Remove the image entries from the task menu
function HideImage() {
@ -44,18 +41,6 @@
element.setAttribute("style","display: none;" );
element.setAttribute("disabled","true" );
}
// Remove the popup entries from the task menu
function HidePopups(hide) {
var element;
element = document.getElementById("popup");
if (hide) {
element.setAttribute("hidden", "true");
element.setAttribute("disabled", "true");
} else {
element.removeAttribute("hidden");
element.removeAttribute("disabled");
}
}
// for some unexplainable reason, CheckForImage() keeps getting called repeatedly
// as we mouse over the task menu. IMO, that shouldn't be happening. To avoid
@ -67,14 +52,10 @@
function CheckForVisibility()
{
// obtain access to permissionmanager and popupmanager
// (popup manager is a wrapper around permission that does extra work)
// obtain access to permissionmanager module
permissionmanager =
Components.classes["@mozilla.org/permissionmanager;1"]
.getService(Components.interfaces.nsIPermissionManager);
popupmanager =
Components.classes["@mozilla.org/PopupWindowManager;1"]
.getService(Components.interfaces.nsIPopupWindowManager);
if (!("_content" in window) || !window._content) {
// this occurs if doing tasks->privacy->cookie->block from java console
return;
@ -107,35 +88,16 @@
disableElement.setAttribute("disabled","true");
enableElement.removeAttribute("disabled");
if (popupmanager.testPermission(getBrowser().currentURI) == Components.interfaces.nsIPopupWindowManager.eDisallow) {
disableElement = document.getElementById("BlockPopups");
enableElement = document.getElementById("AllowPopups");
} else {
disableElement = document.getElementById("AllowPopups");
enableElement = document.getElementById("BlockPopups");
}
disableElement.setAttribute("disabled","true");
if (popupmanager.testSuitability(getBrowser().currentURI))
enableElement.removeAttribute("disabled");
else
enableElement.setAttribute("disabled","true");
var pref;
pref = Components.classes['@mozilla.org/preferences-service;1'];
pref = pref.getService();
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
// try {
// HidePopups(!pref.getBoolPref("dom.disable_open_during_load"));
// } catch(e) {
HidePopups(true);
// }
// determine if image manager should be in the UI
if (alreadyCheckedForImage) {
return;
}
alreadyCheckedForImage = true;
// remove image functions (unless overruled by the "imageblocker.enabled" pref)
var pref;
pref = Components.classes['@mozilla.org/preferences-service;1'];
pref = pref.getService();
pref = pref.QueryInterface(Components.interfaces.nsIPrefBranch);
try {
if (!pref.getBoolPref("imageblocker.enabled")) {
HideImage();
@ -174,16 +136,6 @@
element = document.getElementById("BlockImages");
alert(element.getAttribute("msg"));
break;
case "popupAllow":
popupmanager.add(getBrowser().currentURI, true);
element = document.getElementById("AllowPopups");
alert(element.getAttribute("msg"));
break;
case "popupBlock":
popupmanager.add(getBrowser().currentURI, false);
element = document.getElementById("BlockPopups");
alert(element.getAttribute("msg"));
break;
default:
}
}
@ -230,24 +182,5 @@
oncommand="viewImages();"/>
</menupopup>
</menu>
<menu label="&cookiePopupManager.label;"
accesskey="&cookiePopupManager.accesskey;"
id="popup"
insertbefore="navBeginGlobalItems">
<menupopup>
<menuitem id="BlockPopups" label="&cookieBlockPopupsCmd.label;"
accesskey="&cookieBlockPopupsCmd.accesskey;"
msg="&cookieBlockPopupsMsg.label;"
oncommand="CookieImageAction('popupBlock');"/>
<menuitem id="AllowPopups" label="&cookieAllowPopupsCmd.label;"
accesskey="&cookieAllowPopupsCmd.accesskey;"
msg="&cookieAllowPopupsMsg.label;"
oncommand="CookieImageAction('popupAllow');"/>
<menuseparator/>
<menuitem label="&cookieDisplayPopupsCmd.label;"
accesskey="&cookieDisplayPopupsCmd.accesskey;"
oncommand="viewPopups();"/>
</menupopup>
</menu>
</menupopup>
</overlay>

View File

@ -20,18 +20,12 @@
var COOKIEPERMISSION = 0;
var IMAGEPERMISSION = 1;
var WINDOWPERMISSION = 2;
function viewImages() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "imageManager" );
}
function viewPopups() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "popupManager" );
}
function viewCookies() {
window.openDialog("chrome://communicator/content/wallet/CookieViewer.xul","_blank",
"chrome,resizable=yes", "cookieManager");