No edit summary |
No edit summary |
||
Line 34: | Line 34: | ||
(function () { | (function () { | ||
$(". | $(".spoilerContainer").click(addClass); | ||
function addClass(){ | function addClass(){ | ||
var element = $(this).find(" | var element = $(this).find(".spoilerContent"); | ||
if ($(element).hasClass("spoilerBlock")) { | if ($(element).hasClass("spoilerBlock")) { | ||
$(element).removeClass("spoilerBlock"); | $(element).removeClass("spoilerBlock"); |
Revision as of 06:36, 9 May 2020
/* Any JavaScript here will be loaded for all users on every page load. */
//2kki map frame
mw.hook('wikipage.content').add(function($content) {
$content.find('.kkiDiv:not(.loaded)').each(function() {
var $this = $(this);
$this.html(
$('<iframe>', {
border: 0,
frameborder: 0,
scrolling: 'no',
class: 'kkiFrame',
src: 'https://yume-2kki-explorer.herokuapp.com/',
})
).addClass('loaded');
});
});
(function () {
$(".spoiler").click(changeClass);
function changeClass(){
if ($(this).hasClass("spoiler")) {
$(this).removeClass("spoiler");
$(this).addClass("spoilerClicked");
}
else {
$(this).removeClass("spoilerClicked");
$(this).addClass("spoiler");
}
}
}());
(function () {
$(".spoilerContainer").click(addClass);
function addClass(){
var element = $(this).find(".spoilerContent");
if ($(element).hasClass("spoilerBlock")) {
$(element).removeClass("spoilerBlock");
$(element).addClass("spoilerBlockReveal");
}
else {
$(element).addClass("spoilerBlock");
$(element).removeClass("spoilerBlockReveal");
}
}
}());