OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 localStrings = new LocalStrings(); | 5 localStrings = new LocalStrings(); |
6 | 6 |
7 /** | 7 /** |
8 * Requests the list of crashes from the backend. | 8 * Requests the list of crashes from the backend. |
9 */ | 9 */ |
10 function requestCrashes() { | 10 function requestCrashes() { |
(...skipping 28 matching lines...) Expand all Loading... | |
39 var title = document.createElement('h3'); | 39 var title = document.createElement('h3'); |
40 title.textContent = localStrings.getStringF('crashHeaderFormat', | 40 title.textContent = localStrings.getStringF('crashHeaderFormat', |
41 crash['id']); | 41 crash['id']); |
42 crashBlock.appendChild(title); | 42 crashBlock.appendChild(title); |
43 var date = document.createElement('p'); | 43 var date = document.createElement('p'); |
44 date.textContent = localStrings.getStringF('crashTimeFormat', | 44 date.textContent = localStrings.getStringF('crashTimeFormat', |
45 crash['time']); | 45 crash['time']); |
46 crashBlock.appendChild(date); | 46 crashBlock.appendChild(date); |
47 var linkBlock = document.createElement('p'); | 47 var linkBlock = document.createElement('p'); |
48 var link = document.createElement('a'); | 48 var link = document.createElement('a'); |
49 link.href = 'http://code.google.com/p/chromium/issues/entry?' + | 49 var params = { |
50 'template=Crash%20Report&comment=' + | 50 template: 'Crash Report', |
51 'Chrome%20Version:%20' + version + '%0A' + | 51 comment: ['Chrome Version: ' + version, |
52 'Operating%20System:%20e.g.,%20"Windows%207",%20' + | 52 // TODO(tbreisacher): fill in the OS automatically? |
53 '"Mac%20OS%20X%2010.6"%0A%0A' + | 53 'Operating System: e.g., "Windows 7", "Mac OSX 10.6"', |
54 'URL%20(if%20applicable)%20where%20crash%20occurred:%20%0A%0A' + | 54 '', |
55 'Can%20you%20reproduce%20this%20crash?%0A%0A' + | 55 'URL (if applicable) where crash occurred:', |
56 'What%20steps%20will%20reproduce%20this%20crash%20' + | 56 '', |
57 '(or%20if%20it\'s%20not%20reproducible,%20what%20were%20you%20doing' + | 57 'Can you reproduce this crash?', |
58 '%20just%20before%20the%20crash)?%0A1.%0A2.%0A3.%0A%0A' + | 58 '', |
59 '*Please%20note%20that%20issues%20filed%20with%20no%20information%20' + | 59 'What steps will reproduce this crash? (or if it\'s not ' + |
60 'filled%20in%20above%20will%20be%20marked%20as%20WontFix*%0A%0A' + | 60 'reproducible, what were you doing just before the crash)?', |
61 '****DO%20NOT%20CHANGE%20BELOW%20THIS%20LINE****%0Areport_id:' + | 61 '', |
62 crash['id']; | 62 '1.', '2.', '3.', |
63 '', | |
64 '*Please note that issues filed with no information filled in ' + | |
65 'above will be marked as WontFix*', | |
66 '', | |
67 '****DO NOT CHANGE BELOW THIS LINE****', | |
68 'report_id:' + crash.id].join('\n'), | |
Dan Beam
2012/04/30 22:53:55
might be less awkward if you moved this into a sep
Tyler Breisacher (Chromium)
2012/04/30 23:18:11
Done.
| |
69 }; | |
70 var href = 'http://code.google.com/p/chromium/issues/entry?'; | |
71 for (var param in params) { | |
72 href += encodeURIComponent(param) + '=' + | |
Dan Beam
2012/04/30 22:53:55
use appendParam() from util.js instead
Tyler Breisacher (Chromium)
2012/04/30 23:18:11
Done.
| |
73 encodeURIComponent(params[param]) + '&'; | |
74 } | |
75 link.href = href; | |
63 link.target = '_blank'; | 76 link.target = '_blank'; |
64 link.textContent = localStrings.getString('bugLinkText'); | 77 link.textContent = localStrings.getString('bugLinkText'); |
65 linkBlock.appendChild(link); | 78 linkBlock.appendChild(link); |
66 crashBlock.appendChild(linkBlock); | 79 crashBlock.appendChild(linkBlock); |
67 crashSection.appendChild(crashBlock); | 80 crashSection.appendChild(crashBlock); |
68 } | 81 } |
69 | 82 |
70 $('noCrashes').hidden = crashes.length != 0; | 83 $('noCrashes').hidden = crashes.length != 0; |
71 } | 84 } |
72 | 85 |
73 document.addEventListener('DOMContentLoaded', requestCrashes); | 86 document.addEventListener('DOMContentLoaded', requestCrashes); |
OLD | NEW |