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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Issue 2644753002: DevTools: untruncate links on copy (Closed)
Patch Set: ac Created 3 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
4 * Copyright (C) 2009 Joseph Pecoraro 4 * Copyright (C) 2009 Joseph Pecoraro
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 9 *
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 /** 118 /**
119 * @param {!SDK.ConsoleMessage} consoleMessage 119 * @param {!SDK.ConsoleMessage} consoleMessage
120 * @return {!Element} 120 * @return {!Element}
121 */ 121 */
122 _buildTableMessage(consoleMessage) { 122 _buildTableMessage(consoleMessage) {
123 var formattedMessage = createElement('span'); 123 var formattedMessage = createElement('span');
124 UI.appendStyle(formattedMessage, 'object_ui/objectValue.css'); 124 UI.appendStyle(formattedMessage, 'object_ui/objectValue.css');
125 formattedMessage.className = 'source-code'; 125 formattedMessage.className = 'source-code';
126 var anchorElement = this._buildMessageAnchor(consoleMessage); 126 var anchorElement = this._buildMessageAnchor(consoleMessage);
127 this._anchorElementForTest = anchorElement;
lushnikov 2017/04/04 01:07:07 query it!
luoe 2017/04/04 19:56:34 Done.
127 if (anchorElement) 128 if (anchorElement)
128 formattedMessage.appendChild(anchorElement); 129 formattedMessage.appendChild(anchorElement);
129 130
130 var table = consoleMessage.parameters && consoleMessage.parameters.length ? consoleMessage.parameters[0] : null; 131 var table = consoleMessage.parameters && consoleMessage.parameters.length ? consoleMessage.parameters[0] : null;
131 if (table) 132 if (table)
132 table = this._parameterToRemoteObject(table, this._target()); 133 table = this._parameterToRemoteObject(table, this._target());
133 if (!table || !table.preview) 134 if (!table || !table.preview)
134 return formattedMessage; 135 return formattedMessage;
135 136
136 var columnNames = []; 137 var columnNames = [];
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 var args = consoleMessage.parameters || [messageText]; 257 var args = consoleMessage.parameters || [messageText];
257 messageElement = this._format(args); 258 messageElement = this._format(args);
258 } 259 }
259 messageElement.classList.add('console-message-text'); 260 messageElement.classList.add('console-message-text');
260 261
261 var formattedMessage = createElement('span'); 262 var formattedMessage = createElement('span');
262 UI.appendStyle(formattedMessage, 'object_ui/objectValue.css'); 263 UI.appendStyle(formattedMessage, 'object_ui/objectValue.css');
263 formattedMessage.className = 'source-code'; 264 formattedMessage.className = 'source-code';
264 265
265 var anchorElement = this._buildMessageAnchor(consoleMessage); 266 var anchorElement = this._buildMessageAnchor(consoleMessage);
267 this._anchorElementForTest = anchorElement;
266 if (anchorElement) 268 if (anchorElement)
267 formattedMessage.appendChild(anchorElement); 269 formattedMessage.appendChild(anchorElement);
268 formattedMessage.appendChild(messageElement); 270 formattedMessage.appendChild(messageElement);
269 return formattedMessage; 271 return formattedMessage;
270 272
271 /** 273 /**
272 * @param {string} title 274 * @param {string} title
273 * @return {!Element} 275 * @return {!Element}
274 * @this {SDK.ConsoleMessage} 276 * @this {SDK.ConsoleMessage}
275 */ 277 */
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 return this._message.messageText; 1061 return this._message.messageText;
1060 } 1062 }
1061 1063
1062 /** 1064 /**
1063 * @return {string} 1065 * @return {string}
1064 */ 1066 */
1065 toExportString() { 1067 toExportString() {
1066 var lines = []; 1068 var lines = [];
1067 var nodes = this.contentElement().childTextNodes(); 1069 var nodes = this.contentElement().childTextNodes();
1068 var messageContent = ''; 1070 var messageContent = '';
1069 for (var i = 0; i < nodes.length; ++i) { 1071 for (var i = 0; i < nodes.length; ++i)
1070 var originalLinkText = Components.Linkifier.originalLinkText(nodes[i].pare ntElement); 1072 messageContent += Console.ConsoleViewport.contentTransform(nodes[i]);
1071 messageContent += typeof originalLinkText === 'string' ? originalLinkText : nodes[i].textContent;
1072 }
1073 for (var i = 0; i < this.repeatCount(); ++i) 1073 for (var i = 0; i < this.repeatCount(); ++i)
1074 lines.push(messageContent); 1074 lines.push(messageContent);
1075 return lines.join('\n'); 1075 return lines.join('\n');
1076 } 1076 }
1077 1077
1078 /** 1078 /**
1079 * @param {?RegExp} regex 1079 * @param {?RegExp} regex
1080 */ 1080 */
1081 setSearchRegex(regex) { 1081 setSearchRegex(regex) {
1082 if (this._searchHiglightNodeChanges && this._searchHiglightNodeChanges.lengt h) 1082 if (this._searchHiglightNodeChanges && this._searchHiglightNodeChanges.lengt h)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 toMessageElement() { 1247 toMessageElement() {
1248 if (!this._element) { 1248 if (!this._element) {
1249 super.toMessageElement(); 1249 super.toMessageElement();
1250 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); 1250 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon');
1251 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); 1251 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild);
1252 this.setCollapsed(this._collapsed); 1252 this.setCollapsed(this._collapsed);
1253 } 1253 }
1254 return this._element; 1254 return this._element;
1255 } 1255 }
1256 }; 1256 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698