Changeset 53328 in webkit
- Timestamp:
- Jan 15, 2010 3:20:21 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r53327 r53328 1 2010-01-14 Mikhail Naganov <mnaganov@chromium.org> 2 3 Reviewed by Timothy Hatcher. 4 5 Add welcome screen to Profiles pane to provide some instructions for novices. 6 7 https://bugs.webkit.org/show_bug.cgi?id=19268 8 9 * English.lproj/localizedStrings.js: 10 * WebCore.gypi: 11 * WebCore.vcproj/WebCore.vcproj: 12 * inspector/front-end/ProfileView.js: 13 (WebInspector.CPUProfileType.prototype.get welcomeMessage): 14 * inspector/front-end/ProfilesPanel.js: 15 (WebInspector.ProfileType.prototype.get welcomeMessage): 16 (WebInspector.ProfilesPanel): 17 (WebInspector.ProfilesPanel.prototype.show): 18 (WebInspector.ProfilesPanel.prototype.registerProfileType): 19 (WebInspector.ProfilesPanel.prototype._addWelcomeMessage.messageButtonClicked): 20 (WebInspector.ProfilesPanel.prototype._addWelcomeMessage): 21 (WebInspector.ProfilesPanel.prototype.showProfile): 22 (WebInspector.ProfilesPanel.prototype.closeVisibleView): 23 (WebInspector.ProfilesPanel.prototype._updateInterface): 24 * inspector/front-end/WebKit.qrc: 25 * inspector/front-end/WelcomeView.js: Added. 26 (WebInspector.WelcomeView): 27 (WebInspector.WelcomeView.prototype._windowResized): 28 (WebInspector.WelcomeView.prototype.addMessage): 29 * inspector/front-end/inspector.css: 30 * inspector/front-end/inspector.html: 31 1 32 2010-01-13 Girish Ramakrishnan <girish@forwardbias.in> 2 33 -
trunk/WebCore/WebCore.gypi
r53308 r53328 3738 3738 'inspector/front-end/View.js', 3739 3739 'inspector/front-end/WatchExpressionsSidebarPane.js', 3740 'inspector/front-end/WelcomeView.js', 3740 3741 'inspector/front-end/audits.css', 3741 3742 'inspector/front-end/inspector.css', -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r53205 r53328 42932 42932 > 42933 42933 </File> 42934 <File 42935 RelativePath="..\inspector\front-end\WelcomeView.js" 42936 > 42937 </File> 42934 42938 </Filter> 42935 42939 </Filter> -
trunk/WebCore/inspector/front-end/ProfileView.js
r51528 r53328 600 600 }, 601 601 602 get welcomeMessage() 603 { 604 return WebInspector.UIString("Start CPU profiling by pressing<br>the %s button on the status bar."); 605 }, 606 602 607 setRecordingProfile: function(isProfiling) 603 608 { -
trunk/WebCore/inspector/front-end/ProfilesPanel.js
r51528 r53328 71 71 }, 72 72 73 get welcomeMessage() 74 { 75 return ""; 76 }, 77 73 78 // Must be implemented by subclasses. 74 79 createView: function(profile) … … 111 116 this.profileViewStatusBarItemsContainer = document.createElement("div"); 112 117 this.profileViewStatusBarItemsContainer.id = "profile-view-status-bar-items"; 118 119 this.welcomeView = new WebInspector.WelcomeView("profiles", WebInspector.UIString("Welcome to the Profiles panel")); 120 this.element.appendChild(this.welcomeView.element); 113 121 114 122 this._profiles = []; … … 150 158 { 151 159 WebInspector.Panel.prototype.show.call(this); 160 this.welcomeView.show(); 152 161 if (this._shouldPopulateProfiles) 153 162 this._populateProfiles(); … … 204 213 this.sidebarTree.appendChild(profileType.treeElement); 205 214 profileType.treeElement.expand(); 215 this._addWelcomeMessage(profileType); 216 }, 217 218 _addWelcomeMessage: function(profileType) 219 { 220 var message = profileType.welcomeMessage; 221 // Message text is supposed to have a '%s' substring as a placeholder 222 // for a status bar button. If it is there, we split the message in two 223 // parts, and insert the button between them. 224 var buttonPos = message.indexOf("%s"); 225 if (buttonPos > -1) { 226 var container = document.createDocumentFragment(); 227 var part1 = document.createElement("span"); 228 part1.innerHTML = message.substr(0, buttonPos); 229 container.appendChild(part1); 230 231 var button = new WebInspector.StatusBarButton(profileType.buttonTooltip, profileType.buttonStyle, profileType.buttonCaption); 232 button.element.addEventListener("click", profileType.buttonClicked.bind(profileType), false); 233 container.appendChild(button.element); 234 235 var part2 = document.createElement("span"); 236 part2.innerHTML = message.substr(buttonPos + 2); 237 container.appendChild(part2); 238 this.welcomeView.addMessage(container); 239 } else 240 this.welcomeView.addMessage(message); 206 241 }, 207 242 … … 277 312 return; 278 313 314 this.welcomeView.hide(); 279 315 if (this.visibleView) 280 316 this.visibleView.hide(); … … 330 366 this.visibleView.hide(); 331 367 delete this.visibleView; 368 this.welcomeView.show(); 332 369 }, 333 370 … … 408 445 this.profileViewStatusBarItemsContainer.removeStyleClass("hidden"); 409 446 this.panelEnablerView.visible = false; 447 this.welcomeView.visible = true; 410 448 } else { 411 449 this.enableToggleButton.title = WebInspector.UIString("Profiling disabled. Click to enable."); … … 414 452 this._profileTypeButtonsByIdMap[typeId].addStyleClass("hidden"); 415 453 this.profileViewStatusBarItemsContainer.addStyleClass("hidden"); 454 this.welcomeView.visible = false; 416 455 this.panelEnablerView.visible = true; 417 456 } -
trunk/WebCore/inspector/front-end/WebKit.qrc
r53205 r53328 86 86 <file>View.js</file> 87 87 <file>WatchExpressionsSidebarPane.js</file> 88 <file>WelcomeView.js</file> 88 89 <file>audits.css</file> 89 90 <file>inspector.css</file> -
trunk/WebCore/inspector/front-end/inspector.css
r53263 r53328 2257 2257 } 2258 2258 2259 .panel-enabler-view button , .pane button {2259 .panel-enabler-view button:not(.status-bar-item), .pane button { 2260 2260 color: rgb(6, 6, 6); 2261 2261 background-color: transparent; … … 2267 2267 } 2268 2268 2269 .panel-enabler-view button {2269 .panel-enabler-view button:not(.status-bar-item) { 2270 2270 font-size: 13px; 2271 2271 margin: 6px 0 0 0; 2272 2272 padding: 3px 20px; 2273 2273 height: 24px; 2274 } 2275 2276 .panel-enabler-view.welcome { 2277 z-index: auto; 2278 left: 200px; 2279 } 2280 2281 .panel-enabler-view.welcome img { 2282 height: 90%; 2283 min-height: 180px; 2284 max-width: 90%; 2285 } 2286 2287 .panel-enabler-view.welcome .instructions { 2288 display: inline-block; 2289 vertical-align: middle; 2290 width: 330px; 2291 margin: 0; 2292 padding: 15px; 2293 white-space: normal; 2294 line-height: 175%; 2295 } 2296 2297 .panel-enabler-view.welcome .message { 2298 margin-bottom: 2ex; 2299 } 2300 2301 .panel-enabler-view.welcome button.status-bar-item { 2302 vertical-align: middle; 2274 2303 } 2275 2304 -
trunk/WebCore/inspector/front-end/inspector.html
r53205 r53328 79 79 <script type="text/javascript" src="StylesSidebarPane.js"></script> 80 80 <script type="text/javascript" src="PanelEnablerView.js"></script> 81 <script type="text/javascript" src="WelcomeView.js"></script> 81 82 <script type="text/javascript" src="StatusBarButton.js"></script> 82 83 <script type="text/javascript" src="SummaryBar.js"></script>
Note: See TracChangeset
for help on using the changeset viewer.