]> source.dussan.org Git - nextcloud-server.git/commitdiff
dont load filelist previews if we know we dont have one
authorRobin Appelman <robin@icewind.nl>
Tue, 26 Jul 2016 11:40:44 +0000 (13:40 +0200)
committerRobin Appelman <robin@icewind.nl>
Wed, 27 Jul 2016 10:59:43 +0000 (12:59 +0200)
apps/files/js/filelist.js
core/js/files/client.js
core/js/files/fileinfo.js

index 24cccb3a5c8f34b04aef2def4510d0410776528d..6ac72d8c169cc49bdec24de45dafa847c5ec201d 100644 (file)
                        // display actions
                        this.fileActions.display(filenameTd, !options.silent, this);
 
-                       if (mime !== 'httpd/unix-directory') {
+                       if (mime !== 'httpd/unix-directory' && fileData.hasPreview !== false) {
                                var iconDiv = filenameTd.find('.thumbnail');
                                // lazy load / newly inserted td ?
                                // the typeof check ensures that the default value of animate is true
index 0bf5a69e19c99016c3358f60c71a80d095a423fb..a195258afbba46d7ce620a1cb02d9bfacddfae6c 100644 (file)
@@ -47,7 +47,8 @@
                        baseUrl: this._baseUrl,
                        xmlNamespaces: {
                                'DAV:': 'd',
-                               'http://owncloud.org/ns': 'oc'
+                               'http://owncloud.org/ns': 'oc',
+                               'http://nextcloud.org/ns': 'nc'
                        }
                };
                if (options.userName) {
@@ -61,6 +62,7 @@
        };
 
        Client.NS_OWNCLOUD = 'http://owncloud.org/ns';
+       Client.NS_NEXTCLOUD = 'http://nextcloud.org/ns';
        Client.NS_DAV = 'DAV:';
        Client._PROPFIND_PROPERTIES = [
                /**
                /**
                 * File sizes
                 */
-               [Client.NS_DAV, 'getcontentlength']
+               [Client.NS_DAV, 'getcontentlength'],
+               /**
+                * Preview availability
+                */
+               [Client.NS_NEXTCLOUD, 'has-preview']
        ];
 
        /**
                                data.size = parseInt(sizeProp, 10);
                        }
 
+                       var hasPreviewProp = props['{' + Client.NS_NEXTCLOUD + '}has-preview'];
+                       if (!_.isUndefined(hasPreviewProp)) {
+                               data.hasPreview = hasPreviewProp === 'true';
+                       } else {
+                               data.hasPreview = true;
+                       }
+
                        var contentType = props['{' + Client.NS_DAV + '}getcontenttype'];
                        if (!_.isUndefined(contentType)) {
                                data.mimetype = contentType;
index 3bf68d88b15c2cdbae1a8e19cc6b4bc08dce9a67..1fc239da47aec566136ddf925e5b5fec2185bdb4 100644 (file)
                 *
                 * @type string
                 */
-               mountType: null
+               mountType: null,
+
+               /**
+                * @type boolean
+                */
+               hasPreview: true
        };
 
        if (!OC.Files) {