word-games-theme 1.1.1 → 1.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -202,7 +202,7 @@ window.onscroll = function () {
202
202
  document.querySelector('.active-tab').classList.remove('active-tab')
203
203
  var active_now = document.querySelector('#Tab_' + i.split('_')[1])
204
204
  active_now.classList.add('active-tab')
205
- // active_now.scrollIntoView()
205
+ active_now.scrollIntoView({ block: 'nearest' })
206
206
  }
207
207
  }
208
208
  }
@@ -74,6 +74,8 @@ document.querySelector('.select_dropDown2').value = dictonary
74
74
  // getWords define...
75
75
  const getData = async (serachValue) => {
76
76
  try {
77
+ errorMsg.innerHTML = ""
78
+ wordCount.innerHTML = ""
77
79
  let selectedDictionary = document.querySelector('.select_dropDown2').value
78
80
  main.innerHTML = `<div class="loader">
79
81
  <img src='/assets/images/loading.gif'>
@@ -97,10 +99,40 @@ if (lengthValue === '1') {
97
99
  errorMsg.innerHTML = 'words length should be more than 1'
98
100
  } else {
99
101
  getData(serachValue.toLowerCase())
102
+ function logSubmit(event) {
103
+ let selectedDictionary = document.querySelector('.select_dropDown2').value
104
+ event.preventDefault();
105
+ if (history.pushState) {
106
+ var newurl = window.location.protocol + "//" + window.location.host +
107
+ window.location.pathname + '?' + "search" + "=" + txtBox.value.toLowerCase() + '&' +
108
+ 'dictionary' + '=' + selectedDictionary +
109
+ '&' + 'prefix' + '=' + startsWith.value + '&' + 'contains' + '=' + mustInclude.value +
110
+ '&' + 'suffix' + '=' + endsWith.value + '&' + 'exculde' + '=' + exculdeWith.value +
111
+ '&' + 'include' + '=' + inculdeWith.value + '&' + 'length' + '=' + wordLength.value;
112
+ window.history.pushState({ path: newurl }, '', newurl);
113
+
114
+ const params = new URLSearchParams(window.location.search)
115
+ serachValue = params.get('search')
116
+ prefixValue = params.get('prefix')
117
+ containsValue = params.get('contains')
118
+ suffixValue = params.get('suffix')
119
+ exculdeValue = params.get('exculde')
120
+ includeValue = params.get('include')
121
+ lengthValue = params.get('length')
122
+ dictonary = params.get('dictionary')
123
+ }
124
+ getData(txtBox.value.toLowerCase())
125
+ addFilterCount()
126
+
127
+ }
128
+ applyBtn.addEventListener('submit', logSubmit)
129
+ form.addEventListener('submit', logSubmit);
100
130
  }
101
131
 
102
132
  // wordsStartingWith function define...
103
133
  function wordsStartingWith(data) {
134
+ main.innerHTML = ""
135
+ tab_container.innerHTML = ""
104
136
  if (typeof data === 'string') {
105
137
  errorMsg.innerHTML = 'no words found'
106
138
  wordCount.innerHTML = `<strong>Found 0 words with letters ${serachValue.split(
@@ -134,6 +166,8 @@ function wordsStartingWith(data) {
134
166
  )
135
167
  startsWith.classList.add('tick')
136
168
  startsWith.value = prefixValue
169
+ } else {
170
+ startsWith.classList.remove('tick')
137
171
  }
138
172
  if (containsValue) {
139
173
  newdata = newdata.filter((item) =>
@@ -142,20 +176,24 @@ function wordsStartingWith(data) {
142
176
  mustInclude.classList.add('tick')
143
177
  mustInclude.value = containsValue
144
178
  }
179
+ else {
180
+ mustInclude.classList.remove('tick')
181
+ }
145
182
  if (suffixValue) {
146
183
  newdata = newdata.filter((item) =>
147
184
  item.endsWith(suffixValue.toLowerCase())
148
185
  )
149
186
  endsWith.classList.add('tick')
150
187
  endsWith.value = suffixValue
188
+ } else {
189
+ endsWith.classList.remove('tick')
151
190
  }
152
-
153
191
  if (exculdeValue) {
154
192
  let data = []
155
193
  newdata.map((item) => {
156
194
  let check = false
157
195
  for (let e = 0; e < exculdeValue.length; e++) {
158
- const element = exculdeValue[e]
196
+ const element = exculdeValue[e].toLowerCase()
159
197
  if (item.includes(element)) {
160
198
  check = true
161
199
  break
@@ -170,13 +208,15 @@ function wordsStartingWith(data) {
170
208
  exculdeWith.classList.add('tick')
171
209
  exculdeWith.value = exculdeValue
172
210
  newdata = data
211
+ } else {
212
+ exculdeWith.classList.remove('tick')
173
213
  }
174
214
  if (includeValue) {
175
215
  let data = []
176
216
  newdata.map((item) => {
177
217
  let check = false
178
218
  for (let e = 0; e < includeValue.length; e++) {
179
- const element = includeValue[e]
219
+ const element = includeValue[e].toLowerCase()
180
220
  if (!item.includes(element)) {
181
221
  check = true
182
222
  break
@@ -191,14 +231,16 @@ function wordsStartingWith(data) {
191
231
  inculdeWith.classList.add('tick')
192
232
  inculdeWith.value = includeValue
193
233
  newdata = data
234
+ } else {
235
+ inculdeWith.classList.remove('tick')
194
236
  }
195
-
196
237
  if (lengthValue) {
197
238
  newdata = newdata.filter((item) => item.length == lengthValue)
198
239
  wordLength.classList.add('tick')
199
240
  wordLength.value = lengthValue
241
+ } else {
242
+ wordLength.classList.remove('tick')
200
243
  }
201
-
202
244
  if (newdata.length === 0) {
203
245
  main.innerHTML += ''
204
246
  } else {
@@ -221,7 +263,7 @@ function wordsStartingWith(data) {
221
263
  }
222
264
  })
223
265
 
224
- if (ok) {
266
+ if (result[0] !== undefined) {
225
267
  tab_container.innerHTML += `
226
268
  <input type="button" id="Tab_${i}" onclick="Filtering(${i})" value="${i} Letter"
227
269
  class="tab_link cursorPointer" />
@@ -480,7 +522,7 @@ function addFilterCount() {
480
522
  filter_val[4].value = includeValue
481
523
  filter_val[5].value = lengthValue
482
524
 
483
- for (var i = 0; i <= 4; i++) {
525
+ for (var i = 0; i <= 5; i++) {
484
526
  if (filter_val[i].value != '') {
485
527
  filter_count += 1
486
528
  }
@@ -518,7 +560,7 @@ window.onscroll = function () {
518
560
  document.querySelector('.active-tab').classList.remove('active-tab')
519
561
  var active_now = document.querySelector('#Tab_' + i.split('_')[1])
520
562
  active_now.classList.add('active-tab')
521
- // active_now.scrollIntoView()
563
+ active_now.scrollIntoView({ block: 'nearest' })
522
564
  }
523
565
  }
524
566
  }
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: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-15 00:00:00.000000000 Z
11
+ date: 2022-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -241,6 +241,7 @@ files:
241
241
  - assets/images/wordswithletters-logo.png
242
242
  - assets/images/yellow_bg.png
243
243
  - assets/js/TopScroll.js
244
+ - assets/js/X-letter-test.js
244
245
  - assets/js/X-letter.js
245
246
  - assets/js/adBlocker.js
246
247
  - assets/js/advancedFilter.js
@@ -248,7 +249,7 @@ files:
248
249
  - assets/js/advancedFilter3.js
249
250
  - assets/js/other-lang-wordScrabble.js
250
251
  - assets/js/scrabbleDictonary.js
251
- - assets/js/test.js
252
+ - assets/js/wordScrabble-test.js
252
253
  - assets/js/wordScrabble.js
253
254
  - assets/js/wordleSolver.js
254
255
  - assets/js/words-in-certain-positions.js