| 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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 /** | 53 /** |
| 54 * @type {!Array.<!Console.ConsoleView.RegexMatchRange>} | 54 * @type {!Array.<!Console.ConsoleView.RegexMatchRange>} |
| 55 */ | 55 */ |
| 56 this._regexMatchRanges = []; | 56 this._regexMatchRanges = []; |
| 57 this._filter = new Console.ConsoleViewFilter(this._updateMessageList.bind(th
is)); | 57 this._filter = new Console.ConsoleViewFilter(this._updateMessageList.bind(th
is)); |
| 58 | 58 |
| 59 this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-conte
xt'); | 59 this._executionContextComboBox = new UI.ToolbarComboBox(null, 'console-conte
xt'); |
| 60 this._executionContextComboBox.setMaxWidth(80); | 60 this._executionContextComboBox.setMaxWidth(80); |
| 61 this._consoleContextSelector = new Console.ConsoleContextSelector(this._exec
utionContextComboBox.selectElement()); | 61 this._consoleContextSelector = new Console.ConsoleContextSelector(this._exec
utionContextComboBox.selectElement()); |
| 62 | 62 |
| 63 this._filterStatusText = new UI.ToolbarText(); |
| 64 this._filterStatusText.element.classList.add('dimmed'); |
| 63 this._showSettingsPaneSetting = Common.settings.createSetting('consoleShowSe
ttingsToolbar', false); | 65 this._showSettingsPaneSetting = Common.settings.createSetting('consoleShowSe
ttingsToolbar', false); |
| 64 this._showSettingsPaneButton = new UI.ToolbarSettingToggle( | 66 this._showSettingsPaneButton = new UI.ToolbarSettingToggle( |
| 65 this._showSettingsPaneSetting, 'largeicon-settings-gear', Common.UIStrin
g('Console settings')); | 67 this._showSettingsPaneSetting, 'largeicon-settings-gear', Common.UIStrin
g('Console settings')); |
| 66 | |
| 67 this._progressToolbarItem = new UI.ToolbarItem(createElement('div')); | 68 this._progressToolbarItem = new UI.ToolbarItem(createElement('div')); |
| 68 | 69 |
| 69 var toolbar = new UI.Toolbar('', this._contentsElement); | 70 var toolbar = new UI.Toolbar('', this._contentsElement); |
| 70 toolbar.appendToolbarItem(UI.Toolbar.createActionButton( | 71 toolbar.appendToolbarItem(UI.Toolbar.createActionButton( |
| 71 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); | 72 /** @type {!UI.Action }*/ (UI.actionRegistry.action('console.clear')))); |
| 72 toolbar.appendSeparator(); | 73 toolbar.appendSeparator(); |
| 73 toolbar.appendToolbarItem(this._executionContextComboBox); | 74 toolbar.appendToolbarItem(this._executionContextComboBox); |
| 74 toolbar.appendSeparator(); | 75 toolbar.appendSeparator(); |
| 75 toolbar.appendToolbarItem(this._filter._textFilterUI); | 76 toolbar.appendToolbarItem(this._filter._textFilterUI); |
| 76 toolbar.appendToolbarItem(this._filter._levelComboBox); | 77 toolbar.appendToolbarItem(this._filter._levelComboBox); |
| 77 toolbar.appendToolbarItem(this._progressToolbarItem); | 78 toolbar.appendToolbarItem(this._progressToolbarItem); |
| 78 toolbar.appendSpacer(); | 79 toolbar.appendSpacer(); |
| 79 toolbar.appendText(''); | 80 toolbar.appendToolbarItem(this._filterStatusText); |
| 80 toolbar.appendSeparator(); | 81 toolbar.appendSeparator(); |
| 81 toolbar.appendToolbarItem(this._showSettingsPaneButton); | 82 toolbar.appendToolbarItem(this._showSettingsPaneButton); |
| 82 | 83 |
| 83 this._preserveLogCheckbox = new UI.ToolbarSettingCheckbox( | 84 this._preserveLogCheckbox = new UI.ToolbarSettingCheckbox( |
| 84 Common.moduleSetting('preserveConsoleLog'), Common.UIString('Do not clea
r log on page reload / navigation'), | 85 Common.moduleSetting('preserveConsoleLog'), Common.UIString('Do not clea
r log on page reload / navigation'), |
| 85 Common.UIString('Preserve log')); | 86 Common.UIString('Preserve log')); |
| 86 this._hideNetworkMessagesCheckbox = new UI.ToolbarSettingCheckbox( | 87 this._hideNetworkMessagesCheckbox = new UI.ToolbarSettingCheckbox( |
| 87 this._filter._hideNetworkMessagesSetting, this._filter._hideNetworkMessa
gesSetting.title(), | 88 this._filter._hideNetworkMessagesSetting, this._filter._hideNetworkMessa
gesSetting.title(), |
| 88 Common.UIString('Hide network')); | 89 Common.UIString('Hide network')); |
| 89 var monitoringXHREnabledSetting = Common.moduleSetting('monitoringXHREnabled
'); | 90 var monitoringXHREnabledSetting = Common.moduleSetting('monitoringXHREnabled
'); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 114 this._viewport.setStickToBottom(true); | 115 this._viewport.setStickToBottom(true); |
| 115 this._viewport.contentElement().classList.add('console-group', 'console-grou
p-messages'); | 116 this._viewport.contentElement().classList.add('console-group', 'console-grou
p-messages'); |
| 116 this._contentsElement.appendChild(this._viewport.element); | 117 this._contentsElement.appendChild(this._viewport.element); |
| 117 this._messagesElement = this._viewport.element; | 118 this._messagesElement = this._viewport.element; |
| 118 this._messagesElement.id = 'console-messages'; | 119 this._messagesElement.id = 'console-messages'; |
| 119 this._messagesElement.classList.add('monospace'); | 120 this._messagesElement.classList.add('monospace'); |
| 120 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t
his), true); | 121 this._messagesElement.addEventListener('click', this._messagesClicked.bind(t
his), true); |
| 121 | 122 |
| 122 this._viewportThrottler = new Common.Throttler(50); | 123 this._viewportThrottler = new Common.Throttler(50); |
| 123 | 124 |
| 124 this._filterStatusMessageElement = createElementWithClass('div', 'console-me
ssage'); | |
| 125 this._messagesElement.insertBefore(this._filterStatusMessageElement, this._m
essagesElement.firstChild); | |
| 126 this._filterStatusTextElement = this._filterStatusMessageElement.createChild
('span', 'console-info'); | |
| 127 this._filterStatusMessageElement.createTextChild(' '); | |
| 128 | |
| 129 this._topGroup = Console.ConsoleGroup.createTopGroup(); | 125 this._topGroup = Console.ConsoleGroup.createTopGroup(); |
| 130 this._currentGroup = this._topGroup; | 126 this._currentGroup = this._topGroup; |
| 131 | 127 |
| 132 this._promptElement = this._messagesElement.createChild('div', 'source-code'
); | 128 this._promptElement = this._messagesElement.createChild('div', 'source-code'
); |
| 133 var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-ico
n'); | 129 var promptIcon = UI.Icon.create('smallicon-text-prompt', 'console-prompt-ico
n'); |
| 134 this._promptElement.appendChild(promptIcon); | 130 this._promptElement.appendChild(promptIcon); |
| 135 this._promptElement.id = 'console-prompt'; | 131 this._promptElement.id = 'console-prompt'; |
| 136 this._promptElement.addEventListener('input', this._promptInput.bind(this),
false); | 132 this._promptElement.addEventListener('input', this._promptInput.bind(this),
false); |
| 137 | 133 |
| 138 // FIXME: This is a workaround for the selection machinery bug. See crbug.co
m/410899 | 134 // FIXME: This is a workaround for the selection machinery bug. See crbug.co
m/410899 |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 // This functions is sniffed in tests. | 424 // This functions is sniffed in tests. |
| 429 } | 425 } |
| 430 | 426 |
| 431 _immediatelyScrollToBottom() { | 427 _immediatelyScrollToBottom() { |
| 432 // This will scroll viewport and trigger its refresh. | 428 // This will scroll viewport and trigger its refresh. |
| 433 this._viewport.setStickToBottom(true); | 429 this._viewport.setStickToBottom(true); |
| 434 this._promptElement.scrollIntoView(true); | 430 this._promptElement.scrollIntoView(true); |
| 435 } | 431 } |
| 436 | 432 |
| 437 _updateFilterStatus() { | 433 _updateFilterStatus() { |
| 438 this._filterStatusTextElement.removeChildren(); | 434 this._filterStatusText.setText(Common.UIString( |
| 439 this._filterStatusTextElement.createTextChild(Common.UIString( | 435 this._hiddenByFilterCount === 1 ? '1 item hidden by filters' : |
| 440 this._hiddenByFilterCount === 1 ? '1 message is hidden by filters.' : | 436 this._hiddenByFilterCount + ' items hi
dden by filters')); |
| 441 this._hiddenByFilterCount + ' messages
are hidden by filters.')); | 437 this._filterStatusText.setVisible(!!this._hiddenByFilterCount); |
| 442 this._filterStatusMessageElement.style.display = this._hiddenByFilterCount ?
'' : 'none'; | |
| 443 } | 438 } |
| 444 | 439 |
| 445 /** | 440 /** |
| 446 * @param {!Common.Event} event | 441 * @param {!Common.Event} event |
| 447 */ | 442 */ |
| 448 _onConsoleMessageAdded(event) { | 443 _onConsoleMessageAdded(event) { |
| 449 var message = /** @type {!SDK.ConsoleMessage} */ (event.data); | 444 var message = /** @type {!SDK.ConsoleMessage} */ (event.data); |
| 450 this._addConsoleMessage(message); | 445 this._addConsoleMessage(message); |
| 451 } | 446 } |
| 452 | 447 |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 return true; | 1321 return true; |
| 1327 } | 1322 } |
| 1328 return false; | 1323 return false; |
| 1329 } | 1324 } |
| 1330 }; | 1325 }; |
| 1331 | 1326 |
| 1332 /** | 1327 /** |
| 1333 * @typedef {{messageIndex: number, matchIndex: number}} | 1328 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1334 */ | 1329 */ |
| 1335 Console.ConsoleView.RegexMatchRange; | 1330 Console.ConsoleView.RegexMatchRange; |
| OLD | NEW |