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

Unified Diff: chrome/content/ui/firstRun.js

Issue 10585038: First-run page (revisited) (Closed)
Patch Set: Created May 14, 2013, 3:12 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/content/ui/firstRun.xhtml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/firstRun.js
===================================================================
--- a/chrome/content/ui/firstRun.js
+++ b/chrome/content/ui/firstRun.js
@@ -15,8 +15,59 @@
* along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
*/
+(function()
+{
+ 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);
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.
+
+ onWindowResize();
+ }
+
+ function onScroll()
+ {
+ var currentHeight = document.documentElement.scrollTop + document.body.scrollTop + document.documentElement.clientHeight;
+ shade.style.opacity = (document.documentElement.scrollHeight == currentHeight) ? "0.0" : "0.5";
+ }
+
+ function onWindowResize()
+ {
+ onScroll();
+ }
+
+ function scrollPage()
+ {
+ if (scrollTimer)
+ stopScroll();
+
+ scrollTimer = setInterval(function()
+ {
+ window.scrollBy(0, 5);
+ }, 20);
+ }
+
+ function stopScroll()
+ {
+ clearTimeout(scrollTimer);
+ scrollTimer = null;
+ }
+
+ document.addEventListener("DOMContentLoaded", onDomReady, false);
+})();
+
function init()
{
+ E("currentVersion").textContent = Prefs.currentVersion;
+
generateLinkText(E("changeDescription"));
for each (let subscription in FilterStorage.subscriptions)
@@ -87,3 +138,4 @@
else
UI.openFiltersDialog();
}
+
« no previous file with comments | « no previous file | chrome/content/ui/firstRun.xhtml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld