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

Contenuto cancellato Contenuto aggiunto
Delfo (discussione | contributi)
Nuova pagina: //<pre> // Elenco dei tool da caricare. var toLoad="purg led ns0 lks orol tabs nav stru unw tbar avan cwtch popup nms chat cmd qed wed since goo rch edt ver vpop vfol...
 
Delfo (discussione | contributi)
Nessun oggetto della modifica
 
(5 versioni intermedie di 3 utenti non mostrate)
Riga 1:
// Check if we're editing a page.
//<pre>
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
 
// ElencoAdd deia toolhook da caricarehandler.
mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
 
// Configure a new toolbar entry on the given $textarea jQuery object.
var toLoad="purg led ns0 lks orol tabs nav stru unw tbar avan cwtch popup nms chat cmd qed wed since goo rch edt ver vpop vfol bot linkcomplete qdel lrc dels";
$textarea.wikiEditor( 'addToToolbar', {
 
 
$textarea.wikiEditor( 'addToToolbar', {
 
section: 'secondary',
//Monobook Modulare
group: 'default',
//Lancia il vero monobook
tools: {
// Vedi [[Wikipedia:Monobook.js/MonobookCompleto.js]]
dothing: {
//
type: 'element',
importScript("Wikipedia:Monobook.js/MonobookCompleto.js");
element: function ( context ) {
 
// Note that the `context` object contains various useful references.
//</pre>
console.log( context );
var button = new OO.ui.ButtonInputWidget( {
label: 'Do 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;
}
}
}
} );
} );
} );
}