「MediaWiki:Common.js」の版間の差分
MediaWikiインターフェイスページ
その他の操作
編集の要約なし |
編集の要約なし |
||
| 1行目: | 1行目: | ||
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */ | /* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */ | ||
const | const targetNode = document.getElementById('contentSub'); | ||
const config = { childList: true, subtree: true }; | |||
if ( | const callback = function(mutationsList, observer) { | ||
for (const mutation of mutationsList) { | |||
if (mutation.type === 'childList') { | |||
const subtitleElement = document.getElementById('mw-content-subtitle'); | |||
if (subtitleElement) { | |||
subtitleElement.textContent = ''; | |||
observer.disconnect(); | |||
return; | |||
} | |||
} | |||
} | |||
}; | |||
const observer = new MutationObserver(callback); | |||
if (targetNode) { | |||
observer.observe(targetNode, config); | |||
} | } | ||
console.log("OK Common.js") | |||
console.log(" | |||
2025年8月8日 (金) 10:08時点における版
/* ここにあるすべてのJavaScriptは、すべてのページ読み込みですべての利用者に対して読み込まれます */
const targetNode = document.getElementById('contentSub');
const config = { childList: true, subtree: true };
const callback = function(mutationsList, observer) {
for (const mutation of mutationsList) {
if (mutation.type === 'childList') {
const subtitleElement = document.getElementById('mw-content-subtitle');
if (subtitleElement) {
subtitleElement.textContent = '';
observer.disconnect();
return;
}
}
}
};
const observer = new MutationObserver(callback);
if (targetNode) {
observer.observe(targetNode, config);
}
console.log("OK Common.js")