No edit summary |
No edit summary |
||
Line 40: | Line 40: | ||
$(element).removeClass("spoilerContent"); | $(element).removeClass("spoilerContent"); | ||
$(element).addClass("spoilerContentReveal"); | $(element).addClass("spoilerContentReveal"); | ||
} | } | ||
} | } | ||
}()); | }()); |
Revision as of 06:50, 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("div");
if ($(element).hasClass("spoilerContent")) {
$(element).removeClass("spoilerContent");
$(element).addClass("spoilerContentReveal");
}
}
}());