summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/filelist.js2
-rw-r--r--core/js/files/client.js17
-rw-r--r--core/js/files/fileinfo.js7
3 files changed, 22 insertions, 4 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 24cccb3a5c8..6ac72d8c169 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -1335,7 +1335,7 @@
// 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
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) {