Consistent rpc API between browser<->server
[KiwiIRC.git] / client / src / app.js
index 6f95977c63a5f2ec45b27503fd1bc51d6b9ce0b6..0ff56658d547f97c69d677dbafb771abf32ae932 100644 (file)
@@ -20,6 +20,7 @@ _kiwi.global = {
     settings: undefined, // Instance of _kiwi.model.DataStore\r
     plugins: undefined, // Instance of _kiwi.model.PluginManager\r
     events: undefined, // Instance of PluginInterface\r
+    rpc: undefined, // Instance of WebsocketRpc\r
     utils: {}, // References to misc. re-usable helpers / functions\r
 \r
     initUtils: function() {\r
@@ -32,22 +33,6 @@ _kiwi.global = {
         this.utils.hsl2rgb = hsl2rgb;\r
     },\r
 \r
-    rpc: function() {\r
-        if (!_kiwi.gateway.rpc) {\r
-            throw 'RPC unavailable. Is Kiwi connected to the server yet?';\r
-        }\r
-\r
-        return _kiwi.gateway.rpc.apply(_kiwi.gateway.rpc, arguments);\r
-    },\r
-\r
-    rpcNamespace: function(namespace) {\r
-        if (!_kiwi.gateway.rpc) {\r
-            throw 'RPC unavailable. Is Kiwi connected to the server yet?';\r
-        }\r
-\r
-        return _kiwi.gateway.rpc.namespace(namespace);\r
-    },\r
-\r
     addMediaMessageType: function(match, buildHtml) {\r
         _kiwi.view.MediaMessage.addType(match, buildHtml);\r
     },\r