MediaWiki:Vector.js

MediaWiki interface page
Revision as of 15:38, 18 September 2016 by Alistair3149 (talk | contribs) (smoothstate.js)

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
!function(e,t,n){var o=!(!t||!t.pushState),a={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(a,r){var d,i;return this.ANCHOR_REGEX.test(a)?(d=e.getElementById(a.slice(1)),d&&(i=$(d).offset().top-this.getFixedOffset(),$("html, body").animate({scrollTop:i},1e3),o&&r&&t.pushState({},e.title,n.pathname+a)),!!d):!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(a,"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);var addSmoothStateEle=function(){var e=document.createElement("div");e.id="main";var t=document.getElementById("mw-page-base");t.insertAdjacentElement("afterend",e);var n=document.getElementById("content"),o=document.getElementById("mw-navigation"),a=document.getElementById("footer");e.appendChild(n),e.appendChild(o),e.appendChild(a)};$(document).ready(addSmoothStateEle),$(function(){$("#content").smoothState()});
🍪 We use cookies to keep session information to provide you a better experience.