MediaWiki:Common.js

/* Extended Navigation importArticles({   type: 'script',    articles: [        'u:dev:ExtendedNavigation/code.js'    ] }); End of Extended Navigation */

/* Any JavaScript here will be loaded for all users on every page load. */ importArticles({   type: "script",    articles: [        "u:dev:Tooltips/code.js",        "MediaWiki:Timer.js",        "MediaWiki:Slideshow.js",        ] }, {    type: "style",    articles: [        "MediaWiki:Tooltip.css",        "MediaWiki:Slideshow.css",    ] });

// Suppress tooltip display for links that have the classname 'suppress' $(document).ready( function {   $('.suppress a').removeAttr('title');    stageData; });

function stageData{ // this code is supposed to add the rowspan when a battle has several monsters. Maybe we could use it ? $('.stageData td.stage').each(function{       var t = $(this).parent.nextUntil('tr:not(:has(td.span))');        $(this).attr('rowSpan',t.length+1);        t.children('td:first-child').remove    });

$('.stageDataDropPlus').mouseenter(function{       $(this).hide;        $(this).parent.prev.css({background:'rgba(0,0,0,.7)', zIndex:1});        $(this).parent.parent.css({overflow:''});    }); $('.stageDataDrop').mouseleave(function{       $(this).next.find('.stageDataDropPlus').show;        $(this).css({background:'', zIndex:0});        $(this).parent.css({overflow:'hidden'});    }); }

window.texttip = function{ var tt = $('.tt-text'); tt.removeAttr('title').on('mouseenter touchstart',function{       var o = $(this).offset, w = document.body.clientWidth, b = $(this).hasClass('bottom');        var p = b ? {top: o.top+$(this).outerHeight+5} : {bottom: document.body.clientHeight-o.top-$(this).outerHeight};        if(o.left<w/2) p.left = b ? o.left : o.left+$(this).outerWidth+5;        else p.right = b ? w-o.left-$(this).outerWidth : w-o.left+5;        $(' ').addClass('tt-tip').css(p).html($(this).data('texttip')).appendTo('body');    }) .on('mouseleave touchend',function{$('.tt-tip').remove;}).parent('a').removeAttr('title'); tt.children('a').removeAttr('title'); }; texttip;