Gateway events consistancy
authorDarren <darren@Darrens-MacBook-Pro.local>
Fri, 22 Feb 2013 12:59:05 +0000 (12:59 +0000)
committerDarren <darren@Darrens-MacBook-Pro.local>
Fri, 22 Feb 2013 12:59:05 +0000 (12:59 +0000)
client/assets/dev/model_gateway.js
client/assets/plugin_example.html

index 48ea4ac00d5db9b3687b52cd87d4a3426431f851..c9ccf016d33060ae97eb06ba4d6a5ea40b8127b4 100644 (file)
@@ -74,11 +74,12 @@ _kiwi.model.Gateway = function () {
 \r
             source = is_pm ? event.nick : event.channel;\r
             \r
-            that.trigger('msg:' + source, event);\r
+            that.trigger('message:' + source, event);\r
+            that.trigger('message', event);\r
 \r
             if (is_pm) {\r
-                that.trigger('pm', event);\r
                 that.trigger('pm:' + source, event);\r
+                that.trigger('pm', event);\r
             }\r
         }, this);\r
 \r
@@ -87,8 +88,8 @@ _kiwi.model.Gateway = function () {
             // The notice towards a channel or a query window?\r
             var source = event.target || event.nick;\r
 \r
-            this.trigger('notice', event);\r
             this.trigger('notice:' + source, event);\r
+            this.trigger('notice', event);\r
         }, this);\r
 \r
 \r
@@ -101,15 +102,15 @@ _kiwi.model.Gateway = function () {
             that.trigger('action:' + source, event);\r
 \r
             if (is_pm) {\r
-                that.trigger('action', event);\r
                 that.trigger('action:' + source, event);\r
+                that.trigger('action', event);\r
             }\r
         }, this);\r
 \r
 \r
         this.on('ontopic', function (event) {\r
-            that.trigger('topic', event);\r
             that.trigger('topic:' + event.channel, event);\r
+            that.trigger('topic', event);\r
         });\r
     };\r
 \r
index 19afa216a02fdf1341e321008ef08a6727911b6c..d9393dd682bb1d782b6886f57d56f6e2b0251a55 100644 (file)
                 var input = kiwi.components.ControlInput();
 
                 this.on('applet_loaded', function () {
-                    irc.on('onmsg', function () {
+                    irc.on('message', function () {
                         var bar = that.view.$el.find('.bar');
                         bar.width(bar.width()+1);
                     });
                 });
 
-                input.on('command_graph', function (event) { console.log(event); });
+                input.on('command:graph', function (event) { console.log(event); });
             },
 
             canvas: function (event) {