Chromium Code Reviews| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 this._filterStatusTextElement = this._filterStatusMessageElement.createChild ('span', 'console-info'); | 96 this._filterStatusTextElement = this._filterStatusMessageElement.createChild ('span', 'console-info'); |
| 97 this._filterStatusMessageElement.createTextChild(' '); | 97 this._filterStatusMessageElement.createTextChild(' '); |
| 98 var resetFiltersLink = this._filterStatusMessageElement.createChild('span', 'console-info link'); | 98 var resetFiltersLink = this._filterStatusMessageElement.createChild('span', 'console-info link'); |
| 99 resetFiltersLink.textContent = Common.UIString('Show all messages.'); | 99 resetFiltersLink.textContent = Common.UIString('Show all messages.'); |
| 100 resetFiltersLink.addEventListener('click', this._filter.reset.bind(this._fil ter), true); | 100 resetFiltersLink.addEventListener('click', this._filter.reset.bind(this._fil ter), true); |
| 101 | 101 |
| 102 this._topGroup = Console.ConsoleGroup.createTopGroup(); | 102 this._topGroup = Console.ConsoleGroup.createTopGroup(); |
| 103 this._currentGroup = this._topGroup; | 103 this._currentGroup = this._topGroup; |
| 104 | 104 |
| 105 this._promptElement = this._messagesElement.createChild('div', 'source-code' ); | 105 this._promptElement = this._messagesElement.createChild('div', 'source-code' ); |
| 106 var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-ico n'); | |
| 107 this._promptElement.appendChild(promptIcon); | |
| 106 this._promptElement.id = 'console-prompt'; | 108 this._promptElement.id = 'console-prompt'; |
| 107 this._promptElement.addEventListener('input', this._promptInput.bind(this), false); | 109 this._promptElement.addEventListener('input', this._promptInput.bind(this), false); |
| 108 | 110 |
| 109 // FIXME: This is a workaround for the selection machinery bug. See crbug.co m/410899 | 111 // FIXME: This is a workaround for the selection machinery bug. See crbug.co m/410899 |
| 110 var selectAllFixer = this._messagesElement.createChild('div', 'console-view- fix-select-all'); | 112 var selectAllFixer = this._messagesElement.createChild('div', 'console-view- fix-select-all'); |
| 111 selectAllFixer.textContent = '.'; | 113 selectAllFixer.textContent = '.'; |
| 112 | 114 |
| 113 this._showAllMessagesCheckbox = new UI.ToolbarCheckbox(Common.UIString('Show all messages')); | 115 this._showAllMessagesCheckbox = new UI.ToolbarCheckbox(Common.UIString('Show all messages')); |
| 114 this._showAllMessagesCheckbox.inputElement.checked = true; | 116 this._showAllMessagesCheckbox.inputElement.checked = true; |
| 115 this._showAllMessagesCheckbox.inputElement.addEventListener('change', this._ updateMessageList.bind(this), false); | 117 this._showAllMessagesCheckbox.inputElement.addEventListener('change', this._ updateMessageList.bind(this), false); |
| (...skipping 1082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1198 super(message, linkifier, nestingLevel); | 1200 super(message, linkifier, nestingLevel); |
| 1199 } | 1201 } |
| 1200 | 1202 |
| 1201 /** | 1203 /** |
| 1202 * @override | 1204 * @override |
| 1203 * @return {!Element} | 1205 * @return {!Element} |
| 1204 */ | 1206 */ |
| 1205 contentElement() { | 1207 contentElement() { |
| 1206 if (!this._contentElement) { | 1208 if (!this._contentElement) { |
| 1207 this._contentElement = createElementWithClass('div', 'console-user-command '); | 1209 this._contentElement = createElementWithClass('div', 'console-user-command '); |
| 1210 var icon = UI.Icon.create('smallicon-user-command', 'command-result-icon') ; | |
| 1211 this._contentElement.appendChild(icon); | |
| 1212 | |
| 1208 this._contentElement.message = this; | 1213 this._contentElement.message = this; |
| 1209 | 1214 |
| 1210 this._formattedCommand = createElementWithClass('span', 'source-code'); | 1215 this._formattedCommand = createElementWithClass('span', 'source-code'); |
| 1211 this._formattedCommand.textContent = this.text.replaceControlCharacters(); | 1216 this._formattedCommand.textContent = this.text.replaceControlCharacters(); |
| 1212 this._contentElement.appendChild(this._formattedCommand); | 1217 this._contentElement.appendChild(this._formattedCommand); |
| 1213 | 1218 |
| 1214 if (this._formattedCommand.textContent.length < Console.ConsoleCommand.Max LengthToIgnoreHighlighter) { | 1219 if (this._formattedCommand.textContent.length < Console.ConsoleCommand.Max LengthToIgnoreHighlighter) { |
| 1215 var javascriptSyntaxHighlighter = new UI.DOMSyntaxHighlighter('text/java script', true); | 1220 var javascriptSyntaxHighlighter = new UI.DOMSyntaxHighlighter('text/java script', true); |
| 1216 javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand). then(this._updateSearch.bind(this)); | 1221 javascriptSyntaxHighlighter.syntaxHighlightNode(this._formattedCommand). then(this._updateSearch.bind(this)); |
| 1217 } else { | 1222 } else { |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 1246 super(message, linkifier, nestingLevel); | 1251 super(message, linkifier, nestingLevel); |
| 1247 } | 1252 } |
| 1248 | 1253 |
| 1249 /** | 1254 /** |
| 1250 * @override | 1255 * @override |
| 1251 * @return {!Element} | 1256 * @return {!Element} |
| 1252 */ | 1257 */ |
| 1253 contentElement() { | 1258 contentElement() { |
| 1254 var element = super.contentElement(); | 1259 var element = super.contentElement(); |
| 1255 element.classList.add('console-user-command-result'); | 1260 element.classList.add('console-user-command-result'); |
| 1261 if (this.consoleMessage().level === SDK.ConsoleMessage.MessageLevel.Log) { | |
|
dgozman
2016/11/29 04:22:03
Looking at css, this should be !==
lushnikov
2016/11/29 06:17:00
The relevant CSS is:
.console-log-level .console
| |
| 1262 var icon = UI.Icon.create('smallicon-command-result', 'command-result-icon '); | |
| 1263 element.insertBefore(icon, element.firstChild); | |
| 1264 } | |
| 1256 this.updateTimestamp(false); | 1265 this.updateTimestamp(false); |
| 1257 return element; | 1266 return element; |
| 1258 } | 1267 } |
| 1259 }; | 1268 }; |
| 1260 | 1269 |
| 1261 /** | 1270 /** |
| 1262 * @unrestricted | 1271 * @unrestricted |
| 1263 */ | 1272 */ |
| 1264 Console.ConsoleGroup = class { | 1273 Console.ConsoleGroup = class { |
| 1265 /** | 1274 /** |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1327 return true; | 1336 return true; |
| 1328 } | 1337 } |
| 1329 return false; | 1338 return false; |
| 1330 } | 1339 } |
| 1331 }; | 1340 }; |
| 1332 | 1341 |
| 1333 /** | 1342 /** |
| 1334 * @typedef {{messageIndex: number, matchIndex: number}} | 1343 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1335 */ | 1344 */ |
| 1336 Console.ConsoleView.RegexMatchRange; | 1345 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |