From e74aeb00012cfd024868e31d489c454b083ac38a Mon Sep 17 00:00:00 2001 From: Half-Shot <willh@element.io> Date: Thu, 10 Feb 2022 07:33:09 +0000 Subject: [PATCH] Namespace CONFIG_LOCATION to CHATTERBOX_CONFIG_LOCATION --- README.md | 2 +- index.html | 2 +- src/parent.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9740001..5bf40f7 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ Follow the develop instructions above (steps 1-3), then: Assuming that the build output (inside `/target`) is hosted at `<root>` (eg: chatterbox.element.io), copy and paste the following snippet before the closing `</body>` tag: ```html <script> - window.CONFIG_LOCATION = "path_to_config"; + window.CHATTERBOX_CONFIG_LOCATION = "path_to_config"; </script> <script src="<root>/parent/assets/parent.js" type="module" id="chatterbox-script"></script> ``` diff --git a/index.html b/index.html index 5b278a8..884aeb6 100644 --- a/index.html +++ b/index.html @@ -34,7 +34,7 @@ </div> </div> <script> - window.CONFIG_LOCATION = "./config.json"; + window.CHATTERBOX_CONFIG_LOCATION = "./config.json"; </script> <script src="./src/parent.ts" type="module" id="chatterbox-script"></script> </body> diff --git a/src/parent.ts b/src/parent.ts index 7a22a9f..b414418 100644 --- a/src/parent.ts +++ b/src/parent.ts @@ -52,9 +52,9 @@ function loadCSS() { function loadChatterboxIframe() { const iframe = document.createElement("iframe"); - const configLocation = (window as any).CONFIG_LOCATION; + const configLocation = (window as any).CHATTERBOX_CONFIG_LOCATION; if (!configLocation) { - throw new Error("CONFIG_LOCATION is not set"); + throw new Error("CHATTERBOX_CONFIG_LOCATION is not set"); } iframe.src = new URL("../chatterbox.html?config=" + configLocation, hostRoot).href; iframe.className = "chatterbox-iframe"; -- GitLab