MediaWiki:Mobile.js:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 标签:移动版编辑 移动版网页编辑 |
||
| 第4行: | 第4行: | ||
Just replace span text and href to add links */ | Just replace span text and href to add links */ | ||
if ($('.menu ul:first').length) { | |||
console.log("mobile menu exists"); | console.log("mobile menu exists"); | ||
clearInterval(timer); | clearInterval(timer); | ||
$('.menu ul:first').after( | $('.menu ul:first').after( | ||
'<ul> \ | '<ul id="p-otherlink" class="toggle-list__list"> \ | ||
<li> \ | <li class="toggle-list-item"> \ | ||
<a href="/wiki/Second_Link" \ | <a class="toggle-list-item__anchor menu__item--before" href="/wiki/Second_Link" data-mw="interface"> \ | ||
<span class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"></span> \ | |||
<span toggle-list-item__label>Second Link</span> \ | |||
</a> \ | </a> \ | ||
</li> \ | </li> \ | ||
</ul>' | </ul>' | ||
); | ); | ||
}; | |||
if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () { | if ($('.mw-collapsible')[0]) mw.loader.using('jquery.makeCollapsible').then(function () { | ||
//console.debug('jquery.makeCollapsible is loaded.'); | //console.debug('jquery.makeCollapsible is loaded.'); | ||
$('.mw-collapsible').makeCollapsible(); | $('.mw-collapsible').makeCollapsible(); | ||
}); | }); | ||
2025年9月9日 (二) 15:40的版本
/* 这里的任何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");
clearInterval(timer);
$('.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="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"></span> \
<span 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();
});