Utente:Delfo/common.js: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Delfo (discussione | contributi)
m test
Delfo (discussione | contributi)
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.
pages: {
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
emoticons: {
// Configure a new toolbar entry on the given $textarea jQuery object.
layout: 'Citazioni',
$textarea.wikiEditor( 'addToToolbar', {
label: 'Ref',
characters: [ '<ref>', '{{Cita web|url=|titolo=|accesso=}}', '</ref>']
$textarea.wikiEditor( 'addToToolbar', {
section: 'characterssecondary',
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( {
label: 'RefDo a thing',
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;
}
}
}
} );
} );
} );
} );
}