saithis 039f9c14b5 * The jQuery UI js/css file is now taken from ajax.googleapis.com instead of code.jquery.com
* Table or not is now autodetected, removed data-tooltip attributes
* Empty table cells are now possible
* Removed duplicated \t's on some titles
* Some tooltip code cleanup
2013-02-12 23:16:12 +01:00

22 lines
872 B
JavaScript

// GAME STATUS ///////////////////////////////////////////////////////
// MindUnit display
window.updateGameScore = function(data) {
if(!data) {
window.postAjax('getGameScore', {}, window.updateGameScore);
return;
}
var r = parseInt(data.result.resistanceScore), e = parseInt(data.result.alienScore);
var s = r+e;
var rp = r/s*100, ep = e/s*100;
r = digits(r), e = digits(e);
var rs = '<span class="res" style="width:'+rp+'%;">'+Math.round(rp)+'%&nbsp;</span>';
var es = '<span class="enl" style="width:'+ep+'%;">&nbsp;'+Math.round(ep)+'%</span>';
$('#gamestat').html(rs+es).one('click', function() { window.updateGameScore() });
// help cursor via “#gamestat span”
$('#gamestat').attr('title', 'Resistance:\t'+r+' MindUnits\nEnlightenment:\t'+e+' MindUnits');
window.setTimeout('window.updateGameScore', REFRESH_GAME_SCORE*1000);
}