r109129 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109128‎ | r109129 | r109130 >
Date:09:58, 17 January 2012
Author:hashar
Status:ok (Comments)
Tags:
Comment:
dbg toolbar query list

* add headers (using <th> instead of <colgroup>
* hardcoded width that looks fine to me. 4em is enoug for query count
* split function name / execution time in their own column
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.debug.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.debug.js
@@ -243,11 +243,12 @@
244244
245245 $table = $( '<table id="mw-debug-querylist"></table>' );
246246
247 - // Widths on table cells and columns behave weird in some browsers like Chrome,
248 - // in that, contrary to the W3 box model, padding does not increase cells having a fixed width
249 - $('<colgroup>').css( 'width', /*padding=*/20 + ( String( this.data.queries.length ).length*/*fontSize*/11 ) ).appendTo( $table );
250 - $('<colgroup>').appendTo( $table );
251 - $('<colgroup>').css( 'width', 350 ).appendTo( $table );
 247+ $( '<tr>' )
 248+ .append( $('<th>#</th>').css( 'width', '4em' ) )
 249+ .append( $('<th>SQL</th>') )
 250+ .append( $('<th>Time</th>').css( 'width', '8em' ) )
 251+ .append( $('<th>Call</th>').css( 'width', '12em' ) )
 252+ .appendTo( $table );
252253
253254 for ( i = 0, length = this.data.queries.length; i < length; i += 1 ) {
254255 query = this.data.queries[i];
@@ -255,11 +256,9 @@
256257 $( '<tr>' )
257258 .append( $( '<td>' ).text( i + 1 ) )
258259 .append( $( '<td>' ).text( query.sql ) )
259 - .append( $( '<td>' )
260 - .append( $( '<span class="stats"></span>' ).text( '(' + query.time.toFixed( 4 ) + 'ms) ' ) )
261 - .append( query['function'] )
262 - )
263 - .appendTo( $table );
 260+ .append( $( '<td class="stats">' ).text( query.time.toFixed( 4 )+ 'ms' ) )
 261+ .append( $( '<td>' ).text( query['function'] ) )
 262+ .appendTo( $table );
264263 }
265264
266265

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r107862Implemented console panel in debug toolbarjohnduhart05:56, 3 January 2012

Comments

#Comment by Nikerabbit (talk | contribs)   11:02, 19 January 2012

I again have horizontal scrollbars, not sure if the cause is this or something else.

#Comment by Hashar (talk | contribs)   14:07, 19 January 2012

Try it with previous revision:

svn up -r 109128

In which browser? What happens with another browser? :-b

#Comment by Robmoen (talk | contribs)   18:47, 20 January 2012

In CSS change "overflow: scroll;" to:

.mw-debug-plane { overflow-y: scroll; }

That seems to remove the horizontal scrollbar for me.

Status & tagging log