Geen bewerkingssamenvatting |
Geen bewerkingssamenvatting |
||
(14 tussenliggende versies door 4 gebruikers niet weergegeven) | |||
Regel 1: | Regel 1: | ||
<noinclude> | <noinclude>Dit is de Widget:EMMNavigatorTree Widget.</noinclude> | ||
Dit is de Widget:EMMNavigatorTree Widget. | |||
</noinclude> | |||
<includeonly> | <includeonly> | ||
<div id="emm-navtree" class="demo" style="margin-top:1em;"></div> | |||
<link rel="stylesheet" type="text/css" href="../extensions/emm-navigation-tree/js/lib/style.css"> | |||
< | |||
<script type="text/javascript"> | <script type="text/javascript"> | ||
function checkIfReadyAndExecute() | function checkIfReadyAndExecute() | ||
{ | { | ||
var c='<!--{$rootPages}-->'; | |||
var emmNavigationTree=new EMMNavigationTree(mw, | |||
"<!--{$currentPageName|default:'Pagename niet doorgekregen'}-->",c); | |||
} | |||
RLQ.push(function () { | |||
function waitForMwLoaderUsing(callback) { | |||
if (typeof mw !== 'undefined' && mw.loader && typeof mw.loader.using === 'function') { | |||
callback(); | |||
} else { | |||
console.warn('mw.loader.using is not available yet. Retrying...'); | |||
setTimeout(function() { | |||
waitForMwLoaderUsing(callback); | |||
}, 100); // Retry every 100 milliseconds | |||
} | |||
} | |||
waitForMwLoaderUsing(function () { | |||
mw.loader.using(['ext.EMMNavigationTree', 'mediawiki.api']) | |||
.then(function () { | |||
console.log('Modules loaded'); | |||
checkIfReadyAndExecute(); | |||
}) | |||
.catch(function (err) { | |||
console.error('Error loading modules:', err); | |||
}); | |||
}); | |||
}); | |||
</script> | </script> | ||
</includeonly> | </includeonly> |
Huidige versie van 24 jun 2024 om 14:30
Dit is de Widget:EMMNavigatorTree Widget.