aboutsummaryrefslogtreecommitdiffstats
path: root/apps/media
diff options
context:
space:
mode:
authorMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2012-02-21 22:31:35 +0100
committerMarvin Thomas Rabe <m.rabe@echtzeitraum.de>2012-02-22 16:04:31 +0100
commitb3f3b8c23f4f07a4d38e952f4d77827380c34b58 (patch)
tree1421c859aa88595d8ac317790e2d81106822d6e1 /apps/media
parentc5c843bfefb9e678b65bf30c42082676db07bc3c (diff)
downloadnextcloud-server-b3f3b8c23f4f07a4d38e952f4d77827380c34b58.tar.gz
nextcloud-server-b3f3b8c23f4f07a4d38e952f4d77827380c34b58.zip
UI problems solved. Bookmarks app updated.
Diffstat (limited to 'apps/media')
-rw-r--r--apps/media/js/collection.js24
-rw-r--r--apps/media/js/loader.js4
-rw-r--r--apps/media/js/music.js12
-rw-r--r--apps/media/js/playlist.js8
-rw-r--r--apps/media/js/scanner.js8
5 files changed, 28 insertions, 28 deletions
diff --git a/apps/media/js/collection.js b/apps/media/js/collection.js
index 2249acf3cc4..753785f77b0 100644
--- a/apps/media/js/collection.js
+++ b/apps/media/js/collection.js
@@ -1,3 +1,5 @@
+var initScanned = false;
+
Collection={
artists:[],
albums:[],
@@ -68,10 +70,10 @@ Collection={
for(var i=0;i<Collection.loadedListeners.length;i++){
Collection.loadedListeners[i]();
}
- if(data.songs.length==0){
+ if(data.songs.length==0 && initScanned == false){
$('#scan input.start').click();
+ initScanned = true;
}
-
}
});
}
@@ -81,13 +83,11 @@ Collection={
Collection.parent.show();
}
if(!Collection.loaded){
- Collection.load(Collection.display)
+ Collection.load(Collection.display);
}else{
if(Collection.parent){
Collection.parent.find('tr:not(.template)').remove();
var template=Collection.parent.find('tr.template');
- var lastArtist='';
- var lastAlbum='';
$.each(Collection.artists,function(i,artist){
if(artist.name && artist.songs.length>0){
var tr=template.clone().removeClass('template');
@@ -108,7 +108,7 @@ Collection={
$('tr[data-artist="'+artist.name+'"]').addClass('active');
});
if(artist.songs.length>1){
- var expander=$('<a class="expander">&gt;</a>');
+ expander=$('<a class="expander">&gt;</a>');
expander.data('expanded',false);
expander.click(function(event){
var tr=$(this).parent().parent();
@@ -136,10 +136,11 @@ Collection={
var first=true;
$.each(artist.albums,function(j,album){
$.each(album.songs,function(i,song){
+ var newRow;
if(first){
newRow=tr;
}else{
- var newRow=tr.clone();
+ newRow=tr.clone();
newRow.find('td.artist').text('');
newRow.find('.expander').remove();
}
@@ -221,13 +222,14 @@ Collection={
tr.find('td.album-expander a.expander').addClass('expanded');
tr.find('td.album-expander a.expander').text('v');
$.each(albumData.songs,function(i,song){
+ var newRow;
if(i>0){
- var newRow=tr.clone();
+ newRow=tr.clone();
newRow.find('a.expander').remove();
newRow.find('td.album a').text('');
newRow.find('td.artist a').text('');
}else{
- var newRow=tr;
+ newRow=tr;
}
newRow.find('td.title a').text(song.name);
newRow.find('td.title a').click(function(event){
@@ -339,11 +341,11 @@ Collection={
path:song.song_path,
playCount:song.song_playcount,
};
- album.songs.push(songData)
+ album.songs.push(songData);
artist.songs.push(songData);
Collection.songs.push(songData);
}
-}
+};
$(document).ready(function(){
Collection.parent=$('#collection');
diff --git a/apps/media/js/loader.js b/apps/media/js/loader.js
index 055f858ae16..a832180d1e3 100644
--- a/apps/media/js/loader.js
+++ b/apps/media/js/loader.js
@@ -1,7 +1,7 @@
function musicTypeFromFile(file){
var extention=file.substr(file.indexOf('.')+1);
if(extention=='ogg'){
- return 'oga'
+ return 'oga';
}
//TODO check for more specific cases
return extention;
@@ -39,7 +39,7 @@ function loadPlayer(type,ready){
}
$(document).ready(function() {
- loadPlayer.done=false
+ loadPlayer.done=false;
// FileActions.register('audio','Add to playlist','',addAudio);
// FileActions.register('application/ogg','Add to playlist','',addAudio);
diff --git a/apps/media/js/music.js b/apps/media/js/music.js
index 3373cbac257..1ffe4e10087 100644
--- a/apps/media/js/music.js
+++ b/apps/media/js/music.js
@@ -16,7 +16,7 @@ $(document).ready(function(){
PlayList.render();
});
var button=$('<input type="button" title="'+t('media','Add album to playlist')+'" class="add"></input>');
- button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')')
+ button.css('background-image','url('+OC.imagePath('core','actions/play-add')+')');
button.click(function(event){
event.stopPropagation();
PlayList.add(media);
@@ -24,7 +24,7 @@ $(document).ready(function(){
});
row.find('div.name').append(button);
button.tipsy({gravity:'n', fade:true, delayIn: 400, live:true});
- }
+ };
Collection.display();
Collection.load(function(){
@@ -34,11 +34,9 @@ $(document).ready(function(){
PlayList.add(song);
PlayList.play(0);
}
- })
+ });
});
-
-
function getUrlVars(){
var vars = {}, hash;
var hashes = window.location.hash.substr(1).split('&');
@@ -52,8 +50,8 @@ function getUrlVars(){
function musicTypeFromFile(file){
var extention=file.split('.').pop();
if(extention=='ogg'){
- return 'oga'
+ return 'oga';
}
//TODO check for more specific cases
return extention;
-} \ No newline at end of file
+}
diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js
index 089065989ae..8e9e2a91537 100644
--- a/apps/media/js/playlist.js
+++ b/apps/media/js/playlist.js
@@ -26,19 +26,19 @@ PlayList.render=function(){
li.click(function(event){
PlayList.play($(this).data('index'));
});
- li.append(img)
+ li.append(img);
li.data('index',i);
li.addClass('song');
PlayList.parent.append(li);
}
$(".jp-playlist-" + PlayList.current).addClass("collection_playing");
-}
+};
PlayList.getSelected=function(){
return $('tbody td.name input:checkbox:checked').parent().parent();
-}
+};
PlayList.hide=function(){
$('#playlist').hide();
-}
+};
$(document).ready(function(){
PlayList.parent=$('#leftcontent');
diff --git a/apps/media/js/scanner.js b/apps/media/js/scanner.js
index 0baa9db419a..6c991b60d52 100644
--- a/apps/media/js/scanner.js
+++ b/apps/media/js/scanner.js
@@ -6,7 +6,7 @@ Scanner={
$.getJSON(OC.linkTo('media','ajax/api.php')+'?action=find_music',function(songs){
Scanner.songsFound=songs.length;
if(ready){
- ready(songs)
+ ready(songs);
}
});
},
@@ -24,13 +24,13 @@ Scanner={
Scanner.songsScanned=data.count;
$('#scan span.songCount').text(Scanner.songsScanned);
var progress=(Scanner.songsScanned/Scanner.songsFound)*100;
- $('#scanprogressbar').progressbar('value',progress)
+ $('#scanprogressbar').progressbar('value',progress);
});
Scanner.eventSource.listen('done',function(count){
$('#scan input.start').show();
$('#scan input.stop').hide();
$('#scanprogressbar').hide();
- Collection.load(Collection.display)
+ Collection.load(Collection.display);
if(ready){
ready();
}
@@ -41,4 +41,4 @@ Scanner={
Scanner.close();
},
-}
+};