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

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

Issue 2894113002: Revert of DevTools: Roll Lighthouse binary to 2.0.0-alpha.7 (Closed)
Patch Set: Created 3 years, 7 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 this._hideDialog(); 253 this._hideDialog();
254 } 254 }
255 255
256 /** 256 /**
257 * @param {!Error} err 257 * @param {!Error} err
258 */ 258 */
259 _renderBugReport(err) { 259 _renderBugReport(err) {
260 console.error(err); 260 console.error(err);
261 this._statusElement.textContent = ''; 261 this._statusElement.textContent = '';
262 this._statusIcon.classList.add('error'); 262 this._statusIcon.classList.add('error');
263 this._statusElement.createTextChild(Common.UIString('Ah, sorry! We ran into an error: ')); 263 this._statusElement.createTextChild(Common.UIString('We ran into an error. ' ));
264 this._statusElement.createChild('em').createTextChild(err.message);
265 this._createBugReportLink(err, this._statusElement); 264 this._createBugReportLink(err, this._statusElement);
266 } 265 }
267 266
268 /** 267 /**
269 * @param {!Error} err 268 * @param {!Error} err
270 * @param {!Element} parentElem 269 * @param {!Element} parentElem
271 */ 270 */
272 _createBugReportLink(err, parentElem) { 271 _createBugReportLink(err, parentElem) {
273 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?'; 272 var baseURI = 'https://github.com/GoogleChrome/lighthouse/issues/new?';
274 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 )); 273 var title = encodeURI('title=DevTools Error: ' + err.message.substring(0, 60 ));
275 274
276 var issueBody = ` 275 var qsBody = '';
277 **Initial URL**: ${this._inspectedURL} 276 qsBody += '**Initial URL**: ' + this._inspectedURL + '\n';
278 **Chrome Version**: ${navigator.userAgent.match(/Chrome\/(\S+)/)[1]} 277 qsBody += '**Chrome Version**: ' + navigator.userAgent.match(/Chrome\/(\S+)/ )[1] + '\n';
279 **Error Message**: ${err.message} 278 qsBody += '**Error Message**: ' + err.message + '\n';
280 **Stack Trace**: 279 qsBody += '**Stack Trace**:\n ```' + err.stack + '```';
281 \`\`\` 280 var body = '&body=' + encodeURI(qsBody);
282 ${err.stack} 281
283 \`\`\`
284 `;
285 var body = '&body=' + encodeURI(issueBody.trim());
286 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error'); 282 var reportErrorEl = parentElem.createChild('a', 'audits2-link audits2-report -error');
287 reportErrorEl.href = baseURI + title + body; 283 reportErrorEl.href = baseURI + title + body;
288 reportErrorEl.textContent = Common.UIString('Report this bug'); 284 reportErrorEl.textContent = Common.UIString('Report this bug');
289 reportErrorEl.target = '_blank'; 285 reportErrorEl.target = '_blank';
290 } 286 }
291 287
292 /** 288 /**
293 * @param {!DataTransfer} dataTransfer 289 * @param {!DataTransfer} dataTransfer
294 */ 290 */
295 _handleDrop(dataTransfer) { 291 _handleDrop(dataTransfer) {
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 return; 642 return;
647 643
648 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet); 644 var element = Components.DOMPresentationUtils.linkifyNodeReference(node, undefined, detailsItem.snippet);
649 origElement.title = ''; 645 origElement.title = '';
650 origElement.textContent = ''; 646 origElement.textContent = '';
651 origElement.appendChild(element); 647 origElement.appendChild(element);
652 }); 648 });
653 }); 649 });
654 } 650 }
655 }; 651 };
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