 Issue 29766571:
  Fixes #55 - Updated install button on Samsung Browser for Android  (Closed) 
  Base URL: https://hg.adblockplus.org/web.adblockplus.org
    
  
    Issue 29766571:
  Fixes #55 - Updated install button on Samsung Browser for Android  (Closed) 
  Base URL: https://hg.adblockplus.org/web.adblockplus.org| Index: pages/android.tmpl | 
| =================================================================== | 
| rename from pages/android.md | 
| rename to pages/android.tmpl | 
| --- a/pages/android.md | 
| +++ b/pages/android.tmpl | 
| @@ -1,1 +1,54 @@ | 
| +<head> | 
| + <style> | 
| + /* Hide TOS & Install on android page when not using Samsung Browser */ | 
| + .android:not(.ua-samsung) #terms-message, | 
| + .android:not(.ua-samsung) #install, | 
| + /* Hide other platforms on android page when using Android */ | 
| + .ua-andriod.android #other-platform, | 
| 
ire
2018/05/02 08:06:59
Typo in "ua-android"
 | 
| + /* Hide ABB banner on android page when using Samsung Browser */ | 
| + #content.ua-android.ua-samsung #abb-banner | 
| + { | 
| + display: none; | 
| + } | 
| + | 
| + /* Show ABB notification under install button when using Samsung Browser */ | 
| + #content.ua-android.ua-samsung #adblock-browser-notification | 
| + { | 
| + display: block; | 
| + } | 
| + </style> | 
| + <script src="/js/vendor/bowser.js"></script> | 
| + <script> | 
| + document.addEventListener("DOMContentLoaded", function() | 
| + { | 
| + if (!bowser instanceof Object) return; | 
| + | 
| + var locale = "{{ locale }}"; | 
| + | 
| + var contentElement = document.getElementById("content"); | 
| 
ire
2018/05/02 08:06:59
Coding style -> "No hungarian notation"
 | 
| + | 
| + // Replicating server behaviour on the frontend for testing | 
| + if (bowser.android) | 
| + contentElement.classList.add("ua-android"); | 
| + | 
| + if (bowser.samsungBrowser) | 
| + { | 
| + // Assign more specific user agent (ua-android is already present) | 
| + contentElement.classList.add("ua-samsung"); | 
| + | 
| + // change the Android install link to Samsung Browser | 
| + document | 
| + .getElementById("install-android") | 
| + .href = "https://play.google.com/store/apps/details?id=org.adblockplus.adblockplussbrowser"; | 
| + | 
| + // update the install button text in English *only* | 
| + if (locale == "en") | 
| + document | 
| + .getElementById("install-android") | 
| + .textContent = "Agree and Install for Samsung Internet"; | 
| + } | 
| + }); | 
| + </script> | 
| +</head> | 
| + | 
| <? include index ?> |