JavaScript腳本:
window.addEventListener('load', function () {
var ele = document.querySelector('.start-screen'),
parent = document.querySelector('#mw-content-text > .mw-parser-output');
ele.querySelectorAll('a[href]').forEach(function(e) {
var href = decodeURIComponent(e.href),
section = /#/.test(href),
pagename = section ? href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)#')[1] : href.match('^(?:https:)?(?:\/\/llwiki\.org)?/zh/(.*)$')[1];
if(pagename == mw.config.get('wgPageName')) {
e.href = section ? href.match(/#.*$/)[0] : 'javascript:void(0)';
}
});
if(mw.config.get('skin') == 'minerva') {
parent.appendChild(ele);
ele.scrollTo(ele.scrollLeftMax / 2, 0);
}
});
//
CSS樣式表:
*/
.start-screen {
text-align: center;
position: sticky;
bottom: 3px;
white-space: nowrap;
overflow-x: auto;
}
.start-screen table {
display: inline-table;
}
/*