Title: [114753] trunk/Source/WebCore
Revision
114753
Author
pfeld...@chromium.org
Date
2012-04-20 09:24:41 -0700 (Fri, 20 Apr 2012)

Log Message

Web Inspector: migrate from ScriptsNavigator to NavigatorView in the Styles panel
https://bugs.webkit.org/show_bug.cgi?id=84459

Reviewed by Yury Semikhatsky.

Now that NavigatorView has all the functionality we need, we can use it.

* inspector/front-end/NavigatorView.js:
(WebInspector.NavigatorScriptTreeElement.prototype.ondblclick):
* inspector/front-end/ScriptsNavigator.js:
(WebInspector.ScriptsNavigator):
* inspector/front-end/StylesPanel.js:
(WebInspector.StylesPanel):
(WebInspector.StylesPanel.prototype._resourceAdded):
(WebInspector.StylesPanel.prototype._reset):
(WebInspector.StylesPanel.prototype._itemSelected):
(WebInspector.StylesPanel.prototype._showFile):
* inspector/front-end/navigatorView.css:
(.navigator-tabbed-pane .tabbed-pane-content):
(.navigator-tabbed-pane .navigator-container):
(.navigator-tabbed-pane .navigator):
(.navigator-tabbed-pane .tabbed-pane-header):
(.navigator-tabbed-pane .tabbed-pane-header-contents):
* inspector/front-end/scriptsPanel.css:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (114752 => 114753)


--- trunk/Source/WebCore/ChangeLog	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/ChangeLog	2012-04-20 16:24:41 UTC (rev 114753)
@@ -1,3 +1,30 @@
+2012-04-20  Pavel Feldman  <pfeld...@chromium.org>
+
+        Web Inspector: migrate from ScriptsNavigator to NavigatorView in the Styles panel
+        https://bugs.webkit.org/show_bug.cgi?id=84459
+
+        Reviewed by Yury Semikhatsky.
+
+        Now that NavigatorView has all the functionality we need, we can use it.
+
+        * inspector/front-end/NavigatorView.js:
+        (WebInspector.NavigatorScriptTreeElement.prototype.ondblclick):
+        * inspector/front-end/ScriptsNavigator.js:
+        (WebInspector.ScriptsNavigator):
+        * inspector/front-end/StylesPanel.js:
+        (WebInspector.StylesPanel):
+        (WebInspector.StylesPanel.prototype._resourceAdded):
+        (WebInspector.StylesPanel.prototype._reset):
+        (WebInspector.StylesPanel.prototype._itemSelected):
+        (WebInspector.StylesPanel.prototype._showFile):
+        * inspector/front-end/navigatorView.css:
+        (.navigator-tabbed-pane .tabbed-pane-content):
+        (.navigator-tabbed-pane .navigator-container):
+        (.navigator-tabbed-pane .navigator):
+        (.navigator-tabbed-pane .tabbed-pane-header):
+        (.navigator-tabbed-pane .tabbed-pane-header-contents):
+        * inspector/front-end/scriptsPanel.css:
+
 2012-04-20  Sam D  <dsam2...@gmail.com>
 
         Web Inspector: Does not have search navigation button for going through matches in either direction (prev, next)

Modified: trunk/Source/WebCore/inspector/front-end/NavigatorView.js (114752 => 114753)


--- trunk/Source/WebCore/inspector/front-end/NavigatorView.js	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/inspector/front-end/NavigatorView.js	2012-04-20 16:24:41 UTC (rev 114753)
@@ -551,6 +551,11 @@
         this._navigatorView._scriptSelected(this.uiSourceCode, false);
     },
 
+    ondblclick: function()
+    {
+        this._navigatorView._scriptSelected(this.uiSourceCode, true);
+    },
+
     onenter: function()
     {
         this._navigatorView._scriptSelected(this.uiSourceCode, true);

Modified: trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js (114752 => 114753)


--- trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/inspector/front-end/ScriptsNavigator.js	2012-04-20 16:24:41 UTC (rev 114753)
@@ -36,9 +36,8 @@
     
     this._tabbedPane = new WebInspector.TabbedPane();
     this._tabbedPane.shrinkableTabs = true;
+    this._tabbedPane.element.addStyleClass("navigator-tabbed-pane");
 
-    this._tabbedPane.element.id = "scripts-navigator-tabbed-pane";
-
     this._scriptsView = new WebInspector.NavigatorView();
     this._scriptsView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._scriptSelected, this);
 

Modified: trunk/Source/WebCore/inspector/front-end/StylesPanel.js (114752 => 114753)


--- trunk/Source/WebCore/inspector/front-end/StylesPanel.js	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/inspector/front-end/StylesPanel.js	2012-04-20 16:24:41 UTC (rev 114753)
@@ -45,24 +45,28 @@
 
     this._mainView.minimalSidebarWidth = Preferences.minScriptsSidebarWidth;
     this._mainView.minimalMainWidthPercent = minimalViewsContainerWidthPercent;
-    this._mainView.show(this.element);
 
-    this._navigator = new WebInspector.ScriptsNavigator();
-    this._navigatorView = this._navigator.view;
-    this._navigator.view.show(this._mainView.sidebarElement);
-    this._navigator.addEventListener(WebInspector.ScriptsNavigator.Events.ScriptSelected, this._scriptSelected, this);
+    this._navigatorView = new WebInspector.NavigatorView();
+    this._navigatorView.addEventListener(WebInspector.NavigatorView.Events.ItemSelected, this._itemSelected, this);
 
+    this._tabbedPane = new WebInspector.TabbedPane();
+    this._tabbedPane.element.addStyleClass("navigator-tabbed-pane");
+    this._tabbedPane.shrinkableTabs = true;
+    this._tabbedPane.appendTab(WebInspector.ScriptsNavigator.ScriptsTab, WebInspector.UIString("Stylesheets"), this._navigatorView);
+    this._tabbedPane.show(this._mainView.sidebarElement);
+
     this._editorContainer = new WebInspector.TabbedEditorContainer(this, "previouslyViewedCSSFiles");
     this._editorContainer.show(this._mainView.mainElement);
 
-    this._navigatorController = new WebInspector.NavigatorOverlayController(this, this._mainView, this._navigator.view, this._editorContainer.view);
+    this._navigatorController = new WebInspector.NavigatorOverlayController(this, this._mainView, this._tabbedPane, this._editorContainer.view);
 
-    this._sourceFramesForResource = new Map();
-    this._urlToResource = {};
-
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.CachedResourcesLoaded, this._cachedResourcesLoaded, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.WillLoadCachedResources, this._reset, this);
     WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._reset, this);
+
+    this._mainView.show(this.element);
+    this._sourceFramesForResource = new Map();
+    this._urlToResource = {};
 }
 
 WebInspector.StylesPanel.prototype = {
@@ -104,13 +108,13 @@
         if (resource.type !== WebInspector.resourceTypes.Stylesheet)
             return;
         this._urlToResource[resource.url] = resource;
-        this._navigator.addUISourceCode(resource);
+        this._navigatorView.addUISourceCode(resource);
         this._editorContainer.uiSourceCodeAdded(resource);
     },
 
     _reset: function()
     {
-        this._navigator.reset();
+        this._navigatorView.reset();
         this._editorContainer.reset();
         this._urlToResource = {};
         this._sourceFramesForResource = new Map();
@@ -148,18 +152,18 @@
         this._editorContainer.setFileIsDirty(sourceFrame.resource, sourceFrame.isDirty());
     },
 
-    _scriptSelected: function(event)
+    _itemSelected: function(event)
     {
         var uiSourceCode = /** @type {WebInspector.UISourceCode} */ event.data.uiSourceCode;
-        var sourceFrame = this._showFile(uiSourceCode);
+        this._showFile(uiSourceCode);
         this._navigatorController.hideNavigatorOverlay();
-        if (sourceFrame && event.data.focusSource)
-            sourceFrame.focus();
+        if (event.data.focusSource)
+            this._editorContainer.view.focus();
     },
 
     _showFile: function(uiSourceCode)
     {
-        this._navigator.revealUISourceCode(uiSourceCode);
+        this._navigatorView.revealUISourceCode(uiSourceCode);
         this._editorContainer.showFile(uiSourceCode);
     },
 
@@ -179,7 +183,7 @@
         var sourceFrame = this._sourceFramesForResource.get(resource);
         if (typeof anchor.lineNumber === "number")
             sourceFrame.highlightLine(anchor.lineNumber);
-        sourceFrame.focus();
+        this._editorContainer.view.focus();
     }
 }
 

Modified: trunk/Source/WebCore/inspector/front-end/navigatorView.css (114752 => 114753)


--- trunk/Source/WebCore/inspector/front-end/navigatorView.css	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/inspector/front-end/navigatorView.css	2012-04-20 16:24:41 UTC (rev 114753)
@@ -110,3 +110,25 @@
     width: 100%;
     height: 100%;
 }
+
+.navigator-tabbed-pane .tabbed-pane-content {
+    overflow: hidden;
+}
+
+.navigator-tabbed-pane .navigator-container {
+    overflow-y: auto;
+    overflow-x: hidden;
+}
+
+.navigator-tabbed-pane .navigator {
+    padding-left: 0;
+}
+
+.navigator-tabbed-pane .tabbed-pane-header {
+    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F5F5F5), to(#E5E5E5));
+}
+
+.navigator-tabbed-pane .tabbed-pane-header-contents {
+    margin-left: 20px;
+    margin-right: 28px;
+}

Modified: trunk/Source/WebCore/inspector/front-end/scriptsPanel.css (114752 => 114753)


--- trunk/Source/WebCore/inspector/front-end/scriptsPanel.css	2012-04-20 16:15:48 UTC (rev 114752)
+++ trunk/Source/WebCore/inspector/front-end/scriptsPanel.css	2012-04-20 16:24:41 UTC (rev 114753)
@@ -226,28 +226,6 @@
     top: 2px;
 }
 
-#scripts-navigator-tabbed-pane .tabbed-pane-content {
-    overflow: hidden;
-}
-
-#scripts-navigator-tabbed-pane .navigator-container {
-    overflow-y: auto;
-    overflow-x: hidden;
-}
-
-#scripts-navigator-tabbed-pane .navigator {
-    padding-left: 0;
-}
-
-#scripts-navigator-tabbed-pane .tabbed-pane-header {
-    background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F5F5F5), to(#E5E5E5));
-}
-
-#scripts-navigator-tabbed-pane .tabbed-pane-header-contents {
-    margin-left: 20px;
-    margin-right: 28px;
-}
-
 #scripts-editor-container-tabbed-pane .tabbed-pane-header {
     background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#F5F5F5), to(#E5E5E5));
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to