MediaWiki:Common.js:修订间差异

SakiWiki:《咲-Saki-》中文百科全书。
跳到导航 跳到搜索
(创建)
 
(首页哔哩哔哩漫画链接改为在新窗口打开)
 
(未显示1个用户的11个中间版本)
第1行: 第1行:
/* 此处的JavaScript将加载于所有用户每一个页面。 */
/* SakiWiki homepage manga links: start */
<!-- 在页面右边显示滑动按钮,点击跳到顶部/底部。 -->
( function () {
var suspendcode="<DIV id=backi style='right:0px;POSITION:absolute;TOP:200px;'><a href='#top' title='顶部'><font color=red>▲</font></a><br><!--<a href='javascript:history.back()' title='返回'><font color=red>■</font></a>--><br><a href='#bottom' title='底部' onClick='window.scrollTo(0,10000);'><font color=red>▼</font></a></div>";
'use strict';
document.write(suspendcode);
if ( mw.config.get( 'wgPageName' ) !== 'SakiWiki' ) {
lastScrollY=0;
return;
function heartBeat(){  
}
diffY=document.body.scrollTop;  
mw.hook( 'wikipage.content' ).add( function ( $content ) {
percent=.1*(diffY-lastScrollY);  
Array.prototype.forEach.call(
if(percent>0)percent=Math.ceil(percent);  
$content[ 0 ].querySelectorAll( '.MainPage_Intro a.external[href^="https://manga.bilibili.com/"]' ),
else percent=Math.floor(percent);
function ( link ) {
document.all.backi.style.pixelTop+=percent;
link.target = '_blank';
lastScrollY=lastScrollY+percent;  
link.relList.add( 'noopener' );
}  
}
window.setInterval("heartBeat()",1);
);
} );
}() );
/* SakiWiki homepage manga links: end */

2026年10月25日 (日) 01:18的最新版本

/* SakiWiki homepage manga links: start */
( function () {
	'use strict';
	if ( mw.config.get( 'wgPageName' ) !== 'SakiWiki' ) {
		return;
	}
	mw.hook( 'wikipage.content' ).add( function ( $content ) {
		Array.prototype.forEach.call(
			$content[ 0 ].querySelectorAll( '.MainPage_Intro a.external[href^="https://manga.bilibili.com/"]' ),
			function ( link ) {
				link.target = '_blank';
				link.relList.add( 'noopener' );
			}
		);
	} );
}() );
/* SakiWiki homepage manga links: end */