Utente:Delfo/common.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
m test |
Nessun oggetto della modifica |
||
(Una versione intermedia di uno stesso utente non è mostrata) | |||
Riga 1:
// Check if we're editing a page.
$textarea.wikiEditor( 'addToToolbar', {▼
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
section: 'characters',▼
// Add a hook handler.
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
// Configure a new toolbar entry on the given $textarea jQuery object.
▲ $textarea.wikiEditor( 'addToToolbar', {
label: 'Ref',▼
$textarea.wikiEditor( 'addToToolbar', {
group: 'default',
tools: {
dothing: {
type: 'element',
element: function ( context ) {
// Note that the `context` object contains various useful references.
console.log( context );
var button = new OO.ui.ButtonInputWidget( {
icon: 'hieroglyph'
} );▼
button.connect( null, {
click: function ( e ) {
// Do whatever is required when the button is clicked.
console.log( e );
OO.ui.alert( 'A thing is done.' );
}
} );
return button.$element;
}
}
}
} );
▲} );
} );
} );
}
|