LLWiki正在建设中,欢迎加入我们

“MediaWiki:Mobile.js”的版本间差异

来自LLWiki
跳转到导航 跳转到搜索
标签移动版网页编辑 移动版编辑
第6行: 第6行:
for MW-1.34.2 with MobileFrontend and MinervaNeue
for MW-1.34.2 with MobileFrontend and MinervaNeue
Just replace span text and href to add links */
Just replace span text and href to add links */
var menu = wgULS({recentchanges : '最近更改', sandbox : '沙盒', villagepump : '互助客栈', policy : '方针', help : '帮助'}, {recentchanges : '近期變更', sandbox : '沙盒', villagepump : '互助客棧', policy : '方針', help : '幫助'});
var menu = window.wgULS({recentchanges : '最近更改', sandbox : '沙盒', villagepump : '互助客栈', policy : '方针', help : '帮助'}, {recentchanges : '近期變更', sandbox : '沙盒', villagepump : '互助客棧', policy : '方針', help : '幫助'});
var timer = setInterval(function() {
var timer = setInterval(function() {
if($('.menu ul:first').length) {
if($('.menu ul:first').length) {

2020年8月12日 (三) 07:10的版本

/* 这里的任何JavaScript将为使用移动版网站的用户加载 */
//<nowiki>
(function($, mw) {
	$(function () {
		/* 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 menu = window.wgULS({recentchanges : '最近更改', sandbox : '沙盒', villagepump : '互助客栈', policy : '方针', help : '帮助'}, {recentchanges : '近期變更', sandbox : '沙盒', villagepump : '互助客棧', policy : '方針', help : '幫助'});
		var timer = setInterval(function() {
			if($('.menu ul:first').length) {
				console.log("mobile menu exists");
				clearInterval(timer);
				$('.menu ul:first').append('<li><a href="/zh/special:recentchanges" class="mw-ui-icon mw-ui-icon-before"><span>' + menu.recentchanges + '</span></a></li><li><a href="/zh/project:沙盒" class="mw-ui-icon mw-ui-icon-before"><span>' + menu.sandbox + '</span></a></li><li><a href="/zh/project:互助客栈" class="mw-ui-icon mw-ui-icon-before"><span>' + menu.villagepump + '</span></a></li><li><a href="/zh/project:方针" class="mw-ui-icon mw-ui-icon-before"><span>' + menu.policy + '</span></a></li><li><a href="/zh/help:帮助总览" class="mw-ui-icon mw-ui-icon-before"><span>' + menu.help + '</span></a></li>');
			}
		}, 100); // check every 100ms
		
		/* 沙盒顶部 */
		$('.page-LLWiki_沙盒 #mf-section-0').prepend('<table style="background-color:#F3F5F7;border:1px solid #D4DBE2;border-radius:5px;width:70%;border-left:10px solid #C5C5C5;margin:auto" cellpadding="4px" align="center"><tbody><tr><td width="15%"><div class="center"><img src="/mediawiki/img_auth.php/thumb/0/04/Bandeau-avertisement-3.png/50px-Bandeau-avertisement-3.png" decoding="async" srcset="/mediawiki/img_auth.php/0/04/Bandeau-avertisement-3.png 1.5x" width="50" height="50"></div></td><td style="padding-left:5px">欢迎来到沙盒!您可以在此进行编辑测试。</td></tr></tbody></table>');
		
		/* 引自zh.moegirl.org.cn/mediawiki:mobile.js */
		/* jquery.collapsible */
		if ($('.mw-collapsible').length) {
			mw.loader.using('jquery.makeCollapsible').then(function() {
	        	$('.mw-collapsible').makeCollapsible();
			});
		}
		
		/* 特殊页面 */
		$('.page-Special_用户列表 h1').html('LLWiki上的LLer');
	});
})(jQuery, mediaWiki);
//</nowiki>