word-games-theme 2.6.8 → 2.7.0

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: 137fe43b5869a4d3dbbd7b1a67da8b8cd3dbf58e76db6eb2c425f57b114edfb8
4
- data.tar.gz: 85cfa82687767c010b3286fef9afc21bdbb969d036291b73a15c4fdd602c0c97
3
+ metadata.gz: 6211980f468bd7efdc4bf3e06ceb15354885be1a9f3194a41e60efdfef536c5b
4
+ data.tar.gz: e341aa5d5700467ad2c1e920b77866f8633c9916587aa02415ff34eebdf631a9
5
5
  SHA512:
6
- metadata.gz: 8f05e34319a8114f9e5e66e4275b9944226e648929d55c3b3e8ab4faabade67587d551af5e89b7188393e4746ab3a8c793c9d84619fe78947e2980ae5b1af23c
7
- data.tar.gz: 2c21976c0eb1e9f0f28dc62dea0df68d0fcc3902c80338752f9e1474926043b88284568c5ef7e70a9a26df1539bc48760f375beea915bffaea669bfa1ec3beff
6
+ metadata.gz: e3298f7f2a8f849e740c51918e0c6d0947f5203c64f2aab6612be1276b6ab7924d5736581c4d4930a20465eee1020c68aa0f4e4a2a3eb08a6cba0249e9af448c
7
+ data.tar.gz: dc3e8ad7318eb821776787cac506ef8659f80e91cbfcf39c3cfd14ce655e0303d27153bab3fb19fdb55fb089df61b93df3afc07ab0b386e1fed2525f2603f476
@@ -5,6 +5,8 @@
5
5
  </button>
6
6
  </div>
7
7
 
8
+
9
+
8
10
  <div class="fillterWrapper my-5 filterShow">
9
11
  <div class="startsWith">
10
12
  <input class="filter_val" autocomplete="off" type="text" id="startsWith" placeholder="Starts with" value=""
@@ -19,7 +19,7 @@
19
19
  {% endif %}
20
20
  <button id="button-toggle" class="navbar-toggler" type="button" data-toggle="collapse"
21
21
  data-target="#navbarSupportedContent" aria-label="bars-toggle-icon">
22
- <img src="/assets/images/hamburger-menu.svg" alt="hamburger-menu">
22
+ <img src="/assets/images/hamburger-menu.svg" alt="hamburger-menu" width="30px" height="30px">
23
23
  </button>
24
24
  <div class="mobile-top-bar collapse navbar-collapse justify-content-end" id="navbarSupportedContent">
25
25
  <div class="navbar-nav">
@@ -5,6 +5,8 @@
5
5
  <div class="mt-4 top-banner-ad"></div>
6
6
  <div class="mt-4 bottom-banner-ad"></div>
7
7
  <div class="container">
8
+
9
+
8
10
  <div class="pageHeading text-center" style="margin:22px 0px">
9
11
  <h1 class="heading pb-0 mb-3">
10
12
  {{dataToShow.h1}}</h1>
@@ -1,4 +1,5 @@
1
1
  {%- if site.noResultPage or page.noResultPage -%}
2
+
2
3
  <div class="serachSection" data-url="{{site.url}}" data-range="{{page.blanktilerange}}" data-letter="{{page.letter}}" data-ablank="{{page.ablank}}">
3
4
  <div class="position-relative serachBox">
4
5
  <form id='form' method="GET">
@@ -6,9 +7,9 @@
6
7
  <div class="txt-box-container" style="position: relative;">
7
8
  <input type="text"
8
9
  placeholder="{% if page.size > 15 %}Enter up to {{page.size}} letters?{% else %}Enter up to 15 letters?{% endif %}"
9
- class="txtBox" value='' name="search"
10
+ class="txtBox" name="search"
10
11
  maxlength="{% if page.size > 15 %}{{page.size}}{% else %}15?{% endif %}"
11
- autocomplete="off">
12
+ autocomplete="off" value="{{page.value}}">
12
13
  <div class="letter-close-button">
13
14
  <img width="40px" height="40px" src="/assets/images/close-button.svg" alt="close-btn">
14
15
  </div>
@@ -39,6 +40,7 @@
39
40
 
40
41
  {%- else -%}
41
42
  <div class="container-fluid" id="containerWd">
43
+
42
44
  <div class="serachSection">
43
45
  <div class="position-relative serachBox">
44
46
  <form action="{% if page.url == '/' %}/result{% else %}{{page.url}}/result{% endif %}" id='form'
@@ -14,7 +14,7 @@
14
14
  <div class="wordCount"><strong>
15
15
  {{dataToShow.wordLength}}
16
16
  </strong></div>
17
-
17
+
18
18
  <div class="d-none tab_link_wrapper" style="position: relative;">
19
19
  <div id="tab-scroll" class="tab-scroll flex-row">
20
20
  <input type="button" name="" id="prev" class="prev tabsBg noOutline cursorPointer" value=" "
@@ -41,7 +41,7 @@
41
41
  </div>
42
42
  <div class="wrapper_dropDown mt-3 d-flex justify-content-end" style="gap:10px;">
43
43
  <div class="letter-length">
44
- <select class="form-select length-select" onchange="Filtering(2)">
44
+ <select class="form-select length-select xyz-length-select" onchange="Filtering(2)">
45
45
  <option selected="true" hidden>Letter Length</option>
46
46
  {%- for scrabblewords in dataToShow.words-%}
47
47
  {%- for item in scrabblewords %}
@@ -50,12 +50,10 @@
50
50
  {%- endif -%}
51
51
  {%- endfor -%}
52
52
  {%- endfor -%}
53
-
54
-
55
53
  </select>
56
54
  </div>
57
55
  <div id="sort-select">
58
- <select class="form-select sort-select" id="select_dropDown">
56
+ <select class="form-select xyz_select_dropDown sort-select" id="select_dropDown">
59
57
  <option selected="true" hidden id="alpha" value="alpha">Sort by</option>
60
58
  <option id="alpha" value="alpha">A-Z</option>
61
59
  <option id="alpha" value="alpha">Z-A</option>
@@ -65,7 +63,7 @@
65
63
  </div>
66
64
  </div>
67
65
 
68
- <div class="main">
66
+ <div class="xyz-main-content main">
69
67
  {%- for scrabblewords in dataToShow.words-%}
70
68
  {%- for item in scrabblewords %}
71
69
  {%- if forloop.index == 1 -%}
@@ -78,11 +76,12 @@
78
76
  <ul class="ul list-unstyled">
79
77
  {%- for item in scrabblewords %}
80
78
  {%- assign value = item.word -%}
81
- <a class="anchor__style" title="Lookup python in Dictionary" target="_blank"
82
- href="/word-meaning?search={{item.word}}">
83
- <li class="list_word">{{item.word}}
79
+ <a class="anchor__style" title="Lookup {{value}} in Dictionary" target="_blank" href="/word-meaning?search={{item.word}}">
80
+ <li class="list_word">
81
+ <span>{{item.word}}</span>
84
82
  <span class="points" value="14" style="position:relative; top:4px; font-size:12px">
85
- {{item.points}}</span>
83
+ {{item.points}}
84
+ </span>
86
85
  </li>
87
86
  </a>
88
87
  {%- endfor -%}
@@ -1,75 +1,12 @@
1
1
  {% assign file = page.fileName %}
2
2
  {% assign lang = page.lang %}
3
3
  {% assign dataToShow = site.data.[page.folderName][lang][file] %}
4
-
5
4
  {%- assign CustomColor = site.data.theme.colors -%}
6
-
7
- <style>
8
- .sticky_nav {
9
- position: sticky;
10
- width: inherit;
11
- top: 58px;
12
- background-color: #fff;
13
- z-index: 99;
14
- }
15
- </style>
16
5
  <!-- start commonPage as LandingPage -->
17
- <section class="sticky_nav">
18
- <div class="pageHeading text-center pt-5">
19
- <h1 class="heading m-0 pb-0">
20
- {{dataToShow.h1}}</h1>
21
- {%- if dataToShow.h2 -%}
22
- <h2>
23
- {{dataToShow.h2}}</h2>
24
- {%- endif -%}
25
- </div>
26
- <div class="serachSection">
27
- <div class="position-relative serachBox">
28
- <form action="{{page.url}}/result" id='form'>
29
- <div class="container" id="containerWd">
30
- <input style="border-radius: {{CustomColor.inputFieldBorder}}" type="text"
31
- placeholder="Enter up to 15 letters?" class="txtBox" name="search" maxlength="15"
32
- value={{page.value}} required>
33
- <input
34
- style="border-radius: {{CustomColor.inputFieldBorder}}; background-color: {{CustomColor.inputButtonBg}};"
35
- type="submit" class="serachBtn" id="serach" value>
36
- <div class="letter-close-button">
37
- <svg width="40px" height="40px" viewBox="0 0 24 24" fill="none"
38
- xmlns="http://www.w3.org/2000/svg">
39
- <g id="SVGRepo_bgCarrier" stroke-width="0"></g>
40
- <g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g>
41
- <g id="SVGRepo_iconCarrier">
42
- <path
43
- d="M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2ZM15.36 14.3C15.65 14.59 15.65 15.07 15.36 15.36C15.21 15.51 15.02 15.58 14.83 15.58C14.64 15.58 14.45 15.51 14.3 15.36L12 13.06L9.7 15.36C9.55 15.51 9.36 15.58 9.17 15.58C8.98 15.58 8.79 15.51 8.64 15.36C8.35 15.07 8.35 14.59 8.64 14.3L10.94 12L8.64 9.7C8.35 9.41 8.35 8.93 8.64 8.64C8.93 8.35 9.41 8.35 9.7 8.64L12 10.94L14.3 8.64C14.59 8.35 15.07 8.35 15.36 8.64C15.65 8.93 15.65 9.41 15.36 9.7L13.06 12L15.36 14.3Z"
44
- fill="#292D32"></path>
45
- </g>
46
- </svg>
47
- </div>
48
- <span class="d-none focus-border">
49
- <i></i>
50
- </span>
51
- <div class="dictonaryDropdown">
52
- <!-- <div class="dictonaryDropdown"> -->
53
- <select class="form-select select_dropDown2" name="dictionary"
54
- aria-label="Default select example">
55
- <option value="Dictionary">Dictionary</option>
56
- <option value="twl06" id="twl06">TWL06 (US, Canada, Thailand)</option>
57
- <option selected value="sowpods" id="sowpods">SOWPODS (Uk and Others)</option>
58
- <option value="wwf" id="wwf">Enable (Words With Friends)</option>
59
- </select>
60
- <!-- </div> -->
61
- </div>
62
- </div>
63
-
64
- <div class="container">
65
- {%- include wordgames/advanced-filter/advanced-filter.html -%}
66
- </div>
67
-
68
-
69
- </form>
70
- </div>
71
- </div>
72
- </section>
6
+ <div class="main-header m-0">
7
+ {% include wordgames/headings/headings.html %}
8
+ {% include wordgames/search-box/search-box.html %}
9
+ </div>
73
10
  <div class="container" id="containerWd">
74
11
  {% include wordgames/xyzpages/xyz-words.html %}
75
12
  </div>
@@ -93,6 +93,7 @@
93
93
  <div class="wordgametheme-sidebar-right"></div>
94
94
  {%- endif -%}
95
95
 
96
+
96
97
  {%- include wordgames/xyzpages/xyz.html -%}
97
98
 
98
99
  {% include wordgames/featurehighlights/featurehighlights.html %}
@@ -110,8 +111,6 @@
110
111
 
111
112
  {%- include wordgames/rating/rating.html -%}
112
113
 
113
- <!-- {%- include share/socialshare.html -%} -->
114
-
115
114
  {% include wordgames/adblocker/adblocker.html %}
116
115
 
117
116
  {% include wordgames/xyzpages/xyzFooter.html %}
@@ -119,7 +118,6 @@
119
118
 
120
119
  <script defer src="/assets/js/wordgames-xyz.js"></script>
121
120
  <script defer src="/assets/js/theme.js"></script>
122
- <script defer src="/assets/js/wordgames-home.js"></script>
123
121
 
124
122
  {%- include wordgames/scripts/scripts.html -%}
125
123
  </body>
@@ -121,98 +121,100 @@ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript
121
121
  const formElement = document.querySelector("#form");
122
122
  formElement.addEventListener("submit", function (e) {
123
123
  e.preventDefault();
124
- let quesMark = "?";
125
- if (rangeOfBlankTile) {
126
- if (!txtBox.value.includes("?")) {
127
- txtBox.value = txtBox.value + quesMark.repeat(rangeOfBlankTile); //
128
- txtBox.value = txtBox.value;
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
+ }
129
131
  }
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
-
189
- const paramName = 'search';
190
- if (new URLSearchParams(window.location.search).has(paramName)) {
191
- const additionalData = {
192
- url: "{{site.url}}",
193
- range: "{{page.blanktilerange}}"
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
+ });
194
187
  }
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
- });
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/wordfinder.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
215
  }
216
+ } else {
217
+ console.log("Please Enter Valid Letters.");
216
218
  }
217
219
  });
218
220
  // Now you can use the loadScript function with additional data
@@ -1,69 +1,64 @@
1
- let main = document.querySelector('.main')
2
- let tab_container = document.querySelector('.tab_container')
3
- var sortValue
4
- var sortBool = false
5
- var theSelect = document.getElementById('select_dropDown')
6
- let lengthSelect = document.querySelector(".length-select");
7
-
8
- // Add Filtering
9
- let sections = {}
1
+
2
+ let mainContent = document.querySelector('.xyz-main-content')
3
+ let xyzsortValue
4
+ let xyzsortBool = false
5
+ let thexyzSelect = document.querySelector('.xyz_select_dropDown')
6
+ let xyzlengthSelect = document.querySelector(".xyz-length-select");
7
+
8
+ let wordSections = {}
10
9
  function Filtering(id) {
11
- id = lengthSelect.value
12
- main.innerHTML += ``
10
+ id = xyzlengthSelect.value
11
+ mainContent.innerHTML += ``
13
12
  var section = document.querySelectorAll('.allGroupWords')
14
13
  var sort_val = "alpha";
15
14
  Array.prototype.forEach.call(section, function (e) {
16
15
  if (document.body.clientWidth > 991) {
17
- sections[e.id] = e.offsetTop - 10
16
+ wordSections[e.id] = e.offsetTop - 10
18
17
  } else {
19
- sections[e.id] = e.offsetTop - 10
18
+ wordSections[e.id] = e.offsetTop - 10
20
19
  }
21
20
  })
22
21
  console.log(sort_val + '_' + id);
23
- document.documentElement.scrollTop = sections[sort_val + '_' + id] + 5
22
+ document.documentElement.scrollTop = wordSections[sort_val + '_' + id] + 5
24
23
  }
25
-
26
-
27
-
28
24
  // sorting for words
29
- theSelect.addEventListener("change", () => {
30
- sortValue = theSelect[theSelect.selectedIndex].text;
25
+ thexyzSelect.addEventListener("change", () => {
26
+ xyzsortValue = thexyzSelect[thexyzSelect.selectedIndex].text;
31
27
  let list_word = document.getElementsByClassName("list_word")
32
28
  let data = []
33
29
  Array.from(list_word).forEach(item => {
34
30
  item.removeChild(item.lastElementChild);
35
31
  data.push(item.innerHTML.replace(/\s/g, ''))
36
32
  })
37
- if (sortValue == "Z-A") {
38
- sortBool = "Z-A";
39
- sortby(sortBool, data);
40
- } else if (sortValue == "Points") {
41
- sortBool = "Points";
42
- sortPointsby(sortBool, data);
33
+ if (xyzsortValue == "Z-A") {
34
+ xyzsortBool = "Z-A";
35
+ sortby(xyzsortBool, data);
36
+ } else if (xyzsortValue == "Points") {
37
+ xyzsortBool = "Points";
38
+ sortPointsby(xyzsortBool, data);
43
39
  } else {
44
- sortBool = "A-Z";
45
- sortby(sortBool, data);
40
+ xyzsortBool = "A-Z";
41
+ sortby(xyzsortBool, data);
46
42
  }
47
43
  });
48
-
49
44
  // sort by aplhabets
50
- function sortby(sortValue, data) {
51
- if (sortValue === "Z-A") {
52
- appendData(sortValue, data.reverse())
45
+ function sortby(xyzsortValue, data) {
46
+ if (xyzsortValue === "Z-A") {
47
+ appendData(xyzsortValue, data.reverse())
53
48
  }
54
- else if (sortValue === "A-Z") {
55
- appendData(sortValue, data.sort())
49
+ else if (xyzsortValue === "A-Z") {
50
+ appendData(xyzsortValue, data.sort())
56
51
  }
57
52
  }
58
53
  // sorting by points
59
- function sortPointsby(sortValue, data) {
60
- if (sortValue === "Points") {
54
+ function sortPointsby(xyzsortValue, data) {
55
+ if (xyzsortValue === "Points") {
61
56
  let newArray = [];
62
57
  data.map((item) => {
63
58
  if (item.length === 1) {
64
59
  ok = false;
65
60
  } else {
66
- let ScrabbleLetterScore = ScrabbleScore();
61
+ let ScrabbleLetterScore = xyzScrabbleScore();
67
62
  let points = 0;
68
63
  let word = item.replace(/<\/?[^>]+>/gi, '')
69
64
  for (let i = 0; i < word.length; i++) {
@@ -79,29 +74,29 @@ function sortPointsby(sortValue, data) {
79
74
  newArray.sort(function (a, b) {
80
75
  return b.points - a.points;
81
76
  });
82
- appendData(sortValue, newArray)
77
+ appendData(xyzsortValue, newArray)
83
78
  }
84
79
  }
85
80
 
86
- function appendData(sortValue, data) {
87
- main.innerHTML = "";
81
+ function appendData(xyzsortValue, data) {
82
+ mainContent.innerHTML = "";
88
83
  let newWordsLength = 0;
89
84
  for (let i = 15; i > 0; i--) {
90
85
  let newdata
91
- if (sortValue === "Points") {
86
+ if (xyzsortValue === "Points") {
92
87
  newdata = data.filter((item) => item.words.replace(/<\/?[^>]+>/gi, '').length === i)
93
88
  } else {
94
89
  newdata = data.filter((item) => item.replace(/<\/?[^>]+>/gi, '').length === i)
95
90
  }
96
91
  if (newdata.length === 0) {
97
- main.innerHTML += "";
92
+ mainContent.innerHTML += "";
98
93
  } else {
99
94
  newWordsLength += newdata.length;
100
95
  const result = newdata.map((item) => {
101
- let ScrabbleLetterScore = ScrabbleScore();
96
+ let ScrabbleLetterScore = xyzScrabbleScore();
102
97
  let points = 0;
103
98
  let word
104
- if (sortValue === "Points") {
99
+ if (xyzsortValue === "Points") {
105
100
  word = item.words.replace(/<\/?[^>]+>/gi, '')
106
101
  item = item.words
107
102
  } else {
@@ -111,16 +106,16 @@ function appendData(sortValue, data) {
111
106
  points += ScrabbleLetterScore[word[i]] || 0; // for unknown characters
112
107
  }
113
108
  return `
114
- <a class="anchor__style" title="Lookup ${item.replace(/<\/?[^>]+>/gi, '')} in Dictionary" target="_blank"
115
- href="/word-meaning?search=${item.replace(/<\/?[^>]+>/gi, '')}">
116
- <li class="list_word">
117
- ${item}
118
- <span class="points" value="${points}" style="position:relative; top:4px; font-size:12px">${points}</span>
119
- </li>
120
- </a>
121
- `});
122
-
123
- main.innerHTML += `
109
+ <a href="/word-meaning?search=${item.replace(/<\/?[^>]+>/gi, '')}" class="anchor__style" title="Lookup ${item.replace(/<\/?[^>]+>/gi, '')} in Dictionary" target="_blank">
110
+ <li class="list_word">
111
+ ${item}
112
+ <span class="points" value="${points}" style="position:relative; top:4px; font-size:12px">${points}</span>
113
+ </li>
114
+ </a>
115
+ `
116
+ });
117
+
118
+ mainContent.innerHTML += `
124
119
  <div class="allGroupWords wordlistContainer" id="alpha_${i}">
125
120
  <div class="wordListHeading">
126
121
  <h3 class="lead">${i} Letter Words</h3>
@@ -136,7 +131,7 @@ function appendData(sortValue, data) {
136
131
  }
137
132
  }
138
133
  // Scrabble Point Array
139
- const ScrabbleScore = () => {
134
+ const xyzScrabbleScore = () => {
140
135
  let twl06_sowpods = {
141
136
  a: 1,
142
137
  e: 1,
@@ -201,3 +196,255 @@ const ScrabbleScore = () => {
201
196
  return twl06_sowpods;
202
197
  // }
203
198
  };
199
+
200
+
201
+
202
+
203
+
204
+ let txtBox = document.querySelector('.txtBox')
205
+ let letterCloseButton = document.querySelector('.letter-close-button')
206
+ let startsWith = document.getElementById("startsWith");
207
+ let mustInclude = document.getElementById("mustInclude");
208
+ let endsWith = document.getElementById("endsWith");
209
+ let exculdeWith = document.getElementById("exculdeWith");
210
+ let inculdeWith = document.getElementById("inculdeWith");
211
+ let wordLength = document.getElementById("wordLength");
212
+ const serachSection = document.querySelector(".serachSection");
213
+ let rangeOfBlankTile = serachSection.dataset.range;
214
+
215
+ // // when typing on input
216
+ txtBox.addEventListener('input', (e) => {
217
+ if (e.target.value === "") {
218
+ letterCloseButton.style.display = "none"
219
+ }
220
+ else {
221
+ letterCloseButton.style.display = "block"
222
+ }
223
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
224
+ let rangeOfBlankTile = 3
225
+ if (rangeOfBlankTile === "") {
226
+ rangeOfBlankTile = 3
227
+ }
228
+ e.target.value = e.target.value.replace(/ /g, '?')
229
+ let data = []
230
+ data = e.target.value.split('').filter((i) => i === '?')
231
+ if (data.length > rangeOfBlankTile) {
232
+ e.target.value = e.target.value.replace(/\?$/, '')
233
+ }
234
+ })
235
+ letterCloseButton.addEventListener("click", () => {
236
+ txtBox.value = ""
237
+ letterCloseButton.style.display = "none"
238
+ })
239
+ //tooltips for advanced filter
240
+ const filterInputs = document.querySelectorAll('.filter_val');
241
+ Array.from(filterInputs).forEach((item) => {
242
+ item.addEventListener("input", (e) => {
243
+ const inputValue = e.target.value;
244
+ const parentElement = e.target.parentElement;
245
+ const imgElement = parentElement.querySelector('img');
246
+ const tooltipElement = parentElement.querySelector('.filter-tooltip');
247
+
248
+ if (inputValue == "") {
249
+ imgElement.src = "/assets/images/questionmark.svg"
250
+ setTimeout(() => {
251
+ item.nextElementSibling.setAttribute("data-tip", item.nextElementSibling.id)
252
+ }, 100);
253
+ tooltipElement.style.setProperty('--tooltip-padding', '0.5rem');
254
+ tooltipElement.style.setProperty('--tooltip-border-style', 'soild');
255
+
256
+ } else {
257
+ item.nextElementSibling.removeAttribute("data-tip")
258
+ imgElement.src = "/assets/images/close-btn.svg"
259
+ tooltipElement.style.setProperty('--tooltip-padding', '0');
260
+ tooltipElement.style.setProperty('--tooltip-border-style', 'none');
261
+ }
262
+ item.nextElementSibling.addEventListener("click", () => {
263
+ e.target.value = ""
264
+ imgElement.src = "/assets/images/questionmark.svg"
265
+ setTimeout(() => {
266
+ item.nextElementSibling.setAttribute("data-tip", item.nextElementSibling.id)
267
+ }, 100);
268
+ tooltipElement.style.setProperty('--tooltip-padding', '0.5rem');
269
+ tooltipElement.style.setProperty('--tooltip-border-style', 'soild');
270
+ })
271
+ })
272
+ })
273
+ const loadResource = (FILE_URL, data = {}, async = true, type = "text/javascript") => {
274
+ return new Promise((resolve, reject) => {
275
+ let resourceEle;
276
+
277
+ if (type === "text/javascript") {
278
+ resourceEle = document.createElement("script");
279
+ resourceEle.src = FILE_URL;
280
+ resourceEle.classList.add("loaded-js");
281
+ } else if (type === "text/css") {
282
+ resourceEle = document.createElement("link");
283
+ resourceEle.rel = "stylesheet";
284
+ resourceEle.href = FILE_URL;
285
+ } else {
286
+ reject({
287
+ status: false,
288
+ message: `Unsupported resource type: ${type}`,
289
+ });
290
+ return;
291
+ }
292
+
293
+ resourceEle.type = type;
294
+ resourceEle.async = async;
295
+
296
+ Object.keys(data).forEach((key) => {
297
+ resourceEle.setAttribute(`data-${key}`, data[key]);
298
+ });
299
+
300
+ resourceEle.addEventListener("load", () => {
301
+ resolve({ status: true });
302
+ });
303
+
304
+ resourceEle.addEventListener("error", () => {
305
+ reject({
306
+ status: false,
307
+ message: `Failed to load the resource ${FILE_URL}`,
308
+ });
309
+ });
310
+
311
+ if (type === "text/javascript") {
312
+ // console.log(resourceEle);
313
+ // console.log(FILE_URL);
314
+ document.body.appendChild(resourceEle);
315
+ } else if (type === "text/css") {
316
+ document.head.appendChild(resourceEle);
317
+ }
318
+ });
319
+ };
320
+ const formElement = document.querySelector("#form");
321
+ formElement.addEventListener("submit", function (e) {
322
+ e.preventDefault();
323
+ document.querySelector(".xyzPad").style.display = "none"
324
+ let quesMark = "?";
325
+ if (rangeOfBlankTile) {
326
+ if (!txtBox.value.includes("?")) {
327
+ txtBox.value = txtBox.value + quesMark.repeat(rangeOfBlankTile); //
328
+ txtBox.value = txtBox.value;
329
+ }
330
+ }
331
+ document.querySelector(".fillterWrapper").classList.add("hide")
332
+ let selectedDictionary = document.querySelector(".select_dropDown2").value;
333
+ if (history.pushState) {
334
+ var newurl =
335
+ window.location.protocol +
336
+ "//" +
337
+ window.location.host +
338
+ window.location.pathname +
339
+ "?" +
340
+ "search" +
341
+ "=" +
342
+ txtBox.value.toLowerCase() +
343
+ "&" +
344
+ "dictionary" +
345
+ "=" +
346
+ selectedDictionary +
347
+ "&" +
348
+ "prefix" +
349
+ "=" +
350
+ startsWith.value +
351
+ "&" +
352
+ "contains" +
353
+ "=" +
354
+ mustInclude.value +
355
+ "&" +
356
+ "suffix" +
357
+ "=" +
358
+ endsWith.value +
359
+ "&" +
360
+ "exclude" +
361
+ "=" +
362
+ exculdeWith.value +
363
+ "&" +
364
+ "include" +
365
+ "=" +
366
+ inculdeWith.value +
367
+ "&" +
368
+ "length" +
369
+ "=" +
370
+ wordLength.value;
371
+ window.history.pushState({ path: newurl }, "", newurl);
372
+
373
+ const params = new URLSearchParams(window.location.search);
374
+ serachValue = params.get("search");
375
+ prefixValue = params.get("prefix");
376
+ containsValue = params.get("contains");
377
+ suffixValue = params.get("suffix");
378
+ exculdeValue = params.get("exclude");
379
+ includeValue = params.get("include");
380
+ lengthValue = params.get("length");
381
+ dictonary = params.get("dictionary");
382
+
383
+ gtag("event", "page_view", {
384
+ page_location: window.location.pathname + location.search,
385
+ });
386
+ }
387
+
388
+
389
+ const paramName = 'search';
390
+ if (new URLSearchParams(window.location.search).has(paramName)) {
391
+ const additionalData = {
392
+ url: "{{site.url}}",
393
+ range: "{{page.blanktilerange}}"
394
+ }
395
+ var loadJs = document.querySelector(".loaded-js");
396
+ if (loadJs == null) {
397
+ loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
398
+ .then((data) => {
399
+ console.log("CSS loaded:", data);
400
+ })
401
+ .then(() => {
402
+ // Load the JavaScript file after the CSS file has loaded
403
+ loadResource("/assets/js/wordfinder.js", additionalData, true, "text/javascript")
404
+ .then((data) => {
405
+ console.log("JavaScript loaded:", data);
406
+ getData(txtBox.value.toLowerCase());
407
+ })
408
+ .catch((error) => {
409
+ console.error("Error loading JavaScript:", error);
410
+ });
411
+ })
412
+ .catch((error) => {
413
+ console.error("Error loading CSS:", error);
414
+ });
415
+ }
416
+ }
417
+ });
418
+ // Now you can use the loadScript function with additional data
419
+ function checkQueryParam() {
420
+ const urlParams = new URLSearchParams(window.location.search);
421
+ const paramName = 'search';
422
+ if (urlParams.has(paramName)) {
423
+ document.querySelector(".xyzPad").style.display = "none"
424
+ const additionalData = {
425
+ url: "{{site.url}}",
426
+ range: "{{page.blanktilerange}}"
427
+ };
428
+ loadResource("/assets/css/wordfinder-result.css", additionalData, true, "text/css")
429
+ .then((data) => {
430
+ console.log("CSS loaded:", data);
431
+ })
432
+ .then(() => {
433
+ // Load the JavaScript file after the CSS file has loaded
434
+ loadResource("/assets/js/wordfinder.js", additionalData, true, "text/javascript")
435
+ .then((data) => {
436
+ console.log("JavaScript loaded:", data);
437
+ getData(txtBox.value.toLowerCase());
438
+ })
439
+ .catch((error) => {
440
+ console.error("Error loading JavaScript:", error);
441
+ });
442
+ })
443
+ .catch((error) => {
444
+ console.error("Error loading CSS:", error);
445
+ });
446
+ }
447
+ }
448
+ checkQueryParam();
449
+
450
+
@@ -88,7 +88,7 @@ const loadResource = (FILE_URL, async = true, type = "text/javascript") => {
88
88
 
89
89
  resourceEle.type = type;
90
90
  resourceEle.async = async;
91
-
91
+
92
92
 
93
93
 
94
94
  resourceEle.addEventListener("load", () => {
@@ -113,81 +113,84 @@ const formElement = document.querySelector("#form");
113
113
  formElement.addEventListener("submit", function (e) {
114
114
  e.preventDefault();
115
115
 
116
- document.querySelector(".fillterWrapper").classList.add("hide")
117
- let selectedDictionary = document.querySelector(".select_dropDown2").value;
118
- if (history.pushState) {
119
- var newurl =
120
- window.location.protocol +
121
- "//" +
122
- window.location.host +
123
- window.location.pathname +
124
- "?" +
125
- "search" +
126
- "=" +
127
- txtBox.value.toLowerCase() +
128
- "&" +
129
- "dictionary" +
130
- "=" +
131
- selectedDictionary +
132
- "&" +
133
- "prefix" +
134
- "=" +
135
- startsWith.value +
136
- "&" +
137
- "contains" +
138
- "=" +
139
- mustInclude.value +
140
- "&" +
141
- "suffix" +
142
- "=" +
143
- endsWith.value +
144
- "&" +
145
- "exclude" +
146
- "=" +
147
- exculdeWith.value +
148
- "&" +
149
- "include" +
150
- "=" +
151
- inculdeWith.value +
152
- "&" +
153
- "length" +
154
- "=" +
155
- wordLength.value;
156
- window.history.pushState({ path: newurl }, "", newurl);
157
-
158
- const params = new URLSearchParams(window.location.search);
159
- serachValue = params.get("search");
160
- prefixValue = params.get("prefix");
161
- containsValue = params.get("contains");
162
- suffixValue = params.get("suffix");
163
- exculdeValue = params.get("exclude");
164
- includeValue = params.get("include");
165
- lengthValue = params.get("length");
166
- dictonary = params.get("dictionary");
167
-
168
- gtag("event", "page_view", {
169
- page_location: window.location.pathname + location.search,
170
- });
171
- }
172
-
173
- const paramName = 'search';
174
- if (new URLSearchParams(window.location.search).has(paramName)) {
175
-
176
- loadResource("/assets/css/wordfinder-result.css", true, "text/css").then((data) => {
177
- console.log("CSS loaded:", data);
178
- }).then(() => {
179
- // Load the JavaScript file after the CSS file has loaded
180
- loadResource("/assets/js/xletter-result.js", true, "text/javascript").then((data) => {
116
+ if (txtBox.value != "" || startsWith.value != "" || endsWith.value != "" || mustInclude.value != "" || exculdeWith.value != "" || inculdeWith.value != "" || wordLength.value != "") {
117
+ document.querySelector(".fillterWrapper").classList.add("hide")
118
+ let selectedDictionary = document.querySelector(".select_dropDown2").value;
119
+ if (history.pushState) {
120
+ var newurl =
121
+ window.location.protocol +
122
+ "//" +
123
+ window.location.host +
124
+ window.location.pathname +
125
+ "?" +
126
+ "search" +
127
+ "=" +
128
+ txtBox.value.toLowerCase() +
129
+ "&" +
130
+ "dictionary" +
131
+ "=" +
132
+ selectedDictionary +
133
+ "&" +
134
+ "prefix" +
135
+ "=" +
136
+ startsWith.value +
137
+ "&" +
138
+ "contains" +
139
+ "=" +
140
+ mustInclude.value +
141
+ "&" +
142
+ "suffix" +
143
+ "=" +
144
+ endsWith.value +
145
+ "&" +
146
+ "exclude" +
147
+ "=" +
148
+ exculdeWith.value +
149
+ "&" +
150
+ "include" +
151
+ "=" +
152
+ inculdeWith.value +
153
+ "&" +
154
+ "length" +
155
+ "=" +
156
+ wordLength.value;
157
+ window.history.pushState({ path: newurl }, "", newurl);
158
+
159
+ const params = new URLSearchParams(window.location.search);
160
+ serachValue = params.get("search");
161
+ prefixValue = params.get("prefix");
162
+ containsValue = params.get("contains");
163
+ suffixValue = params.get("suffix");
164
+ exculdeValue = params.get("exclude");
165
+ includeValue = params.get("include");
166
+ lengthValue = params.get("length");
167
+ dictonary = params.get("dictionary");
168
+
169
+ gtag("event", "page_view", {
170
+ page_location: window.location.pathname + location.search,
171
+ });
172
+ }
173
+ const paramName = 'search';
174
+ if (new URLSearchParams(window.location.search).has(paramName)) {
175
+
176
+ loadResource("/assets/css/wordfinder-result.css", true, "text/css").then((data) => {
177
+ console.log("CSS loaded:", data);
178
+ }).then(() => {
179
+ // Load the JavaScript file after the CSS file has loaded
180
+ loadResource("/assets/js/xletter-result.js", true, "text/javascript").then((data) => {
181
181
  console.log("JavaScript loaded:", data);
182
182
  getData(txtBox.value.toLowerCase());
183
183
  })
184
+ .catch((error) => {
185
+ console.error("Error loading JavaScript:", error);
186
+ });
187
+ })
184
188
  .catch((error) => {
185
- console.error("Error loading JavaScript:", error);
189
+ console.error("Error loading CSS:", error);
186
190
  });
187
- })
188
- .catch((error) => {
189
- console.error("Error loading CSS:", error);
190
- });
191
+ }
192
+ } else {
193
+ console.log("Please Enter Valid Letters.");
191
194
  }
192
195
  });
193
196
 
@@ -196,24 +199,24 @@ function checkQueryParam() {
196
199
  const urlParams = new URLSearchParams(window.location.search);
197
200
  const paramName = 'search';
198
201
  if (urlParams.has(paramName)) {
199
- loadResource("/assets/css/wordfinder-result.css", true, "text/css")
200
- .then((data) => {
201
- console.log("CSS loaded:", data);
202
- })
203
- .then(() => {
204
- // Load the JavaScript file after the CSS file has loaded
205
- loadResource("/assets/js/xletter-result.js", true, "text/javascript")
206
- .then((data) => {
207
- console.log("JavaScript loaded:", data);
208
- getData(txtBox.value.toLowerCase());
209
- })
210
- .catch((error) => {
211
- console.error("Error loading JavaScript:", error);
212
- });
213
- })
214
- .catch((error) => {
215
- console.error("Error loading CSS:", error);
216
- });
202
+ loadResource("/assets/css/wordfinder-result.css", true, "text/css")
203
+ .then((data) => {
204
+ console.log("CSS loaded:", data);
205
+ })
206
+ .then(() => {
207
+ // Load the JavaScript file after the CSS file has loaded
208
+ loadResource("/assets/js/xletter-result.js", true, "text/javascript")
209
+ .then((data) => {
210
+ console.log("JavaScript loaded:", data);
211
+ getData(txtBox.value.toLowerCase());
212
+ })
213
+ .catch((error) => {
214
+ console.error("Error loading JavaScript:", error);
215
+ });
216
+ })
217
+ .catch((error) => {
218
+ console.error("Error loading CSS:", error);
219
+ });
217
220
  }
218
221
  }
219
222
  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.6.8
4
+ version: 2.7.0
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-03-16 00:00:00.000000000 Z
11
+ date: 2024-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll