User:PrelevatedInsider22581/common.js: Difference between revisions

From BetaArchive Wiki
No edit summary
No edit summary
Line 6: Line 6:
button.on( 'click', function () {
button.on( 'click', function () {
             mw.loader.using( 'oojs-ui-core' ).done( function () {
             mw.loader.using( 'oojs-ui-core' ).done( function () {
                 OO.ui.alert( 'Something happened!' ).done( function () {
                 $( function () {
    console.log( 'User closed the dialog.' );
                      OO.ui.alert( 'Something happened!' ).done( function () {
} );
                              console.log( 'User closed the dialog.' );
                        } );
                  } );
             } );
             } );
} );
} );

Revision as of 18:00, 17 July 2023

mw.loader.using( 'oojs-ui-core' ).done( function () {
	$( function () {
		var button = new OO.ui.ButtonWidget( {
			label: 'Click me!'
		} );
		button.on( 'click', function () {
            mw.loader.using( 'oojs-ui-core' ).done( function () {
                 $( function () {
                       OO.ui.alert( 'Something happened!' ).done( function () {
                              console.log( 'User closed the dialog.' );
                        } );
                  } );
            } );
		} );
		$( '#mw-content-text' ).append( button.$element );
	} );
} );