Difference between revisions of "User:Podehaye/button.js"

From Wikibase Personal data
Jump to navigation Jump to search
(Created page with " mw.loader.using( 'oojs-ui-core' ).done( function () { $( function () { var button = new OO.ui.ButtonWidget( { label: 'Click me!' } ); button.on( 'click', function () {...")
 
Line 6: Line 6:
 
alert( '<span>You clicked the button defined <a href="https://wiki.personaldata.io/w/index.php?title=User:Podehaye/button.js">here</a>!</span>' );
 
alert( '<span>You clicked the button defined <a href="https://wiki.personaldata.io/w/index.php?title=User:Podehaye/button.js">here</a>!</span>' );
 
} );
 
} );
$( '#mw-content-text' ).append( button.$element );
+
$( '#mw-content-text' ).prepend( button.$element );
 
} );
 
} );
 
} );
 
} );

Revision as of 00:03, 20 April 2019

mw.loader.using( 'oojs-ui-core' ).done( function () {
	$( function () {
		var button = new OO.ui.ButtonWidget( { label: 'Click me!' } );
		button.on( 'click', function () {
			alert( '<span>You clicked the button defined <a href="https://wiki.personaldata.io/w/index.php?title=User:Podehaye/button.js">here</a>!</span>' );
		} );
		$( '#mw-content-text' ).prepend( button.$element );
	} );
} );