From 6b0428948f235fcc977ab5eae068bc0839d28194 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Thu, 13 Apr 2000 05:16:10 +0000 Subject: [PATCH] remove image blocking --- modules/libpref/src/init/all.js | 2 +- .../resources/content/pref-cookies.xul | 8 +++--- .../prefwindow/resources/content/pref.js | 24 +++++++++++++++-- .../prefwindow/resources/content/preftree.xul | 2 +- .../resources/locale/en-US/pref-cookies.dtd | 9 ++++--- .../resources/locale/en-US/preftree.dtd | 3 ++- xpfe/global/resources/content/tasksOverlay.js | 26 ++++++++++++++++++- .../global/resources/content/tasksOverlay.xul | 4 +-- 8 files changed, 64 insertions(+), 14 deletions(-) diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index 1b3f2c628725..ee3fb8e047f2 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -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"); diff --git a/xpfe/components/prefwindow/resources/content/pref-cookies.xul b/xpfe/components/prefwindow/resources/content/pref-cookies.xul index 67afc5212401..9004faf4f321 100644 --- a/xpfe/components/prefwindow/resources/content/pref-cookies.xul +++ b/xpfe/components/prefwindow/resources/content/pref-cookies.xul @@ -26,8 +26,8 @@ @@ -49,7 +49,9 @@ } - + <text value="&cookies;"/> diff --git a/xpfe/components/prefwindow/resources/content/pref.js b/xpfe/components/prefwindow/resources/content/pref.js index 1b05340faf5a..7e2cb73f67f1 100644 --- a/xpfe/components/prefwindow/resources/content/pref.js +++ b/xpfe/components/prefwindow/resources/content/pref.js @@ -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] ) { diff --git a/xpfe/components/prefwindow/resources/content/preftree.xul b/xpfe/components/prefwindow/resources/content/preftree.xul index 12aa28cec24b..2b8ea64fe080 100644 --- a/xpfe/components/prefwindow/resources/content/preftree.xul +++ b/xpfe/components/prefwindow/resources/content/preftree.xul @@ -189,7 +189,7 @@ - + diff --git a/xpfe/components/prefwindow/resources/locale/en-US/pref-cookies.dtd b/xpfe/components/prefwindow/resources/locale/en-US/pref-cookies.dtd index 2cfdebc3afaa..fbdaa2e9d744 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/pref-cookies.dtd +++ b/xpfe/components/prefwindow/resources/locale/en-US/pref-cookies.dtd @@ -1,9 +1,12 @@ - - + + + + - + + diff --git a/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd b/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd index 03518c48f5b5..3bae75cfc268 100644 --- a/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd +++ b/xpfe/components/prefwindow/resources/locale/en-US/preftree.dtd @@ -25,7 +25,8 @@ - + + diff --git a/xpfe/global/resources/content/tasksOverlay.js b/xpfe/global/resources/content/tasksOverlay.js index 8e9852512b7b..ebdb7dd48d0c 100644 --- a/xpfe/global/resources/content/tasksOverlay.js +++ b/xpfe/global/resources/content/tasksOverlay.js @@ -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 diff --git a/xpfe/global/resources/content/tasksOverlay.xul b/xpfe/global/resources/content/tasksOverlay.xul index 97746a0f292a..f7d69446880e 100644 --- a/xpfe/global/resources/content/tasksOverlay.xul +++ b/xpfe/global/resources/content/tasksOverlay.xul @@ -35,7 +35,7 @@ - + @@ -50,7 +50,7 @@ - +