diff options
Diffstat (limited to 'pyload/web/app/index.html')
-rw-r--r-- | pyload/web/app/index.html | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pyload/web/app/index.html b/pyload/web/app/index.html index 28584587c..e8e28f4e1 100644 --- a/pyload/web/app/index.html +++ b/pyload/web/app/index.html @@ -19,6 +19,15 @@ <!-- endbuild --> <script type="text/javascript"> + + // Use value set by templateEngine or default val + function configValue(string, defaultValue) { + if (string.indexOf('{{') > -1) + return defaultValue; + + return string; + } + window.dates = { weeks: ['week', 'weeks'], days: ['day', 'days'], @@ -27,13 +36,11 @@ seconds: ['second', 'seconds'] }; // TODO carefully when translating - // TODO: use configured values window.hostProtocol = window.location.protocol + '//'; window.hostAddress = window.location.hostname; - window.hostPort = '8001'; - window.pathPrefix = "/"; - - window.wsAddress = "ws://%s:7227"; // TODO + window.hostPort = configValue('{{web}}', '8001'); + window.pathPrefix = '/'; + window.wsAddress = configValue('{{ws}}', 'ws://%s:7227'); require(['config'], function(Config) { require(['default'], function(App) { |