bigbluebutton-Github/labs/html5-embed/public/js/collections/users.js

25 lines
683 B
JavaScript
Raw Normal View History

2012-10-26 05:12:21 +08:00
define([
'jquery',
'underscore',
'backbone',
'models/user'
], function($, _, Backbone, UserModel){
var UserCollection = Backbone.Collection.extend({
model: UserModel,
initialize: function(){
var self = this;
BBB.listen("UserLeftEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + "] has left.");
});
BBB.listen("UserJoinedEvent", function(bbbEvent) {
console.log("User [" + bbbEvent.userID + ", " + bbbEvent.userName + "] has joined.");
self.add({ userid: bbbEvent.userID, username: bbbEvent.userName});
});
2012-10-26 05:12:21 +08:00
}
});
var userCollection = new UserCollection();
return userCollection;
2012-10-26 05:12:21 +08:00
});