Index: chrome/content/ui/firstRun.js |
=================================================================== |
--- a/chrome/content/ui/firstRun.js |
+++ b/chrome/content/ui/firstRun.js |
@@ -15,8 +15,74 @@ |
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
+(function() |
+{ |
+ var contentHeight = 0; |
+ var left; |
+ var right; |
Wladimir Palant
2013/05/07 15:01:12
The variables left and right seem to be unused.
|
+ var shade; |
+ var scrollTimer; |
+ |
+ function onDomReady() |
+ { |
+ shade = document.getElementById("shade"); |
+ |
+ shade.addEventListener("mouseover", scrollPage, false); |
+ shade.addEventListener("mouseout", stopScroll, false); |
+ |
+ window.addEventListener('resize', onWindowResize, false); |
+ document.addEventListener('scroll', onScroll, false); |
+ |
+ onWindowResize(); |
+ } |
+ |
+ function onScroll() |
+ { |
+ var currentHeight = document.documentElement.scrollTop + document.body.scrollTop + document.documentElement.clientHeight; |
+ shade.style.opacity = (contentHeight == currentHeight) ? "0.0" : "0.5"; |
+ } |
+ |
+ function onWindowResize() |
+ { |
+ contentHeight = document.documentElement.scrollHeight; |
+ shade.style.opacity = (contentHeight > document.documentElement.clientHeight) ? "0.5" : "0.0"; |
Wladimir Palant
2013/05/07 15:01:12
Why do we have different logic here and in onScrol
|
+ } |
+ |
+ function scrollPage() |
+ { |
+ window.scrollBy(0, 5); |
+ scrollTimer = setTimeout(scrollPage, 20); |
Wladimir Palant
2013/05/07 15:01:12
What if mouseover event fires twice for some reaso
|
+ } |
+ |
+ function stopScroll() |
+ { |
+ clearTimeout(scrollTimer); |
+ } |
+ |
+ function scrollContent(direction) |
Wladimir Palant
2013/05/07 15:01:12
This function seems to be unused code.
|
+ { |
+ cur -= direction; |
+ if (cur < 0) cur = 0; |
+ if (cur > cols) cur = cols; |
+ |
+ left.style.visibility="hidden"; |
+ right.style.visibility="hidden"; |
+ |
+ if (cur > 0 && cur <= cols) |
+ left.style.visibility="visible"; |
+ if (cur < cols && cols > 0) |
+ right.style.visibility="visible"; |
+ |
+ innerBase.style.left = (cur * -width) + "px"; |
+ } |
+ |
+ document.addEventListener("DOMContentLoaded", onDomReady, false); |
+})(); |
+ |
function init() |
{ |
+ E("currentVersion").textContent = Prefs.currentVersion; |
+ |
generateLinkText(E("changeDescription")); |
for each (let subscription in FilterStorage.subscriptions) |
@@ -87,3 +153,4 @@ |
else |
UI.openFiltersDialog(); |
} |
+ |