};\r
\r
\r
+ // Clicking a tab\r
+ this.onPanelActive = function (panel, connection) {\r
+ this.panels = connection.panels;\r
+ this.active_connection = connection;\r
+ console.log('Active connection:', connection.get('connection_id'), 'Active panel:', panel.get('name'));\r
+ };\r
+\r
+\r
this.bindGatewayCommands = function (gw) {\r
gw.on('onconnect', function (event) {\r
that.view.barsShow();\r
\r
ev.params.shift();\r
\r
- panel.addMsg(_kiwi.gateway.get('nick'), ev.params.join(' '));\r
+ panel.addMsg(_kiwi.app.connections.active_connection.get('nick'), ev.params.join(' '));\r
_kiwi.gateway.privmsg(destination, ev.params.join(' '));\r
}\r
\r
}\r
\r
var panel = _kiwi.app.panels.active;\r
- panel.addMsg('', '* ' + _kiwi.gateway.get('nick') + ' ' + ev.params.join(' '), 'action');\r
+ panel.addMsg('', '* ' + _kiwi.app.connections.active_connection.get('nick') + ' ' + ev.params.join(' '), 'action');\r
_kiwi.gateway.action(panel.get('name'), ev.params.join(' '));\r
}\r
\r
\r
\r
onNetworkAdd: function(network) {\r
- network.panels.on('active', this.onActive, this);\r
+ network.panels.on('active', this.onPanelActive, this);\r
},\r
\r
onNetworkRemove: function(network) {\r
- network.panels.off('active', this.onActive, this);\r
+ network.panels.off('active', this.onPanelActive, this);\r
},\r
\r
- onActive: function(panel) {\r
+ onPanelActive: function(panel) {\r
var connection = this.getByConnectionId(panel.tab.data('connection_id'));\r
this.trigger('active', panel, connection);\r
\r
this.active_connection = connection;\r
this.active = panel;\r
- console.log('Active connection:', connection.get('connection_id'), 'Active panel:', panel.get('name'));\r
}\r
});
\ No newline at end of file
userbox.member = member;\r
userbox.channel = this.model.channel;\r
\r
- if (!this.model.getByNick(_kiwi.gateway.get('nick')).get('is_op')) {\r
+ if (!this.model.getByNick(_kiwi.app.connections.active_connection.get('nick')).get('is_op')) {\r
userbox.$el.children('.if_op').remove();\r
}\r
\r
nick_colour_hex, nick_hex, is_highlight, msg_css_classes = '';\r
\r
// Nick highlight detecting\r
- if ((new RegExp('\\b' + _kiwi.gateway.get('nick') + '\\b', 'i')).test(msg.msg)) {\r
+ if ((new RegExp('\\b' + _kiwi.app.connections.active_connection.get('nick') + '\\b', 'i')).test(msg.msg)) {\r
is_highlight = true;\r
msg_css_classes += ' highlight';\r
}\r
(function () {\r
// Only inrement the counters if we're not the active panel\r
if (this.model.isActive()) return;\r
-\r
+console.log('Updating activity');\r
var $act = this.model.tab.find('.activity');\r
$act.text((parseInt($act.text(), 10) || 0) + 1);\r
if ($act.text() === '0') {\r
}\r
\r
// Process the raw command for any aliases\r
- this.preprocessor.vars.server = _kiwi.gateway.get('name');\r
+ this.preprocessor.vars.server = _kiwi.app.connections.active_connection.get('name');\r
this.preprocessor.vars.channel = _kiwi.app.panels.active.get('name');\r
this.preprocessor.vars.destination = this.preprocessor.vars.channel;\r
command_raw = this.preprocessor.process(command_raw);\r