word-games-theme 2.6.1 → 2.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/assets/js/wordfinder-home.js +22 -18
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ebf74384e793254590608ccd9a267c0c73b34325d8c3ea686f909288ddf1e1d
4
- data.tar.gz: dfa7bb09a7f47ba2017f1f0b472184df4262556e8c127892884cb963fd044811
3
+ metadata.gz: 0b29e5cfde5e0c4a157d89b64af62c0570f135dd2b5cca369e2bff769a28ee6c
4
+ data.tar.gz: 97d33b64c47719c0b0fc2f34fa0bd533174fc3728e915f5225143765d79fba6f
5
5
  SHA512:
6
- metadata.gz: 8021c2e45fd1321e7ccf3434f56667a4927a2cb269e0fcf7774dc0f8e91838c9f233beaa157b22212a0513216568b875bad04a7a7733fd9570ffdac00c766eb0
7
- data.tar.gz: 48561d4a9927efacfc1427e611ff67a1c779a03e48c3f0485047c66aa9550e5147f4da5689c48a37987536edc9cb9e10f73d1e2aa0fc712da20087eee3b6db1c
6
+ metadata.gz: 1bc3aae8975934d5b740590871ae93d7eec6fc50acac24dc8aaf13384d60aa1b1b00471dc64800ee9a1bbb56ac359b468b0c1bab1df6bda50fddae8836b151e3
7
+ data.tar.gz: fbb016773aba70c5ecd6ec8b0708cd0267d2b290c285ff798b301c3e855531c2bbe23bd0ecbbdc2215adfc1e7cff2bfc22c180c579eeaf5134b7597177d53d45
@@ -78,6 +78,7 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
78
78
  if (type === "text/javascript") {
79
79
  resourceEle = document.createElement("script");
80
80
  resourceEle.src = FILE_URL;
81
+ resourceEle.classList.add("loaded-js");
81
82
  } else if (type === "text/css") {
82
83
  resourceEle = document.createElement("link");
83
84
  resourceEle.rel = "stylesheet";
@@ -191,24 +192,27 @@ formElement.addEventListener("submit", function (e) {
191
192
  url: "{{site.url}}",
192
193
  range: "{{page.blanktilerange}}"
193
194
  }
194
- loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
195
- .then((data) => {
196
- console.log("CSS loaded:", data);
197
- })
198
- .then(() => {
199
- // Load the JavaScript file after the CSS file has loaded
200
- loadResource("/assets/js/wordfinder.js", additionalData, true, "text/javascript")
201
- .then((data) => {
202
- console.log("JavaScript loaded:", data);
203
- getData(txtBox.value.toLowerCase());
204
- })
205
- .catch((error) => {
206
- console.error("Error loading JavaScript:", error);
207
- });
208
- })
209
- .catch((error) => {
210
- console.error("Error loading CSS:", error);
211
- });
195
+ var loadJs = document.querySelector(".loaded-js");
196
+ if (loadJs == null) {
197
+ loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
198
+ .then((data) => {
199
+ console.log("CSS loaded:", data);
200
+ })
201
+ .then(() => {
202
+ // Load the JavaScript file after the CSS file has loaded
203
+ loadResource("/assets/js/wordfinder.js", additionalData, true, "text/javascript")
204
+ .then((data) => {
205
+ console.log("JavaScript loaded:", data);
206
+ getData(txtBox.value.toLowerCase());
207
+ })
208
+ .catch((error) => {
209
+ console.error("Error loading JavaScript:", error);
210
+ });
211
+ })
212
+ .catch((error) => {
213
+ console.error("Error loading CSS:", error);
214
+ });
215
+ }
212
216
  }
213
217
  });
214
218
  // Now you can use the loadScript function with additional data
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word-games-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms