From 9a6ec85fe0d50fc2db8ccfcd18a585f34a8ffe94 Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Mon, 22 Mar 2010 22:06:50 -0400 Subject: [PATCH 1/1] Add support for displaying the year; put the album in italics. (Feature request from Markus.) --- player/index.php | 2 +- std/base.css | 6 +++++- std/command.js | 18 ++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/player/index.php b/player/index.php index 56588e7..fa6d768 100644 --- a/player/index.php +++ b/player/index.php @@ -63,7 +63,7 @@



-


+


diff --git a/std/base.css b/std/base.css index 074ddb5..cbfc3cb 100644 --- a/std/base.css +++ b/std/base.css @@ -6,11 +6,15 @@ a { text-decoration: none; } -tr, td, #disp_artist, #disp_album, #disp_info, p.disp, img.thumbnailart { +tr, td, #disp_artist, #disp_album, #disp_info, #disp_year, p.disp, img.thumbnailart { padding: 0px; margin: 0px; } +#disp_album { + font-style: italic; +} + .main_container { padding-left: 5px; padding-bottom: 10px; diff --git a/std/command.js b/std/command.js index 7d7bd33..8db64d1 100644 --- a/std/command.js +++ b/std/command.js @@ -41,6 +41,7 @@ playing.pl_size = 0; playing.size = 0; playing.artist = ""; playing.album = ""; +playing.year = ""; playing.title = ""; playing.image = ""; // playing.asin = ""; @@ -66,6 +67,7 @@ playing.pp_button = null; playing.disp_artist = null; playing.disp_title = null; playing.disp_album = null; +playing.disp_year = null; playing.albumart = null; var last_pl_selected = true; @@ -127,6 +129,7 @@ function init_player() { playing.disp_artist = document.getElementById('disp_artist'); playing.disp_title = document.getElementById('disp_title'); playing.disp_album = document.getElementById('disp_album'); + playing.disp_year = document.getElementById('disp_year'); playing.albumart = document.getElementById("albumart"); playing.pp_button = document.getElementById("pp_button"); @@ -474,11 +477,14 @@ function request_song_info() { remove_children(playing.disp_artist); remove_children(playing.disp_title); remove_children(playing.disp_album); + if(playing.disp_year) + remove_children(playing.disp_year); if(playing.albumart) remove_children(playing.albumart); playing.artist = ""; playing.title = ""; playing.album = ""; + playing.year = ""; playing.image = ""; playing.asin = ""; playing.length = ""; @@ -495,9 +501,11 @@ function update_current_song(info) { var artist = info[ "Artist"]; var title = info["Title"]; var album = info[ "Album"]; + var year = (info["Year"] == null) ? info["Date"] : info["Year"]; var a = playing.disp_artist; var t = playing.disp_title; var alb = playing.disp_album; + var y = playing.disp_year; var new_thumb = false; if(typeof(title)=='undefined') @@ -506,6 +514,10 @@ function update_current_song(info) { album = ""; if(typeof(artist)=='undefined') artist = ""; + if(typeof(year)=='undefined') + year = ""; + else + year = "["+year+"]"; if(artist!=playing.artist) { playing.artist = artist; @@ -519,6 +531,12 @@ function update_current_song(info) { remove_children(alb); alb.appendChild(create_txt(album)); } + if((playing.year != year) && y) { + playing.year = year; + new_thumb = true; + remove_children(y); + y.appendChild(create_txt(year)); + } if(typeof(info['file'])!='undefined') { var f = info['file']; -- 2.39.2