X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki.inspect.js;h=72a27fa57fa352f2740e67af024c4bdd050cc5d7;hb=1284faa4950f1feba3b1b35473f31a1b8100aa37;hp=f4545dee0f626ff1fba6ff9cae91e890dcfdf9b7;hpb=abdbb51ead53edcd09ec1ab4c3dd15365441e611;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki.inspect.js b/resources/src/mediawiki.inspect.js index f4545dee0f..72a27fa57f 100644 --- a/resources/src/mediawiki.inspect.js +++ b/resources/src/mediawiki.inspect.js @@ -7,7 +7,7 @@ /* eslint-disable no-console */ -( function ( mw, $ ) { +( function () { // mw.inspect is a singleton class with static methods // that itself can also be invoked as a function (mediawiki.base/mw#inspect). @@ -40,9 +40,13 @@ var i, units = [ '', ' KiB', ' MiB', ' GiB', ' TiB', ' PiB' ]; - if ( !$.isNumeric( bytes ) || bytes === 0 ) { return bytes; } + if ( !$.isNumeric( bytes ) || bytes === 0 ) { + return bytes; + } - for ( i = 0; bytes >= 1024; bytes /= 1024 ) { i++; } + for ( i = 0; bytes >= 1024; bytes /= 1024 ) { + i++; + } // Maintain one decimal for kB and above, but don't // add ".0" for bytes. return bytes.toFixed( i > 0 ? 1 : 0 ) + units[ i ]; @@ -153,6 +157,7 @@ style.textContent = css; document.body.appendChild( style ); + // eslint-disable-next-line jquery/no-each-util $.each( style.sheet.cssRules, function ( index, rule ) { selectors.total++; // document.querySelector() on prefixed pseudo-elements can throw exceptions @@ -385,4 +390,4 @@ mw.log( 'mw.inspect: reports are not available in debug mode.' ); } -}( mediaWiki, jQuery ) ); +}() );