MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
mw.hook('wikipage.content').add(function ($content) { | mw.hook('wikipage.content').add(function ($content) { | ||
// Check if the ix-time-display element exists | // Check if the ix-time-display element exists |
Latest revision as of 14:26, 2 January 2025
mw.hook('wikipage.content').add(function ($content) {
// Check if the ix-time-display element exists
if (document.getElementById('ix-time-display')) {
// If it exists, manually trigger the script
var script = document.createElement('script');
script.textContent = document.querySelector('#ix-time-display + script').textContent;
document.body.appendChild(script);
}
});
mw.hook('wikipage.content').add(function ($content) {
$content.find('script').each(function() {
if (this.textContent.includes('convertToIxTime')) {
eval(this.textContent);
}
});
});