MediaWiki:Vector.js: различия между версиями
Перейти к навигации
Перейти к поиску
Нет описания правки |
← Новая страница: «/* Размещённый здесь код JavaScript будет загружаться пользователям, использующим тему офо…» |
||
Строка 1: | Строка 1: | ||
$('# | /* Размещённый здесь код JavaScript будет загружаться пользователям, использующим тему оформления Vector */ | ||
$( '#wpTextbox1' ).on( 'wikiEditor-toolbar-buildSection-main', function( event, section ) { | |||
// Add icons for bold (F) and italic (L) for Swedish (sv) | |||
// | // Don't overwrite them if they're already defined, so this hack can safely be removed once the | ||
if( | // usability team incorporates these icons in the software | ||
if ( !( 'sv' in section.groups.format.tools.bold.icon ) ) { | |||
// 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]; | |||
} | |||
} ); |
Версия от 01:32, 16 апреля 2016
/* Размещённый здесь код JavaScript будет загружаться пользователям, использующим тему оформления Vector */
$( '#wpTextbox1' ).on( 'wikiEditor-toolbar-buildSection-main', function( event, section ) {
// Add icons for bold (F) and italic (L) for Swedish (sv)
// Don't overwrite them if they're already defined, so this hack can safely be removed once the
// usability team incorporates these icons in the software
if ( !( 'sv' in section.groups.format.tools.bold.icon ) ) {
// 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];
}
} );