MediaWiki:Vector.js

!function(e,t,n){var r=!(!t||!t.pushState),o={ANCHOR_REGEX:/^#[^ ]+$/,OFFSET_HEIGHT_PX:150,init:function{this.scrollToCurrent,$(window).on("hashchange",$.proxy(this,"scrollToCurrent")),$("body").on("click","a",$.proxy(this,"delegateAnchors"))},getFixedOffset:function{return this.OFFSET_HEIGHT_PX},scrollIfAnchor:function(o,a){var i,c;return this.ANCHOR_REGEX.test(o)?(i=e.getElementById(o.slice(1)),i&&(c=$(i).offset.top-this.getFixedOffset,$("html, body").animate({scrollTop:c},1e3),r&&a&&t.pushState({},e.title,n.pathname+o)),!!i):!1},scrollToCurrent:function(e){this.scrollIfAnchor(window.location.hash)&&e&&e.preventDefault},delegateAnchors:function(e){var t=e.target;this.scrollIfAnchor(t.getAttribute("href"),!0)&&e.preventDefault}};$(e).ready($.proxy(o,"init"))}(window.document,window.history,window.location);var addStyleSwitcherEle=function{var e=document.createElement("div");e.className="themeswitcher",e.id="darktheme";var t=document.createTextNode("theme");e.appendChild(t);var n=document.getElementById("p-personal");n.insertAdjacentElement("afterend",e)};$(document).ready(addStyleSwitcherEle),$(document).ready(Barba.Pjax.start);