「MediaWiki:Mobile.js」の版間の差分
編集の要約なし |
編集の要約なし |
||
10行目: | 10行目: | ||
clearInterval(timer); | clearInterval(timer); | ||
$('.menu ul:first').after( | $('.menu ul:first').after( | ||
'<ul class="level1"> | '<ul class="level1"> | ||
<li> | |||
<a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>ETS2 Dropdown Menu</span></a> | |||
</li> | |||
<ul class ="level2"> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2の概要</span></a></li> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2の基本</span></a></li> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2のデータ</span></a></li> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2のマップ</span></a></li> | |||
</ul> | |||
</ul> | </ul> | ||
<ul class="level1"> | |||
<li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>MediaWiki Dropdown Menu</span></a></li> | <li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>MediaWiki Dropdown Menu</span></a></li> | ||
<ul class ="level2"> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>MediaWikiについての備忘録</span></a></li> | |||
</ul> | |||
</ul> | </ul> | ||
<ul class="level1"> | |||
<li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>Translate Dropdown Menu</span></a></li> | |||
<ul class ="level2"> | |||
<li id="ca-google-translate" class="vector-more-collapsible-item mw-list-item"><a href="#" class="mw-ui-icon mw-ui-icon-before"><span>Google Translate</span></a></li> | |||
</ul> | |||
</ul>' | |||
/* | |||
<ul> | |||
<li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>MediaWikiについての備忘録</span></a></li> | |||
<li id="ca-google-translate"><a href="#"><span>Translate</span></a></li> | |||
</ul>' | </ul>' | ||
*/ | */ | ||
); | ); |
2023年11月11日 (土) 13:45時点における版
/* ここにある全ての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 */ var timer = setInterval(function() { if ($('.menu ul:first').length) { console.log("mobile menu exists"); clearInterval(timer); $('.menu ul:first').after( '<ul class="level1"> <li> <a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>ETS2 Dropdown Menu</span></a> </li> <ul class ="level2"> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2の概要</span></a></li> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2の基本</span></a></li> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2のデータ</span></a></li> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>ETS2のマップ</span></a></li> </ul> </ul> <ul class="level1"> <li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>MediaWiki Dropdown Menu</span></a></li> <ul class ="level2"> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before"><span>MediaWikiについての備忘録</span></a></li> </ul> </ul> <ul class="level1"> <li><a href="#" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>Translate Dropdown Menu</span></a></li> <ul class ="level2"> <li id="ca-google-translate" class="vector-more-collapsible-item mw-list-item"><a href="#" class="mw-ui-icon mw-ui-icon-before"><span>Google Translate</span></a></li> </ul> </ul>' /* <ul> <li><a href="https://gamefanweb.com/ets2/index.php" class="mw-ui-icon mw-ui-icon-before mw-ui-icon-minerva-watchlist"><span>MediaWikiについての備忘録</span></a></li> <li id="ca-google-translate"><a href="#"><span>Translate</span></a></li> </ul>' */ ); $(".menu").find(".level2").hide(); // hide level2 until level1 is clicked $(".level1").click(function(event){ $(this).find(".level2").slideToggle(500); }); // if level1 is clicked, dropdown level2 } }, 100); // check every 100ms console.log();