From 4d1ed7e05f5efc589b7fb6031661ccda496cee76 Mon Sep 17 00:00:00 2001 From: Cloud Dumper Date: Sat, 7 Jan 2012 23:41:51 +0100 Subject: [PATCH] Improve music playlist rendering. This change: * bolds currently playing song in playlist; * forces song names in playlist to one line, ellipsize after (...); * adds jQuery tipsies to get the whole song name, along with the artist name, and the album the song is coming from. No need to split this changeset into three different ones for the sake of atomicity. Two first elements were on the priorities / bug list available there: http://gitorious.org/owncloud/pages/Home --- apps/media/css/music.css | 4 ++-- apps/media/js/playlist.js | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/apps/media/css/music.css b/apps/media/css/music.css index a6738058be3..41ade44a66f 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -22,11 +22,11 @@ div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; } #collection li.album,#collection li.song { margin-left:3em; } #leftcontent img.remove { display:none; float:right; cursor:pointer; } #leftcontent li:hover img.remove { display:inline; } -#leftcontent li {white-space: normal; } +#leftcontent li div.label { float: left; width: 200px; overflow: hidden; text-overflow: ellipsis; } #collection li button { float:right; } #collection li,#playlist li { list-style-type:none; } .template { display:none; } -.collection_playing { background:#eee; } +.collection_playing { background:#eee; font-weight: bold; } #collection li { padding-right:10px; } #searchresults input.play, #searchresults input.add { float:left; height:1em; width:1em; } diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js index 57180b3be7b..089065989ae 100644 --- a/apps/media/js/playlist.js +++ b/apps/media/js/playlist.js @@ -1,11 +1,23 @@ PlayList.render=function(){ $('#playlist').show(); + + /* + * We should not empty() PlayList.parent() but thorougly manage its + * elements instead because some code might be attached to those. + * JQuery tipsies are one of them. The following line make sure they + * are all removed before we delete the associated
  • . + */ + $(".tipsy").remove(); + PlayList.parent.empty(); for(var i=0;i'); - li.append(item.name); - li.attr('class', 'jp-playlist-' + i); + li.attr('class', 'jp-playlist-' + i); + li.attr('title', item.artist + ' - ' + item.name + '
    (' + item.album + ')'); + var div = $('
    ' + item.name + '
    '); + li.append(div); + $('.jp-playlist-' + i).tipsy({gravity:'w', fade:true, live:true, html:true}); var img=$(''); img.click(function(event){ event.stopPropagation();