User:Mrblahblah200/HideLanguages.js

importStylesheet('User:Mrblahblah200/HideLanguages.css');

function hideLanguages(instant) { // Set cookie to remember user option mw.cookie.set('langhide', '1'); // Add CSS property var plang = $('#p-lang'); plang.addClass('langhidden'); // Get languages to slide up	var body = plang.find('.body:not(.fakebody)'); if (instant) { body.slideUp(0); } else { body.slideUp('fast'); }	// Change text on link var toggle = plang.find('.langtoggle'); var toggleLink = toggle.find('.togglelink'); toggleLink.text('show'); // Reset onclick functions toggleLink.off('click'); toggleLink.on('click', showLanguages); }

function showLanguages { // Unset cookie to remember user option mw.cookie.set('langhide', null); // Remove CSS property var plang = $('#p-lang'); plang.removeClass('langhidden'); // Get languages to slide down var body = plang.find('.body:not(.fakebody)'); body.slideDown('fast'); // Change text on link var toggle = plang.find('.langtoggle'); var toggleLink = toggle.find('.togglelink'); toggleLink.text('hide'); // Reset onclick functions toggleLink.off('click'); toggleLink.on('click', hideLanguages.bind(this, false)); }

var toggleHTML = ' [***] '; var toggleButton = $(toggleHTML); $('#p-lang-label').append(toggleButton); $('#p-lang').append($(' '));

// Figure out user options if (mw.cookie.get('langhide')) { hideLanguages(true); } else { showLanguages; }