]> Joshua Wise's Git repositories - patchfork.git/commitdiff
Add support for displaying the year; put the album in italics. (Feature request...
authorJoshua Wise <joshua@h2so4.joshuawise.com>
Tue, 23 Mar 2010 02:06:50 +0000 (22:06 -0400)
committerJoshua Wise <joshua@h2so4.joshuawise.com>
Tue, 23 Mar 2010 02:06:50 +0000 (22:06 -0400)
player/index.php
std/base.css
std/command.js

index 56588e762efa6287ef20a2c57ebee34fcd824272..fa6d768b141b53b046ab732fa95970f113137896 100644 (file)
@@ -63,7 +63,7 @@
        <div class='pc_artist' >
                <p class='disp'><span id='disp_title'></span><br/></p>
                <p class='disp' ><span id='disp_artist'></span><br/></p>
        <div class='pc_artist' >
                <p class='disp'><span id='disp_title'></span><br/></p>
                <p class='disp' ><span id='disp_artist'></span><br/></p>
-               <p class='disp'><span id='disp_album'></span><br/></p>
+               <p class='disp'><span id='disp_album'></span> <span id='disp_year'></span><br/></p>
        </div>
 
        <div class='pc_ci' >
        </div>
 
        <div class='pc_ci' >
index 074ddb5885ecccdc43d4db70c93fe92a26b6774d..cbfc3cbc68a55081e7fe058eba805dc274a1e2c1 100644 (file)
@@ -6,11 +6,15 @@ a {
        text-decoration: none;
 }
 
        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;
 }
 
        padding: 0px;
        margin: 0px;
 }
 
+#disp_album {
+       font-style: italic;
+}
+
 .main_container {
        padding-left: 5px;
        padding-bottom: 10px; 
 .main_container {
        padding-left: 5px;
        padding-bottom: 10px; 
index 7d7bd332685556022fc554b39c99bc244219155e..8db64d1284fcae5681b98634c3513e3f7bcd556c 100644 (file)
@@ -41,6 +41,7 @@ playing.pl_size = 0;
 playing.size = 0;
 playing.artist = "";
 playing.album = "";
 playing.size = 0;
 playing.artist = "";
 playing.album = "";
+playing.year = "";
 playing.title = "";
 playing.image = "";    // 
 playing.asin = "";     
 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_artist = null;
 playing.disp_title = null; 
 playing.disp_album = null;
+playing.disp_year = null;
 playing.albumart = null;
 
 var last_pl_selected = true;
 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_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");
 
                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);
                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 = "";
                if(playing.albumart)
                        remove_children(playing.albumart);
                playing.artist = "";
                playing.title = "";
                playing.album = "";
+               playing.year = "";
                playing.image = "";
                playing.asin = "";
                playing.length = "";
                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 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 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')
        var new_thumb = false;
 
        if(typeof(title)=='undefined')
@@ -506,6 +514,10 @@ function update_current_song(info) {
                album = "";
        if(typeof(artist)=='undefined')
                artist = "";
                album = "";
        if(typeof(artist)=='undefined')
                artist = "";
+       if(typeof(year)=='undefined')
+               year = "";
+       else
+               year = "["+year+"]";
 
        if(artist!=playing.artist) {
                playing.artist = artist;
 
        if(artist!=playing.artist) {
                playing.artist = artist;
@@ -519,6 +531,12 @@ function update_current_song(info) {
                remove_children(alb);
                alb.appendChild(create_txt(album));
        }
                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'];
 
        if(typeof(info['file'])!='undefined') {
                var f = info['file'];
This page took 0.027362 seconds and 4 git commands to generate.