From 558e132b6e0e8620827e640b77fa9fcce8b9ee06 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Sun, 3 Jan 2021 12:51:06 +0200 Subject: [PATCH] Replace theme colors in color-selector.js when exported Affects issues: - Fixed #1666 --- .../djrapitops/plan/delivery/export/NetworkPageExporter.java | 2 +- .../com/djrapitops/plan/delivery/export/PlayerPageExporter.java | 2 +- .../djrapitops/plan/delivery/export/PlayersPageExporter.java | 2 +- .../com/djrapitops/plan/delivery/export/ServerPageExporter.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java index 2135ed547..7ab9affe5 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/NetworkPageExporter.java @@ -215,7 +215,7 @@ public class NetworkPageExporter extends FileExporter { () -> files.getResourceFromJar("web/" + resourceName).asWebResource()); Path to = toDirectory.resolve(resourceName); - if (resourceName.endsWith(".css")) { + if (resourceName.endsWith(".css") || resourceName.endsWith("color-selector.js")) { export(to, theme.replaceThemeColors(resource.asString())); } else if ("js/network-values.js".equalsIgnoreCase(resourceName) || "js/sessionAccordion.js".equalsIgnoreCase(resourceName)) { String relativePlayerLink = toRelativePathFromRoot("player"); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java index 12b2051e0..b78397995 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayerPageExporter.java @@ -191,7 +191,7 @@ public class PlayerPageExporter extends FileExporter { () -> files.getResourceFromJar("web/" + resourceName).asWebResource()); Path to = toDirectory.resolve(resourceName); - if (resourceName.endsWith(".css")) { + if (resourceName.endsWith(".css") || resourceName.endsWith("color-selector.js")) { export(to, theme.replaceThemeColors(resource.asString())); } else if (Resource.isTextResource(resourceName)) { export(to, resource.asString()); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java index 49ecc1fb2..af47eb6b3 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/PlayersPageExporter.java @@ -164,7 +164,7 @@ public class PlayersPageExporter extends FileExporter { () -> files.getResourceFromJar("web/" + resourceName).asWebResource()); Path to = toDirectory.resolve(resourceName); - if (resourceName.endsWith(".css")) { + if (resourceName.endsWith(".css") || resourceName.endsWith("color-selector.js")) { export(to, theme.replaceThemeColors(resource.asString())); } else if (Resource.isTextResource(resourceName)) { export(to, resource.asString()); diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java index 91fd4262d..d9cf723f0 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/export/ServerPageExporter.java @@ -234,7 +234,7 @@ public class ServerPageExporter extends FileExporter { () -> files.getResourceFromJar("web/" + resourceName).asWebResource()); Path to = toDirectory.resolve(resourceName); - if (resourceName.endsWith(".css")) { + if (resourceName.endsWith(".css") || resourceName.endsWith("color-selector.js")) { export(to, theme.replaceThemeColors(resource.asString())); } else if (Resource.isTextResource(resourceName)) { export(to, resource.asString());