summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2011-07-29 01:36:31 +0200
committerRobin Appelman <icewind1991@gmail.com>2011-07-29 01:37:08 +0200
commit6d0c8ea7e4c15e2a4072e0951eac3c0f64b2fbdc (patch)
tree5d412befba3f056821ce74ef0b4293b0b4fc8b3d /files
parentdbcebba8826be76eca141a28c29b4dd8d051291f (diff)
downloadnextcloud-server-6d0c8ea7e4c15e2a4072e0951eac3c0f64b2fbdc.tar.gz
nextcloud-server-6d0c8ea7e4c15e2a4072e0951eac3c0f64b2fbdc.zip
use proper file icons for image and audio files
Diffstat (limited to 'files')
-rw-r--r--files/js/filelist.js3
-rw-r--r--files/js/files.js9
2 files changed, 11 insertions, 1 deletions
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 252a9c95807..a53ad672e42 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -96,7 +96,8 @@ FileList={
},
loadingDone:function(name){
$('tr[data-file="'+name+'"]').data('loading',false);
- $('tr[data-file="'+name+'"] td.filename a').attr('style','background-image:url(img/file.png');
+ var mime=$('tr[data-file="'+name+'"]').data('mime');
+ $('tr[data-file="'+name+'"] td.filename a').attr('style','background-image:url('+getMimeIcon(mime)+')');
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
},
isLoading:function(name){
diff --git a/files/js/files.js b/files/js/files.js
index 60f2b2aec87..193c740b6c5 100644
--- a/files/js/files.js
+++ b/files/js/files.js
@@ -437,3 +437,12 @@ function relative_modified_date(timestamp) {
else if(timediff < 63113852) { return 'last year'; }
else { return diffyears+' years ago'; }
}
+
+function getMimeIcon(mime){
+ mime=mime.substr(0,mime.indexOf('/'));
+ var knownMimes=['image','audio'];
+ if(knownMimes.indexOf(mime)==-1){
+ mime='file';
+ }
+ return OC.imagePath('core','mimetypes/'+mime+'.png');
+} \ No newline at end of file