diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-10-08 21:18:47 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-10-13 16:33:39 +0200 |
commit | d7fa2a0f7770acb36c49ea60348bb583e53b04e7 (patch) | |
tree | 8bbbc87c3b5c03944ed7605543ebcb796d96f274 /files/js/files.js | |
parent | 8da00e2d9aef5b77832a8d05a87c6b7cfbc5940a (diff) | |
download | nextcloud-server-d7fa2a0f7770acb36c49ea60348bb583e53b04e7.tar.gz nextcloud-server-d7fa2a0f7770acb36c49ea60348bb583e53b04e7.zip |
mimetype icon improvements
Diffstat (limited to 'files/js/files.js')
-rw-r--r-- | files/js/files.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/files/js/files.js b/files/js/files.js index 9342642b4ff..079646070d4 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -473,11 +473,14 @@ function relative_modified_date(timestamp) { else { return diffyears+' '+t('files','years ago'); } } -function getMimeIcon(mime){ - mime=mime.substr(0,mime.indexOf('/')); - var knownMimes=['image','audio']; - if(knownMimes.indexOf(mime)==-1){ - mime='file'; +function getMimeIcon(mime, ready){ + if(getMimeIcon.cache[mime]){ + ready(getMimeIcon.cache[mime]); + }else{ + $.get( OC.filePath('files','ajax','mimeicon.php')+'?mime='+mime, function(path){ + getMimeIcon.cache[mime]=path; + ready(getMimeIcon.cache[mime]); + }); } - return OC.imagePath('core','filetypes/'+mime); } +getMimeIcon.cache={}; |