User:ErrantX/hiderefs.js

// Hide Refs: Add a button to hide/show inline citations // add import("User:ErrantX/hiderefs.js"); to your vector.js to get it working // A button will appear somewhere in the top tabs

addOnloadHook(function { if (mw.config.get('wgNamespaceNumber') == 0)  {    addPortletLink ("p-views", "javascript:hide_refs;", "Hide Refs", "hide-refs", "Hide/Show the inline references");  } }); function hide_refs {   var divs = document.getElementsByClassName("reference"); for(var x = 0; x < divs.length; ++x) divs[x].style.display = "none"; document.getElementById("hide-refs").firstChild.innerHTML = " Show Refs "; } function show_refs {   var divs = document.getElementsByClassName("reference"); for(var x = 0; x < divs.length; ++x) divs[x].style.display = "inline"; document.getElementById("hide-refs").firstChild.innerHTML = " Hide Refs "; }