r109130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109129‎ | r109130 | r109131 >
Date:10:10, 17 January 2012
Author:hashar
Status:ok
Tags:
Comment:
dbg toolbar: makes pane title consistent

Example output:
Console (1) | Queries (45) | Debug Log (21) | Request | PHP includes (131)

A null / undefined / 0 value will skip the parentheses output.
Modified paths:
  • /trunk/phase3/resources/mediawiki/mediawiki.debug.js (modified) (history)

Diff [purge]

Index: trunk/phase3/resources/mediawiki/mediawiki.debug.js
@@ -127,10 +127,15 @@
128128 /**
129129 * Returns a jQuery element for a debug-bit div with a for a pane link
130130 *
131 - * @param id
 131+ * @param id CSS id snippet. Will be prefixed with 'mw-debug-'
 132+ * @param text Text to show
 133+ * @param count Optional count to show
132134 * @return {jQuery}
133135 */
134 - function paneTriggerBitDiv( id, text ) {
 136+ function paneTriggerBitDiv( id, text, count ) {
 137+ if( count ) {
 138+ text = text + ' (' + count + ')';
 139+ }
135140 return $( '<div>' ).attr({
136141 id: 'mw-debug-' + id,
137142 'class': 'mw-debug-bit mw-debug-panelink'
@@ -139,15 +144,15 @@
140145 .appendTo( $bits );
141146 }
142147
143 - paneTriggerBitDiv( 'console', 'Console (' + this.data.log.length + ')' );
 148+ paneTriggerBitDiv( 'console', 'Console', this.data.log.length );
144149
145 - paneTriggerBitDiv( 'querylist', 'Queries: ' + this.data.queries.length );
 150+ paneTriggerBitDiv( 'querylist', 'Queries', this.data.queries.length );
146151
147 - paneTriggerBitDiv( 'debuglog', 'Debug Log (' + this.data.debugLog.length + ' lines)' );
 152+ paneTriggerBitDiv( 'debuglog', 'Debug Log', this.data.debugLog.length );
148153
149154 paneTriggerBitDiv( 'request', 'Request' );
150155
151 - paneTriggerBitDiv( 'includes', this.data.includes.length + ' Files Included' );
 156+ paneTriggerBitDiv( 'includes', 'PHP includes', this.data.includes.length );
152157
153158 bitDiv( 'mwversion' )
154159 .append( $( '<a href="https://www.mediawiki.org//www.mediawiki.org/"></a>' ).text( 'MediaWiki' ) )

Status & tagging log