From: Darren Date: Fri, 22 Feb 2013 11:00:21 +0000 (+0000) Subject: Client: ControlBox event namespace seperator X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6c58c492d6539001f746b5e6c560531ffe663cdb;p=KiwiIRC.git Client: ControlBox event namespace seperator --- diff --git a/client/assets/dev/applet_nickserv.js b/client/assets/dev/applet_nickserv.js index 4b45a55..b09b362 100644 --- a/client/assets/dev/applet_nickserv.js +++ b/client/assets/dev/applet_nickserv.js @@ -28,7 +28,7 @@ this.set('title', 'Nickserv Login'); //this.view = new View(); - _kiwi.global.control.on('command_login', this.loginCommand, this); + _kiwi.global.control.on('command:login', this.loginCommand, this); }, loginCommand: function (event) { diff --git a/client/assets/dev/model_application.js b/client/assets/dev/model_application.js index bc3a868..f8d37c7 100644 --- a/client/assets/dev/model_application.js +++ b/client/assets/dev/model_application.js @@ -805,45 +805,45 @@ _kiwi.model.Application = function () { controlbox.on('unknown_command', unknownCommand); controlbox.on('command', allCommands); - controlbox.on('command_msg', msgCommand); + controlbox.on('command:msg', msgCommand); - controlbox.on('command_action', actionCommand); + controlbox.on('command:action', actionCommand); - controlbox.on('command_join', joinCommand); + controlbox.on('command:join', joinCommand); - controlbox.on('command_part', partCommand); + controlbox.on('command:part', partCommand); - controlbox.on('command_nick', function (ev) { + controlbox.on('command:nick', function (ev) { _kiwi.gateway.changeNick(ev.params[0]); }); - controlbox.on('command_query', queryCommand); + controlbox.on('command:query', queryCommand); - controlbox.on('command_topic', topicCommand); + controlbox.on('command:topic', topicCommand); - controlbox.on('command_notice', noticeCommand); + controlbox.on('command:notice', noticeCommand); - controlbox.on('command_quote', quoteCommand); + controlbox.on('command:quote', quoteCommand); - controlbox.on('command_kick', kickCommand); + controlbox.on('command:kick', kickCommand); - controlbox.on('command_clear', clearCommand); + controlbox.on('command:clear', clearCommand); - controlbox.on('command_css', function (ev) { + controlbox.on('command:css', function (ev) { var queryString = '?reload=' + new Date().getTime(); $('link[rel="stylesheet"]').each(function () { this.href = this.href.replace(/\?.*|$/, queryString); }); }); - controlbox.on('command_js', function (ev) { + controlbox.on('command:js', function (ev) { if (!ev.params[0]) return; $script(ev.params[0] + '?' + (new Date().getTime())); }); - controlbox.on('command_set', function (ev) { + controlbox.on('command:set', function (ev) { if (!ev.params[0]) return; var setting = ev.params[0], @@ -862,13 +862,13 @@ _kiwi.model.Application = function () { }); - controlbox.on('command_save', function (ev) { + controlbox.on('command:save', function (ev) { _kiwi.global.settings.save(); _kiwi.app.panels.active.addMsg('', 'Settings have been saved'); }); - controlbox.on('command_alias', function (ev) { + controlbox.on('command:alias', function (ev) { var name, rule; // No parameters passed so list them @@ -899,8 +899,8 @@ _kiwi.model.Application = function () { controlbox.preprocessor.aliases[name] = rule; }); - controlbox.on('command_applet', appletCommand); - controlbox.on('command_settings', settingsCommand); + controlbox.on('command:applet', appletCommand); + controlbox.on('command:settings', settingsCommand); }; // A fallback action. Send a raw command to the server diff --git a/client/assets/dev/view.js b/client/assets/dev/view.js index 1bc9bb2..dc7e554 100644 --- a/client/assets/dev/view.js +++ b/client/assets/dev/view.js @@ -955,11 +955,11 @@ _kiwi.view.ControlBox = Backbone.View.extend({ // Trigger the command events this.trigger('command', {command: command, params: params}); - this.trigger('command_' + command, {command: command, params: params}); + this.trigger('command:' + command, {command: command, params: params}); // If we didn't have any listeners for this event, fire a special case // TODO: This feels dirty. Should this really be done..? - if (!this._callbacks['command_' + command]) { + if (!this._callbacks['command:' + command]) { this.trigger('unknown_command', {command: command, params: params}); } }