User:WikiMacaroons/moblink.js

var moblink = $(mw.util.addPortletLink('p-personal','#',"Mobile View",'Switch to Mobile View','Switch to Mobile View','','#pt-mytalk')); $( moblink ).click( function {	var url = window.location.href;	var mobv = url.replace("en.wikipedia", "en.m.wikipedia");	window.location.href = mobv; });