enhancedchanges.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. JavaScript file for enhanced recentchanges
  3. */
  4. /*
  5. * Add the CSS to hide parts that should be collapsed
  6. *
  7. * We do this with JS so everything will be expanded by default
  8. * if JS is disabled
  9. */
  10. appendCSS('.mw-changeslist-hidden {'+
  11. ' display:none;'+
  12. '}'+
  13. 'div.mw-changeslist-expanded {'+
  14. ' display:block;'+
  15. '}'+
  16. 'span.mw-changeslist-expanded {'+
  17. ' display:inline !important;'+
  18. ' visibility:visible !important;'+
  19. '}'
  20. );
  21. /*
  22. * Switch an RC line between hidden/shown
  23. * @param int idNumber : the id number of the RC group
  24. */
  25. function toggleVisibility(idNumber) {
  26. var openarrow = document.getElementById("mw-rc-openarrow-"+idNumber);
  27. var closearrow = document.getElementById("mw-rc-closearrow-"+idNumber);
  28. var subentries = document.getElementById("mw-rc-subentries-"+idNumber);
  29. if (openarrow.className == 'mw-changeslist-expanded') {
  30. openarrow.className = 'mw-changeslist-hidden';
  31. closearrow.className = 'mw-changeslist-expanded';
  32. subentries.className = 'mw-changeslist-expanded';
  33. } else {
  34. openarrow.className = 'mw-changeslist-expanded';
  35. closearrow.className = 'mw-changeslist-hidden';
  36. subentries.className = 'mw-changeslist-hidden';
  37. }
  38. }