From 12dbf510346ec50701ce1798966ee26ad1856078 Mon Sep 17 00:00:00 2001 From: Hoppyhob Date: Fri, 17 May 2024 20:58:06 -0500 Subject: [PATCH] [#3441] Removed leading / on css url() and on icon in config.mjs There was an issue where a leading slash (/) was causing the url() css to use a absolute url path instead of a relative path. This worked without a routePrefix because the url path was the same if for both absolute and relative, however with a routePrefix we need to preserve the prefix, this was done by removing the leading slash for icons paths and in the case of a less defined url a leading ../../ was added to remove the /systems/dnd5e/ that would be added to the relative path. Closes #3441 --- less/v2/character.less | 2 +- less/v2/dark/character.less | 2 +- .../applications/actor/character-sheet-2.mjs | 2 +- module/config.mjs | 28 +++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/less/v2/character.less b/less/v2/character.less index a282e8f668..73fa2b50f4 100644 --- a/less/v2/character.less +++ b/less/v2/character.less @@ -63,7 +63,7 @@ /* ---------------------------------- */ &.minimized { - background: url("/ui/denim075.png"); + background: url("../../ui/denim075.png"); border: unset; > header { diff --git a/less/v2/dark/character.less b/less/v2/dark/character.less index 0274c60d9f..fc84ed5d64 100644 --- a/less/v2/dark/character.less +++ b/less/v2/dark/character.less @@ -3,7 +3,7 @@ &:not(.minimized) { background: none; } .window-content { - background: var(--dnd5e-color-dark-gray) url("/ui/denim075.png"); + background: var(--dnd5e-color-dark-gray) url("../../ui/denim075.png"); &::before { content: ""; diff --git a/module/applications/actor/character-sheet-2.mjs b/module/applications/actor/character-sheet-2.mjs index fb0f42156b..24afa47165 100644 --- a/module/applications/actor/character-sheet-2.mjs +++ b/module/applications/actor/character-sheet-2.mjs @@ -320,7 +320,7 @@ export default class ActorSheet5eCharacter2 extends ActorSheet5eCharacter { // Character Background context.creatureType = { class: details.type.value === "custom" ? "none" : "", - icon: CONFIG.DND5E.creatureTypes[details.type.value]?.icon ?? "/icons/svg/mystery-man.svg", + icon: CONFIG.DND5E.creatureTypes[details.type.value]?.icon ?? "icons/svg/mystery-man.svg", title: details.type.value === "custom" ? details.type.custom : CONFIG.DND5E.creatureTypes[details.type.value]?.label, diff --git a/module/config.mjs b/module/config.mjs index de43589f14..9cdc256fb4 100644 --- a/module/config.mjs +++ b/module/config.mjs @@ -709,90 +709,90 @@ DND5E.creatureTypes = { aberration: { label: "DND5E.CreatureAberration", plural: "DND5E.CreatureAberrationPl", - icon: "/icons/creatures/tentacles/tentacle-eyes-yellow-pink.webp", + icon: "icons/creatures/tentacles/tentacle-eyes-yellow-pink.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.yy50qVC1JhPHt4LC", detectAlignment: true }, beast: { label: "DND5E.CreatureBeast", plural: "DND5E.CreatureBeastPl", - icon: "/icons/creatures/claws/claw-bear-paw-swipe-red.webp", + icon: "icons/creatures/claws/claw-bear-paw-swipe-red.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.6bTHn7pZek9YX2tv" }, celestial: { label: "DND5E.CreatureCelestial", plural: "DND5E.CreatureCelestialPl", - icon: "/icons/creatures/abilities/wings-birdlike-blue.webp", + icon: "icons/creatures/abilities/wings-birdlike-blue.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.T5CJwxjhBbi6oqaM", detectAlignment: true }, construct: { label: "DND5E.CreatureConstruct", plural: "DND5E.CreatureConstructPl", - icon: "/icons/creatures/magical/construct-stone-earth-gray.webp", + icon: "icons/creatures/magical/construct-stone-earth-gray.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.jQGAJZBZTqDFod8d" }, dragon: { label: "DND5E.CreatureDragon", plural: "DND5E.CreatureDragonPl", - icon: "/icons/creatures/abilities/dragon-fire-breath-orange.webp", + icon: "icons/creatures/abilities/dragon-fire-breath-orange.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.k2IRXZwGk9W0PM2S" }, elemental: { label: "DND5E.CreatureElemental", plural: "DND5E.CreatureElementalPl", - icon: "/icons/creatures/magical/spirit-fire-orange.webp", + icon: "icons/creatures/magical/spirit-fire-orange.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.7z1LXGGkXpHuzkFh", detectAlignment: true }, fey: { label: "DND5E.CreatureFey", plural: "DND5E.CreatureFeyPl", - icon: "/icons/creatures/magical/fae-fairy-winged-glowing-green.webp", + icon: "icons/creatures/magical/fae-fairy-winged-glowing-green.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.OFsRUt3pWljgm8VC", detectAlignment: true }, fiend: { label: "DND5E.CreatureFiend", plural: "DND5E.CreatureFiendPl", - icon: "/icons/magic/death/skull-horned-goat-pentagram-red.webp", + icon: "icons/magic/death/skull-horned-goat-pentagram-red.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.ElHKBJeiJPC7gj6k", detectAlignment: true }, giant: { label: "DND5E.CreatureGiant", plural: "DND5E.CreatureGiantPl", - icon: "/icons/creatures/magical/humanoid-giant-forest-blue.webp", + icon: "icons/creatures/magical/humanoid-giant-forest-blue.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.AOXn3Mv5vPZwo0Uf" }, humanoid: { label: "DND5E.CreatureHumanoid", plural: "DND5E.CreatureHumanoidPl", - icon: "/icons/magic/unholy/strike-body-explode-disintegrate.webp", + icon: "icons/magic/unholy/strike-body-explode-disintegrate.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.iFzQs4AenN8ALRvw" }, monstrosity: { label: "DND5E.CreatureMonstrosity", plural: "DND5E.CreatureMonstrosityPl", - icon: "/icons/creatures/abilities/mouth-teeth-rows-red.webp", + icon: "icons/creatures/abilities/mouth-teeth-rows-red.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.TX0yPEFTn79AMZ8P" }, ooze: { label: "DND5E.CreatureOoze", plural: "DND5E.CreatureOozePl", - icon: "/icons/creatures/slimes/slime-movement-pseudopods-green.webp", + icon: "icons/creatures/slimes/slime-movement-pseudopods-green.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.cgzIC1ecG03D97Fg" }, plant: { label: "DND5E.CreaturePlant", plural: "DND5E.CreaturePlantPl", - icon: "/icons/magic/nature/tree-animated-strike.webp", + icon: "icons/magic/nature/tree-animated-strike.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.1oT7t6tHE4kZuSN1" }, undead: { label: "DND5E.CreatureUndead", plural: "DND5E.CreatureUndeadPl", - icon: "/icons/magic/death/skull-horned-worn-fire-blue.webp", + icon: "icons/magic/death/skull-horned-worn-fire-blue.webp", reference: "Compendium.dnd5e.rules.JournalEntry.NizgRXLNUqtdlC1s.JournalEntryPage.D2BdqS1GeD5rcZ6q", detectAlignment: true }