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