Widget:AvailableCritters: Difference between revisions

Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 102: Line 102:


// Listen for the wikipage.content hook to update the gallery after MediaWiki processes the content
// Listen for the wikipage.content hook to update the gallery after MediaWiki processes the content
mw.hook('wikipage.content').add(function ($content) {
window.addEventListener('load', function() {
     updateGallery();
    if (typeof mw === 'object' && typeof mw.hook === 'function') {
        mw.hook('wikipage.content').add(function ($content) {
            updateGallery();
        });
     } else {
        console.error('MediaWiki scripts not loaded');
    }
});
});