OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html i18n-values="dir:textdirection;"> | 2 <html i18n-values="dir:textdirection;"> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"/> | 4 <meta charset="utf-8"/> |
5 <title i18n-content="title"></title> | 5 <title i18n-content="title"></title> |
6 <link rel="stylesheet" href="bug_report.css"/> | 6 <link rel="stylesheet" href="bug_report.css"/> |
7 | 7 |
8 <script src="shared/js/local_strings.js"></script> | 8 <script src="shared/js/local_strings.js"></script> |
9 <script src="shared/js/util.js"></script> | 9 <script src="shared/js/util.js"></script> |
10 <script src="bug_report.js"></script> | 10 <script src="bug_report.js"></script> |
11 <script> | 11 <script> |
12 | 12 |
13 /////////////////////////////////////////////////////////////////////////////// | 13 /////////////////////////////////////////////////////////////////////////////// |
14 // Document Functions: | 14 // Document Functions: |
15 /** | 15 /** |
16 * Window onload handler, sets up the page. | 16 * Window onload handler, sets up the page. |
17 */ | 17 */ |
18 function load() { | 18 function load() { |
19 // textContent on description-text textarea seems to default | 19 // textContent on description-text textarea seems to default |
20 // to several spaces, this resets it to empty. | 20 // to several spaces, this resets it to empty. |
21 $('description-text').textContent = ''; | 21 $('description-text').textContent = ''; |
22 | 22 |
23 $('current-screenshot').nextSibling.textContent = | 23 $('current-screenshot').nextSibling.textContent = |
24 localStrings.getString('currentscreenshots'); | 24 localStrings.getString('currentscreenshots'); |
| 25 <if expr="pp_ifdef('chromeos')"> |
| 26 $('saved-screenshot').nextSibling.textContent = |
| 27 localStrings.getString('savedscreenshots'); |
| 28 </if> |
25 $('no-screenshot').nextSibling.textContent = | 29 $('no-screenshot').nextSibling.textContent = |
26 localStrings.getString('noscreenshot'); | 30 localStrings.getString('noscreenshot'); |
27 | 31 |
28 // Get a list of issues that we allow the user to select from. | 32 // Get a list of issues that we allow the user to select from. |
29 // Note, the order and the issues types themselves are different | 33 // Note, the order and the issues types themselves are different |
30 // between Chromium and Chromium OS, so this code needs to be | 34 // between Chromium and Chromium OS, so this code needs to be |
31 // maintained individually between the bug_report.html and | 35 // maintained individually between the bug_report.html and |
32 // bug_report_cros.html files. | 36 // bug_report_cros.html files. |
33 var issueTypeText = []; | 37 var issueTypeText = []; |
34 issueTypeText[0] = localStrings.getString('issue-choose'); | 38 issueTypeText[0] = localStrings.getString('issue-choose'); |
| 39 <if expr="not pp_ifdef('chromeos')"> |
35 issueTypeText[1] = localStrings.getString('issue-page-formatting'); | 40 issueTypeText[1] = localStrings.getString('issue-page-formatting'); |
36 issueTypeText[2] = localStrings.getString('issue-page-load'); | 41 issueTypeText[2] = localStrings.getString('issue-page-load'); |
37 issueTypeText[3] = localStrings.getString('issue-plugins'); | 42 issueTypeText[3] = localStrings.getString('issue-plugins'); |
38 issueTypeText[4] = localStrings.getString('issue-tabs'); | 43 issueTypeText[4] = localStrings.getString('issue-tabs'); |
39 issueTypeText[5] = localStrings.getString('issue-sync'); | 44 issueTypeText[5] = localStrings.getString('issue-sync'); |
40 issueTypeText[6] = localStrings.getString('issue-crashes'); | 45 issueTypeText[6] = localStrings.getString('issue-crashes'); |
41 issueTypeText[7] = localStrings.getString('issue-extensions'); | 46 issueTypeText[7] = localStrings.getString('issue-extensions'); |
42 issueTypeText[8] = localStrings.getString('issue-phishing'); | 47 issueTypeText[8] = localStrings.getString('issue-phishing'); |
43 issueTypeText[9] = localStrings.getString('issue-other'); | 48 issueTypeText[9] = localStrings.getString('issue-other'); |
44 | 49 </if> |
| 50 <if expr="pp_ifdef('chromeos')"> |
| 51 issueTypeText[1] = localStrings.getString('issue-connectivity'); |
| 52 issueTypeText[2] = localStrings.getString('issue-sync'); |
| 53 issueTypeText[3] = localStrings.getString('issue-crashes'); |
| 54 issueTypeText[4] = localStrings.getString('issue-page-formatting'); |
| 55 issueTypeText[5] = localStrings.getString('issue-extensions'); |
| 56 issueTypeText[6] = localStrings.getString('issue-standby'); |
| 57 issueTypeText[7] = localStrings.getString('issue-phishing'); |
| 58 issueTypeText[8] = localStrings.getString('issue-other'); |
| 59 </if> |
45 // Add all the issues to the selection box. | 60 // Add all the issues to the selection box. |
46 for (var i = 0; i < issueTypeText.length; i++) { | 61 for (var i = 0; i < issueTypeText.length; i++) { |
47 var option = document.createElement('option'); | 62 var option = document.createElement('option'); |
48 option.className = 'bug-report-text'; | 63 option.className = 'bug-report-text'; |
49 option.textContent = issueTypeText[i]; | 64 option.textContent = issueTypeText[i]; |
50 $('issue-with-combo').add(option); | 65 $('issue-with-combo').add(option); |
51 } | 66 } |
52 | 67 |
53 chrome.send('getDialogDefaults', []); | 68 chrome.send('getDialogDefaults', []); |
54 chrome.send('refreshScreenshots', []); | 69 chrome.send('refreshScreenshots', []); |
55 }; | 70 }; |
56 | 71 |
57 function setupScreenshots(screenshots) { | 72 function setupScreenshots(screenshots) { |
58 if (screenshots.length > 0) | 73 if (screenshots.length == 1) { |
59 addScreenshot('current-screenshots', screenshots[0]); | 74 addScreenshot('current-screenshots', screenshots[0]); |
| 75 } else { |
| 76 // We're in Chromium OS. |
| 77 currentScreenshot = screenshots[0]; |
| 78 addScreenshot('current-screenshots', currentScreenshot); |
| 79 |
| 80 savedScreenshots = screenshots[1]; |
| 81 for (i = 0; i < savedScreenshots.length; ++i) |
| 82 addScreenshot('saved-screenshots', savedScreenshots[i]); |
| 83 } |
60 } | 84 } |
61 | 85 |
62 function setupDialogDefaults(defaults) { | 86 function setupDialogDefaults(defaults) { |
63 if (defaults.length > 0) | 87 if (defaults.length > 0) { |
64 $('page-url-text').value = defaults[0]; | 88 $('page-url-text').value = defaults[0]; |
| 89 if (defaults.length > 2) { |
| 90 // We're in Chromium OS. |
| 91 $('sysinfo-url').href = defaults[1]; |
| 92 $('user-email-text').value = defaults[2]; |
| 93 } |
| 94 } |
65 } | 95 } |
66 | 96 |
67 window.addEventListener('DOMContentLoaded', load); | 97 window.addEventListener('DOMContentLoaded', load); |
68 </script> | 98 </script> |
69 </head> | 99 </head> |
70 <body> | 100 <body> |
71 <table> | 101 <table> |
72 <!-- Issue type dropdown --> | 102 <!-- Issue type dropdown --> |
73 <tr> | 103 <tr> |
74 <th id="issue-with" class="bug-report-label" i18n-content="issue-with"> | 104 <th id="issue-with" class="bug-report-label" i18n-content="issue-with"> |
(...skipping 21 matching lines...) Expand all Loading... |
96 <th id="description" colspan="2" class="bug-report-label" | 126 <th id="description" colspan="2" class="bug-report-label" |
97 i18n-content="description"> | 127 i18n-content="description"> |
98 </th> | 128 </th> |
99 </tr> | 129 </tr> |
100 <tr> | 130 <tr> |
101 <td colspan="2"> | 131 <td colspan="2"> |
102 <textarea id='description-text' rows="10" class="bug-report-text"> | 132 <textarea id='description-text' rows="10" class="bug-report-text"> |
103 </textarea> | 133 </textarea> |
104 </td> | 134 </td> |
105 </tr> | 135 </tr> |
| 136 <if expr="pp_ifdef('chromeos')"> |
| 137 <!-- System Information checkbox --> |
| 138 <tr> |
| 139 <td> |
| 140 <input id="sys-info-checkbox" type="checkbox" value="sysinfo" checked> |
| 141 <span id="sysinfo-label"></span> <a href='about:blank' id="sysinfo-url" |
| 142 target="_blank" i18n-content="sysinfo">></a> |
| 143 </td> |
| 144 </tr> |
| 145 <!-- Page URL text box --> |
| 146 <tr> |
| 147 <th id="user-email" class="bug-report-label" i18n-content="user-email"> |
| 148 </th> |
| 149 </tr> |
| 150 <tr> |
| 151 <td> |
| 152 <input id='user-email-text' maxlength=200 class="bug-report-text"> |
| 153 </td> |
| 154 </tr> |
| 155 </if> |
106 <!-- Screenshot radio buttons --> | 156 <!-- Screenshot radio buttons --> |
107 <tr> | 157 <tr> |
108 <th id="screenshot" class="bug-report-label" i18n-content="screenshot"> | 158 <th id="screenshot" class="bug-report-label" i18n-content="screenshot"> |
109 </th> | 159 </th> |
110 </tr> | 160 </tr> |
111 <tr> | 161 <tr> |
112 <td> | 162 <td> |
113 <input id="no-screenshot" type="radio" name="screenshot-group" | 163 <input id="no-screenshot" type="radio" name="screenshot-group" |
114 value="none" onclick="noneSelected()"> | 164 value="none" onclick="noneSelected()"> |
115 <br> | 165 <br> |
| 166 <if expr="pp_ifdef('chromeos')"> |
| 167 <input id="saved-screenshot" type="radio" name="screenshot-group" |
| 168 value="saved" onclick="savedSelected()"> |
| 169 <br> |
| 170 <div id="saved-screenshots" style="display: none;" |
| 171 class="thumbnail-list"> |
| 172 </div> |
| 173 </if> |
116 <input id="current-screenshot" type="radio" name="screenshot-group" | 174 <input id="current-screenshot" type="radio" name="screenshot-group" |
117 value="current" checked onclick="currentSelected()"> | 175 value="current" checked onclick="currentSelected()"> |
118 <br> | 176 <br> |
119 <div id="current-screenshots" class="thumbnail-list"> | 177 <div id="current-screenshots" class="thumbnail-list"> |
120 </div> | 178 </div> |
121 </td> | 179 </td> |
122 </tr> | 180 </tr> |
123 <!-- Buttons --> | 181 <!-- Buttons --> |
124 <tr> | 182 <tr> |
125 <td> | 183 <td> |
126 <hr> | 184 <hr> |
127 <input id='send-report-button' type="submit" class="bug-report-button" | 185 <input id='send-report-button' type="submit" class="bug-report-button" |
128 i18n-values="value:send-report" onclick="sendReport()"> | 186 i18n-values="value:send-report" onclick="sendReport()"> |
129 <input id='cancel-button' type="submit" class="bug-report-button" | 187 <input id='cancel-button' type="submit" class="bug-report-button" |
130 i18n-values="value:cancel" onclick="cancel()"> | 188 i18n-values="value:cancel" onclick="cancel()"> |
131 </td> | 189 </td> |
132 </tr> | 190 </tr> |
133 </table> | 191 </table> |
134 </body> | 192 </body> |
135 </html> | 193 </html> |
OLD | NEW |