Bug 144297

Summary: Web Inspector: Add new tab button to make it easy to bring a closed tab back
Product: WebKit Reporter: Timothy Hatcher <timothy>
Component: Web InspectorAssignee: Timothy Hatcher <timothy>
Status: RESOLVED FIXED    
Severity: Normal CC: graouts, joepeck, jonowells, mattbaker, nvasilyev, timothy, webkit-bug-importer
Priority: P2 Keywords: DoNotImportToRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Screenshot of New Tab View
none
Patch joepeck: review+, timothy: commit-queue-

Description Timothy Hatcher 2015-04-27 17:19:36 PDT
The tab bar should have a new tab button.
Comment 1 Timothy Hatcher 2015-04-27 17:21:23 PDT
Created attachment 251792 [details]
Patch
Comment 2 Timothy Hatcher 2015-04-27 17:21:57 PDT
Created attachment 251793 [details]
Screenshot of New Tab View
Comment 3 Timothy Hatcher 2015-04-27 17:25:53 PDT
Comment on attachment 251792 [details]
Patch

I need to tweak this to work with JSContext inspection.
Comment 4 Timothy Hatcher 2015-04-27 19:41:56 PDT
Created attachment 251807 [details]
Patch
Comment 5 Joseph Pecoraro 2015-04-27 19:51:05 PDT
Comment on attachment 251807 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=251807&action=review

r=me!

> Source/WebInspectorUI/UserInterface/Views/NewTabContentView.css:26
> +
> +

Style: Double newline oops.

> Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js:33
> +    this._allowedNewTabs = [{image: "Images/Elements.svg", title: WebInspector.UIString("Elements"), type: WebInspector.ElementsTabContentView.Type},
> +        {image: "Images/Console.svg", title: WebInspector.UIString("Console"), type: WebInspector.ConsoleTabContentView.Type}];

Style: Would read cleaner on their own lines.

> Source/WebInspectorUI/UserInterface/Views/NewTabContentView.js:58
> +        var boxElement = document.createElement("div");
> +        boxElement.classList.add("box");
> +
> +        var imageElement = document.createElement("img");
> +        imageElement.src = info.image;
> +
> +        var labelElement = document.createElement("label");
> +        labelElement.textContent = info.title;
> +
> +        boxElement.appendChild(imageElement);
> +        tabItemElement.appendChild(boxElement);
> +        tabItemElement.appendChild(labelElement);

Style: I still prefer just inlining the appendChilds, it saves so many lines, and you know the element is always inserted. Exceptions are "this.element.appendChild".
Comment 6 Timothy Hatcher 2015-04-28 06:06:08 PDT
Comment on attachment 251807 [details]
Patch

https://trac.webkit.org/r183468