MediaWiki:Vector.js

!function(t,e,n){var o=!(!e||!e.pushState),r={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(r,i){var a,c;return this.ANCHOR_REGEX.test(r)?(a=t.getElementById(r.slice(1)),a&&(c=$(a).offset.top-this.getFixedOffset,$("html, body").animate({scrollTop:c},1e3),o&&i&&e.pushState({},t.title,n.pathname+r)),!!a):!1},scrollToCurrent:function(t){this.scrollIfAnchor(window.location.hash)&&t&&t.preventDefault},delegateAnchors:function(t){var e=t.target;this.scrollIfAnchor(e.getAttribute("href"),!0)&&t.preventDefault}};$(t).ready($.proxy(r,"init"))}(window.document,window.history,window.location);var addStyleSwitcherEle=function{var t=document.createElement("div");t.className="themeswitcher",t.id="darktheme";var e=document.createTextNode("theme");t.appendChild(e);var n=document.getElementById("p-personal");n.insertAdjacentElement("afterend",t)};$(document).ready(addStyleSwitcherEle)