diff options
author | Jörn Friedrich Dreyer <jfd@butonic.de> | 2014-12-19 00:24:46 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2015-01-02 10:28:41 +0100 |
commit | a6204efa0d1422a6840372db2caed677a5c1c80d (patch) | |
tree | c3a4bed4b2c53ca954d1b16172d8aed4713fb8b4 /apps/files | |
parent | b93f2ddcb577a262d170163f4bc7117b70ffa3f7 (diff) | |
download | nextcloud-server-a6204efa0d1422a6840372db2caed677a5c1c80d.tar.gz nextcloud-server-a6204efa0d1422a6840372db2caed677a5c1c80d.zip |
show audio icon & image previews
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/js/search.js | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/apps/files/js/search.js b/apps/files/js/search.js index 1f155b0e9b7..cd66bca4986 100644 --- a/apps/files/js/search.js +++ b/apps/files/js/search.js @@ -34,12 +34,7 @@ } /*render folder icon, show path beneath filename, show size and last modified date on the right */ - // backward compatibility: - if (typeof result.mime !== 'undefined') { - result.mime_type = result.mime; - } else if (typeof result.mime_type !== 'undefined') { - result.mime = result.mime_type; - } + OCA.Files.Search.updateLegacyMimetype(result); var $pathDiv = $('<div class="path"></div>').text(result.path); $row.find('td.info div.name').after($pathDiv).text(result.name); @@ -54,12 +49,7 @@ } /*render preview icon, show path beneath filename, show size and last modified date on the right */ - // backward compatibility: - if (typeof result.mime !== 'undefined') { - result.mime_type = result.mime; - } else if (typeof result.mime_type !== 'undefined') { - result.mime = result.mime_type; - } + OCA.Files.Search.updateLegacyMimetype(result); $pathDiv = $('<div class="path"></div>').text(result.path); $row.find('td.info div.name').after($pathDiv).text(result.name); @@ -89,21 +79,23 @@ return $row; }, renderAudioResult: function($row, result) { - if (OCA.Files.Search.inFileList($row, result)) { - return null; - } /*render preview icon, show path beneath filename, show size and last modified date on the right show Artist and Album */ + $row = OCA.Files.Search.renderFileResult($row, result); + if ($row) { + $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/audio') + ')'); + } return $row; }, renderImageResult: function($row, result) { - if (OCA.Files.Search.inFileList($row, result)) { - return null; - } /*render preview icon, show path beneath filename, show size and last modified date on the right show width and height */ + $row = OCA.Files.Search.renderFileResult($row, result); + if ($row && !OCA.Files.Search.fileAppLoaded()) { + $row.find('td.icon').css('background-image', 'url(' + OC.imagePath('core', 'filetypes/image') + ')'); + } return $row; }, inFileList: function($row, result){ @@ -113,6 +105,12 @@ return false; } }, + updateLegacyMimetype: function(result){ + // backward compatibility: + if (!result.mime && result.mime_type) { + result.mime = result.mime_type; + } + }, handleFolderClick: function($row, result, event) { // open folder if (OCA.Files.Search.fileAppLoaded()) { |