MediaWiki:Common.js: Difference between revisions
From Heroes of Might and Magic: Olden Era Official Wiki
m test Tag: Reverted |
Undo revision 3327 by 76561198021843184 (talk) Tag: Undo |
||
| Line 22: | Line 22: | ||
); | ); | ||
}); | }); | ||
Revision as of 13:15, 29 October 2025
/* Any JavaScript here will be loaded for all users on every page load. */
$(function() {
var $box = $('#spellboxv-display');
$('.spell-link').hover(
function() {
var spellName = $(this).data('spell');
var apiUrl = mw.util.wikiScript('api');
$.post(apiUrl, {
action: 'parse',
format: 'json',
text: '{{#invoke:SpellTableUtil|spellBoxV|name=' + spellName + '}}',
contentmodel: 'wikitext'
}, function(data) {
var html = data.parse.text['*'];
$box.html(html).show();
});
},
function() {
$box.hide().empty();
}
);
});


