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

MediaWiki:Minerva.js

来自LLWiki
跳转到导航 跳转到搜索

注意:在保存之后,您可能需要清除浏览器缓存才能看到所作出的变更的影响。

  • Firefox或Safari:按住Shift的同时单击刷新,或按Ctrl-F5Ctrl-R(Mac为⌘-R
  • Google Chrome:Ctrl-Shift-R(Mac为⌘-Shift-R
  • Internet Explorer:按住Ctrl的同时单击刷新,或按Ctrl-F5
  • Opera:前往菜单 → 设置(Mac为Opera → Preferences),然后隐私和安全 → 清除浏览数据 → 缓存的图片和文件
/* 这里的任何JavaScript将为使用MinervaNeue皮肤的用户加载 */
"use strict";

// Force collapsible and sortable
mw.hook( 'wikipage.content' ).add( function ( $content ) {
	var modules = [];

	var $collapsible = $content.find( '.mw-collapsible' );
	if ( $collapsible.length ) {
		modules.push( 'jquery.makeCollapsible' );
	}

	var $sortable = $content.find( 'table.sortable' );
	if ( $sortable.length ) {
		modules.push( 'jquery.tablesorter' );
	}

	if ( modules.length ) {
		// Both modules are preloaded by Skin::getDefaultModules()
		mw.loader.using( modules ).then( function () {
			// For tables that are both sortable and collapsible,
			// it must be made sortable first and collapsible second.
			// This is because jquery.tablesorter stumbles on the
			// elements inserted by jquery.makeCollapsible (T64878)
			if ( $sortable && $sortable.length ) {
				$sortable.tablesorter();
			}
			if ( $collapsible && $collapsible.length ) {
				$collapsible.makeCollapsible();
			}
		} );
	}
} );