summaryrefslogtreecommitdiffstats
path: root/apps/media
diff options
context:
space:
mode:
authorCloud Dumper <clouddumper@gmail.com>2012-01-07 23:41:51 +0100
committerRobin Appelman <icewind1991@gmail.com>2012-01-08 13:45:44 +0100
commit4d1ed7e05f5efc589b7fb6031661ccda496cee76 (patch)
tree775b11dd32f830fe1363d60426ab65a362224ac5 /apps/media
parenta4e14b49b14b2215037806ded362b2ded0e61465 (diff)
downloadnextcloud-server-4d1ed7e05f5efc589b7fb6031661ccda496cee76.tar.gz
nextcloud-server-4d1ed7e05f5efc589b7fb6031661ccda496cee76.zip
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
Diffstat (limited to 'apps/media')
-rw-r--r--apps/media/css/music.css4
-rw-r--r--apps/media/js/playlist.js16
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 <li/>.
+ */
+ $(".tipsy").remove();
+
PlayList.parent.empty();
for(var i=0;i<PlayList.items.length;i++){
var item=PlayList.items[i];
var li=$('<li/>');
- li.append(item.name);
- li.attr('class', 'jp-playlist-' + i);
+ li.attr('class', 'jp-playlist-' + i);
+ li.attr('title', item.artist + ' - ' + item.name + '<br/>(' + item.album + ')');
+ var div = $('<div class="label">' + item.name + '</div>');
+ li.append(div);
+ $('.jp-playlist-' + i).tipsy({gravity:'w', fade:true, live:true, html:true});
var img=$('<img class="remove svg action" src="'+OC.imagePath('core','actions/delete')+'"/>');
img.click(function(event){
event.stopPropagation();