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

Side by Side Diff: firstRun.js

Issue 5244235691327488: Issue 2072 - Don`t duplicate 128x128 icon in Chrome builds (Closed)
Patch Set: Created March 2, 2015, 2:12 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 { 50 {
51 ext.backgroundPage.sendMessage({ 51 ext.backgroundPage.sendMessage({
52 type: "app.get", 52 type: "app.get",
53 what: "doclink", 53 what: "doclink",
54 link: link 54 link: link
55 }, callback); 55 }, callback);
56 } 56 }
57 57
58 function onDOMLoaded() 58 function onDOMLoaded()
59 { 59 {
60 // Set up logo image
61 var logo = E("logo");
62 logo.src = "skin/abp-128.png";
Sebastian Noack 2015/03/02 14:25:02 Can't you specify that URL in firstRun.html? DOMCo
Wladimir Palant 2015/03/02 14:28:51 No, that's not guaranteed. Over the web the browse
63 var errorCallback = function()
Sebastian Noack 2015/03/02 14:25:02 Why an anonymous function?
Wladimir Palant 2015/03/02 14:28:51 What exactly are you suggesting? A global function
Sebastian Noack 2015/03/02 14:32:16 Yes, I'm suggesting a nested named function. But i
64 {
65 logo.removeEventListener("error", errorCallback, false);
66 // We are probably in Chrome/Opera/Safari, the image has a different path.
67 logo.src = "icons/detailed/abp-128.png";
68 };
69 logo.addEventListener("error", errorCallback, false);
70
60 // Set up URLs 71 // Set up URLs
61 getDocLink("donate", function(link) 72 getDocLink("donate", function(link)
62 { 73 {
63 E("donate").href = link; 74 E("donate").href = link;
64 }); 75 });
65 76
66 getDocLink("contributors", function(link) 77 getDocLink("contributors", function(link)
67 { 78 {
68 E("contributors").href = link; 79 E("contributors").href = link;
69 }); 80 });
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 { 287 {
277 var button = E("toggle-" + feature); 288 var button = E("toggle-" + feature);
278 if (isEnabled) 289 if (isEnabled)
279 button.classList.remove("off"); 290 button.classList.remove("off");
280 else 291 else
281 button.classList.add("off"); 292 button.classList.add("off");
282 } 293 }
283 294
284 document.addEventListener("DOMContentLoaded", onDOMLoaded, false); 295 document.addEventListener("DOMContentLoaded", onDOMLoaded, false);
285 })(); 296 })();
OLDNEW
« no previous file with comments | « firstRun.html ('k') | skin/abp-128.png » ('j') | skin/firstRun.css » ('J')

Powered by Google App Engine
This is Rietveld