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

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, 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
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 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 get text() { 1059 get text() {
1060 return this._message.messageText; 1060 return this._message.messageText;
1061 } 1061 }
1062 1062
1063 /** 1063 /**
1064 * @return {string} 1064 * @return {string}
1065 */ 1065 */
1066 toExportString() { 1066 toExportString() {
1067 var lines = []; 1067 var lines = [];
1068 var nodes = this.contentElement().childTextNodes(); 1068 var nodes = this.contentElement().childTextNodes();
1069 var messageContent = ''; 1069 var messageContent = nodes.map(Components.Linkifier.untruncatedNodeText).joi n('');
1070 for (var i = 0; i < nodes.length; ++i) {
1071 var originalLinkText = Components.Linkifier.originalLinkText(nodes[i].pare ntElement);
1072 messageContent += typeof originalLinkText === 'string' ? originalLinkText : nodes[i].textContent;
1073 }
1074 for (var i = 0; i < this.repeatCount(); ++i) 1070 for (var i = 0; i < this.repeatCount(); ++i)
1075 lines.push(messageContent); 1071 lines.push(messageContent);
1076 return lines.join('\n'); 1072 return lines.join('\n');
1077 } 1073 }
1078 1074
1079 /** 1075 /**
1080 * @param {?RegExp} regex 1076 * @param {?RegExp} regex
1081 */ 1077 */
1082 setSearchRegex(regex) { 1078 setSearchRegex(regex) {
1083 if (this._searchHiglightNodeChanges && this._searchHiglightNodeChanges.lengt h) 1079 if (this._searchHiglightNodeChanges && this._searchHiglightNodeChanges.lengt h)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1248 toMessageElement() { 1244 toMessageElement() {
1249 if (!this._element) { 1245 if (!this._element) {
1250 super.toMessageElement(); 1246 super.toMessageElement();
1251 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon'); 1247 this._expandGroupIcon = UI.Icon.create('', 'expand-group-icon');
1252 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild); 1248 this._contentElement.insertBefore(this._expandGroupIcon, this._contentElem ent.firstChild);
1253 this.setCollapsed(this._collapsed); 1249 this.setCollapsed(this._collapsed);
1254 } 1250 }
1255 return this._element; 1251 return this._element;
1256 } 1252 }
1257 }; 1253 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698