Warning.png

Поддержка Wiki прекращена, она доступна в режиме архива. Информация в ней устарела и может быть неактуальной.

Изменения

Перейти к: навигация, поиск

MediaWiki:Common.js

1756 байтов убрано, 10:01, 6 августа 2016
Нет описания правки
/* Fires when DOM is ready */
$( function() {
 
 
/**
* Fix edit summary prompt for undo
*
* Fixes the fact that the undo function combined with the "no edit summary prompter"
* causes problems if leaving the edit summary unchanged.
* Added by [[wikipedia:User:Deskana]], code by [[wikipedia:User:Tra]].
* See https://bugzilla.wikimedia.org/show_bug.cgi?id=8912
*/
if ( document.location.search.indexOf( "undo=" ) !== -1 && document.getElementsByName( 'wpAutoSummary' )[0] ) {
document.getElementsByName( 'wpAutoSummary' )[0].value='1';
}
 
 
/**
* Pause grid GUI templates (e.g. [[Template:Grid/Crafting Table]]) on mouseover
*
* This is so people have a chance to look at each image on the cell
* and click on pages they want to view.
*/
$( '#mw-content-text' ).on( {
'mouseenter': function() {
$( this ).find( '.animated' ).removeClass( 'animated' ).addClass( 'paused' );
},
'mouseleave': function() {
$( this ).find( '.paused' ).removeClass( 'paused' ).addClass( 'animated' );
}
}, '.grid-generic, .grid-Crafting_Table, .grid-Furnace, .grid-Brewing_Stand, .mcui' );
 
 
/**
* Make simple search suggestions box separately styled
*/
mw.loader.using( 'mediawiki.searchSuggest', function() {
$( '.suggestions:first' ).addClass( 'searchbar' );
} );
 
 
/**
* Set unlicensed as the default license on file pages
*
* That way the file will be categorised so someone can find a license for the file
*/
if ( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Upload' ) {
if ( $( '#wpLicense' ).val() === '' ) {
$( '#wpLicense' ).val( i18n.defaultLicense );
}
mw.loader.using( 'mediawiki.legacy.upload', function() {
var change = setInterval( function() {
if ( licenseSelectorCheck ) {
$( '#wpLicense' ).change();
clearInterval( change );
}
}, 500 );
} );
}
 
/**

Навигация