| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 tx.executeSql("SELECT * FROM " + this.tableName, null, InspectorCont
roller.wrapCallback(this._queryFinished.bind(this)), InspectorController.wrapCal
lback(this._queryError.bind(this))); | 58 tx.executeSql("SELECT * FROM " + this.tableName, null, InspectorCont
roller.wrapCallback(this._queryFinished.bind(this)), InspectorController.wrapCal
lback(this._queryError.bind(this))); |
| 59 } | 59 } |
| 60 | 60 |
| 61 this.database.database.transaction(InspectorController.wrapCallback(quer
yTransaction.bind(this)), InspectorController.wrapCallback(this._queryError.bind
(this))); | 61 this.database.database.transaction(InspectorController.wrapCallback(quer
yTransaction.bind(this)), InspectorController.wrapCallback(this._queryError.bind
(this))); |
| 62 }, | 62 }, |
| 63 | 63 |
| 64 _queryFinished: function(tx, result) | 64 _queryFinished: function(tx, result) |
| 65 { | 65 { |
| 66 this.element.removeChildren(); | 66 this.element.removeChildren(); |
| 67 | 67 |
| 68 var dataGrid = WebInspector.panels.databases.dataGridForResult(result); | 68 var dataGrid = WebInspector.panels.storage.dataGridForResult(result); |
| 69 if (!dataGrid) { | 69 if (!dataGrid) { |
| 70 var emptyMsgElement = document.createElement("div"); | 70 var emptyMsgElement = document.createElement("div"); |
| 71 emptyMsgElement.className = "storage-table-empty"; | 71 emptyMsgElement.className = "storage-table-empty"; |
| 72 emptyMsgElement.textContent = WebInspector.UIString("The “%s”\ntable
is empty.", this.tableName); | 72 emptyMsgElement.textContent = WebInspector.UIString("The “%s”\ntable
is empty.", this.tableName); |
| 73 this.element.appendChild(emptyMsgElement); | 73 this.element.appendChild(emptyMsgElement); |
| 74 return; | 74 return; |
| 75 } | 75 } |
| 76 | 76 |
| 77 this.element.appendChild(dataGrid.element); | 77 this.element.appendChild(dataGrid.element); |
| 78 }, | 78 }, |
| 79 | 79 |
| 80 _queryError: function(tx, error) | 80 _queryError: function(tx, error) |
| 81 { | 81 { |
| 82 this.element.removeChildren(); | 82 this.element.removeChildren(); |
| 83 | 83 |
| 84 var errorMsgElement = document.createElement("div"); | 84 var errorMsgElement = document.createElement("div"); |
| 85 errorMsgElement.className = "storage-table-error"; | 85 errorMsgElement.className = "storage-table-error"; |
| 86 errorMsgElement.textContent = WebInspector.UIString("An error occurred t
rying to\nread the “%s” table.", this.tableName); | 86 errorMsgElement.textContent = WebInspector.UIString("An error occurred t
rying to\nread the “%s” table.", this.tableName); |
| 87 this.element.appendChild(errorMsgElement); | 87 this.element.appendChild(errorMsgElement); |
| 88 }, | 88 }, |
| 89 | 89 |
| 90 _refreshButtonClicked: function(event) | 90 _refreshButtonClicked: function(event) |
| 91 { | 91 { |
| 92 this.update(); | 92 this.update(); |
| 93 } | 93 } |
| 94 } | 94 } |
| 95 | 95 |
| 96 WebInspector.DatabaseTableView.prototype.__proto__ = WebInspector.View.prototype
; | 96 WebInspector.DatabaseTableView.prototype.__proto__ = WebInspector.View.prototype
; |
| OLD | NEW |