User:Qwerfjkl/scripts/toggleCollapse.js

mw.loader.using( 'mediawiki.util', function {

// Wait for the page to be parsed $( document ).ready( function {

//see below "Portlets" subsection var link = mw.util.addPortletLink( 'p-tb', '#', 'Toggle collapse', 't-togglecollapse', 'Toggle all [hide]/[show] boxes on the page.'); $( link ).click( function ( event ) {           event.preventDefault;            $('a[class~=mw-collapsible-text]').click; // links with collapsible class        } ); } ); } );