OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
67 this._workspace = workspaceForTest || WebInspector.workspace; | 67 this._workspace = workspaceForTest || WebInspector.workspace; |
68 | 68 |
69 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel")); | 69 var helpSection = WebInspector.shortcutsScreen.section(WebInspector.UIString ("Sources Panel")); |
70 this.debugToolbar = this._createDebugToolbar(); | 70 this.debugToolbar = this._createDebugToolbar(); |
71 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); | 71 this._debugToolbarDrawer = this._createDebugToolbarDrawer(); |
72 this.threadsToolbar = new WebInspector.ThreadsToolbar(); | 72 this.threadsToolbar = new WebInspector.ThreadsToolbar(); |
73 | 73 |
74 const initialDebugSidebarWidth = 225; | 74 const initialDebugSidebarWidth = 225; |
75 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth); | 75 this._splitView = new WebInspector.SplitView(true, true, "sourcesPanelSplitV iewState", initialDebugSidebarWidth); |
76 this._splitView.enableShowModeSaving(); | 76 this._splitView.enableShowModeSaving(); |
77 this._splitView.setMainElementConstraints(200, 25); | |
78 this._splitView.setSidebarElementConstraints(WebInspector.SourcesPanel.minTo olbarWidth, 25); | |
79 | |
80 this._splitView.show(this.element); | 77 this._splitView.show(this.element); |
81 | 78 |
82 // Create scripts navigator | 79 // Create scripts navigator |
83 const initialNavigatorWidth = 225; | 80 const initialNavigatorWidth = 225; |
84 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth); | 81 this.editorView = new WebInspector.SplitView(true, false, "sourcesPanelNavig atorSplitViewState", initialNavigatorWidth); |
85 this.editorView.enableShowModeSaving(); | 82 this.editorView.enableShowModeSaving(); |
86 this.editorView.element.id = "scripts-editor-split-view"; | 83 this.editorView.element.id = "scripts-editor-split-view"; |
87 this.editorView.element.tabIndex = 0; | 84 this.editorView.element.tabIndex = 0; |
88 | |
89 this.editorView.setSidebarElementConstraints(Preferences.minSidebarWidth); | |
90 this.editorView.setMainElementConstraints(50, 50); | |
91 this.editorView.show(this._splitView.mainElement()); | 85 this.editorView.show(this._splitView.mainElement()); |
92 | 86 |
93 this._navigator = new WebInspector.SourcesNavigator(this._workspace); | 87 this._navigator = new WebInspector.SourcesNavigator(this._workspace); |
88 this._navigator.view.setMinimumSize(Preferences.minSidebarWidth, 25); | |
94 this._navigator.view.show(this.editorView.sidebarElement()); | 89 this._navigator.view.show(this.editorView.sidebarElement()); |
95 | 90 |
96 var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIStri ng("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a fil e"); | 91 var tabbedEditorPlaceholderText = WebInspector.isMac() ? WebInspector.UIStri ng("Hit Cmd+O to open a file") : WebInspector.UIString("Hit Ctrl+O to open a fil e"); |
97 | 92 |
98 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); | 93 this._drawerEditorView = new WebInspector.SourcesPanel.DrawerEditorView(); |
99 this.sourcesView = new WebInspector.SourcesView(); | 94 this.sourcesView = new WebInspector.SourcesView(); |
100 this.sourcesView.show(this._drawerEditorView.element); | 95 this.sourcesView.show(this._drawerEditorView.element); |
101 | 96 |
102 this._searchableView = new WebInspector.SearchableView(this); | 97 this._searchableView = new WebInspector.SearchableView(this); |
103 this._searchableView.setMinimalSearchQuerySize(0); | 98 this._searchableView.setMinimalSearchQuerySize(0); |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
207 return; | 202 return; |
208 | 203 |
209 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost."); | 204 event.returnValue = WebInspector.UIString("DevTools have unsaved changes that will be permanently lost."); |
210 WebInspector.inspectorView.showPanel("sources"); | 205 WebInspector.inspectorView.showPanel("sources"); |
211 for (var i = 0; i < unsavedSourceCodes.length; ++i) | 206 for (var i = 0; i < unsavedSourceCodes.length; ++i) |
212 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]); | 207 WebInspector.panels.sources.showUISourceCode(unsavedSourceCodes[i]); |
213 } | 208 } |
214 window.addEventListener("beforeunload", handleBeforeUnload, true); | 209 window.addEventListener("beforeunload", handleBeforeUnload, true); |
215 } | 210 } |
216 | 211 |
217 WebInspector.SourcesPanel.minToolbarWidth = 215; | 212 WebInspector.SourcesPanel.minToolbarWidth = 185; |
vsevik
2014/03/19 16:59:49
This is important to keep the old value because we
dgozman
2014/03/19 19:43:49
We decided with Pavel that it's not worth it. Extr
| |
218 | 213 |
219 WebInspector.SourcesPanel.Events = { | 214 WebInspector.SourcesPanel.Events = { |
220 EditorClosed: "EditorClosed", | 215 EditorClosed: "EditorClosed", |
221 EditorSelected: "EditorSelected", | 216 EditorSelected: "EditorSelected", |
222 } | 217 } |
223 | 218 |
224 WebInspector.SourcesPanel.prototype = { | 219 WebInspector.SourcesPanel.prototype = { |
225 /** | 220 /** |
226 * @param {?Event=} event | 221 * @param {?Event=} event |
227 */ | 222 */ |
(...skipping 1251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1479 if (!vertically) | 1474 if (!vertically) |
1480 this._splitView.uninstallResizer(this._statusBarContainerElement); | 1475 this._splitView.uninstallResizer(this._statusBarContainerElement); |
1481 else | 1476 else |
1482 this._splitView.installResizer(this._statusBarContainerElement); | 1477 this._splitView.installResizer(this._statusBarContainerElement); |
1483 | 1478 |
1484 // Create vertical box with stack. | 1479 // Create vertical box with stack. |
1485 var vbox = new WebInspector.VBox(); | 1480 var vbox = new WebInspector.VBox(); |
1486 vbox.element.appendChild(this._debugToolbarDrawer); | 1481 vbox.element.appendChild(this._debugToolbarDrawer); |
1487 vbox.element.appendChild(this.debugToolbar); | 1482 vbox.element.appendChild(this.debugToolbar); |
1488 vbox.element.appendChild(this.threadsToolbar.element); | 1483 vbox.element.appendChild(this.threadsToolbar.element); |
1484 vbox.setMinimumSize(WebInspector.SourcesPanel.minToolbarWidth, 25); | |
1489 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); | 1485 var sidebarPaneStack = new WebInspector.SidebarPaneStack(); |
1490 sidebarPaneStack.element.classList.add("flex-auto"); | 1486 sidebarPaneStack.element.classList.add("flex-auto"); |
1491 sidebarPaneStack.show(vbox.element); | 1487 sidebarPaneStack.show(vbox.element); |
1492 | 1488 |
1493 if (!vertically) { | 1489 if (!vertically) { |
1494 // Populate the only stack. | 1490 // Populate the only stack. |
1495 for (var pane in this.sidebarPanes) | 1491 for (var pane in this.sidebarPanes) |
1496 sidebarPaneStack.addPane(this.sidebarPanes[pane]); | 1492 sidebarPaneStack.addPane(this.sidebarPanes[pane]); |
1497 this._extensionSidebarPanesContainer = sidebarPaneStack; | 1493 this._extensionSidebarPanesContainer = sidebarPaneStack; |
1498 | 1494 |
1499 this.sidebarPaneView = vbox; | 1495 this.sidebarPaneView = vbox; |
1500 } else { | 1496 } else { |
1501 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5); | 1497 var splitView = new WebInspector.SplitView(true, true, "sourcesPanel DebuggerSidebarSplitViewState", 0.5); |
1502 splitView.setMainElementConstraints(WebInspector.SourcesPanel.minToo lbarWidth, 25); | |
1503 vbox.show(splitView.mainElement()); | 1498 vbox.show(splitView.mainElement()); |
1504 | 1499 |
1505 // Populate the left stack. | 1500 // Populate the left stack. |
1506 sidebarPaneStack.addPane(this.sidebarPanes.callstack); | 1501 sidebarPaneStack.addPane(this.sidebarPanes.callstack); |
1507 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); | 1502 sidebarPaneStack.addPane(this.sidebarPanes.jsBreakpoints); |
1508 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); | 1503 sidebarPaneStack.addPane(this.sidebarPanes.domBreakpoints); |
1509 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); | 1504 sidebarPaneStack.addPane(this.sidebarPanes.xhrBreakpoints); |
1510 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ; | 1505 sidebarPaneStack.addPane(this.sidebarPanes.eventListenerBreakpoints) ; |
1511 if (this.sidebarPanes.workerList) | 1506 if (this.sidebarPanes.workerList) |
1512 sidebarPaneStack.addPane(this.sidebarPanes.workerList); | 1507 sidebarPaneStack.addPane(this.sidebarPanes.workerList); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1554 __proto__: WebInspector.Panel.prototype | 1549 __proto__: WebInspector.Panel.prototype |
1555 } | 1550 } |
1556 | 1551 |
1557 /** | 1552 /** |
1558 * @constructor | 1553 * @constructor |
1559 * @extends {WebInspector.VBox} | 1554 * @extends {WebInspector.VBox} |
1560 */ | 1555 */ |
1561 WebInspector.SourcesView = function() | 1556 WebInspector.SourcesView = function() |
1562 { | 1557 { |
1563 WebInspector.VBox.call(this); | 1558 WebInspector.VBox.call(this); |
1559 this.setMinimumSize(50, 25); | |
1564 this.registerRequiredCSS("sourcesView.css"); | 1560 this.registerRequiredCSS("sourcesView.css"); |
1565 this.element.id = "sources-panel-sources-view"; | 1561 this.element.id = "sources-panel-sources-view"; |
1566 this.element.addEventListener("dragenter", this._onDragEnter.bind(this), tru e); | 1562 this.element.addEventListener("dragenter", this._onDragEnter.bind(this), tru e); |
1567 this.element.addEventListener("dragover", this._onDragOver.bind(this), true) ; | 1563 this.element.addEventListener("dragover", this._onDragOver.bind(this), true) ; |
1568 } | 1564 } |
1569 | 1565 |
1570 WebInspector.SourcesView.dragAndDropFilesType = "Files"; | 1566 WebInspector.SourcesView.dragAndDropFilesType = "Files"; |
1571 | 1567 |
1572 WebInspector.SourcesView.prototype = { | 1568 WebInspector.SourcesView.prototype = { |
1573 _onDragEnter: function (event) | 1569 _onDragEnter: function (event) |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1722 { | 1718 { |
1723 } | 1719 } |
1724 | 1720 |
1725 WebInspector.SourcesPanel.EditorAction.prototype = { | 1721 WebInspector.SourcesPanel.EditorAction.prototype = { |
1726 /** | 1722 /** |
1727 * @param {!WebInspector.SourcesPanel} panel | 1723 * @param {!WebInspector.SourcesPanel} panel |
1728 * @return {!Element} | 1724 * @return {!Element} |
1729 */ | 1725 */ |
1730 button: function(panel) { } | 1726 button: function(panel) { } |
1731 } | 1727 } |
OLD | NEW |