MediaWiki:Common.js:修订间差异
HW(留言 | 贡献) (创建页面,内容为“→这里的任何JavaScript将为所有用户在每次页面加载时加载。: // 等待页面内容加载完成 mw.hook('wikipage.content').add(function() { // 仅在 Minerva 皮肤下生效 if (mw.config.get('skin') !== 'minerva') return; // 1. 获取当前页面信息 const pageTitle = mw.config.get('wgPageName'); const isTalkPage = mw.config.get('wgNamespaceNumber') % 2 === 1; // 判断是否为讨论页 const isExistingPage = m…”) |
|||
| 第20行: | 第20行: | ||
bottomBar.id = 'custom-wiki-bottom-bar'; | bottomBar.id = 'custom-wiki-bottom-bar'; | ||
bottomBar.style.cssText = ` | bottomBar.style.cssText = ` | ||
`; | `; | ||
| 第68行: | 第63行: | ||
}); | }); | ||
// 6. 将按钮栏插入到 main#content 内部的最底部 | |||
const | const content = document.querySelector('main#content, #content'); | ||
if ( | if (content) { | ||
bottomBar.style.marginTop = '2.5rem'; | |||
content.appendChild(bottomBar); | content.appendChild(bottomBar); | ||
} | } | ||
}); | }); | ||