From 720292ae3cd521250c1eca98a65e59a2f468312d Mon Sep 17 00:00:00 2001 From: Simo Kinnunen Date: Thu, 3 Jul 2014 18:42:52 +0900 Subject: [PATCH] Rename the APP global variable to APPSTATE. It will soon contain more information. --- lib/roles/app.js | 6 ++++-- res/app/components/stf/socket/socket-service.js | 4 ++-- res/app/views/index.jade | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/roles/app.js b/lib/roles/app.js index 7e1ed42e..2b6e1b7c 100644 --- a/lib/roles/app.js +++ b/lib/roles/app.js @@ -84,8 +84,10 @@ module.exports = function(options) { })) // Variables for templates - app.locals.APP = { - websocketUrl: options.websocketUrl + app.locals.APPSTATE = { + config: { + websocketUrl: options.websocketUrl + } } // Proxied requests must come before any body parsers. These proxies are diff --git a/res/app/components/stf/socket/socket-service.js b/res/app/components/stf/socket/socket-service.js index 8e473464..2b620703 100644 --- a/res/app/components/stf/socket/socket-service.js +++ b/res/app/components/stf/socket/socket-service.js @@ -1,9 +1,9 @@ var io = require('socket.io') module.exports = function SocketFactory($rootScope, VersionUpdateService) { - /*globals APP:false*/ + /*globals APPSTATE:false*/ - var socket = io(APP.websocketUrl, { + var socket = io(APPSTATE.config.websocketUrl, { reconnection: false , transports: ['websocket'] }) diff --git a/res/app/views/index.jade b/res/app/views/index.jade index 6c7002f0..b0dd6a65 100644 --- a/res/app/views/index.jade +++ b/res/app/views/index.jade @@ -22,7 +22,7 @@ html div(growl) div(ng-view).fill-height - script var APP = !{JSON.stringify(APP)} + script var APPSTATE = !{JSON.stringify(APPSTATE)} script(src='/static/build/entry/commons.entry.js') script(src='/static/build/entry/app.entry.js') script(src='/static/bower_components/stf-analytics/analytics.js')