Changeset 222003 in webkit


Ignore:
Timestamp:
Sep 13, 2017 5:32:04 PM (7 years ago)
Author:
webkit@devinrousso.com
Message:

Web Inspector: allow recordings to be saved via ⌘-S in the Recording tab
https://bugs.webkit.org/show_bug.cgi?id=175284

Reviewed by Matt Baker.

  • UserInterface/Views/RecordingContentView.js:

(WI.RecordingContentView.prototype.get supportsSave):
(WI.RecordingContentView.prototype.get saveData):

  • UserInterface/Views/RecordingNavigationSidebarPanel.js:

(WI.RecordingNavigationSidebarPanel.prototype._exportNavigationItemClicked):
Use the current content view's saveData when exporting.

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r222002 r222003  
     12017-09-13  Devin Rousso  <webkit@devinrousso.com>
     2
     3        Web Inspector: allow recordings to be saved via ⌘-S in the Recording tab
     4        https://bugs.webkit.org/show_bug.cgi?id=175284
     5
     6        Reviewed by Matt Baker.
     7
     8        * UserInterface/Views/RecordingContentView.js:
     9        (WI.RecordingContentView.prototype.get supportsSave):
     10        (WI.RecordingContentView.prototype.get saveData):
     11
     12        * UserInterface/Views/RecordingNavigationSidebarPanel.js:
     13        (WI.RecordingNavigationSidebarPanel.prototype._exportNavigationItemClicked):
     14        Use the current content view's saveData when exporting.
     15
    1162017-09-13  Devin Rousso  <webkit@devinrousso.com>
    217
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js

    r221695 r222003  
    135135            supplementalRepresentedObjects.push(this.representedObject);
    136136        return supplementalRepresentedObjects;
     137    }
     138
     139    get supportsSave()
     140    {
     141        return true;
     142    }
     143
     144    get saveData()
     145    {
     146        return {
     147            url: "web-inspector:///Recording.json",
     148            content: JSON.stringify(this.representedObject.toJSON()),
     149            forceSaveAs: true,
     150        };
    137151    }
    138152
  • trunk/Source/WebInspectorUI/UserInterface/Views/RecordingNavigationSidebarPanel.js

    r221844 r222003  
    186186    _exportNavigationItemClicked(event)
    187187    {
    188         if (!this._recording)
     188        if (!this._recording || !this.contentBrowser || !this.contentBrowser.currentContentView || !this.contentBrowser.currentContentView.supportsSave)
    189189            return;
    190190
    191191        const forceSaveAs = true;
    192         WI.saveDataToFile({
    193             url: "web-inspector:///Recording.json",
    194             content: JSON.stringify(this._recording.toJSON()),
    195         }, forceSaveAs);
     192        WI.saveDataToFile(this.contentBrowser.currentContentView.saveData, forceSaveAs);
    196193    }
    197194};
Note: See TracChangeset for help on using the changeset viewer.