diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/js/filelist.js | 10 | ||||
-rw-r--r-- | apps/files/js/files.js | 9 | ||||
-rw-r--r-- | apps/files/lib/helper.php | 14 |
3 files changed, 20 insertions, 13 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index a855d6cbe59..b2de0161aa8 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -129,7 +129,7 @@ window.FileList={ if (loading) { imgurl = OC.imagePath('core', 'loading.gif'); } else { - imgurl = OC.imagePath('core', 'filetypes/file.png'); + imgurl = OC.imagePath('core', 'filetypes/file'); } var tr = this.createRow( 'file', @@ -157,7 +157,7 @@ window.FileList={ var tr = this.createRow( 'dir', name, - OC.imagePath('core', 'filetypes/folder.png'), + OC.imagePath('core', 'filetypes/folder'), OC.linkTo('files', 'index.php')+"?dir="+ encodeURIComponent($('#dir').val()+'/'+name).replace(/%2F/g, '/'), size, lastModified, @@ -907,7 +907,7 @@ $(document).ready(function() { uploadtext.attr('currentUploads', currentUploads); var translatedText = n('files', 'Uploading %n file', 'Uploading %n files', currentUploads); if (currentUploads === 0) { - var img = OC.imagePath('core', 'filetypes/folder.png'); + var img = OC.imagePath('core', 'filetypes/folder'); data.context.find('td.filename').attr('style','background-image:url('+img+')'); uploadtext.text(translatedText); uploadtext.hide(); @@ -967,7 +967,7 @@ $(document).ready(function() { if (data.errorThrown === 'abort') { //cleanup uploading to a dir var uploadtext = $('tr .uploadtext'); - var img = OC.imagePath('core', 'filetypes/folder.png'); + var img = OC.imagePath('core', 'filetypes/folder'); uploadtext.parents('td.filename').attr('style','background-image:url('+img+')'); uploadtext.fadeOut(); uploadtext.attr('currentUploads', 0); @@ -980,7 +980,7 @@ $(document).ready(function() { if (data.errorThrown === 'abort') { //cleanup uploading to a dir var uploadtext = $('tr .uploadtext'); - var img = OC.imagePath('core', 'filetypes/folder.png'); + var img = OC.imagePath('core', 'filetypes/folder'); uploadtext.parents('td.filename').attr('style','background-image:url('+img+')'); uploadtext.fadeOut(); uploadtext.attr('currentUploads', 0); diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 1ec4c4ec7ab..dab060229e6 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -731,6 +731,9 @@ Files.getMimeIcon = function(mime, ready) { ready(Files.getMimeIcon.cache[mime]); } else { $.get( OC.filePath('files','ajax','mimeicon.php'), {mime: mime}, function(path) { + if(SVGSupport()){ + path = path.substr(0, path.length-4) + '.svg'; + } Files.getMimeIcon.cache[mime]=path; ready(Files.getMimeIcon.cache[mime]); }); @@ -785,8 +788,10 @@ Files.lazyLoadPreview = function(path, mime, ready, width, height, etag) { // this will make the browser cache the image var img = new Image(); img.onload = function(){ - //set preview thumbnail URL - ready(previewURL); + // if loading the preview image failed (no preview for the mimetype) then img.width will < 5 + if (img.width > 5) { + ready(previewURL); + } } img.src = previewURL; }); diff --git a/apps/files/lib/helper.php b/apps/files/lib/helper.php index ac8a2ad3200..fec1297b180 100644 --- a/apps/files/lib/helper.php +++ b/apps/files/lib/helper.php @@ -36,14 +36,16 @@ class Helper } } } - return \OC_Helper::mimetypeIcon('dir'); + $icon = \OC_Helper::mimetypeIcon('dir'); + }else{ + if($file['isPreviewAvailable']) { + $pathForPreview = $file['directory'] . '/' . $file['name']; + return \OC_Helper::previewIcon($pathForPreview) . '&c=' . $file['etag']; + } + $icon = \OC_Helper::mimetypeIcon($file['mimetype']); } - if($file['isPreviewAvailable']) { - $pathForPreview = $file['directory'] . '/' . $file['name']; - return \OC_Helper::previewIcon($pathForPreview) . '&c=' . $file['etag']; - } - return \OC_Helper::mimetypeIcon($file['mimetype']); + return substr($icon, 0, -3) . 'svg'; } /** |