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 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 { | 1246 { |
1247 return this.contentElement(); | 1247 return this.contentElement(); |
1248 }, | 1248 }, |
1249 | 1249 |
1250 /** | 1250 /** |
1251 * @override | 1251 * @override |
1252 * @return {!Element} | 1252 * @return {!Element} |
1253 */ | 1253 */ |
1254 contentElement: function() | 1254 contentElement: function() |
1255 { | 1255 { |
1256 if (!this._element) { | 1256 if (!this._contentElement) { |
1257 this._element = createElementWithClass("div", "console-user-command"
); | 1257 this._contentElement = createElementWithClass("div", "console-user-c
ommand"); |
1258 this._element.message = this; | 1258 this._contentElement.message = this; |
1259 | 1259 |
1260 this._formattedCommand = createElementWithClass("span", "console-mes
sage-text source-code"); | 1260 this._formattedCommand = createElementWithClass("span", "console-mes
sage-text source-code"); |
1261 this._formattedCommand.textContent = this.text.replaceControlCharact
ers(); | 1261 this._formattedCommand.textContent = this.text.replaceControlCharact
ers(); |
1262 this._element.appendChild(this._formattedCommand); | 1262 this._contentElement.appendChild(this._formattedCommand); |
1263 | 1263 |
1264 if (this._formattedCommand.textContent.length < WebInspector.Console
Command.MaxLengthToIgnoreHighlighter) { | 1264 if (this._formattedCommand.textContent.length < WebInspector.Console
Command.MaxLengthToIgnoreHighlighter) { |
1265 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHigh
lighter("text/javascript", true); | 1265 var javascriptSyntaxHighlighter = new WebInspector.DOMSyntaxHigh
lighter("text/javascript", true); |
1266 javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedC
ommand).then(this._updateSearch.bind(this)) | 1266 javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedC
ommand).then(this._updateSearch.bind(this)) |
1267 } else { | 1267 } else { |
1268 this._updateSearch(); | 1268 this._updateSearch(); |
1269 } | 1269 } |
1270 } | 1270 } |
1271 return this._element; | 1271 return this._contentElement; |
1272 }, | 1272 }, |
1273 | 1273 |
1274 _updateSearch: function() | 1274 _updateSearch: function() |
1275 { | 1275 { |
1276 this.setSearchRegex(this.searchRegex()); | 1276 this.setSearchRegex(this.searchRegex()); |
1277 }, | 1277 }, |
1278 | 1278 |
1279 __proto__: WebInspector.ConsoleViewMessage.prototype | 1279 __proto__: WebInspector.ConsoleViewMessage.prototype |
1280 } | 1280 } |
1281 | 1281 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1417 return true; | 1417 return true; |
1418 } | 1418 } |
1419 return false; | 1419 return false; |
1420 } | 1420 } |
1421 } | 1421 } |
1422 | 1422 |
1423 /** | 1423 /** |
1424 * @typedef {{messageIndex: number, matchIndex: number}} | 1424 * @typedef {{messageIndex: number, matchIndex: number}} |
1425 */ | 1425 */ |
1426 WebInspector.ConsoleView.RegexMatchRange; | 1426 WebInspector.ConsoleView.RegexMatchRange; |
OLD | NEW |