User:Vector2.0/common.js

var meta = document.createElement('meta'); meta.name = "viewport"; meta.content = "initial-scale=1.0, user-scalable=yes, minimum-scale=0.25, maximum-scale=5.0, width=device-width"; document.getElementsByTagName('head')[0].appendChild(meta);

var header = document.createElement('div'); header.className = 'ui-header';

var wordmark = document.createElement('div'); wordmark.className = 'siteWordmark';

var mwhead = document.getElementById('mw-head'); mwhead.appendChild(header); mwhead.appendChild(wordmark);

var hbMenu = document.createElement('input'); hbMenu.className = 'hamburgerMenu'; hbMenu.type = "checkbox"; hbMenu.name = "name"; hbMenu.value = "value"; hbMenu.id = "hamburgerMenu";

header.appendChild(hbMenu); var sideDrawer = document.getElementById('mw-panel');

hbMenu.onchange = function { sideDrawer.style.display = this.checked ? 'block' : 'none'; };

var userMenu = document.createElement('input'); userMenu.className = 'userMenu'; userMenu.type = "checkbox"; userMenu.name = "name"; userMenu.value = "value"; userMenu.id = "userMenu";

header.appendChild(userMenu); var userDrawer = document.getElementById('p-personal');

userMenu.onchange = function { userDrawer.style.display = this.checked ? 'block' : 'none'; };

$(window).on('scroll', function {        var top = $(window).scrollTop,            divBottom = $('p-search').offset.top + $('p-search').outerHeight;        if (divBottom > top) {            $('p-search').removeClass('outOfView');        } else {            $('p-search').addClass('outOfView');        }    });