Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
No edit summary
No edit summary
Line 206: Line 206:


function getSpellIcon(iconType) {
function getSpellIcon(iconType) {
var iconIndex = iconType === 'divine' ? 1 : 0;
var fileName = iconType === 'divine' ? 'DivineIcon.png' : 'ArcaneIcon.png';
var $sourceIcon = $('.wizlords-magic-intro-icon img').eq(iconIndex);
var scriptPath = mw.config.get('wgScriptPath') || '';


if (!$sourceIcon.length) {
return $('<img>')
return $('<span>').text('');
.attr('src', scriptPath + '/index.php/Special:FilePath/' + encodeURIComponent(fileName))
}
.attr('alt', '')
 
.attr('loading', 'lazy')
return $sourceIcon.clone()
.attr('decoding', 'async');
.removeAttr('width')
.removeAttr('height')
.removeAttr('srcset')
.removeAttr('sizes')
.removeAttr('style')
.attr('alt', '');
}
}