MediaWiki:Gadget-lib-toolbar.js: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Beau (dyskusja | edycje)
drobne techniczne
Beau (dyskusja | edycje)
nowa wersja
Linia 6:
window.toolbarGadget = {
/** Version of the gadget */
version: 45,
/** A status of the pagegadget */
pageLoadedready: false,
/** Indicates wheter the user has enabled the new toolbar */
wikieditor: null,
/** An array of buttons, which were added before a toolbar was constructed */
buttons: [],
Linia 26 ⟶ 28:
*/
addButton: function( button ) {
if ( !this.pageLoadedready ) {
this.buttons.push( button );
return;
Linia 130 ⟶ 132:
}
},
 
/** Sets up the gadget */
init: function() {
this.wikieditor = mw.user.options.get( 'usebetatoolbar' ) === 1;
this.pageLoaded = true;
for ( var ithat = 0; i < this.buttons.length; i++ ) {
 
this.addButton( this.buttons[i] );
hookEvent( var 'load',addButtons = function() {
jQuery( document ).ready( function() {
this that.pageLoadedready = true;
for ( var i = 0; i < that.buttons.length; i++ ) {
this that.addButton( thisthat.buttons[i] );
}
this that.buttons = null;
} );
};
 
if ( this.wikieditor ) {
mw.loader.using( "mediawikiext.legacywikiEditor.wikibitstoolbar", function() {
addButtons();
} );
} else {
mw.loader.using( "mediawiki.action.edit", function() {
addButtons();
} );
}
this.buttons = null;
}
};
 
toolbarGadget.init();
mw.loader.using( "mediawiki.legacy.wikibits", function() {
hookEvent( 'load', function() {
toolbarGadget.init();
} );
} );
}