MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
CaptainChris (talk | contribs) Created page with "→Any JavaScript here will be loaded for all users on every page load.: document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.infobox').forEach(box => { box.querySelectorAll('hr').forEach(hr => { const section = hr.previousSibling; if (section && section.nodeType === Node.TEXT_NODE && !section.textContent.trim()) { hr.style.display = 'none'; } }); }); });" |
CaptainChris (talk | contribs) No edit summary |
||
| Line 9: | Line 9: | ||
} | } | ||
}); | }); | ||
}); | |||
}); | |||
document.addEventListener("DOMContentLoaded", () => { | |||
const iframe = document.querySelector('iframe[key="wikiphone"]'); | |||
if (!iframe) return; | |||
iframe.style.width = "100%"; | |||
iframe.style.border = "none"; | |||
iframe.style.overflow = "hidden"; | |||
window.addEventListener("message", (event) => { | |||
if (typeof event.data === "object" && event.data.type === "resizeIframe") { | |||
iframe.style.height = event.data.height + "px"; | |||
} | |||
}); | }); | ||
}); | }); | ||
Revision as of 21:19, 10 November 2025
/* Any JavaScript here will be loaded for all users on every page load. */
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.infobox').forEach(box => {
box.querySelectorAll('hr').forEach(hr => {
const section = hr.previousSibling;
if (section && section.nodeType === Node.TEXT_NODE && !section.textContent.trim()) {
hr.style.display = 'none';
}
});
});
});
document.addEventListener("DOMContentLoaded", () => {
const iframe = document.querySelector('iframe[key="wikiphone"]');
if (!iframe) return;
iframe.style.width = "100%";
iframe.style.border = "none";
iframe.style.overflow = "hidden";
window.addEventListener("message", (event) => {
if (typeof event.data === "object" && event.data.type === "resizeIframe") {
iframe.style.height = event.data.height + "px";
}
});
});