Left: | ||
Right: |
OLD | NEW |
---|---|
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-2013 Eyeo GmbH | 3 * Copyright (C) 2006-2013 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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
16 */ | 16 */ |
17 | 17 |
18 (function() | |
19 { | |
20 var shade; | |
21 var scrollTimer; | |
22 | |
23 function onDomReady() | |
24 { | |
25 shade = document.getElementById("shade"); | |
26 | |
27 shade.addEventListener("mouseover", scrollPage, false); | |
28 shade.addEventListener("mouseout", stopScroll, false); | |
29 | |
30 window.addEventListener('resize', onWindowResize, false); | |
31 document.addEventListener('scroll', onScroll, false); | |
Wladimir Palant
2013/05/15 12:12:02
Nit: double quotation marks here and above please.
Thomas Greiner
2013/05/23 09:17:21
Done.
| |
32 | |
33 onWindowResize(); | |
34 } | |
35 | |
36 function onScroll() | |
37 { | |
38 var currentHeight = document.documentElement.scrollTop + document.body.scrol lTop + document.documentElement.clientHeight; | |
39 shade.style.opacity = (document.documentElement.scrollHeight == currentHeigh t) ? "0.0" : "0.5"; | |
40 } | |
41 | |
42 function onWindowResize() | |
43 { | |
44 onScroll(); | |
45 } | |
46 | |
47 function scrollPage() | |
48 { | |
49 if (scrollTimer) | |
50 stopScroll(); | |
51 | |
52 scrollTimer = setInterval(function() | |
53 { | |
54 window.scrollBy(0, 5); | |
55 }, 20); | |
56 } | |
57 | |
58 function stopScroll() | |
59 { | |
60 clearTimeout(scrollTimer); | |
61 scrollTimer = null; | |
62 } | |
63 | |
64 document.addEventListener("DOMContentLoaded", onDomReady, false); | |
65 })(); | |
66 | |
18 function init() | 67 function init() |
19 { | 68 { |
69 E("currentVersion").textContent = Prefs.currentVersion; | |
70 | |
20 generateLinkText(E("changeDescription")); | 71 generateLinkText(E("changeDescription")); |
21 | 72 |
22 for each (let subscription in FilterStorage.subscriptions) | 73 for each (let subscription in FilterStorage.subscriptions) |
23 { | 74 { |
24 if (subscription instanceof DownloadableSubscription && subscription.url != Prefs.subscriptions_exceptionsurl && !subscription.disabled) | 75 if (subscription instanceof DownloadableSubscription && subscription.url != Prefs.subscriptions_exceptionsurl && !subscription.disabled) |
25 { | 76 { |
26 E("listName").textContent = subscription.title; | 77 E("listName").textContent = subscription.title; |
27 | 78 |
28 let link = E("listHomepage"); | 79 let link = E("listHomepage"); |
29 link.setAttribute("href", subscription.homepage); | 80 link.setAttribute("href", subscription.homepage); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
80 Utils.runAsync(showOptions); | 131 Utils.runAsync(showOptions); |
81 else | 132 else |
82 topWnd.ExtensionsView.showOptions(Utils.addonID); | 133 topWnd.ExtensionsView.showOptions(Utils.addonID); |
83 } | 134 } |
84 showOptions(); | 135 showOptions(); |
85 } | 136 } |
86 } | 137 } |
87 else | 138 else |
88 UI.openFiltersDialog(); | 139 UI.openFiltersDialog(); |
89 } | 140 } |
141 | |
OLD | NEW |