2016-02-03 15:18:14 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016
|
|
|
|
*
|
|
|
|
* This file is licensed under the Affero General Public License version 3
|
|
|
|
* or later.
|
|
|
|
*
|
|
|
|
* See the COPYING-README file.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
(function(OC, OCA) {
|
2016-11-21 14:03:45 +00:00
|
|
|
|
|
|
|
_.extend(OC.Files.Client, {
|
|
|
|
PROPERTY_READMARKER: '{' + OC.Files.Client.NS_OWNCLOUD + '}readMarker'
|
|
|
|
});
|
|
|
|
|
2016-02-03 15:18:14 +00:00
|
|
|
/**
|
|
|
|
* @class OCA.Comments.CommentSummaryModel
|
|
|
|
* @classdesc
|
|
|
|
*
|
|
|
|
* Model containing summary information related to comments
|
2016-11-21 14:03:45 +00:00
|
|
|
* like the read marker.
|
2016-02-03 15:18:14 +00:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
var CommentSummaryModel = OC.Backbone.Model.extend(
|
|
|
|
/** @lends OCA.Comments.CommentSummaryModel.prototype */ {
|
|
|
|
sync: OC.Backbone.davSync,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Object type
|
|
|
|
*
|
|
|
|
* @type string
|
|
|
|
*/
|
|
|
|
_objectType: 'files',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Object id
|
|
|
|
*
|
|
|
|
* @type string
|
|
|
|
*/
|
|
|
|
_objectId: null,
|
|
|
|
|
|
|
|
davProperties: {
|
2016-11-21 14:03:45 +00:00
|
|
|
'readMarker': OC.Files.Client.PROPERTY_READMARKER
|
2016-02-03 15:18:14 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initializes the summary model
|
|
|
|
*
|
|
|
|
* @param {string} [options.objectType] object type
|
|
|
|
* @param {string} [options.objectId] object id
|
|
|
|
*/
|
|
|
|
initialize: function(attrs, options) {
|
|
|
|
options = options || {};
|
|
|
|
if (options.objectType) {
|
|
|
|
this._objectType = options.objectType;
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
url: function() {
|
|
|
|
return OC.linkToRemote('dav') + '/comments/' +
|
|
|
|
encodeURIComponent(this._objectType) + '/' +
|
|
|
|
encodeURIComponent(this.id) + '/';
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
OCA.Comments.CommentSummaryModel = CommentSummaryModel;
|
|
|
|
})(OC, OCA);
|