From ff6f960a84633fee021b92eff17709be5650b7fb Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+Rsl1122@users.noreply.github.com> Date: Fri, 20 Mar 2020 09:43:33 +0200 Subject: [PATCH] Renamed Resource snippet Positions --- .../plan/delivery/web/ResourceService.java | 8 ++++---- .../djrapitops/plan/delivery/web/ResourceSvc.java | 14 +++++++------- .../src/main/resources/assets/plan/web/error.html | 2 ++ .../main/resources/assets/plan/web/network.html | 2 +- .../src/main/resources/assets/plan/web/player.html | 2 +- .../main/resources/assets/plan/web/players.html | 2 +- .../src/main/resources/assets/plan/web/server.html | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResourceService.java b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResourceService.java index acb52510f..97b394b69 100644 --- a/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResourceService.java +++ b/Plan/api/src/main/java/com/djrapitops/plan/delivery/web/ResourceService.java @@ -73,19 +73,19 @@ public interface ResourceService { /** * Loaded before page contents. */ - HEAD, + PRE_CONTENT, /** - * Loaded after page contents. + * Loaded after library scripts. *
* Recommended for modifying the structure of the page or loading libraries. */ - BODY, + PRE_MAIN_SCRIPT, /** * Loaded after script execution. *
* Recommended for loading data to custom structure on the page. */ - BODY_END + AFTER_MAIN_SCRIPT } class Holder { diff --git a/Plan/common/src/main/java/com/djrapitops/plan/delivery/web/ResourceSvc.java b/Plan/common/src/main/java/com/djrapitops/plan/delivery/web/ResourceSvc.java index 533951e9f..182f59d82 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/delivery/web/ResourceSvc.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/delivery/web/ResourceSvc.java @@ -84,23 +84,23 @@ public class ResourceSvc implements ResourceService { return "Error: Given resource did not support WebResource#asString method properly and returned 'null'"; } - StringBuilder toHead = byPosition.get(Position.HEAD); + StringBuilder toHead = byPosition.get(Position.PRE_CONTENT); if (toHead != null) { html = StringUtils.replaceOnce(html, "", toHead.append("").toString()); } - StringBuilder toBody = byPosition.get(Position.BODY); + StringBuilder toBody = byPosition.get(Position.PRE_MAIN_SCRIPT); if (toBody != null) { - if (StringUtils.contains(html, "")) { - html = StringUtils.replaceOnce(html, "", toBody.toString()); + if (StringUtils.contains(html, " + +