commit 7a67c517617376f296612a5641e58e024b0aa0cc Author: Georg Koppen gk@torproject.org Date: Fri Jan 18 09:18:26 2019 +0000
Bug 29035: Post-YE campaign clean-up 2018
Removing the newsletter signup banner --- src/chrome/content/aboutTor/aboutTor-content.js | 21 ------- src/chrome/content/aboutTor/aboutTor.xhtml | 13 ----- src/chrome/content/torbutton.js | 17 ------ src/chrome/skin/aboutTor.css | 72 ------------------------ src/chrome/skin/newsletter_3x.png | Bin 6735 -> 0 bytes src/defaults/preferences/preferences.js | 1 - 6 files changed, 124 deletions(-)
diff --git a/src/chrome/content/aboutTor/aboutTor-content.js b/src/chrome/content/aboutTor/aboutTor-content.js index ff5a970b..ae20505e 100644 --- a/src/chrome/content/aboutTor/aboutTor-content.js +++ b/src/chrome/content/aboutTor/aboutTor-content.js @@ -24,7 +24,6 @@ let { bindPrefAndInit, show_torbrowser_manual } = Cu.import("resource://torbutto var AboutTorListener = { kAboutTorLoadedMessage: "AboutTor:Loaded", kAboutTorChromeDataMessage: "AboutTor:ChromeData", - kAboutTorHideTorNewsBanner: "AboutTor:HideTorNewsBanner",
get isAboutTor() { return content.document.documentURI.toLowerCase() == "about:tor"; @@ -59,24 +58,6 @@ var AboutTorListener = { } },
- setupBannerClosing: function () { - let that = this; - let closer = content.document.getElementById("tornews-banner-closer"); - closer.addEventListener("click", function () { - sendAsyncMessage(that.kAboutTorHideTorNewsBanner); - }); - let link = content.document.querySelector("#tornews-banner-message a"); - link.addEventListener("click", function () { - // Wait until page unloads so we don't hide banner before that. - content.addEventListener("unload", function () { - sendAsyncMessage(that.kAboutTorHideTorNewsBanner); - }); - }); - bindPrefAndInit("extensions.torbutton.tornews_banner_countdown", - countdown => content.document.body.setAttribute( - "show-tornews-banner", countdown > 0)); - }, - onPageLoad: function() { // Arrange to update localized text and links. bindPrefAndInit("intl.locale.requested", aNewVal => { @@ -85,8 +66,6 @@ var AboutTorListener = { } });
- this.setupBannerClosing(); - // Add message and event listeners. addMessageListener(this.kAboutTorChromeDataMessage, this); addEventListener("pagehide", this, false); diff --git a/src/chrome/content/aboutTor/aboutTor.xhtml b/src/chrome/content/aboutTor/aboutTor.xhtml index 87fe8307..ecdd0f85 100644 --- a/src/chrome/content/aboutTor/aboutTor.xhtml +++ b/src/chrome/content/aboutTor/aboutTor.xhtml @@ -31,19 +31,6 @@ window.addEventListener("pageshow", function() { </script> </head> <body dir="&locale.dir;"> - <div id="tornews-banner"> - <div><!--EMPTY SPACER DIV--></div> - <div id="tornews-banner-message"> - <div id="tornews-banner-icon"></div> - <div>&aboutTor.newsletter.tagline; - <a href="https://newsletter.torproject.org"> - &aboutTor.newsletter.link_text; - </a> - </div> - </div> - <div id="tornews-banner-closer">×</div> - </div> - <div class="torcontent-container"> <div id="torstatus-version"/> <div id="torstatus" class="top"> diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js index 03dc3563..9f6ba898 100644 --- a/src/chrome/content/torbutton.js +++ b/src/chrome/content/torbutton.js @@ -19,7 +19,6 @@ const k_tb_last_browser_version_pref = "extensions.torbutton.lastBrowserVersion" const k_tb_browser_update_needed_pref = "extensions.torbutton.updateNeeded"; const k_tb_last_update_check_pref = "extensions.torbutton.lastUpdateCheck"; const k_tb_tor_check_failed_topic = "Torbutton:TorCheckFailed"; -const k_tb_tornews_banner_countdown = "extensions.torbutton.tornews_banner_countdown";
var m_tb_prefs = Services.prefs;
@@ -232,14 +231,6 @@ function torbutton_init_toolbutton() } }
-// Show the Sign Up for Tor News banner a finite number of times. -function torbutton_tornews_banner_countdown() { - let count = m_tb_prefs.getIntPref(k_tb_tornews_banner_countdown, 0); - if (count > 0) { - m_tb_prefs.setIntPref(k_tb_tornews_banner_countdown, count - 1); - } -} - // Bug 1506 P2-P4: This code sets some version variables that are irrelevant. // It does read out some important environment variables, though. It is // called once per browser window.. This might belong in a component. @@ -348,10 +339,6 @@ function torbutton_init() { // Add about:tor IPC message listener. window.messageManager.addMessageListener("AboutTor:Loaded", torbutton_abouttor_message_handler); - window.messageManager.addMessageListener("AboutTor:HideTorNewsBanner", - torbutton_abouttor_message_handler); - - torbutton_tornews_banner_countdown();
setupPreferencesForMobile();
@@ -431,10 +418,6 @@ var torbutton_abouttor_message_handler = { aMessage.target.messageManager.sendAsyncMessage("AboutTor:ChromeData", this.chromeData); break; - case "AboutTor:HideTorNewsBanner": - torbutton_log(5, "message AboutTor:HideTorNewsBanner received"); - m_tb_prefs.setIntPref(k_tb_tornews_banner_countdown, 0); - break; } },
diff --git a/src/chrome/skin/aboutTor.css b/src/chrome/skin/aboutTor.css index ce0a2f29..2e6bab75 100644 --- a/src/chrome/skin/aboutTor.css +++ b/src/chrome/skin/aboutTor.css @@ -271,75 +271,3 @@ body:not([showmanual]) .showForManual { height: 50px; border-radius: 50px 50px 0 0; } - -/* Tor News Signup Banner - * While this banner is present, we need to - * offset the elements normally at the top of - * the window. - */ - -#tornews-banner { - display: flex; - align-items: center; - background-color: white; - color: var(--abouttor-bg-toron-color); - font-size: 16px; - height: 60px; - justify-content: space-between; - left: 0px; - right: 0px; - top: 0px; - transform: translateY(-60px); - transition: transform 200ms; -} - -body[show-tornews-banner="true"] #tornews-banner { - transform: translateY(0px); - transition: transform 0ms; -} - -#tornews-banner-message { - align-items: center; - display: flex; - justify-content: center; -} - -#tornews-banner-message a { - color: var(--abouttor-bg-toron-color); -} - -#tornews-banner-icon { - background: url('chrome://torbutton/skin/newsletter_3x.png') no-repeat center center; - background-size: cover; - height: 32px; - margin: 0px 16px; - width: 32px; -} - -#tornews-banner-closer { - display: flex; - align-items: center; - font-size: 20px; - height: 22px; - justify-content: center; - margin: 4px 20px; - padding: 4px; - width: 22px; - -moz-user-select: none; -} - -#tornews-banner-closer:hover { - background-color: gray; - cursor: pointer; -} - -body[show-tornews-banner="false"] #torstatus-version, -body[show-tornews-banner="false"] #onboarding-overlay-button { - transition: transform 200ms; -} - -body[show-tornews-banner="true"] #torstatus-version, -body[show-tornews-banner="true"] #onboarding-overlay-button { - transform: translateY(60px); - transition: transform 0ms; -} diff --git a/src/chrome/skin/newsletter_3x.png b/src/chrome/skin/newsletter_3x.png deleted file mode 100644 index 821572fa..00000000 Binary files a/src/chrome/skin/newsletter_3x.png and /dev/null differ diff --git a/src/defaults/preferences/preferences.js b/src/defaults/preferences/preferences.js index 45b60ce8..270131d2 100644 --- a/src/defaults/preferences/preferences.js +++ b/src/defaults/preferences/preferences.js @@ -6,7 +6,6 @@ pref("extensions.torbutton.logmethod",1); // 0=stdout, 1=errorconsole, 2=debuglo pref("extensions.torbutton.display_circuit", true); pref("extensions.torbutton@torproject.org.description", "chrome://torbutton/locale/torbutton.properties"); pref("extensions.torbutton.updateNeeded", false); -pref("extensions.torbutton.tornews_banner_countdown", 4);
// Tor check and proxy prefs pref("extensions.torbutton.test_enabled",true);
tbb-commits@lists.torproject.org