diff --git a/app/index.html b/app/index.html index acba4eaa..c836d983 100644 --- a/app/index.html +++ b/app/index.html @@ -13,6 +13,10 @@ {{content-for 'head-footer'}} + + {{content-for 'body'}} diff --git a/config/environment.js b/config/environment.js index bfadc88c..47259a50 100644 --- a/config/environment.js +++ b/config/environment.js @@ -1,5 +1,28 @@ /* jshint node: true */ +// TODO: how to include this from app/utils/ here? +var extend = function(out) { + out = out || {}; + + for (var i = 1; i < arguments.length; i++) { + var obj = arguments[i]; + + if (!obj) + continue; + + for (var key in obj) { + if (obj.hasOwnProperty(key)) { + if (typeof obj[key] === 'object') + deepExtend(out[key], obj[key]); + else + out[key] = obj[key]; + } + } + } + + return out; +}; + module.exports = function(environment) { var ENV = { modulePrefix: 'travis', @@ -31,6 +54,11 @@ module.exports = function(environment) { intervals: { updateTimes: 1000 } }; + // merge environment vars from index.html + if(typeof TravisENV !== 'undefined') { + extend(ENV, TravisENV); + } + if (environment === 'development') { // ENV.APP.LOG_RESOLVER = true; // ENV.APP.LOG_ACTIVE_GENERATION = true; @@ -55,15 +83,6 @@ module.exports = function(environment) { } - ENV.endpoints = { - ssh_key: false, - caches: false - }; - ENV.pro = false; - ENV.pusher = {}; - ENV.intervals = { updateTimes: 1000, times: -1 }; - ENV.api_endpoint = 'https://api.travis-ci.org'; - ENV.contentSecurityPolicy = { 'default-src': "'none'", // TODO: for some reason unsafe-eval is needed when I use collection helper,