feat: add website root path settings (#1)

* feat: add website root path settings
* fix: disable cloudflare rocket-loader for iframe-resizer
This commit is contained in:
Axel Cocat 2022-03-16 23:39:45 +01:00 committed by GitHub
parent 1b7e975080
commit b8de1cbc8b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 86 additions and 60 deletions

View file

@ -16,7 +16,7 @@ function createGuildEmblem(emblem, el) {
const canvas = $emblem.find("canvas")[0];
const ctx = canvas.getContext("2d");
const imgUrl = (type, section, value, value2) => `/img/guild-emblems/${type}_${value}${value2 ? ("_" + value2) : ""}_T${section}_U.PNG`;
const imgUrl = (type, section, value, value2) => `${handlebarsData.websiteRoot}/img/guild-emblems/${type}_${value}${value2 ? ("_" + value2) : ""}_T${section}_U.PNG`;
const $images = $("<div>").addClass("images").appendTo($emblem);
const bgUpper = $("<img>").attr("src", imgUrl("Background", "U", emblem.background)).appendTo($images)[0];
@ -64,7 +64,7 @@ function createArenaEmblem(teamSize, emblem, el) {
const canvas = $emblem.find("canvas")[0];
const ctx = canvas.getContext("2d");
const imgUrl = (teamSize, type, value) => `/img/arena-banners/PVP-Banner${teamSize ? ("-" + teamSize) : ""}${type ? ("-" + type) : ""}${value ? ("-" + value) : ""}.PNG`;
const imgUrl = (teamSize, type, value) => `${handlebarsData.websiteRoot}/img/arena-banners/PVP-Banner${teamSize ? ("-" + teamSize) : ""}${type ? ("-" + type) : ""}${value ? ("-" + value) : ""}.PNG`;
const $images = $("<div>").addClass("images").appendTo($emblem);
const banner = $("<img>").attr("src", imgUrl(teamSize)).appendTo($images)[0];

View file

@ -1,3 +1,3 @@
window.parent.postMessage({
url: window.location.pathname,
url: window.location.pathname.replace(handlebarsData.websiteRoot, ""),
}, "*");