word-games-theme 2.8.3 → 2.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/css/wordgames-result.css +1 -1
- data/assets/js/wordfinder.js +12 -6
- data/assets/js/words-in-certain-positions-worker.js +112 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 59c3c5987a2db2a23978e1b311cc8043269e965d75f78d9310ee6874aab83ace
|
4
|
+
data.tar.gz: 90ec438023355bf4de30fa30756ce055ba43712791cd3227248e3cd45420828e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fe45d8e1cae6738209e613843403025a922fcf9f009aa37a3ac2965865bdfad90a863808c5555d3d8cd59b27a1a4434f2be8555da34d126ad61a3a44d7fca24d
|
7
|
+
data.tar.gz: 5289ecc157d4064d94aafdb6b660366ba358da01cab650937f35faf9cbf98956caf119e58ce2988df668e140ebff4a5e07a2313cbba7d2a16534b36f228be433
|
data/assets/js/wordfinder.js
CHANGED
@@ -90,14 +90,20 @@ const getDiff = (text1, text2) => {
|
|
90
90
|
let authorsLists = document.querySelector(".authors-list")
|
91
91
|
let serachBtn = document.querySelector(".serachBtn")
|
92
92
|
let searchBtnContainer = document.querySelector(".search-btn-container")
|
93
|
-
|
94
|
-
let
|
95
|
-
let homePageSearchResult = `/?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
|
93
|
+
let home_page_search_result
|
94
|
+
let homePageSearchResult
|
96
95
|
|
97
96
|
// getWords define...
|
98
97
|
const worker = new Worker('/assets/js/wordfinder-worker.js');
|
99
98
|
const getData = async (serachValue) => {
|
100
99
|
try {
|
100
|
+
|
101
|
+
if (letterLen) {
|
102
|
+
home_page_search_result = document.querySelector("#home_page_search_result")
|
103
|
+
homePageSearchResult = `/?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
|
104
|
+
}
|
105
|
+
|
106
|
+
|
101
107
|
document.querySelector(".main-header").style.background = "#fff"
|
102
108
|
document.querySelector(".heading-h2").style.display = "none"
|
103
109
|
document.querySelector(".sortingFilters").style.display = "none"
|
@@ -322,12 +328,12 @@ function getWords(data) {
|
|
322
328
|
}
|
323
329
|
|
324
330
|
|
325
|
-
if(letterLen){
|
331
|
+
if (letterLen) {
|
326
332
|
home_page_search_result.href = homePageSearchResult
|
327
333
|
home_page_search_result.innerHTML = `See words of any length with letters ${serachValue.split("")}`
|
328
334
|
}
|
329
|
-
|
330
|
-
|
335
|
+
|
336
|
+
|
331
337
|
main.innerHTML += `
|
332
338
|
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
333
339
|
<h3 class="wordListHeading lead">${i} Letter Words</h3>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
self.onmessage = async (event) => {
|
2
|
+
if (event.data.type === "api") {
|
3
|
+
const { method, endpoint, greenLetters, greenWithIndex } = event.data
|
4
|
+
let response = await fetch(`${endpoint}`, {
|
5
|
+
method: `${method}`,
|
6
|
+
body: JSON.stringify({
|
7
|
+
greenLetters: greenLetters,
|
8
|
+
greenWithIndex: greenWithIndex,
|
9
|
+
}),
|
10
|
+
})
|
11
|
+
let data = await response.json();
|
12
|
+
data = data.slice(0, 1500)
|
13
|
+
let ok = true
|
14
|
+
let newWordsLength = 0
|
15
|
+
for (let i = 0; i <= 15; i++) {
|
16
|
+
let newdata = data.filter((item) => item.length === i)
|
17
|
+
newWordsLength += newdata.length
|
18
|
+
let result = newdata.map((item) => {
|
19
|
+
if (item.length === 1) {
|
20
|
+
ok = false
|
21
|
+
newWordsLength = newWordsLength - 1
|
22
|
+
} else {
|
23
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
24
|
+
sum = 0
|
25
|
+
item = item.toLowerCase()
|
26
|
+
for (let i = 0; i < item.length; i++) {
|
27
|
+
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
28
|
+
}
|
29
|
+
return `
|
30
|
+
<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
|
31
|
+
${item}
|
32
|
+
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px">${sum}</span>
|
33
|
+
</a>
|
34
|
+
`;
|
35
|
+
}
|
36
|
+
})
|
37
|
+
|
38
|
+
self.postMessage({
|
39
|
+
data: newdata,
|
40
|
+
i: i,
|
41
|
+
newWordsLength: newWordsLength,
|
42
|
+
result,
|
43
|
+
ok: ok
|
44
|
+
});
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
};
|
49
|
+
const ScrabbleScore = (dictonary) => {
|
50
|
+
let twl06_sowpods = {
|
51
|
+
a: 1,
|
52
|
+
e: 1,
|
53
|
+
i: 1,
|
54
|
+
o: 1,
|
55
|
+
u: 1,
|
56
|
+
l: 1,
|
57
|
+
n: 1,
|
58
|
+
r: 1,
|
59
|
+
s: 1,
|
60
|
+
t: 1,
|
61
|
+
d: 2,
|
62
|
+
g: 2,
|
63
|
+
b: 3,
|
64
|
+
c: 3,
|
65
|
+
m: 3,
|
66
|
+
p: 3,
|
67
|
+
f: 4,
|
68
|
+
h: 4,
|
69
|
+
v: 4,
|
70
|
+
w: 4,
|
71
|
+
y: 4,
|
72
|
+
k: 5,
|
73
|
+
j: 8,
|
74
|
+
x: 8,
|
75
|
+
q: 10,
|
76
|
+
z: 10,
|
77
|
+
};
|
78
|
+
let wwfScore = {
|
79
|
+
a: 1,
|
80
|
+
b: 4,
|
81
|
+
c: 4,
|
82
|
+
d: 2,
|
83
|
+
e: 1,
|
84
|
+
f: 4,
|
85
|
+
g: 3,
|
86
|
+
h: 3,
|
87
|
+
i: 1,
|
88
|
+
j: 10,
|
89
|
+
k: 5,
|
90
|
+
l: 2,
|
91
|
+
m: 4,
|
92
|
+
n: 2,
|
93
|
+
o: 1,
|
94
|
+
p: 4,
|
95
|
+
q: 10,
|
96
|
+
r: 1,
|
97
|
+
s: 1,
|
98
|
+
t: 1,
|
99
|
+
u: 2,
|
100
|
+
v: 5,
|
101
|
+
w: 4,
|
102
|
+
x: 8,
|
103
|
+
y: 3,
|
104
|
+
z: 10,
|
105
|
+
};
|
106
|
+
|
107
|
+
if (dictonary === "wwf") {
|
108
|
+
return wwfScore;
|
109
|
+
} else {
|
110
|
+
return twl06_sowpods;
|
111
|
+
}
|
112
|
+
};
|
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.8.
|
4
|
+
version: 2.8.4
|
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-05-
|
11
|
+
date: 2024-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|
@@ -401,6 +401,7 @@ files:
|
|
401
401
|
- assets/js/wordgames-xyz.js
|
402
402
|
- assets/js/wordleSolver.js
|
403
403
|
- assets/js/wordleSolverResult.js
|
404
|
+
- assets/js/words-in-certain-positions-worker.js
|
404
405
|
- assets/js/words-in-certain-positions.js
|
405
406
|
- assets/js/words-starting-with.js
|
406
407
|
- assets/js/xletter-home.js
|