User:Ericwong99/Common.css

importArticles({   type: 'script',    articles: [        'w:c:dev:ReferencePopups/code.js'        "u:dev:FloatingToc/code.js",        "u:dev:Tooltips/code.js"    ] });

function events{ $('.event').each(function{       if($(this).is('[data-start]')) var start = $(this).data('start')*1000, end = $(this).data('end')*1000;        else var start = $(this).closest('[data-start]').data('start')*1000, end = $(this).closest('[data-end]').data('end')*1000;        var cur = new Date*1;        if(cur < start) $(this).removeClass('eventDuring eventAfter').addClass('eventBefore');        else if(start <= cur && cur < end) $(this).removeClass('eventBefore eventAfter').addClass('eventDuring');        else if(end <= cur) $(this).removeClass('eventBefore eventDuring').addClass('eventAfter');        if(!$(this).hasClass('eventTimer')) return true;        var text = '';        if($(this).hasClass('eventBefore')) var diff = start-cur;        else if($(this).hasClass('eventDuring')) var diff = end-cur;        else if($(this).hasClass('eventAfter')) var diff = cur-end;        if(temp = Math.floor(diff/86400000)) text = temp + 'Day'; text += ('0'+Math.floor(diff%86400000/3600000)).slice(-2); $(this).empty.append(           document.createTextNode(text),            $(' ').addClass('eventTimerFlash').text(':'),            document.createTextNode(('0'+Math.floor(diff%3600000/60000)).slice(-2))        );

});   $('.eventDisplayBefore, .eventDisplayDuring, .eventDisplayAfter').hide;    $('.eventDisplayBefore.eventBefore, .eventDisplayDuring.eventDuring, .eventDisplayAfter.eventAfter').show;    setTimeout(events,5000); } function eventsSwitch(dl){    if($('#Timetable').is(':visible'))        var from = $('#Timetable'), to = $('#CurrentEvents');    else        var from = $('#CurrentEvents'), to = $('#Timetable');    $('#EventsModule').delay(dl).animate({height: to.height},dl);    from.fadeOut(dl);    to.delay(dl*2).fadeIn(dl); }

function alternate{ $('.alternate > :first-child').show; $('.alternate > :last-child').hide; $('.alternate') .delay(1500) .queue(function(n){$(this).children(':first-child').fadeOut(750,n);}) .queue(function(n){$(this).children(':last-child').fadeIn(750,n);}) .delay(1500) .queue(function(n){$(this).children(':last-child').fadeOut(750,n);}) .queue(function(n){$(this).children(':first-child').fadeIn(750,n);}); setTimeout(alternate,6000); }

function staminaSlider{ if(!$('#staminaSlider').length) return; var t = null, r = function{ clearTimeout(t); var now = new Date, eta = new Date(now.getTime + ($('#staminaSlider input[type=hidden]').eq(1).val-$('#staminaSlider input[type=hidden]').eq(0).val)*600000), d = Math.max(0,(Date.UTC(eta.getFullYear,eta.getMonth,eta.getDate) - Date.UTC(now.getFullYear,now.getMonth,now.getDate))/86400000); switch(d){case 0:d='';break; case 1:d='明天';break; case 2:d='後天';break; default:d=d+'天後';} $('#staminaSliderNow').empty.append(document.createTextNode(('0'+now.getHours).slice(-2)),$(' ').addClass('eventTimerFlash').text(':'),document.createTextNode(('0'+now.getMinutes).slice(-2))); if($('#staminaSlider input[type=checkbox]').prop('checked')){ var l = $('#staminaSlider .sliderText').eq(-1); $('#staminaSliderETA').empty.text((l.find('select').val=='今天'?'':l.find('select').val)+(('0'+l.find('input[type=text]').val).slice(-2))).append($(' ').addClass('eventTimerFlash').text(':'),document.createTextNode('00')); $('#staminaSlider input').slice(0,2).val(Math.max(0,Math.ceil($('#staminaSlider input[type=hidden]').eq(1).val - (new Date(now.getFullYear,now.getMonth,now.getDate+$('#staminaSlider select').prop('selectedIndex'),$('#staminaSlider input').eq(-1).val*1).getTime - now.getTime)/600000))); }else{ $('#staminaSliderETA').empty.append(document.createTextNode(d),document.createTextNode(('0'+eta.getHours).slice(-2)),$(' ').addClass('eventTimerFlash').text(':'),document.createTextNode(('0'+eta.getMinutes).slice(-2))); }       $('#staminaSlider').data('control').set($('#staminaSlider .sliderArrow+.sliderText input[type=hidden]').map(function{return $(this).val*1;}).get); var v = $('#staminaSlider .sliderArrow').map(function{return parseInt($(this).css('top'));}).get; $('#staminaSlider .sliderText') .eq(0).css('top',v[0] = v[0] + Math.max(27-v[0]+v[1],0)/2 - 5).end .eq(1).css('top',function{return Math.min(v[1]-5,v[0]-$(this).height-3);}); t = setTimeout(r,6000); };   $(' ').addClass('sliderText').insertAfter('#staminaSlider .sliderArrow'); $(' ').addClass('sliderText').appendTo('#staminaSlider'); $('#staminaSlider .sliderText').eq(0).append(       $(' ').attr({id:'staminaSliderSwitch'}).text('現有'),        document.createTextNode('體力: '),        $(' ').addClass('input').val(50),        $(' ').val(50),        $(' '),        document.createTextNode('現在是 '),        $(' ').attr({id:'staminaSliderNow'})    ).end.eq(1).append(        document.createTextNode('目標體力: '),        $(' ').addClass('input').val(80),        $(' ').val(80),        $(' '),        $(' ').attr({id:'staminaSliderSwitch2'}).text('大約'),        document.createTextNode('於 '),        $(' ').attr({id:'staminaSliderETA'})    ).end.eq(2).append(        $(' '),        document.createTextNode('鎖定於'),        $(' '),        $(' ').addClass('input').css({width:'auto', marginRight:2}).append($(' ').text('今天'),$(' ').text('明天'),$(' ').text('後天')),        $(' ').addClass('input').val(0),        document.createTextNode(' 時'), $(' ').attr({id:'staminaSliderLockArrow'}) ).css({background: 'rgb(255,128,0)'}).hide.on('mousedown',function(e){e.stopPropagation;});   r;    $('#staminaSlider').on('slide',function(e,y,i){ $(this).find('.sliderText input[type=text]').eq(i).val(Math.floor(y)); $(this).find('.sliderText input[type=hidden]').eq(i).val(Math.floor(y)); r; });   $('#staminaSlider .sliderArrow+.sliderText').on('mousedown',function(ev){ if(ev.target!=this) return true; ev.preventDefault; $(this).prev.trigger('mousedown'); });   $('#staminaSlider input[type=checkbox]').on('change',function{ r; $('#staminaSlider input').eq(0).prop('disabled',$(this).prop('checked')); $('#staminaSliderSwitch').text($(this).prop('checked')?'需保留':'現有'); $('#staminaSliderSwitch2').text($(this).prop('checked')?'':'大約'); });   $('#staminaSlider .sliderArrow+.sliderText input[type=text]').on('keyup',function{ var n = $('#staminaSlider .sliderArrow+.sliderText input[type=text]'), v = n.map(function{return $(this).val*1;}).get, i = n.index(this); $(this).next.val(Math[i?'max':'min'].apply(this,v)); r; });   $('#staminaSliderETA').on('click',function{ var d = $(this).parent; $('.sliderText').eq(-1).css({top: d.position.top+d.height+3}).show; $(document).one('mousedown',function{$('.sliderText').eq(-1).hide;}) }); }

function stageData{ $('.stageData td.special').each(function{       var t = $(this).parent.nextUntil('tr:not(:has(td.specspan))');        if(t.length == 0) return true;        $(this).attr('rowSpan',t.length+1);        t.each(function{$(this).children.eq(1).remove;});    }); $('.stageData td.stage').each(function{       var t = $(this).parent.nextUntil('tr:not(:has(td.span))');        if(t.length == 0) return true;        $(this).attr('rowSpan',t.length+1);        t.each(function{$(this).children.eq(0).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'});    }); }

var tooltips_config = { waitForImages: true, } var tooltips_list =

$.ready(function{   var script = document.createElement("script");    script.type = "text/javascript";    document.getElementsByTagName("head")[0].appendChild(script);    createLeftMeun; });

function createLeftMeun { var div = document.createElement("div"); $(div).attr("class", "leftMenu"); $("#mw-content-text").prepend(div); var handBookDiv = document.createElement("div"); $(handBookDiv).attr("class", "psearch"); $(handBookDiv).appendTo(div); var questDiv = document.createElement("div"); $(questDiv).attr("class", "fsearch"); $(questDiv).appendTo(div); var friendDiv = document.createElement("div"); $(friendDiv).attr("class", "gsearch"); $(friendDiv).appendTo(div); getMenuImage("\u53ec\u559a\u7378\u641c\u5c0bi.png", "\u53ec\u559a\u7378\u641c\u5c0b\u5668", "psearch"); getMenuImage("\u4ee3\u8868\u641c\u5c0bi.png", "\u4ee3\u8868\u641c\u5c0b\u5668", "fsearch"); getMenuImage("\u516c\u6703\u641c\u5c0bi.png", "\u516c\u6703\u641c\u5c0b\u5668", "gsearch"); } function getMenuImage(fileName, link, node) { $.get(mw.util.wikiScript('api'), {		format: 'json',		action: 'parse',		text: decodeURI('%5B%5Bfile%3A' + fileName + '%7Clink=' + link + '%5D%5D')	}, function (data) {		var content = $(data.parse.text['*']).children;		$(content).children.attr('width', ).attr('height', );		$("div.leftMenu ." + node).append(content);	}, 'json'); }

function gacha{ if ($("#resultList").length){ disableSelection(document.body); $("#resultList").isotope({itemSelector:".filterIcon",layoutMode:"fitRows"}); var palList=[]; $("#gachaList .d-pal").each(function(i){			if ($(this).hasClass("r-1")) v=15; else if ($(this).hasClass("r-2")) v=3; else if ($(this).hasClass("r-3")) v=1; else v=1;			if ($(this).parent.attr("id")!="gachaList") v*=3;			for (j=0; j<v; j++) palList.push(i);		}); var palCount=palList.length; $(".gachaButton#pal").click(function{			i=$($("#gachaList .d-pal")[palList[Math.floor(Math.random*palCount)]]).clone;			$("#resultList").prepend(i.hide.fadeIn("slow",function{$(this).find(".eggCover").delay(1000).fadeOut(800)})).isotope("reloadItems").isotope({sortBy:"original-order"});		}); var rareList=[]; $("#gachaList .d-rare").each(function(i){			if ($(this).parent.attr("id")=="gachaList") v=1; else v=3;			if ($(this).hasClass("r-3")) v*=12; else if ($(this).hasClass("r-4")) v*=3; else if ($(this).hasClass("r-5")) v*=1; else v=1;			for (j=0; j.filterIcon"));		}); } }

$(function commentHint {   $("#WikiaArticleComments").before(" Please do not post Looking for Ally messages in the comments. Use the Leader Finder "); });

$(function {   var a = $('');    var locurl = location.href;    if (locurl.indexOf('?') != -1) {    var locary = "&" + locurl.split('?')[1];    } else var locary = '';    $("header#WikiaPageHeader").children("a.comments").after(a);    a.click(function { location.href = "/wiki/" + wgPageName + "?action=purge" + locary; }); });

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;