Merge lp:~gesha/linaro-android-frontend/remove-mandatory-tabs into lp:linaro-android-frontend

Proposed by Georgy Redkozubov
Status: Merged
Merged at revision: 286
Proposed branch: lp:~gesha/linaro-android-frontend/remove-mandatory-tabs
Merge into: lp:linaro-android-frontend
Diff against target: 77 lines (+5/-30)
1 file modified
static/buildDetails.js (+5/-30)
To merge this branch: bzr merge lp:~gesha/linaro-android-frontend/remove-mandatory-tabs
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+131151@code.launchpad.net

Description of the change

This branch removes mandatory tabs and fallback support for HOWTOs and adds searching of HOWTOs only in current dir.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

In the loop over howto_paths (line 41 of the diff), I'd say a loop variable is more likely an "index" rather than "count" (count is the total count of something; perhaps we could call it a "counter", but that suggests something else as well). It's even better if it actually indicates what's it an index for, eg. "howto_index".

review: Needs Fixing
287. By Georgy Redkozubov

Fix based on review comments

Revision history for this message
Georgy Redkozubov (gesha) wrote :

> In the loop over howto_paths (line 41 of the diff), I'd say a loop variable is
> more likely an "index" rather than "count" (count is the total count of
> something; perhaps we could call it a "counter", but that suggests something
> else as well). It's even better if it actually indicates what's it an index
> for, eg. "howto_index".

Fixed.

Revision history for this message
Данило Шеган (danilo) wrote :

Thanks, looks good now.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'static/buildDetails.js'
2--- static/buildDetails.js 2012-10-19 14:07:39 +0000
3+++ static/buildDetails.js 2012-10-24 12:01:21 +0000
4@@ -22,7 +22,6 @@
5 var buildNumber = history.get('build');
6 var fetchLatest = (buildNumber === undefined);
7
8- var howto_dir = "/howto/";
9 var howto_paths = [
10 "HOWTO_releasenotes.txt",
11 "HOWTO_install.txt",
12@@ -30,12 +29,6 @@
13 "HOWTO_flashfirmware.txt",
14 "HOWTO_rtsm.txt"]
15
16- // For these files we use the fallback pages found in static/.
17- var howto_mandatory = [
18- "HOWTO_install.txt",
19- "HOWTO_getsourceandbuild.txt",
20- "HOWTO_flashfirmware.txt"]
21-
22 // Mapping for howto_paths tab titles
23 var howto_titles = [
24 "Release Notes",
25@@ -44,14 +37,6 @@
26 "Firmware Update",
27 "RTSM"]
28
29- // First and the last howto's don't have fallbacks, but this can change
30- // later.
31- var howto_fallbacks = [
32- '',
33- 'Please read "Image Installation Wiki page":https://wiki.linaro.org/Platform/Android/ImageInstallation <br><br>For more info, check out this "page":https://wiki.linaro.org/Platform/Android',
34- 'Please read these two pages: "Get Source page":https://wiki.linaro.org/Platform/Android/GetSource and "Build Source page":https://wiki.linaro.org/Platform/Android/BuildSource <br><br>For more info, check out this "page":https://wiki.linaro.org/Platform/Android',
35- 'Please read "Flash Firmware Wiki page":https://wiki.linaro.org/Platform/Android/FlashFirmware <br><br>For more info, check out this "page":https://wiki.linaro.org/Platform/Android',
36- '']
37
38
39
40@@ -440,33 +425,23 @@
41 function handleRenderedFiles(downloadUrl) {
42
43 var rendered_files = new Object();
44- var count = 0;
45+ var howto_index = 0;
46
47- for (var count in howto_paths) {
48+ for (var howto_index in howto_paths) {
49 $.ajax({
50 url: '/api/proxy-remote-file?url=' + downloadUrl +
51- howto_dir + howto_paths[count],
52+ howto_paths[howto_index],
53 success: function(data) {
54 if (data != 'Invalid argument') {
55- rendered_files[howto_titles[count]] =
56+ rendered_files[howto_titles[howto_index]] =
57 convert_textile(data);
58 }
59- count++;
60+ howto_index++;
61 },
62 async: false,
63 });
64 }
65
66- for (var count in howto_paths) {
67- if ($.inArray(howto_paths[count], howto_mandatory) != -1) {
68- if (rendered_files[howto_titles[count]] == undefined) {
69- // No file found, get fallback.
70- rendered_files[howto_titles[count]] =
71- convert_textile(howto_fallbacks[count]);
72- }
73- }
74- }
75-
76 refresh_tabs(rendered_files);
77 }
78

Subscribers

People subscribed via source and target branches