summaryrefslogtreecommitdiffstats
path: root/apps/comments
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/comments
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/comments')
-rw-r--r--apps/comments/js/commentmodel.js33
-rw-r--r--apps/comments/js/commentsummarymodel.js11
-rw-r--r--apps/comments/js/filesplugin.js11
3 files changed, 36 insertions, 19 deletions
diff --git a/apps/comments/js/commentmodel.js b/apps/comments/js/commentmodel.js
index e75c79b3f08..a594753cd45 100644
--- a/apps/comments/js/commentmodel.js
+++ b/apps/comments/js/commentmodel.js
@@ -9,7 +9,19 @@
*/
(function(OC, OCA) {
- var NS_OWNCLOUD = 'http://owncloud.org/ns';
+
+ _.extend(OC.Files.Client, {
+ PROPERTY_FILEID: '{' + OC.Files.Client.NS_OWNCLOUD + '}id',
+ PROPERTY_MESSAGE: '{' + OC.Files.Client.NS_OWNCLOUD + '}message',
+ PROPERTY_ACTORTYPE: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorType',
+ PROPERTY_ACTORID: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorId',
+ PROPERTY_ISUNREAD: '{' + OC.Files.Client.NS_OWNCLOUD + '}isUnread',
+ PROPERTY_OBJECTID: '{' + OC.Files.Client.NS_OWNCLOUD + '}objectId',
+ PROPERTY_OBJECTTYPE: '{' + OC.Files.Client.NS_OWNCLOUD + '}objectType',
+ PROPERTY_ACTORDISPLAYNAME: '{' + OC.Files.Client.NS_OWNCLOUD + '}actorDisplayName',
+ PROPERTY_CREATIONDATETIME: '{' + OC.Files.Client.NS_OWNCLOUD + '}creationDateTime'
+ });
+
/**
* @class OCA.Comments.CommentModel
* @classdesc
@@ -27,15 +39,15 @@
},
davProperties: {
- 'id': '{' + NS_OWNCLOUD + '}id',
- 'message': '{' + NS_OWNCLOUD + '}message',
- 'actorType': '{' + NS_OWNCLOUD + '}actorType',
- 'actorId': '{' + NS_OWNCLOUD + '}actorId',
- 'actorDisplayName': '{' + NS_OWNCLOUD + '}actorDisplayName',
- 'creationDateTime': '{' + NS_OWNCLOUD + '}creationDateTime',
- 'objectType': '{' + NS_OWNCLOUD + '}objectType',
- 'objectId': '{' + NS_OWNCLOUD + '}objectId',
- 'isUnread': '{' + NS_OWNCLOUD + '}isUnread',
+ 'id': OC.Files.Client.PROPERTY_FILEID,
+ 'message': OC.Files.Client.PROPERTY_MESSAGE,
+ 'actorType': OC.Files.Client.PROPERTY_ACTORTYPE,
+ 'actorId': OC.Files.Client.PROPERTY_ACTORID,
+ 'actorDisplayName': OC.Files.Client.PROPERTY_ACTORDISPLAYNAME,
+ 'creationDateTime': OC.Files.Client.PROPERTY_CREATIONDATETIME,
+ 'objectType': OC.Files.Client.PROPERTY_OBJECTTYPE,
+ 'objectId': OC.Files.Client.PROPERTY_OBJECTID,
+ 'isUnread': OC.Files.Client.PROPERTY_ISUNREAD
'mentions': '{' + NS_OWNCLOUD + '}mentions'
},
@@ -78,4 +90,3 @@
OCA.Comments.CommentModel = CommentModel;
})(OC, OCA);
-
diff --git a/apps/comments/js/commentsummarymodel.js b/apps/comments/js/commentsummarymodel.js
index d405315ca1f..ffabbc30fb4 100644
--- a/apps/comments/js/commentsummarymodel.js
+++ b/apps/comments/js/commentsummarymodel.js
@@ -9,13 +9,17 @@
*/
(function(OC, OCA) {
- var NS_OWNCLOUD = 'http://owncloud.org/ns';
+
+ _.extend(OC.Files.Client, {
+ PROPERTY_READMARKER: '{' + OC.Files.Client.NS_OWNCLOUD + '}readMarker'
+ });
+
/**
* @class OCA.Comments.CommentSummaryModel
* @classdesc
*
* Model containing summary information related to comments
- * like the read marker.
+ * like the read marker.
*
*/
var CommentSummaryModel = OC.Backbone.Model.extend(
@@ -37,7 +41,7 @@
_objectId: null,
davProperties: {
- 'readMarker': '{' + NS_OWNCLOUD + '}readMarker'
+ 'readMarker': OC.Files.Client.PROPERTY_READMARKER
},
/**
@@ -62,4 +66,3 @@
OCA.Comments.CommentSummaryModel = CommentSummaryModel;
})(OC, OCA);
-
diff --git a/apps/comments/js/filesplugin.js b/apps/comments/js/filesplugin.js
index cc419c18ddb..8c5762065a1 100644
--- a/apps/comments/js/filesplugin.js
+++ b/apps/comments/js/filesplugin.js
@@ -11,6 +11,11 @@
/* global Handlebars */
(function() {
+
+ _.extend(OC.Files.Client, {
+ PROPERTY_COMMENTS_UNREAD: '{' + OC.Files.Client.NS_OWNCLOUD + '}comments-unread'
+ });
+
var TEMPLATE_COMMENTS_UNREAD =
'<a class="action action-comment permanent" title="{{countMessage}}" href="#">' +
'<img class="svg" src="{{iconUrl}}"/>' +
@@ -52,19 +57,17 @@
fileList.registerTabView(new OCA.Comments.CommentsTabView('commentsTabView'));
- var NS_OC = 'http://owncloud.org/ns';
-
var oldGetWebdavProperties = fileList._getWebdavProperties;
fileList._getWebdavProperties = function() {
var props = oldGetWebdavProperties.apply(this, arguments);
- props.push('{' + NS_OC + '}comments-unread');
+ props.push(OC.Files.Client.PROPERTY_COMMENTS_UNREAD);
return props;
};
fileList.filesClient.addFileInfoParser(function(response) {
var data = {};
var props = response.propStat[0].properties;
- var commentsUnread = props['{' + NS_OC + '}comments-unread'];
+ var commentsUnread = props[OC.Files.Client.PROPERTY_COMMENTS_UNREAD];
if (!_.isUndefined(commentsUnread) && commentsUnread !== '') {
data.commentsUnread = parseInt(commentsUnread, 10);
}