MediaWiki:Vector.js: различия между версиями

Материал из Викимультии — энциклопедии мультипликации
Перейти к навигации Перейти к поиску
← Новая страница: «/* Размещённый здесь код JavaScript будет загружаться пользователям, использующим тему офо…»
Нет описания правки
 
(не показана 1 промежуточная версия этого же участника)
Строка 1: Строка 1:
/* Размещённый здесь код JavaScript будет загружаться пользователям, использующим тему оформления Vector */
// "Add section" at the bottom
$( '#wpTextbox1' ).on( 'wikiEditor-toolbar-buildSection-main', function( event, section ) {
if ( mw.config.get( 'wgNamespaceNumber' ) && mw.config.get( 'wgAction' ) === 'view' ) {
// Add icons for bold (F) and italic (L) for Swedish (sv)
$( '#ca-addsection a' )
// Don't overwrite them if they're already defined, so this hack can safely be removed once the
.clone()
// usability team incorporates these icons in the software
.addClass( 'ruwiki-addSectionBottom' )
if ( !( 'sv' in section.groups.format.tools.bold.icon ) ) {
.insertAfter( '#content' );
// There's already a bold F icon for German, use that one
}
section.groups.format.tools.bold.icon['sv'] = 'format-bold-F.png';
section.groups.format.tools.bold.offset['sv'] = [2, -214];
}
if ( !( 'sv' in section.groups.format.tools.italic.icon ) ) {
// Use an icon from Commons for L
section.groups.format.tools.italic.icon['sv'] = '//upload.wikimedia.org/wikipedia/commons/3/32/Toolbaricon_italic_L.png';
section.groups.format.tools.italic.offset['sv'] = [2, -214];
}
} );

Текущая версия от 14:17, 10 июля 2019

// "Add section" at the bottom
if ( mw.config.get( 'wgNamespaceNumber' ) && mw.config.get( 'wgAction' ) === 'view' ) {
	$( '#ca-addsection a' )
		.clone()
		.addClass( 'ruwiki-addSectionBottom' )
		.insertAfter( '#content' );
}