remove image blocking

This commit is contained in:
morse%netscape.com 2000-04-13 05:16:10 +00:00
parent e18fe941f0
commit 6b0428948f
8 changed files with 64 additions and 14 deletions

View File

@ -279,7 +279,7 @@ pref("wallet.fetchPatches", false);
pref("wallet.Server", "http://www.mozilla.org/wallet/tables/");
pref("wallet.version", "1");
pref("wallet.enabled", true);
pref("imageblocker.enabled", true);
pref("imageblocker.enabled", false);
pref("messages.new_window", true); // ML obsolete; use mailnews.message_in_thread_window
pref("intl.accept_languages", "en");
pref("intl.accept_charsets", "iso-8859-1,*,utf-8");

View File

@ -26,8 +26,8 @@
<window debug="false" xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
class="dialog"
align="vertical" title="&window.title;"
class="dialog" id="cookieWindow"
align="vertical" title="&window.title;" titleWithImages="&window.titleWithImages;"
onload="if( parent.handle ) parent.handle.onpageload( 'pref-cookies' ); else parent.queuedTag = 'pref-cookies';">
<html:script language="JavaScript">
@ -49,7 +49,9 @@
}
</html:script>
<box type="smallheader" title="&lHeader;" description="&rHeader;"/>
<box id="cookieHeader" type="smallheader"
title="&lHeader;" titleWithImages="&lHeaderWithImages;"
description="&rHeader;" descriptionWithImages="&rHeaderWithImages;"/>
<titledbox orient="vertical">
<title><text value="&cookies;"/></title>

View File

@ -81,7 +81,18 @@ function PREF_onload()
// this.wsm.PageData.splice(0); // brutally empty the PageData Array
if( window.queuedTag )
this.onpageload( window.queuedTag );
// enable image blocker if "imageblocker.enabled" pref is true
try {
if (this.pref.GetBoolPref("imageblocker.enabled")) {
element = document.getElementById("cookiesCell");
valueWithImages = element.getAttribute("valueWithImages");
element.setAttribute("value",valueWithImages);
}
} catch(e) {
dump("imageblocker.enabled pref is missing from all.js");
}
}
function PREF_onok()
@ -314,10 +325,19 @@ function PREF_onpageload( tag )
if (tag == "pref-cookies") {
element = window.frames[this.contentFrame].document.getElementById("imagesArea");
element.setAttribute("style","display: inline;" );
element = window.frames[this.contentFrame].document.getElementById("cookieHeader");
titleWithImages = element.getAttribute("titleWithImages");
element.setAttribute("title",titleWithImages);
descriptionWithImages = element.getAttribute("descriptionWithImages");
element.setAttribute
("description",descriptionWithImages );
element = window.frames[this.contentFrame].document.getElementById("cookieWindow");
titleWithImages = element.getAttribute("titleWithImages");
element.setAttribute("title",titleWithImages);
}
}
} catch(e) {
// dump("imageblocker.enabled pref is missing from all.js");
dump("imageblocker.enabled pref is missing from all.js");
}
if( !this.wsm.PageData[tag] ) {

View File

@ -189,7 +189,7 @@
<treechildren>
<treeitem open="true">
<treerow>
<treecell indent="true" url="chrome://pref/content/pref-cookies.xul" value="&cookies.label;"/>
<treecell indent="true" url="chrome://pref/content/pref-cookies.xul" value="&cookies.label;" valueWithImages="&cookies.labelWithImages;" id="cookiesCell"/>
</treerow>
</treeitem>

View File

@ -1,9 +1,12 @@
<!-- LOCALIZATION NOTE : FILE Cookie management prefs -->
<!ENTITY window.title "Cookies/Images">
<!ENTITY lHeader "Cookies/Images">
<!ENTITY window.title "Cookies">
<!ENTITY window.titleWithImages "Cookies/Images">
<!ENTITY lHeader "Cookies">
<!ENTITY lHeaderWithImages "Cookies/Images">
<!ENTITY remSignCheck.label "Automatically prefill usernames and passwords">
<!ENTITY rHeader "Manage cookies and images stored on your computer">
<!ENTITY rHeader "Manage cookies stored on your computer">
<!ENTITY rHeaderWithImages "Manage cookies/images stored on your computer">
<!ENTITY cookies "Cookies">
<!ENTITY accAllCookiesRadio.label "Accept all cookies">
<!ENTITY accAllCookiesRadio.accesskey "a">

View File

@ -25,7 +25,8 @@
<!ENTITY offline.label "Offline">
<!ENTITY advance.label "Advanced">
<!ENTITY down.label "Download">
<!ENTITY cookies.label "Cookies and Images">
<!ENTITY cookies.label "Cookies">
<!ENTITY cookies.labelWithImages "Cookies and Images">
<!ENTITY wallet.label "Forms and Passwords">
<!ENTITY cache.label "Cache">
<!ENTITY proxies.label "Proxies">

View File

@ -240,7 +240,21 @@ function HideWallet() {
element.setAttribute("disabled","true" );
}
function CheckForWallet()
function HideImage() {
var element;
element = document.getElementById("image");
element.setAttribute("style","display: none;" );
element.setAttribute("disabled","true" );
}
function HideImage() {
var element;
element = document.getElementById("image");
element.setAttribute("style","display: none;" );
element.setAttribute("disabled","true" );
}
function CheckForWalletAndImage()
{
// remove wallet functions if not in browser
try {
@ -259,6 +273,16 @@ function CheckForWallet()
} catch(e) {
dump("wallet.enabled pref is missing from all.js\n");
}
// remove image functions (unless overruled by the "imageblocker.enabled" pref)
try {
if (!this.pref.GetBoolPref("imageblocker.enabled")) {
HideImage();
}
} catch(e) {
dump("imageblocker.enabled pref is missing from all.js\n");
}
}
// perform a wallet action

View File

@ -35,7 +35,7 @@
<menuseparator/>
<menu value="&walletMenu.label;">
<menupopup id="personalManagers" oncreate="CheckForWallet()">
<menupopup id="personalManagers" oncreate="CheckForWalletAndImage()">
<menu value="&walletPasswordManager.label;">
<menupopup>
<menuitem value="&walletDisplaySignonsCmd.label;" oncommand="WalletDialog('signon');"/>
@ -50,7 +50,7 @@
<menuitem value="&walletBlockCookiesCmd.label;" oncommand="WalletAction('cookieBlock');"/>
</menupopup>
</menu>
<menu value="&walletImageManager.label;">
<menu value="&walletImageManager.label;" id="image">
<menupopup>
<menuitem value="&walletDisplayImagesCmd.label;" oncommand="WalletDialog('image');"/>
<menuitem value="&walletAllowImagesCmd.label;" oncommand="WalletAction('imageAllow');"/>