MediaWiki:MainPage.js

$(document).ready(function{   'use strict';    var $mdata = $('.mw-content').find('div.mpdata');    $mdata.each(function(index){ var type = $(this).attr('data-type'), title = $(this).find('> h2:first'), $mpHTML = $(''); switch (type){ case 'slider': var $sliderItems = [], $items = $(this).find('> span.mpsliderimg'); $mpHTML.html(''); $items.each(function(i){                   var $item = $('    ').addClass('mp-slider-item');                    $item.find('> figure').addClass('mp-slider-image slider-image').find('> img').addClass('mp-slider-img image');                    $sliderItems[$sliderItems.length] = $item;                }); $mpHTML.find('> ul').html($sliderItems); break; }       $mdata.replaceWith($mpHTML); }); });