Skip to content
This repository was archived by the owner on Nov 6, 2023. It is now read-only.

Commit 01a1e04

Browse files
authored
UI Patches for Immediate fixes (#17911)
* UI Patches for Immediate fixes * Design review feedback
1 parent 7a138bf commit 01a1e04

File tree

8 files changed

+68
-101
lines changed

8 files changed

+68
-101
lines changed
-888 Bytes
Binary file not shown.

chromium/pages/cancel/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ <h1 id="https-everywhere"><img src="../../images/banner-red.png" alt="HTTPS Ever
1313
<p data-i18n="cancel_he_blocking_explainer"></p>
1414

1515
<p id="url-paragraph">
16-
<span id="url-label">URL: </span><a href="#" id="url-value">PLACEHOLDER</a>
16+
<span id="url-label">URL: </span><span id="url-value">PLACEHOLDER</span>
1717
</p>
1818

1919
<form method="get" action="#" id="url-actions-form">

chromium/pages/options/index.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
<span class="section-header-span inactive" data-show="update-channels-wrapper" data-i18n="options_updateChannels"></span>
1212

1313
<div class="section-wrapper" id="general-settings-wrapper">
14-
<div id="counter-wrapper" class="settings-wrapper">
15-
<input type="checkbox" id="showCounter">
16-
<label for="showCounter" data-i18n="menu_showCounter"></label>
17-
</div>
1814
<div id="update-wrapper" class="settings-wrapper">
1915
<input type="checkbox" id="autoUpdateRulesets">
2016
<label for="autoUpdateRulesets" data-i18n="options_autoUpdateRulesets"></label>

chromium/pages/options/ux.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,21 @@
77

88
document.addEventListener("DOMContentLoaded", () => {
99

10-
const showCounter = document.getElementById("showCounter");
1110
const autoUpdateRulesets = document.getElementById("autoUpdateRulesets");
1211
const enableMixedRulesets = document.getElementById("enableMixedRulesets");
1312
const showDevtoolsTab = document.getElementById("showDevtoolsTab");
1413

1514
const defaultOptions = {
16-
showCounter: true,
1715
autoUpdateRulesets: true,
1816
enableMixedRulesets: false,
1917
showDevtoolsTab: true
2018
};
2119

2220
sendMessage("get_option", defaultOptions, item => {
23-
showCounter.checked = item.showCounter;
2421
autoUpdateRulesets.checked = item.autoUpdateRulesets;
2522
enableMixedRulesets.checked = item.enableMixedRulesets;
2623
showDevtoolsTab.checked = item.showDevtoolsTab;
2724

28-
showCounter.addEventListener("change", () => {
29-
sendMessage("set_option", { showCounter: showCounter.checked });
30-
});
31-
3225
autoUpdateRulesets.addEventListener("change", () => {
3326
sendMessage("set_option", { autoUpdateRulesets: autoUpdateRulesets.checked });
3427
});

chromium/pages/popup/index.html

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,29 +35,23 @@ <h1 id="onoffswitch_label" data-i18n="menu_globalEnable"></h1>
3535
<h1 id="HttpNowhere__header" data-i18n="menu_encryptAllSitesEligible"></h1>
3636
<input aria-hidden="true" id="http-nowhere-checkbox" type="checkbox"><label id="http-nowhere-checkbox_label" aria-label="Toggle on or off" for="http-nowhere-checkbox"></label>
3737
<h2 id="HttpNowhere__explained" data-i18n="menu_httpNoWhereExplained"></h2>
38-
<span id="HttpNowhere__see_more" class="see_more__arrow down" aria-label="Listen or See more explanation"></span>
39-
<span id="HttpNowhere__see_more--prompt" class="see_more__prompt" data-i18n="menu_seeMore"></span>
40-
<div class="see_more__content hide">
41-
<p class="see_more--clarified" data-i18n="menu_httpNoWhereMore"></p>
42-
</div>
4338
</section>
4439

4540
<section id="RuleManagement" class="settings_block">
4641
<section id="settingsForThisSite">
4742
<h1 data-i18n="chrome_settings_for_this_site_header"></h1>
48-
<img class="settingsForThisSite__gear-icon" src="../../images/icons/SettingsIcon.png" alt="gear icon" aria-hidden="true" >
4943
<h2 data-i18n="chrome_settings_for_this_site_subheader"></h2>
5044
</section>
51-
52-
<span id="RuleManagement__see_more" class="see_more__arrow down" aria-label="Listen or See more explanation"></span>
53-
<span id="RuleManagement__see_more--prompt" class="see_more__prompt" data-i18n="menu_seeMore"></span>
54-
<div class="see_more__content hide">
55-
<p class="see_more--clarified" data-i18n="chrome_settings_for_this_site_explained"></p>
56-
57-
<section id="disableEnableSection">
45+
<section id="disableEnableSection">
5846
<a href="javascript:void 0" id="disable-on-this-site" class="button" data-i18n="chrome_disable_on_this_site"></a>
5947
<a href="javascript:void 0" id="enable-on-this-site" class="button" data-i18n="chrome_enable_on_this_site"></a>
60-
</section>
48+
</section>
49+
<div id="RuleManagement__see_more--prompt" class="see_more__prompt" aria-label="Listen or See more for explanation">
50+
<span id="RuleManagement__see_more" class="see_more__arrow down"></span>
51+
<span class="see_more__text" data-i18n="menu_seeMore"></span>
52+
</div>
53+
<div class="see_more__content hide">
54+
<p class="see_more--clarified" data-i18n="chrome_settings_for_this_site_explained"></p>
6155

6256
<section id="addRuleSection">
6357
<a href="javascript:void 0" id="add-rule-link" class="button" data-i18n="chrome_add_rule"></a>

chromium/pages/popup/style.css

Lines changed: 43 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ body {
1818
header {
1919
background-color: var(--light-grey);
2020
color: var(--text-main);
21-
display: block;
21+
display: flex;
2222
padding: var(--space);
2323
}
2424

@@ -27,12 +27,12 @@ header h1 {
2727
}
2828

2929
header .logo-container {
30-
width: 100%;
31-
float: left;
30+
margin: var(--space);
31+
width: 85%;
3232
}
3333

3434
header .logo-container img {
35-
width: 70%;
35+
width: 100%;
3636
}
3737

3838
header small {
@@ -44,36 +44,41 @@ header small {
4444
width: 100%;
4545
}
4646

47-
h1,
48-
h2,
49-
h3 {
50-
font-size: 1em;
51-
}
52-
5347
h1 {
48+
font-size: 16px;
5449
margin: var(--space) auto
5550
}
5651

5752
h2 {
5853
clear: both;
54+
font-size: 12px;
5955
font-weight: normal;
6056
margin: 0;
6157
}
6258

59+
h3 {
60+
font-size: 16px;
61+
}
62+
6363
h1,
6464
h2 {
6565
color: var(--text-main);
6666
}
6767

6868
footer {
69+
display: inline-flex;
70+
margin: var(--space);
71+
}
72+
73+
footer a.button {
6974
margin: var(--space);
7075
}
7176

7277
/* Elements */
7378
.settings_block {
7479
display: inline-block;
75-
padding: 20px 1em;
76-
border-bottom: #000 solid 1px;
80+
padding: 5px 1em 20px 1em;
81+
border-bottom: var(--light-grey) solid 1px;
7782
}
7883

7984
.button {
@@ -83,7 +88,7 @@ footer {
8388
font-size: 12px;
8489
font-weight: bold;
8590
margin: var(--space) auto;
86-
padding: 15px;
91+
padding: 10px;
8792
text-align: center;
8893
text-decoration: none;
8994
}
@@ -96,23 +101,23 @@ footer {
96101
.see_more__prompt {
97102
color: var(--text-main);
98103
cursor: pointer;
99-
font-size: .9em;
104+
font-size: 12px;
100105
float: right;
101106
margin: 5px 0;
102107
}
103108

104109
.see_more__arrow {
105110
border: solid var(--darker-blue);
106111
border-width: 0 3px 3px 0;
107-
cursor: pointer;
108112
float: right;
109113
margin-left: 10px;
110-
margin-top: var(--space);
114+
margin-top: 3px;
111115
padding: 3px;
112116
}
113117

114118
.see_more__content.show p {
115-
margin: 10px 0 0 0;
119+
font-size: 12px;
120+
margin: 10px 0;
116121
}
117122

118123
.down {
@@ -196,7 +201,7 @@ input:checked+label:after {
196201
}
197202

198203
.rule.checkbox label {
199-
font-size: .9em;
204+
font-size: 12px;
200205
font-weight: normal;
201206
height: 25px;
202207
text-indent: -285px;
@@ -208,6 +213,10 @@ input:checked+label:after {
208213
width: 15px;
209214
}
210215

216+
#disable-on-this-site {
217+
clear: both;
218+
}
219+
211220
#disableButton {
212221
display: block;
213222
}
@@ -217,17 +226,17 @@ input:checked+label:after {
217226
float: left;
218227
}
219228

220-
#settingsForThisSite h1 {
221-
float: left;
229+
#RuleManagement {
230+
padding: 5px 1em 10px 1em;
222231
}
223232

224-
#settingsForThisSite img {
225-
float: right;
226-
width: 30px;
233+
#settingsForThisSite h1 {
234+
float: left;
227235
}
228236

229237
#addRuleSection label,
230238
#addRuleSection button {
239+
font-size: 14px;
231240
width: 100%;
232241
}
233242

@@ -247,11 +256,15 @@ input:checked+label:after {
247256

248257
#HttpNowhere {
249258
display: block;
250-
padding: 25px 1em;
259+
padding: 5px 1em;
251260
}
252261

253262
#StableRules h3 {
254263
float: left;
264+
margin-left: 10px;
265+
}
266+
#StableRules h2 {
267+
margin-left: 10px;
255268
}
256269
#StableRules #RuleManagement--counter {
257270
background: var(--darker-blue);
@@ -262,16 +275,16 @@ input:checked+label:after {
262275
font-size: 12px;
263276
font-weight: bold;
264277
height: 15px;
265-
margin-top: 5px;
266-
margin-right: 60%;
278+
margin-top: 10px;
279+
margin-right: 55%;
267280
padding: 5px;
268281
text-align: center;
269282
width: 15px;
270283
}
271284

272285
/* Event based */
273286
.see_more--clarified {
274-
font-size: .9em;
287+
font-size: 12px;
275288
}
276289

277290
/* Hide rules & options if the extension is off. */
@@ -302,14 +315,15 @@ section.rules {
302315
/* For "see more" content */
303316
.hide {
304317
height: 0;
305-
visibility: hidden;
306318
opacity: 0;
307319
overflow: hidden;
308320
transition: 0s;
321+
visibility: hidden;
309322
}
310323

311324
.show {
312-
visibility: visible;
325+
clear: both;
313326
opacity: 1;
314327
transition: visibility 0s linear 0s, opacity 300ms;
328+
visibility: visible;
315329
}

chromium/pages/popup/ux.js

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -33,34 +33,30 @@ function toggleRuleLine(event) {
3333
* @description Toggles content for user to view rules and explanations for different modes
3434
*/
3535
function toggleSeeMore(event) {
36-
/*
37-
@todo
38-
probably could put this all in one div so two events aren't being read for this section
39-
*/
40-
let target = event.target.parentNode.querySelector('.see_more__content');
41-
let arrow, prompt;
42-
43-
if(event.target.classList.contains('see_more__arrow')) {
44-
arrow = event.target;
45-
prompt = arrow.parentNode.querySelector('.see_more__prompt');
36+
let target = event.target;
37+
let content;
38+
39+
if (target !== this) {
40+
content = document.querySelector('.see_more__content');
4641
} else {
47-
// Reverse logic if user clicks text instead of the arrow.
48-
prompt = event.target;
49-
arrow = prompt.parentNode.querySelector('.see_more__arrow');
42+
content = target.parentNode.querySelector('.see_more__content');
5043
}
5144

45+
let arrow = target.parentNode.querySelector('.see_more__arrow');
46+
let text = target.parentNode.querySelector('.see_more__text');
47+
5248
if(arrow.classList.contains('down')) {
5349
arrow.classList.replace('down', 'up');
54-
prompt.innerText = 'See less';
50+
text.innerText = 'See less';
5551
} else if (arrow.classList.contains('up')) {
5652
arrow.classList.replace('up', 'down');
57-
prompt.innerText = 'See more';
53+
text.innerText = 'See more';
5854
}
5955

60-
if (target.classList.contains('hide')) {
61-
target.classList.replace('hide', 'show');
62-
} else if (target.classList.contains('show')) {
63-
target.classList.replace('show', 'hide');
56+
if (content.classList.contains('hide')) {
57+
content.classList.replace('hide', 'show');
58+
} else if (content.classList.contains('show')) {
59+
content.classList.replace('show', 'hide');
6460
}
6561
}
6662

@@ -193,7 +189,7 @@ function listRules(activeTab) {
193189
appendRulesToListDiv(unstableRules, e("UnstableRules"), 'unstable');
194190

195191
// Add listener to capture the toggle event
196-
e("RuleManagement").addEventListener("click", toggleRuleLine);
192+
e("add-new-rule-button").addEventListener("click", toggleRuleLine);
197193
}
198194

199195
// Only show the "Add a rule" section if we're on an HTTPS page
@@ -221,10 +217,6 @@ document.addEventListener("DOMContentLoaded", function () {
221217
updateEnabledDisabledUI();
222218
e('onoffswitch').addEventListener('click', toggleEnabledDisabled);
223219
e('http-nowhere-checkbox').addEventListener('click', toggleHttpNowhere, false);
224-
225-
e('HttpNowhere__see_more').addEventListener('click', toggleSeeMore);
226-
e('RuleManagement__see_more').addEventListener('click', toggleSeeMore);
227-
e('HttpNowhere__see_more--prompt').addEventListener('click', toggleSeeMore);
228220
e('RuleManagement__see_more--prompt').addEventListener('click', toggleSeeMore);
229221

230222
e('reset-to-defaults').addEventListener('click', () => {

test/selenium/test_options.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,3 @@ def load_options(self):
99
def test_options(self):
1010
self.load_options()
1111
self.assertEqual(self.driver.current_url, self.shim.options_url)
12-
13-
def test_show_counter(self):
14-
if self.shim.browser_type == 'chrome':
15-
raise unittest.SkipTest('broken on chrome')
16-
selector = '#showCounter'
17-
self.load_options()
18-
sleep(3)
19-
20-
el = self.query_selector(selector)
21-
self.assertTrue(el.is_selected())
22-
el.click()
23-
24-
self.driver.refresh()
25-
sleep(3)
26-
el = self.query_selector(selector)
27-
self.assertFalse(el.is_selected())
28-
el.click()
29-
30-
self.driver.refresh()
31-
sleep(3)
32-
el = self.query_selector(selector)
33-
self.assertTrue(el.is_selected())

0 commit comments

Comments
 (0)