word-games-theme 0.4.5 → 0.4.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +21 -21
  3. data/README.md +2 -2
  4. data/_data/blog/alertbar.yml +3 -3
  5. data/_data/blog/blog.yml +2 -2
  6. data/_data/blog/nav.json +13 -13
  7. data/_data/footer/en/data.json +74 -74
  8. data/_data/footer/hi/data.json +68 -68
  9. data/_data/footer/networksites.json +15 -15
  10. data/_data/wordgames/en/words_with_friends_word_finder.json +55 -55
  11. data/_includes/Rating/structureddata.html +53 -53
  12. data/_includes/author_bio.html +15 -15
  13. data/_includes/authors/authors.html +27 -27
  14. data/_includes/autogenerated/footer.html +72 -0
  15. data/_includes/disqus_comments.html +10 -10
  16. data/_includes/filterWords/index.html +10 -10
  17. data/_includes/google-analytics.html +22 -22
  18. data/_includes/header/blogHeader.html +28 -28
  19. data/_includes/paginationBlogPage.html +34 -34
  20. data/_includes/paginationPostPage.html +14 -14
  21. data/_includes/postauthorbio.html +17 -17
  22. data/_includes/postbox.html +29 -29
  23. data/_includes/script.html +13 -13
  24. data/_includes/section/about.html +25 -25
  25. data/_includes/section/alertbar.html +11 -11
  26. data/_includes/section/commonPage.html +1 -1
  27. data/_includes/section/count.html +23 -23
  28. data/_includes/section/home.html +1 -1
  29. data/_includes/section/home2.html +1 -1
  30. data/_includes/section/wordGroup.html +6 -6
  31. data/_layouts/autogencontent.html +1 -2
  32. data/_layouts/blog.html +66 -66
  33. data/_layouts/categories.html +25 -25
  34. data/_layouts/default.html +17 -0
  35. data/_layouts/disclaimer.html +115 -115
  36. data/_layouts/page.html +68 -67
  37. data/_layouts/privacyPolicy.html +420 -420
  38. data/_layouts/wordMeaning.html +106 -106
  39. data/assets/css/HomePageblog.css +154 -154
  40. data/assets/css/about.css +51 -51
  41. data/assets/css/feature.css +69 -69
  42. data/assets/css/footer.css +95 -95
  43. data/assets/css/news.css +62 -62
  44. data/assets/css/style.css +5 -1
  45. data/assets/images/angle-arrow-down.svg +43 -43
  46. data/assets/images/right.svg +38 -38
  47. data/assets/images/right2.svg +38 -38
  48. data/assets/images/right3.svg +38 -38
  49. data/assets/images/word-games-logo.svg +52 -52
  50. data/assets/js/TopScroll.js +8 -8
  51. data/assets/js/advancedFilter.js +5 -5
  52. data/assets/js/advancedFilter2.js +12 -12
  53. data/assets/js/advancedFilter3.js +2 -2
  54. data/assets/js/scrabbleDictonary.js +165 -165
  55. data/assets/js/wordScrabble.js +162 -12
  56. metadata +8 -7
@@ -7,10 +7,11 @@ let form = document.querySelector('#form')
7
7
  let wordCount = document.querySelector('.wordCount')
8
8
  let main = document.querySelector('.main')
9
9
  let errorMsg = document.querySelector('.errorMsg')
10
+ let script = document.currentScript
10
11
 
11
12
  // getqueryUrl from form
12
13
  const params = new URLSearchParams(window.location.search)
13
- let serachValue = params.get('search')
14
+ let serachValue = params.get('search').toLowerCase()
14
15
  let prefixValue = params.get('prefix')
15
16
  let containsValue = params.get('contains')
16
17
  let suffixValue = params.get('suffix')
@@ -33,19 +34,53 @@ var sortBool = false
33
34
 
34
35
  let txtBox = document.querySelector('.txtBox')
35
36
  txtBox.value = serachValue
36
-
37
+ txtBox.addEventListener('keyup', (e) => {
38
+ let rangeOfBlankTile = script.dataset.range
39
+ e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, '')
40
+ if (rangeOfBlankTile === null) {
41
+ rangeOfBlankTile = 10
42
+ }
43
+ e.target.value = e.target.value.replace(/ /g, '?')
44
+ let data = []
45
+ data = e.target.value.split('').filter((i) => i === '?')
46
+ if (data.length > rangeOfBlankTile) {
47
+ e.target.value = e.target.value.replace(/\?$/, '')
48
+ }
49
+ })
37
50
  var theSelect = document.getElementById('select_dropDown')
38
51
  document.querySelector('.select_dropDown2').value = dictonary
52
+ const getDiff = (text1, text2) => {
53
+ var diffRange = []
54
+ var currentRange = undefined
55
+ for (var i = 0; i < text1.length; i++) {
56
+ if (text1[i] != text2[i]) {
57
+ if (currentRange == undefined) {
58
+ currentRange = [i]
59
+ }
60
+ }
61
+ if (currentRange != undefined && text1[i] == text2[i]) {
62
+ currentRange.push(i)
63
+ diffRange.push(currentRange)
64
+ currentRange = undefined
65
+ }
66
+ }
67
+ if (currentRange != undefined) {
68
+ currentRange.push(i)
69
+ diffRange.push(currentRange)
70
+ }
71
+ return diffRange
72
+ }
39
73
 
40
74
  // getWords define...
41
75
  const getData = async (serachValue) => {
42
76
  try {
77
+ let selectedDictionary = document.querySelector('.select_dropDown2').value
43
78
  main.innerHTML = `<div class="loader">
44
79
  <img src='/assets/images/loading.gif'>
45
80
  </div>`
46
81
  /// loader
47
82
  const response = await fetch(
48
- `/.netlify/functions/getWords?name=${serachValue}`
83
+ `./netlify/functions/getWords?name=${serachValue}&selecteddictionary=${selectedDictionary}`
49
84
  )
50
85
  const data = await response.json()
51
86
  main.innerHTML = ''
@@ -123,8 +158,31 @@ function getWords(data) {
123
158
  main.innerHTML += ''
124
159
  } else {
125
160
  newWordsLength += newdata.length
126
-
127
161
  const result = newdata.map((item) => {
162
+ var text1 = serachValue.replace('?', '')
163
+ var text2 = item
164
+ var text3 = item
165
+ let chars = text1.split('')
166
+ let indexs = []
167
+ chars.map((i) => {
168
+ let findIndexes = findIndex(text3, i)
169
+ if (findIndexes.length > 0) {
170
+ text3 = text3.split('')
171
+ text3[findIndexes] = '$'
172
+ text3 = text3.join('')
173
+ indexs = [...indexs, ...findIndexes]
174
+ }
175
+ })
176
+ let itemHtml = ''
177
+ text2.split('').map((itemValue, index) => {
178
+ let check = indexs.find((i) => i === index)
179
+ if (check !== undefined) {
180
+ itemHtml += `${itemValue}`
181
+ } else {
182
+ itemHtml += `<span class='highlight'>${itemValue}</span>`
183
+ }
184
+ })
185
+
128
186
  if (item.length === 1) {
129
187
  ok = false
130
188
  newWordsLength = newWordsLength - 1
@@ -135,8 +193,8 @@ function getWords(data) {
135
193
  for (let i = 0; i < item.length; i++) {
136
194
  sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
137
195
  }
138
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
139
- <li>${item}
196
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
197
+ <li>${itemHtml}
140
198
  <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
141
199
  </li></a>`
142
200
  }
@@ -149,7 +207,6 @@ function getWords(data) {
149
207
  `
150
208
  let tabs = document.getElementsByClassName('tab_link')
151
209
  tabs[0] ? tabs[0].classList.add('active-tab') : ''
152
-
153
210
  main.innerHTML += `
154
211
  <div class="allGroupWords wordlistContainer" id="alpha_${i}">
155
212
  <div class="wordListHeading">
@@ -213,8 +270,42 @@ function sortPointsby(sortValue, data) {
213
270
  })
214
271
 
215
272
  const result = newArray.map((item) => {
273
+ var text1 = serachValue.replace('?', '')
274
+ var text2 = item.words
275
+ var text3 = item.words
276
+ function findIndex(str, char) {
277
+ const strLength = str.length
278
+ const indexes = []
279
+ let newStr = str
280
+ while (newStr && newStr.indexOf(char) > -1) {
281
+ indexes.push(newStr.indexOf(char) + strLength - newStr.length)
282
+ newStr = newStr.substring(newStr.indexOf(char) + 1)
283
+ newStr = newStr.substring(newStr.indexOf(char) + 1)
284
+ }
285
+ return indexes
286
+ }
287
+ let chars = text1.split('')
288
+ let indexs = []
289
+ chars.map((i) => {
290
+ let findIndexes = findIndex(text3, i)
291
+ if (findIndexes.length > 0) {
292
+ text3 = text3.split('')
293
+ text3[findIndexes] = '$'
294
+ text3 = text3.join('')
295
+ indexs = [...indexs, ...findIndexes]
296
+ }
297
+ })
298
+ let itemHtml = ''
299
+ text2.split('').map((itemValue, index) => {
300
+ let check = indexs.find((i) => i === index)
301
+ if (check !== undefined) {
302
+ itemHtml += `${itemValue}`
303
+ } else {
304
+ itemHtml += `<span class='highlight'>${itemValue}</span>`
305
+ }
306
+ })
216
307
  return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.words}">
217
- <li>${item.words}
308
+ <li>${itemHtml}
218
309
  <span class="points" value="${item.points}" style="position:relative; top:4px; font-size:12px"> ${item.points}</span>
219
310
  </li></a>`
220
311
  })
@@ -251,6 +342,29 @@ function sortby(sortBool, data) {
251
342
  newWordsLength += newdata.length
252
343
 
253
344
  const result = newdata.map((item) => {
345
+ var text1 = serachValue.replace('?', '')
346
+ var text2 = item
347
+ var text3 = item
348
+ let chars = text1.split('')
349
+ let indexs = []
350
+ chars.map((i) => {
351
+ let findIndexes = findIndex(text3, i)
352
+ if (findIndexes.length > 0) {
353
+ text3 = text3.split('')
354
+ text3[findIndexes] = '$'
355
+ text3 = text3.join('')
356
+ indexs = [...indexs, ...findIndexes]
357
+ }
358
+ })
359
+ let itemHtml = ''
360
+ text2.split('').map((itemValue, index) => {
361
+ let check = indexs.find((i) => i === index)
362
+ if (check !== undefined) {
363
+ itemHtml += `${itemValue}`
364
+ } else {
365
+ itemHtml += `<span class='highlight'>${itemValue}</span>`
366
+ }
367
+ })
254
368
  if (item.length === 1) {
255
369
  ok = false
256
370
  newWordsLength = newWordsLength - 1
@@ -262,8 +376,8 @@ function sortby(sortBool, data) {
262
376
  sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
263
377
  }
264
378
 
265
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
266
- <li>${item}
379
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
380
+ <li>${itemHtml}
267
381
  <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
268
382
  </li></a>`
269
383
  }
@@ -292,6 +406,29 @@ function sortby(sortBool, data) {
292
406
  main.innerHTML += ''
293
407
  } else {
294
408
  const result = newdata.map((item) => {
409
+ var text1 = serachValue.replace('?', '')
410
+ var text2 = item
411
+ var text3 = item
412
+ let chars = text1.split('')
413
+ let indexs = []
414
+ chars.map((i) => {
415
+ let findIndexes = findIndex(text3, i)
416
+ if (findIndexes.length > 0) {
417
+ text3 = text3.split('')
418
+ text3[findIndexes] = '$'
419
+ text3 = text3.join('')
420
+ indexs = [...indexs, ...findIndexes]
421
+ }
422
+ })
423
+ let itemHtml = ''
424
+ text2.split('').map((itemValue, index) => {
425
+ let check = indexs.find((i) => i === index)
426
+ if (check !== undefined) {
427
+ itemHtml += `${itemValue}`
428
+ } else {
429
+ itemHtml += `<span class='highlight'>${itemValue}</span>`
430
+ }
431
+ })
295
432
  if (item.length === 1) {
296
433
  ok = false
297
434
  } else {
@@ -302,8 +439,8 @@ function sortby(sortBool, data) {
302
439
  sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
303
440
  }
304
441
 
305
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
306
- <li>${item}
442
+ return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
443
+ <li>${itemHtml}
307
444
  <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
308
445
  </li></a>`
309
446
  }
@@ -509,3 +646,16 @@ function scroll_Left() {
509
646
  function scroll_Right() {
510
647
  tab_container.scrollLeft -= 130
511
648
  }
649
+ function findIndex(str, char) {
650
+ const strLength = str.length
651
+ const indexes = []
652
+ let newStr = str
653
+
654
+ while (newStr && newStr.indexOf(char) > -1) {
655
+ indexes.push(newStr.indexOf(char) + strLength - newStr.length)
656
+ newStr = newStr.substring(newStr.indexOf(char) + 1)
657
+ newStr = newStr.substring(newStr.indexOf(char) + 1)
658
+ }
659
+
660
+ return indexes
661
+ }
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: 0.4.5
4
+ version: 0.4.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - manpreet-appscms
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-09-15 00:00:00.000000000 Z
11
+ date: 2021-10-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: jekyll
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '12.0'
55
- description:
55
+ description:
56
56
  email:
57
57
  - manpreet@appscms.com
58
58
  executables: []
@@ -105,6 +105,7 @@ files:
105
105
  - _includes/author_bio.html
106
106
  - _includes/authors/authors.html
107
107
  - _includes/autogenerated/content.html
108
+ - _includes/autogenerated/footer.html
108
109
  - _includes/custom-head.html
109
110
  - _includes/disqus_comments.html
110
111
  - _includes/filterWords/index.html
@@ -216,7 +217,7 @@ homepage: https://github.com/Contenttool/word-games-theme
216
217
  licenses:
217
218
  - MIT
218
219
  metadata: {}
219
- post_install_message:
220
+ post_install_message:
220
221
  rdoc_options: []
221
222
  require_paths:
222
223
  - lib
@@ -231,8 +232,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
232
  - !ruby/object:Gem::Version
232
233
  version: '0'
233
234
  requirements: []
234
- rubygems_version: 3.1.2
235
- signing_key:
235
+ rubygems_version: 3.1.6
236
+ signing_key:
236
237
  specification_version: 4
237
238
  summary: Word-Games theme for all word-games-sites
238
239
  test_files: []