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

Side by Side Diff: 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
Patch Set: Addressed #5 Created May 1, 2018, 11:23 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
« no previous file with comments | « no previous file | static/js/vendor/bowser.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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,
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 </style>
14 <script src="/js/vendor/bowser.js"></script>
15 <script>
16 document.addEventListener("DOMContentLoaded", function()
17 {
18 if (!bowser instanceof Object) return;
19
20 var locale = "{{ locale }}";
21
22 var contentElement = document.getElementById("content");
23
24 // Replicating server behaviour on the frontend for testing
25 if (bowser.android)
26 contentElement.classList.add("ua-android");
27
28 if (bowser.samsungBrowser)
29 {
30 // Assign more specific user agent (ua-android is already present)
31 contentElement.classList.add("ua-samsung");
32
33 // change the Android install link to Samsung Browser
34 document
35 .getElementById("install-android")
36 .href = "https://play.google.com/store/apps/details?id=org.adblockplus .adblockplussbrowser";
37
38 // update the install button text in English *only*
39 if (locale == "en")
40 document
41 .getElementById("install-android")
42 .textContent = "Agree and Install for Samsung Internet";
43 }
44 });
45 </script>
46 </head>
47
1 <? include index ?> 48 <? include index ?>
OLDNEW
« no previous file with comments | « no previous file | static/js/vendor/bowser.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld