diff options
author | Robin Appelman <robin@icewind.nl> | 2016-07-26 13:40:44 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-07-27 12:59:43 +0200 |
commit | 03c17ff614ba9cd022a7c855b63516adfb6f5055 (patch) | |
tree | 47e0aada21835ad51469e88d14a06943020fda70 /core/js | |
parent | 1fef5d3d06752f1a2a686681ae81fd13d88e535a (diff) | |
download | nextcloud-server-03c17ff614ba9cd022a7c855b63516adfb6f5055.tar.gz nextcloud-server-03c17ff614ba9cd022a7c855b63516adfb6f5055.zip |
dont load filelist previews if we know we dont have one
Diffstat (limited to 'core/js')
-rw-r--r-- | core/js/files/client.js | 17 | ||||
-rw-r--r-- | core/js/files/fileinfo.js | 7 |
2 files changed, 21 insertions, 3 deletions
diff --git a/core/js/files/client.js b/core/js/files/client.js index 0bf5a69e19c..a195258afbb 100644 --- a/core/js/files/client.js +++ b/core/js/files/client.js @@ -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 = [ /** @@ -95,7 +97,11 @@ /** * File sizes */ - [Client.NS_DAV, 'getcontentlength'] + [Client.NS_DAV, 'getcontentlength'], + /** + * Preview availability + */ + [Client.NS_NEXTCLOUD, 'has-preview'] ]; /** @@ -274,6 +280,13 @@ 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; diff --git a/core/js/files/fileinfo.js b/core/js/files/fileinfo.js index 3bf68d88b15..1fc239da47a 100644 --- a/core/js/files/fileinfo.js +++ b/core/js/files/fileinfo.js @@ -127,7 +127,12 @@ * * @type string */ - mountType: null + mountType: null, + + /** + * @type boolean + */ + hasPreview: true }; if (!OC.Files) { |