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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/audits2/Audits2Panel.js

Issue 2888263002: DevTools: Roll Lighthouse binary to 2.0.1-alpha.0 (Closed)
Patch Set: rebase Created 3 years, 6 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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 /** 5 /**
6 * @unrestricted 6 * @unrestricted
7 */ 7 */
8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar { 8 Audits2.Audits2Panel = class extends UI.PanelWithSidebar {
9 constructor() { 9 constructor() {
10 super('audits2'); 10 super('audits2');
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 this._hideDialog(); 291 this._hideDialog();
292 } 292 }
293 293
294 /** 294 /**
295 * @param {!Error} err 295 * @param {!Error} err
296 */ 296 */
297 _renderBugReport(err) { 297 _renderBugReport(err) {
298 console.error(err); 298 console.error(err);
299 this._statusElement.textContent = ''; 299 this._statusElement.textContent = '';
300 this._statusIcon.classList.add('error'); 300 this._statusIcon.classList.add('error');
301 this._statusElement.createTextChild(Common.UIString('We ran into an error. ' )); 301 this._statusElement.createTextChild(Common.UIString('Ah, sorry! We ran into an error: '));
302 this._statusElement.createChild('em').createTextChild(err.message);
302 this._createBugReportLink(err, this._statusElement); 303 this._createBugReportLink(err, this._statusElement);
303 } 304 }
304 305
305 /** 306 /**
306 * @param {!Error} err 307 * @param {!Error} err
307 * @param {!Element} parentElem 308 * @param {!Element} parentElem
308 */ 309 */
309 _createBugReportLink(err, parentElem) { 310 _createBugReportLink(err, parentElem) {
310 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?'; 311 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?';
311 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 )); 312 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 ));
312 313
313 var qsBody = ''; 314 var issueBody = `
314 qsBody += '**Initial URL**: ' + this._inspectedURL + '\n'; 315 **Initial URL**: ${this._inspectedURL}
315 qsBody += '**Chrome Version**: ' + navigator.userAgent.match(/Chrome\/(\S+)/ )[1] + '\n'; 316 **Chrome Version**: ${navigator.userAgent.match(/Chrome\/(\S+)/)[1]}
316 qsBody += '**Error Message**: ' + err.message + '\n'; 317 **Error Message**: ${err.message}
317 qsBody += '**Stack Trace**:\n ```' + err.stack + '```'; 318 **Stack Trace**:
318 var body = '&body=' + encodeURI(qsBody); 319 \`\`\`
319 320 ${err.stack}
321 \`\`\`
322 `;
323 var body = '&body=' + encodeURI(issueBody.trim());
320 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error'); 324 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error');
321 reportErrorEl.href = baseURI + title + body; 325 reportErrorEl.href = baseURI + title + body;
322 reportErrorEl.textContent = Common.UIString('Report this bug'); 326 reportErrorEl.textContent = Common.UIString('Report this bug');
323 reportErrorEl.target = '_blank'; 327 reportErrorEl.target = '_blank';
324 } 328 }
325 329
326 /** 330 /**
327 * @param {!DataTransfer} dataTransfer 331 * @param {!DataTransfer} dataTransfer
328 */ 332 */
329 _handleDrop(dataTransfer) { 333 _handleDrop(dataTransfer) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 return; 684 return;
681 685
682 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet); 686 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet);
683 origElement.title = ''; 687 origElement.title = '';
684 origElement.textContent = ''; 688 origElement.textContent = '';
685 origElement.appendChild(element); 689 origElement.appendChild(element);
686 }); 690 });
687 }); 691 });
688 } 692 }
689 }; 693 };
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/audits2/audits2Dialog.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698