From 919445558be93f164b6bfeae6a5c8457ae5038f8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 24 Aug 2017 11:28:35 +0200 Subject: [PATCH] Start debugging Signed-off-by: Joas Schilling --- js/models/participantcollection.js | 18 ++++++++++++++---- templates/index.php | 3 +++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/js/models/participantcollection.js b/js/models/participantcollection.js index 4da7245e8..227894f94 100644 --- a/js/models/participantcollection.js +++ b/js/models/participantcollection.js @@ -27,20 +27,30 @@ OCA.SpreedMe.Models = OCA.SpreedMe.Models || {}; OCA.SpreedMe.Models.ParticipantCollection = Backbone.Collection.extend({ - room: undefined, - initialise: function(models, options) { - this.room = options.room; + initialize: function() { + console.log("initialize"); + console.log(arguments); }, model: OCA.SpreedMe.Models.Participant, + room: undefined, + + /** + * @param {OCA.SpreedMe.Models.Room} room + * @returns {Array} + */ + setRoom: function(room) { + this.room = room; + this.url = OC.linkToOCS('apps/spreed/api/v1/room', 2) + '/' + this.room.get('token') + 'participants'; + }, // comparator: function(model) { // return -(model.get('lastPing')); // }, - url: OC.linkToOCS('apps/spreed/api/v1/room', 2) + '/' + this.room.get('token') + 'participants', /** * @param result * @returns {Array} */ parse: function(result) { + console.log(result); return result.ocs.data; } }); diff --git a/templates/index.php b/templates/index.php index 61c931922..77084ad57 100644 --- a/templates/index.php +++ b/templates/index.php @@ -14,7 +14,10 @@ script( 'vendor/backbone.marionette/lib/backbone.marionette.min', 'models/room', 'models/roomcollection', + 'models/participant', + 'models/participantcollection', 'views/roomlistview', + 'views/participantview', 'simplewebrtc', 'webrtc', 'signaling',