word-games-theme 3.1.5 → 3.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/wordgames/advanced-filter/advanced-filter.html +11 -10
- data/_includes/wordgames/words-data/words-data.html +13 -8
- data/_layouts/wordgames-home.html +12 -1
- data/assets/css/wordGroup.css +1 -1
- data/assets/css/wordfinder-result.css +1 -1
- data/assets/css/wordgames-result.css +7 -4
- data/assets/js/scrabbleDictonary.js +4 -4
- data/assets/js/show-more-words.js +3 -3
- data/assets/js/wordfinder-home.js +44 -20
- data/assets/js/wordfinder-worker.js +69 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5a3ee85b4117adf5dfb61c935d85e42797072e0d88260bedf911be60203f8f8
|
4
|
+
data.tar.gz: 368c661dedab31a6cbc017a31b7a9eaa27b1cb5f00079cc0cd6555068349df56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ec348039e2e3c9ca412cdee09f900eeeb36a6a43a100004d85707c62d0c0081b332d385475250f03e86ad4df8974e907c747dd86af2a735f4394abd51c908116
|
7
|
+
data.tar.gz: 44263306fe7867366235b84bdd77ced77ca915cb1f77f4a3a67e722d52031fdec32481baefd48a786fbe3814c3a1c43e6d684d5428844a060cb807628480fd09
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
|
9
9
|
|
10
|
-
<div class="fillterWrapper my-
|
10
|
+
<div class="fillterWrapper my-4 filterShow">
|
11
11
|
<div class="startsWith">
|
12
12
|
<input class="filter_val textBoxes" autocomplete="off" type="text" id="startsWith" placeholder="Starts with" value=""
|
13
13
|
name="prefix">
|
@@ -23,6 +23,15 @@
|
|
23
23
|
<img width="30px" height="30px" src="/assets/images/questionmark.svg" alt="Question Mark" />
|
24
24
|
</div>
|
25
25
|
</div>
|
26
|
+
<div class="mustInclude">
|
27
|
+
<input class="filter_val textBoxes" autocomplete="off" type="text" id="mustInclude" placeholder="Contains"
|
28
|
+
name="contains">
|
29
|
+
<div class="filter-tooltip" data-tip="Words that contain letters in this order(ab)"
|
30
|
+
id="Words that contain letters in this order(ab)">
|
31
|
+
<img width="30px" height="30px" src="/assets/images/questionmark.svg" alt="Question Mark" />
|
32
|
+
</div>
|
33
|
+
|
34
|
+
</div>
|
26
35
|
<div class="wordLength same">
|
27
36
|
<input autocomplete="off" type="number" class="filter_val textBoxes" id="wordLength" placeholder="Length" name="length"
|
28
37
|
value="{{page.letter}}">
|
@@ -41,15 +50,7 @@
|
|
41
50
|
<img width="30px" height="30px" src="/assets/images/questionmark.svg" alt="Question Mark" />
|
42
51
|
</div>
|
43
52
|
</div>
|
44
|
-
|
45
|
-
<input class="filter_val textBoxes" autocomplete="off" type="text" id="mustInclude" placeholder="Contains"
|
46
|
-
name="contains">
|
47
|
-
<div class="filter-tooltip" data-tip="Words that contain letters in this order(ab)"
|
48
|
-
id="Words that contain letters in this order(ab)">
|
49
|
-
<img width="30px" height="30px" src="/assets/images/questionmark.svg" alt="Question Mark" />
|
50
|
-
</div>
|
51
|
-
|
52
|
-
</div>
|
53
|
+
|
53
54
|
|
54
55
|
<div class="exculdeWith">
|
55
56
|
<input class="filter_val textBoxes" autocomplete="off" type="text" id="exculdeWith" placeholder="Exclude" value=""
|
@@ -1,4 +1,15 @@
|
|
1
1
|
{% assign dataToShow = site.data[page.folderName][page.lang][page.fileName] %}
|
2
|
+
{%- if page.letter -%}
|
3
|
+
<style>
|
4
|
+
.letter-length {
|
5
|
+
display: none;
|
6
|
+
}
|
7
|
+
|
8
|
+
.sortingFilters {
|
9
|
+
display: flex !important;
|
10
|
+
}
|
11
|
+
</style>
|
12
|
+
{%- endif -%}
|
2
13
|
<div class="row pad m-0">
|
3
14
|
<div class="col-md-12">
|
4
15
|
{%- if page.letter -%}
|
@@ -6,7 +17,7 @@
|
|
6
17
|
onclick="gtag('event', 'click', {'event_category': 'Link click', 'event_label': 'Home Page Search Result'});"></a>
|
7
18
|
{%- endif -%}
|
8
19
|
<div class="filters d-flex justify-content-between align-items-center">
|
9
|
-
<div class="wordCount">{{dataToShow.wordLength}}</div>
|
20
|
+
<div class="wordCount font-weight-bolder">{{dataToShow.wordLength}}</div>
|
10
21
|
<div class="filterSortedIcons">
|
11
22
|
<div class="filter-icon" onclick="myFunction()">
|
12
23
|
<i class="bi bi-filter"></i>
|
@@ -40,14 +51,11 @@
|
|
40
51
|
</div>
|
41
52
|
</div>
|
42
53
|
<div class="sortingFilters wrapper_dropDown justify-content-end" style="gap:10px; display: none;">
|
43
|
-
|
44
|
-
|
45
54
|
<div class="letter-length">
|
46
55
|
<select class="form-select length-select">
|
47
56
|
<option selected="true" hidden>Letter Length</option>
|
48
57
|
</select>
|
49
58
|
</div>
|
50
|
-
|
51
59
|
<div id="sort-select">
|
52
60
|
<select class="form-select sort-select" id="select_dropDown">
|
53
61
|
<option selected="true" hidden id="alpha" value="alpha">Sort by</option>
|
@@ -59,8 +67,6 @@
|
|
59
67
|
</div>
|
60
68
|
</div>
|
61
69
|
|
62
|
-
|
63
|
-
|
64
70
|
{%- if page.letter -%}
|
65
71
|
<div id="get-value" data-fileName="{{page.fileName}}" data-lang="{{page.lang}}"
|
66
72
|
data-folderName="{{page.folderName}}" class="main">
|
@@ -73,7 +79,7 @@
|
|
73
79
|
</div>
|
74
80
|
<div class="wordList">
|
75
81
|
<ul class="ul list-unstyled">
|
76
|
-
{%- for item in scrabblewords limit:
|
82
|
+
{%- for item in scrabblewords limit: 97 %}
|
77
83
|
{%- assign value = item.word -%}
|
78
84
|
<a class="anchor__style" target="_blank" href="/word-meaning?search={{item.word | strip_html}}">
|
79
85
|
<div class="tool-tip" data-toggle="tooltip" data-placement="top"
|
@@ -107,7 +113,6 @@
|
|
107
113
|
<div class="main"></div>
|
108
114
|
{%- endif -%}
|
109
115
|
|
110
|
-
|
111
116
|
<div class="errorMsg"></div>
|
112
117
|
|
113
118
|
</div>
|
@@ -5,6 +5,16 @@
|
|
5
5
|
|
6
6
|
{%- if site.noResultPage or page.noResultPage -%}
|
7
7
|
{%- if page.letter -%}
|
8
|
+
|
9
|
+
{%- if page.permalink == "/five-letter-words-with-these-letters" -%}
|
10
|
+
<style>
|
11
|
+
.serachSection {
|
12
|
+
position: relative !important;
|
13
|
+
top: 0px !important;
|
14
|
+
}
|
15
|
+
</style>
|
16
|
+
{%- endif -%}
|
17
|
+
|
8
18
|
<style>
|
9
19
|
.main-header {
|
10
20
|
padding-top: 12vh;
|
@@ -102,7 +112,8 @@
|
|
102
112
|
|
103
113
|
<script data-lang="{{page.lang}}" defer src="/assets/js/theme.js"></script>
|
104
114
|
{%- if site.noResultPage -%}
|
105
|
-
<script data-url="{{site.url}}" data-blanktilerange="{{page.blanktilerange}}" defer
|
115
|
+
<script data-url="{{site.url}}" data-blanktilerange="{{page.blanktilerange}}" defer
|
116
|
+
src="/assets/js/wordfinder-home.js"></script>
|
106
117
|
{%- else -%}
|
107
118
|
<script defer src="/assets/js/wordgames-home.js"></script>
|
108
119
|
{%- endif -%}
|
data/assets/css/wordGroup.css
CHANGED
@@ -360,7 +360,7 @@ input:-webkit-autofill:active {
|
|
360
360
|
}
|
361
361
|
|
362
362
|
.wordCount {
|
363
|
-
text-indent: 10px;
|
363
|
+
/* text-indent: 10px; */
|
364
364
|
font-size: 18px;
|
365
365
|
}
|
366
366
|
|
@@ -422,12 +422,12 @@ input:-webkit-autofill:active {
|
|
422
422
|
}
|
423
423
|
|
424
424
|
.wordList>ul li {
|
425
|
-
padding: 8px
|
425
|
+
padding: 8px 10px;
|
426
426
|
background: #f8f9fa;
|
427
427
|
border-radius: 5px;
|
428
|
-
margin: 6px
|
428
|
+
margin: 6px 5px;
|
429
429
|
width: auto;
|
430
|
-
min-width: 100px;
|
430
|
+
/* min-width: 100px; */
|
431
431
|
text-align: center;
|
432
432
|
border: solid 1px var(--black-color);
|
433
433
|
box-shadow: 2px 2px 1px 0px var(--black-color);
|
@@ -445,6 +445,9 @@ input:-webkit-autofill:active {
|
|
445
445
|
}
|
446
446
|
|
447
447
|
.points {
|
448
|
+
position: relative;
|
449
|
+
top: 4px;
|
450
|
+
font-size: 12px;
|
448
451
|
color: #73716e;
|
449
452
|
font-weight: 600;
|
450
453
|
}
|
@@ -11,7 +11,7 @@ defintions.innerHTML = `Defintion(s) for ${serachValue}`
|
|
11
11
|
// DICTONARY
|
12
12
|
const fetchMeaning = async (serachValue) => {
|
13
13
|
try {
|
14
|
-
let resMeaning = await fetch(
|
14
|
+
let resMeaning = await fetch(`/.netlify/functions/wordMeaning?search=${serachValue}`)
|
15
15
|
let getDef = await resMeaning.text()
|
16
16
|
|
17
17
|
if (getDef && resMeaning.status == 200) {
|
@@ -147,7 +147,7 @@ const fetchTWL06Dic = async (serachValue) => {
|
|
147
147
|
}
|
148
148
|
|
149
149
|
try {
|
150
|
-
let res = await fetch(
|
150
|
+
let res = await fetch(`/.netlify/functions/gettwl06?search=${serachValue}`)
|
151
151
|
|
152
152
|
let getData = await res.text()
|
153
153
|
|
@@ -204,7 +204,7 @@ const fetchSOWPODSDic = async (serachValue) => {
|
|
204
204
|
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
205
205
|
}
|
206
206
|
|
207
|
-
let res = await fetch(
|
207
|
+
let res = await fetch(`/.netlify/functions/getsowpods?search=${serachValue}`)
|
208
208
|
|
209
209
|
let getData = await res.text()
|
210
210
|
|
@@ -257,7 +257,7 @@ const fetchEnableDic = async (serachValue) => {
|
|
257
257
|
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
258
258
|
}
|
259
259
|
|
260
|
-
let res = await fetch(
|
260
|
+
let res = await fetch(`/.netlify/functions/getenable?search=${serachValue}`)
|
261
261
|
|
262
262
|
let getData = await res.text()
|
263
263
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
let data_indexs =
|
2
|
+
let data_indexs = 98;
|
3
3
|
function ShowMoreWords(e) {
|
4
4
|
let showmore = e.parentElement.children[0];
|
5
5
|
let script = document.getElementById("get-value");
|
@@ -28,7 +28,7 @@ function ShowMoreWords(e) {
|
|
28
28
|
}
|
29
29
|
}
|
30
30
|
if (data_indexs < full_words.length) {
|
31
|
-
for (let d = data_indexs; d < data_indexs +
|
31
|
+
for (let d = data_indexs; d < data_indexs + 98; d++) {
|
32
32
|
if (full_words[d] != undefined) {
|
33
33
|
// $('[data-toggle="tooltip"]').tooltip();
|
34
34
|
let li = document.createElement("li");
|
@@ -61,7 +61,7 @@ function ShowMoreWords(e) {
|
|
61
61
|
}
|
62
62
|
}
|
63
63
|
document.getElementById(id).innerHTML = `See More Words`;
|
64
|
-
data_indexs +=
|
64
|
+
data_indexs += 98;
|
65
65
|
} else {
|
66
66
|
document.getElementById(id).style.display = "none";
|
67
67
|
}
|
@@ -350,7 +350,6 @@ const worker = new Worker('/assets/js/wordfinder-worker.js');
|
|
350
350
|
const getData = async (serachValue) => {
|
351
351
|
try {
|
352
352
|
let selectedDictionary = document.querySelector(".select_dropDown2").value;
|
353
|
-
|
354
353
|
if (letterLen) {
|
355
354
|
home_page_search_result = document.querySelector("#home_page_search_result")
|
356
355
|
homePageSearchResult = `/?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
|
@@ -359,10 +358,13 @@ const getData = async (serachValue) => {
|
|
359
358
|
document.querySelector(".main-header").style.background = "#fff"
|
360
359
|
document.querySelector(".heading-h2").style.display = "none"
|
361
360
|
document.querySelector(".sortingFilters").style.display = "none"
|
362
|
-
|
363
361
|
errorMsg.innerHTML = "";
|
364
362
|
wordCount.innerHTML = "";
|
365
363
|
|
364
|
+
|
365
|
+
if (serachValue) {
|
366
|
+
serachValue = serachValue + startsWith.value + endsWith.value + mustInclude.value + inculdeWith.value + exculdeWith.value
|
367
|
+
}
|
366
368
|
worker.postMessage({
|
367
369
|
type: "api",
|
368
370
|
serachValue: serachValue,
|
@@ -372,7 +374,7 @@ const getData = async (serachValue) => {
|
|
372
374
|
worker.onmessage = (event) => {
|
373
375
|
main.innerHTML = "";
|
374
376
|
serachBtn.style.background = 'url(/assets/images/search.svg) no-repeat center center';
|
375
|
-
getWords(event.data.data);
|
377
|
+
getWords(serachValue, event.data.data);
|
376
378
|
}
|
377
379
|
} catch (error) {
|
378
380
|
console.log(error);
|
@@ -405,20 +407,28 @@ let previousDataIndex = null
|
|
405
407
|
let previousID = null;
|
406
408
|
let storepreviousIndex = []
|
407
409
|
let moreData = []
|
408
|
-
let data_index =
|
409
|
-
function getWords(data) {
|
410
|
-
data_index =
|
410
|
+
let data_index = 98;
|
411
|
+
function getWords(serachValue, data) {
|
412
|
+
data_index = 98
|
411
413
|
moreData = []
|
412
414
|
storepreviousIndex = []
|
413
415
|
main.innerHTML = "";
|
414
416
|
lengthSelect.innerHTML = ""
|
415
417
|
if (typeof data === "string") {
|
418
|
+
const params = new URLSearchParams(window.location.search);
|
416
419
|
errorMsg.innerHTML = "no words found";
|
420
|
+
|
421
|
+
if (!letterLen) {
|
422
|
+
let serachValue = params.get("search").toLowerCase();
|
423
|
+
txtBox.value = serachValue + "?"
|
424
|
+
logSubmit(new Event('submit'))
|
425
|
+
}
|
426
|
+
|
417
427
|
} else {
|
418
428
|
worker.postMessage({
|
419
429
|
type: 'filterwords',
|
420
430
|
data: data,
|
421
|
-
serachValue:
|
431
|
+
serachValue: serachValue,
|
422
432
|
prefixValue: startsWith.value,
|
423
433
|
containsValue: mustInclude.value,
|
424
434
|
suffixValue: endsWith.value,
|
@@ -483,6 +493,7 @@ function getWords(data) {
|
|
483
493
|
home_page_search_result.innerHTML = `See words of any length with letters ${serachValue.split("")}`
|
484
494
|
}
|
485
495
|
|
496
|
+
|
486
497
|
main.innerHTML += `
|
487
498
|
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
488
499
|
<h3 class="wordListHeading lead">${i} Letter Words</h3>
|
@@ -504,7 +515,6 @@ function getWords(data) {
|
|
504
515
|
}
|
505
516
|
}
|
506
517
|
if (newWordsLength === 0) {
|
507
|
-
console.log(newdata);
|
508
518
|
errorMsg.innerHTML = "No Words Found";
|
509
519
|
document.querySelector(".sortingFilters").style.display = "none"
|
510
520
|
} else {
|
@@ -552,11 +562,11 @@ async function showMoreWords(e) {
|
|
552
562
|
let id = showmore.id;
|
553
563
|
|
554
564
|
if (previousID !== null && parseInt(previousID) !== parseInt(id)) {
|
555
|
-
data_index =
|
565
|
+
data_index = 98
|
556
566
|
const filteredIndexes = storepreviousIndex.filter(item => item.id === id);
|
557
567
|
if (filteredIndexes.length > 0) {
|
558
568
|
const lastItem = filteredIndexes[filteredIndexes.length - 1];
|
559
|
-
data_index = lastItem.data_index +
|
569
|
+
data_index = lastItem.data_index + 98;
|
560
570
|
lastItem.data_index = data_index;
|
561
571
|
}
|
562
572
|
}
|
@@ -566,16 +576,21 @@ async function showMoreWords(e) {
|
|
566
576
|
id
|
567
577
|
})
|
568
578
|
console.log("Current data_index:", data_index);
|
569
|
-
|
570
579
|
document.getElementById(id).innerHTML = `Loading...`;
|
571
580
|
let content_area = document.getElementById("alpha_" + id).getElementsByClassName("wordList")[0];
|
572
581
|
const result = await getMoreWords();
|
573
582
|
let full_words = result.filter((item) => item.length === Number(id));
|
574
583
|
|
575
584
|
if (data_index < full_words.length) {
|
576
|
-
for (let d = data_index; d < data_index +
|
585
|
+
for (let d = data_index; d < data_index + 98; d++) {
|
577
586
|
if (full_words[d] != undefined) {
|
578
587
|
let itemHtml = "";
|
588
|
+
let points
|
589
|
+
let ScrabbleLetterScore = ScrabbleScore();
|
590
|
+
|
591
|
+
if (serachValue) {
|
592
|
+
serachValue = serachValue + startsWith.value + endsWith.value + mustInclude.value + inculdeWith.value + exculdeWith.value
|
593
|
+
}
|
579
594
|
if (serachValue) {
|
580
595
|
var text1 = serachValue.replace("?", "");
|
581
596
|
var text2 = full_words[d];
|
@@ -591,24 +606,33 @@ async function showMoreWords(e) {
|
|
591
606
|
indexs = [...indexs, ...findIndexes];
|
592
607
|
}
|
593
608
|
});
|
609
|
+
let n1 = false
|
594
610
|
text2.split("").map((itemValue, index) => {
|
595
611
|
let check = indexs.find((i) => i === index);
|
596
612
|
if (check !== undefined) {
|
597
613
|
itemHtml += `${itemValue}`;
|
614
|
+
n1 = true
|
598
615
|
} else {
|
599
616
|
itemHtml += `<span class='highlight'>${itemValue}</span>`;
|
600
617
|
}
|
601
618
|
});
|
619
|
+
if (n1 == true) {
|
620
|
+
let parsedText = itemHtml.replace(/<span[^>]*>.*?<\/span>/g, '');
|
621
|
+
// console.log(parsedText);
|
622
|
+
points = 0
|
623
|
+
for (let i = 0; i < parsedText.length; i++) {
|
624
|
+
points += ScrabbleLetterScore[parsedText[i]] || 0; // for unknown characters
|
625
|
+
}
|
626
|
+
}
|
602
627
|
} else {
|
603
628
|
itemHtml = full_words[d]
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
for (let i = 0; i < full_words[d].length; i++) {
|
609
|
-
points += ScrabbleLetterScore[full_words[d][i]] || 0; // for unknown characters
|
629
|
+
points = 0;
|
630
|
+
for (let i = 0; i < full_words[d].length; i++) {
|
631
|
+
points += ScrabbleLetterScore[full_words[d][i]] || 0; // for unknown characters
|
632
|
+
}
|
610
633
|
}
|
611
634
|
|
635
|
+
full_words[d] = full_words[d].toLowerCase();
|
612
636
|
let span = document.createElement("span");
|
613
637
|
span.setAttribute("class", "points");
|
614
638
|
span.setAttribute("value", `${points}`);
|
@@ -625,7 +649,7 @@ async function showMoreWords(e) {
|
|
625
649
|
}
|
626
650
|
}
|
627
651
|
document.getElementById(id).innerHTML = `More Words`;
|
628
|
-
data_index +=
|
652
|
+
data_index += 98;
|
629
653
|
} else {
|
630
654
|
document.getElementById(id).style.display = "none";
|
631
655
|
}
|
@@ -703,7 +727,7 @@ function showMoreLimit() {
|
|
703
727
|
for (let i = 0; i < showmore.length; i++) {
|
704
728
|
let data_of_button = document.getElementById("alpha_" + showmore[i].getAttribute("id"));
|
705
729
|
let final_data = data_of_button.getElementsByClassName("anchor__style");
|
706
|
-
if (final_data.length <
|
730
|
+
if (final_data.length < 98) {
|
707
731
|
tableFooter[i].style.display = "none";
|
708
732
|
}
|
709
733
|
}
|
@@ -88,14 +88,20 @@ self.onmessage = async (event) => {
|
|
88
88
|
|
89
89
|
} else {
|
90
90
|
newWordsLength += newdata.length;
|
91
|
-
newdata = sortWords(sortingFilter, newdata, dictonary);
|
91
|
+
newdata = sortWords(serachValue, sortingFilter, newdata, dictonary);
|
92
|
+
console.log(newdata);
|
93
|
+
|
92
94
|
let result = newdata.map((item) => {
|
93
95
|
let itemHtml = "";
|
96
|
+
let ScrabbleLetterScore = ScrabbleScore();
|
97
|
+
let sum = 0
|
98
|
+
|
94
99
|
if (serachValue) {
|
95
100
|
var text1 = serachValue.replace("?", "");
|
96
101
|
var text2 = item;
|
97
102
|
var text3 = item;
|
98
103
|
let chars = text1.split("");
|
104
|
+
|
99
105
|
let indexs = [];
|
100
106
|
chars.map((i) => {
|
101
107
|
let findIndexes = findIndex(text3, i);
|
@@ -106,27 +112,37 @@ self.onmessage = async (event) => {
|
|
106
112
|
indexs = [...indexs, ...findIndexes];
|
107
113
|
}
|
108
114
|
});
|
115
|
+
|
116
|
+
let n1 = false
|
109
117
|
text2.split("").map((itemValue, index) => {
|
110
118
|
let check = indexs.find((i) => i === index);
|
111
119
|
if (check !== undefined) {
|
112
120
|
itemHtml += `${itemValue}`;
|
121
|
+
n1 = true
|
113
122
|
} else {
|
114
123
|
itemHtml += `<span class='highlight'>${itemValue}</span>`;
|
115
124
|
}
|
116
125
|
});
|
126
|
+
|
127
|
+
if (n1 == true) {
|
128
|
+
let parsedText = itemHtml.replace(/<span[^>]*>.*?<\/span>/g, '');
|
129
|
+
sum = 0
|
130
|
+
for (let i = 0; i < parsedText.length; i++) {
|
131
|
+
sum += ScrabbleLetterScore[parsedText[i]] || 0; // for unknown characters
|
132
|
+
}
|
133
|
+
}
|
117
134
|
} else {
|
118
135
|
itemHtml = item
|
136
|
+
sum = 0
|
137
|
+
for (let i = 0; i < itemHtml.length; i++) {
|
138
|
+
sum += ScrabbleLetterScore[itemHtml[i]] || 0; // for unknown characters
|
139
|
+
}
|
119
140
|
}
|
120
141
|
if (item.length === 1) {
|
121
142
|
ok = false;
|
122
143
|
newWordsLength = newWordsLength - 1;
|
123
144
|
} else {
|
124
|
-
let ScrabbleLetterScore = ScrabbleScore();
|
125
|
-
sum = 0;
|
126
145
|
item = item.toLowerCase();
|
127
|
-
for (let i = 0; i < item.length; i++) {
|
128
|
-
sum += ScrabbleLetterScore[item[i]] || 0; // for unknown characters
|
129
|
-
}
|
130
146
|
return `
|
131
147
|
<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
|
132
148
|
${itemHtml}
|
@@ -135,7 +151,7 @@ self.onmessage = async (event) => {
|
|
135
151
|
`;
|
136
152
|
}
|
137
153
|
});
|
138
|
-
result = result.slice(0,
|
154
|
+
result = result.slice(0, 98)
|
139
155
|
self.postMessage({
|
140
156
|
type: "filterwords",
|
141
157
|
prefixValue: prefixValue,
|
@@ -155,7 +171,7 @@ self.onmessage = async (event) => {
|
|
155
171
|
};
|
156
172
|
|
157
173
|
|
158
|
-
function sortWords(sortingFilter, data, dictonary) {
|
174
|
+
function sortWords(serachValue, sortingFilter, data, dictonary) {
|
159
175
|
if (sortingFilter == 0) {
|
160
176
|
return data;
|
161
177
|
} else if (sortingFilter == 1) {
|
@@ -174,12 +190,54 @@ function sortWords(sortingFilter, data, dictonary) {
|
|
174
190
|
let ScrabbleLetterScore = ScrabbleScore(dictonary);
|
175
191
|
let points = 0;
|
176
192
|
item = item.toLowerCase();
|
177
|
-
|
178
|
-
|
193
|
+
let itemHtml = "";
|
194
|
+
let sum = 0
|
195
|
+
|
196
|
+
if (serachValue) {
|
197
|
+
var text1 = serachValue.replace("?", "");
|
198
|
+
var text2 = item;
|
199
|
+
var text3 = item;
|
200
|
+
let chars = text1.split("");
|
201
|
+
|
202
|
+
let indexs = [];
|
203
|
+
chars.map((i) => {
|
204
|
+
let findIndexes = findIndex(text3, i);
|
205
|
+
if (findIndexes.length > 0) {
|
206
|
+
text3 = text3.split("");
|
207
|
+
text3[findIndexes] = "$";
|
208
|
+
text3 = text3.join("");
|
209
|
+
indexs = [...indexs, ...findIndexes];
|
210
|
+
}
|
211
|
+
});
|
212
|
+
|
213
|
+
let n1 = false
|
214
|
+
text2.split("").map((itemValue, index) => {
|
215
|
+
let check = indexs.find((i) => i === index);
|
216
|
+
if (check !== undefined) {
|
217
|
+
itemHtml += `${itemValue}`;
|
218
|
+
n1 = true
|
219
|
+
} else {
|
220
|
+
itemHtml += `<span class='highlight'>${itemValue}</span>`;
|
221
|
+
}
|
222
|
+
});
|
223
|
+
|
224
|
+
if (n1 == true) {
|
225
|
+
let parsedText = itemHtml.replace(/<span[^>]*>.*?<\/span>/g, '');
|
226
|
+
sum = 0
|
227
|
+
for (let i = 0; i < parsedText.length; i++) {
|
228
|
+
sum += ScrabbleLetterScore[parsedText[i]] || 0; // for unknown characters
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}else{
|
232
|
+
itemHtml = item
|
233
|
+
sum = 0
|
234
|
+
for (let i = 0; i < itemHtml.length; i++) {
|
235
|
+
sum += ScrabbleLetterScore[itemHtml[i]] || 0; // for unknown characters
|
236
|
+
}
|
179
237
|
}
|
180
238
|
const value = {
|
181
239
|
words: item,
|
182
|
-
points:
|
240
|
+
points: sum,
|
183
241
|
};
|
184
242
|
newArray.push(value);
|
185
243
|
}
|
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: 3.1.
|
4
|
+
version: 3.1.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-
|
11
|
+
date: 2024-09-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|