| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 if (!query.length) | 128 if (!query.length) |
| 129 return; | 129 return; |
| 130 | 130 |
| 131 this._prompt.setText(''); | 131 this._prompt.setText(''); |
| 132 | 132 |
| 133 this.database.executeSql(query, this._queryFinished.bind(this, query), this.
_queryError.bind(this, query)); | 133 this.database.executeSql(query, this._queryFinished.bind(this, query), this.
_queryError.bind(this, query)); |
| 134 } | 134 } |
| 135 | 135 |
| 136 _queryFinished(query, columnNames, values) { | 136 _queryFinished(query, columnNames, values) { |
| 137 var dataGrid = DataGrid.SortableDataGrid.create(columnNames, values); | 137 var dataGrid = DataGrid.SortableDataGrid.create(columnNames, values); |
| 138 dataGrid.setStriped(true); |
| 138 var trimmedQuery = query.trim(); | 139 var trimmedQuery = query.trim(); |
| 139 | 140 |
| 140 if (dataGrid) { | 141 if (dataGrid) { |
| 141 dataGrid.renderInline(); | 142 dataGrid.renderInline(); |
| 142 this._appendViewQueryResult(trimmedQuery, dataGrid.asWidget()); | 143 this._appendViewQueryResult(trimmedQuery, dataGrid.asWidget()); |
| 143 dataGrid.autoSizeColumns(5); | 144 dataGrid.autoSizeColumns(5); |
| 144 } | 145 } |
| 145 | 146 |
| 146 if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i)) | 147 if (trimmedQuery.match(/^create /i) || trimmedQuery.match(/^drop table /i)) |
| 147 this.dispatchEventToListeners(Resources.DatabaseQueryView.Events.SchemaUpd
ated, this.database); | 148 this.dispatchEventToListeners(Resources.DatabaseQueryView.Events.SchemaUpd
ated, this.database); |
| (...skipping 44 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 |