User:GalacticSheriff/common.js

$(document).ready(function{ var toggle_reader = document.createElement("li"); toggle_reader.className = "mw-list-element"; toggle_reader.id = "pt-readertoggle"; toggle_reader.innerText = "Reader Mode Off"; var refs = document.getElementsByTagName("sup"); var menu_bar = document.getElementsByClassName("vector-menu-content-list")[0]; menu_bar.insertBefore(toggle_reader, menu_bar.childNodes[0]); $("#pt-readertoggle").css('cursor','pointer'); $("#pt-readertoggle").hover(function { $(this).css("text-decoration", "underline"); },function{ $(this).css("text-decoration", "none"); } );

$("#pt-readertoggle").click(function{	if(	$("#pt-readertoggle").text == "Reader Mode Off"){		$("#pt-readertoggle").text("Reader Mode On");		for (var x=0; x<refs.length;x++) {           refs[x].style.display="none";        }	}	else{		$("#pt-readertoggle").text("Reader Mode Off");		for (var i=0; i<refs.length;i++) {            refs[i].style.display="inline";        }	} }); })