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: Addressed Sebastian comments Created April 24, 2015, 2:35 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « 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 <meta name="title" content="Adblock Browser Beta Launch" />
2 <meta property="og:title" content="Adblock Browser Beta Launch" />
3 <meta name="description" content="Want Adblock Browser for your smartphone or ta blet? Join the Adblock Browser for Android Beta Google+ community." />
4 <meta property="og:description" content="Want Adblock Browser for your smartphon e or tablet? Join the Adblock Browser for Android Beta Google+ community." />
5
6 <style type="text/css">
7 #content *
8 {
9 box-sizing: content-box;
10 }
11
12 #content h1
13 {
14 margin-bottom: 28px;
15 }
16
17 ol
18 {
19 font-size: 16px;
20 padding-left: 60px;
21 }
22
23 ol li
24 {
25 margin-bottom: 14px;
26 }
27
28 #content h3.subscribe-header
29 {
30 font-size: 18px;
31 margin-bottom: 14px;
32 }
33
34 .subscribe-description
35 {
36 margin: 14px 0px 20px 0px;
37 }
38
39 .button-community-wrapper
40 {
41 display: inline-block;
42 text-align: center;
43 border: solid 1px #4CAE4C;
44 border-radius: 3px;
45 background-color: #5CB85C;
46 margin: 10px 0px 30px 0px;
47 }
48
49 .button-community-wrapper a
50 {
51 display: block;
52 padding: 25px 20px;
53 color: #FFFFFF;
54 font-weight: bold;
55 font-size: 14px;
56 text-decoration: none;
57 }
58
59 #subscribe-textbox
60 {
61 border: solid 1px #B5B4B0;
62 margin-right: 20px;
63 padding-left: 10px;
64 padding-right: 10px;
65 font-size: 16px;
66 width: 276px;
67 line-height: 44px;
68 height: 44px; /* IE 8 */
69 }
70
71 #subscribe-textbox.placeholder
72 {
73 color: #B5B4B0;
74 }
75
76 #subscribe-button
77 {
78 border: solid 1px #357EBD;
79 border-radius: 3px;
80 background-color: #428BCA;
81 color: #FFFFFF;
82 font-size: 14px;
83 font-weight: bold;
84 min-width: 146px;
85 height: 44px;
86 }
87
88 #subscribe-button span
89 {
90 padding-left: 30px;
91 padding-right: 30px;
92 }
93
94 .disclaimer
95 {
96 display: none;
97 font-size: 14px;
98 color: #D00;
99 border: 1px solid #D00;
100 border-radius: 5px;
101 padding: 5px;
102 margin-top: 30px;
103 }
104
105 html[lang="fr"] .disclaimer.lang-fr
106 {
107 display: block;
108 }
109
110 #subscribe-form .sucess-label, #response-error,
111 #subscribe-form .invalid-label, #subscribe-form.success input,
112 #subscribe-form.success button
113 {
114 display: none;
115 }
116
117 #subscribe-form .invalid-label
118 {
119 margin-top: 30px;
120 }
121
122 #subscribe-form.success .sucess-label,
123 #subscribe-form.invalid .invalid-label,
124 #subscribe-form.error #response-error
125 {
126 display: block;
127 }
128 </style>
129
130 <script type="text/javascript">
131 //<![CDATA[
132 function addListener(obj, type, listener, useCapture)
133 {
134 if ("addEventListener" in obj)
135 {
136 obj.addEventListener(type, function(ev)
137 {
138 if (listener(ev) === false)
139 ev.preventDefault();
140 }, useCapture);
141 }
142 else
143 {
144 if (type == "DOMContentLoaded")
145 type = "readystatechange";
146
147 type = "on" + type;
148 // IE 8
149 if ("attachEvent" in obj)
150 {
151 obj.attachEvent(type, function()
152 {
153 if (document.readyState == "complete" && listener(event) === false)
154 event.returnValue = false;
155 });
156 }
157 else
158 {
159 obj[type] = listener;
160 }
161 }
162 }
163
164 function addPlaceholder(textbox)
165 {
166 textbox.setAttribute("class", "placeholder");
167 textbox.value = getPlaceholderText();
168 }
169
170 function getPlaceholderText()
171 {
172 return document.getElementById("subscribe-textbox").placeholder;
Sebastian Noack 2015/04/24 15:46:10 This won't work on browsers that don't support pla
saroyanm 2015/04/24 15:54:05 Actually I've tested it with IE8 and it works grea
173 }
174
175 function contentLoad()
176 {
177 var emailTextbox = document.getElementById("subscribe-textbox");
178
179 // textbox placeholder implementation for browsers
180 // that don't support placeholder attribute
Sebastian Noack 2015/04/24 15:46:10 Nit: You might want to name Safari iOS and IE9 her
saroyanm 2015/04/24 15:54:05 Done.
181 if (!("placeholder" in document.createElement("input"))
182 && !emailTextbox.value)
183 {
184 addPlaceholder(emailTextbox);
185 addListener(emailTextbox, "focus", function()
186 {
187 if (emailTextbox.value == getPlaceholderText())
188 {
189 emailTextbox.value = "";
190 emailTextbox.setAttribute("class", "");
191 }
192 }, false);
193
194 addListener(emailTextbox, "blur", function()
195 {
196 if (!emailTextbox.value)
197 addPlaceholder(emailTextbox);
198 }, false);
199 }
200
201 addListener(document.getElementById("subscribe-form"), "submit", function()
202 {
203 var formElement = document.getElementById("subscribe-form");
204 if (!window.XMLHttpRequest)
205 {
206 formElement.submit();
207 return false;
208 }
209
210 var params = emailTextbox.name + "=" + encodeURIComponent(emailTextbox.value );
211 var request = new XMLHttpRequest();
212 request.open("POST", formElement.action, true);
213 request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded" );
214 addListener(request, "readystatechange", function()
215 {
216 if (request.readyState == 4)
217 {
218 if (request.status >= 200 && request.status < 300)
219 {
220 formElement.setAttribute("class", "success");
221 }
222 else if (request.status == 400)
223 {
224 formElement.setAttribute("class", "invalid");
225 }
226 else
227 {
228 var errorWrapper = document.getElementById("response-error");
229 if ("textContent" in errorWrapper)
230 errorWrapper.textContent = request.statusText;
231 else // IE8
232 errorWrapper.innerText = request.statusText;
233
234 formElement.setAttribute("class", "error");
235 }
236 }
237 }, false);
238 request.send(params);
239 return false;
240 }, false);
241 }
242 addListener(document, "DOMContentLoaded", contentLoad, false);
243 //]]>
244 </script>
OLDNEW
« no previous file with comments | « adblock-browser.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld