Widget:Character-Banner: Difference between revisions
From Elwiki
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly> | <includeonly> | ||
<script type="application/javascript"> | <script type="application/javascript"> | ||
RLQ.push(function () { | |||
var classes = []; | var classes = []; | ||
var maps = {}; | var maps = {}; | ||
jQuery('#p-Characters-label + .mw-portlet-body #nav > ul > li > a').each(function(){ | |||
classes.push( | classes.push(jQuery(this).attr('title').replace('/', '')) | ||
}); | }); | ||
Line 43: | Line 43: | ||
} | } | ||
jQuery('.char-banner-tree-image').mouseenter(function(e) { | |||
var base_name = | var base_name = jQuery(this).parent().attr('data-base'); | ||
var class_name = | var class_name = jQuery(this).attr('data-class-name'); | ||
var index = | var index = jQuery(this).index()+1; | ||
var coords = [1, 1]; | var coords = [1, 1]; | ||
Line 53: | Line 53: | ||
else coords = [index-8, 3]; | else coords = [index-8, 3]; | ||
jQuery('.char-banner-title').text(class_name); | |||
jQuery('.char-banner-image').html(face('Aisha', coords[0], coords[1])); | |||
}); | }); | ||
jQuery('.char-banner-tree').mouseleave(function(e) { | |||
var base_name = | var base_name = jQuery(this).attr('data-base'); | ||
if (base_name == 'LuCiel') base_name = 'Lu/Ciel'; | if (base_name == 'LuCiel') base_name = 'Lu/Ciel'; | ||
jQuery('.char-banner-title').text(base_name); | |||
jQuery('.char-banner-image').html(face('Aisha')); | |||
jQuery('.char-banner-image').click(function(){ | |||
window.location.href = '/w/' + base_name; | window.location.href = '/w/' + base_name; | ||
}); | }); |