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

Unified Diff: static/poland/js/index.js

Issue 29800606: Fixes #91 - Homepage duplicate in Polish for SEM (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Patch Set: Created June 6, 2018, 5:37 p.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
Index: static/poland/js/index.js
===================================================================
new file mode 100644
--- /dev/null
+++ b/static/poland/js/index.js
@@ -0,0 +1,57 @@
+"use strict";
+
+(function()
+{
+ var supportedPlatforms = {
+
+ // Desktop browsers
+ "chrome": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdccddilifddb",
+ "opera": "https://addons.opera.com/extensions/details/opera-adblock/?display=en-US",
+ "yandexbrowser": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdccddilifddb",
+ "msie": "https://update.adblockplus.org/latest/adblockplusie.exe",
+ "msedge": "https://www.microsoft.com/store/p/adblock-plus/9nblggh4r9nz",
+ "firefox": "https://update.adblockplus.org/latest/adblockplusfirefox.xpi",
+ "safari": "https://update.adblockplus.org/latest/adblockplussafari.safariextz",
+ "maxthon": "",
+
+ // Mobile platforms
+ "ios": "https://eyeo.to/adblockbrowser/ios/abp-website",
+ "android": "https://eyeo.to/adblockbrowser/android/abp-website"
+ };
+
+ function setupHeroDownloadButton()
+ {
+ var detectedPlatform = Object.keys(supportedPlatforms)
+ .find(bowser.hasOwnProperty.bind(bowser));
+
+ if (!detectedPlatform) return;
+
+ document.body.classList.add(detectedPlatform);
+
+ if (detectedPlatform == "maxthon") return;
+
+ var heroDownloadButton = document.getElementById("hero-download-button");
+ heroDownloadButton.href = supportedPlatforms[detectedPlatform];
+ heroDownloadButton.textContent = document
+ .getElementById("download-label-" + detectedPlatform)
+ .textContent;
+
+ heroDownloadButton.addEventListener("click", function(event)
+ {
+ if (typeof chrome == "undefined") return;
+ event.preventDefault();
+
+ try
+ {
+ chrome.webstore.install();
+ }
+ catch(error)
+ {
+ window.location = "/" + this.hreflang + "/download";
+ }
+ });
+ }
+
+ if (typeof bowser != "undefined") setupHeroDownloadButton();
+
+}());
« static/poland.html ('K') | « static/poland/js/bowser.js ('k') | static/poland/js/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld