| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @constructor | 6 * @constructor |
| 7 * @extends {WebInspector.VBox} | 7 * @extends {WebInspector.VBox} |
| 8 */ | 8 */ |
| 9 WebInspector.AdvancedSearchView = function() | 9 WebInspector.AdvancedSearchView = function() |
| 10 { | 10 { |
| 11 WebInspector.VBox.call(this, true); | 11 WebInspector.VBox.call(this, true); |
| 12 this.setMinimumSize(0, 40); | 12 this.setMinimumSize(0, 40); |
| 13 this.registerRequiredCSS("sources/sourcesSearch.css"); | 13 this.registerRequiredCSS("sources/sourcesSearch.css"); |
| 14 | 14 |
| 15 this._searchId = 0; | 15 this._searchId = 0; |
| 16 | 16 |
| 17 this.contentElement.classList.add("search-view"); | 17 this.contentElement.classList.add("search-view"); |
| 18 | 18 |
| 19 this._searchPanelElement = this.contentElement.createChild("div", "search-dr
awer-header"); | 19 this._searchPanelElement = this.contentElement.createChild("div", "search-dr
awer-header"); |
| 20 this._searchPanelElement.addEventListener("keydown", this._onKeyDown.bind(th
is), false); | 20 this._searchPanelElement.addEventListener("keydown", this._onKeyDown.bind(th
is), false); |
| 21 this._searchPanelElement.addEventListener("keyup", this._onKeyUp.bind(this),
false); | 21 this._searchPanelElement.addEventListener("input", this._onInput.bind(this),
false); |
| 22 | 22 |
| 23 this._searchResultsElement = this.contentElement.createChild("div"); | 23 this._searchResultsElement = this.contentElement.createChild("div"); |
| 24 this._searchResultsElement.className = "search-results"; | 24 this._searchResultsElement.className = "search-results"; |
| 25 | 25 |
| 26 this._search = WebInspector.HistoryInput.create(); | 26 this._search = WebInspector.HistoryInput.create(); |
| 27 this._searchPanelElement.appendChild(this._search); | 27 this._searchPanelElement.appendChild(this._search); |
| 28 this._search.placeholder = WebInspector.UIString("Search all sources (use \"
file:\" to filter by path)\u200e"); | 28 this._search.placeholder = WebInspector.UIString("Search all sources (use \"
file:\" to filter by path)\u200e"); |
| 29 this._search.setAttribute("type", "text"); | 29 this._search.setAttribute("type", "text"); |
| 30 this._search.classList.add("search-config-search"); | 30 this._search.classList.add("search-config-search"); |
| 31 this._search.setAttribute("results", "0"); | 31 this._search.setAttribute("results", "0"); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 */ | 289 */ |
| 290 _onKeyDown: function(event) | 290 _onKeyDown: function(event) |
| 291 { | 291 { |
| 292 switch (event.keyCode) { | 292 switch (event.keyCode) { |
| 293 case WebInspector.KeyboardShortcut.Keys.Enter.code: | 293 case WebInspector.KeyboardShortcut.Keys.Enter.code: |
| 294 this._onAction(); | 294 this._onAction(); |
| 295 break; | 295 break; |
| 296 } | 296 } |
| 297 }, | 297 }, |
| 298 | 298 |
| 299 _onKeyUp: function() | 299 _onInput: function() |
| 300 { | 300 { |
| 301 if (this._search.value && this._search.value.length) | 301 if (this._search.value && this._search.value.length) |
| 302 this._searchInputClearElement.hidden = false; | 302 this._searchInputClearElement.hidden = false; |
| 303 else | 303 else |
| 304 this._searchInputClearElement.hidden = true; | 304 this._searchInputClearElement.hidden = true; |
| 305 }, | 305 }, |
| 306 | 306 |
| 307 _save: function() | 307 _save: function() |
| 308 { | 308 { |
| 309 this._advancedSearchConfig.set(this._buildSearchConfig().toPlainObject()
); | 309 this._advancedSearchConfig.set(this._buildSearchConfig().toPlainObject()
); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 performIndexing: function(progress) { }, | 450 performIndexing: function(progress) { }, |
| 451 | 451 |
| 452 stopSearch: function() { }, | 452 stopSearch: function() { }, |
| 453 | 453 |
| 454 /** | 454 /** |
| 455 * @param {!WebInspector.ProjectSearchConfig} searchConfig | 455 * @param {!WebInspector.ProjectSearchConfig} searchConfig |
| 456 * @return {!WebInspector.SearchResultsPane} | 456 * @return {!WebInspector.SearchResultsPane} |
| 457 */ | 457 */ |
| 458 createSearchResultsPane: function(searchConfig) { } | 458 createSearchResultsPane: function(searchConfig) { } |
| 459 } | 459 } |
| OLD | NEW |