word-games-theme 2.5.5 → 2.5.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9dfb0ef73b39f27d54a383d3e8bcd2c1b2ba3c56a703939b5777741e32fa3c07
4
- data.tar.gz: 4716ac1c8a0b3e91d1b7e22b0d66d69d916942fced5cb8ad9520ee286d843595
3
+ metadata.gz: db8009b82a57d188fc729ce57e6323e65fd76bd38c829fa9fff70a921070fee9
4
+ data.tar.gz: cd0391b5eba53f1601377274aa7deced632b1f359ffa847ec11bd44d52273714
5
5
  SHA512:
6
- metadata.gz: 9605cbc5465ad358d9dad94b559b636801dc5cc5f9d03b928c227178f59741f5e7c6e0f990e99e95fd301b6b540edc98691521350d1f1e69e38a8d604644ebfe
7
- data.tar.gz: ea1c8aea7c2a1140023a65ba24d73c816db084f65279e8c8ee4f45ea89d3ad5a3045b84e68821cd38e77800fe09fdb6e26708dc2d6141c82874de461fdc18702
6
+ metadata.gz: 85768a403ee1aceb690f4bbe5c614d4e33c11025e54064f54725696b4c25635813a6fd4cdb7f1c8998aceeaaefab5d79a2ebd3032471324a0b92300713744d51
7
+ data.tar.gz: 1f0987e0b434536427489bfc5dc2b8574b59f22dc658d5d3b77470c9a76d147d3ab3dac30bcbbac686b8a094f18fabae78abe81ffe3b9806ada984762067597f
@@ -77,9 +77,11 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
77
77
 
78
78
  if (type === "text/javascript") {
79
79
  resourceEle = document.createElement("script");
80
+ resourceEle.src = FILE_URL;
80
81
  } else if (type === "text/css") {
81
82
  resourceEle = document.createElement("link");
82
83
  resourceEle.rel = "stylesheet";
84
+ resourceEle.href = FILE_URL;
83
85
  } else {
84
86
  reject({
85
87
  status: false,
@@ -90,7 +92,6 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
90
92
 
91
93
  resourceEle.type = type;
92
94
  resourceEle.async = async;
93
- resourceEle.href = FILE_URL;
94
95
 
95
96
  Object.keys(data).forEach((key) => {
96
97
  resourceEle.setAttribute(`data-${key}`, data[key]);
@@ -108,6 +109,8 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
108
109
  });
109
110
 
110
111
  if (type === "text/javascript") {
112
+ // console.log(resourceEle);
113
+ // console.log(FILE_URL);
111
114
  document.body.appendChild(resourceEle);
112
115
  } else if (type === "text/css") {
113
116
  document.head.appendChild(resourceEle);
@@ -191,16 +194,20 @@ formElement.addEventListener("submit", function (e) {
191
194
  loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
192
195
  .then((data) => {
193
196
  console.log("CSS loaded:", data);
194
- // Once the CSS is loaded, create the script element for JavaScript
195
- const jsScript = document.createElement("script");
196
- jsScript.src = "/assets/js/wordfinder.js";
197
- jsScript.onload = () => {
198
- getData(txtBox.value.toLowerCase());
199
- };
200
- document.body.appendChild(jsScript);
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
+ });
201
208
  })
202
209
  .catch((error) => {
203
- console.error("Error loading resource:", error);
210
+ console.error("Error loading CSS:", error);
204
211
  });
205
212
  }
206
213
  });
@@ -216,17 +223,20 @@ function checkQueryParam() {
216
223
  loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
217
224
  .then((data) => {
218
225
  console.log("CSS loaded:", data);
219
- // Once the CSS is loaded, create the script element for JavaScript
220
- const jsScript = document.createElement("script");
221
- jsScript.src = "/assets/js/wordfinder.js";
222
- jsScript.onload = () => {
223
- console.log("JS loaded");
224
- getData(txtBox.value.toLowerCase());
225
- };
226
- document.body.appendChild(jsScript);
226
+ })
227
+ .then(() => {
228
+ // Load the JavaScript file after the CSS file has loaded
229
+ loadResource("/assets/js/wordfinder.js", additionalData, true, "text/javascript")
230
+ .then((data) => {
231
+ console.log("JavaScript loaded:", data);
232
+ getData(txtBox.value.toLowerCase());
233
+ })
234
+ .catch((error) => {
235
+ console.error("Error loading JavaScript:", error);
236
+ });
227
237
  })
228
238
  .catch((error) => {
229
- console.error("Error loading resource:", error);
239
+ console.error("Error loading CSS:", error);
230
240
  });
231
241
  }
232
242
  }
@@ -122,9 +122,9 @@ if (lengthValue === '1') {
122
122
  lengthValue = params.get('length')
123
123
  dictonary = params.get('dictionary')
124
124
 
125
- gtag('event', 'page_view', {
126
- page_location: window.location.pathname + location.search,
127
- })
125
+ // gtag('event', 'page_view', {
126
+ // page_location: window.location.pathname + location.search,
127
+ // })
128
128
  }
129
129
  getData(txtBox.value.toLowerCase())
130
130
  addFilterCount()
@@ -73,9 +73,11 @@ const loadResource = (FILE_URL, async = true, type = "text/javascript") => {
73
73
 
74
74
  if (type === "text/javascript") {
75
75
  resourceEle = document.createElement("script");
76
+ resourceEle.src = FILE_URL;
76
77
  } else if (type === "text/css") {
77
78
  resourceEle = document.createElement("link");
78
79
  resourceEle.rel = "stylesheet";
80
+ resourceEle.href = FILE_URL;
79
81
  } else {
80
82
  reject({
81
83
  status: false,
@@ -86,7 +88,7 @@ const loadResource = (FILE_URL, async = true, type = "text/javascript") => {
86
88
 
87
89
  resourceEle.type = type;
88
90
  resourceEle.async = async;
89
- resourceEle.href = FILE_URL;
91
+
90
92
 
91
93
 
92
94
  resourceEle.addEventListener("load", () => {
@@ -171,19 +173,23 @@ formElement.addEventListener("submit", function (e) {
171
173
  const paramName = 'search';
172
174
  if (new URLSearchParams(window.location.search).has(paramName)) {
173
175
  loadResource("/assets/css/wordfinder-result.css", true, "text/css")
174
- .then((data) => {
175
- console.log("CSS loaded:", data);
176
- // Once the CSS is loaded, create the script element for JavaScript
177
- const jsScript = document.createElement("script");
178
- jsScript.src = "/assets/js/xletter-result.js";
179
- jsScript.onload = () => {
176
+ .then((data) => {
177
+ console.log("CSS loaded:", data);
178
+ })
179
+ .then(() => {
180
+ // Load the JavaScript file after the CSS file has loaded
181
+ loadResource("/assets/js/xletter-result.js", true, "text/javascript")
182
+ .then((data) => {
183
+ console.log("JavaScript loaded:", data);
180
184
  getData(txtBox.value.toLowerCase());
181
- };
182
- document.body.appendChild(jsScript);
183
- })
184
- .catch((error) => {
185
- console.error("Error loading resource:", error);
186
- });
185
+ })
186
+ .catch((error) => {
187
+ console.error("Error loading JavaScript:", error);
188
+ });
189
+ })
190
+ .catch((error) => {
191
+ console.error("Error loading CSS:", error);
192
+ });
187
193
  }
188
194
  });
189
195
 
@@ -192,21 +198,24 @@ function checkQueryParam() {
192
198
  const urlParams = new URLSearchParams(window.location.search);
193
199
  const paramName = 'search';
194
200
  if (urlParams.has(paramName)) {
195
- loadResource("/assets/css/wordfinder-result.css", true, "text/css")
196
- .then((data) => {
197
- console.log("CSS loaded:", data);
198
- // Once the CSS is loaded, create the script element for JavaScript
199
- const jsScript = document.createElement("script");
200
- jsScript.src = "/assets/js/xletter-result.js";
201
- jsScript.onload = () => {
202
- console.log("JS loaded");
201
+ loadResource("/assets/css/wordfinder-result.css", true, "text/css")
202
+ .then((data) => {
203
+ console.log("CSS loaded:", data);
204
+ })
205
+ .then(() => {
206
+ // Load the JavaScript file after the CSS file has loaded
207
+ loadResource("/assets/js/xletter-result.js", true, "text/javascript")
208
+ .then((data) => {
209
+ console.log("JavaScript loaded:", data);
203
210
  getData(txtBox.value.toLowerCase());
204
- };
205
- document.body.appendChild(jsScript);
206
- })
207
- .catch((error) => {
208
- console.error("Error loading resource:", error);
209
- });
211
+ })
212
+ .catch((error) => {
213
+ console.error("Error loading JavaScript:", error);
214
+ });
215
+ })
216
+ .catch((error) => {
217
+ console.error("Error loading CSS:", error);
218
+ });
210
219
  }
211
220
  }
212
221
  checkQueryParam();
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: word-games-theme
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.5
4
+ version: 2.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-02-15 00:00:00.000000000 Z
11
+ date: 2024-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll