From 15ad64e35626a09810efd9e16765e45a416aff6c Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Fri, 17 Apr 2020 17:46:17 +0200 Subject: [PATCH] Fix web icons ignoring web_root (#291) Fix the URLs for the item icons in the web interface ignoring the web_root config option. [travis skip] --- static/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/static/main.js b/static/main.js index a3330fbe..3f2edb61 100644 --- a/static/main.js +++ b/static/main.js @@ -187,7 +187,7 @@ function replaceAll(target, search, replacement) { function getImageFromName(name){ if(imagelinks[name]){ - return imagelinks[name]; + return root + imagelinks[name].slice(1); } else if(imagedata[name]) { return "https://wiki.factorio.com/images/" + imagedata[name] + ".png"; } else if(factorioLocale["entity-name"] && factorioLocale["entity-name"][name]){ @@ -201,7 +201,7 @@ function getImageFromName(name){ } else return `${root}pictures/unknown-item.png`; } window.factorioLocale = {}; -$.getJSON("/api/getFactorioLocale", (locale) => { +$.getJSON(`${root}api/getFactorioLocale`, (locale) => { window.factorioLocale = locale; }); // image data