MediaWiki:Wikia.js

/* --- Removes the need for adding a surfeit amount of attributes --- */ /* --- by making the desirable ones the default. --- */   $(".wikia-gallery").removeClass.addClass("wikia-gallery wikia-gallery-caption-below wikia-gallery-position-center wikia-gallery-spacing-small wikia-gallery-border-none wikia-gallery-captions-center wikia-gallery-caption-size-medium"); /* --- Template:Portal/Contents slider --- */

$(".portal__content__aux a").on("click", function(e) {       e.preventDefault;        var id = $(this).parent.attr("id");        $(".portal__content__slide.active").removeClass("active");        $(".portal__content__slide#" + id).addClass("active");        $(".portal.navigation").addClass(id);    }); $(".portal__content__navigator .previous").on("click", function {       if( $(".portal__content__slide.active").attr("id") == "hub" ) {            console.log("Attempted to access previous slide when none exists in the stack (no operation).");        } else {            var active = $(".portal__content__slide.active");            active.removeClass("active");            active.prev.addClass("active");            var newid = active.prev.attr("id");            $(".portal.navigation").removeClass.addClass("portal navigation " + newid);        }    }); $(".portal__content__navigator .next").on("click", function {       if( $(".portal__content__slide.active").attr("id") == "Spinoffs" ) {            console.log("Attempted to access next slide when none exists in the stack (recycled back to slide 1).");            var active = $(".portal__content__slide.active");            active.removeClass("active");            $(".portal__content__slide#hub").addClass("active");            $(".portal.navigation").removeClass.addClass("portal navigation hub");        } else {            var active = $(".portal__content__slide.active");            active.removeClass("active");            active.next.addClass("active");            var newid = active.next.attr("id");            $(".portal.navigation").removeClass.addClass("portal navigation " + newid);        }    }); $(".portal__content__navigator .index").on("click", function {      $(".portal__content__slide.active").removeClass("active");       $(".portal__content__slide#hub").addClass("active");       $(".portal.navigation").removeClass.addClass("portal navigation hub");    });