User:PrelevatedInsider22581/common.js: Difference between revisions

From BetaArchive Wiki
No edit summary
No edit summary
Line 1: Line 1:
function getHref() {
    return location.href;
}
mw.loader.using( 'oojs-ui-core' ).done( function () {
mw.loader.using( 'oojs-ui-core' ).done( function () {
$( function () {
$( function () {
Line 5: Line 9:
} );
} );
button.on( 'click', function () {
button.on( 'click', function () {
            mw.loader.using( 'oojs-ui-core' ).done( function () {
            location.href = getHref() + "&action=info"
                $( function () {
                      OO.ui.alert( 'Something happened!' ).done( function () {
                              console.log( 'User closed the dialog.' );
                        } );
                  } );
            } );
} );
} );
$( '#mw-content-text' ).append( button.$element );
$( '#mw-content-text' ).append( button.$element );
} );
} );
} );
} );

Revision as of 19:29, 17 July 2023

function getHref() {
    return location.href;
}

mw.loader.using( 'oojs-ui-core' ).done( function () {
	$( function () {
		var button = new OO.ui.ButtonWidget( {
			label: 'Click me!'
		} );
		button.on( 'click', function () {
             location.href = getHref() + "&action=info"
		} );
		$( '#mw-content-text' ).append( button.$element );
	} );
} );