Reviewed by Anders Carlsson.
authorweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 01:47:30 +0000 (01:47 +0000)
committerweinig@apple.com <weinig@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 13 Dec 2007 01:47:30 +0000 (01:47 +0000)
        Add button to clear the Web Inspector's console.

        * English.lproj/InspectorLocalizedStrings.js:
        * page/inspector/ConsolePanel.js:
        * page/inspector/inspector.css:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28668 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/English.lproj/InspectorLocalizedStrings.js
WebCore/page/inspector/ConsolePanel.js
WebCore/page/inspector/inspector.css

index b05a50f..26825f0 100644 (file)
@@ -1,3 +1,13 @@
+2007-12-12  Sam Weinig  <sam@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        Add button to clear the Web Inspector's console.
+
+        * English.lproj/InspectorLocalizedStrings.js:
+        * page/inspector/ConsolePanel.js:
+        * page/inspector/inspector.css:
+
 2007-12-12  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Adam and Jon.
index de1df9d..b5fd011 100644 (file)
Binary files a/WebCore/English.lproj/InspectorLocalizedStrings.js and b/WebCore/English.lproj/InspectorLocalizedStrings.js differ
index 447eacf..0528845 100644 (file)
@@ -46,6 +46,12 @@ WebInspector.ConsolePanel = function()
     this.element.appendChild(this.consolePrompt);
 
     this.consolePrompt.addEventListener("keydown", this.promptKeyDown.bind(this), false);
+
+    var clearButtonText = WebInspector.UIString("Clear");
+    this.clearMessagesElement = document.createElement("button");
+    this.clearMessagesElement.appendChild(document.createTextNode(clearButtonText));
+    this.clearMessagesElement.title = clearButtonText;
+    this.clearMessagesElement.addEventListener("click", this.clearButtonClicked.bind(this), false);
 }
 
 WebInspector.ConsolePanel.prototype = {
@@ -53,12 +59,17 @@ WebInspector.ConsolePanel.prototype = {
     {
         WebInspector.Panel.prototype.show.call(this);
         WebInspector.consoleListItem.select();
+
+        this.clearMessagesElement.removeStyleClass("hidden");
+        if (!this.clearMessagesElement.parentNode)
+            document.getElementById("toolbarButtons").appendChild(this.clearMessagesElement);
     },
 
     hide: function()
     {
         WebInspector.Panel.prototype.hide.call(this);
         WebInspector.consoleListItem.deselect();
+        this.clearMessagesElement.addStyleClass("hidden");
     },
 
     addMessage: function(msg)
@@ -99,6 +110,11 @@ WebInspector.ConsolePanel.prototype = {
         this.messageList.removeChildren();
     },
 
+    clearButtonClicked: function()
+    {
+        this.clearMessages();
+    },
+
     messageListClicked: function(event)
     {
         var link = event.target.firstParentOrSelfWithNodeName("a");
index 897fe85..26caafc 100644 (file)
@@ -97,6 +97,7 @@ body.attached.inactive #toolbar {
     height: 19px;
     -webkit-box-sizing: border-box;
     vertical-align: middle;
+    line-height: 7px;
 }
 
 #toolbar button:focus {