OLD | NEW |
---|---|
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 925 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
936 } | 936 } |
937 a.appendChild(toAppend); | 937 a.appendChild(toAppend); |
938 } | 938 } |
939 return a; | 939 return a; |
940 } | 940 } |
941 | 941 |
942 // String.format does treat formattedResult like a Builder, result is an object. | 942 // String.format does treat formattedResult like a Builder, result is an object. |
943 return String.format(format, parameters, formatters, formattedResult, ap pend.bind(this)); | 943 return String.format(format, parameters, formatters, formattedResult, ap pend.bind(this)); |
944 }, | 944 }, |
945 | 945 |
946 clearHighlight: function() | 946 clearHighlights: function() |
947 { | 947 { |
948 if (!this._formattedMessage) | 948 if (!this._formattedMessage) |
949 return; | 949 return; |
950 | 950 |
951 WebInspector.removeSearchResultsHighlight(this._formattedMessage); | 951 WebInspector.removeSearchResultsHighlight(this._formattedMessage); |
952 }, | 952 }, |
953 | 953 |
954 highlightSearchResults: function(regexObject) | 954 highlightSearchResults: function(regexObject) |
955 { | 955 { |
956 if (!this._formattedMessage) | 956 if (!this._formattedMessage) |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1265 break; | 1265 break; |
1266 } | 1266 } |
1267 | 1267 |
1268 return sourceString + " " + typeString + " " + levelString + ": " + this .formattedMessage().textContent + "\n" + this._message.url + " line " + this._me ssage.line; | 1268 return sourceString + " " + typeString + " " + levelString + ": " + this .formattedMessage().textContent + "\n" + this._message.url + " line " + this._me ssage.line; |
1269 }, | 1269 }, |
1270 | 1270 |
1271 get text() | 1271 get text() |
1272 { | 1272 { |
1273 return this._message.messageText; | 1273 return this._message.messageText; |
1274 }, | 1274 }, |
1275 | |
1276 /** | |
1277 * @return {!string} | |
1278 */ | |
1279 getText: function () { | |
1280 return this._messageElement.textContent; | |
robwu
2014/10/25 23:13:00
What's the difference between the text getter (a f
aknudsen
2014/10/26 11:22:40
The reason for the getText method is to implement
| |
1281 }, | |
1282 | |
1283 highlightMatch: function(start, end, isCurrent) | |
1284 { | |
1285 if (!this._formattedMessage) | |
1286 return; | |
1287 | |
1288 console.log("Highlighting from position " + start + " to " + end); | |
1289 WebInspector.highlightSearchResults(this._messageElement, | |
1290 [new WebInspector.SourceRange(start, end - start + 1)], undefined, is Current); | |
1291 }, | |
1275 } | 1292 } |
1276 | 1293 |
1277 /** | 1294 /** |
1278 * @constructor | 1295 * @constructor |
1279 * @extends {WebInspector.ConsoleViewMessage} | 1296 * @extends {WebInspector.ConsoleViewMessage} |
1280 * @param {!WebInspector.ConsoleMessage} consoleMessage | 1297 * @param {!WebInspector.ConsoleMessage} consoleMessage |
1281 * @param {!WebInspector.Linkifier} linkifier | 1298 * @param {!WebInspector.Linkifier} linkifier |
1282 * @param {number} nestingLevel | 1299 * @param {number} nestingLevel |
1283 */ | 1300 */ |
1284 WebInspector.ConsoleGroupViewMessage = function(consoleMessage, linkifier, nesti ngLevel) | 1301 WebInspector.ConsoleGroupViewMessage = function(consoleMessage, linkifier, nesti ngLevel) |
(...skipping 29 matching lines...) Expand all Loading... | |
1314 { | 1331 { |
1315 if (!this._wrapperElement) { | 1332 if (!this._wrapperElement) { |
1316 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); | 1333 WebInspector.ConsoleViewMessage.prototype.toMessageElement.call(this ); |
1317 this._wrapperElement.classList.toggle("collapsed", this._collapsed); | 1334 this._wrapperElement.classList.toggle("collapsed", this._collapsed); |
1318 } | 1335 } |
1319 return this._wrapperElement; | 1336 return this._wrapperElement; |
1320 }, | 1337 }, |
1321 | 1338 |
1322 __proto__: WebInspector.ConsoleViewMessage.prototype | 1339 __proto__: WebInspector.ConsoleViewMessage.prototype |
1323 } | 1340 } |
OLD | NEW |