User:Equazcion/ToggleEditNotices.js

if ((mw.config.get('wgAction') == "edit") || (mw.config.get('wgAction') == "submit")){ // If option is not set, display edit notices by default if (typeof HideEditNotices == 'undefined'){ var HideEditNotices = false; }	// Add toggle link and set initial state if (HideEditNotices == true){ $('.editnotice-area').attr('hidden',''); $('#firstHeading span:first').after(' Show Edit Notice'); } else { $('#firstHeading span:first').after(' Hide Edit Notice'); }

// Set link function $('.enTog').click(function{		if ($('.editnotice-area').attr('hidden') == "hidden"){			$('.editnotice-area').prop('hidden', false);			$('.enTog').html('Hide Edit Notice');		} else {			$('.editnotice-area').attr('hidden','');			$('.enTog').html('Show Edit Notice');		}	}); }