X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fmediawiki%2Fmediawiki.debug.js;h=88af3c653dde979dae46a156a87dce1a4b75487f;hb=e413fbf1f32da7997eced8eb9f9a7cce204ea863;hp=e631c7601440c2c9bcbac509f268f436febc1f04;hpb=10e91851b2568267e5ccb7bbd0ab24ec4f2a195a;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/mediawiki/mediawiki.debug.js b/resources/mediawiki/mediawiki.debug.js index e631c76014..88af3c653d 100644 --- a/resources/mediawiki/mediawiki.debug.js +++ b/resources/mediawiki/mediawiki.debug.js @@ -5,12 +5,13 @@ * @since 1.19 */ -( function ( $, mw, undefined ) { -"use strict"; +( function ( mw, $ ) { + 'use strict'; - var hovzer = $.getFootHovzer(); + var debug, + hovzer = $.getFootHovzer(); - var debug = mw.Debug = { + debug = mw.Debug = { /** * Toolbar container element * @@ -93,9 +94,9 @@ * Constructs the HTML for the debugging toolbar */ buildHtml: function () { - var $container, $bits, panes, id; + var $container, $bits, panes, id, gitInfo; - $container = $( '
' ); + $container = $( '
' ); $bits = $( '
' ); @@ -106,9 +107,9 @@ * @return {jQuery} */ function bitDiv( id ) { - return $( '
' ).attr({ + return $( '
' ).prop({ id: 'mw-debug-' + id, - 'class': 'mw-debug-bit' + className: 'mw-debug-bit' }) .appendTo( $bits ); } @@ -122,8 +123,8 @@ */ function paneLabel( id, text ) { return $( '' ) - .attr({ - 'class': 'mw-debug-panelabel', + .prop({ + className: 'mw-debug-panelabel', href: '#mw-debug-pane-' + id }) .text( text ); @@ -138,12 +139,12 @@ * @return {jQuery} */ function paneTriggerBitDiv( id, text, count ) { - if( count ) { + if ( count ) { text = text + ' (' + count + ')'; } - return $( '
' ).attr({ + return $( '
' ).prop({ id: 'mw-debug-' + id, - 'class': 'mw-debug-bit mw-debug-panelink' + className: 'mw-debug-bit mw-debug-panelink' }) .append( paneLabel( id, text ) ) .appendTo( $bits ); @@ -159,20 +160,22 @@ paneTriggerBitDiv( 'includes', 'PHP includes', this.data.includes.length ); - var gitInfo = ''; - if ( this.data.gitRevision != false ) { + gitInfo = ''; + if ( this.data.gitRevision !== false ) { gitInfo = '(' + this.data.gitRevision.substring( 0, 7 ) + ')'; - if ( this.data.gitViewUrl != false ) { - gitInfo = $( '' ).attr( 'href', this.data.gitViewUrl ).text( gitInfo ); + if ( this.data.gitViewUrl !== false ) { + gitInfo = $( '' ) + .attr( 'href', this.data.gitViewUrl ) + .text( gitInfo ); } } bitDiv( 'mwversion' ) - .append( $( '' ).text( 'MediaWiki' ) ) - .append( ': ' + this.data.mwVersion + ' ' ) + .append( $( 'MediaWiki' ) ) + .append( document.createTextNode( ': ' + this.data.mwVersion + ' ' ) ) .append( gitInfo ); - if ( this.data.gitBranch != false ) { + if ( this.data.gitBranch !== false ) { bitDiv( 'gitbranch' ).text( 'Git branch: ' + this.data.gitBranch ); } @@ -184,9 +187,7 @@ .text( 'Time: ' + this.data.time.toFixed( 5 ) ); bitDiv( 'memory' ) - .text( 'Memory: ' + this.data.memory ) - .append( $( '' ).text( ' (' + this.data.memoryPeak + ')' ) ); - + .text( 'Memory: ' + this.data.memory + ' (Peak: ' + this.data.memoryPeak + ')' ); $bits.appendTo( $container ); @@ -204,8 +205,8 @@ } $( '
' ) - .attr({ - 'class': 'mw-debug-pane', + .prop({ + className: 'mw-debug-pane', id: 'mw-debug-pane-' + id }) .append( panes[id] ) @@ -223,9 +224,9 @@ $table = $( '' ); - $('').css( 'width', /*padding=*/20 + ( 10*/*fontSize*/11 ) ).appendTo( $table ); - $('').appendTo( $table ); - $('').css( 'width', 350 ).appendTo( $table ); + $( '' ).css( 'width', /* padding = */ 20 + ( 10 * /* fontSize = */ 11 ) ).appendTo( $table ); + $( '' ).appendTo( $table ); + $( '' ).css( 'width', 350 ).appendTo( $table ); entryTypeText = function( entryType ) { @@ -248,7 +249,7 @@ $( '' ) .append( $( '' ) - .append( $('').css( 'width', '4em' ) ) - .append( $('') ) - .append( $('').css( 'width', '8em' ) ) - .append( $('').css( 'width', '18em' ) ) + .append( $( '' ).css( 'width', '4em' ) ) + .append( $( '' ) ) + .append( $( '' ).css( 'width', '8em' ) ) + .append( $( '' ).css( 'width', '18em' ) ) .appendTo( $table ); for ( i = 0, length = this.data.queries.length; i < length; i += 1 ) { @@ -298,7 +299,7 @@ for ( i = 0, length = this.data.debugLog.length; i < length; i += 1 ) { line = this.data.debugLog[i]; $( '
  • ' ) - .html( mw.html.escape( line ).replace( /\n/g, "
    \n" ) ) + .html( mw.html.escape( line ).replace( /\n/g, '
    \n' ) ) .appendTo( $list ); } @@ -361,4 +362,4 @@ } }; -} )( jQuery, mediaWiki ); +}( mediaWiki, jQuery ) );
  • ' ) .text( entry.typeText ) - .attr( 'class', 'mw-debug-console-' + entry.type ) + .addClass( 'mw-debug-console-' + entry.type ) ) .append( $( '' ).html( entry.msg ) ) .append( $( '' ).text( entry.caller ) ) @@ -267,10 +268,10 @@ $table = $( '
    ' ); $( '
    #SQLTimeCall#SQLTimeCall