Client: Private `kiwi` namespace renamed to `_kiwi`
[KiwiIRC.git] / client / assets / dev / model_gateway.js
index 91cf5d0aeab8da86a7c1a7fdd11cfeede4371a94..47c41a49803e9f00b661661fd7987a26104d0d5d 100644 (file)
@@ -1,4 +1,4 @@
-kiwi.model.Gateway = function () {\r
+_kiwi.model.Gateway = function () {\r
 \r
     // Set to a reference to this object within initialize()\r
     var that = null;\r
@@ -62,12 +62,12 @@ kiwi.model.Gateway = function () {
         var resource;\r
 \r
         // Work out the resource URL for socket.io\r
-        if (kiwi.app.get('base_path').substr(0, 1) === '/') {\r
-            resource = kiwi.app.get('base_path');\r
+        if (_kiwi.app.get('base_path').substr(0, 1) === '/') {\r
+            resource = _kiwi.app.get('base_path');\r
             resource = resource.substr(1, resource.length-1);\r
             resource += '/transport';\r
         } else {\r
-            resource = kiwi.app.get('base_path') + '/transport';\r
+            resource = _kiwi.app.get('base_path') + '/transport';\r
         }\r
 \r
         this.socket = io.connect(this.get('kiwi_server'), {\r
@@ -85,12 +85,12 @@ kiwi.model.Gateway = function () {
         });\r
 \r
         this.socket.on('error', function (e) {\r
-            console.log("kiwi.gateway.socket.on('error')", {reason: e});\r
+            console.log("_kiwi.gateway.socket.on('error')", {reason: e});\r
             that.trigger("connect_fail", {reason: e});\r
         });\r
 \r
         this.socket.on('connecting', function (transport_type) {\r
-            console.log("kiwi.gateway.socket.on('connecting')");\r
+            console.log("_kiwi.gateway.socket.on('connecting')");\r
             that.trigger("connecting");\r
         });\r
 \r
@@ -104,9 +104,9 @@ kiwi.model.Gateway = function () {
             this.emit('kiwi', {command: 'connect', nick: that.get('nick'), hostname: host, port: port, ssl: ssl, password:password}, function (err, server_num) {\r
                 if (!err) {\r
                     that.server_num = server_num;\r
-                    console.log("kiwi.gateway.socket.on('connect')");\r
+                    console.log("_kiwi.gateway.socket.on('connect')");\r
                 } else {\r
-                    console.log("kiwi.gateway.socket.on('error')", {reason: err});\r
+                    console.log("_kiwi.gateway.socket.on('error')", {reason: err});\r
                     callback(err);\r
                 }\r
             });\r
@@ -126,20 +126,20 @@ kiwi.model.Gateway = function () {
 \r
         this.socket.on('disconnect', function () {\r
             that.trigger("disconnect", {});\r
-            console.log("kiwi.gateway.socket.on('disconnect')");\r
+            console.log("_kiwi.gateway.socket.on('disconnect')");\r
         });\r
 \r
         this.socket.on('close', function () {\r
-            console.log("kiwi.gateway.socket.on('close')");\r
+            console.log("_kiwi.gateway.socket.on('close')");\r
         });\r
 \r
         this.socket.on('reconnecting', function (reconnectionDelay, reconnectionAttempts) {\r
-            console.log("kiwi.gateway.socket.on('reconnecting')");\r
+            console.log("_kiwi.gateway.socket.on('reconnecting')");\r
             that.trigger("reconnecting", {delay: reconnectionDelay, attempts: reconnectionAttempts});\r
         });\r
 \r
         this.socket.on('reconnect_failed', function () {\r
-            console.log("kiwi.gateway.socket.on('reconnect_failed')");\r
+            console.log("_kiwi.gateway.socket.on('reconnect_failed')");\r
         });\r
     };\r
 \r
@@ -210,15 +210,15 @@ kiwi.model.Gateway = function () {
                 break;\r
             /*\r
             case 'sync':\r
-                if (kiwi.gateway.onSync && kiwi.gateway.syncing) {\r
-                    kiwi.gateway.syncing = false;\r
-                    kiwi.gateway.onSync(item);\r
+                if (_kiwi.gateway.onSync && _kiwi.gateway.syncing) {\r
+                    _kiwi.gateway.syncing = false;\r
+                    _kiwi.gateway.onSync(item);\r
                 }\r
                 break;\r
             */\r
 \r
             case 'kiwi':\r
-                this.emit('kiwi.' + data.namespace, data.data);\r
+                this.emit('_kiwi.' + data.namespace, data.data);\r
                 break;\r
             }\r
         }\r