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

Side by Side Diff: chrome/browser/resources/bug_report.html

Issue 5372007: Retry commit for, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/chrome/browser/resources
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/bug_report.css ('k') | chrome/browser/resources/bug_report.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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="page-title"></title>
6 <link rel="stylesheet" href="bug_report.css"/> 6 <!-- We want to keep our style in sync with the options page. -->
7 <link rel="stylesheet" href="dom_ui.css">
8 <link rel="stylesheet" href="options/options_page.css">
9 <link rel="stylesheet" href="bug_report.css">
7 10
8 <script src="shared/js/local_strings.js"></script> 11 <script src="shared/js/local_strings.js"></script>
9 <script src="shared/js/util.js"></script> 12 <script src="shared/js/util.js"></script>
10 <script src="bug_report.js"></script> 13 <script src="bug_report.js"></script>
11 <script> 14 <script>
12 15
13 /////////////////////////////////////////////////////////////////////////////// 16 ///////////////////////////////////////////////////////////////////////////////
14 // Document Functions: 17 // Document Functions:
15 /** 18 /**
16 * Window onload handler, sets up the page. 19 * Window onload handler, sets up the page.
17 */ 20 */
18 function load() { 21 function load() {
19 $('sysinfo-url').onclick = function(event) { 22 $('sysinfo-url').onclick = function(event) {
20 chrome.send('openSystemTab'); 23 chrome.send('openSystemTab');
21 }; 24 };
25
26 var menuOffPattern = /(^\?|&)menu=off($|&)/;
27 var menuDisabled = menuOffPattern.test(window.location.search);
28 document.documentElement.setAttribute('hide-menu', menuDisabled);
29
22 30
23 // textContent on description-text textarea seems to default 31 // textContent on description-text textarea seems to default
24 // to several spaces, this resets it to empty. 32 // to several spaces, this resets it to empty.
25 $('description-text').textContent = ''; 33 $('description-text').textContent = '';
26 $('send-report-button').disabled = true;
27
28 $('issue-with-combo').addEventListener('change', function(e) {
29 $('send-report-button').disabled =
30 this.selectedIndex <= 0 || $('description-text').value.length == 0;
31 });
32
33 $('description-text').addEventListener('keyup', function(e) {
34 $('send-report-button').disabled =
35 $('issue-with-combo').selectedIndex <= 0 || this.value.length == 0;
36 });
37
38 $('current-screenshot').nextSibling.textContent =
39 localStrings.getString('currentscreenshots');
40 <if expr="pp_ifdef('chromeos')">
41 $('saved-screenshot').nextSibling.textContent =
42 localStrings.getString('savedscreenshots');
43 </if>
44 $('no-screenshot').nextSibling.textContent =
45 localStrings.getString('noscreenshot');
46 34
47 // Get a list of issues that we allow the user to select from. 35 // Get a list of issues that we allow the user to select from.
48 // Note, the order and the issues types themselves are different 36 // Note, the order and the issues types themselves are different
49 // between Chromium and Chromium OS, so this code needs to be 37 // between Chromium and Chromium OS, so this code needs to be
50 // maintained individually between the bug_report.html and 38 // maintained individually between in these two sections.
51 // bug_report_cros.html files.
52 var issueTypeText = []; 39 var issueTypeText = [];
53 issueTypeText[0] = localStrings.getString('issue-choose'); 40 issueTypeText[0] = localStrings.getString('issue-choose');
54 <if expr="not pp_ifdef('chromeos')"> 41 <if expr="not pp_ifdef('chromeos')">
55 issueTypeText[1] = localStrings.getString('issue-page-formatting'); 42 issueTypeText[1] = localStrings.getString('issue-page-formatting');
56 issueTypeText[2] = localStrings.getString('issue-page-load'); 43 issueTypeText[2] = localStrings.getString('issue-page-load');
57 issueTypeText[3] = localStrings.getString('issue-plugins'); 44 issueTypeText[3] = localStrings.getString('issue-plugins');
58 issueTypeText[4] = localStrings.getString('issue-tabs'); 45 issueTypeText[4] = localStrings.getString('issue-tabs');
59 issueTypeText[5] = localStrings.getString('issue-sync'); 46 issueTypeText[5] = localStrings.getString('issue-sync');
60 issueTypeText[6] = localStrings.getString('issue-crashes'); 47 issueTypeText[6] = localStrings.getString('issue-crashes');
61 issueTypeText[7] = localStrings.getString('issue-extensions'); 48 issueTypeText[7] = localStrings.getString('issue-extensions');
(...skipping 12 matching lines...) Expand all
74 </if> 61 </if>
75 // Add all the issues to the selection box. 62 // Add all the issues to the selection box.
76 for (var i = 0; i < issueTypeText.length; i++) { 63 for (var i = 0; i < issueTypeText.length; i++) {
77 var option = document.createElement('option'); 64 var option = document.createElement('option');
78 option.className = 'bug-report-text'; 65 option.className = 'bug-report-text';
79 option.textContent = issueTypeText[i]; 66 option.textContent = issueTypeText[i];
80 $('issue-with-combo').add(option); 67 $('issue-with-combo').add(option);
81 } 68 }
82 69
83 chrome.send('getDialogDefaults', []); 70 chrome.send('getDialogDefaults', []);
84 chrome.send('refreshScreenshots', []); 71 chrome.send('refreshCurrentScreenshot', []);
85 }; 72 };
86 73
87 function setupScreenshots(screenshots) { 74 function setupCurrentScreenshot(screenshot) {
88 if (screenshots.length == 1) { 75 addScreenshot('current-screenshots', screenshot);
89 addScreenshot('current-screenshots', screenshots[0]); 76 }
77
78 function setupSavedScreenshots(screenshots) {
79 if (screenshots.length == 0) {
80 $('saved-screenshots').innerText =
81 localStrings.getString('no-saved-screenshots');
82
83 // Make sure we make the display the message
84 $('saved-screenshots').style.display = 'block';
85
86 // In case the user tries to send now; fail safe, do not send a screenshot
87 // at all versus sending the current screenshot.
88 selectedThumbnailDivId = '';
89 selectedThumbnailId = '';
90 } else { 90 } else {
91 // We're in Chromium OS. 91 for (i = 0; i < screenshots.length; ++i)
92 currentScreenshot = screenshots[0]; 92 addScreenshot('saved-screenshots', screenshots[i]);
93 addScreenshot('current-screenshots', currentScreenshot); 93
94 94 // Now that we have our screenshots, try selecting the saved screenshots
95 savedScreenshots = screenshots[1]; 95 // again.
96 if (savedScreenshots.length == 0) { 96 savedSelected();
97 $('saved-screenshots').disabled = true;
98 return;
99 }
100 for (i = 0; i < savedScreenshots.length; ++i)
101 addScreenshot('saved-screenshots', savedScreenshots[i]);
102 } 97 }
103 } 98 }
104 99
100
105 function setupDialogDefaults(defaults) { 101 function setupDialogDefaults(defaults) {
106 if (defaults.length > 0) { 102 if (defaults.length > 0) {
107 $('page-url-text').value = defaults[0]; 103 $('page-url-text').value = defaults[0];
104 if (defaults[0] == '')
105 $('page-url-checkbox').checked = false;
106
108 if (defaults.length > 2) { 107 if (defaults.length > 2) {
109 // We're in Chromium OS. 108 // We're in Chromium OS.
110 $('user-email-text').value = defaults[2]; 109 $('user-email-text').textContent = defaults[2];
110 if (defaults[2] == '') {
111 // if we didn't get an e-mail address from cros,
112 // disable the user email display totally
113 $('user-email-table').style.display = 'none';
114
115 // this also means we are in privacy mode, so no saved screenshots
116 $('screenshot-link-tosaved').style.display = 'none';
117 }
111 } 118 }
112 } 119 }
113 } 120 }
114 121
115 window.addEventListener('DOMContentLoaded', load); 122 window.addEventListener('DOMContentLoaded', load);
116 </script> 123 </script>
117 </head> 124 </head>
118 <body> 125 <body i18n-values=".style.fontFamily:fontfamily;.style.fontSize:fontsize">
119 <div> 126 <div id="main-content">
120 <div id="main-panel"> 127 <div id="navbar-container">
121 <div class="formpane"> 128 <h1 id="settings-title" i18n-content="page-title">
122 <table> 129 </h1>
123 <!-- Issue type dropdown --> 130 </div>
124 <tr> 131 <div id="mainview" class>
125 <th id="issue-with" class="bug-report-label" i18n-content="issue-with" > 132 <!-- Even though we really don't need these many nested DIV's, we're staying
126 </th> 133 as close to the settings page layout as possible, re-using all our styles
127 </tr> 134 from options_page.css -->
128 <tr> 135 <div id="mainview-content">
129 <td> 136 <div class="page">
130 <select id="issue-with-combo" class="bug-report-text"> 137 <h1 i18n-content="title"></h1>
131 </select> 138 <table id="main-table">
132 </td> 139 <!-- Issue type dropdown -->
133 </tr> 140 <tbody>
134 <!-- Page URL text box --> 141 <tr>
135 <tr> 142 <th id="issue-with" class="bug-report-label"
136 <th colspan="2" id="page-url" class="bug-report-label" 143 i18n-content="issue-with"></th>
137 i18n-content="page-url"> 144 </tr>
138 </th> 145 <tr>
139 </tr> 146 <td>
140 <tr> 147 <select id="issue-with-combo" class="bug-report-text">
141 <td colspan="2"> 148 </select>
142 <input id='page-url-text' maxlength=200 class="bug-report-text"> 149 </td>
143 </td> 150 </tr>
144 </tr> 151 <!-- Description -->
145 <!-- Description --> 152 <tr>
146 <tr> 153 <th id="description" colspan="2" class="bug-report-label"
147 <th id="description" colspan="2" class="bug-report-label" 154 i18n-content="description"></th>
148 i18n-content="description"> 155 </tr>
149 </th> 156 <tr>
150 </tr> 157 <td colspan="2">
151 <tr> 158 <textarea id="description-text" rows="10"
152 <td colspan="2"> 159 class="bug-report-text"></textarea>
153 <textarea id='description-text' rows="10" class="bug-report-text"> 160 </td>
154 </textarea> 161 </tr>
155 </td> 162 <tr>
156 </tr> 163 <td>
157 </table> 164 <table style="-webkit-border-vertical-spacing: 0px;">
158 </div> 165 <!-- Page URL -->
159 <div class="formpane"> 166 <tr>
160 <table> 167 <td>
161 <if expr="pp_ifdef('chromeos')"> 168 <table class="bug-report-table">
162 <!-- Page URL text box --> 169 <tr>
163 <tr> 170 <td class="bug-report-fieldlabel">
164 <th id="user-email" class="bug-report-label" i18n-content="user-email" > 171 <input id="page-url-checkbox" type="checkbox"
165 </th> 172 value="pageurl" checked>
166 </tr> 173 <span id="page-url-label" i18n-content="page-url">
167 <tr> 174 </span>
168 <td> 175 </td>
169 <input id='user-email-text' maxlength=200 class="bug-report-text"> 176 <td>
170 </td> 177 <input id="page-url-text" class="bug-report-field"
171 </tr> 178 maxlength="200">
172 <!-- System Information checkbox --> 179 </td>
173 <tr> 180 </tr>
174 <td> 181 </table>
175 <input id="sys-info-checkbox" type="checkbox" value="sysinfo" checke d> 182 </td>
176 <span id="sysinfo-label"></span> 183 </tr>
177 <a id="sysinfo-url" href="#" > 184 <!-- User e-mail -->
178 <span i18n-content="sysinfo"></span> 185 <tr>
179 </a> 186 <td>
180 </td> 187 <if expr="pp_ifdef('chromeos')">
181 </tr> 188 <table id="user-email-table" class="bug-report-table">
182 </if> 189 <tr>
183 <!-- Screenshot radio buttons --> 190 <td class="bug-report-fieldlabel">
184 <tr> 191 <input id="user-email-checkbox" type="checkbox"
185 <th id="screenshot" class="bug-report-label" i18n-content="screenshot" > 192 checked>
186 </th> 193 <span id="user-email-label"
187 </tr> 194 i18n-content="user-email"></span>
188 <tr> 195 </td>
189 <td> 196 <td>
190 <input id="no-screenshot" type="radio" name="screenshot-group" 197 <label id="user-email-text"
191 value="none" onclick="noneSelected()"> 198 class="bug-report-field"></label>
192 <br> 199 </td>
193 <if expr="pp_ifdef('chromeos')"> 200 </tr>
194 <input id="saved-screenshot" type="radio" name="screenshot-group" 201 </table>
195 value="saved" onclick="savedSelected()"> 202 </if>
196 <br> 203 </td>
197 <div id="saved-screenshots" style="display: none;" 204 </tr>
198 class="thumbnail-list"> 205 <!-- System Information -->
199 </div> 206 <tr>
200 </if> 207 <td>
201 <input id="current-screenshot" type="radio" name="screenshot-group" 208 <table class="bug-report-table">
202 value="current" checked onclick="currentSelected()"> 209 <tr>
203 <br> 210 <td class="bug-report-fieldlabel">
204 <div id="current-screenshots" class="thumbnail-list"> 211 <input id="sys-info-checkbox" type="checkbox"
205 </div> 212 checked>
206 </td> 213 <span id="sysinfo-label">
207 </tr> 214 <a id="sysinfo-url" href="#"
208 </table> 215 i18n-content="sysinfo"></a>
216 </span>
217 </td>
218 </tr>
219 </table>
220 </td>
221 </tr>
222 <!-- Screenshot -->
223 <tr>
224 <td>
225 <table class="bug-report-table">
226 <tr>
227 <td class="bug-report-fieldlabel">
228 <input id="screenshot-checkbox" type="checkbox">
229 <span id="screenshot-label-current"
230 i18n-content="current-screenshot">
231 </span>
232 <if expr="pp_ifdef('chromeos')">
233 <span id="screenshot-label-saved"
234 style="display: none;"
235 i18n-content="saved-screenshot">
236 </span>
237 <a id="screenshot-link-tosaved" href="#"
238 onclick="changeToSaved()"
239 i18n-content="choose-different-screenshot">
240 </a>
241 <a id="screenshot-link-tocurrent" href="#"
242 style="display: none;"
243 onclick="changeToCurrent()"
244 i18n-content="choose-original-screenshot">
245 </a>
246 </if>
247 </td>
248 </tr>
249 </table>
250 </td>
251 </tr>
252 <tr>
253 <td>
254 <if expr="pp_ifdef('chromeos')">
255 <div id="saved-screenshots" style="display: none;"
256 class="thumbnail-list"></div>
257 </if>
258 <div id="current-screenshots" class="thumbnail-list">
259 </div>
260 </td>
261 </tr>
262 </table>
263 </td>
264 </tr>
265 <tr>
266 <td>
267 <div id="buttons-pane">
268 <!-- Buttons -->
269 <input id="send-report-button" type="submit"
270 class="bug-report-button" onclick="sendReport()"
271 i18n-values="value:send-report">
272 <input id="cancel-button" type="submit"
273 class="bug-report-button" i18n-values="value:cancel"
274 onclick="cancel()">
275 </div>
276 <if expr="pp_ifdef('chromeos')">
277 <div id="privacy-note" i18n-values=".innerHTML:privacy-note">
278 </div>
279 </if>
280 </td>
281 </tr>
282 </tbody>
283 </table>
284 </div>
209 </div> 285 </div>
210 </div> 286 </div>
211 </div> 287 </div>
212 <div id="buttons">
213 <!-- Buttons -->
214 <input id='send-report-button' type="submit" class="bug-report-button"
215 i18n-values="value:send-report" onclick="sendReport()">
216 <input id='cancel-button' type="submit" class="bug-report-button"
217 i18n-values="value:cancel" onclick="cancel()">
218 </div>
219 </body> 288 </body>
220 </html> 289 </html>
OLDNEW
« no previous file with comments | « chrome/browser/resources/bug_report.css ('k') | chrome/browser/resources/bug_report.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698