Commit 4f8bf590 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 29035: Post-YE campaign clean-up 2018

Removing the newsletter signup banner
parent 648b643c
......@@ -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);
......
......@@ -32,19 +32,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">&times;</div>
</div>
<div class="torcontent-container">
<div id="torstatus-version"/>
<img class="torcontent-logo" src="resource://torbutton-assets/torbrowser_mobile_logo.png"/>
......
......@@ -17,7 +17,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;
......@@ -222,14 +221,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);
}
}
function torbutton_is_mobile() {
return Services.appinfo.OS === "Android";
}
......@@ -342,10 +333,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();
......@@ -433,10 +420,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;
}
},
......
......@@ -282,78 +282,6 @@ body:not([showmanual]) .showForManual {
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;
}
/*
* Mobile specific css
*/
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment