[Pkg-owncloud-commits] [owncloud] 10/123: Enable file icons & previews in "Shared ..." categories

David Prévot taffit at moszumanska.debian.org
Tue May 19 23:55:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit b1713b2f75370d6c597c2a2a16ab51431802ade2
Author: Morris Jobke <hey at morrisjobke.de>
Date:   Wed May 6 18:32:52 2015 +0200

    Enable file icons & previews in "Shared ..." categories
    
    * sharing API returns now the mimetype icon path
    * file previews are now lazyloaded by default (as the doc says)
    * fixes #16086
---
 apps/files/js/filelist.js               | 3 ++-
 apps/files_sharing/api/local.php        | 1 +
 apps/files_sharing/js/sharedfilelist.js | 1 +
 3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 0181aca..e88ea1a 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -950,7 +950,8 @@
 			if (fileData.isPreviewAvailable) {
 				var iconDiv = filenameTd.find('.thumbnail');
 				// lazy load / newly inserted td ?
-				if (options.animate) {
+				// the typeof check ensures that the default value of animate is true
+				if (typeof(options.animate) === 'undefined' || !!options.animate) {
 					this.lazyLoadPreview({
 						path: path + '/' + fileData.name,
 						mime: mime,
diff --git a/apps/files_sharing/api/local.php b/apps/files_sharing/api/local.php
index 00509bc..0381280 100644
--- a/apps/files_sharing/api/local.php
+++ b/apps/files_sharing/api/local.php
@@ -68,6 +68,7 @@ class Local {
 					if (\OC::$server->getPreviewManager()->isMimeSupported($share['mimetype'])) {
 						$share['isPreviewAvailable'] = true;
 					}
+					$share['icon'] = substr(\OC_Helper::mimetypeIcon($share['mimetype']), 0, -3) . 'svg';
 				}
 			}
 			return new \OC_OCS_Result($shares);
diff --git a/apps/files_sharing/js/sharedfilelist.js b/apps/files_sharing/js/sharedfilelist.js
index 2c7d6c7..ca18794 100644
--- a/apps/files_sharing/js/sharedfilelist.js
+++ b/apps/files_sharing/js/sharedfilelist.js
@@ -176,6 +176,7 @@
 				.map(function(share) {
 					var file = {
 						id: share.file_source,
+						icon: share.icon,
 						mimetype: share.mimetype
 					};
 					if (share.item_type === 'folder') {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list