MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */

/* Display / wanted pages without real redlinks */ $( window ).load(function { var sp = document.getElementById( 'tm-Wanted' ).innerHTML.split("\t");  var dropdown = document.getElementById('tm-wantedpages');  var mainpage = document.getElementById('tm-toplevelpage').innerHTML + '/';  sp.forEach( function(subpage) { var sp_us = subpage.replace(" ", "_"); var li = document.createElement('li'); li.innerHTML = ' '+subpage+""; dropdown.appendChild(li); }); });

/* Section Hide folder functionality */

function toggleSection(toggleObj, id, showtext, hidetext) { var e = document.getElementById('sectionblock'+id); if(toggleObj.innerHTML == showtext) { toggleObj.innerHTML = hidetext; e.style.display = 'block'; } else { toggleObj.innerHTML = showtext; e.style.display = 'none'; }

}

function toggleAllSections(toggleObj, showtext, hidetext, showall, hideall) { if (toggleObj.innerHTML == hideall) { $( ".hidelink" ).each( function (i, val) {     if (val.innerHTML == hidetext) {        val.onclick;      }    }); toggleObj.innerHTML = showall; } else { $( ".hidelink" ).each( function (i, val) {     if (val.innerHTML == showtext) {        val.onclick;      }    }); toggleObj.innerHTML = hideall; } }