MediaWiki:Common.js: Difference between revisions
((by SublimeText.Mediawiker)) |
((by SublimeText.Mediawiker)) |
||
Line 1: | Line 1: | ||
mw.loader.load( 'https://use.fontawesome.com/releases/v5.0.7/js/all.js' ); | mw.loader.load( 'https://use.fontawesome.com/releases/v5.0.7/js/all.js' ); | ||
// OOUI Buttons | |||
// Example: A ButtonWidget configured with an icon, label, and styling flag. | |||
// Create a new ButtonWidget. | |||
var ooui_button = new OO.ui.ButtonWidget(); | |||
// Configure the ButtonWidget. In this example, methods are used to configure the | |||
// button's icon, label, and styling flag. | |||
ooui_button.setIcon( 'info' ) | |||
.setLabel( 'Button with icon' ) | |||
.setFlags( 'progressive' ); | |||
// Append the button to the DOM. | |||
$( '.oo-ui-button' ).append( ooui_button.$element ); |
Revision as of 15:46, 28 February 2018
mw.loader.load( 'https://use.fontawesome.com/releases/v5.0.7/js/all.js' );
// OOUI Buttons
// Example: A ButtonWidget configured with an icon, label, and styling flag.
// Create a new ButtonWidget.
var ooui_button = new OO.ui.ButtonWidget();
// Configure the ButtonWidget. In this example, methods are used to configure the
// button's icon, label, and styling flag.
ooui_button.setIcon( 'info' )
.setLabel( 'Button with icon' )
.setFlags( 'progressive' );
// Append the button to the DOM.
$( '.oo-ui-button' ).append( ooui_button.$element );