52,192
edits
Marblemadmax (talk | contribs) mNo edit summary |
Marblemadmax (talk | contribs) 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() { | ||
if (typeof mw === 'object' && typeof mw.hook === 'function') { | |||
mw.hook('wikipage.content').add(function ($content) { | |||
updateGallery(); | |||
}); | |||
} else { | |||
console.error('MediaWiki scripts not loaded'); | |||
} | |||
}); | }); | ||