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 #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:
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,
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>
20 <script src="/js/vendor/bowser.js"></script>
21 <script>
22 document.addEventListener("DOMContentLoaded", function()
23 {
24 if (!bowser instanceof Object) return;
25
26 var locale = "{{ locale }}";
27
28 var contentElement = document.getElementById("content");
ire 2018/05/02 08:06:59 Coding style -> "No hungarian notation"
29
30 // Replicating server behaviour on the frontend for testing
31 if (bowser.android)
32 contentElement.classList.add("ua-android");
33
34 if (bowser.samsungBrowser)
35 {
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 });
51 </script>
52 </head>
53
1 <? include index ?> 54 <? 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