Changeset 109223 in webkit
- Timestamp:
- Feb 29, 2012 9:40:55 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r109221 r109223 1 2012-02-27 Vsevolod Vlasov <vsevik@chromium.org> 2 3 Web Inspector: [InspectorIndexedDB] Add refresh to IndexedDB support. 4 https://bugs.webkit.org/show_bug.cgi?id=79695 5 6 Reviewed by Pavel Feldman. 7 8 * inspector/front-end/IndexedDBViews.js: 9 (WebInspector.IDBDataView): 10 (WebInspector.IDBDataView.prototype._refreshButtonClicked): 11 (WebInspector.IDBDataView.prototype.get statusBarItems): 12 * inspector/front-end/ResourcesPanel.js: 13 (WebInspector.IndexedDBTreeElement): 14 (WebInspector.IndexedDBTreeElement.prototype.onattach): 15 (WebInspector.IndexedDBTreeElement.prototype._handleContextMenuEvent): 16 (WebInspector.IDBDatabaseTreeElement.prototype.onattach): 17 (WebInspector.IDBDatabaseTreeElement.prototype._handleContextMenuEvent): 18 (WebInspector.IDBDatabaseTreeElement.prototype._refreshIndexedDB): 19 1 20 2012-02-29 Andrey Kosyakov <caseq@chromium.org> 2 21 -
trunk/Source/WebCore/inspector/front-end/IndexedDBViews.js
r108495 r109223 38 38 WebInspector.View.call(this); 39 39 this.registerRequiredCSS("indexedDBViews.css"); 40 40 41 41 this.element.addStyleClass("fill"); 42 42 this.element.addStyleClass("indexed-db-database-view"); 43 43 44 44 this._headersListElement = this.element.createChild("ol", "outline-disclosure"); 45 45 this._headersTreeOutline = new TreeOutline(this._headersListElement); 46 46 this._headersTreeOutline.expandTreeElementsWhenArrowing = true; 47 47 48 48 this._securityOriginTreeElement = new TreeElement("", null, false); 49 49 this._securityOriginTreeElement.selectable = false; … … 106 106 WebInspector.View.call(this); 107 107 this.registerRequiredCSS("indexedDBViews.css"); 108 109 this._model = model; 108 109 this._model = model; 110 110 this._databaseId = databaseId; 111 111 this._isIndex = !!index; … … 115 115 var editorToolbar = this._createEditorToolbar(); 116 116 this.element.appendChild(editorToolbar); 117 117 118 118 this._dataGridContainer = this.element.createChild("div", "fill"); 119 119 this._dataGridContainer.addStyleClass("data-grid-container"); 120 121 this._refreshButton = new WebInspector.StatusBarButton(WebInspector.UIString("Refresh"), "refresh-storage-status-bar-item"); 122 this._refreshButton.addEventListener("click", this._refreshButtonClicked, this); 120 123 121 124 this._pageSize = 50; … … 135 138 columns["number"].title = WebInspector.UIString("#"); 136 139 columns["number"].width = "50px"; 137 140 138 141 var keyPath = this._isIndex ? this._index.keyPath : this._objectStore.keyPath; 139 142 columns["key"] = {}; 140 143 var keyColumnTitle = WebInspector.UIString("Key") + (keyPath ? " (" + keyPath + ")" : ""); 141 144 columns["key"].title = keyColumnTitle; 142 145 143 146 if (this._isIndex) { 144 147 columns["primaryKey"] = {}; … … 146 149 columns["primaryKey"].title = primaryKeyColumnTitle; 147 150 } 148 151 149 152 columns["value"] = {}; 150 153 columns["value"].title = WebInspector.UIString("Value"); … … 170 173 this._pageBackButton.addEventListener("click", this._pageBackButtonClicked.bind(this), false); 171 174 editorToolbar.appendChild(this._pageBackButton); 172 175 173 176 this._pageForwardButton = editorToolbar.createChild("button", "forward-button"); 174 177 this._pageForwardButton.addStyleClass("status-bar-item"); … … 178 181 this._pageForwardButton.addEventListener("click", this._pageForwardButtonClicked.bind(this), false); 179 182 editorToolbar.appendChild(this._pageForwardButton); 180 183 181 184 this._keyInputElement = editorToolbar.createChild("input", "key-input"); 182 185 this._keyInputElement.placeholder = WebInspector.UIString("Start from key"); … … 194 197 this._updateData(false); 195 198 }, 196 199 197 200 _pageForwardButtonClicked: function() 198 201 { … … 200 203 this._updateData(false); 201 204 }, 202 205 203 206 _keyInputChanged: function() 204 207 { 205 window.setTimeout(this._updateData.bind(this, false), 0); 206 }, 207 208 window.setTimeout(this._updateData.bind(this, false), 0); 209 }, 210 208 211 /** 209 212 * @param {WebInspector.IndexedDBModel.ObjectStore} objectStore … … 221 224 222 225 this._skipCount = 0; 223 this._updateData(true); 224 }, 225 226 this._updateData(true); 227 }, 228 226 229 /** 227 230 * @param {string} keyString … … 237 240 return result; 238 241 }, 239 242 240 243 /** 241 244 * @return {string} … … 256 259 var pageSize = this._pageSize; 257 260 var skipCount = this._skipCount; 258 261 259 262 if (!force && this._lastKey === key && this._lastPageSize === pageSize && this._lastSkipCount === skipCount) 260 263 return; … … 287 290 this._dataGrid.appendChild(node); 288 291 } 289 292 290 293 this._pageBackButton.disabled = skipCount === 0; 291 294 this._pageForwardButton.disabled = !hasMore; 292 295 } 293 296 294 297 var idbKeyRange = key ? window.webkitIDBKeyRange.lowerBound(key) : null; 295 298 if (this._isIndex) … … 298 301 this._model.loadObjectStoreData(this._databaseId, this._objectStore.name, idbKeyRange, skipCount, pageSize, callback.bind(this)); 299 302 }, 303 304 _refreshButtonClicked: function(event) 305 { 306 this._updateData(true); 307 }, 308 309 get statusBarItems() 310 { 311 return [this._refreshButton.element]; 312 } 300 313 } 301 314 … … 311 324 { 312 325 WebInspector.DataGridNode.call(this, data, false); 313 326 314 327 this._valueTitle = valueTitle; 315 328 this.selectable = false; … … 324 337 if (columnIdentifier !== "value") 325 338 return WebInspector.DataGridNode.prototype.createCell.call(this, columnIdentifier); 326 339 327 340 var section = new WebInspector.ObjectPropertiesSection(this.data["value"], this._valueTitle) 328 341 section.editable = false; -
trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js
r108495 r109223 1514 1514 }, 1515 1515 1516 onattach: function() 1517 { 1518 WebInspector.StorageCategoryTreeElement.prototype.onattach.call(this); 1519 this.listItemElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true); 1520 }, 1521 1522 _handleContextMenuEvent: function(event) 1523 { 1524 var contextMenu = new WebInspector.ContextMenu(); 1525 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this.refreshIndexedDB.bind(this)); 1526 contextMenu.show(event); 1527 }, 1528 1516 1529 _createIndexedDBModel: function() 1517 1530 { … … 1618 1631 }, 1619 1632 1633 onattach: function() 1634 { 1635 WebInspector.BaseStorageTreeElement.prototype.onattach.call(this); 1636 this.listItemElement.addEventListener("contextmenu", this._handleContextMenuEvent.bind(this), true); 1637 }, 1638 1639 _handleContextMenuEvent: function(event) 1640 { 1641 var contextMenu = new WebInspector.ContextMenu(); 1642 contextMenu.appendItem(WebInspector.UIString("Refresh IndexedDB"), this._refreshIndexedDB.bind(this)); 1643 contextMenu.show(event); 1644 }, 1645 1646 _refreshIndexedDB: function(event) 1647 { 1648 this._model.refreshDatabaseNames(); 1649 }, 1650 1620 1651 /** 1621 1652 * @param {WebInspector.IndexedDBModel.Database} database … … 1641 1672 } 1642 1673 } 1643 1674 1644 1675 if (this.children.length) { 1645 1676 this.hasChildren = true; … … 1657 1688 this._view = new WebInspector.IDBDatabaseView(this._database); 1658 1689 1659 this._storagePanel.showIndexedDB(this._view); 1690 this._storagePanel.showIndexedDB(this._view); 1660 1691 } 1661 1692 } … … 1709 1740 } 1710 1741 } 1711 1742 1712 1743 if (this.children.length) { 1713 1744 this.hasChildren = true; … … 1725 1756 this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, null); 1726 1757 1727 this._storagePanel.showIndexedDB(this._view); 1758 this._storagePanel.showIndexedDB(this._view); 1728 1759 } 1729 1760 } … … 1761 1792 { 1762 1793 this._index = index; 1763 1794 1764 1795 if (this._view) 1765 1796 this._view.update(this._index); … … 1772 1803 this._view = new WebInspector.IDBDataView(this._model, this._databaseId, this._objectStore, this._index); 1773 1804 1774 this._storagePanel.showIndexedDB(this._view); 1805 this._storagePanel.showIndexedDB(this._view); 1775 1806 } 1776 1807 }
Note: See TracChangeset
for help on using the changeset viewer.