Changeset 62647 in webkit
- Timestamp:
- Jul 7, 2010 3:10:11 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r62646 r62647 1 2010-07-06 Yury Semikhatsky <yurys@chromium.org> 2 3 Reviewed by Pavel Feldman. 4 5 Inspector should remember the size of sidebars set by the user 6 https://bugs.webkit.org/show_bug.cgi?id=19207 7 8 * inspector/front-end/AbstractTimelinePanel.js: 9 (WebInspector.AbstractTimelinePanel): 10 * inspector/front-end/AuditsPanel.js: 11 (WebInspector.AuditsPanel): 12 * inspector/front-end/ConsolePanel.js: 13 (WebInspector.ConsolePanel): 14 * inspector/front-end/ElementsPanel.js: 15 (WebInspector.ElementsPanel.prototype.rightSidebarResizerDragEnd): 16 * inspector/front-end/Panel.js: 17 (WebInspector.Panel): 18 (WebInspector.Panel.prototype.get toolbarItemClass): 19 (WebInspector.Panel.prototype.show): 20 (WebInspector.Panel.prototype.createSidebar): 21 (WebInspector.Panel.prototype.get _sidebarWidthSettingName): 22 (WebInspector.Panel.prototype._endSidebarDragging): 23 (WebInspector.Panel.prototype.updateSidebarWidth): 24 (WebInspector.Panel.prototype.restoreSidebarWidth): 25 (WebInspector.Panel.prototype.saveSidebarWidth): 26 * inspector/front-end/ProfilesPanel.js: 27 (WebInspector.ProfilesPanel): 28 * inspector/front-end/ResourcesPanel.js: 29 (WebInspector.ResourcesPanel): 30 (WebInspector.ResourcesPanel.prototype.resourceTrackingWasEnabled): 31 * inspector/front-end/ScriptsPanel.js: 32 (WebInspector.ScriptsPanel): 33 (WebInspector.ScriptsPanel.prototype._endSidebarResizeDrag): 34 (WebInspector.ScriptsPanel.prototype._sidebarResizeDrag): 35 (WebInspector.ScriptsPanel.prototype.setSidebarWidth): 36 * inspector/front-end/Settings.js: 37 (WebInspector.populateApplicationSettings): 38 * inspector/front-end/StoragePanel.js: 39 (WebInspector.StoragePanel): 40 * inspector/front-end/TimelinePanel.js: 41 (WebInspector.TimelinePanel): 42 1 43 2010-07-05 Steve Block <steveblock@google.com> 2 44 -
trunk/WebCore/inspector/front-end/AbstractTimelinePanel.js
r59372 r62647 29 29 */ 30 30 31 WebInspector.AbstractTimelinePanel = function( )31 WebInspector.AbstractTimelinePanel = function(name) 32 32 { 33 WebInspector.Panel.call(this );33 WebInspector.Panel.call(this, name); 34 34 this._items = []; 35 35 this._staleItems = []; -
trunk/WebCore/inspector/front-end/AuditsPanel.js
r60414 r62647 31 31 WebInspector.AuditsPanel = function() 32 32 { 33 WebInspector.Panel.call(this );33 WebInspector.Panel.call(this, "audits"); 34 34 35 35 this._constructCategories(); … … 48 48 this.auditResultsTreeElement.expand(); 49 49 50 this.element.addStyleClass("audits");51 52 50 this.clearResultsButton = new WebInspector.StatusBarButton(WebInspector.UIString("Clear audit results."), "clear-status-bar-item"); 53 51 this.clearResultsButton.addEventListener("click", this._clearButtonClicked.bind(this), false); … … 61 59 62 60 WebInspector.AuditsPanel.prototype = { 63 toolbarItemClass: "audits",64 65 61 get toolbarItemLabel() 66 62 { -
trunk/WebCore/inspector/front-end/ConsolePanel.js
r51952 r62647 29 29 WebInspector.ConsolePanel = function() 30 30 { 31 WebInspector.Panel.call(this );31 WebInspector.Panel.call(this, "console"); 32 32 } 33 33 34 34 WebInspector.ConsolePanel.prototype = { 35 toolbarItemClass: "console",36 37 35 get toolbarItemLabel() 38 36 { -
trunk/WebCore/inspector/front-end/ElementsPanel.js
r62489 r62647 31 31 WebInspector.ElementsPanel = function() 32 32 { 33 WebInspector.Panel.call(this); 34 35 this.element.addStyleClass("elements"); 33 WebInspector.Panel.call(this, "elements"); 36 34 37 35 this.contentElement = document.createElement("div"); … … 115 113 116 114 WebInspector.ElementsPanel.prototype = { 117 toolbarItemClass: "elements",118 119 115 get toolbarItemLabel() 120 116 { … … 1122 1118 { 1123 1119 WebInspector.elementDragEnd(event); 1120 this.saveSidebarWidth(); 1124 1121 }, 1125 1122 … … 1128 1125 var x = event.pageX; 1129 1126 var newWidth = Number.constrain(window.innerWidth - x, Preferences.minElementsSidebarWidth, window.innerWidth * 0.66); 1130 1127 this.setSidebarWidth(newWidth); 1128 event.preventDefault(); 1129 }, 1130 1131 setSidebarWidth: function(newWidth) 1132 { 1131 1133 this.sidebarElement.style.width = newWidth + "px"; 1132 1134 this.contentElement.style.right = newWidth + "px"; 1133 1135 this.sidebarResizeElement.style.right = (newWidth - 3) + "px"; 1134 1135 1136 this.treeOutline.updateSelection(); 1136 1137 event.preventDefault();1138 1137 }, 1139 1138 -
trunk/WebCore/inspector/front-end/Panel.js
r60414 r62647 27 27 */ 28 28 29 WebInspector.Panel = function( )29 WebInspector.Panel = function(name) 30 30 { 31 31 WebInspector.View.call(this); 32 32 33 33 this.element.addStyleClass("panel"); 34 this.element.addStyleClass(name); 35 this._panelName = name; 36 37 WebInspector.applicationSettings.installSetting(this._sidebarWidthSettingName(), this._panelName + "-sidebar-width", undefined); 34 38 } 35 39 … … 53 57 this._toolbarItem.panel = this; 54 58 55 if ("toolbarItemClass" in this) 56 this._toolbarItem.addStyleClass(this.toolbarItemClass); 59 this._toolbarItem.addStyleClass(this._panelName); 57 60 58 61 var iconElement = document.createElement("div"); … … 87 90 WebInspector.currentFocusElement = this.defaultFocusedElement; 88 91 89 this. updateSidebarWidth();92 this.restoreSidebarWidth(); 90 93 this._restoreScrollPositions(); 91 94 }, … … 292 295 createSidebar: function(parentElement, resizerParentElement) 293 296 { 294 if (this. hasSidebar)297 if (this.sidebarElement) 295 298 return; 296 299 … … 300 303 if (!resizerParentElement) 301 304 resizerParentElement = parentElement; 302 303 this.hasSidebar = true;304 305 305 306 this.sidebarElement = document.createElement("div"); … … 320 321 }, 321 322 323 _sidebarWidthSettingName: function() 324 { 325 return this._panelName + "SidebarWidth"; 326 }, 327 322 328 _startSidebarDragging: function(event) 323 329 { … … 335 341 { 336 342 WebInspector.elementDragEnd(event); 343 this.saveSidebarWidth(); 337 344 }, 338 345 339 346 updateSidebarWidth: function(width) 340 347 { 341 if (!this. hasSidebar)348 if (!this.sidebarElement) 342 349 return; 343 350 … … 366 373 this.sidebarElement.style.width = width + "px"; 367 374 this.sidebarResizeElement.style.left = (width - 3) + "px"; 375 }, 376 377 restoreSidebarWidth: function() 378 { 379 var sidebarWidth = WebInspector.applicationSettings[this._sidebarWidthSettingName()]; 380 this.updateSidebarWidth(sidebarWidth); 381 }, 382 383 saveSidebarWidth: function() 384 { 385 if (!this.sidebarElement) 386 return; 387 WebInspector.applicationSettings[this._sidebarWidthSettingName()] = this.sidebarElement.offsetWidth; 368 388 }, 369 389 -
trunk/WebCore/inspector/front-end/ProfilesPanel.js
r61691 r62647 91 91 WebInspector.ProfilesPanel = function() 92 92 { 93 WebInspector.Panel.call(this );93 WebInspector.Panel.call(this, "profiles"); 94 94 95 95 this.createSidebar(); 96 96 97 this.element.addStyleClass("profiles");98 97 this._profileTypesByIdMap = {}; 99 98 this._profileTypeButtonsByIdMap = {}; … … 129 128 130 129 WebInspector.ProfilesPanel.prototype = { 131 toolbarItemClass: "profiles",132 133 130 get toolbarItemLabel() 134 131 { -
trunk/WebCore/inspector/front-end/ResourcesPanel.js
r61014 r62647 30 30 WebInspector.ResourcesPanel = function() 31 31 { 32 WebInspector.AbstractTimelinePanel.call(this); 33 34 this.element.addStyleClass("resources"); 32 WebInspector.AbstractTimelinePanel.call(this, "resources"); 35 33 36 34 this._createPanelEnabler(); … … 52 50 53 51 WebInspector.ResourcesPanel.prototype = { 54 toolbarItemClass: "resources",55 56 52 get toolbarItemLabel() 57 53 { … … 320 316 this._resourceTrackingEnabled = true; 321 317 this.reset(); 318 this.restoreSidebarWidth(); 322 319 }, 323 320 -
trunk/WebCore/inspector/front-end/ScriptsPanel.js
r62645 r62647 26 26 WebInspector.ScriptsPanel = function() 27 27 { 28 WebInspector.Panel.call(this); 29 30 this.element.addStyleClass("scripts"); 28 WebInspector.Panel.call(this, "scripts"); 31 29 32 30 this.topStatusBar = document.createElement("div"); … … 185 183 186 184 WebInspector.ScriptsPanel.prototype = { 187 toolbarItemClass: "scripts",188 189 185 get toolbarItemLabel() 190 186 { … … 791 787 { 792 788 WebInspector.elementDragEnd(event); 793 794 789 delete this._dragOffset; 790 this.saveSidebarWidth(); 795 791 }, 796 792 … … 799 795 var x = event.pageX + this._dragOffset; 800 796 var newWidth = Number.constrain(window.innerWidth - x, Preferences.minScriptsSidebarWidth, window.innerWidth * 0.66); 801 797 this.setSidebarWidth(newWidth); 798 event.preventDefault(); 799 }, 800 801 setSidebarWidth: function(newWidth) 802 { 802 803 this.sidebarElement.style.width = newWidth + "px"; 803 804 this.sidebarButtonsElement.style.width = newWidth + "px"; … … 807 808 808 809 this.resize(); 809 event.preventDefault();810 810 }, 811 811 -
trunk/WebCore/inspector/front-end/Settings.js
r61014 r62647 49 49 { 50 50 WebInspector.applicationSettings._load(settingsString); 51 WebInspector.applicationSettings._installSetting("eventListenersFilter", "event-listeners-filter", "all"); 52 WebInspector.applicationSettings._installSetting("colorFormat", "color-format", "hex"); 53 WebInspector.applicationSettings._installSetting("resourcesLargeRows", "resources-large-rows", true); 54 WebInspector.applicationSettings._installSetting("watchExpressions", "watch-expressions", []); 55 WebInspector.applicationSettings._installSetting("lastViewedScriptFile", "last-viewed-script-file"); 56 WebInspector.applicationSettings._installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false); 57 WebInspector.applicationSettings._installSetting("showUserAgentStyles", "show-user-agent-styles", true); 58 WebInspector.applicationSettings._installSetting("resourceViewTab", "resource-view-tab", "content"); 59 WebInspector.applicationSettings._installSetting("consoleHistory", "console-history", []); 51 WebInspector.applicationSettings.installSetting("eventListenersFilter", "event-listeners-filter", "all"); 52 WebInspector.applicationSettings.installSetting("colorFormat", "color-format", "hex"); 53 WebInspector.applicationSettings.installSetting("resourcesLargeRows", "resources-large-rows", true); 54 WebInspector.applicationSettings.installSetting("watchExpressions", "watch-expressions", []); 55 WebInspector.applicationSettings.installSetting("lastViewedScriptFile", "last-viewed-script-file"); 56 WebInspector.applicationSettings.installSetting("showInheritedComputedStyleProperties", "show-inherited-computed-style-properties", false); 57 WebInspector.applicationSettings.installSetting("showUserAgentStyles", "show-user-agent-styles", true); 58 WebInspector.applicationSettings.installSetting("resourceViewTab", "resource-view-tab", "content"); 59 WebInspector.applicationSettings.installSetting("consoleHistory", "console-history", []); 60 60 61 WebInspector.applicationSettings.dispatchEventToListeners("loaded"); 61 62 } … … 70 71 { 71 72 this._sessionScope = sessionScope; 73 this._defaultValues = {}; 72 74 } 73 75 … … 89 91 }, 90 92 91 _installSetting: function(name, propertyName, defaultValue)93 installSetting: function(name, propertyName, defaultValue) 92 94 { 93 95 this.__defineGetter__(name, this._get.bind(this, propertyName)); 94 96 this.__defineSetter__(name, this._set.bind(this, propertyName)); 95 if (!(propertyName in this._store)) { 96 this._store[propertyName] = defaultValue; 97 } 97 this._defaultValues[propertyName] = defaultValue; 98 98 }, 99 99 100 100 _get: function(propertyName) 101 101 { 102 return this._store[propertyName]; 102 if (propertyName in this._store) 103 return this._store[propertyName]; 104 return this._defaultValues[propertyName]; 103 105 }, 104 106 -
trunk/WebCore/inspector/front-end/StoragePanel.js
r62503 r62647 30 30 WebInspector.StoragePanel = function(database) 31 31 { 32 WebInspector.Panel.call(this );32 WebInspector.Panel.call(this, "storage"); 33 33 34 34 this.createSidebar(); … … 65 65 66 66 WebInspector.StoragePanel.prototype = { 67 toolbarItemClass: "storage",68 69 67 get toolbarItemLabel() 70 68 { -
trunk/WebCore/inspector/front-end/TimelinePanel.js
r60552 r62647 31 31 WebInspector.TimelinePanel = function() 32 32 { 33 WebInspector.Panel.call(this); 34 this.element.addStyleClass("timeline"); 33 WebInspector.Panel.call(this, "timeline"); 35 34 36 35 this.element.appendChild(this._createTopPane()); … … 107 106 108 107 WebInspector.TimelinePanel.prototype = { 109 toolbarItemClass: "timeline",110 111 108 _createTopPane: function() { 112 109 var topPaneElement = document.createElement("div");
Note: See TracChangeset
for help on using the changeset viewer.