Client: ControlBox event namespace seperator
authorDarren <darren@Darrens-MacBook-Pro.local>
Fri, 22 Feb 2013 11:00:21 +0000 (11:00 +0000)
committerDarren <darren@Darrens-MacBook-Pro.local>
Fri, 22 Feb 2013 11:00:21 +0000 (11:00 +0000)
client/assets/dev/applet_nickserv.js
client/assets/dev/model_application.js
client/assets/dev/view.js

index 4b45a55cf839312034611d7364650c31f412e221..b09b362fda48e8f90a0259fe71af45eff281e0ef 100644 (file)
@@ -28,7 +28,7 @@
             this.set('title', 'Nickserv Login');\r
             //this.view = new View();\r
 \r
-            _kiwi.global.control.on('command_login', this.loginCommand, this);\r
+            _kiwi.global.control.on('command:login', this.loginCommand, this);\r
         },\r
 \r
         loginCommand: function (event) {\r
index bc3a86880fcbe53a764a1b2dd4bcc001e4e8d01f..f8d37c70eb62301df107c478e51ccbca2c15f90a 100644 (file)
@@ -805,45 +805,45 @@ _kiwi.model.Application = function () {
             controlbox.on('unknown_command', unknownCommand);\r
 \r
             controlbox.on('command', allCommands);\r
-            controlbox.on('command_msg', msgCommand);\r
+            controlbox.on('command:msg', msgCommand);\r
 \r
-            controlbox.on('command_action', actionCommand);\r
+            controlbox.on('command:action', actionCommand);\r
 \r
-            controlbox.on('command_join', joinCommand);\r
+            controlbox.on('command:join', joinCommand);\r
 \r
-            controlbox.on('command_part', partCommand);\r
+            controlbox.on('command:part', partCommand);\r
 \r
-            controlbox.on('command_nick', function (ev) {\r
+            controlbox.on('command:nick', function (ev) {\r
                 _kiwi.gateway.changeNick(ev.params[0]);\r
             });\r
 \r
-            controlbox.on('command_query', queryCommand);\r
+            controlbox.on('command:query', queryCommand);\r
 \r
-            controlbox.on('command_topic', topicCommand);\r
+            controlbox.on('command:topic', topicCommand);\r
 \r
-            controlbox.on('command_notice', noticeCommand);\r
+            controlbox.on('command:notice', noticeCommand);\r
 \r
-            controlbox.on('command_quote', quoteCommand);\r
+            controlbox.on('command:quote', quoteCommand);\r
 \r
-            controlbox.on('command_kick', kickCommand);\r
+            controlbox.on('command:kick', kickCommand);\r
 \r
-            controlbox.on('command_clear', clearCommand);\r
+            controlbox.on('command:clear', clearCommand);\r
 \r
 \r
-            controlbox.on('command_css', function (ev) {\r
+            controlbox.on('command:css', function (ev) {\r
                 var queryString = '?reload=' + new Date().getTime();\r
                 $('link[rel="stylesheet"]').each(function () {\r
                     this.href = this.href.replace(/\?.*|$/, queryString);\r
                 });\r
             });\r
 \r
-            controlbox.on('command_js', function (ev) {\r
+            controlbox.on('command:js', function (ev) {\r
                 if (!ev.params[0]) return;\r
                 $script(ev.params[0] + '?' + (new Date().getTime()));\r
             });\r
 \r
             \r
-            controlbox.on('command_set', function (ev) {\r
+            controlbox.on('command:set', function (ev) {\r
                 if (!ev.params[0]) return;\r
 \r
                 var setting = ev.params[0],\r
@@ -862,13 +862,13 @@ _kiwi.model.Application = function () {
             });\r
 \r
 \r
-            controlbox.on('command_save', function (ev) {\r
+            controlbox.on('command:save', function (ev) {\r
                 _kiwi.global.settings.save();\r
                 _kiwi.app.panels.active.addMsg('', 'Settings have been saved');\r
             });\r
 \r
 \r
-            controlbox.on('command_alias', function (ev) {\r
+            controlbox.on('command:alias', function (ev) {\r
                 var name, rule;\r
 \r
                 // No parameters passed so list them\r
@@ -899,8 +899,8 @@ _kiwi.model.Application = function () {
                 controlbox.preprocessor.aliases[name] = rule;\r
             });\r
 \r
-            controlbox.on('command_applet', appletCommand);\r
-            controlbox.on('command_settings', settingsCommand);\r
+            controlbox.on('command:applet', appletCommand);\r
+            controlbox.on('command:settings', settingsCommand);\r
         };\r
 \r
         // A fallback action. Send a raw command to the server\r
index 1bc9bb295f8422e535a924b2d8f012ce01b2f5de..dc7e5540a0ccbc077e55ffcbf8bb66c5873d66d2 100644 (file)
@@ -955,11 +955,11 @@ _kiwi.view.ControlBox = Backbone.View.extend({
 \r
         // Trigger the command events\r
         this.trigger('command', {command: command, params: params});\r
-        this.trigger('command_' + command, {command: command, params: params});\r
+        this.trigger('command:' + command, {command: command, params: params});\r
 \r
         // If we didn't have any listeners for this event, fire a special case\r
         // TODO: This feels dirty. Should this really be done..?\r
-        if (!this._callbacks['command_' + command]) {\r
+        if (!this._callbacks['command:' + command]) {\r
             this.trigger('unknown_command', {command: command, params: params});\r
         }\r
     }\r