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

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

Issue 9078049: First run page (Closed)
Patch Set: Created Dec. 28, 2012, 11:06 a.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') | chrome/content/ui/firstRun.xhtml » ('J')
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,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();
}
+
« no previous file with comments | « no previous file | chrome/content/ui/firstRun.xhtml » ('j') | chrome/content/ui/firstRun.xhtml » ('J')

Powered by Google App Engine
This is Rietveld