OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 21 matching lines...) Expand all Loading... |
32 | 32 |
33 this.database = database; | 33 this.database = database; |
34 | 34 |
35 this.element.classList.add('storage-view', 'query', 'monospace'); | 35 this.element.classList.add('storage-view', 'query', 'monospace'); |
36 this.element.addEventListener('selectstart', this._selectStart.bind(this), f
alse); | 36 this.element.addEventListener('selectstart', this._selectStart.bind(this), f
alse); |
37 | 37 |
38 this._promptContainer = this.element.createChild('div', 'database-query-prom
pt-container'); | 38 this._promptContainer = this.element.createChild('div', 'database-query-prom
pt-container'); |
39 this._promptContainer.appendChild(UI.Icon.create('smallicon-text-prompt', 'p
rompt-icon')); | 39 this._promptContainer.appendChild(UI.Icon.create('smallicon-text-prompt', 'p
rompt-icon')); |
40 this._promptElement = this._promptContainer.createChild('div'); | 40 this._promptElement = this._promptContainer.createChild('div'); |
41 this._promptElement.className = 'database-query-prompt'; | 41 this._promptElement.className = 'database-query-prompt'; |
| 42 this._promptElement.setAttribute('contenteditable', 'plaintext-only'); |
42 this._promptElement.addEventListener('keydown', this._promptKeyDown.bind(thi
s), true); | 43 this._promptElement.addEventListener('keydown', this._promptKeyDown.bind(thi
s), true); |
43 | 44 |
44 this._prompt = new UI.TextPrompt(); | 45 this._prompt = new UI.TextPrompt(); |
45 this._prompt.initialize(this.completions.bind(this), ' '); | 46 this._prompt.initialize(this.completions.bind(this), ' '); |
46 this._proxyElement = this._prompt.attach(this._promptElement); | 47 this._proxyElement = this._prompt.attach(this._promptElement); |
47 | 48 |
48 this.element.addEventListener('click', this._messagesClicked.bind(this), tru
e); | 49 this.element.addEventListener('click', this._messagesClicked.bind(this), tru
e); |
49 } | 50 } |
50 | 51 |
51 _messagesClicked() { | 52 _messagesClicked() { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 resultElement.className = 'database-query-result'; | 193 resultElement.className = 'database-query-result'; |
193 element.appendChild(resultElement); | 194 element.appendChild(resultElement); |
194 return resultElement; | 195 return resultElement; |
195 } | 196 } |
196 }; | 197 }; |
197 | 198 |
198 /** @enum {symbol} */ | 199 /** @enum {symbol} */ |
199 Resources.DatabaseQueryView.Events = { | 200 Resources.DatabaseQueryView.Events = { |
200 SchemaUpdated: Symbol('SchemaUpdated') | 201 SchemaUpdated: Symbol('SchemaUpdated') |
201 }; | 202 }; |
OLD | NEW |