Участник:Mike Novikoff/common.js: различия между версиями

Содержимое удалено Содержимое добавлено
u:ØM/quotes.js, and I'll even use importScript() to be counted
Wikificator: code from Jack
Строка 28:
// [https://ru.wikipedia.org/wiki/MediaWiki:Gadget-LegacyToolbar2006.js]
//
// Load the former (it will be used by Wikificator) and pretend
// that the latter is loaded as well (since Wikificator checks it)
// see <https://ru.wikipedia.org/?diff=96161584>
//
$.when( mw.loader.using([ 'ext.gadget.mediawiki.toolbar' ]) ).then( function() {
 
mw.hook( 'legacy.toolbar.ready' ).fire();
// seeCode <from Jack [https://ru.wikipedia.org/?diff=96161584>96950416]
//
var $toolbar = $( '#toolbar' );
if ( !$toolbar.length ) {
var $textBox = $( '#wpTextbox1' );
if ( $textBox.length ) {
$toolbar = $( '<div>' )
.attr( 'id', 'toolbar' )
.css( 'clear', 'none' )
.insertBefore( $textBox );
}
}
$( '<div>' )
.addClass( 'mw-toolbar-editbutton' )
.attr( 'alt', 'Викификатор' )
.attr( 'title', 'Викификатор — автоматический обработчик текста' )
.css( {
width: '69px',
backgroundImage: 'url(//upload.wikimedia.org/wikipedia/commons/3/38/Button_wikify.png)'
} )
.appendTo( $toolbar )
.click( Wikify );
});