Changeset 109349 in webkit


Ignore:
Timestamp:
Mar 1, 2012 8:34:05 AM (12 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: [InspectorIndexedDB] Show tooltips with IndexedDB objects meta information
https://bugs.webkit.org/show_bug.cgi?id=80022

Reviewed by Pavel Feldman.

Added tooltips with meta information for IndexedDB databases, object stores and indexes.
Added keyPath: prefix to key columns in IndexedDB data grid.

  • English.lproj/localizedStrings.js:
  • inspector/front-end/IndexedDBViews.js:

(WebInspector.IDBDataView.prototype._createDataGrid):
(WebInspector.IDBDataView.prototype._keyPathHeader):

  • inspector/front-end/ResourcesPanel.js:

(WebInspector.IDBDatabaseTreeElement.prototype.update):
(WebInspector.IDBDatabaseTreeElement.prototype._updateTooltip):
(WebInspector.IDBObjectStoreTreeElement.prototype.update):
(WebInspector.IDBObjectStoreTreeElement.prototype._updateTooltip):
(WebInspector.IDBIndexTreeElement.prototype.update):
(WebInspector.IDBIndexTreeElement.prototype._updateTooltip):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r109348 r109349  
     12012-03-01  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: [InspectorIndexedDB] Show tooltips with IndexedDB objects meta information
     4        https://bugs.webkit.org/show_bug.cgi?id=80022
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Added tooltips with meta information for IndexedDB databases, object stores and indexes.
     9        Added keyPath: prefix to key columns in IndexedDB data grid.
     10
     11        * English.lproj/localizedStrings.js:
     12        * inspector/front-end/IndexedDBViews.js:
     13        (WebInspector.IDBDataView.prototype._createDataGrid):
     14        (WebInspector.IDBDataView.prototype._keyPathHeader):
     15        * inspector/front-end/ResourcesPanel.js:
     16        (WebInspector.IDBDatabaseTreeElement.prototype.update):
     17        (WebInspector.IDBDatabaseTreeElement.prototype._updateTooltip):
     18        (WebInspector.IDBObjectStoreTreeElement.prototype.update):
     19        (WebInspector.IDBObjectStoreTreeElement.prototype._updateTooltip):
     20        (WebInspector.IDBIndexTreeElement.prototype.update):
     21        (WebInspector.IDBIndexTreeElement.prototype._updateTooltip):
     22
    1232012-03-01  Pavel Feldman  <pfeldman@google.com>
    224
  • trunk/Source/WebCore/inspector/front-end/IndexedDBViews.js

    r109223 r109349  
    141141        var keyPath = this._isIndex ? this._index.keyPath : this._objectStore.keyPath;
    142142        columns["key"] = {};
    143         var keyColumnTitle = WebInspector.UIString("Key") + (keyPath ? " (" + keyPath + ")" : "");
     143        var keyColumnTitle = WebInspector.UIString("Key") + this._keyPathHeader(keyPath);
    144144        columns["key"].title = keyColumnTitle;
    145145
    146146        if (this._isIndex) {
    147147            columns["primaryKey"] = {};
    148             var primaryKeyColumnTitle = WebInspector.UIString("Primary key") + (this._objectStore.keyPath ? " (" + this._objectStore.keyPath + ")" : "");
     148            var primaryKeyColumnTitle = WebInspector.UIString("Primary key") + this._keyPathHeader(this._objectStore.keyPath);
    149149            columns["primaryKey"].title = primaryKeyColumnTitle;
    150150        }
     
    155155        var dataGrid = new WebInspector.DataGrid(columns);
    156156        return dataGrid;
     157    },
     158
     159    /**
     160     * @return {string}
     161     */
     162    _keyPathHeader: function(keyPath)
     163    {
     164        if (!keyPath)
     165            return "";
     166        return " (" + WebInspector.UIString("keyPath") + ": \"" + keyPath + "\")";
    157167    },
    158168
  • trunk/Source/WebCore/inspector/front-end/ResourcesPanel.js

    r109223 r109349  
    16801680        if (this._view)
    16811681            this._view.update(database);
     1682       
     1683        this._updateTooltip();
     1684    },
     1685
     1686    _updateTooltip: function()
     1687    {
     1688        this.tooltip = WebInspector.UIString("Version") + ": " + this._database.version;
    16821689    },
    16831690
     
    17481755        if (this._view)
    17491756            this._view.update(this._objectStore);
     1757       
     1758        this._updateTooltip();
     1759    },
     1760
     1761    _updateTooltip: function()
     1762    {
     1763        this.tooltip = this._objectStore.keyPath ? (WebInspector.UIString("Key path") + ": " + this._objectStore.keyPath) : "";
    17501764    },
    17511765
     
    17951809        if (this._view)
    17961810            this._view.update(this._index);
     1811       
     1812        this._updateTooltip();
     1813    },
     1814
     1815    _updateTooltip: function()
     1816    {
     1817        var tooltipLines = [];
     1818        tooltipLines.push(WebInspector.UIString("Key path") + ": " + this._index.keyPath);
     1819        if (this._index.unique)
     1820            tooltipLines.push(WebInspector.UIString("unique"));
     1821        if (this._index.multiEntry)
     1822            tooltipLines.push(WebInspector.UIString("multiEntry"));
     1823        this.tooltip = tooltipLines.join("\n");
    17971824    },
    17981825
Note: See TracChangeset for help on using the changeset viewer.