| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 this._viewport.setStickToBottom(true); | 81 this._viewport.setStickToBottom(true); |
| 82 this._viewport.contentElement().classList.add("console-group", "console-grou
p-messages"); | 82 this._viewport.contentElement().classList.add("console-group", "console-grou
p-messages"); |
| 83 this._contentsElement.appendChild(this._viewport.element); | 83 this._contentsElement.appendChild(this._viewport.element); |
| 84 this._messagesElement = this._viewport.element; | 84 this._messagesElement = this._viewport.element; |
| 85 this._messagesElement.id = "console-messages"; | 85 this._messagesElement.id = "console-messages"; |
| 86 this._messagesElement.classList.add("monospace"); | 86 this._messagesElement.classList.add("monospace"); |
| 87 this._messagesElement.addEventListener("click", this._messagesClicked.bind(t
his), true); | 87 this._messagesElement.addEventListener("click", this._messagesClicked.bind(t
his), true); |
| 88 | 88 |
| 89 this._viewportThrottler = new WebInspector.Throttler(50); | 89 this._viewportThrottler = new WebInspector.Throttler(50); |
| 90 | 90 |
| 91 this._filterStatusMessageElement = document.createElementWithClass("div", "c
onsole-message"); | 91 this._filterStatusMessageElement = createElementWithClass("div", "console-me
ssage"); |
| 92 this._messagesElement.insertBefore(this._filterStatusMessageElement, this._m
essagesElement.firstChild); | 92 this._messagesElement.insertBefore(this._filterStatusMessageElement, this._m
essagesElement.firstChild); |
| 93 this._filterStatusTextElement = this._filterStatusMessageElement.createChild
("span", "console-info"); | 93 this._filterStatusTextElement = this._filterStatusMessageElement.createChild
("span", "console-info"); |
| 94 this._filterStatusMessageElement.createTextChild(" "); | 94 this._filterStatusMessageElement.createTextChild(" "); |
| 95 var resetFiltersLink = this._filterStatusMessageElement.createChild("span",
"console-info node-link"); | 95 var resetFiltersLink = this._filterStatusMessageElement.createChild("span",
"console-info node-link"); |
| 96 resetFiltersLink.textContent = WebInspector.UIString("Show all messages."); | 96 resetFiltersLink.textContent = WebInspector.UIString("Show all messages."); |
| 97 resetFiltersLink.addEventListener("click", this._filter.reset.bind(this._fil
ter), true); | 97 resetFiltersLink.addEventListener("click", this._filter.reset.bind(this._fil
ter), true); |
| 98 | 98 |
| 99 this._topGroup = WebInspector.ConsoleGroup.createTopGroup(); | 99 this._topGroup = WebInspector.ConsoleGroup.createTopGroup(); |
| 100 this._currentGroup = this._topGroup; | 100 this._currentGroup = this._topGroup; |
| 101 | 101 |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 /** | 335 /** |
| 336 * @param {!WebInspector.ExecutionContext} executionContext | 336 * @param {!WebInspector.ExecutionContext} executionContext |
| 337 */ | 337 */ |
| 338 _executionContextCreated: function(executionContext) | 338 _executionContextCreated: function(executionContext) |
| 339 { | 339 { |
| 340 // FIXME(413886): We never want to show execution context for the main t
hread of shadow page in service/shared worker frontend. | 340 // FIXME(413886): We never want to show execution context for the main t
hread of shadow page in service/shared worker frontend. |
| 341 // This check could be removed once we do not send this context to front
end. | 341 // This check could be removed once we do not send this context to front
end. |
| 342 if (WebInspector.isWorkerFrontend() && executionContext.target() === Web
Inspector.targetManager.mainTarget()) | 342 if (WebInspector.isWorkerFrontend() && executionContext.target() === Web
Inspector.targetManager.mainTarget()) |
| 343 return; | 343 return; |
| 344 | 344 |
| 345 var newOption = document.createElement("option"); | 345 var newOption = createElement("option"); |
| 346 newOption.__executionContext = executionContext; | 346 newOption.__executionContext = executionContext; |
| 347 newOption.text = this._titleFor(executionContext); | 347 newOption.text = this._titleFor(executionContext); |
| 348 this._optionByExecutionContext.set(executionContext, newOption); | 348 this._optionByExecutionContext.set(executionContext, newOption); |
| 349 var sameGroupExists = false; | 349 var sameGroupExists = false; |
| 350 var options = this._executionContextSelector.selectElement().options; | 350 var options = this._executionContextSelector.selectElement().options; |
| 351 var insertBeforeOption = null; | 351 var insertBeforeOption = null; |
| 352 for (var i = 0; i < options.length; ++i) { | 352 for (var i = 0; i < options.length; ++i) { |
| 353 var optionContext = options[i].__executionContext; | 353 var optionContext = options[i].__executionContext; |
| 354 var isSameGroup = executionContext.target() === optionContext.target
() && executionContext.frameId === optionContext.frameId; | 354 var isSameGroup = executionContext.target() === optionContext.target
() && executionContext.frameId === optionContext.frameId; |
| 355 sameGroupExists |= isSameGroup; | 355 sameGroupExists |= isSameGroup; |
| (...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1147 regexObject.lastIndex = 0; | 1147 regexObject.lastIndex = 0; |
| 1148 return regexObject.test(this.text); | 1148 return regexObject.test(this.text); |
| 1149 }, | 1149 }, |
| 1150 | 1150 |
| 1151 /** | 1151 /** |
| 1152 * @return {!Element} | 1152 * @return {!Element} |
| 1153 */ | 1153 */ |
| 1154 contentElement: function() | 1154 contentElement: function() |
| 1155 { | 1155 { |
| 1156 if (!this._element) { | 1156 if (!this._element) { |
| 1157 this._element = document.createElementWithClass("div", "console-user
-command"); | 1157 this._element = createElementWithClass("div", "console-user-command"
); |
| 1158 this._element.message = this; | 1158 this._element.message = this; |
| 1159 | 1159 |
| 1160 this._formatCommand(); | 1160 this._formatCommand(); |
| 1161 this._element.appendChild(this._formattedCommand); | 1161 this._element.appendChild(this._formattedCommand); |
| 1162 } | 1162 } |
| 1163 return this._element; | 1163 return this._element; |
| 1164 }, | 1164 }, |
| 1165 | 1165 |
| 1166 _formatCommand: function() | 1166 _formatCommand: function() |
| 1167 { | 1167 { |
| 1168 this._formattedCommand = document.createElementWithClass("span", "consol
e-message-text source-code"); | 1168 this._formattedCommand = createElementWithClass("span", "console-message
-text source-code"); |
| 1169 this._formattedCommand.textContent = this.text; | 1169 this._formattedCommand.textContent = this.text; |
| 1170 }, | 1170 }, |
| 1171 | 1171 |
| 1172 __proto__: WebInspector.ConsoleViewMessage.prototype | 1172 __proto__: WebInspector.ConsoleViewMessage.prototype |
| 1173 } | 1173 } |
| 1174 | 1174 |
| 1175 /** | 1175 /** |
| 1176 * @constructor | 1176 * @constructor |
| 1177 * @extends {WebInspector.ConsoleViewMessage} | 1177 * @extends {WebInspector.ConsoleViewMessage} |
| 1178 * @param {!WebInspector.ConsoleMessage} message | 1178 * @param {!WebInspector.ConsoleMessage} message |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { | 1266 WebInspector.ConsoleView.ShowConsoleActionDelegate.prototype = { |
| 1267 /** | 1267 /** |
| 1268 * @return {boolean} | 1268 * @return {boolean} |
| 1269 */ | 1269 */ |
| 1270 handleAction: function() | 1270 handleAction: function() |
| 1271 { | 1271 { |
| 1272 WebInspector.console.show(); | 1272 WebInspector.console.show(); |
| 1273 return true; | 1273 return true; |
| 1274 } | 1274 } |
| 1275 } | 1275 } |
| OLD | NEW |