word-games-theme 2.7.0 → 2.7.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6211980f468bd7efdc4bf3e06ceb15354885be1a9f3194a41e60efdfef536c5b
4
- data.tar.gz: e341aa5d5700467ad2c1e920b77866f8633c9916587aa02415ff34eebdf631a9
3
+ metadata.gz: fa6b5d2626682b813605058ed8d761a3fd01167d07c83377bc01b810c1e148f2
4
+ data.tar.gz: 74d110d207334c2b00f08a3180cbba582bd189577089b9b64f50a32d31b57e91
5
5
  SHA512:
6
- metadata.gz: e3298f7f2a8f849e740c51918e0c6d0947f5203c64f2aab6612be1276b6ab7924d5736581c4d4930a20465eee1020c68aa0f4e4a2a3eb08a6cba0249e9af448c
7
- data.tar.gz: dc3e8ad7318eb821776787cac506ef8659f80e91cbfcf39c3cfd14ce655e0303d27153bab3fb19fdb55fb089df61b93df3afc07ab0b386e1fed2525f2603f476
6
+ metadata.gz: 3908ca69d49cb55fd9d175eed49b5a791bab3480a166fe48e92a423efa0bc64bb8b2615a37309b47b445b56955e83e0986eb9efef018535d63023c291ab2450a
7
+ data.tar.gz: 9ca3a12a3443e92c3e20742ca7c33630cf36242546885a2e9e05aca0cd52f6a1dd8d4d00e8fc688f63c5c4decd38ec4b77d6b62257969c83522a54296c46e632
@@ -62,10 +62,10 @@
62
62
  {%- if page.language -%}
63
63
  <script>
64
64
  const select_dropDown2 = document.querySelector(".select_dropDown2")
65
- select_dropDown2[0].style.display = "none"
66
- select_dropDown2[1].style.display = "none"
67
- select_dropDown2[2].style.display = "none"
68
- select_dropDown2[3].style.display = "none"
65
+ select_dropDown2.style.display = "none"
66
+ // select_dropDown2[1].style.display = "none"
67
+ // select_dropDown2[2].style.display = "none"
68
+ // select_dropDown2[3].style.display = "none"
69
69
  </script>
70
70
  {%- endif -%}
71
71
 
data/_layouts/page.html CHANGED
@@ -18,8 +18,11 @@
18
18
 
19
19
  {%- include script.html -%}
20
20
 
21
+
22
+
21
23
  {%- if site.versioning -%}
22
24
 
25
+
23
26
  <script defer src="{{ site.baseurl }}/{% ministamp assets/js/leftNav.js assets/js/leftNav.js %}"></script>
24
27
  {%- if page.tool == "words-that-start-with-the-letters" -%}
25
28
  <script defer src="{{ site.baseurl }}/{% ministamp assets/js/words-starting-with.js assets/js/words-starting-with.js %}"></script>
@@ -46,6 +49,15 @@
46
49
  {%- endif -%}
47
50
 
48
51
 
52
+
53
+
54
+
55
+ {%- if page.language -%}
56
+ <script>
57
+ select_dropDown2.style.display = "none"
58
+ </script>
59
+ {%- endif -%}
60
+
49
61
  </body>
50
62
 
51
63
  </html>
@@ -80,12 +80,15 @@
80
80
  {%- if page.language -%}
81
81
  <script>
82
82
  const select_dropDown2 = document.querySelector(".select_dropDown2")
83
- select_dropDown2[0].style.display = "none"
83
+ select_dropDown2select_dropDown2.style.display = "none"
84
84
  select_dropDown2[1].style.display = "none"
85
85
  select_dropDown2[2].style.display = "none"
86
86
  select_dropDown2[3].style.display = "none"
87
87
  </script>
88
88
  {%- endif -%}
89
+
90
+
91
+
89
92
  <script defer src="/assets/js/theme.js"></script>
90
93
 
91
94
  {%- if site.noResultPage and page.letter-%}
@@ -0,0 +1,251 @@
1
+ let txtBox = document.querySelector('.txtBox')
2
+ txtBox.focus()
3
+ let letterCloseButton = document.querySelector('.letter-close-button')
4
+ let startsWith = document.getElementById("startsWith");
5
+ let mustInclude = document.getElementById("mustInclude");
6
+ let endsWith = document.getElementById("endsWith");
7
+ let exculdeWith = document.getElementById("exculdeWith");
8
+ let inculdeWith = document.getElementById("inculdeWith");
9
+ let wordLength = document.getElementById("wordLength");
10
+
11
+ const serachSection = document.querySelector(".serachSection");
12
+ let rangeOfBlankTile = serachSection.dataset.range;
13
+
14
+ // // when typing on input
15
+ txtBox.addEventListener('input', (e) => {
16
+ if (e.target.value === "") {
17
+ letterCloseButton.style.display = "none"
18
+ }
19
+ else {
20
+ letterCloseButton.style.display = "block"
21
+ }
22
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
23
+ let rangeOfBlankTile = 3
24
+ if (rangeOfBlankTile === "") {
25
+ rangeOfBlankTile = 3
26
+ }
27
+ e.target.value = e.target.value.replace(/ /g, '?')
28
+ let data = []
29
+ data = e.target.value.split('').filter((i) => i === '?')
30
+ if (data.length > rangeOfBlankTile) {
31
+ e.target.value = e.target.value.replace(/\?$/, '')
32
+ }
33
+ })
34
+ letterCloseButton.addEventListener("click", () => {
35
+ txtBox.value = ""
36
+ letterCloseButton.style.display = "none"
37
+ })
38
+ //tooltips for advanced filter
39
+ const filterInputs = document.querySelectorAll('.filter_val');
40
+ Array.from(filterInputs).forEach((item) => {
41
+ item.addEventListener("input", (e) => {
42
+ const inputValue = e.target.value;
43
+ const parentElement = e.target.parentElement;
44
+ const imgElement = parentElement.querySelector('img');
45
+ const tooltipElement = parentElement.querySelector('.filter-tooltip');
46
+
47
+ if (inputValue == "") {
48
+ imgElement.src = "/assets/images/questionmark.svg"
49
+ setTimeout(() => {
50
+ item.nextElementSibling.setAttribute("data-tip", item.nextElementSibling.id)
51
+ }, 100);
52
+ tooltipElement.style.setProperty('--tooltip-padding', '0.5rem');
53
+ tooltipElement.style.setProperty('--tooltip-border-style', 'soild');
54
+
55
+ } else {
56
+ item.nextElementSibling.removeAttribute("data-tip")
57
+ imgElement.src = "/assets/images/close-btn.svg"
58
+ tooltipElement.style.setProperty('--tooltip-padding', '0');
59
+ tooltipElement.style.setProperty('--tooltip-border-style', 'none');
60
+ }
61
+ item.nextElementSibling.addEventListener("click", () => {
62
+ e.target.value = ""
63
+ imgElement.src = "/assets/images/questionmark.svg"
64
+ setTimeout(() => {
65
+ item.nextElementSibling.setAttribute("data-tip", item.nextElementSibling.id)
66
+ }, 100);
67
+ tooltipElement.style.setProperty('--tooltip-padding', '0.5rem');
68
+ tooltipElement.style.setProperty('--tooltip-border-style', 'soild');
69
+ })
70
+ })
71
+ })
72
+
73
+
74
+ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript") => {
75
+ return new Promise((resolve, reject) => {
76
+ let resourceEle;
77
+
78
+ if (type === "text/javascript") {
79
+ resourceEle = document.createElement("script");
80
+ resourceEle.src = FILE_URL;
81
+ resourceEle.classList.add("loaded-js");
82
+ } else if (type === "text/css") {
83
+ resourceEle = document.createElement("link");
84
+ resourceEle.rel = "stylesheet";
85
+ resourceEle.href = FILE_URL;
86
+ } else {
87
+ reject({
88
+ status: false,
89
+ message: `Unsupported resource type: ${type}`,
90
+ });
91
+ return;
92
+ }
93
+
94
+ resourceEle.type = type;
95
+ resourceEle.async = async;
96
+
97
+ Object.keys(data).forEach((key) => {
98
+ resourceEle.setAttribute(`data-${key}`, data[key]);
99
+ });
100
+
101
+ resourceEle.addEventListener("load", () => {
102
+ resolve({ status: true });
103
+ });
104
+
105
+ resourceEle.addEventListener("error", () => {
106
+ reject({
107
+ status: false,
108
+ message: `Failed to load the resource ${FILE_URL}`,
109
+ });
110
+ });
111
+
112
+ if (type === "text/javascript") {
113
+ // console.log(resourceEle);
114
+ // console.log(FILE_URL);
115
+ document.body.appendChild(resourceEle);
116
+ } else if (type === "text/css") {
117
+ document.head.appendChild(resourceEle);
118
+ }
119
+ });
120
+ };
121
+ const formElement = document.querySelector("#form");
122
+ formElement.addEventListener("submit", function (e) {
123
+ e.preventDefault();
124
+ if (txtBox.value != "" || startsWith.value != "" || endsWith.value != "" || mustInclude.value != "" || exculdeWith.value != "" || inculdeWith.value != "" || wordLength.value != "") {
125
+ let quesMark = "?";
126
+ if (rangeOfBlankTile) {
127
+ if (!txtBox.value.includes("?")) {
128
+ txtBox.value = txtBox.value + quesMark.repeat(rangeOfBlankTile); //
129
+ txtBox.value = txtBox.value;
130
+ }
131
+ }
132
+ document.querySelector(".fillterWrapper").classList.add("hide")
133
+ let selectedDictionary = document.querySelector(".select_dropDown2").value;
134
+ if (history.pushState) {
135
+ var newurl =
136
+ window.location.protocol +
137
+ "//" +
138
+ window.location.host +
139
+ window.location.pathname +
140
+ "?" +
141
+ "search" +
142
+ "=" +
143
+ txtBox.value.toLowerCase() +
144
+ "&" +
145
+ "dictionary" +
146
+ "=" +
147
+ selectedDictionary +
148
+ "&" +
149
+ "prefix" +
150
+ "=" +
151
+ startsWith.value +
152
+ "&" +
153
+ "contains" +
154
+ "=" +
155
+ mustInclude.value +
156
+ "&" +
157
+ "suffix" +
158
+ "=" +
159
+ endsWith.value +
160
+ "&" +
161
+ "exclude" +
162
+ "=" +
163
+ exculdeWith.value +
164
+ "&" +
165
+ "include" +
166
+ "=" +
167
+ inculdeWith.value +
168
+ "&" +
169
+ "length" +
170
+ "=" +
171
+ wordLength.value;
172
+ window.history.pushState({ path: newurl }, "", newurl);
173
+
174
+ const params = new URLSearchParams(window.location.search);
175
+ serachValue = params.get("search");
176
+ prefixValue = params.get("prefix");
177
+ containsValue = params.get("contains");
178
+ suffixValue = params.get("suffix");
179
+ exculdeValue = params.get("exclude");
180
+ includeValue = params.get("include");
181
+ lengthValue = params.get("length");
182
+ dictonary = params.get("dictionary");
183
+
184
+ gtag("event", "page_view", {
185
+ page_location: window.location.pathname + location.search,
186
+ });
187
+ }
188
+ const paramName = 'search';
189
+ if (new URLSearchParams(window.location.search).has(paramName)) {
190
+ const additionalData = {
191
+ url: "{{site.url}}",
192
+ range: "{{page.blanktilerange}}"
193
+ }
194
+ var loadJs = document.querySelector(".loaded-js");
195
+ if (loadJs == null) {
196
+ loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
197
+ .then((data) => {
198
+ console.log("CSS loaded:", data);
199
+ })
200
+ .then(() => {
201
+ // Load the JavaScript file after the CSS file has loaded
202
+ loadResource("/assets/js/other-lang-wordScrabble.js", additionalData, true, "text/javascript")
203
+ .then((data) => {
204
+ console.log("JavaScript loaded:", data);
205
+ getData(txtBox.value.toLowerCase());
206
+ })
207
+ .catch((error) => {
208
+ console.error("Error loading JavaScript:", error);
209
+ });
210
+ })
211
+ .catch((error) => {
212
+ console.error("Error loading CSS:", error);
213
+ });
214
+ }
215
+ }
216
+ } else {
217
+ console.log("Please Enter Valid Letters.");
218
+ }
219
+ });
220
+ // Now you can use the loadScript function with additional data
221
+ function checkQueryParam() {
222
+ const urlParams = new URLSearchParams(window.location.search);
223
+ const paramName = 'search';
224
+ if (urlParams.has(paramName)) {
225
+ const additionalData = {
226
+ url: "{{site.url}}",
227
+ range: "{{page.blanktilerange}}"
228
+ };
229
+ loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
230
+ .then((data) => {
231
+ console.log("CSS loaded:", data);
232
+ })
233
+ .then(() => {
234
+ // Load the JavaScript file after the CSS file has loaded
235
+ loadResource("/assets/js/other-lang-wordScrabble.js", additionalData, true, "text/javascript")
236
+ .then((data) => {
237
+ console.log("JavaScript loaded:", data);
238
+ getData(txtBox.value.toLowerCase());
239
+ })
240
+ .catch((error) => {
241
+ console.error("Error loading JavaScript:", error);
242
+ });
243
+ })
244
+ .catch((error) => {
245
+ console.error("Error loading CSS:", error);
246
+ });
247
+ }
248
+ }
249
+ checkQueryParam();
250
+
251
+
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.7.0
4
+ version: 2.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
@@ -381,6 +381,7 @@ files:
381
381
  - assets/js/leftNav.js
382
382
  - assets/js/multiple-word-anagram-solver.js
383
383
  - assets/js/noRefreshAds.js
384
+ - assets/js/other-lang-wordScrabble-home.js
384
385
  - assets/js/other-lang-wordScrabble.js
385
386
  - assets/js/repeat-letters.js
386
387
  - assets/js/resultPage.js