Set title in genFourColumnTable

This commit is contained in:
fkloft 2015-06-23 20:03:09 +02:00
parent a7387e3f4b
commit 3396cc7a27

View File

@ -12,14 +12,15 @@ window.getRangeText = function(d) {
if(!range.isLinkable) title += '\nPortal is missing resonators,\nno new links can be made'; if(!range.isLinkable) title += '\nPortal is missing resonators,\nno new links can be made';
return ['<span title="' + title + '">range</span>', return ['range',
'<a onclick="window.rangeLinkClick()"' '<a onclick="window.rangeLinkClick()"'
+ (range.isLinkable ? '' : ' style="text-decoration:line-through;"') + (range.isLinkable ? '' : ' style="text-decoration:line-through;"')
+ ' title="'+title+'">' + '>'
+ (range.range > 1000 + (range.range > 1000
? Math.floor(range.range/1000) + ' km' ? Math.floor(range.range/1000) + ' km'
: Math.floor(range.range) + ' m') : Math.floor(range.range) + ' m')
+ '</a>']; + '</a>',
title];
} }
// generates description text from details for portal // generates description text from details for portal
@ -151,9 +152,9 @@ window.getModDetails = function(d) {
window.getEnergyText = function(d) { window.getEnergyText = function(d) {
var currentNrg = getCurrentPortalEnergy(d); var currentNrg = getCurrentPortalEnergy(d);
var totalNrg = getTotalPortalEnergy(d); var totalNrg = getTotalPortalEnergy(d);
var inf = currentNrg + ' / ' + totalNrg; var title = currentNrg + ' / ' + totalNrg;
var fill = prettyEnergy(currentNrg) + ' / ' + prettyEnergy(totalNrg) var fill = prettyEnergy(currentNrg) + ' / ' + prettyEnergy(totalNrg)
return ['energy', '<tt title="'+inf+'">' + fill + '</tt>']; return ['energy', fill, title];
} }
@ -237,22 +238,19 @@ window.getAttackApGainText = function(d,fieldCount,linkCount) {
var breakdown = getAttackApGain(d,fieldCount,linkCount); var breakdown = getAttackApGain(d,fieldCount,linkCount);
var totalGain = breakdown.enemyAp; var totalGain = breakdown.enemyAp;
function tt(text) { var t = '';
var t = ''; if (teamStringToId(PLAYER.team) == teamStringToId(d.team)) {
if (teamStringToId(PLAYER.team) == teamStringToId(d.team)) { totalGain = breakdown.friendlyAp;
totalGain = breakdown.friendlyAp; t += 'Friendly AP:\t' + breakdown.friendlyAp + '\n';
t += 'Friendly AP:\t' + breakdown.friendlyAp + '\n'; t += ' Deploy ' + breakdown.deployCount + ', ';
t += ' Deploy ' + breakdown.deployCount + ', '; t += 'Upgrade ' + breakdown.upgradeCount + '\n';
t += 'Upgrade ' + breakdown.upgradeCount + '\n'; t += '\n';
t += '\n';
}
t += 'Enemy AP:\t' + breakdown.enemyAp + '\n';
t += ' Destroy AP:\t' + breakdown.destroyAp + '\n';
t += ' Capture AP:\t' + breakdown.captureAp + '\n';
return '<tt title="' + t + '">' + text + '</tt>';
} }
t += 'Enemy AP:\t' + breakdown.enemyAp + '\n';
t += ' Destroy AP:\t' + breakdown.destroyAp + '\n';
t += ' Capture AP:\t' + breakdown.captureAp + '\n';
return [tt('AP Gain'), tt(digits(totalGain))]; return ['AP Gain', digits(totalGain), t];
} }
@ -261,16 +259,12 @@ window.getHackDetailsText = function(d) {
var shortHackInfo = hackDetails.hacks+' @ '+formatInterval(hackDetails.cooldown); var shortHackInfo = hackDetails.hacks+' @ '+formatInterval(hackDetails.cooldown);
function tt(text) { var title = 'Hacks available every 4 hours\n'
var t = 'Hacks available every 4 hours\n'; + 'Hack count:\t'+hackDetails.hacks+'\n'
t += 'Hack count:\t'+hackDetails.hacks+'\n'; + 'Cooldown time:\t'+formatInterval(hackDetails.cooldown)+'\n'
t += 'Cooldown time:\t'+formatInterval(hackDetails.cooldown)+'\n'; + 'Burnout time:\t'+formatInterval(hackDetails.burnout);
t += 'Burnout time:\t'+formatInterval(hackDetails.burnout)+'\n';
return '<span title="'+t+'">'+text+'</span>'; return ['hacks', shortHackInfo, title];
}
return [tt('hacks'), tt(shortHackInfo)];
} }
@ -280,16 +274,12 @@ window.getMitigationText = function(d,linkCount) {
var mitigationShort = mitigationDetails.total; var mitigationShort = mitigationDetails.total;
if (mitigationDetails.excess) mitigationShort += ' (+'+mitigationDetails.excess+')'; if (mitigationDetails.excess) mitigationShort += ' (+'+mitigationDetails.excess+')';
function tt(text) { var title = 'Total shielding:\t'+(mitigationDetails.shields+mitigationDetails.links)+'\n'
var t = 'Total shielding:\t'+(mitigationDetails.shields+mitigationDetails.links)+'\n' + '- active:\t'+mitigationDetails.total+'\n'
+ '- active:\t'+mitigationDetails.total+'\n' + '- excess:\t'+mitigationDetails.excess+'\n'
+ '- excess:\t'+mitigationDetails.excess+'\n' + 'From\n'
+ 'From\n' + '- shields:\t'+mitigationDetails.shields+'\n'
+ '- shields:\t'+mitigationDetails.shields+'\n' + '- links:\t'+mitigationDetails.links;
+ '- links:\t'+mitigationDetails.links;
return '<span title="'+t+'">'+text+'</span>'; return ['shielding', mitigationShort, title];
}
return [tt('shielding'), tt(mitigationShort)];
} }