MediaWiki:Common.js: Difference between revisions
No edit summary |
No edit summary |
||
| Line 24: | Line 24: | ||
$('.language-button.jp').on('click', function() { | $('.language-button.jp').on('click', function() { | ||
$(this).toggleClass('highlight'); | $(this).toggleClass('highlight'); | ||
$('.jp').show(); | $('.jp-content').show(); | ||
$('.en').hide(); | $('.en-content').hide(); | ||
}); | }); | ||
}); | }); | ||
| Line 33: | Line 33: | ||
$('.language-button.en').on('click', function() { | $('.language-button.en').on('click', function() { | ||
$(this).toggleClass('highlight'); | $(this).toggleClass('highlight'); | ||
$('.en').show(); | $('.en-content').show(); | ||
$('.jp').hide(); | $('.jp-content').hide(); | ||
}); | }); | ||
}); | }); | ||
Revision as of 15:32, 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 */
/* Kanji Toggle */
$(document).ready(function () {
$('.language-button.jp').on('click', function() {
$(this).toggleClass('highlight');
$('.jp-content').show();
$('.en-content').hide();
});
});
/* English Toggle */
$(document).ready(function () {
$('.language-button.en').on('click', function() {
$(this).toggleClass('highlight');
$('.en-content').show();
$('.jp-content').hide();
});
});
/* Implement edition buttons */
$(document).ready(function () {
$('.edition-button').on('click', function() {
$(this).toggleClass('highlight');
$('.edition-target').toggle();
});
});