| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2009 Joseph Pecoraro | 3 * Copyright (C) 2009 Joseph Pecoraro |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 static clearConsole() { | 172 static clearConsole() { |
| 173 for (var target of SDK.targetManager.targets()) { | 173 for (var target of SDK.targetManager.targets()) { |
| 174 target.runtimeModel.discardConsoleEntries(); | 174 target.runtimeModel.discardConsoleEntries(); |
| 175 target.consoleModel.requestClearMessages(); | 175 target.consoleModel.requestClearMessages(); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 /** | 179 /** |
| 180 * @param {!Node} node |
| 181 * @return {string} |
| 182 */ |
| 183 static _contentTransform(node) { |
| 184 var originalLinkText = Components.Linkifier.originalLinkText(node.parentElem
ent); |
| 185 if (typeof originalLinkText === 'string') |
| 186 return originalLinkText; |
| 187 return node.textContent; |
| 188 } |
| 189 |
| 190 /** |
| 180 * @return {!UI.SearchableView} | 191 * @return {!UI.SearchableView} |
| 181 */ | 192 */ |
| 182 searchableView() { | 193 searchableView() { |
| 183 return this._searchableView; | 194 return this._searchableView; |
| 184 } | 195 } |
| 185 | 196 |
| 186 _clearHistory() { | 197 _clearHistory() { |
| 187 this._consoleHistorySetting.set([]); | 198 this._consoleHistorySetting.set([]); |
| 188 this._prompt.history().setHistoryData([]); | 199 this._prompt.history().setHistoryData([]); |
| 189 } | 200 } |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 */ | 671 */ |
| 661 function writeNextChunk(stream, error) { | 672 function writeNextChunk(stream, error) { |
| 662 if (messageIndex >= this.itemCount() || error) { | 673 if (messageIndex >= this.itemCount() || error) { |
| 663 stream.close(); | 674 stream.close(); |
| 664 progressIndicator.done(); | 675 progressIndicator.done(); |
| 665 return; | 676 return; |
| 666 } | 677 } |
| 667 var lines = []; | 678 var lines = []; |
| 668 for (var i = 0; i < chunkSize && i + messageIndex < this.itemCount(); ++i)
{ | 679 for (var i = 0; i < chunkSize && i + messageIndex < this.itemCount(); ++i)
{ |
| 669 var message = this.itemElement(messageIndex + i); | 680 var message = this.itemElement(messageIndex + i); |
| 670 var messageContent = message.contentElement().deepTextContent(); | 681 var messageContent = message.contentElement().deepTextContent(Console.Co
nsoleView._contentTransform); |
| 671 for (var j = 0; j < message.repeatCount(); ++j) | 682 for (var j = 0; j < message.repeatCount(); ++j) |
| 672 lines.push(messageContent); | 683 lines.push(messageContent); |
| 673 } | 684 } |
| 674 messageIndex += i; | 685 messageIndex += i; |
| 675 stream.write(lines.join('\n') + '\n', writeNextChunk.bind(this)); | 686 stream.write(lines.join('\n') + '\n', writeNextChunk.bind(this)); |
| 676 progressIndicator.setWorked(messageIndex); | 687 progressIndicator.setWorked(messageIndex); |
| 677 } | 688 } |
| 678 } | 689 } |
| 679 | 690 |
| 680 /** | 691 /** |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1336 return true; | 1347 return true; |
| 1337 } | 1348 } |
| 1338 return false; | 1349 return false; |
| 1339 } | 1350 } |
| 1340 }; | 1351 }; |
| 1341 | 1352 |
| 1342 /** | 1353 /** |
| 1343 * @typedef {{messageIndex: number, matchIndex: number}} | 1354 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1344 */ | 1355 */ |
| 1345 Console.ConsoleView.RegexMatchRange; | 1356 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |