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

Side by Side Diff: html/static/js/firstRun.js

Issue 4859491858251776: Fix the approach used in ieFirstRun.js (Closed)
Patch Set: Created March 21, 2014, 4:58 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
« no previous file with comments | « no previous file | html/static/js/ieFirstRun.js » ('j') | html/static/js/ieFirstRun.js » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 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 16 matching lines...) Expand all
27 object.addEventListener(type, listener, false); 27 object.addEventListener(type, listener, false);
28 else 28 else
29 { 29 {
30 object.attachEvent("on" + type, function() 30 object.attachEvent("on" + type, function()
31 { 31 {
32 listener(event); 32 listener(event);
33 }); 33 });
34 } 34 }
35 } 35 }
36 36
37 function removeListener(object, type, listener) 37 function removeListener(object, type, listener)
Felix Dahlke 2014/07/04 13:40:32 There are multiple uses of this function below - s
38 { 38 {
39 // all IE versions require the use of detachEvent for message event to work 39 // all IE versions require the use of detachEvent for message event to work
40 if (type != "message" && "removeEventListener" in object) 40 if (type != "message" && "removeEventListener" in object)
41 object.removeEventListener(type, listener); 41 object.removeEventListener(type, listener);
42 else 42 else
43 object.detachEvent("on" + type, listener); 43 object.detachEvent("on" + type, listener);
44 } 44 }
45 45
46 function openSharePopup(url) 46 function openSharePopup(url)
47 { 47 {
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 document.title = AdblockPlus.getMessage("first-run", "first-run-title-install" ); 139 document.title = AdblockPlus.getMessage("first-run", "first-run-title-install" );
140 for (var i in mapping) 140 for (var i in mapping)
141 { 141 {
142 var element = document.getElementById(i); 142 var element = document.getElementById(i);
143 element.innerText = AdblockPlus.getMessage("first-run", mapping[i]); 143 element.innerText = AdblockPlus.getMessage("first-run", mapping[i]);
144 } 144 }
145 } 145 }
146 146
147 function init() 147 function init()
148 { 148 {
149 initWrappers();
150 // Choose a share text variant randomly 149 // Choose a share text variant randomly
151 var variant = Math.floor(Math.random() * 2) + 1; 150 var variant = Math.floor(Math.random() * 2) + 1;
152 var classList = document.documentElement.className.split(" "); 151 var classList = document.documentElement.className.split(" ");
153 classList.push("share-variant-" + variant); 152 classList.push("share-variant-" + variant);
154 document.documentElement.className = classList.join(" "); 153 document.documentElement.className = classList.join(" ");
155 154
156 initTranslations(); 155 initTranslations();
157 initSocialLinks(variant); 156 initSocialLinks(variant);
158 157
159 var donateLink = document.getElementById("share-donate"); 158 var donateLink = document.getElementById("share-donate");
160 donateLink.href = getDocLink("donate") + "&variant=" + variant; 159 donateLink.href = getDocLink("donate") + "&variant=" + variant;
161 } 160 }
162 161
163 addListener(window, "load", init); 162 addListener(window, "load", init);
OLDNEW
« no previous file with comments | « no previous file | html/static/js/ieFirstRun.js » ('j') | html/static/js/ieFirstRun.js » ('J')

Powered by Google App Engine
This is Rietveld