Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

MediaWiki:Common.js: Difference between revisions

MediaWiki interface page
fixed positioning algorithm for tooltip
No edit summary
Line 223: Line 223:
addOnloadHook(checkElementByClassComp);
addOnloadHook(checkElementByClassComp);
addOnloadHook(createTooltipTrigger);
addOnloadHook(createTooltipTrigger);
/** Eve University New Fitting Template *******************
*
* Description: Allows showing and hiding of EFT and recommended skills section
* Allows viewing of fit and module info in game
* Adds titles to modules for viewing when hovering over picture
*
* Maintainers: Miranda McLaughlin
**********************************************************/
try{
(function($) {
$(function() {
$(function() {
$('.shipFitting .button.eft').bind('click', toggleEFT);
$('.shipFitting .button.skills').bind('click', toggleSkills);
$('.shipFitting .button.eve').bind('click', showFitInGame);
$('.shipFitting .module').not('.open, .inactive').bind('click', showItemInfoInGame);
$('.shipFitting .subMod').not('.open, .inactive').bind('click', showItemInfoInGame);
$('.shipFitting .module:not(.open, .inactive) img').each(addTitle);
$('.shipFitting .subMod:not(.open, .inactive) img').each(addTitle);
});
function toggleEFT() {
$(this).parents('.shipFitting').toggleClass('showEft');
}
function toggleSkills() {
$(this).parents('.shipFitting').toggleClass('showSkills');
}
function showFitInGame() {
var dna = $(this).attr("data-shipdna");
console.log(dna);
CCPEVE.showFitting(dna);
}
function showItemInfoInGame() {
var typeID = $(this).attr('data-typeid');
console.log(typeID);
CCPEVE.showInfo(typeID);
}
function addTitle(index, element) {
var name = $(element).attr('alt');
$(element).attr('title', name);
}
});
})(jQuery);
}catch(e){console.log("Joel screwed up! Contact Miranda McLaughlin.", e);}
/**********************************************************/