User:Al-Andalusi/enhancedchanges.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | Documentation for this user script can be added at User:Al-Andalusi/enhancedchanges. |
/*
JavaScript file for enhanced recentchanges
Copied from: http://meta.wikimedia.org/skins-1.5/common/enhancedchanges.js
*/
/*
* 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';
}
}