summaryrefslogtreecommitdiffstats
path: root/skins/common/enhancedchanges.js
blob: b1789c9e06e5d1cb39183eb2ebc05298053d0ff7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* 
  JavaScript file for enhanced recentchanges
 */
 
/*
  * Add the CSS to hide parts that should be collapsed
  *
  * We do this with JS so everything will be expanded by default
  * if JS is disabled
 */
appendCSS('.mw-changeslist-hidden {'+
	'	display:none;'+
	'}'+
	'div.mw-changeslist-expanded {'+
	'	display:block;'+
	'}'+
	'span.mw-changeslist-expanded {'+
	'	display:inline !important;'+
	'	visibility:visible !important;'+
	'}'
);

/*
 * Switch an RC line between hidden/shown
 * @param int idNumber : the id number of the RC group
*/ 
function toggleVisibility(idNumber) {
	var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber);
	var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber);
	var subentries = document.getElementById("mw-rc-subentries-"+idNumber);
	if (openarrow.className == 'mw-changeslist-expanded') {
		openarrow.className = 'mw-changeslist-hidden';
		closearrow.className = 'mw-changeslist-expanded';
		subentries.className = 'mw-changeslist-expanded';
	} else {
		openarrow.className = 'mw-changeslist-expanded';
		closearrow.className = 'mw-changeslist-hidden';
		subentries.className = 'mw-changeslist-hidden';
	}
}