Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
The Tor Project
Applications
torbutton
Commits
4ad39b36
Commit
4ad39b36
authored
Nov 20, 2018
by
Arthur Edelstein
Committed by
Georg Koppen
Dec 03, 2018
Browse files
Bug 28540: Use new text for 2018 donation banner
parent
68ad9e3d
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/chrome/content/aboutTor/aboutTor-content.js
View file @
4ad39b36
...
...
@@ -72,7 +72,7 @@ var AboutTorListener = {
sendAsyncMessage
(
that
.
kAboutTorHideDonationBanner
);
});
});
bindPrefAndInit
(
"
extensions.torbutton.donation_banner_countdown
"
,
bindPrefAndInit
(
"
extensions.torbutton.donation_banner_countdown
2
"
,
countdown
=>
{
if
(
content
.
document
&&
content
.
document
.
body
)
{
content
.
document
.
body
.
setAttribute
(
...
...
src/chrome/content/aboutTor/aboutTor.xhtml
View file @
4ad39b36
...
...
@@ -37,15 +37,17 @@ window.addEventListener("pageshow", function() {
<div
id=
"donation-banner-lines"
>
<div
id=
"donation-banner-line1"
>
&aboutTor.donationBanner.line1;
</div>
<div
id=
"donation-banner-line2"
data-
0
=
"&aboutTor.donationBanner.line2
a
;"
data-
1
=
"&aboutTor.donationBanner.line2
b
;"
data-
2
=
"&aboutTor.donationBanner.line2
c
;"
data-
3
=
"&aboutTor.donationBanner.line2
d
;"
data-
4
=
"&aboutTor.donationBanner.line2
e
;"
data-
5
=
"&aboutTor.donationBanner.line2
f
;"
>
&aboutTor.donationBanner.line2
a
;
data-
6
=
"&aboutTor.donationBanner.line2
e
;"
data-
7
=
"&aboutTor.donationBanner.line2
f
;"
data-
8
=
"&aboutTor.donationBanner.line2
g
;"
data-
9
=
"&aboutTor.donationBanner.line2
h
;"
data-
10
=
"&aboutTor.donationBanner.line2
i
;"
data-
11
=
"&aboutTor.donationBanner.line2
j
;"
>
&aboutTor.donationBanner.line2
e
;
</div>
<div
id=
"donation-banner-line3"
>
&aboutTor.donationBanner.line3;
</div>
<div
id=
"donation-banner-line3"
data-b=
"&aboutTor.donationBanner.line3b;"
>
&aboutTor.donationBanner.line3;
</div>
<a
id=
"donation-banner-button"
href=
"https://www.torproject.org/donate/donate-sin-tbd0-0"
type=
"button"
...
...
@@ -58,13 +60,17 @@ window.addEventListener("pageshow", function() {
</div>
<script
type=
"text/javascript"
>
<!
[
CDATA
[
let
lineChoice
=
Math
.
floor
(
Math
.
random
()
*
6
);
let
lineChoice
=
6
+
Math
.
floor
(
Math
.
random
()
*
6
);
let
line2
=
document
.
getElementById
(
"
donation-banner-line2
"
);
let
line2text
=
line2
.
getAttribute
(
`data-
${
lineChoice
}
`
);
let
line2pieces
=
line2text
.
split
(
"
"
);
let
line2end
=
'
<span>
'
+
line2pieces
.
pop
()
+
'
</span>
'
;
line2pieces
.
push
(
line2end
);
line2
.
innerHTML
=
line2pieces
.
join
(
"
"
);
line3
=
document
.
getElementById
(
"
donation-banner-line3
"
);
if
(
lineChoice
===
11
)
{
line3
.
innerHTML
=
line3
.
getAttribute
(
"
data-b
"
);
}
let
buttonChoice
=
Math
.
floor
(
Math
.
random
()
*
2
);
let
button
=
document
.
getElementById
(
"
donation-banner-button
"
);
button
.
innerHTML
=
button
.
getAttribute
(
`data-
${
buttonChoice
}
`
);
...
...
src/chrome/content/torbutton.js
View file @
4ad39b36
...
...
@@ -17,7 +17,7 @@ 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_donation_banner_countdown
=
"
extensions.torbutton.donation_banner_countdown
"
;
const
k_tb_donation_banner_countdown
=
"
extensions.torbutton.donation_banner_countdown
2
"
;
var
m_tb_prefs
=
Services
.
prefs
;
...
...
src/defaults/preferences/preferences.js
View file @
4ad39b36
...
...
@@ -6,7 +6,7 @@ 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.donation_banner_countdown
"
,
12
);
pref
(
"
extensions.torbutton.donation_banner_countdown
2
"
,
12
);
// Tor check and proxy prefs
pref
(
"
extensions.torbutton.test_enabled
"
,
true
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment