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

Unified 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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« adblock-browser.html ('K') | « adblock-browser.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: adblock-browser-head.html
===================================================================
new file mode 100644
--- /dev/null
+++ b/adblock-browser-head.html
@@ -0,0 +1,223 @@
+<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.
+<meta name="title" content="Adblock Browser Beta Launch">
+<meta property="og:title" content="Adblock Browser Beta Launch">
+<meta name="description" content="Want Adblock Browser for your smartphone or tablet? Join the Adblock Browser for Android Beta Google+ community.">
+<meta property="og:description" content="Want Adblock Browser for your smartphone 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.
+
+<style type="text/css">
+*
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.
+{
+ box-sizing: content-box;
+}
+
+#content h1
+{
+ 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
+}
+
+ol
+{
+ font-size: 16px;
+ padding-left: 60px;
+}
+
+ol li
+{
+ margin-bottom: 14px;
+}
+
+#content h3.subscribe-header
+{
+ font-size: 18px;
+ margin-bottom: 14px;
+}
+
+.subscribe-description
+{
+ margin: 14px 0px 20px 0px;
+}
+
+a.button-community
+{
+ 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
+ border: solid 1px #4CAE4C;
+ border-radius: 3px;
+ background-color: #5CB85C;
+ color: #FFFFFF;
+ margin: 24px 0px 48px 0px;
+ text-align: center;
+ padding: 25px 0px;
+ 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.
+ font-weight: bold;
+ font-size: 14px;
+ text-decoration: none;
+}
+
+#subscribe-textbox
+{
+ border: solid 1px #B5B4B0;
+ 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.
+ 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.
+ font-size: 16px;
+ width: 276px;
+ 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.
+}
+
+#subscribe-textbox.placeholder
+{
+ color: #B5B4B0;
+}
+
+#subscribe-button
+{
+ border: solid 1px #357EBD;
+ border-radius: 3px;
+ background-color: #428BCA;
+ color: #FFFFFF;
+ font-size: 14px;
+ font-weight: bold;
+ 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.
+ height: 44px;
+}
+
+.disclaimer
+{
+ display: none;
+ font-size: 14px;
+ color: #000;
+ 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.
+ color: #D00;
+ border: 1px solid #D00;
+ border-radius: 5px;
+ padding: 5px;
+ margin-top: 30px;
+}
+
+html[lang="fr"] .disclaimer.lang-fr
+{
+ display: block;
+}
+
+#subscribe-form .empty-label, #subscribe-form .sucess-label,
+#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
+{
+ display: none;
+}
+
+#subscribe-form .empty-label,
+#subscribe-form .invalid-label
+{
+ margin-top: 30px;
+}
+
+#subscribe-form.success input
+{
+ display: none;
+}
+
+#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.
+{
+ display: block;
+}
+
+#subscribe-form.empty .empty-label
+{
+ display: block;
+}
+
+#subscribe-form.invalid .invalid-label
+{
+ display: block;
+}
+
+#subscribe-form.error #response-error
+{
+ display: block;
+}
+</style>
+
+<script type="text/javascript">
+function addPlaceholder(textbox)
+{
+ textbox.setAttribute("class", "placeholder");
+ 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.
+}
+
+function contentLoad()
+{
+ if (document.readyState != "interactive")
+ return;
+
+ var emailTextbox = document.getElementById("subscribe-textbox");
+
+ // textbox placeholder implementation for browsers
+ // that don't support placeholder attribute
+ 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.
+ && !emailTextbox.value)
+ {
+ addPlaceholder(emailTextbox);
+ 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.
+ {
+ if (emailTextbox.value == "Your email address")
+ {
+ emailTextbox.value = "";
+ emailTextbox.setAttribute("class", "");
+ }
+ }, false);
+
+ emailTextbox.addEventListener("blur", function()
+ {
+ if (!emailTextbox.value)
+ addPlaceholder(emailTextbox);
+ }, false);
+ }
+
+ document.getElementById("subscribe-form").addEventListener("submit", function(e)
+ {
+ e.preventDefault();
+ var formElement = document.getElementById("subscribe-form");
+ if (!emailTextbox.value)
+ {
+ formElement.setAttribute("class", "empty");
+ return;
+ }
+
+ // Simple email validation for browsers
+ // that don't support input of type email
+ var input = document.createElement("input");
+ input.setAttribute("type", "email");
+ if (input.type !== "email"
+ && !(/(.+)@(.+){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.
+ {
+ formElement.setAttribute("class", "invalid");
+ return;
+ }
+
+ 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
+ {
+ formElement.submit();
+ return;
+ }
+
+ 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.
+ var request = new XMLHttpRequest();
+ 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.
+ request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+ request.setRequestHeader("Content-length", params.length);
+ request.addEventListener("load", function()
+ {
+ 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.
+ {
+ 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.
+ }
+ else
+ {
+ 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.
+ 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.
+ }
+ }, false);
+ request.send(params);
+ }, false);
+}
+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.
+</script>
« adblock-browser.html ('K') | « adblock-browser.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld