Changeset 186634 in webkit


Ignore:
Timestamp:
Jul 9, 2015 2:54:11 PM (9 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Special Logs to Console that do not have an expression should be styled differently, looks like code
https://bugs.webkit.org/show_bug.cgi?id=143840

Reviewed by Timothy Hatcher.

  • UserInterface/Controllers/JavaScriptLogViewController.js:

(WebInspector.WebInspector.JavaScriptLogViewController.appendImmediateExecutionWithResult):
Now applies a class to special logs initiated by the user (log element, log object, etc).

  • UserInterface/Views/ConsoleCommandView.js:

(WebInspector.ConsoleCommandView): Added className parameter.

  • UserInterface/Views/ConsoleMessageView.css:

(.console-user-command.selected-element-log):
(.console-user-command.special-user-log > .console-message-text):

  • UserInterface/Views/DOMTreeOutline.js:

(WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
(WebInspector.DOMTreeOutline.prototype._populateContextMenu):

  • UserInterface/Views/ObjectPreviewView.js:

(WebInspector.ObjectPreviewView.prototype._contextMenuHandler):

  • UserInterface/Views/ObjectTreeBaseTreeElement.js:

(WebInspector.ObjectTreeBaseTreeElement.prototype._logSymbolProperty):
(WebInspector.ObjectTreeBaseTreeElement.prototype._logValue):

Location:
trunk/Source/WebInspectorUI
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r186602 r186634  
     12015-07-09  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Special Logs to Console that do not have an expression should be styled differently, looks like code
     4        https://bugs.webkit.org/show_bug.cgi?id=143840
     5
     6        Reviewed by Timothy Hatcher.
     7
     8        * UserInterface/Controllers/JavaScriptLogViewController.js:
     9        (WebInspector.WebInspector.JavaScriptLogViewController.appendImmediateExecutionWithResult):
     10        Now applies a class to special logs initiated by the user (log element, log object, etc).
     11        * UserInterface/Views/ConsoleCommandView.js:
     12        (WebInspector.ConsoleCommandView): Added className parameter.
     13        * UserInterface/Views/ConsoleMessageView.css:
     14        (.console-user-command.selected-element-log):
     15        (.console-user-command.special-user-log > .console-message-text):
     16        * UserInterface/Views/DOMTreeOutline.js:
     17        (WebInspector.DOMTreeOutline.prototype._populateContextMenu.logElement):
     18        (WebInspector.DOMTreeOutline.prototype._populateContextMenu):
     19        * UserInterface/Views/ObjectPreviewView.js:
     20        (WebInspector.ObjectPreviewView.prototype._contextMenuHandler):
     21        * UserInterface/Views/ObjectTreeBaseTreeElement.js:
     22        (WebInspector.ObjectTreeBaseTreeElement.prototype._logSymbolProperty):
     23        (WebInspector.ObjectTreeBaseTreeElement.prototype._logValue):
     24
    1252015-07-09  Devin Rousso  <drousso@apple.com>
    226
  • trunk/Source/WebInspectorUI/UserInterface/Controllers/JavaScriptLogViewController.js

    r186283 r186634  
    120120    }
    121121
    122     appendImmediateExecutionWithResult(text, result)
     122    appendImmediateExecutionWithResult(text, result, addSpecialUserLogClass)
    123123    {
    124124        console.assert(result instanceof WebInspector.RemoteObject);
    125125
    126         var commandMessageView = new WebInspector.ConsoleCommandView(text);
     126        var commandMessageView = new WebInspector.ConsoleCommandView(text, addSpecialUserLogClass ? "special-user-log" : null);
    127127        this._appendConsoleMessageView(commandMessageView, true);
    128128
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleCommandView.js

    r182579 r186634  
    3030WebInspector.ConsoleCommandView = class ConsoleCommandView extends WebInspector.Object
    3131{
    32     constructor(commandText)
     32    constructor(commandText, className)
    3333    {
    3434        super();
     
    3939        this._element.classList.add("console-user-command");
    4040        this._element.setAttribute("data-labelprefix", WebInspector.UIString("Input: "));
     41
     42        if (className)
     43            this._element.classList.add(className);
    4144
    4245        this._formattedCommandElement = this._element.appendChild(document.createElement("span"));
  • trunk/Source/WebInspectorUI/UserInterface/Views/ConsoleMessageView.css

    r185835 r186634  
    3030}
    3131
     32.console-user-command.special-user-log > .console-message-text {
     33    padding: 1px 6px;
     34    border-radius: 3px;
     35    border: 1px solid transparent;
     36    background-color: rgb(34, 131, 246);
     37    color: white;
     38    font-size: 10px;
     39    -webkit-user-select: none;
     40}
     41
    3242.console-message .repeat-count {
    3343    display: inline-block;
  • trunk/Source/WebInspectorUI/UserInterface/Views/DOMTreeOutline.js

    r185485 r186634  
    513513                    return;
    514514                var text = WebInspector.UIString("Selected Element");
    515                 WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject);
     515                WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, remoteObject, true);
    516516            });
    517517        }
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectPreviewView.js

    r185886 r186634  
    264264                WebInspector.quickConsole.prompt.pushHistoryItem(text);
    265265
    266             WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, this._remoteObject);
     266            WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, this._remoteObject, isImpossible);
    267267        }.bind(this));
    268268
  • trunk/Source/WebInspectorUI/UserInterface/Views/ObjectTreeBaseTreeElement.js

    r186466 r186634  
    162162
    163163        var text = WebInspector.UIString("Selected Symbol");
    164         WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, symbol);
     164        WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, symbol, true);
    165165    }
    166166
     
    178178            WebInspector.quickConsole.prompt.pushHistoryItem(text);
    179179
    180         WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, resolvedValue);
     180        WebInspector.consoleLogViewController.appendImmediateExecutionWithResult(text, resolvedValue, isImpossible);
    181181    }
    182182
Note: See TracChangeset for help on using the changeset viewer.