Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: adblock-browser-head.html

Issue 4814987935612928: Issue 2213 - landing page for mobile beta launch (Closed)
Patch Set: Created April 21, 2015, 10:46 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« adblock-browser.html ('K') | « adblock-browser.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <link rel="canonical" href="https://adblockplus.org/"/>
Thomas Greiner 2015/04/21 13:31:45 This page is not a duplicate of "https://adblockpl
saroyanm 2015/04/22 15:27:08 Done.
2 <meta name="title" content="Adblock Browser Beta Launch">
3 <meta property="og:title" content="Adblock Browser Beta Launch">
4 <meta name="description" content="Want Adblock Browser for your smartphone or ta blet? Join the Adblock Browser for Android Beta Google+ community.">
5 <meta property="og:description" content="Want Adblock Browser for your smartphon e or tablet? Join the Adblock Browser for Android Beta Google+ community.">
Thomas Greiner 2015/04/21 13:31:45 Anwiki requires that each tag is closed which also
saroyanm 2015/04/22 15:27:08 Done.
6
7 <style type="text/css">
8 *
Thomas Greiner 2015/04/21 13:31:45 This style will also be applied to elements outsid
saroyanm 2015/04/22 15:27:08 Done.
9 {
10 box-sizing: content-box;
11 }
12
13 #content h1
14 {
15 margin-bottom: 28px;
Thomas Greiner 2015/04/21 13:31:45 Why is this necessary? h1 tags already have margin
saroyanm 2015/04/22 15:27:08 It's not specified, but in the style-guide image i
Thomas Greiner 2015/04/23 10:47:11 In that case please make it at least a round numer
16 }
17
18 ol
19 {
20 font-size: 16px;
21 padding-left: 60px;
22 }
23
24 ol li
25 {
26 margin-bottom: 14px;
27 }
28
29 #content h3.subscribe-header
30 {
31 font-size: 18px;
32 margin-bottom: 14px;
33 }
34
35 .subscribe-description
36 {
37 margin: 14px 0px 20px 0px;
38 }
39
40 a.button-community
41 {
42 display: block;
Thomas Greiner 2015/04/21 13:31:45 Note that making it a block element could lead to
saroyanm 2015/04/22 15:27:08 I see, hope current solution is better. Please not
Thomas Greiner 2015/04/23 10:47:11 Making the anchor tag into an inline-block and wra
43 border: solid 1px #4CAE4C;
44 border-radius: 3px;
45 background-color: #5CB85C;
46 color: #FFFFFF;
47 margin: 24px 0px 48px 0px;
48 text-align: center;
49 padding: 25px 0px;
50 width: 298px;
Thomas Greiner 2015/04/21 13:31:45 Please replace the static width with a padding to
saroyanm 2015/04/22 15:27:08 Good point.
51 font-weight: bold;
52 font-size: 14px;
53 text-decoration: none;
54 }
55
56 #subscribe-textbox
57 {
58 border: solid 1px #B5B4B0;
59 margin-right: 18px;
Thomas Greiner 2015/04/21 13:31:45 The exact pixel value is not specified in the desi
saroyanm 2015/04/22 15:27:08 Done.
60 padding-left: 10px;
Thomas Greiner 2015/04/21 13:31:45 What about `padding-right` for symmetry?
saroyanm 2015/04/22 15:27:08 Done.
61 font-size: 16px;
62 width: 276px;
63 height: 44px;
Thomas Greiner 2015/04/21 13:31:45 Using `line-height` is preferable in this case to
saroyanm 2015/04/22 15:27:08 Done.
64 }
65
66 #subscribe-textbox.placeholder
67 {
68 color: #B5B4B0;
69 }
70
71 #subscribe-button
72 {
73 border: solid 1px #357EBD;
74 border-radius: 3px;
75 background-color: #428BCA;
76 color: #FFFFFF;
77 font-size: 14px;
78 font-weight: bold;
79 width: 146px;
Thomas Greiner 2015/04/21 13:31:45 Again, using padding-left/right would ensure that
saroyanm 2015/04/22 15:27:08 Done.
80 height: 44px;
81 }
82
83 .disclaimer
84 {
85 display: none;
86 font-size: 14px;
87 color: #000;
88 text-align: left;
Thomas Greiner 2015/04/21 13:31:45 I assume this is a copy&paste leftover, right?
saroyanm 2015/04/22 15:27:08 Done.
89 color: #D00;
90 border: 1px solid #D00;
91 border-radius: 5px;
92 padding: 5px;
93 margin-top: 30px;
94 }
95
96 html[lang="fr"] .disclaimer.lang-fr
97 {
98 display: block;
99 }
100
101 #subscribe-form .empty-label, #subscribe-form .sucess-label,
102 #response-error, #subscribe-form .invalid-label
Thomas Greiner 2015/04/21 13:31:45 Note that translators won't be able to translate t
saroyanm 2015/04/22 15:27:08 As discussed, even the hidden texts are being show
Thomas Greiner 2015/04/23 10:47:11 As long as it's tested and it works, that's fine w
103 {
104 display: none;
105 }
106
107 #subscribe-form .empty-label,
108 #subscribe-form .invalid-label
109 {
110 margin-top: 30px;
111 }
112
113 #subscribe-form.success input
114 {
115 display: none;
116 }
117
118 #subscribe-form.success .sucess-label
Thomas Greiner 2015/04/21 13:31:45 You combined similar styles above in line 101 so I
saroyanm 2015/04/22 15:27:08 Done.
119 {
120 display: block;
121 }
122
123 #subscribe-form.empty .empty-label
124 {
125 display: block;
126 }
127
128 #subscribe-form.invalid .invalid-label
129 {
130 display: block;
131 }
132
133 #subscribe-form.error #response-error
134 {
135 display: block;
136 }
137 </style>
138
139 <script type="text/javascript">
140 function addPlaceholder(textbox)
141 {
142 textbox.setAttribute("class", "placeholder");
143 textbox.value = "Your email address";
Thomas Greiner 2015/04/21 13:31:45 This text is not translatable.
saroyanm 2015/04/22 15:27:08 Done.
144 }
145
146 function contentLoad()
147 {
148 if (document.readyState != "interactive")
149 return;
150
151 var emailTextbox = document.getElementById("subscribe-textbox");
152
153 // textbox placeholder implementation for browsers
154 // that don't support placeholder attribute
155 if (document.createElement("input").placeholder == undefined
Thomas Greiner 2015/04/21 13:31:45 A less error-prone way would be `!("placeholder" i
saroyanm 2015/04/22 15:27:08 Done.
156 && !emailTextbox.value)
157 {
158 addPlaceholder(emailTextbox);
159 emailTextbox.addEventListener("focus", function()
Thomas Greiner 2015/04/21 13:31:45 IE8 doesn't support `addEventListener` yet. Theref
saroyanm 2015/04/22 15:27:08 Done.
160 {
161 if (emailTextbox.value == "Your email address")
162 {
163 emailTextbox.value = "";
164 emailTextbox.setAttribute("class", "");
165 }
166 }, false);
167
168 emailTextbox.addEventListener("blur", function()
169 {
170 if (!emailTextbox.value)
171 addPlaceholder(emailTextbox);
172 }, false);
173 }
174
175 document.getElementById("subscribe-form").addEventListener("submit", function( e)
176 {
177 e.preventDefault();
178 var formElement = document.getElementById("subscribe-form");
179 if (!emailTextbox.value)
180 {
181 formElement.setAttribute("class", "empty");
182 return;
183 }
184
185 // Simple email validation for browsers
186 // that don't support input of type email
187 var input = document.createElement("input");
188 input.setAttribute("type", "email");
189 if (input.type !== "email"
190 && !(/(.+)@(.+){2,}\.(.+){2,}/.test(emailTextbox.value)))
Sebastian Noack 2015/04/22 07:52:45 Didn't we agree to leave email validation up to th
saroyanm 2015/04/22 15:27:08 Yes we did, actually I was thinking while we are s
Sebastian Noack 2015/04/23 11:57:58 Yes, we still support IE8. But IMO that doesn't me
saroyanm 2015/04/23 13:29:04 I know it would be much more easy not to support t
Sebastian Noack 2015/04/23 13:32:49 I see. Given the design, I agree that the placehol
saroyanm 2015/04/23 13:55:11 Please note that form validation is not supported
Sebastian Noack 2015/04/23 14:05:29 Oh, didn't realize.
saroyanm 2015/04/23 14:26:26 Translated error message will be nice to have feat
Sebastian Noack 2015/04/23 14:41:19 Exactly, it would be a nice to have feature, and t
saroyanm 2015/04/23 15:02:05 If I can consider only IE 8 and IE9 implementation
Sebastian Noack 2015/04/23 15:31:56 It's probably not worth further arguing whether we
saroyanm 2015/04/23 15:45:52 Sure I can response to any status code, that would
Sebastian Noack 2015/04/23 16:00:12 Server-side email validation has already been impl
saroyanm 2015/04/23 17:13:43 Done.
191 {
192 formElement.setAttribute("class", "invalid");
193 return;
194 }
195
196 if (!window.XMLHttpRequest)
Thomas Greiner 2015/04/21 13:31:45 According to https://developer.mozilla.org/en-US/d
saroyanm 2015/04/22 15:27:08 I'm preventing default on line: 177, so I assume i
Thomas Greiner 2015/04/23 10:47:11 1) We don't support IE7 anymore. 2) Did you find a
197 {
198 formElement.submit();
199 return;
200 }
201
202 var params = emailTextbox.name + "=" + emailTextbox.value;
Thomas Greiner 2015/04/21 13:31:45 I'd suggest encoding the value using `encodeURICom
saroyanm 2015/04/22 15:27:08 Done.
203 var request = new XMLHttpRequest();
204 request.open("POST", formElement.action);
Thomas Greiner 2015/04/21 13:31:45 Please add the third parameter here to explicitly
saroyanm 2015/04/22 15:27:08 Done.
205 request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded" );
206 request.setRequestHeader("Content-length", params.length);
207 request.addEventListener("load", function()
208 {
209 if (request.status == 200)
Sebastian Noack 2015/04/22 07:52:45 Since you only need to check whether the request w
saroyanm 2015/04/22 15:27:08 Done.
210 {
211 document.getElementById("subscribe-form").setAttribute("class", "success ");
Thomas Greiner 2015/04/21 13:31:45 You can just access `formElement` here.
saroyanm 2015/04/22 15:27:08 Done.
212 }
213 else
214 {
215 document.getElementById("response-error").innerHTML = request.statusText ;
Thomas Greiner 2015/04/21 13:31:45 No need to use `innerHTML` here so I'd suggest usi
saroyanm 2015/04/22 15:27:08 Done.
216 document.getElementById("subscribe-form").setAttribute("class", "error") ;
Thomas Greiner 2015/04/21 13:31:45 You can just access `formElement` here.
saroyanm 2015/04/22 15:27:08 Done.
217 }
218 }, false);
219 request.send(params);
220 }, false);
221 }
222 document.addEventListener("readystatechange", contentLoad, false);
Thomas Greiner 2015/04/21 13:31:45 I understand that this is necessary for compatibil
Thomas Greiner 2015/04/21 13:31:45 I'd prefer to have this as a fallback instead. jQu
saroyanm 2015/04/22 15:27:08 I guess this should be covered in addListener meth
Thomas Greiner 2015/04/23 10:47:11 Yep, that's right.
223 </script>
OLDNEW
« adblock-browser.html ('K') | « adblock-browser.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld