summaryrefslogtreecommitdiffstats
path: root/chrome/browser/resources/bug_report.html
blob: d643010e87ed5873411933f7444e2b3de6b76900 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<!DOCTYPE HTML>
<html i18n-values="dir:textdirection;">
<head>
<meta charset="utf-8"/>
<title i18n-content="title"></title>
<link rel="stylesheet" href="bug_report.css"/>

<script src="shared/js/local_strings.js"></script>
<script src="shared/js/util.js"></script>
<script src="bug_report.js"></script>
<script>

///////////////////////////////////////////////////////////////////////////////
// Document Functions:
/**
 * Window onload handler, sets up the page.
 */
function load() {
  // textContent on description-text textarea seems to default
  // to several spaces, this resets it to empty.
  $('description-text').textContent = '';

  $('current-screenshot').nextSibling.textContent =
      localStrings.getString('currentscreenshots');
<if expr="pp_ifdef('chromeos')">
  $('saved-screenshot').nextSibling.textContent =
      localStrings.getString('savedscreenshots');
</if>
  $('no-screenshot').nextSibling.textContent =
      localStrings.getString('noscreenshot');

  // Get a list of issues that we allow the user to select from.
  // Note, the order and the issues types themselves are different
  // between Chromium and Chromium OS, so this code needs to be
  // maintained individually between the bug_report.html and
  // bug_report_cros.html files.
  var issueTypeText = [];
  issueTypeText[0] = localStrings.getString('issue-choose');
<if expr="not pp_ifdef('chromeos')">
  issueTypeText[1] = localStrings.getString('issue-page-formatting');
  issueTypeText[2] = localStrings.getString('issue-page-load');
  issueTypeText[3] = localStrings.getString('issue-plugins');
  issueTypeText[4] = localStrings.getString('issue-tabs');
  issueTypeText[5] = localStrings.getString('issue-sync');
  issueTypeText[6] = localStrings.getString('issue-crashes');
  issueTypeText[7] = localStrings.getString('issue-extensions');
  issueTypeText[8] = localStrings.getString('issue-phishing');
  issueTypeText[9] = localStrings.getString('issue-other');
</if>
<if expr="pp_ifdef('chromeos')">
  issueTypeText[1] = localStrings.getString('issue-connectivity');
  issueTypeText[2] = localStrings.getString('issue-sync');
  issueTypeText[3] = localStrings.getString('issue-crashes');
  issueTypeText[4] = localStrings.getString('issue-page-formatting');
  issueTypeText[5] = localStrings.getString('issue-extensions');
  issueTypeText[6] = localStrings.getString('issue-standby');
  issueTypeText[7] = localStrings.getString('issue-phishing');
  issueTypeText[8] = localStrings.getString('issue-other');
</if>
  // Add all the issues to the selection box.
  for (var i = 0; i < issueTypeText.length; i++) {
    var option = document.createElement('option');
    option.className = 'bug-report-text';
    option.textContent = issueTypeText[i];
    $('issue-with-combo').add(option);
  }

  chrome.send('getDialogDefaults', []);
  chrome.send('refreshScreenshots', []);
};

function setupScreenshots(screenshots) {
  if (screenshots.length == 1) {
    addScreenshot('current-screenshots', screenshots[0]);
  } else {
    // We're in Chromium OS.
    currentScreenshot = screenshots[0];
    addScreenshot('current-screenshots', currentScreenshot);

    savedScreenshots = screenshots[1];
    for (i = 0; i < savedScreenshots.length; ++i)
      addScreenshot('saved-screenshots', savedScreenshots[i]);
  }
}

function setupDialogDefaults(defaults) {
  if (defaults.length > 0) {
    $('page-url-text').value = defaults[0];
    if (defaults.length > 2) {
      // We're in Chromium OS.
      $('sysinfo-url').href = defaults[1];
      $('user-email-text').value = defaults[2];
    }
  }
}

window.addEventListener('DOMContentLoaded', load);
</script>
</head>
<body>
<table>
  <!--  Issue type dropdown -->
  <tr>
    <th id="issue-with" class="bug-report-label" i18n-content="issue-with">
    </th>
  </tr>
  <tr>
    <td>
      <select id="issue-with-combo" class="bug-report-text">
      </select>
    </td>
  </tr>
  <!--  Page URL text box -->
  <tr>
    <th colspan="2" id="page-url" class="bug-report-label"
        i18n-content="page-url">
    </th>
  </tr>
  <tr>
    <td colspan="2">
      <input id='page-url-text' maxlength=200 class="bug-report-text">
    </td>
  </tr>
  <!--  Description -->
  <tr>
    <th id="description" colspan="2" class="bug-report-label"
        i18n-content="description">
    </th>
  </tr>
  <tr>
    <td colspan="2">
      <textarea id='description-text' rows="10" class="bug-report-text">
      </textarea>
    </td>
  </tr>
<if expr="pp_ifdef('chromeos')">
  <!--  System Information checkbox -->
  <tr>
    <td>
      <input id="sys-info-checkbox" type="checkbox" value="sysinfo" checked>
      <span id="sysinfo-label"></span> <a href='about:blank' id="sysinfo-url"
            target="_blank" i18n-content="sysinfo">></a>
    </td>
  </tr>
  <!--  Page URL text box -->
  <tr>
    <th id="user-email" class="bug-report-label" i18n-content="user-email">
    </th>
  </tr>
  <tr>
    <td>
      <input id='user-email-text' maxlength=200 class="bug-report-text">
    </td>
  </tr>
</if>
  <!--  Screenshot radio buttons -->
  <tr>
    <th id="screenshot" class="bug-report-label" i18n-content="screenshot">
    </th>
  </tr>
  <tr>
    <td>
      <input id="no-screenshot" type="radio" name="screenshot-group"
             value="none" onclick="noneSelected()">
      <br>
<if expr="pp_ifdef('chromeos')">
      <input id="saved-screenshot" type="radio" name="screenshot-group"
             value="saved" onclick="savedSelected()">
      <br>
      <div id="saved-screenshots" style="display: none;"
           class="thumbnail-list">
      </div>
</if>
      <input id="current-screenshot" type="radio" name="screenshot-group"
             value="current" checked onclick="currentSelected()">
      <br>
      <div id="current-screenshots" class="thumbnail-list">
      </div>
    </td>
  </tr>
  <!--  Buttons -->
  <tr>
    <td>
      <hr>
      <input id='send-report-button' type="submit" class="bug-report-button"
             i18n-values="value:send-report" onclick="sendReport()">
      <input id='cancel-button' type="submit" class="bug-report-button"
             i18n-values="value:cancel" onclick="cancel()">
    </td>
  </tr>
</table>
</body>
</html>