word-games-theme 3.1.0 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_data/wordgames/en/root.json +291 -587
- data/_includes/wordgames/head/head.html +0 -2
- data/_includes/wordgames/header/new-header.html +1 -0
- data/_includes/wordgames/search-box/search-box.html +8 -8
- data/_layouts/wordgames-home.html +1 -5
- data/assets/css/wordgames-home.css +52 -1
- data/assets/css/wordgames-result.css +69 -46
- data/assets/js/X-letter.js +0 -1
- data/assets/js/theme.js +0 -1
- data/assets/js/wordfinder-home.js +562 -60
- data/assets/js/wordfinder-worker.js +73 -59
- data/assets/js/wordfinder.js +1 -1
- data/assets/js/wordleSolver.js +8 -3
- metadata +2 -2
@@ -10,6 +10,7 @@ self.onmessage = async (event) => {
|
|
10
10
|
const data = await response.json();
|
11
11
|
self.postMessage({ data });
|
12
12
|
}
|
13
|
+
|
13
14
|
if (event.data.type === "filterwords") {
|
14
15
|
const { data, serachValue, prefixValue, containsValue, suffixValue, exculdeValue, includeValue, lengthValue, sortingFilter, dictonary } = event.data
|
15
16
|
let newWordsLength = 0;
|
@@ -71,71 +72,84 @@ self.onmessage = async (event) => {
|
|
71
72
|
if (lengthValue) {
|
72
73
|
newdata = newdata.filter((item) => item.length == lengthValue);
|
73
74
|
}
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
75
|
+
if (newdata.length === 0) {
|
76
|
+
self.postMessage({
|
77
|
+
type: "filterwords",
|
78
|
+
prefixValue: prefixValue,
|
79
|
+
containsValue: containsValue,
|
80
|
+
suffixValue: suffixValue,
|
81
|
+
exculdeValue: exculdeValue,
|
82
|
+
includeValue: includeValue,
|
83
|
+
lengthValue: lengthValue,
|
84
|
+
newdata: newdata,
|
85
|
+
i: i,
|
86
|
+
newWordsLength: newWordsLength,
|
87
|
+
});
|
88
|
+
|
89
|
+
} else {
|
90
|
+
newWordsLength += newdata.length;
|
91
|
+
newdata = sortWords(sortingFilter, newdata, dictonary);
|
92
|
+
let result = newdata.map((item) => {
|
93
|
+
let itemHtml = "";
|
94
|
+
if (serachValue) {
|
95
|
+
var text1 = serachValue.replace("?", "");
|
96
|
+
var text2 = item;
|
97
|
+
var text3 = item;
|
98
|
+
let chars = text1.split("");
|
99
|
+
let indexs = [];
|
100
|
+
chars.map((i) => {
|
101
|
+
let findIndexes = findIndex(text3, i);
|
102
|
+
if (findIndexes.length > 0) {
|
103
|
+
text3 = text3.split("");
|
104
|
+
text3[findIndexes] = "$";
|
105
|
+
text3 = text3.join("");
|
106
|
+
indexs = [...indexs, ...findIndexes];
|
107
|
+
}
|
108
|
+
});
|
109
|
+
text2.split("").map((itemValue, index) => {
|
110
|
+
let check = indexs.find((i) => i === index);
|
111
|
+
if (check !== undefined) {
|
112
|
+
itemHtml += `${itemValue}`;
|
113
|
+
} else {
|
114
|
+
itemHtml += `<span class='highlight'>${itemValue}</span>`;
|
115
|
+
}
|
116
|
+
});
|
117
|
+
} else {
|
118
|
+
itemHtml = item
|
115
119
|
}
|
116
|
-
|
120
|
+
if (item.length === 1) {
|
121
|
+
ok = false;
|
122
|
+
newWordsLength = newWordsLength - 1;
|
123
|
+
} else {
|
124
|
+
let ScrabbleLetterScore = ScrabbleScore();
|
125
|
+
sum = 0;
|
126
|
+
item = item.toLowerCase();
|
127
|
+
for (let i = 0; i < item.length; i++) {
|
128
|
+
sum += ScrabbleLetterScore[item[i]] || 0; // for unknown characters
|
129
|
+
}
|
130
|
+
return `
|
117
131
|
<a class="anchor__style" title="Lookup ${item} in Dictionary" target="_blank" href="/word-meaning?search=${item.toLowerCase()}">
|
118
132
|
${itemHtml}
|
119
133
|
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px">${sum}</span>
|
120
134
|
</a>
|
121
135
|
`;
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
136
|
+
}
|
137
|
+
});
|
138
|
+
result = result.slice(0, 25)
|
139
|
+
self.postMessage({
|
140
|
+
type: "filterwords",
|
141
|
+
prefixValue: prefixValue,
|
142
|
+
containsValue: containsValue,
|
143
|
+
suffixValue: suffixValue,
|
144
|
+
exculdeValue: exculdeValue,
|
145
|
+
includeValue: includeValue,
|
146
|
+
lengthValue: lengthValue,
|
147
|
+
newdata: newdata,
|
148
|
+
i: i,
|
149
|
+
newWordsLength: newWordsLength,
|
150
|
+
result,
|
151
|
+
});
|
152
|
+
}
|
139
153
|
}
|
140
154
|
}
|
141
155
|
};
|
data/assets/js/wordfinder.js
CHANGED
data/assets/js/wordleSolver.js
CHANGED
@@ -58,6 +58,13 @@ let faqsContainer = document.querySelector("#faqsContainer")
|
|
58
58
|
let infographicsContainer = document.querySelector("#infographicsContainer")
|
59
59
|
let authorsLists = document.querySelector(".authors-list")
|
60
60
|
|
61
|
+
|
62
|
+
function sendPageViewEvent() {
|
63
|
+
gtag('event', 'page_view', {
|
64
|
+
page_location: window.location.pathname + location.search
|
65
|
+
});
|
66
|
+
}
|
67
|
+
|
61
68
|
function handleSubmit(e) {
|
62
69
|
e.preventDefault()
|
63
70
|
if (featureContainer) {
|
@@ -121,9 +128,7 @@ function handleSubmit(e) {
|
|
121
128
|
let includes = params.get('includes')
|
122
129
|
let excludes = params.get('excludes')
|
123
130
|
|
124
|
-
|
125
|
-
page_location: window.location.pathname + location.search,
|
126
|
-
})
|
131
|
+
setTimeout(sendPageViewEvent, 0);
|
127
132
|
}
|
128
133
|
wordleSolver(getGreenLetters, getYellowLetters, getGreyLetters, greenWithIndex)
|
129
134
|
}
|
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.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: 2024-08-
|
11
|
+
date: 2024-08-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jekyll
|