signal-desktop/js/views/group_update_view.js

30 lines
680 B
JavaScript
Raw Normal View History

2018-04-27 21:25:04 +00:00
(function() {
'use strict';
2018-04-27 21:25:04 +00:00
window.Whisper = window.Whisper || {};
2018-04-27 21:25:04 +00:00
Whisper.GroupUpdateView = Backbone.View.extend({
tagName: 'div',
className: 'group-update',
render: function() {
//TODO l10n
if (this.model.left) {
this.$el.text(this.model.left + ' left the group');
return this;
}
2015-02-16 20:47:36 +00:00
2018-04-27 21:25:04 +00:00
var messages = ['Updated the group.'];
if (this.model.name) {
messages.push("Title is now '" + this.model.name + "'.");
}
if (this.model.joined) {
messages.push(this.model.joined.join(', ') + ' joined the group');
}
2018-04-27 21:25:04 +00:00
this.$el.text(messages.join(' '));
2018-04-27 21:25:04 +00:00
return this;
},
});
})();