Changeset 34740 in webkit
- Timestamp:
- Jun 23, 2008 10:33:49 AM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r34739 r34740 1 2008-06-23 Timothy Hatcher <timothy@apple.com> 2 3 Make profiles of the same name in the Inspector group in the 4 sidebar under a collapsable item that contains all the runs. 5 6 https://bugs.webkit.org/show_bug.cgi?id=19713 7 8 Reviewed by Darin Adler. 9 10 * English.lproj/localizedStrings.js: New strings. 11 * page/inspector/Images/profileGroupIcon.png: Added. 12 * page/inspector/Images/profileSmallIcon.png: Added. 13 * page/inspector/ProfilesPanel.js: 14 (WebInspector.ProfilesPanel.prototype.reset): Clear _profileGroups. 15 Remove the "some-expandable" class from the sidebarTree. 16 (WebInspector.ProfilesPanel.prototype.addProfile): Append new profiles 17 that have the same name as a previous profile into a group. When a 18 group has 2 profiles a ProfileGroupSidebarTreeElement is made and the 19 ProfileSidebarTreeElements are appended to the group's element. 20 (WebInspector.ProfileSidebarTreeElement.prototype.get mainTitle): 21 Return _mainTitle is it is set. 22 (WebInspector.ProfileSidebarTreeElement.prototype.set mainTitle): 23 Set _mainTitle which is an override title. 24 (WebInspector.ProfileGroupSidebarTreeElement): Inherit SidebarTreeElement. 25 (WebInspector.ProfileGroupSidebarTreeElement.prototype.onselect): 26 Show the last profile in the group when selected. 27 * page/inspector/SidebarTreeElement.js: 28 (WebInspector.SidebarTreeElement.prototype.get small): Return _small. 29 (WebInspector.SidebarTreeElement.prototype.set small): Set _small and 30 update the style to match. 31 (WebInspector.SidebarTreeElement.prototype.onattach): Set the small 32 class if the small property is true. 33 * page/inspector/inspector.css: New styles for profiles groups 34 and for the small profiles. 35 1 36 2008-06-23 Anders Carlsson <andersca@apple.com> 2 37 -
trunk/WebCore/page/inspector/ProfilesPanel.js
r34072 r34740 106 106 107 107 this._profiles = []; 108 this._profileGroups = {}; 109 110 this.sidebarTreeElement.removeStyleClass("some-expandable"); 108 111 109 112 this.sidebarTree.removeChildren(); … … 122 125 this._profiles.push(profile); 123 126 127 var sidebarParent = this.sidebarTree; 128 var small = false; 129 var alternateTitle; 130 131 if (profile.title !== "org.webkit.profiles.user-initiated") { 132 if (!(profile.title in this._profileGroups)) 133 this._profileGroups[profile.title] = []; 134 135 var group = this._profileGroups[profile.title]; 136 group.push(profile); 137 138 if (group.length === 2) { 139 // Make a group TreeElement now that there are 2 profiles. 140 group._profilesTreeElement = new WebInspector.ProfileGroupSidebarTreeElement(profile.title); 141 142 // Insert at the same index for the first profile of the group. 143 var index = this.sidebarTree.children.indexOf(group[0]._profilesTreeElement); 144 this.sidebarTree.insertChild(group._profilesTreeElement, index); 145 146 // Move the first profile to the group. 147 var selected = group[0]._profilesTreeElement.selected; 148 this.sidebarTree.removeChild(group[0]._profilesTreeElement); 149 group._profilesTreeElement.appendChild(group[0]._profilesTreeElement); 150 if (selected) { 151 group[0]._profilesTreeElement.select(); 152 group[0]._profilesTreeElement.reveal(); 153 } 154 155 group[0]._profilesTreeElement.small = true; 156 group[0]._profilesTreeElement.mainTitle = WebInspector.UIString("Run %d", 1); 157 158 this.sidebarTreeElement.addStyleClass("some-expandable"); 159 } 160 161 if (group.length >= 2) { 162 sidebarParent = group._profilesTreeElement; 163 alternateTitle = WebInspector.UIString("Run %d", group.length); 164 small = true; 165 } 166 } 167 124 168 var profileTreeElement = new WebInspector.ProfileSidebarTreeElement(profile); 169 profileTreeElement.small = small; 170 if (alternateTitle) 171 profileTreeElement.mainTitle = alternateTitle; 125 172 profile._profilesTreeElement = profileTreeElement; 126 173 127 this.sidebarTree.appendChild(profileTreeElement);174 sidebarParent.appendChild(profileTreeElement); 128 175 }, 129 176 … … 256 303 get mainTitle() 257 304 { 305 if (this._mainTitle) 306 return this._mainTitle; 258 307 if (this.profile.title === "org.webkit.profiles.user-initiated") 259 308 return WebInspector.UIString("Profile %d", this._profileNumber); … … 263 312 set mainTitle(x) 264 313 { 265 // Can't change mainTitle. 314 this._mainTitle = x; 315 this.refreshTitles(); 266 316 }, 267 317 … … 278 328 279 329 WebInspector.ProfileSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype; 330 331 WebInspector.ProfileGroupSidebarTreeElement = function(title, subtitle) 332 { 333 WebInspector.SidebarTreeElement.call(this, "profile-group-sidebar-tree-item", title, subtitle, null, true); 334 } 335 336 WebInspector.ProfileGroupSidebarTreeElement.prototype = { 337 onselect: function() 338 { 339 WebInspector.panels.profiles.showProfile(this.children[this.children.length - 1].profile); 340 } 341 } 342 343 WebInspector.ProfileGroupSidebarTreeElement.prototype.__proto__ = WebInspector.SidebarTreeElement.prototype; -
trunk/WebCore/page/inspector/SidebarTreeElement.js
r34272 r34740 98 98 99 99 WebInspector.SidebarTreeElement.prototype = { 100 get small() 101 { 102 return this._small; 103 }, 104 105 set small(x) 106 { 107 this._small = x; 108 109 if (this._listItemNode) { 110 if (this._small) 111 this._listItemNode.addStyleClass("small"); 112 else 113 this._listItemNode.removeStyleClass("small"); 114 } 115 }, 116 100 117 get mainTitle() 101 118 { … … 164 181 this._listItemNode.addStyleClass(this.className); 165 182 183 if (this.small) 184 this._listItemNode.addStyleClass("small"); 185 166 186 if (this.hasChildren && this.disclosureButton) 167 187 this._listItemNode.appendChild(this.disclosureButton); -
trunk/WebCore/page/inspector/inspector.css
r34694 r34740 2487 2487 } 2488 2488 2489 .profile-sidebar-tree-item.small .icon { 2490 content: url(Images/profileSmallIcon.png); 2491 } 2492 2493 .profile-group-sidebar-tree-item .icon { 2494 content: url(Images/profileGroupIcon.png); 2495 } 2496 2489 2497 .profile-view { 2490 2498 display: none;
Note: See TracChangeset
for help on using the changeset viewer.