diff options
author | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-12 21:00:41 -0400 |
---|---|---|
committer | Michael Gapczynski <GapczynskiM@gmail.com> | 2011-08-12 21:00:41 -0400 |
commit | 122018889a054e2cc7222ce123edd859fd3511f4 (patch) | |
tree | 0dff0f4745828df16156e3900222e2ae11e3a0cb /apps | |
parent | ffe9da91af72e7f7953f41968f536d15390edffe (diff) | |
parent | 67156f87e3757fbd5e692e7d6b2209cfafc6c3cf (diff) | |
download | nextcloud-server-122018889a054e2cc7222ce123edd859fd3511f4.tar.gz nextcloud-server-122018889a054e2cc7222ce123edd859fd3511f4.zip |
Merge branch 'master' into sharing
Conflicts:
files/css/files.css
Diffstat (limited to 'apps')
-rw-r--r-- | apps/media/css/music.css | 3 | ||||
-rw-r--r-- | apps/media/css/player.css | 16 | ||||
-rw-r--r-- | apps/media/js/collection.js | 27 | ||||
-rw-r--r-- | apps/media/js/player.js | 48 |
4 files changed, 58 insertions, 36 deletions
diff --git a/apps/media/css/music.css b/apps/media/css/music.css index c78ab200719..f9c3b955d6c 100644 --- a/apps/media/css/music.css +++ b/apps/media/css/music.css @@ -12,4 +12,5 @@ li button.right.prettybutton{font-size:1em;} #collection li{padding-right:10px;} #searchresults input.play, #searchresults input.add{float:right; height:16px; width:16px;} #collection tr.collapsed td.album, #collection tr.collapsed td.title{color:#ddd} -a.expander{float:right;display:block} +a.expander{ float:right; display:block; } +tr.active { background-color:#ccc; } diff --git a/apps/media/css/player.css b/apps/media/css/player.css index 6cf424a8ea1..42ef219994c 100644 --- a/apps/media/css/player.css +++ b/apps/media/css/player.css @@ -1,25 +1,25 @@ #controls ul.jp-controls{list-style-type:none;padding:0;} #controls ul.jp-controls li{display:inline;} #controls ul.jp-controls a{position:absolute;overflow:hidden;text-indent:-9999px;} -a.jp-play,a.jp-pause{width:40px;height:40px;z-index:1;top:0;left:48px;} +a.jp-play,a.jp-pause{width:3.1em;height:3.1em;z-index:1;top:0;left:3.8em;} a.jp-play{background:url("../img/jplayer.blue.monday.png") 0 0 no-repeat;} a.jp-play:hover{background:url("../img/jplayer.blue.monday.png") -41px 0 no-repeat;} a.jp-pause{background:url("../img/jplayer.blue.monday.png") 0 -42px no-repeat;display:none;} a.jp-pause:hover{background:url("../img/jplayer.blue.monday.png") -41px -42px no-repeat;} -a.jp-previous{left:20px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -112px no-repeat;width:28px;height:28px;} +a.jp-previous{left:20px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -112px no-repeat;width:2.3em;height:2.3em;} a.jp-previous:hover{background:url("../img/jplayer.blue.monday.png") -29px -112px no-repeat;} -a.jp-next{left:88px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -141px no-repeat;width:28px;height:28px;} +a.jp-next{left:88px;top:.5em;background:url("../img/jplayer.blue.monday.png") 0 -141px no-repeat;width:2.3em;height:2.3em;} a.jp-next:hover{background:url("../img/jplayer.blue.monday.png") -29px -141px no-repeat;} -div.jp-progress{position:absolute;overflow:hidden;background-color:#293b51;top:1em;left:164px;width:122px;height:15px;} +div.jp-progress{position:absolute;overflow:hidden;background-color:#293b51;top:1em;left:10em;width:15em;height:1.2em;} div.jp-seek-bar{background:url("../img/jplayer.blue.monday.png") 0 -202px repeat-x;width:0;height:100%;cursor:pointer;} div.jp-play-bar{background:url("../img/jplayer.blue.monday.png") 0 -218px repeat-x;width:0;height:100%;} div.jp-seeking-bg{background:url("../img/pbar-ani.gif");} -a.jp-mute,a.jp-unmute{height:15px;width:18px;top:1em;left:296px;} +a.jp-mute,a.jp-unmute{height:1.2em;width:1.5em;top:1em;left:26em;} a.jp-mute{background:url("../img/jplayer.blue.monday.png") 0 -186px no-repeat;} a.jp-mute:hover{background:url("../img/jplayer.blue.monday.png") -19px -170px no-repeat;} a.jp-unmute{background:url("../img/jplayer.blue.monday.png") 0 -170px no-repeat;display:none;} a.jp-unmute:hover{background:url("../img/jplayer.blue.monday.png") -19px -186px no-repeat;} -div.jp-volume-bar{position:absolute;overflow:hidden;background:url("../img/jplayer.blue.monday.png") 0 -250px repeat-x;width:46px;height:5px;cursor:pointer;top:1.3em;left:324px;} -div.jp-volume-bar-value{background:url("../img/jplayer.blue.monday.png") 0 -256px repeat-x;width:0;height:5px;} -div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:1em;left:164px;width:122px;} +div.jp-volume-bar{position:absolute;overflow:hidden;background:url("../img/jplayer.blue.monday.png") 0 -250px repeat-x;width:4em;height:0.4em;cursor:pointer;top:1.3em;left:28em;} +div.jp-volume-bar-value{background:url("../img/jplayer.blue.monday.png") 0 -256px repeat-x;width:0;height:0.4em;} +div.jp-current-time,div.jp-duration{position:absolute;font-size:.64em;font-style:oblique;top:1em;left:16.8em;width:22em;} div.jp-duration{text-align:right;} diff --git a/apps/media/js/collection.js b/apps/media/js/collection.js index e49024973fa..8ef10951b6b 100644 --- a/apps/media/js/collection.js +++ b/apps/media/js/collection.js @@ -60,14 +60,18 @@ Collection={ tr.find('td.title a').text(song.song_name); tr.find('td.title a').click(function(event){ event.preventDefault(); - PlayList.add(song); - PlayList.render(); + PlayList.add(song,true); + PlayList.play(0); + Collection.parent.find('tr').removeClass('active'); + tr.addClass('active'); }); if(artist.artist_name!=lastArtist){ tr.find('td.artist a').click(function(event){ event.preventDefault(); - PlayList.add(artist); - PlayList.render(); + PlayList.add(artist,true); + PlayList.play(0); + Collection.parent.find('tr').removeClass('active'); + $('tr[data-artist="'+artist.artist_name+'"]').addClass('active'); }); tr.find('td.artist a').text(artist.artist_name); if(artist.albums.length>1){ @@ -87,8 +91,10 @@ Collection={ if(album.album_name!=lastAlbum){ tr.find('td.album a').click(function(event){ event.preventDefault(); - PlayList.add(album); - PlayList.render(); + PlayList.add(album,true); + PlayList.play(0); + Collection.parent.find('tr').removeClass('active'); + $('tr[data-album="'+album.album_name+'"]').addClass('active'); }); tr.find('td.album a').text(album.album_name); if(album.songs.length>1){ @@ -149,10 +155,11 @@ Collection={ Collection.parent.hide(); } }, - registerPlay:function(){ - var item=PlayList.items[PlayList.current]; - var song=Collection.findSong(item.artist,item.album,item.name); - song.song_playcount++; + registerPlay:function(item){ + if(item){ + var song=Collection.findSong(item.artist,item.album,item.name); + song.song_playcount++; + } }, addButtons:function(parent){ parent.children('button.add').click(function(){ diff --git a/apps/media/js/player.js b/apps/media/js/player.js index 8298db56e61..d37196a89f5 100644 --- a/apps/media/js/player.js +++ b/apps/media/js/player.js @@ -5,48 +5,53 @@ var PlayList={ player:null, volume:0.8, active:false, + tempPlaylist:[], + isTemp:true, next:function(){ + var items=(PlayList.isTemp)?PlayList.tempPlaylist:PlayList.items; var next=PlayList.current+1; - if(next>=PlayList.items.length){ + if(next>=items.length){ next=0; } PlayList.play(next); PlayList.render(); }, previous:function(){ + var items=(PlayList.isTemp)?PlayList.tempPlaylist:PlayList.items; var next=PlayList.current-1; if(next<0){ - next=PlayList.items.length-1; + next=items.length-1; } PlayList.play(next); PlayList.render(); }, play:function(index,time,ready){ + var items=(PlayList.isTemp)?PlayList.tempPlaylist:PlayList.items; if(index==null){ index=PlayList.current; } - if(index>-1 && index<PlayList.items.length){ + if(index>-1 && index<items.length){ PlayList.current=index; if(PlayList.player){ - if(PlayList.player.data('jPlayer').options.supplied!=PlayList.items[index].type){//the the audio type changes we need to reinitialize jplayer + if(PlayList.player.data('jPlayer').options.supplied!=items[index].type){//the the audio type changes we need to reinitialize jplayer PlayList.player.jPlayer("destroy"); - PlayList.init(PlayList.items[index].type,function(){PlayList.play(null,time,ready)}); + PlayList.init(items[index].type,function(){PlayList.play(null,time,ready)}); }else{ - PlayList.player.jPlayer("setMedia", PlayList.items[PlayList.current]); - PlayList.items[index].playcount++; + PlayList.player.jPlayer("setMedia", items[PlayList.current]); + items[index].playcount++; PlayList.player.jPlayer("play",time); if(index>0){ var previous=index-1; }else{ - var previous=PlayList.items.length-1; + var previous=items.length-1; } - if(index+1<PlayList.items.length){ + if(index+1<items.length){ var next=index+1; }else{ var next=0; } - $('.jp-next').attr('title',PlayList.items[next].name); - $('.jp-previous').attr('title',PlayList.items[previous].name); + $('.jp-next').attr('title',items[next].name); + $('.jp-previous').attr('title',items[previous].name); if (typeof Collection !== 'undefined') { Collection.registerPlay(); } @@ -55,7 +60,7 @@ var PlayList={ } } }else{ - PlayList.init(PlayList.items[index].type,PlayList.play); + PlayList.init(items[index].type,PlayList.play); } } }, @@ -95,28 +100,37 @@ var PlayList={ swfPath:OC.linkTo('media','js'), }); }, - add:function(song){ + add:function(song,temp,dontReset){ + if(!dontReset){ + PlayList.tempPlaylist=[];//clear the temp playlist + } + PlayList.isTemp=temp; + PlayList.isTemp=true; if(!song){ return; } if(song.substr){//we are passed a string, asume it's a url to a song - PlayList.addFile(song); + PlayList.addFile(song,temp,true); } if(song.albums){//a artist object was passed, add all albums inside it $.each(song.albums,function(index,album){ - PlayList.add(album); + PlayList.add(album,temp,true); }); } if(song.songs){//a album object was passed, add all songs inside it $.each(song.songs,function(index,song){ - PlayList.add(song); + PlayList.add(song,temp,true); }); } if(song.song_name){ var type=musicTypeFromFile(song.song_path); var item={name:song.song_name,type:type,artist:song.artist_name,album:song.album_name,length:song.song_length,playcount:song.song_playcount}; item[type]=PlayList.urlBase+encodeURIComponent(song.song_path); - PlayList.items.push(item); + if(PlayList.isTemp){ + PlayList.tempPlaylist.push(item); + }else{ + PlayList.items.push(item); + } } }, addFile:function(path){ |