MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 3: | Line 3: | ||
/* Add the hamburger menu button */ | /* Add the hamburger menu button */ | ||
$(function () { | $(function () { | ||
var hamburgerContainer = document.getElementById('p-namespaces'); | var hamburgerContainer = document.getElementById('p-namespaces'); | ||
var hamburger = document.getElementById('p-namespaces-label'); | var hamburger = document.getElementById('p-namespaces-label'); | ||
Revision as of 03:33, 19 July 2020
/* Any JavaScript here will be loaded for all users on every page load. */
/* Add the hamburger menu button */
$(function () {
var hamburgerContainer = document.getElementById('p-namespaces');
var hamburger = document.getElementById('p-namespaces-label');
hamburger.innerHTML = "<i class='fa fa-bars'></i>";
hamburgerContainer.setAttribute("onclick","toggleMenu();");
hamburger.style.display = "initial";
}());
/* Implement hamburger menu */
$(document).ready(function () {
$('#p-namespaces-label').on('click', function() {
$(this).toggleClass('highlight');
$('#mw-panel').toggle();
});
});
/* Implement language buttons */
$(document).ready(function () {
$('.language-button').on('click', function() {
$(this).toggleClass('highlight');
$('.language-target').toggle();
});
});
/* Implement edition buttons */
$(document).ready(function () {
$('.edition-button').on('click', function() {
$(this).toggleClass('highlight');
$('.edition-target').toggle();
});
});