From: Darren Date: Mon, 6 Oct 2014 20:38:44 +0000 (+0100) Subject: kiwi_server no longer read from _kiwi.app X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=89bbe76bcbda7a7129cf86743a4f10d8bb6876e4;p=KiwiIRC.git kiwi_server no longer read from _kiwi.app --- diff --git a/client/src/models/application.js b/client/src/models/application.js index aab897d..4456c59 100644 --- a/client/src/models/application.js +++ b/client/src/models/application.js @@ -7,10 +7,9 @@ /** _kiwi.view.StatusMessage */ message: null, - /* Address for the kiwi server */ - kiwi_server: null, - initialize: function (options) { + this.app_options = options; + if (options.container) { this.set('container', options.container); } @@ -30,9 +29,6 @@ this.themes = options.themes || []; this.text_theme = options.text_theme || {}; - // Best guess at where the kiwi server is if not already specified - this.kiwi_server = options.kiwi_server || this.detectKiwiServer(); - // The applet to initially load this.startup_applet_name = options.startup || 'kiwi_startup'; @@ -44,8 +40,11 @@ initializeInterfaces: function () { + // Best guess at where the kiwi server is if not already specified + var kiwi_server = this.app_options.kiwi_server || this.detectKiwiServer(); + // Set the gateway up - _kiwi.gateway = new _kiwi.model.Gateway(); + _kiwi.gateway = new _kiwi.model.Gateway({kiwi_server: kiwi_server}); this.bindGatewayCommands(_kiwi.gateway); this.initializeClient(); @@ -278,7 +277,7 @@ that.message.text(msg, {timeout: 8000}); setTimeout(function forcedReconnectPartTwo() { - _kiwi.app.kiwi_server = serv; + _kiwi.gateway.set('kiwi_server', serv); _kiwi.gateway.reconnect(function() { // Reconnect all the IRC connections diff --git a/client/src/models/gateway.js b/client/src/models/gateway.js index 4fe707d..c479aaf 100644 --- a/client/src/models/gateway.js +++ b/client/src/models/gateway.js @@ -30,9 +30,6 @@ _kiwi.model.Gateway = Backbone.Model.extend({ this.connect_callback = callback; - // Keep note of the server we are connecting to - this.set('kiwi_server', _kiwi.app.kiwi_server); - this.socket = new EngineioTools.ReconnectingSocket(this.get('kiwi_server'), { transports: _kiwi.app.server_settings.transports || ['polling', 'websocket'], path: _kiwi.app.get('base_path') + '/transport',