1 _kiwi
.view
.UserBox
= Backbone
.View
.extend({
3 'click .query': 'queryClick',
4 'click .info': 'infoClick',
5 'click .slap': 'slapClick',
6 'click .op': 'opClick',
7 'click .deop': 'deopClick',
8 'click .voice': 'voiceClick',
9 'click .devoice': 'devoiceClick',
10 'click .kick': 'kickClick',
11 'click .ban': 'banClick'
14 initialize: function () {
16 op
: _kiwi
.global
.i18n
.translate('client_views_userbox_op').fetch(),
17 de_op
: _kiwi
.global
.i18n
.translate('client_views_userbox_deop').fetch(),
18 voice
: _kiwi
.global
.i18n
.translate('client_views_userbox_voice').fetch(),
19 de_voice
: _kiwi
.global
.i18n
.translate('client_views_userbox_devoice').fetch(),
20 kick
: _kiwi
.global
.i18n
.translate('client_views_userbox_kick').fetch(),
21 ban
: _kiwi
.global
.i18n
.translate('client_views_userbox_ban').fetch(),
22 message
: _kiwi
.global
.i18n
.translate('client_views_userbox_query').fetch(),
23 info
: _kiwi
.global
.i18n
.translate('client_views_userbox_whois').fetch(),
24 slap
: _kiwi
.global
.i18n
.translate('client_views_userbox_slap').fetch()
26 this.$el
= $(_
.template($('#tmpl_userbox').html().trim(), text
));
29 queryClick: function (event
) {
30 var panel
= new _kiwi
.model
.Query({name
: this.member
.get('nick')});
31 _kiwi
.app
.connections
.active_connection
.panels
.add(panel
);
35 infoClick: function (event
) {
36 _kiwi
.app
.controlbox
.processInput('/whois ' + this.member
.get('nick'));
39 slapClick: function (event
) {
40 _kiwi
.app
.controlbox
.processInput('/slap ' + this.member
.get('nick'));
43 opClick: function (event
) {
44 _kiwi
.app
.controlbox
.processInput('/mode ' + this.channel
.get('name') + ' +o ' + this.member
.get('nick'));
47 deopClick: function (event
) {
48 _kiwi
.app
.controlbox
.processInput('/mode ' + this.channel
.get('name') + ' -o ' + this.member
.get('nick'));
51 voiceClick: function (event
) {
52 _kiwi
.app
.controlbox
.processInput('/mode ' + this.channel
.get('name') + ' +v ' + this.member
.get('nick'));
55 devoiceClick: function (event
) {
56 _kiwi
.app
.controlbox
.processInput('/mode ' + this.channel
.get('name') + ' -v ' + this.member
.get('nick'));
59 kickClick: function (event
) {
60 // TODO: Enable the use of a custom kick message
61 _kiwi
.app
.controlbox
.processInput('/kick ' + this.member
.get('nick') + ' Bye!');
64 banClick: function (event
) {
65 // TODO: Set ban on host, not just on nick
66 _kiwi
.app
.controlbox
.processInput('/mode ' + this.channel
.get('name') + ' +b ' + this.member
.get('nick') + '!*');