word-games-theme 2.5.4 → 2.5.6

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: bdc5416f5477229735c57966afd6def5120009cb06ae1a61391b86dd46cd9cef
4
- data.tar.gz: a80cfe294cb7e04274e255b3a19931d7e9a8bc5e768c1d67733992fd760704d2
3
+ metadata.gz: 574b8489526d0d0cc8dfb240ba686abf2f3a0836ecc8a05fea4baf7bfa8854f9
4
+ data.tar.gz: ab5cbf38573d8c7930bf04a3b32568f70cdd5b1e4042809d6bb957286f2eb757
5
5
  SHA512:
6
- metadata.gz: d6f93c7d04bf7f1725ba1732107941b1d832edeeb0b24d60da832945663d277842c5a7387b06baf1a766ba45d2b1dd019316ceebd65efcd4b8d75ad8c28573ae
7
- data.tar.gz: 4670e9f3dfbaf07b00b857fc42e9c376b2946b96da4e5517a2d79b347746926a6139fe5f818d7dc6af0131d0d2ae7bd0889c6346f1ebe0b294c94dc3145ef8da
6
+ metadata.gz: a844e397e2c79e3f8eacb7c200de55d444b198780e983acc8346a0e0383a905711b17abf7dd761109bd7da5a7b3ef626fd770efde9fbacff2bce14f79314c001
7
+ data.tar.gz: 7bc3ae38414e2c4092a54297c6552f850a5298a289ffc647f1ae184381fadd7025a4f402e91e2da5b09cbea88406ad5a0743a4e13dd06367abe264bde6a9453e
@@ -8,6 +8,9 @@ let exculdeWith = document.getElementById("exculdeWith");
8
8
  let inculdeWith = document.getElementById("inculdeWith");
9
9
  let wordLength = document.getElementById("wordLength");
10
10
 
11
+ const serachSection = document.querySelector(".serachSection");
12
+ let rangeOfBlankTile = serachSection.dataset.range;
13
+
11
14
  // // when typing on input
12
15
  txtBox.addEventListener('input', (e) => {
13
16
  if (e.target.value === "") {
@@ -74,9 +77,11 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
74
77
 
75
78
  if (type === "text/javascript") {
76
79
  resourceEle = document.createElement("script");
80
+ resourceEle.src = FILE_URL;
77
81
  } else if (type === "text/css") {
78
82
  resourceEle = document.createElement("link");
79
83
  resourceEle.rel = "stylesheet";
84
+ resourceEle.href = FILE_URL;
80
85
  } else {
81
86
  reject({
82
87
  status: false,
@@ -87,7 +92,6 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
87
92
 
88
93
  resourceEle.type = type;
89
94
  resourceEle.async = async;
90
- resourceEle.href = FILE_URL;
91
95
 
92
96
  Object.keys(data).forEach((key) => {
93
97
  resourceEle.setAttribute(`data-${key}`, data[key]);
@@ -105,6 +109,8 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
105
109
  });
106
110
 
107
111
  if (type === "text/javascript") {
112
+ // console.log(resourceEle);
113
+ // console.log(FILE_URL);
108
114
  document.body.appendChild(resourceEle);
109
115
  } else if (type === "text/css") {
110
116
  document.head.appendChild(resourceEle);
@@ -114,6 +120,13 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
114
120
  const formElement = document.querySelector("#form");
115
121
  formElement.addEventListener("submit", function (e) {
116
122
  e.preventDefault();
123
+ let quesMark = "?";
124
+ if (rangeOfBlankTile) {
125
+ if (!txtBox.value.includes("?")) {
126
+ txtBox.value = txtBox.value + quesMark.repeat(rangeOfBlankTile); //
127
+ txtBox.value = txtBox.value;
128
+ }
129
+ }
117
130
 
118
131
  document.querySelector(".fillterWrapper").classList.add("hide")
119
132
  let selectedDictionary = document.querySelector(".select_dropDown2").value;
@@ -181,16 +194,20 @@ formElement.addEventListener("submit", function (e) {
181
194
  loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
182
195
  .then((data) => {
183
196
  console.log("CSS loaded:", data);
184
- // Once the CSS is loaded, create the script element for JavaScript
185
- const jsScript = document.createElement("script");
186
- jsScript.src = "/assets/js/wordfinder.js";
187
- jsScript.onload = () => {
188
- getData(txtBox.value.toLowerCase());
189
- };
190
- 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
+ });
191
208
  })
192
209
  .catch((error) => {
193
- console.error("Error loading resource:", error);
210
+ console.error("Error loading CSS:", error);
194
211
  });
195
212
  }
196
213
  });
@@ -206,17 +223,20 @@ function checkQueryParam() {
206
223
  loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
207
224
  .then((data) => {
208
225
  console.log("CSS loaded:", data);
209
- // Once the CSS is loaded, create the script element for JavaScript
210
- const jsScript = document.createElement("script");
211
- jsScript.src = "/assets/js/wordfinder.js";
212
- jsScript.onload = () => {
213
- console.log("JS loaded");
214
- getData(txtBox.value.toLowerCase());
215
- };
216
- 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
+ });
217
237
  })
218
238
  .catch((error) => {
219
- console.error("Error loading resource:", error);
239
+ console.error("Error loading CSS:", error);
220
240
  });
221
241
  }
222
242
  }
@@ -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.4
4
+ version: 2.5.6
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