Diferencia entre revisiones de «Usuario:Hasley/sandbox/test.js»

Sin resumen de edición
Sin resumen de edición
Línea 1: Línea 1:
// 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-beta').attr('data-id')
    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 13: Línea 21:
}
}


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

Revisión del 03:38 11 ene 2022

// 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 );

	} );
}