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

Delta Between Two Patch Sets: static/js/index.js

Issue 29841563: Noissue - Merged index_page into master (Closed) Base URL: https://hg.adblockplus.org/web.adblockplus.org
Left Patch Set: Added Samsung Internet to browsers list for translations Created July 30, 2018, 4:51 a.m.
Right Patch Set: Fixed more misc issues discussed in IRC Created July 30, 2018, 4:40 p.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
LEFTRIGHT
1 "use strict"; 1 "use strict";
2 2
3 (function() 3 (function()
4 { 4 {
5 var supportedPlatforms = { 5 var supportedPlatforms = {
6 6
7 // Desktop browsers 7 // Desktop browsers
8 "chrome": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdcc ddilifddb", 8 "chrome": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpkdaibdcc ddilifddb",
9 "opera": "https://addons.opera.com/extensions/details/opera-adblock/?display =en-US", 9 "opera": "https://addons.opera.com/extensions/details/opera-adblock/?display =en-US",
10 "yandexbrowser": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpk daibdccddilifddb", 10 "yandexbrowser": "https://chrome.google.com/webstore/detail/cfhdojbkjhnklbpk daibdccddilifddb",
(...skipping 12 matching lines...) Expand all
23 { 23 {
24 var detectedPlatform = Object.keys(supportedPlatforms) 24 var detectedPlatform = Object.keys(supportedPlatforms)
25 .find(bowser.hasOwnProperty.bind(bowser)); 25 .find(bowser.hasOwnProperty.bind(bowser));
26 26
27 if (!detectedPlatform) return; 27 if (!detectedPlatform) return;
28 28
29 document.body.classList.add(detectedPlatform); 29 document.body.classList.add(detectedPlatform);
30 30
31 if (detectedPlatform == "maxthon") return; 31 if (detectedPlatform == "maxthon") return;
32 32
33 var heroDownloadButton = document.getElementById("hero-download-button"); 33 var heroDownloadButton = document.getElementById("install-button");
34 heroDownloadButton.href = supportedPlatforms[detectedPlatform]; 34 heroDownloadButton.href = supportedPlatforms[detectedPlatform];
35 heroDownloadButton.textContent = document 35 heroDownloadButton.textContent = document
36 .getElementById("download-label-" + detectedPlatform) 36 .getElementById("download-label-" + detectedPlatform)
37 .textContent; 37 .textContent;
38 38
39 heroDownloadButton.addEventListener("click", function(event) 39 heroDownloadButton.addEventListener("click", function(event)
40 { 40 {
41 if (typeof chrome == "undefined") return; 41 if (typeof chrome == "undefined") return;
42 event.preventDefault(); 42 event.preventDefault();
43 43
44 try 44 try
45 { 45 {
46 chrome.webstore.install(); 46 chrome.webstore.install();
47 } 47 }
48 catch(error) 48 catch(error)
49 { 49 {
50 window.location = "/" + this.hreflang + "/download"; 50 window.location = "/" + this.hreflang + "/download";
51 } 51 }
52 }); 52 });
53 } 53 }
54 54
55 if (typeof bowser != "undefined") setupHeroDownloadButton(); 55 if (typeof bowser != "undefined") setupHeroDownloadButton();
56 56
57 }()); 57 }());
LEFTRIGHT

Powered by Google App Engine
This is Rietveld