Changeset 180432 in webkit


Ignore:
Timestamp:
Feb 20, 2015 11:35:27 AM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Add a setting for clearing the console on page reload
https://bugs.webkit.org/show_bug.cgi?id=134414

Patch by Ronald Jett <rjett@apple.com> on 2015-02-20
Reviewed by Timothy Hatcher.

Created a new setting "clear-log-on-reload", which defaults to true.
Users can toggle this setting with an item added to the console's context menu.
When enabled, the console will clear on page reload. When disabled, the console
content will remain during page reloads.

  • Localizations/en.lproj/localizedStrings.js:
  • UserInterface/Views/LogContentView.js:

(WebInspector.LogContentView):
(WebInspector.LogContentView.prototype._sessionStarted):
(WebInspector.LogContentView.prototype._handleContextMenuEvent):
(WebInspector.LogContentView.prototype._toggleClearLogOnReloadSetting):

Location:
trunk/Source/WebInspectorUI
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r180388 r180432  
     12015-02-20  Ronald Jett  <rjett@apple.com>
     2
     3        Web Inspector: Add a setting for clearing the console on page reload
     4        https://bugs.webkit.org/show_bug.cgi?id=134414
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        Created a new setting "clear-log-on-reload", which defaults to true.
     9        Users can toggle this setting with an item added to the console's context menu.
     10        When enabled, the console will clear on page reload. When disabled, the console
     11        content will remain during page reloads.
     12
     13        * Localizations/en.lproj/localizedStrings.js:
     14        * UserInterface/Views/LogContentView.js:
     15        (WebInspector.LogContentView):
     16        (WebInspector.LogContentView.prototype._sessionStarted):
     17        (WebInspector.LogContentView.prototype._handleContextMenuEvent):
     18        (WebInspector.LogContentView.prototype._toggleClearLogOnReloadSetting):
     19
    1202015-02-19  Saam Barati  <saambarati1@gmail.com>
    221
  • trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js

    r180117 r180432  
    8787localizedStrings["Children"] = "Children";
    8888localizedStrings["Clear Log"] = "Clear Log";
     89localizedStrings["Clear Log on Reload"] = "Clear Log on Reload";
    8990localizedStrings["Clear Timeline"] = "Clear Timeline";
    9091localizedStrings["Clear log (%s or %s)"] = "Clear log (%s or %s)";
     
    259260localizedStrings["Invalid"] = "Invalid";
    260261localizedStrings["JavaScript & Events"] = "JavaScript & Events";
     262localizedStrings["Keep Log on Reload"] = "Keep Log on Reload";
    261263localizedStrings["Key"] = "Key";
    262264localizedStrings["Label"] = "Label";
  • trunk/Source/WebInspectorUI/UserInterface/Views/LogContentView.js

    r180384 r180432  
    7373    this._clearLogNavigationItem.addEventListener(WebInspector.ButtonNavigationItem.Event.Clicked, this._clearLog, this);
    7474
     75    this._clearLogOnReloadSetting = new WebInspector.Setting("clear-log-on-reload", true);
     76
    7577    var toolTip = WebInspector.UIString("Show split console");
    7678    var altToolTip = WebInspector.UIString("Show full-height console");
     
    302304    _sessionStarted: function(event)
    303305    {
     306        if (this._clearLogOnReloadSetting.value)
     307            this._clearLog();
     308
    304309        this._logViewController.startNewSession();
    305310    },
     
    331336        var contextMenu = new WebInspector.ContextMenu(event);
    332337        contextMenu.appendItem(WebInspector.UIString("Clear Log"), this._clearLog.bind(this));
     338        contextMenu.appendSeparator();
     339
     340        var clearLogOnReloadUIString = this._clearLogOnReloadSetting.value ? WebInspector.UIString("Keep Log on Reload") : WebInspector.UIString("Clear Log on Reload");
     341
     342        contextMenu.appendItem(clearLogOnReloadUIString, this._toggleClearLogOnReloadSetting.bind(this));
     343
    333344        contextMenu.show();
    334345    },
     
    619630        else
    620631            WebInspector.showSplitConsole();
     632    },
     633
     634    _toggleClearLogOnReloadSetting: function()
     635    {
     636        this._clearLogOnReloadSetting.value = !this._clearLogOnReloadSetting.value;
    621637    },
    622638
Note: See TracChangeset for help on using the changeset viewer.