Skip to content

Commit 0976778

Browse files
committed
Merge pull request #2787
Update Disable and Report buttons, make Donate button into a link.
2 parents 1493462 + 92ff219 commit 0976778

File tree

5 files changed

+78
-69
lines changed

5 files changed

+78
-69
lines changed

src/_locales/en_US/messages.json

+33-33
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
{
2+
"name": {
3+
"message": "Privacy Badger",
4+
"description": ""
5+
},
6+
"description": {
7+
"message": "Privacy Badger automatically learns to block invisible trackers.",
8+
"description": ""
9+
},
10+
"popup_disable_for_site": {
11+
"message": "Disable for this site",
12+
"description": "Button in the popup."
13+
},
14+
"popup_enable_for_site": {
15+
"message": "Enable for this site",
16+
"description": "Button in the popup, visible if Privacy Badger is disabled on the current site"
17+
},
18+
"report_broken_site": {
19+
"message": "Report broken site",
20+
"description": "Button in the popup."
21+
},
22+
"version": {
23+
"message": "version $VERSION_STRING$",
24+
"description": "Shows Privacy Badger's version in the popup. For example, \"version 2018.8.1\".",
25+
"placeholders": {
26+
"version_string": {
27+
"content": "$1",
28+
"example": "2018.8.1"
29+
}
30+
}
31+
},
232
"badger_status_block": {
333
"message": "Blocked $DOMAIN$",
434
"description": "Tooltip shown when you hover over a domain name with a red slider in the list of domains in the popup or under the Tracking Domains tab on the options page.",
@@ -37,7 +67,7 @@
3767
},
3868
"donate_to_eff": {
3969
"message": "Donate to EFF",
40-
"description": "Button shown in the popup and on the intro page."
70+
"description": "Link shown in the popup; also a button on the intro page"
4171
},
4272
"intro_donate_subheading": {
4373
"message": "Help us by donating and sharing your support for our tools",
@@ -218,8 +248,8 @@
218248
"description": "Tooltip that comes up when you hover over the 'tracking domains' link under the Tracking Domains tab on the options page."
219249
},
220250
"intro_report_button": {
221-
"message": "Please don't forget to click on 'Did Privacy Badger break this site'. We respect your privacy so we don't send automatic reports.",
222-
"description": "Intro page paragraph. The quoted message ('Did Privacy Badger break this site') should match the first part of the translation for the 'report_broken_site' message."
251+
"message": "Please don't forget to click on 'Report broken site'. We respect your privacy so we don't send automatic reports.",
252+
"description": "Intro page paragraph. The quoted message ('Report broken site') should match the translation for the 'report_broken_site' message."
223253
},
224254
"options_title": {
225255
"message": "Privacy Badger Options",
@@ -229,10 +259,6 @@
229259
"message": "This will automatically send the following information to EFF: the page you're currently visiting, your browser version, the version of Privacy Badger, and the state of all of the sliders on this page.",
230260
"description": ""
231261
},
232-
"popup_enable_for_site": {
233-
"message": "Enable Privacy Badger for this site",
234-
"description": ""
235-
},
236262
"options_domain_type_filter": {
237263
"message": "Filter by type:",
238264
"description": "Label for a dropdown control on the Tracking Domains options page tab."
@@ -301,16 +327,6 @@
301327
"message": "Take the tour",
302328
"description": "Intro page welcome button."
303329
},
304-
"version": {
305-
"message": "version $VERSION_STRING$",
306-
"description": "Shows Privacy Badger's version in the popup. For example, \"version 2018.8.1\".",
307-
"placeholders": {
308-
"version_string": {
309-
"content": "$1",
310-
"example": "2018.8.1"
311-
}
312-
}
313-
},
314330
"badger_status_cookieblock": {
315331
"message": "Blocked cookies from $DOMAIN$",
316332
"description": "Tooltip shown when you hover over a domain name with a yellow slider in the list of domains in the popup or under the Tracking Domains tab on the options page.",
@@ -333,10 +349,6 @@
333349
"message": "Please select a file to import.",
334350
"description": ""
335351
},
336-
"report_broken_site": {
337-
"message": "Did Privacy Badger break this site? Let us know!",
338-
"description": "Button in the popup."
339-
},
340352
"tooltip_cookieblock": {
341353
"message": "Center the slider to block cookies",
342354
"description": ""
@@ -475,10 +487,6 @@
475487
"message": "Move the slider right to allow a domain",
476488
"description": ""
477489
},
478-
"popup_disable_for_site": {
479-
"message": "Disable Privacy Badger for this site",
480-
"description": "Button in the popup."
481-
},
482490
"intro_privacy_note": {
483491
"message": "Privacy Badger will NEVER share data about your browsing unless you choose to share it.",
484492
"description": "Intro page paragraph."
@@ -504,10 +512,6 @@
504512
"message": "Privacy Badger hasn't detected any <a target='_blank' tabindex=-1 title='i18n_what_is_a_tracker' class='tooltip' href='https://www.eff.org/privacybadger#faq-What-is-a-third-party-tracker?'>tracking domains</a> yet. Keep browsing!",
505513
"description": "Shown on the Tracking Domains tab on the options page if all tracking domains have been removed."
506514
},
507-
"name": {
508-
"message": "Privacy Badger",
509-
"description": ""
510-
},
511515
"intro_not_an_adblocker_paragraph": {
512516
"message": "Privacy Badger starts blocking once it sees the same tracker on three different websites. Three strikes and it's out!",
513517
"description": "Intro page paragraph."
@@ -560,10 +564,6 @@
560564
"message": "Share on Facebook",
561565
"description": "Text that comes up when you hover over the social sharing buttons on the intro page."
562566
},
563-
"description": {
564-
"message": "Privacy Badger automatically learns to block invisible trackers.",
565-
"description": ""
566-
},
567567
"report_fail": {
568568
"message": "Oops. Something went wrong.",
569569
"description": ""

src/js/popup.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,6 @@ function init() {
173173

174174
$("#activate_site_btn").on("click", activateOnSite);
175175
$("#deactivate_site_btn").on("click", deactivateOnSite);
176-
$("#donate").on("click", function() {
177-
chrome.tabs.create({
178-
url: "https://supporters.eff.org/donate/support-privacy-badger"
179-
});
180-
});
181176

182177
$('#error_input').on('input propertychange', function() {
183178
// No easy way of sending message on popup close, send message for every change
@@ -393,16 +388,15 @@ function send_error(message) {
393388
* activate PB for site event handler
394389
*/
395390
function activateOnSite() {
396-
$("#activate_site_btn").toggle();
397-
$("#deactivate_site_btn").toggle();
398-
$("#blockedResourcesContainer").show();
391+
$("#activate_site_btn").prop("disabled", true);
399392

400393
chrome.runtime.sendMessage({
401394
type: "activateOnSite",
402395
tabHost: POPUP_DATA.tabHost,
403396
tabId: POPUP_DATA.tabId,
404397
tabUrl: POPUP_DATA.tabUrl
405398
}, () => {
399+
// reload tab and close popup
406400
chrome.tabs.reload(POPUP_DATA.tabId);
407401
window.close();
408402
});
@@ -412,16 +406,15 @@ function activateOnSite() {
412406
* de-activate PB for site event handler
413407
*/
414408
function deactivateOnSite() {
415-
$("#activate_site_btn").toggle();
416-
$("#deactivate_site_btn").toggle();
417-
$("#blockedResourcesContainer").hide();
409+
$("#deactivate_site_btn").prop("disabled", true);
418410

419411
chrome.runtime.sendMessage({
420412
type: "deactivateOnSite",
421413
tabHost: POPUP_DATA.tabHost,
422414
tabId: POPUP_DATA.tabId,
423415
tabUrl: POPUP_DATA.tabUrl
424416
}, () => {
417+
// reload tab and close popup
425418
chrome.tabs.reload(POPUP_DATA.tabId);
426419
window.close();
427420
});

src/lib/i18n.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function setTextDirection() {
5656
// popup page
5757
if (ON_POPUP) {
5858
// fix floats
59-
['#badger-header-logo', '#header-image-stack', '#header-image-stack a', '#header-image-stack img', '#version'].forEach((selector) => {
59+
['#badger-header-logo', '#header-image-stack', '#header-image-stack a', '#header-image-stack img'].forEach((selector) => {
6060
toggle_css_value(selector, "float", "left", "right");
6161
});
6262
['#fittslaw', '#options', '#help', '#share', '.overlay_close'].forEach((selector) => {

src/skin/popup.css

+30-17
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ a { text-decoration: none }
5252

5353
a:hover { color: #ec9329 }
5454

55-
.clear {
56-
clear: both;
55+
button {
56+
/* needed for Firefox */
57+
color: #333;
5758
}
5859

5960
.clicker {
@@ -168,12 +169,15 @@ a:hover { color: #ec9329 }
168169
}
169170

170171
/* body#main to avoid applying this to options page */
171-
body#main #blockedResourcesContainer {
172+
body#main #blockedResourcesContainer, #special-browser-page, #disabled-site-message {
172173
flex: 1;
173174
display: flex;
174175
flex-direction: column;
175176
justify-content: center;
176177
}
178+
#special-browser-page, #disabled-site-message {
179+
text-align: center;
180+
}
177181

178182
button.cta-button, a.cta-button {
179183
background-color: #ff641c;
@@ -291,12 +295,12 @@ button.cta-button:hover, a.cta-button:hover {
291295
margin: 0;
292296
}
293297
/* body#main to avoid applying this to options page */
294-
body#main #pbInstructions a, #firstparty-protections-container a, #webrtc-deprecation-div a {
298+
body#main #pbInstructions a, #firstparty-protections-container a, #webrtc-deprecation-div a, #donate a {
295299
text-decoration: underline;
296300
color: black;
297301
font-weight: bold;
298302
}
299-
body#main #pbInstructions a:hover, #firstparty-protections-container a:hover, #webrtc-deprecation-div a:hover {
303+
body#main #pbInstructions a:hover, #firstparty-protections-container a:hover, #webrtc-deprecation-div a:hover, #donate a:hover {
300304
color: #ec9329;
301305
}
302306
#instructions-firstparty-description {
@@ -306,11 +310,6 @@ body#main #pbInstructions a:hover, #firstparty-protections-container a:hover, #w
306310
padding: 8px;
307311
font-size: 12px;
308312
}
309-
#special-browser-page, #disabled-site-message {
310-
text-align: center;
311-
margin: 40px 0;
312-
padding: 0;
313-
}
314313
#no-third-parties {
315314
display: block;
316315
font-size: 12px;
@@ -334,12 +333,14 @@ body#main #pbInstructions a:hover, #firstparty-protections-container a:hover, #w
334333
/* fix overly bold text on macOS */
335334
-webkit-font-smoothing: antialiased;
336335
-moz-osx-font-smoothing: grayscale;
337-
line-height: 16px;
338336
margin-top: 8px;
339337
padding: 10px;
340338
text-align: center;
341339
width: 49%;
342340
}
341+
.pbButton:not(:disabled):active {
342+
transform: translateY(1px);
343+
}
343344
.pbButton:hover:enabled {
344345
border: 2px solid #F06A0A;
345346
}
@@ -348,8 +349,11 @@ body#main #pbInstructions a:hover, #firstparty-protections-container a:hover, #w
348349
color: #666;
349350
cursor: auto;
350351
}
351-
#donate {
352-
width: 100%;
352+
#deactivate_site_btn, #activate_site_btn, #error {
353+
font-size: 16px;
354+
}
355+
#error .ui-icon {
356+
font-size: 12px;
353357
}
354358

355359
#not-yet-blocked-header, #non-trackers-header {
@@ -439,11 +443,19 @@ div.overlay.active {
439443
font-size: 13px;
440444
}
441445

442-
#version{
443-
color: #707070;
444-
font-size: 10px;
445-
float: left;
446+
#version {
447+
color: #707070;
448+
font-size: 10px;
449+
position: absolute;
450+
bottom: 5px;
451+
}
452+
#donate {
453+
font-size: 14px;
454+
margin: 5px 0;
455+
padding: 10px;
456+
text-align: center;
446457
}
458+
447459
.faded-bw-color-scheme {
448460
filter: grayscale(1) opacity(0.6);
449461
}
@@ -554,6 +566,7 @@ div.overlay.active {
554566
body#main #pbInstructions a,
555567
#firstparty-protections-container a,
556568
#webrtc-deprecation-div a,
569+
#donate a,
557570
#pbInstructions,
558571
.toggle-header-title,
559572
#special-browser-page,

src/skin/popup.html

+10-7
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ <h1 id="share_title" class="i18n_share_title overlay_title"></h1>
129129
<h2 id="title-name"><span class="i18n_name"></span></h2>
130130
</div>
131131
</div>
132-
<div class='clear'></div>
133132
</div>
134133

135134
<div id="firstparty-protections-container" style="display:none">
@@ -172,12 +171,16 @@ <h2 id="title-name"><span class="i18n_name"></span></h2>
172171
</div>
173172

174173
<div id="siteControls">
175-
<button id="deactivate_site_btn" class="i18n_popup_disable_for_site pbButton"></button>
176-
<button id="activate_site_btn" class="i18n_popup_enable_for_site pbButton" style="display:none"></button>
177-
<button id="error" class="i18n_report_broken_site pbButton"></button>
178-
<button id="donate" class="pbButton" target="_blank"><span class="ui-icon ui-icon-heart" style="color:#ec1e1e"></span> <span class="i18n_donate_to_eff"></span></button>
174+
<button id="deactivate_site_btn" class="pbButton"><span class="ui-icon ui-icon-power"></span> <span class="i18n_popup_disable_for_site"></span></button>
175+
<button id="activate_site_btn" class="pbButton" style="display:none"><span class="ui-icon ui-icon-power"></span> <span class="i18n_popup_enable_for_site"></span></button>
176+
<button id="error" class="pbButton"><span class="ui-icon ui-icon-mail-send"></span> <span class="i18n_report_broken_site"></span></button>
179177
</div>
180-
<span id="version" class="i18n_version"></span>
181-
<div class='clear'></div>
178+
179+
<footer>
180+
<div id="donate">
181+
<a href="https://supporters.eff.org/donate/support-privacy-badger" target="_blank"><span class="ui-icon ui-icon-heart" style="color:#ec1e1e"></span> <span class="i18n_donate_to_eff"></span></a>
182+
</div>
183+
<div id="version" class="i18n_version"></div>
184+
</footer>
182185
</body>
183186
</html>

0 commit comments

Comments
 (0)