Diferencia entre revisiones de «MediaWiki:Common.js»

Página de la interfaz de MediaWiki
Sin resumen de edición
Sin resumen de edición
Línea 9: Línea 9:
// barra de progreso
// barra de progreso
if ( mw.config.get( 'wgPageName' ) === 'Usuario:Hasley/sandbox2' ) {
if ( mw.config.get( 'wgPageName' ) === 'Usuario:Hasley/sandbox2' ) {
$.when( $.ready, mw.loader.using( [ 'oojs-ui' ] ) ).then( function () {
$.when( $.ready, mw.loader.using( [ 'oojs-ui' ] ) ).then( function () {


var number = $( '#progress-bar' ).text();
barId = 1;
 
var number = $( '#progress-bar-' + barId ).attr( 'data-id-' + barId );


var progressBar = new OO.ui.ProgressBarWidget( {
var progressBar = new OO.ui.ProgressBarWidget( {
progress: number
progress: number
} );
} );
progressBar.$element.css({
borderRadius: '.2rem',
margin: '0 auto',
});


if ( progressBar.progress < 100 ) {
if ( progressBar.progress < 100 ) {
Línea 21: Línea 29:
}
}


$( '#progress-bar' ).append( progressBar.$element );
$( '#progress-bar-' + barId ).append( progressBar.$element );
 
} );
} );
}
}

Revisión del 00:34 12 ene 2022

// ocultar mw-pt-translate-header para los anónimos

mw.loader.using( [ 'mediawiki.user' ], function ( ) {
	if ( mw.user.isAnon() == 1 ) {
		mw.util.addCSS( '.mw-pt-translate-header {display:none}' );
	}
} );

// barra de progreso
if ( mw.config.get( 'wgPageName' ) === 'Usuario:Hasley/sandbox2' ) {

	$.when( $.ready, mw.loader.using( [ 'oojs-ui' ] ) ).then( function () {	

		barId = 1;

		var number = $( '#progress-bar-' + barId ).attr( 'data-id-' + barId );

		var progressBar = new OO.ui.ProgressBarWidget( {
			progress: number
		} );

		progressBar.$element.css({
			borderRadius: '.2rem',
			margin: '0 auto',
		});

		if ( progressBar.progress < 100 ) {
		    progressBar.pushPending();
		}

		$( '#progress-bar-' + barId ).append( progressBar.$element );

	} );
}