remove unused group_member_list component
parent
531e7bab46
commit
828aa4413f
@ -1,57 +0,0 @@
|
|||||||
/* global Whisper: false */
|
|
||||||
/* global textsecure: false */
|
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
window.Whisper = window.Whisper || {};
|
|
||||||
|
|
||||||
Whisper.ContactListView = Whisper.ListView.extend({
|
|
||||||
tagName: 'div',
|
|
||||||
itemView: Whisper.View.extend({
|
|
||||||
tagName: 'div',
|
|
||||||
className: 'contact',
|
|
||||||
templateName: 'contact',
|
|
||||||
initialize(options) {
|
|
||||||
this.ourNumber = textsecure.storage.user.getNumber();
|
|
||||||
this.listenBack = options.listenBack;
|
|
||||||
|
|
||||||
this.listenTo(this.model, 'change', this.render);
|
|
||||||
},
|
|
||||||
render() {
|
|
||||||
if (this.contactView) {
|
|
||||||
this.contactView.remove();
|
|
||||||
this.contactView = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const isMe = this.ourNumber === this.model.id;
|
|
||||||
|
|
||||||
this.contactView = new Whisper.ReactWrapperView({
|
|
||||||
className: 'contact-wrapper',
|
|
||||||
Component: window.Signal.Components.ContactListItem,
|
|
||||||
props: {
|
|
||||||
isMe,
|
|
||||||
avatarPath: this.model.getAvatarPath(),
|
|
||||||
phoneNumber: this.model.getNumber(),
|
|
||||||
name: this.model.getName(),
|
|
||||||
profileName: this.model.getProfileName(),
|
|
||||||
verified: this.model.isVerified(),
|
|
||||||
onClick: this.showIdentity.bind(this),
|
|
||||||
},
|
|
||||||
});
|
|
||||||
this.$el.append(this.contactView.el);
|
|
||||||
return this;
|
|
||||||
},
|
|
||||||
showIdentity() {
|
|
||||||
if (this.model.id === this.ourNumber) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const view = new Whisper.KeyVerificationPanelView({
|
|
||||||
model: this.model,
|
|
||||||
});
|
|
||||||
this.listenBack(view);
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
})();
|
|
@ -1,41 +0,0 @@
|
|||||||
/* global Whisper, i18n */
|
|
||||||
|
|
||||||
// eslint-disable-next-line func-names
|
|
||||||
(function() {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
window.Whisper = window.Whisper || {};
|
|
||||||
|
|
||||||
// TODO: take a title string which could replace the 'members' header
|
|
||||||
Whisper.GroupMemberList = Whisper.View.extend({
|
|
||||||
className: 'group-member-list panel',
|
|
||||||
templateName: 'group-member-list',
|
|
||||||
initialize(options) {
|
|
||||||
this.needVerify = options.needVerify;
|
|
||||||
|
|
||||||
this.render();
|
|
||||||
|
|
||||||
this.member_list_view = new Whisper.ContactListView({
|
|
||||||
collection: this.model,
|
|
||||||
className: 'members',
|
|
||||||
toInclude: {
|
|
||||||
listenBack: options.listenBack,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
this.member_list_view.render();
|
|
||||||
|
|
||||||
this.$('.container').append(this.member_list_view.el);
|
|
||||||
},
|
|
||||||
render_attributes() {
|
|
||||||
let summary;
|
|
||||||
if (this.needVerify) {
|
|
||||||
summary = i18n('membersNeedingVerification');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
members: i18n('groupMembers'),
|
|
||||||
summary,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
});
|
|
||||||
})();
|
|
Loading…
Reference in New Issue