No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
}); | }); | ||
}); | }); | ||
(function () { | (function () { | ||
Line 64: | Line 31: | ||
} | } | ||
}()); | }()); | ||
(function () { | (function () { | ||
$(".spoilerSearch").click(addClass); | $(".spoilerSearch").click(addClass); | ||
function addClass(){ | function addClass(){ | ||
var | var element = $(this).find("div"); | ||
if ($(element).hasClass("spoilerBlock")) { | |||
$(element).removeClass("spoilerBlock"); | |||
$(element).addClass("spoilerBlockReveal"); | |||
} | |||
else { | |||
$(element).addClass("spoilerBlock"); | |||
$(element).removeClass("spoilerBlockReveal"); | |||
} | |||
} | } | ||
}()); | }()); |
Revision as of 06:27, 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 () {
$(".spoilerSearch").click(addClass);
function addClass(){
var element = $(this).find("div");
if ($(element).hasClass("spoilerBlock")) {
$(element).removeClass("spoilerBlock");
$(element).addClass("spoilerBlockReveal");
}
else {
$(element).addClass("spoilerBlock");
$(element).removeClass("spoilerBlockReveal");
}
}
}());