| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 this._prompt.setSuggestBoxEnabled(true); | 134 this._prompt.setSuggestBoxEnabled(true); |
| 135 this._prompt.setAutocompletionTimeout(0); | 135 this._prompt.setAutocompletionTimeout(0); |
| 136 this._prompt.renderAsBlock(); | 136 this._prompt.renderAsBlock(); |
| 137 var proxyElement = this._prompt.attach(this._promptElement); | 137 var proxyElement = this._prompt.attach(this._promptElement); |
| 138 proxyElement.addEventListener("keydown", this._promptKeyDown.bind(this), fal
se); | 138 proxyElement.addEventListener("keydown", this._promptKeyDown.bind(this), fal
se); |
| 139 | 139 |
| 140 this._consoleHistorySetting = WebInspector.settings.createLocalSetting("cons
oleHistory", []); | 140 this._consoleHistorySetting = WebInspector.settings.createLocalSetting("cons
oleHistory", []); |
| 141 var historyData = this._consoleHistorySetting.get(); | 141 var historyData = this._consoleHistorySetting.get(); |
| 142 this._prompt.setHistoryData(historyData); | 142 this._prompt.setHistoryData(historyData); |
| 143 | 143 |
| 144 this._consoleHistoryAutocompleteSetting = WebInspector.moduleSetting("consol
eHistoryAutocomplete"); |
| 145 this._consoleHistoryAutocompleteSetting.addChangeListener(this._consoleHisto
ryAutocompleteChanged, this); |
| 146 this._consoleHistoryAutocompleteChanged(); |
| 147 |
| 144 this._updateFilterStatus(); | 148 this._updateFilterStatus(); |
| 145 WebInspector.moduleSetting("consoleTimestampsEnabled").addChangeListener(thi
s._consoleTimestampsSettingChanged, this); | 149 WebInspector.moduleSetting("consoleTimestampsEnabled").addChangeListener(thi
s._consoleTimestampsSettingChanged, this); |
| 146 | 150 |
| 147 this._registerWithMessageSink(); | 151 this._registerWithMessageSink(); |
| 148 WebInspector.targetManager.observeTargets(this); | 152 WebInspector.targetManager.observeTargets(this); |
| 149 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.MainFrameNavigated, this._onMainFrameNavigated, this); | 153 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Event
s.MainFrameNavigated, this._onMainFrameNavigated, this); |
| 150 | 154 |
| 151 this._initConsoleMessages(); | 155 this._initConsoleMessages(); |
| 152 | 156 |
| 153 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,
this._executionContextChanged, this); | 157 WebInspector.context.addFlavorChangeListener(WebInspector.ExecutionContext,
this._executionContextChanged, this); |
| 154 } | 158 } |
| 155 | 159 |
| 156 WebInspector.ConsoleView.persistedHistorySize = 300; | 160 WebInspector.ConsoleView.persistedHistorySize = 300; |
| 157 | 161 |
| 158 WebInspector.ConsoleView.prototype = { | 162 WebInspector.ConsoleView.prototype = { |
| 159 /** | 163 /** |
| 160 * @return {!WebInspector.SearchableView} | 164 * @return {!WebInspector.SearchableView} |
| 161 */ | 165 */ |
| 162 searchableView: function() | 166 searchableView: function() |
| 163 { | 167 { |
| 164 return this._searchableView; | 168 return this._searchableView; |
| 165 }, | 169 }, |
| 166 | 170 |
| 167 _clearHistory: function() | 171 _clearHistory: function() |
| 168 { | 172 { |
| 169 this._consoleHistorySetting.set([]); | 173 this._consoleHistorySetting.set([]); |
| 170 this._prompt.setHistoryData([]); | 174 this._prompt.setHistoryData([]); |
| 171 }, | 175 }, |
| 172 | 176 |
| 177 _consoleHistoryAutocompleteChanged: function() |
| 178 { |
| 179 this._prompt.setAddCompletionsFromHistory(this._consoleHistoryAutocomple
teSetting.get()); |
| 180 }, |
| 181 |
| 173 /** | 182 /** |
| 174 * @param {!WebInspector.Event} event | 183 * @param {!WebInspector.Event} event |
| 175 */ | 184 */ |
| 176 _onMainFrameNavigated: function(event) | 185 _onMainFrameNavigated: function(event) |
| 177 { | 186 { |
| 178 var frame = /** @type {!WebInspector.ResourceTreeFrame} */(event.data); | 187 var frame = /** @type {!WebInspector.ResourceTreeFrame} */(event.data); |
| 179 WebInspector.console.log(WebInspector.UIString("Navigated to %s", frame.
url)); | 188 WebInspector.console.log(WebInspector.UIString("Navigated to %s", frame.
url)); |
| 180 }, | 189 }, |
| 181 | 190 |
| 182 _initConsoleMessages: function() | 191 _initConsoleMessages: function() |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 return true; | 1331 return true; |
| 1323 } | 1332 } |
| 1324 return false; | 1333 return false; |
| 1325 } | 1334 } |
| 1326 } | 1335 } |
| 1327 | 1336 |
| 1328 /** | 1337 /** |
| 1329 * @typedef {{messageIndex: number, matchIndex: number}} | 1338 * @typedef {{messageIndex: number, matchIndex: number}} |
| 1330 */ | 1339 */ |
| 1331 WebInspector.ConsoleView.RegexMatchRange; | 1340 WebInspector.ConsoleView.RegexMatchRange; |
| OLD | NEW |