summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorMichael Jobst <mjobst+github@tecratech.de>2016-11-21 15:03:45 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2016-12-23 16:56:55 +0100
commit969c19b2e926331e2686208507c2643107caf5a1 (patch)
treec0c03ac7bbcdc7760e97e35ddacef8919ed527e6 /apps/files_sharing
parent56c016946d0695a62e418839cf19786a223b4ae7 (diff)
downloadnextcloud-server-969c19b2e926331e2686208507c2643107caf5a1.tar.gz
nextcloud-server-969c19b2e926331e2686208507c2643107caf5a1.zip
Fixed size issues on main detail view and disappearing of share recipients (#26603)
* fixed size issues on main detail view and disappearing of share recipients * Changes due to code comments * Moved reloadProperties() to FileInfoModel * Solved Scrutinizer issues * Bugfix: undefined value used on error * check if options are set for FileInfoModel.initialize() Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/js/share.js28
1 files changed, 20 insertions, 8 deletions
diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js
index 01c2ccfb863..fcae7bc9a58 100644
--- a/apps/files_sharing/js/share.js
+++ b/apps/files_sharing/js/share.js
@@ -9,6 +9,12 @@
*/
(function() {
+
+ _.extend(OC.Files.Client, {
+ PROPERTY_SHARE_TYPES: '{' + OC.Files.Client.NS_OWNCLOUD + '}share-types',
+ PROPERTY_OWNER_DISPLAY_NAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}owner-display-name'
+ });
+
if (!OCA.Sharing) {
OCA.Sharing = {};
}
@@ -65,32 +71,38 @@
fileInfo.shareTypes = shareTypes;
}
+ if( $el.attr('data-expiration')){
+ var expirationTimestamp = parseInt($el.attr('data-expiration'));
+ fileInfo.shares = [];
+ fileInfo.shares.push({expiration: expirationTimestamp});
+ }
+
+ fileInfo.recipientsDisplayName = $el.attr('data-share-recipients') || undefined;
+
return fileInfo;
};
- var NS_OC = 'http://owncloud.org/ns';
-
var oldGetWebdavProperties = fileList._getWebdavProperties;
fileList._getWebdavProperties = function() {
var props = oldGetWebdavProperties.apply(this, arguments);
- props.push('{' + NS_OC + '}owner-display-name');
- props.push('{' + NS_OC + '}share-types');
+ props.push(OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME);
+ props.push(OC.Files.Client.PROPERTY_SHARE_TYPES);
return props;
};
fileList.filesClient.addFileInfoParser(function(response) {
var data = {};
var props = response.propStat[0].properties;
- var permissionsProp = props['{' + NS_OC + '}permissions'];
+ var permissionsProp = props[OC.Files.Client.PROPERTY_PERMISSIONS];
if (permissionsProp && permissionsProp.indexOf('S') >= 0) {
- data.shareOwner = props['{' + NS_OC + '}owner-display-name'];
+ data.shareOwner = props[OC.Files.Client.PROPERTY_OWNER_DISPLAY_NAME];
}
- var shareTypesProp = props['{' + NS_OC + '}share-types'];
+ var shareTypesProp = props[OC.Files.Client.PROPERTY_SHARE_TYPES];
if (shareTypesProp) {
data.shareTypes = _.chain(shareTypesProp).filter(function(xmlvalue) {
- return (xmlvalue.namespaceURI === NS_OC && xmlvalue.nodeName.split(':')[1] === 'share-type');
+ return (xmlvalue.namespaceURI === OC.Files.Client.NS_OWNCLOUD && xmlvalue.nodeName.split(':')[1] === 'share-type');
}).map(function(xmlvalue) {
return parseInt(xmlvalue.textContent || xmlvalue.text, 10);
}).value();