I have managed to load the subtables on the main page.
These are the steps I have taken so far:
<div id="{{PAGENAME}}_tabber"><tabber>
|-|1 - 40=
|-|41 - 80=
</tabber></div>
var pName = mw.config.get('wgPageName');
if(pName==='Αλάνα' && $('div#'+pName+'_tabber').length==1)
{
mw.loader.using(['mediawiki.api'], function()
{
var api = new mw.Api();
var container = $('div#'+pName+'_tabber');
$.each($(container).find('ul li'),function(k,v)
{
var sPage = $(v).attr('data-hash').replace(/_/g,'');
api.get({
action: 'parse',
page: pName+'/'+sPage,
prop: 'text',
format: 'json'
}).done(function(data)
{
$(container).find('div.wds-tab__content').eq(k).find('p').replaceWith(data.parse.text['*']);
});
});
});
}
I have added the above JS to my personal JS page:
https://ikariam.fandom.com/el/wiki/User:Panos78/common.js
All the above code loads the subtables in the blink of an eye, but something is still missing... the tooltips are not working.
In order for the tooltips to work, the entire code from the file:
https://ikariam.fandom.com/el/wiki/MediaWiki:Expansion.js
should be loaded and fired after the last subtable is fetched and placed on the main page and it will be able to handle both subtables.
I believe there must be a combination of the code from Expansion.js and the code you have suggested, but I cannot figure out what the combination should be.