Changeset 121955 in webkit


Ignore:
Timestamp:
Jul 6, 2012 5:14:24 AM (12 years ago)
Author:
vsevik@chromium.org
Message:

Web Inspector: Implement snippets removing.
https://bugs.webkit.org/show_bug.cgi?id=90674

Reviewed by Pavel Feldman.

  • inspector/front-end/NavigatorView.js:

(WebInspector.NavigatorView.prototype.rename.afterEditing):

  • inspector/front-end/ScriptsNavigator.js:

(WebInspector.ScriptsNavigator.prototype.removeUISourceCode):
(WebInspector.SnippetsNavigatorView.prototype._handleRemoveSnippet):

  • inspector/front-end/ScriptsPanel.js:

(WebInspector.ScriptsPanel.prototype._addUISourceCode):
(WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):
(WebInspector.ScriptsPanel.prototype._revealExecutionLine):

  • inspector/front-end/TabbedEditorContainer.js:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r121953 r121955  
     12012-07-06  Vsevolod Vlasov  <vsevik@chromium.org>
     2
     3        Web Inspector: Implement snippets removing.
     4        https://bugs.webkit.org/show_bug.cgi?id=90674
     5
     6        Reviewed by Pavel Feldman.
     7
     8        * inspector/front-end/NavigatorView.js:
     9        (WebInspector.NavigatorView.prototype.rename.afterEditing):
     10        * inspector/front-end/ScriptsNavigator.js:
     11        (WebInspector.ScriptsNavigator.prototype.removeUISourceCode):
     12        (WebInspector.SnippetsNavigatorView.prototype._handleRemoveSnippet):
     13        * inspector/front-end/ScriptsPanel.js:
     14        (WebInspector.ScriptsPanel.prototype._addUISourceCode):
     15        (WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):
     16        (WebInspector.ScriptsPanel.prototype._revealExecutionLine):
     17        * inspector/front-end/TabbedEditorContainer.js:
     18
    1192012-07-06  'Pavel Feldman'  <pfeldman@chromium.org>
    220
  • trunk/Source/WebCore/inspector/front-end/NavigatorView.js

    r119905 r121955  
    162162            if (this._lastSelectedUISourceCode === oldUISourceCode)
    163163                selected = true;
    164             this._removeUISourceCode(oldUISourceCode);
     164            this.removeUISourceCode(oldUISourceCode);
    165165        }
    166166
     
    186186     * @param {WebInspector.UISourceCode} uiSourceCode
    187187     */
    188     _removeUISourceCode: function(uiSourceCode)
     188    removeUISourceCode: function(uiSourceCode)
    189189    {
    190190        var treeElement = this._scriptTreeElementsByUISourceCode.get(uiSourceCode);
     
    253253
    254254        // Tree outline should be marked as edited as well as the tree element to prevent search from starting.
    255         WebInspector.markBeingEdited(scriptTreeElement.treeOutline.element, true);
     255        var treeOutlineElement = scriptTreeElement.treeOutline.element
     256        WebInspector.markBeingEdited(treeOutlineElement, true);
    256257
    257258        function commitHandler(element, newTitle, oldTitle)
     
    274275        function afterEditing(committed)
    275276        {
    276             WebInspector.markBeingEdited(scriptTreeElement.treeOutline.element, false);
     277            WebInspector.markBeingEdited(treeOutlineElement, false);
    277278            if (callback)
    278279                callback(committed);
  • trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js

    r121673 r121955  
    9999    /**
    100100     * @param {WebInspector.UISourceCode} uiSourceCode
     101     */
     102    removeUISourceCode: function(uiSourceCode)
     103    {
     104        this._snippetsNavigatorViewForUISourceCode(uiSourceCode).removeUISourceCode(uiSourceCode);
     105    },
     106
     107    /**
     108     * @param {WebInspector.UISourceCode} uiSourceCode
    101109     * @return {boolean}
    102110     */
     
    254262    _handleRemoveSnippet: function(uiSourceCode, event)
    255263    {
    256         // FIXME: To be implemented.
     264        if (!uiSourceCode.isSnippet)
     265            return;
     266        var snippetJavaScriptSource = /** @type {WebInspector.SnippetJavaScriptSource} */ uiSourceCode;
     267        WebInspector.scriptSnippetModel.deleteScriptSnippet(snippetJavaScriptSource);
    257268    },
    258269
  • trunk/Source/WebCore/inspector/front-end/ScriptsPanel.js

    r121949 r121955  
    257257    {
    258258        this._navigator.addUISourceCode(uiSourceCode);
    259         this._editorContainer.uiSourceCodeAdded(uiSourceCode);
     259        this._editorContainer.addUISourceCode(uiSourceCode);
    260260    },
    261261
     
    263263    {
    264264        var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data;
     265        this._editorContainer.removeUISourceCode(uiSourceCode);
     266        this._navigator.removeUISourceCode(uiSourceCode);
    265267        this._removeSourceFrame(uiSourceCode);
    266268    },
     
    543545    {
    544546        // Some scripts (anonymous and snippets evaluations) are not added to files select by default.
    545         this._editorContainer.uiSourceCodeAdded(uiLocation.uiSourceCode);
     547        this._editorContainer.addUISourceCode(uiLocation.uiSourceCode);
    546548        var sourceFrame = this._showFile(uiLocation.uiSourceCode);
    547549        sourceFrame.revealLine(uiLocation.lineNumber);
  • trunk/Source/WebCore/inspector/front-end/TabbedEditorContainer.js

    r121750 r121955  
    191191     * @param {WebInspector.UISourceCode} uiSourceCode
    192192     */
    193     uiSourceCodeAdded: function(uiSourceCode)
     193    addUISourceCode: function(uiSourceCode)
    194194    {
    195195        if (this._userSelectedFiles || this._loadedURLs[uiSourceCode.url])
     
    207207            this._innerShowFile(uiSourceCode, false);
    208208    },
    209    
     209
     210    /**
     211     * @param {WebInspector.UISourceCode} uiSourceCode
     212     */
     213    removeUISourceCode: function(uiSourceCode)
     214    {
     215        var tabId = this._tabIds.get(uiSourceCode);
     216        if (tabId)
     217            this._tabbedPane.closeTab(tabId);
     218    },
     219
    210220    /**
    211221     * @param {WebInspector.UISourceCode} uiSourceCode
     
    273283        uiSourceCode.addEventListener(WebInspector.UISourceCode.Events.ContentChanged, this._uiSourceCodeContentChanged, this);
    274284        return tabId;
    275     },
    276 
    277     /**
    278      * @param {WebInspector.UISourceCode} uiSourceCode
    279      */
    280     _removeFileTab: function(uiSourceCode)
    281     {
    282         var tabId = this._tabIds.get(uiSourceCode);
    283 
    284         if (tabId)
    285             this._tabbedPane.closeTab(tabId);
    286285    },
    287286
Note: See TracChangeset for help on using the changeset viewer.