Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
}); | }); | ||
} | } | ||
+ | |||
+ | tools = document.getElementById('p-tb').children[1].children[0]; | ||
+ | |||
+ | sideLinks = [ | ||
+ | {'name':'Templates', | ||
+ | 'url' :'Category:Templates'} | ||
+ | ] | ||
+ | |||
+ | sideLinks.forEach(function(link){ | ||
+ | var li = document.createElement('li'); | ||
+ | tools.appendChild(li); | ||
+ | var a = document.createElement('a'); | ||
+ | li.appendChild(a); | ||
+ | a.innerText = link.name; | ||
+ | a.href = 'https://dwaia.site/wiki/' + link.url; | ||
+ | }) |
Revision as of 22:47, 14 April 2019
overlay = document.getElementById('overlay'); confirmButtons = Array.from(document.getElementsByClassName('button-confirm')); cancelButtons = Array.from(document.getElementsByClassName('button-cancel')); goBack = function(){ history.back() }; if(overlay != null){ hideOverlay = function(){ overlay.style.visibility = 'hidden' }; cancelButtons.forEach(function(butt){ butt.addEventListener('click', goBack); }); confirmButtons.forEach(function(butt){ butt.addEventListener('click', hideOverlay ); }); } tools = document.getElementById('p-tb').children[1].children[0]; sideLinks = [ {'name':'Templates', 'url' :'Category:Templates'} ] sideLinks.forEach(function(link){ var li = document.createElement('li'); tools.appendChild(li); var a = document.createElement('a'); li.appendChild(a); a.innerText = link.name; a.href = 'https://dwaia.site/wiki/' + link.url; })