No edit summary |
fix link |
||
(7 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
/* Add to MediaWiki:Mobile.js for custom Mobile Menu links | /* Add to MediaWiki:Mobile.js for custom Mobile Menu links | ||
Line 14: | Line 18: | ||
clearInterval(timer); | clearInterval(timer); | ||
$('.menu ul:first').after( | $('.menu ul:first').after( | ||
'<ul class="toggli-list__list"><li class="toggle-list-item"><a class="toggle-list-item__anchor" href="/index.php?title=Special:Upload"><span class="toggle-list-item__label">Upload file</a></span></li></ul>'); | '<ul class="toggli-list__list"><li class="toggle-list-item"><a class="toggle-list-item__anchor" href="/index.php?title=Special:Upload"><span class="toggle-list-item__label"><img src="/resources/assets/upload_icon.png" height="20px"/> Upload file</a></span></li></ul>'); | ||
} | } | ||
}, 100); // check every 100ms | }, 100); // check every 100ms | ||
var timer2 = setInterval(function() { | |||
if ($('#p-tb').length) { | |||
var currentPage = mw.config.get('wgPageName'); | |||
console.log("More list exists"); | |||
clearInterval(timer2); | |||
$('#p-tb li:last').after( | |||
'<li class="toggle-list-item"><a href="/index.php/Special:PageOwnershipPermissions/' + currentPage + '" class="toggle-list-item__anchor"><span class="toggle-list-item__label">Permissions</span></a></li>'); | |||
} | |||
}, 100); |
Latest revision as of 16:29, 23 October 2024
/* Any JavaScript here will be loaded for all users on every page load. */ /* 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 Hack from: https://www.mediawiki.org/wiki/Topic:Vqy1kx6q4e0bzvyb */ var timer = setInterval(function() { if ($('.menu ul:first').length) { console.log("mobile menu exists"); clearInterval(timer); $('.menu ul:first').after( '<ul class="toggli-list__list"><li class="toggle-list-item"><a class="toggle-list-item__anchor" href="/index.php?title=Special:Upload"><span class="toggle-list-item__label"><img src="/resources/assets/upload_icon.png" height="20px"/> Upload file</a></span></li></ul>'); } }, 100); // check every 100ms var timer2 = setInterval(function() { if ($('#p-tb').length) { var currentPage = mw.config.get('wgPageName'); console.log("More list exists"); clearInterval(timer2); $('#p-tb li:last').after( '<li class="toggle-list-item"><a href="/index.php/Special:PageOwnershipPermissions/' + currentPage + '" class="toggle-list-item__anchor"><span class="toggle-list-item__label">Permissions</span></a></li>'); } }, 100);