MediaWiki:ExpandAndCollapse.js:修订间差异

来自PD2汉化wiki
跳转到导航 跳转到搜索
Weili0677留言 | 贡献
创建页面,内容为“Yoinked from https://www.whonix.org/wiki/MediaWiki:ExpandAndCollapse.js:​ (function() { let allExpanded = false; // Setup $('.expand-or-collapse-all-button').on('click', function() { $('.mw-collapsible-text').each( function() { if( allExpanded && $(this).parent().hasClass('mw-collapsible-toggle-expanded') || ! allExpanded && $(this).parent().hasClass('mw-collapsible-toggle-collapsed') || ( allExpanded && ! $(this).parent().…”
 
Weili0677留言 | 贡献
无编辑摘要
 
(未显示同一用户的1个中间版本)
第20行: 第20行:
allExpanded = ! allExpanded;
allExpanded = ! allExpanded;
});
});
    //LA.init({id:"3Iq1VwOsODsXILsN",ck:"3Iq1VwOsODsXILsN"});  //LA统计
})();
})();

2025年9月17日 (三) 15:34的最新版本

/* Yoinked from https://www.whonix.org/wiki/MediaWiki:ExpandAndCollapse.js */

(function() {
	
	let allExpanded = false;

	// Setup
	
	$('.expand-or-collapse-all-button').on('click', function() {
		$('.mw-collapsible-text').each( function() {
			if( allExpanded && $(this).parent().hasClass('mw-collapsible-toggle-expanded')
				|| ! allExpanded && $(this).parent().hasClass('mw-collapsible-toggle-collapsed')
                || ( allExpanded && ! $(this).parent().hasClass('mw-collapsible-toggle-expanded')
                && ! $(this).parent().hasClass('mw-collapsible-toggle-collapsed')) ) {
				$(this)[0].click();
			}
		});
		
		$(this).toggleClass('all-expanded');
		allExpanded = ! allExpanded;
	});

    //LA.init({id:"3Iq1VwOsODsXILsN",ck:"3Iq1VwOsODsXILsN"});  //LA统计
	
})();