Merge "Fix unexpected return type of User::idFromName()"
[lhc/web/wiklou.git] / resources / src / mediawiki.debug / debug.js
index 37c0fac..32dbdc1 100644 (file)
@@ -1,4 +1,4 @@
-( function ( mw, $ ) {
+( function () {
        'use strict';
 
        var debug,
                buildHtml: function () {
                        var $container, $bits, panes, id, gitInfo;
 
-                       $container = $( '<div id="mw-debug-toolbar" class="mw-debug" lang="en" dir="ltr"></div>' );
+                       $container = $( '<div>' )
+                               .attr( {
+                                       id: 'mw-debug-toolbar',
+                                       lang: 'en',
+                                       dir: 'ltr'
+                               } )
+                               .addClass( 'mw-debug' );
 
-                       $bits = $( '<div class="mw-debug-bits"></div>' );
+                       $bits = $( '<div>' ).addClass( 'mw-debug-bits' );
 
                        /**
                         * Returns a jQuery element for a debug-bit div
                        }
 
                        bitDiv( 'mwversion' )
-                               .append( $( '<a href="//www.mediawiki.org/">MediaWiki</a>' ) )
+                               .append( $( '<a>' ).attr( 'href', '//www.mediawiki.org/' ).text( 'MediaWiki' ) )
                                .append( document.createTextNode( ': ' + this.data.mwVersion + ' ' ) )
                                .append( gitInfo );
 
                        }
 
                        bitDiv( 'phpversion' )
-                               .append( $( this.data.phpEngine === 'HHVM' ?
-                                       '<a href="https://hhvm.com/">HHVM</a>' :
-                                       '<a href="https://php.net/">PHP</a>'
-                               ) )
+                               .append( this.data.phpEngine === 'HHVM' ?
+                                       $( '<a>' ).attr( 'href', 'https://hhvm.com/' ).text( 'HHVM' ) :
+                                       $( '<a>' ).attr( 'href', 'https://php.net/' ).text( 'PHP' )
+                               )
                                .append( ': ' + this.data.phpVersion );
 
                        bitDiv( 'time' )
                buildConsoleTable: function () {
                        var $table, entryTypeText, i, length, entry;
 
-                       $table = $( '<table id="mw-debug-console">' );
+                       $table = $( '<table>' ).attr( 'id', 'mw-debug-console' );
 
                        $( '<colgroup>' ).css( 'width', /* padding = */ 20 + ( 10 * /* fontSize = */ 11 ) ).appendTo( $table );
                        $( '<colgroup>' ).appendTo( $table );
                buildQueryTable: function () {
                        var $table, i, length, query;
 
-                       $table = $( '<table id="mw-debug-querylist"></table>' );
+                       $table = $( '<table>' ).attr( 'id', 'mw-debug-querylist' );
 
                        $( '<tr>' )
-                               .append( $( '<th>#</th>' ).css( 'width', '4em' ) )
-                               .append( $( '<th>SQL</th>' ) )
-                               .append( $( '<th>Time</th>' ).css( 'width', '8em' ) )
-                               .append( $( '<th>Call</th>' ).css( 'width', '18em' ) )
+                               .append( $( '<th>' ).text( '#' ).css( 'width', '4em' ) )
+                               .append( $( '<th>' ).text( 'SQL' ) )
+                               .append( $( '<th>' ).text( 'Time' ).css( 'width', '8em' ) )
+                               .append( $( '<th>' ).text( 'Call' ).css( 'width', '18em' ) )
                                .appendTo( $table );
 
                        for ( i = 0, length = this.data.queries.length; i < length; i += 1 ) {
                                $( '<tr>' )
                                        .append( $( '<td>' ).text( i + 1 ) )
                                        .append( $( '<td>' ).text( query.sql ) )
-                                       .append( $( '<td class="stats">' ).text( ( query.time * 1000 ).toFixed( 4 ) + 'ms' ) )
-                                       .append( $( '<td>' ).text( query[ 'function' ] ) )
+                                       .append( $( '<td>' ).text( ( query.time * 1000 ).toFixed( 4 ) + 'ms' ).addClass( 'stats' ) )
+                                       .append( $( '<td>' ).text( query.function ) )
                                        .appendTo( $table );
                        }
 
                                file = this.data.includes[ i ];
                                $( '<tr>' )
                                        .append( $( '<td>' ).text( file.name ) )
-                                       .append( $( '<td class="nr">' ).text( file.size ) )
+                                       .append( $( '<td>' ).text( file.size ).addClass( 'nr' ) )
                                        .appendTo( $table );
                        }
 
                debug.init();
        } );
 
-}( mediaWiki, jQuery ) );
+}() );