User:Valcio/vector.js

if(mw.config.get('wgNamespaceNumber')===0 && mw.config.get("wgAction")=="view"){ var eye=' '; var eyec=' <img id="eyec" alt="OOjs UI icon eyeClosed.svg" onclick="ChangeMode" src="//upload.wikimedia.org/wikipedia/commons/thumb/7/79/OOjs_UI_icon_eyeClosed.svg/20px-OOjs_UI_icon_eyeClosed.svg.png" decoding="async" width="20" height="20" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/7/79/OOjs_UI_icon_eyeClosed.svg/30px-OOjs_UI_icon_eyeClosed.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/7/79/OOjs_UI_icon_eyeClosed.svg/40px-OOjs_UI_icon_eyeClosed.svg.png 2x" data-file-width="20" data-file-height="20">'; var refo=' <img id="refo" alt="OOjs UI icon reference.svg" onclick="HideReferences(0)" src="//upload.wikimedia.org/wikipedia/commons/thumb/9/9c/OOjs_UI_icon_reference.svg/20px-OOjs_UI_icon_reference.svg.png" decoding="async" width="20" height="20" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/9/9c/OOjs_UI_icon_reference.svg/30px-OOjs_UI_icon_reference.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/9/9c/OOjs_UI_icon_reference.svg/40px-OOjs_UI_icon_reference.svg.png 2x" data-file-width="20" data-file-height="20">'; var refc=' <img id="refc" alt="OOjs UI icon Existing-ltr.svg" onclick="HideReferences(0)" src="//upload.wikimedia.org/wikipedia/commons/thumb/f/f1/OOjs_UI_icon_referenceExisting-ltr.svg/20px-OOjs_UI_icon_referenceExisting-ltr.svg.png" decoding="async" width="20" height="20" srcset="//upload.wikimedia.org/wikipedia/commons/thumb/f/f1/OOjs_UI_icon_referenceExisting-ltr.svg/30px-OOjs_UI_icon_referenceExisting-ltr.svg.png 1.5x, //upload.wikimedia.org/wikipedia/commons/thumb/f/f1/OOjs_UI_icon_referenceExisting-ltr.svg/40px-OOjs_UI_icon_referenceExisting-ltr.svg.png 2x" data-file-width="20" data-file-height="20">'; document.getElementById("firstHeading").innerHTML=" "+document.getElementById("firstHeading").innerHTML+' '+eye+refo+" "; var ordoc=document.innerHTML; var currenteye=eye; var currentref=refo; var currentrefnum=2; var ChangeMode=function{ if(document.getElementById("eyeo")){ currenteye=eyec; document.getElementById("firstHeading").innerHTML=document.getElementById("firstHeading").textContent+eyec+currentref; document.getElementById("firstHeading").style.position="sticky"; document.getElementById("firstHeading").style.right="10em"; document.getElementById("firstHeading").style.top="0"; document.getElementById("firstHeading").style.background="white"; document.getElementById("firstHeading").style.zIndex="10000"; document.getElementById("content").style.marginRight="10em"; document.getElementById("firstHeading").style.width=document.getElementById("content").style.width; document.getElementById("mw-panel").style.display="none"; document.getElementById("mw-head").style.display="none"; document.getElementById("mw-page-base").style.display="none"; document.getElementById("mw-head-base").style.display="none"; document.getElementById("catlinks").style.display="none"; document.getElementById("footer").style.display="none"; document.getElementById("siteNotice").style.display="none"; document.getElementsByClassName("WDI-box")[0].style.display="none"; for(var i=0;i<document.getElementsByClassName("avviso").length;i++) document.getElementsByClassName("avviso")[i].style.display="none"; HideReferences(currentrefnum); }else{ currenteye=eye; document.getElementById("firstHeading").innerHTML=document.getElementById("firstHeading").textContent+eye+currentref; document.getElementById("firstHeading").style.removeProperty("position"); document.getElementById("firstHeading").style.removeProperty("right"); document.getElementById("firstHeading").style.removeProperty("top"); document.getElementById("firstHeading").style.removeProperty("background"); document.getElementById("firstHeading").style.removeProperty("z-index"); document.getElementById("content").style.marginRight="0em"; document.getElementById("firstHeading").style.removeProperty("width"); document.getElementById("mw-panel").style.removeProperty("display"); document.getElementById("mw-head").style.display="inline"; document.getElementById("mw-page-base").style.display="inline"; document.getElementById("mw-head-base").style.display="inline"; document.getElementById("catlinks").style.display="inline"; document.getElementById("footer").style.display="inline"; document.getElementById("siteNotice").style.display="inline"; document.getElementsByClassName("WDI-box")[0].style.display="inline"; for(var i=0;i<document.getElementsByClassName("avviso").length;i++) document.getElementsByClassName("avviso")[i].style.display="block"; HideReferences(currentrefnum); } }; var HideReferences=function(a){ if(document.getElementById("refo")&&a!=2||a==1){ currentref=refc; currentrefnum=1; document.getElementById("firstHeading").innerHTML=document.getElementById("firstHeading").textContent+currenteye+refc; for(var i=0;i<document.getElementsByClassName("reference").length;i++){ document.getElementsByClassName("reference")[i].style.display="none"; }	}else if(a==0||a==2){ currentref=refo; currentrefnum=2; document.getElementById("firstHeading").innerHTML=document.getElementById("firstHeading").textContent+currenteye+refo; for(var i=0; i<document.getElementsByClassName("reference").length; i++){ document.getElementsByClassName("reference")[i].style.display="inline"; }	} }; }