From 9ca815d99b1c9721bef3acff04c12f4be8c8f28b Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 5 Oct 2012 13:40:38 +0200 Subject: [PATCH] 0xdb info view: move score to statistics column --- static/js/pandora/infoView.0xdb.js | 35 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/static/js/pandora/infoView.0xdb.js b/static/js/pandora/infoView.0xdb.js index 19cdbf3a6..b1c00c6c6 100644 --- a/static/js/pandora/infoView.0xdb.js +++ b/static/js/pandora/infoView.0xdb.js @@ -441,20 +441,6 @@ pandora.ui.infoView = function(data) { $div.html(html.join('; ')); } - if (data.votes || data.likes) { - $div = $('
') - .css(css) - .appendTo($text); - html = []; - ['votes', 'likes'].forEach(function(key) { - data[key] && html.push( - formatKey(key == 'votes' ? 'Mainstream Score' : 'Arthouse Score') - + Ox.formatNumber(data[key], 1) + '%' - ); - }); - $div.html(html.join('; ')); - } - ['reviews', 'links'].forEach(function(key) { data[key] && $('
') .css(css) @@ -468,16 +454,31 @@ pandora.ui.infoView = function(data) { $('
').css({height: '16px'}).appendTo($text); + // Mainstream Score, Arthouse Score ---------------------------------------- + + ['votes', 'likes'].forEach(function(key) { + var value = data[key] || 0; + $('
') + .css({marginBottom: '4px'}) + .append(formatKey(key == 'votes' ? 'Mainstream Score' : 'Arthouse Score'), true) + .append( + Ox.Theme.formatColor(value * 1.2, 'hue') + .css({textAlign: 'right'}) + .html(Ox.formatNumber(value, 1) + '%') + ) + .appendTo($statistics); + }); + // Hue, Saturation, Lightness, Volume -------------------------------------- ['hue', 'saturation', 'lightness', 'volume'].forEach(function(key) { + var value = data[key] || 0; $('
') .css({marginBottom: '4px'}) .append(formatKey(key, true)) .append( - Ox.Theme.formatColor( - data[key] || 0, key == 'volume' ? 'lightness' : key - ).css({textAlign: 'right'}) + Ox.Theme.formatColor(value, key == 'volume' ? 'lightness' : key) + .css({textAlign: 'right'}) ) .appendTo($statistics); });