Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Issue 10828027: Extensions Docs Server: use addEventListener with branch.js (Closed)

Created:
8 years, 5 months ago by cduvall
Modified:
8 years, 4 months ago
CC:
chromium-reviews, Aaron Boodman, mihaip-chromium-reviews_chromium.org, clintstaley
Visibility:
Public.

Description

Extensions Docs Server: use addEventListener with branch.js Clean up branch.js to use addEventListener. BUG=131095 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=148773

Patch Set 1 : #

Total comments: 8

Patch Set 2 : clean up #

Unified diffs Side-by-side diffs Delta from patch set Stats (+19 lines, -14 lines) Patch
M chrome/common/extensions/docs/server2/static/js/branch.js View 1 1 chunk +13 lines, -9 lines 0 comments Download
M chrome/common/extensions/docs/server2/template_data_source.py View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/common/extensions/docs/server2/templates/private/footer.html View 1 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/docs/server2/templates/private/header_body.html View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 3 (0 generated)
cduvall
Cleaned up branch.js. I tested it some with node in the terminal, and it works ...
8 years, 5 months ago (2012-07-26 18:29:37 UTC) #1
not at google - send to devlin
lgtm https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/extensions/docs/server2/static/js/branch.js File chrome/common/extensions/docs/server2/static/js/branch.js (right): https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/extensions/docs/server2/static/js/branch.js#newcode7 chrome/common/extensions/docs/server2/static/js/branch.js:7: if (!this.value) "this" is evil. This method gets ...
8 years, 4 months ago (2012-07-27 03:30:39 UTC) #2
cduvall
8 years, 4 months ago (2012-07-27 17:51:10 UTC) #3
https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
File chrome/common/extensions/docs/server2/static/js/branch.js (right):

https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
chrome/common/extensions/docs/server2/static/js/branch.js:7: if (!this.value)
On 2012/07/27 03:30:39, kalman wrote:
> "this" is evil. This method gets called with the event as its argument; use
> that, or hold onto 'branchChooser' and use it directly.
> 
> var branchChooser = document.gEBI('branchChooser');
> 
> function redirectToBranch() {
>   ...
> }

Done.

https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
chrome/common/extensions/docs/server2/static/js/branch.js:13: path[index] =
this.value;
On 2012/07/27 03:30:39, kalman wrote:
> need to make sure that if value is empty the element is deleted, otherwise
there
> will be two // in the path.

Value will never be empty, the branchChooser uses the full name of the default
branch (so 'stable' instead of ''). Also, the value is checked at line 7 if it
is empty.

https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
chrome/common/extensions/docs/server2/static/js/branch.js:22: true);
On 2012/07/27 03:30:39, kalman wrote:
> hm haven't seen "true" here before. Why do you need? Just curious.

It was so I could use 'this' in the callback. Now I don't need it :)

https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
File chrome/common/extensions/docs/server2/templates/private/header_body.html
(right):

https://chromiumcodereview.appspot.com/10828027/diff/2001/chrome/common/exten...
chrome/common/extensions/docs/server2/templates/private/header_body.html:2:
<script>window.bootstrap = { branchInfo: {{*branchInfo}} };</script>
On 2012/07/27 03:30:39, kalman wrote:
> Put in the footer? Loading the select without the data existing shouldn't
> matter, and the fewer <script>s before the end the better.

Done.

Powered by Google App Engine
This is Rietveld 408576698