MediaWiki:Common.js:修订间差异
MediaWiki界面页面
更多操作
无编辑摘要 |
无编辑摘要 |
||
| (未显示2个用户的8个中间版本) | |||
| 第1行: | 第1行: | ||
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */ | |||
// 自动加载 MediaWiki:Footer 页面内容,并插入到每个页面底部 | |||
$(document).ready(function() { | |||
const namespace = mw.config.get('wgNamespaceNumber'); | |||
const action = mw.config.get('wgAction'); | |||
if (namespace !== 0 || action !== 'view') { | |||
return; | return; | ||
} | } | ||
fetch("/api.php?action=parse&page=MediaWiki:Footer&format=json") | |||
.then(res => res.json()) | |||
.then(data => { | |||
if (data.parse && data.parse.text) { | |||
const html = data.parse.text['*']; | |||
$('#mw-content-text').append('<div class="global-footer">' + html + '</div>'); | |||
} | |||
}); | |||
}); | }); | ||
2026年3月27日 (五) 11:25的最新版本
/* 这里的任何JavaScript将为所有用户在每次页面加载时加载。 */
// 自动加载 MediaWiki:Footer 页面内容,并插入到每个页面底部
$(document).ready(function() {
const namespace = mw.config.get('wgNamespaceNumber');
const action = mw.config.get('wgAction');
if (namespace !== 0 || action !== 'view') {
return;
}
fetch("/api.php?action=parse&page=MediaWiki:Footer&format=json")
.then(res => res.json())
.then(data => {
if (data.parse && data.parse.text) {
const html = data.parse.text['*'];
$('#mw-content-text').append('<div class="global-footer">' + html + '</div>');
}
});
});