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

Delta Between Two Patch Sets: pages/android.tmpl

Issue 29766571: Fixes #55 - Updated install button on Samsung Browser for Android (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Left Patch Set: First draft Created April 30, 2018, 9:10 p.m.
Right Patch Set: Addressed #6 Created May 1, 2018, 11:34 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | static/js/vendor/bowser.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 {% block head %} 1 <head>
2 <style>
3 /* Hide TOS & Install on android page when not using Samsung Browser */
4 .android:not(.ua-samsung) #terms-message,
5 .android:not(.ua-samsung) #install,
6 /* Hide other platforms on android page when using Android */
7 .ua-andriod.android #other-platform,
ire 2018/05/02 08:06:59 Typo in "ua-android"
8 /* Hide ABB banner on android page when using Samsung Browser */
9 #content.ua-android.ua-samsung #abb-banner
10 {
11 display: none;
12 }
13
14 /* Show ABB notification under install button when using Samsung Browser */
15 #content.ua-android.ua-samsung #adblock-browser-notification
16 {
17 display: block;
18 }
19 </style>
2 <script src="/js/vendor/bowser.js"></script> 20 <script src="/js/vendor/bowser.js"></script>
3 <script> 21 <script>
4 if (bowser instanceof Object && bowser.samsungBrowser) 22 document.addEventListener("DOMContentLoaded", function()
5 { 23 {
6 // hide the Adblock Browser banner 24 if (!bowser instanceof Object) return;
7 document
8 .getElementById("content")
9 .classList.remove("ua-android");
10 25
11 // change the Android install link to Samsung Browser 26 var locale = "{{ locale }}";
12 document 27
13 .getElementById("install-android") 28 var contentElement = document.getElementById("content");
ire 2018/05/02 08:06:59 Coding style -> "No hungarian notation"
14 .href = "https://play.google.com/store/apps/details?id=org.adblockplus.a dblockplussbrowser"; 29
15 } 30 // Replicating server behaviour on the frontend for testing
16 else 31 if (bowser.android)
17 { 32 contentElement.classList.add("ua-android");
18 // hide TOS message and install button for not-samsung android browsers 33
19 document.getElementById("terms-message").style.display = "none"; 34 if (bowser.samsungBrowser)
20 document.getElementById("install").style.display = "none"; 35 {
21 } 36 // Assign more specific user agent (ua-android is already present)
37 contentElement.classList.add("ua-samsung");
38
39 // change the Android install link to Samsung Browser
40 document
41 .getElementById("install-android")
42 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser";
43
44 // update the install button text in English *only*
45 if (locale == "en")
46 document
47 .getElementById("install-android")
48 .textContent = "Agree and Install for Samsung Internet";
49 }
50 });
22 </script> 51 </script>
23 {% endblock %} 52 </head>
24 53
25 <? include index ?> 54 <? include index ?>
LEFTRIGHT

Powered by Google App Engine
This is Rietveld