MediaWiki:ImprovedTabbers.js

require(['wikia.window', 'jquery', 'mw'], function (window, $, mw) {   if (window.TabberWichoutTitlesLoaded) {        return;    }    window.TabberWichoutTitlesLoaded = true;    $(".tabber").each(function { var $this = $(this), tabContent = $this.children('.tabbertab'), nav = $this.children('.tabbernav'); tabContent.each(function {            $(this).attr('data-tabber-title', $(this).attr('title') );            $(this).attr('title', null);        }); function showContent(title) { var content = tabContent.filter('[data-tabber-title="' + title + '"]'); if (content.length !== 1) return false; tabContent.hide; content.show; nav.find('.tabberactive').removeClass('tabberactive'); nav.find('a[title="' + title + '"]').parent.addClass('tabberactive'); $(window).trigger('scroll'); return true; }       nav.on('click', 'a', function (e) {            var title = $(this).attr('title');            e.preventDefault;            location.hash = '#' + title;            showContent(title);        }); }); });