Empty commit

This commit is contained in:
Git 2013-04-10 08:00:43 +00:00
parent b009e2c889
commit 6790608346

View File

@ -153,18 +153,23 @@
tasteometerHtml += '<li class="lastfm_essential">Compatibility: '; tasteometerHtml += '<li class="lastfm_essential">Compatibility: ';
var compatibility = Math.round(j['score'] * 100); var compatibility = Math.round(j['score'] * 100);
var background; var background;
if (compatibility < 50){ if (compatibility < 0 || compatibility > 100) {
background = 'rgb(255, '+Math.floor(255*compatibility/50)+', 0)' compatibility = "Unknown";
} else { tasteometerHtml += compatibility;
background = 'rgb('+Math.floor((1-(compatibility-50)/50)*255)+', 255, 0)' } else {
} if (compatibility < 50){
tasteometerHtml += compatibility + '%\r\ background = 'rgb(255, '+Math.floor(255*compatibility/50)+', 0)'
} else {
background = 'rgb('+Math.floor((1-(compatibility-50)/50)*255)+', 255, 0)'
}
tasteometerHtml += compatibility + '%\r\
<li class="lastfm_essential">\r\ <li class="lastfm_essential">\r\
<div id="lastfm_compatibilitybar_container">\n\ <div id="lastfm_compatibilitybar_container">\n\
<div id="lastfm_compatibilitybar" style="width: '+compatibility+'%; background: '+background+';">\n\ <div id="lastfm_compatibilitybar" style="width: '+compatibility+'%; background: '+background+';">\n\
</div>\r\ </div>\r\
</div>\r\ </div>\r\
</li>'; </li>';
}
// Only print shared artists if there are any // Only print shared artists if there are any
if (j['artists']['matches'] != 0){ if (j['artists']['matches'] != 0){
sharedArtistsHtml += '<li>Shared artists:</li><li><ul class="nobullet">'; sharedArtistsHtml += '<li>Shared artists:</li><li><ul class="nobullet">';