MediaWiki:Mobile.js
注意:在发布之后,您可能需要清除浏览器缓存才能看到所作出的更改的影响。
- Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5或Ctrl-R(Mac为⌘-R)
- Google Chrome:按Ctrl-Shift-R(Mac为⌘-Shift-R)
- Edge:按住Ctrl的同时单击刷新,或按Ctrl-F5。
/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
/* Add to MediaWiki:Mobile.js for custom Mobile Menu links
for MW-1.34.2 with MobileFrontend and MinervaNeue
Just replace span text and href to add links */
if ($('.menu ul:first').length) {
console.log("mobile menu exists");
$('.menu ul:first').after(
'<ul id="p-otherlink" class="toggle-list__list"> \
<li class="toggle-list-item"> \
<a class="toggle-list-item__anchor menu__item--before" href="/wiki/Second_Link" data-mw="interface"> \
<span class="minerva-icon minerva-icon--home"></span> \
<span class="toggle-list-item__label">Second Link</span> \
</a> \
</li> \
</ul>'
);
};
if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () {
//console.debug('jquery.makeCollapsible is loaded.');
$('.mw-collapsible').makeCollapsible();
});