Changeset 33525 in webkit
- Timestamp:
- May 16, 2008 1:46:57 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r33524 r33525 174 174 * page/mac/AccessibilityObjectWrapper.mm: 175 175 (-[AccessibilityObjectWrapper accessibilityAttributeValue:]): 176 177 2008-05-15 Timothy Hatcher <timothy@apple.com> 178 179 Adds an error and warning count indicator at the bottom right in the 180 Inspector's status bar. 181 182 https://bugs.webkit.org/show_bug.cgi?id=18650 183 184 Initial implementation by Adam Roben. 185 Reviewed by Sam Weinig. 186 187 Test: manual-tests/inspector/error-warning-count.html 188 189 * English.lproj/localizedStrings.js: Added new strings. 190 * manual-tests/inspector/error-warning-count.html: Added. 191 * page/inspector/Console.js: 192 (WebInspector.Console.prototype.show): Don't do anything if visible. 193 (WebInspector.Console.prototype.hide): Don't do anything if hidden. 194 Temporally set properties and classes to mimic the post-animation 195 values so panels like Elements in their updateStatusBarItems call will 196 size things to fit the final location. 197 * page/inspector/ElementsPanel.js: 198 (WebInspector.ElementsPanel.prototype.updateBreadcrumbSizes): 199 Account for the #error-warning-count width when sizing breadcrumbs. 200 * page/inspector/Resource.js: 201 (WebInspector.Resource.prototype.set errors): Update the global error count. 202 (WebInspector.Resource.prototype.set warnings): Update the global warning count. 203 * page/inspector/inspector.css: Make .hidden's display property 204 !important to ensure things really hide, and added styling for the new 205 #error-warning-count element. 206 * page/inspector/inspector.html: Added an #error-warning-count div 207 in the #anchored-status-bar-items div. 208 * page/inspector/inspector.js: 209 (WebInspector.get errors): Added. 210 (WebInspector.set errors): Added. Calls _updateErrorAndWarningCounts. 211 (WebInspector.get warnings): Added. 212 (WebInspector.set warnings): Added. Calls _updateErrorAndWarningCounts. 213 (WebInspector._updateErrorAndWarningCounts): Added. Update the 214 #error-warning-count div with the current error/warning count. 215 (WebInspector.loaded): Add a click event listener to the 216 #error-warning-count element that will show the Console. Call 217 _updateErrorAndWarningCounts to display the initial error/warning counts. 176 218 177 219 2008-05-15 Timothy Hatcher <timothy@apple.com> -
trunk/WebCore/page/inspector/Console.js
r33454 r33525 59 59 show: function() 60 60 { 61 if (this._animating )61 if (this._animating || this.visible) 62 62 return; 63 63 … … 98 98 hide: function() 99 99 { 100 if (this._animating )100 if (this._animating || !this.visible) 101 101 return; 102 102 … … 113 113 114 114 var anchoredItems = document.getElementById("anchored-status-bar-items"); 115 116 // Temporally set properties and classes to mimic the post-animation values so panels 117 // like Elements in their updateStatusBarItems call will size things to fit the final location. 118 document.getElementById("main-status-bar").style.setProperty("padding-left", (anchoredItems.offsetWidth - 1) + "px"); 119 document.body.removeStyleClass("console-visible"); 120 if ("updateStatusBarItems" in WebInspector.currentPanel) 121 WebInspector.currentPanel.updateStatusBarItems(); 122 document.body.addStyleClass("console-visible"); 115 123 116 124 var animations = [ … … 126 134 mainStatusBar.style.removeProperty("padding-left"); 127 135 document.body.removeStyleClass("console-visible"); 128 if ("updateStatusBarItems" in WebInspector.currentPanel)129 WebInspector.currentPanel.updateStatusBarItems();130 136 delete this._animating; 131 137 } -
trunk/WebCore/page/inspector/ElementsPanel.js
r33508 r33525 598 598 { 599 599 var rightPadding = 20; 600 var errorWarningElement = document.getElementById("error-warning-count"); 601 if (!WebInspector.console.visible && errorWarningElement) 602 rightPadding += errorWarningElement.offsetWidth; 600 603 return ((crumbs.totalOffsetLeft + crumbs.offsetWidth + rightPadding) < window.innerWidth); 601 604 } -
trunk/WebCore/page/inspector/Resource.js
r33411 r33525 444 444 if (this._errors === x) 445 445 return; 446 447 var difference = x - this._errors; 448 WebInspector.errors += difference; 449 446 450 this._errors = x; 447 451 }, … … 458 462 if (this._warnings === x) 459 463 return; 464 465 var difference = x - this._warnings; 466 WebInspector.warnings += difference; 467 460 468 this._warnings = x; 461 469 }, -
trunk/WebCore/page/inspector/inspector.css
r33445 r33525 52 52 53 53 .hidden { 54 display: none ;54 display: none !important; 55 55 } 56 56 … … 340 340 #clear-console-status-bar-item:active { 341 341 background-position: 32px 0; 342 } 343 344 #error-warning-count { 345 position: absolute; 346 right: 16px; 347 top: 0; 348 cursor: pointer; 349 padding: 6px 2px; 350 font-size: 10px; 351 height: 19px; 352 } 353 354 #error-warning-count:hover { 355 border-bottom: 1px solid rgb(96, 96, 96); 356 } 357 358 #error-count::before { 359 content: url(Images/errorIcon.png); 360 width: 10px; 361 height: 10px; 362 vertical-align: -1px; 363 margin-right: 2px; 364 } 365 366 #error-count + #warning-count { 367 margin-left: 6px; 368 } 369 370 #warning-count::before { 371 content: url(Images/warningIcon.png); 372 width: 10px; 373 height: 10px; 374 vertical-align: -1px; 375 margin-right: 2px; 342 376 } 343 377 -
trunk/WebCore/page/inspector/inspector.html
r33410 r33525 79 79 <div id="searchResultsResizer" class="hidden"></div> 80 80 <div id="main-panels" class="focusable focused"></div> 81 <div id="main-status-bar" class="status-bar"><div id="anchored-status-bar-items"><button id="dock-status-bar-item" class="status-bar-item toggled"></button><button id="console-status-bar-item" class="status-bar-item"></button>< /div></div>81 <div id="main-status-bar" class="status-bar"><div id="anchored-status-bar-items"><button id="dock-status-bar-item" class="status-bar-item toggled"></button><button id="console-status-bar-item" class="status-bar-item"></button><div id="error-warning-count" class="hidden"></div></div></div> 82 82 </div> 83 83 <div id="console"> -
trunk/WebCore/page/inspector/inspector.js
r33508 r33525 182 182 WebInspector.animateStyle(animations, 250, animationFinished); 183 183 } 184 }, 185 186 get errors() 187 { 188 return this._errors || 0; 189 }, 190 191 set errors(x) 192 { 193 x = Math.max(x, 0); 194 195 if (this._errors === x) 196 return; 197 this._errors = x; 198 this._updateErrorAndWarningCounts(); 199 }, 200 201 get warnings() 202 { 203 return this._warnings || 0; 204 }, 205 206 set warnings(x) 207 { 208 x = Math.max(x, 0); 209 210 if (this._warnings === x) 211 return; 212 this._warnings = x; 213 this._updateErrorAndWarningCounts(); 214 }, 215 216 _updateErrorAndWarningCounts: function() 217 { 218 var errorWarningElement = document.getElementById("error-warning-count"); 219 if (!errorWarningElement) 220 return; 221 222 if (!this.errors && !this.warnings) { 223 errorWarningElement.addStyleClass("hidden"); 224 return; 225 } 226 227 errorWarningElement.removeStyleClass("hidden"); 228 229 errorWarningElement.removeChildren(); 230 231 if (this.errors) { 232 var errorElement = document.createElement("span"); 233 errorElement.id = "error-count"; 234 errorElement.textContent = this.errors; 235 errorWarningElement.appendChild(errorElement); 236 } 237 238 if (this.warnings) { 239 var warningsElement = document.createElement("span"); 240 warningsElement.id = "warning-count"; 241 warningsElement.textContent = this.warnings; 242 errorWarningElement.appendChild(warningsElement); 243 } 244 245 if (this.errors) { 246 if (this.warnings) { 247 if (this.errors == 1) { 248 if (this.warnings == 1) 249 errorWarningElement.title = WebInspector.UIString("%d error, %d warning", this.errors, this.warnings); 250 else 251 errorWarningElement.title = WebInspector.UIString("%d error, %d warnings", this.errors, this.warnings); 252 } else if (this.warnings == 1) 253 errorWarningElement.title = WebInspector.UIString("%d errors, %d warning", this.errors, this.warnings); 254 else 255 errorWarningElement.title = WebInspector.UIString("%d errors, %d warnings", this.errors, this.warnings); 256 } else if (this.errors == 1) 257 errorWarningElement.title = WebInspector.UIString("%d error", this.errors); 258 else 259 errorWarningElement.title = WebInspector.UIString("%d errors", this.errors); 260 } else if (this.warnings == 1) 261 errorWarningElement.title = WebInspector.UIString("%d warning", this.warnings); 262 else if (this.warnings) 263 errorWarningElement.title = WebInspector.UIString("%d warnings", this.warnings); 264 else 265 errorWarningElement.title = null; 184 266 } 185 267 } … … 258 340 else 259 341 dockToggleButton.title = WebInspector.UIString("Dock to main window."); 342 343 var errorWarningCount = document.getElementById("error-warning-count"); 344 errorWarningCount.addEventListener("click", this.console.show.bind(this.console), false); 345 this._updateErrorAndWarningCounts(); 260 346 261 347 document.getElementById("search-toolbar-label").textContent = WebInspector.UIString("Search");
Note: See TracChangeset
for help on using the changeset viewer.