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

Issue 9078049: First run page (Closed)

Created:
Dec. 28, 2012, 11:06 a.m. by Andrey Novikov
Modified:
Sept. 17, 2013, 10:58 a.m.
Reviewers:
Wladimir Palant
CC:
Felix Dahlke
Visibility:
Public.

Description

This code review is based on revision #3593 because I couldn't update to default - hg failed on jshydra dependency. I've made only Typo Correction feature to support activation because I didn't find other feature switches in preferences. I think it would be better not to simply hide Activate button, but to put some sort of a tick mark instead, but wanted to consult you first. I didn't know how to address openFilters() if it is enclosed in anonymous closure, so I've left it alone. I didn't remove init() because I was not sure if it will be not needed anymore. I didn't implement clicks on social buttons because I need initial assistance from Felix on that.

Patch Set 1 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+421 lines, -50 lines) Patch
M chrome/content/ui/firstRun.js View 2 chunks +67 lines, -0 lines 4 comments Download
M chrome/content/ui/firstRun.xhtml View 1 chunk +75 lines, -19 lines 9 comments Download
A chrome/skin/adblockplus_128.png View Binary file 0 comments Download
A chrome/skin/features/acceptable.png View Binary file 0 comments Download
A chrome/skin/features/adblocking.png View Binary file 0 comments Download
A chrome/skin/features/malware.png View Binary file 0 comments Download
A chrome/skin/features/social.png View Binary file 0 comments Download
A chrome/skin/features/tracking.png View Binary file 0 comments Download
A chrome/skin/features/typo.png View Binary file 0 comments Download
M chrome/skin/firstRun.css View 2 chunks +275 lines, -28 lines 0 comments Download
A chrome/skin/social/facebook.png View Binary file 0 comments Download
A chrome/skin/social/gplus.png View Binary file 0 comments Download
A chrome/skin/social/twitter.png View Binary file 0 comments Download
M defaults/prefs.js View 1 chunk +1 line, -1 line 0 comments Download
M lib/ui.js View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 2
Andrey Novikov
See issue description for comments.
Dec. 28, 2012, 11:21 a.m. (2012-12-28 11:21:07 UTC) #1
Wladimir Palant
May 7, 2013, 3:01 p.m. (2013-05-07 15:01:12 UTC) #2
Obviously, this needs to be properly localizable before it can land. Also, we
need to consider the scenario where some features are already activated when
this page is displayed, e.g. because the extension was preconfigured by an
admin. Showing features that are already activated makes little sense. Finally,
the images need to be combined into sprites.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.js
File chrome/content/ui/firstRun.js (right):

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.j...
chrome/content/ui/firstRun.js:22: var right;
The variables left and right seem to be unused.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.j...
chrome/content/ui/firstRun.js:48: shade.style.opacity = (contentHeight >
document.documentElement.clientHeight) ? "0.5" : "0.0";
Why do we have different logic here and in onScroll? This function should simply
call onScroll. No point caching contentHeight, onScroll can simply look it up
every time.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.j...
chrome/content/ui/firstRun.js:54: scrollTimer = setTimeout(scrollPage, 20);
What if mouseover event fires twice for some reason (e.g. because you catch the
event from a child element)? Cleaner solution:

function scrollPage()
{
  if (scrollTimer)
    stopScroll();

  scrollTimer = setInterval(function()
  {
    window.scrollBy(0, 5);
  }, 20);
}

function stopScroll()
{
  clearTimeout(scrollTimer);
  scrollTimer = null;
}

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.j...
chrome/content/ui/firstRun.js:62: function scrollContent(direction)
This function seems to be unused code.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
File chrome/content/ui/firstRun.xhtml (right):

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:38: <a href="#"
onclick="UI.loadDocLink('acceptable_ads', 'criteria'); return false;">strict
guidelines</a>
In fact, that's something we've done wrong in Chrome - anchors should also be
set on the server side, not hardcoded in the extensions. I added
acceptable_ads_criteria redirect, please use it instead of changing
loadDocLink().

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:43: <h2>Adblock Plus can do more then block
ads:</h2>
s/then/than/

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:46: <div class="feature">
Wrong indentation here.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:47: <img
src="chrome://adblockplus/skin/features/typo.png" alt="Typo Correction"/>
I would suggest going with alt="" here - the alt text doesn't provide any
additional information and localizing it is pointless. Also, image paths really
belong into skin (CSS code).

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:54: <button
onclick="TypoActions.setEnabled(true); this.setAttribute('hidden', 'true');
return false;">Activate</button>
We shouldn't be using inline JavaScript if we want to use this page in Chrome
later - inline JavaScript is forbidden via CSP there. Not using it is better
style anyway.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:63: <button>Activate</button>
This is obviously a TODO.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:73: <button>Activate</button>
This is obviously a TODO.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:81: <button>Activate</button>
This is obviously a TODO.

http://codereview.adblockplus.org/9078049/diff/1/chrome/content/ui/firstRun.x...
chrome/content/ui/firstRun.xhtml:89: <img
src="chrome://adblockplus/skin/social/facebook.png" width="82" height="82"
alt="Facebook logo"/>
Alt text should be "Share on Facebook" here - otherwise a blind person will have
no idea what this is. A different accessibility approach will be necessary once
the paths are moved to CSS however.

These buttons shouldn't be links, they should work the same as Chrome's
first-run page.

Powered by Google App Engine
This is Rietveld