"use strict"; var app = {}; angular.module('app.cfg', []) .constant('cfg', (function (appCfg, protocol, host, pathname, sourceDir) { var srcDirIndex = pathname.lastIndexOf(sourceDir), devMode = -1 !== srcDirIndex, urlPrefix = (devMode) ? pathname.substring(0, srcDirIndex) + '/web' : pathname; urlPrefix = '/' === urlPrefix[urlPrefix.length - 1] ? urlPrefix.substr(0, urlPrefix.length - 1) : urlPrefix; app.cfg = {}; app.cfg.xsrfCookieName = 'XSRF-TOKEN'; app.cfg.xsrfHeaderName = 'X-XSRF-TOKEN'; app.cfg.debug = devMode; app.cfg.lang = 'en'; app.cfg.devMode = devMode; app.cfg.url = protocol + '//' + host + urlPrefix; app.cfg.apiUrl = app.cfg.url; app.cfg.userInfo = null; angular.extend(app.cfg, appCfg); return app.cfg; })(window.appCfg || {}, window.location.protocol, location.host, location.pathname, '/source/'));