From 9605c7341fbf96e4cb3390fa1ee18dba04d8f863 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Fri, 13 Oct 2023 14:06:41 -0400 Subject: [PATCH 1/2] move assets into static dir at root --- includes/CTB.php | 2 +- {includes/assets => static}/a11y-dialog.min.js | 0 {includes/assets => static}/ctb.css | 0 {includes/assets => static}/ctb.js | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename {includes/assets => static}/a11y-dialog.min.js (100%) rename {includes/assets => static}/ctb.css (100%) rename {includes/assets => static}/ctb.js (100%) diff --git a/includes/CTB.php b/includes/CTB.php index 6b4615e..468427c 100644 --- a/includes/CTB.php +++ b/includes/CTB.php @@ -37,7 +37,7 @@ public function __construct( Container $container ) { * @return void */ public function ctb_scripts() { - $assetsDir = container()->plugin()->url . 'vendor/newfold-labs/wp-module-global-ctb/includes/assets/'; + $assetsDir = container()->plugin()->url . 'vendor/newfold-labs/wp-module-global-ctb/static/'; // load the a11y dialog lib wp_register_script( diff --git a/includes/assets/a11y-dialog.min.js b/static/a11y-dialog.min.js similarity index 100% rename from includes/assets/a11y-dialog.min.js rename to static/a11y-dialog.min.js diff --git a/includes/assets/ctb.css b/static/ctb.css similarity index 100% rename from includes/assets/ctb.css rename to static/ctb.css diff --git a/includes/assets/ctb.js b/static/ctb.js similarity index 100% rename from includes/assets/ctb.js rename to static/ctb.js From edc36503f8218283a8fccc6640035348af04ef91 Mon Sep 17 00:00:00 2001 From: Evan Mullins Date: Fri, 13 Oct 2023 14:07:40 -0400 Subject: [PATCH 2/2] remove double slash in endpoint url --- static/ctb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/ctb.js b/static/ctb.js index bbd6a72..5fe26ff 100644 --- a/static/ctb.js +++ b/static/ctb.js @@ -13,7 +13,7 @@ // handle click to receive ctb iframe url window.fetch( - `${window.NewfoldRuntime.restUrl}/newfold-ctb/v2/ctb/${ctbId}`, + `${window.NewfoldRuntime.restUrl}newfold-ctb/v2/ctb/${ctbId}`, { credentials: 'same-origin', headers: {