User:SayuriDarling/global.js

importArticles({ type: 'script', articles: [   'u:dev:MediaWiki:ChatHacks.js' ]});

importScriptPage('ChatTimestamps/code.js','dev');

require(['wikia.window', 'mw'], function(context, mw) {   var globalNav = document.getElementById('globalNavigation');    Array.prototype.slice.call(globalNav.getElementsByClassName('wds-global-navigation__dropdown-toggle')).forEach(function(elem){ elem.addEventListener('mouseenter', elem.click); elem.parentNode.addEventListener('mouseleave', elem.click.bind(elem)); });   globalNav.querySelector('.wds-avatar').addEventListener('click', function  { context.location = (new mw.Title(mw.user.name, 2)).getUrl; }); });