word-games-theme 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +21 -21
- data/README.md +2 -2
- data/_data/blog/alertbar.yml +3 -3
- data/_data/blog/blog.yml +2 -2
- data/_data/blog/nav.json +13 -13
- data/_data/blog/share.yml +26 -27
- data/_data/footer/en/data.json +74 -74
- data/_data/footer/hi/data.json +68 -68
- data/_data/footer/networksites.json +15 -15
- data/_data/header/en/data.json +68 -71
- data/_data/wordgames/en/anagram_word_finder.json +48 -48
- data/_data/wordgames/en/eight_letter_word_finder.json +223 -223
- data/_data/wordgames/en/eleven_letter_word_finder.json +184 -184
- data/_data/wordgames/en/five_letter_word_finder.json +188 -188
- data/_data/wordgames/en/four_letter_word_finder.json +176 -176
- data/_data/wordgames/en/jumble_word_finder.json +54 -62
- data/_data/wordgames/en/lexical_word_finder.json +60 -60
- data/_data/wordgames/en/nine_letter_word_finder.json +184 -184
- data/_data/wordgames/en/root.json +79 -79
- data/_data/wordgames/en/scrabble_word_finder_cheat.json +48 -48
- data/_data/wordgames/en/seven_letter_word_finder.json +184 -184
- data/_data/wordgames/en/six_letter_word_finder.json +175 -175
- data/_data/wordgames/en/ten_letter_word_finder.json +184 -184
- data/_data/wordgames/en/thirteen_letter_word_finder.json +184 -184
- data/_data/wordgames/en/three_letter_word_finder.json +188 -188
- data/_data/wordgames/en/twelve_letter_word_finder.json +184 -184
- data/_data/wordgames/en/two_letter_word_finder.json +188 -188
- data/_data/wordgames/en/words_with_friends_word_finder.json +55 -55
- data/_includes/Rating/rating.html +91 -87
- data/_includes/Rating/structureddata.html +53 -53
- data/_includes/author_bio.html +15 -15
- data/_includes/authors/authors.html +27 -27
- data/_includes/custom-head.html +31 -31
- data/_includes/disqus_comments.html +10 -10
- data/_includes/filterWords/index.html +10 -10
- data/_includes/footer/index.html +47 -43
- data/_includes/google-analytics.html +22 -22
- data/_includes/head/index.html +108 -104
- data/_includes/header/blogHeader.html +28 -28
- data/_includes/header/index.html +41 -46
- data/_includes/paginationBlogPage.html +34 -34
- data/_includes/paginationPostPage.html +14 -14
- data/_includes/postauthorbio.html +17 -17
- data/_includes/postbox.html +29 -29
- data/_includes/script.html +13 -13
- data/_includes/section/about.html +25 -25
- data/_includes/section/alertbar.html +11 -11
- data/_includes/section/blog.html +41 -41
- data/_includes/section/commonPage.html +99 -92
- data/_includes/section/count.html +23 -23
- data/_includes/section/feature.html +34 -34
- data/_includes/section/home.html +94 -89
- data/_includes/section/home2.html +90 -83
- data/_includes/section/news.html +32 -32
- data/_includes/section/recent_posts.html +42 -42
- data/_includes/section/related_categories_post.html +73 -73
- data/_includes/section/related_tag_post.html +59 -59
- data/_includes/section/wordGroup.html +6 -6
- data/_includes/seo.html +56 -57
- data/_includes/share/socialshare.html +49 -50
- data/_layouts/blog.html +66 -66
- data/_layouts/categories.html +25 -25
- data/_layouts/default.html +43 -43
- data/_layouts/disclaimer.html +115 -115
- data/_layouts/page.html +67 -67
- data/_layouts/page2.html +60 -60
- data/_layouts/post.html +69 -69
- data/_layouts/privacyPolicy.html +420 -420
- data/_layouts/termAndCondition.html +421 -421
- data/_layouts/wordMeaning.html +106 -106
- data/assets/css/HomePageblog.css +154 -154
- data/assets/css/about.css +51 -51
- data/assets/css/advancedFilter.css +160 -160
- data/assets/css/blog.css +481 -481
- data/assets/css/feature.css +69 -69
- data/assets/css/footer.css +95 -95
- data/assets/css/home.css +235 -234
- data/assets/css/news.css +62 -62
- data/assets/css/style.css +399 -386
- data/assets/css/wordGroup.css +62 -62
- data/assets/images/angle-arrow-down.svg +43 -43
- data/assets/images/facebook-square.svg +1 -0
- data/assets/images/facebook.svg +1 -0
- data/assets/images/instagram-square.svg +1 -0
- data/assets/images/linkedin.svg +1 -0
- data/assets/images/linkedin2.svg +1 -0
- data/assets/images/ratingStar.png +0 -0
- data/assets/images/right.svg +38 -38
- data/assets/images/right2.svg +38 -38
- data/assets/images/right3.svg +38 -38
- data/assets/images/star.svg +1 -0
- data/assets/images/twitter-square.svg +1 -0
- data/assets/images/twitter.svg +1 -0
- data/assets/images/twitter2.svg +1 -0
- data/assets/images/window-close.png +0 -0
- data/assets/images/window-close.svg +1 -0
- data/assets/images/word-games-logo.svg +52 -52
- data/assets/js/TopScroll.js +8 -8
- data/assets/js/X-letter.js +359 -359
- data/assets/js/advancedFilter.js +5 -5
- data/assets/js/advancedFilter2.js +12 -12
- data/assets/js/advancedFilter3.js +2 -2
- data/assets/js/scrabbleDictonary.js +165 -165
- data/assets/js/wordScrabble.js +511 -510
- metadata +19 -8
- data/_data/header/hi/data.json +0 -145
data/assets/js/advancedFilter.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
const wordLength = document.querySelector('.wordLength')
|
2
|
-
wordLength.style.display = 'none'
|
3
|
-
|
4
|
-
// const sortSelect = document.querySelector('#sort-select')
|
5
|
-
// sortSelect.style.display = 'none'
|
1
|
+
const wordLength = document.querySelector('.wordLength')
|
2
|
+
wordLength.style.display = 'none'
|
3
|
+
|
4
|
+
// const sortSelect = document.querySelector('#sort-select')
|
5
|
+
// sortSelect.style.display = 'none'
|
@@ -1,12 +1,12 @@
|
|
1
|
-
// const advancedFilter = document.querySelector('.advancedFilter')
|
2
|
-
// const fillterWrapper = document.querySelector('.fillterWrapper')
|
3
|
-
// advancedFilter.addEventListener('click', () => {
|
4
|
-
// fillterWrapper.classList.toggle('active')
|
5
|
-
// fillterWrapper.classList.remove('hide')
|
6
|
-
// })
|
7
|
-
|
8
|
-
// const close = document.querySelector('.fa-times')
|
9
|
-
// close.addEventListener('click', () => {
|
10
|
-
// fillterWrapper.classList.remove('active')
|
11
|
-
// fillterWrapper.classList.add('hide')
|
12
|
-
// })
|
1
|
+
// const advancedFilter = document.querySelector('.advancedFilter')
|
2
|
+
// const fillterWrapper = document.querySelector('.fillterWrapper')
|
3
|
+
// advancedFilter.addEventListener('click', () => {
|
4
|
+
// fillterWrapper.classList.toggle('active')
|
5
|
+
// fillterWrapper.classList.remove('hide')
|
6
|
+
// })
|
7
|
+
|
8
|
+
// const close = document.querySelector('.fa-times')
|
9
|
+
// close.addEventListener('click', () => {
|
10
|
+
// fillterWrapper.classList.remove('active')
|
11
|
+
// fillterWrapper.classList.add('hide')
|
12
|
+
// })
|
@@ -1,2 +1,2 @@
|
|
1
|
-
// const advancedFilter = document.querySelector('.advancedFilter')
|
2
|
-
// advancedFilter.style.display = ' none'
|
1
|
+
// const advancedFilter = document.querySelector('.advancedFilter')
|
2
|
+
// advancedFilter.style.display = ' none'
|
@@ -1,165 +1,165 @@
|
|
1
|
-
// getqueryUrl from form
|
2
|
-
const params = new URLSearchParams(window.location.search)
|
3
|
-
let serachValue = params.get('search')
|
4
|
-
|
5
|
-
let txtBox = document.querySelector('.txtBox')
|
6
|
-
txtBox.value = serachValue
|
7
|
-
|
8
|
-
// DICTONARY
|
9
|
-
const fetchTWL06Dic = async (serachValue) => {
|
10
|
-
let newAlphabet = {
|
11
|
-
a: 1,
|
12
|
-
e: 1,
|
13
|
-
i: 1,
|
14
|
-
o: 1,
|
15
|
-
u: 1,
|
16
|
-
l: 1,
|
17
|
-
n: 1,
|
18
|
-
r: 1,
|
19
|
-
s: 1,
|
20
|
-
t: 1,
|
21
|
-
d: 2,
|
22
|
-
g: 2,
|
23
|
-
b: 3,
|
24
|
-
c: 3,
|
25
|
-
m: 3,
|
26
|
-
p: 3,
|
27
|
-
f: 4,
|
28
|
-
h: 4,
|
29
|
-
v: 4,
|
30
|
-
w: 4,
|
31
|
-
y: 4,
|
32
|
-
k: 5,
|
33
|
-
j: 8,
|
34
|
-
x: 8,
|
35
|
-
q: 10,
|
36
|
-
z: 10,
|
37
|
-
}
|
38
|
-
|
39
|
-
let sum = 0
|
40
|
-
let item = serachValue.toLowerCase()
|
41
|
-
|
42
|
-
for (let i = 0; i < item.length; i++) {
|
43
|
-
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
44
|
-
}
|
45
|
-
|
46
|
-
try {
|
47
|
-
let res = await fetch(`/.netlify/functions/gettwl06?search=${serachValue}`)
|
48
|
-
let getData = await res.text()
|
49
|
-
|
50
|
-
if (getData) {
|
51
|
-
document.getElementsByClassName('found-word')[0].innerHTML = 'Yes'
|
52
|
-
document.getElementsByClassName('word-score')[0].innerHTML =
|
53
|
-
sum + ' ' + 'Points'
|
54
|
-
} else {
|
55
|
-
document.getElementsByClassName('found-word')[0].style.background =
|
56
|
-
'#F34423'
|
57
|
-
document.getElementsByClassName('found-word')[0].innerHTML = 'No'
|
58
|
-
}
|
59
|
-
} catch (error) {
|
60
|
-
console.log(error)
|
61
|
-
}
|
62
|
-
}
|
63
|
-
fetchTWL06Dic(serachValue)
|
64
|
-
|
65
|
-
const fetchSOWPODSDic = async (serachValue) => {
|
66
|
-
let newAlphabet = {
|
67
|
-
a: 1,
|
68
|
-
e: 1,
|
69
|
-
i: 1,
|
70
|
-
o: 1,
|
71
|
-
u: 1,
|
72
|
-
l: 1,
|
73
|
-
n: 1,
|
74
|
-
r: 1,
|
75
|
-
s: 1,
|
76
|
-
t: 1,
|
77
|
-
d: 2,
|
78
|
-
g: 2,
|
79
|
-
b: 3,
|
80
|
-
c: 3,
|
81
|
-
m: 3,
|
82
|
-
p: 3,
|
83
|
-
f: 4,
|
84
|
-
h: 4,
|
85
|
-
v: 4,
|
86
|
-
w: 4,
|
87
|
-
y: 4,
|
88
|
-
k: 5,
|
89
|
-
j: 8,
|
90
|
-
x: 8,
|
91
|
-
q: 10,
|
92
|
-
z: 10,
|
93
|
-
}
|
94
|
-
let sum = 0
|
95
|
-
|
96
|
-
let item = serachValue.toLowerCase()
|
97
|
-
|
98
|
-
for (let i = 0; i < item.length; i++) {
|
99
|
-
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
100
|
-
}
|
101
|
-
|
102
|
-
let res = await fetch(`/.netlify/functions/getsowpods?search=${serachValue}`)
|
103
|
-
let getData = await res.text()
|
104
|
-
if (getData) {
|
105
|
-
document.getElementsByClassName('found-word')[1].innerHTML = 'Yes'
|
106
|
-
document.getElementsByClassName('word-score')[1].innerHTML =
|
107
|
-
sum + ' ' + 'Points'
|
108
|
-
} else {
|
109
|
-
document.getElementsByClassName('found-word')[1].style.background =
|
110
|
-
'#F34423'
|
111
|
-
document.getElementsByClassName('found-word')[1].innerHTML = 'No'
|
112
|
-
}
|
113
|
-
}
|
114
|
-
fetchSOWPODSDic(serachValue)
|
115
|
-
|
116
|
-
const fetchEnableDic = async (serachValue) => {
|
117
|
-
let newAlphabet = {
|
118
|
-
a: 1,
|
119
|
-
b: 4,
|
120
|
-
c: 4,
|
121
|
-
d: 2,
|
122
|
-
e: 1,
|
123
|
-
f: 4,
|
124
|
-
g: 3,
|
125
|
-
h: 3,
|
126
|
-
i: 1,
|
127
|
-
j: 10,
|
128
|
-
k: 5,
|
129
|
-
l: 2,
|
130
|
-
m: 4,
|
131
|
-
n: 2,
|
132
|
-
o: 1,
|
133
|
-
p: 4,
|
134
|
-
q: 10,
|
135
|
-
r: 1,
|
136
|
-
s: 1,
|
137
|
-
t: 1,
|
138
|
-
u: 2,
|
139
|
-
v: 5,
|
140
|
-
w: 4,
|
141
|
-
x: 8,
|
142
|
-
y: 3,
|
143
|
-
z: 10,
|
144
|
-
}
|
145
|
-
let sum = 0
|
146
|
-
let item = serachValue.toLowerCase()
|
147
|
-
|
148
|
-
for (let i = 0; i < item.length; i++) {
|
149
|
-
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
150
|
-
}
|
151
|
-
|
152
|
-
let res = await fetch(`/.netlify/functions/getenable?search=${serachValue}`)
|
153
|
-
let getData = await res.text()
|
154
|
-
if (getData) {
|
155
|
-
document.getElementsByClassName('found-word')[2].innerHTML = 'Yes'
|
156
|
-
document.getElementsByClassName('word-score')[2].innerHTML =
|
157
|
-
sum + ' ' + 'Points'
|
158
|
-
} else {
|
159
|
-
document.getElementsByClassName('found-word')[2].style.background =
|
160
|
-
'#F34423'
|
161
|
-
document.getElementsByClassName('found-word')[2].innerHTML = 'No'
|
162
|
-
}
|
163
|
-
}
|
164
|
-
|
165
|
-
fetchEnableDic(serachValue)
|
1
|
+
// getqueryUrl from form
|
2
|
+
const params = new URLSearchParams(window.location.search)
|
3
|
+
let serachValue = params.get('search')
|
4
|
+
|
5
|
+
let txtBox = document.querySelector('.txtBox')
|
6
|
+
txtBox.value = serachValue
|
7
|
+
|
8
|
+
// DICTONARY
|
9
|
+
const fetchTWL06Dic = async (serachValue) => {
|
10
|
+
let newAlphabet = {
|
11
|
+
a: 1,
|
12
|
+
e: 1,
|
13
|
+
i: 1,
|
14
|
+
o: 1,
|
15
|
+
u: 1,
|
16
|
+
l: 1,
|
17
|
+
n: 1,
|
18
|
+
r: 1,
|
19
|
+
s: 1,
|
20
|
+
t: 1,
|
21
|
+
d: 2,
|
22
|
+
g: 2,
|
23
|
+
b: 3,
|
24
|
+
c: 3,
|
25
|
+
m: 3,
|
26
|
+
p: 3,
|
27
|
+
f: 4,
|
28
|
+
h: 4,
|
29
|
+
v: 4,
|
30
|
+
w: 4,
|
31
|
+
y: 4,
|
32
|
+
k: 5,
|
33
|
+
j: 8,
|
34
|
+
x: 8,
|
35
|
+
q: 10,
|
36
|
+
z: 10,
|
37
|
+
}
|
38
|
+
|
39
|
+
let sum = 0
|
40
|
+
let item = serachValue.toLowerCase()
|
41
|
+
|
42
|
+
for (let i = 0; i < item.length; i++) {
|
43
|
+
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
44
|
+
}
|
45
|
+
|
46
|
+
try {
|
47
|
+
let res = await fetch(`/.netlify/functions/gettwl06?search=${serachValue}`)
|
48
|
+
let getData = await res.text()
|
49
|
+
|
50
|
+
if (getData) {
|
51
|
+
document.getElementsByClassName('found-word')[0].innerHTML = 'Yes'
|
52
|
+
document.getElementsByClassName('word-score')[0].innerHTML =
|
53
|
+
sum + ' ' + 'Points'
|
54
|
+
} else {
|
55
|
+
document.getElementsByClassName('found-word')[0].style.background =
|
56
|
+
'#F34423'
|
57
|
+
document.getElementsByClassName('found-word')[0].innerHTML = 'No'
|
58
|
+
}
|
59
|
+
} catch (error) {
|
60
|
+
console.log(error)
|
61
|
+
}
|
62
|
+
}
|
63
|
+
fetchTWL06Dic(serachValue)
|
64
|
+
|
65
|
+
const fetchSOWPODSDic = async (serachValue) => {
|
66
|
+
let newAlphabet = {
|
67
|
+
a: 1,
|
68
|
+
e: 1,
|
69
|
+
i: 1,
|
70
|
+
o: 1,
|
71
|
+
u: 1,
|
72
|
+
l: 1,
|
73
|
+
n: 1,
|
74
|
+
r: 1,
|
75
|
+
s: 1,
|
76
|
+
t: 1,
|
77
|
+
d: 2,
|
78
|
+
g: 2,
|
79
|
+
b: 3,
|
80
|
+
c: 3,
|
81
|
+
m: 3,
|
82
|
+
p: 3,
|
83
|
+
f: 4,
|
84
|
+
h: 4,
|
85
|
+
v: 4,
|
86
|
+
w: 4,
|
87
|
+
y: 4,
|
88
|
+
k: 5,
|
89
|
+
j: 8,
|
90
|
+
x: 8,
|
91
|
+
q: 10,
|
92
|
+
z: 10,
|
93
|
+
}
|
94
|
+
let sum = 0
|
95
|
+
|
96
|
+
let item = serachValue.toLowerCase()
|
97
|
+
|
98
|
+
for (let i = 0; i < item.length; i++) {
|
99
|
+
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
100
|
+
}
|
101
|
+
|
102
|
+
let res = await fetch(`/.netlify/functions/getsowpods?search=${serachValue}`)
|
103
|
+
let getData = await res.text()
|
104
|
+
if (getData) {
|
105
|
+
document.getElementsByClassName('found-word')[1].innerHTML = 'Yes'
|
106
|
+
document.getElementsByClassName('word-score')[1].innerHTML =
|
107
|
+
sum + ' ' + 'Points'
|
108
|
+
} else {
|
109
|
+
document.getElementsByClassName('found-word')[1].style.background =
|
110
|
+
'#F34423'
|
111
|
+
document.getElementsByClassName('found-word')[1].innerHTML = 'No'
|
112
|
+
}
|
113
|
+
}
|
114
|
+
fetchSOWPODSDic(serachValue)
|
115
|
+
|
116
|
+
const fetchEnableDic = async (serachValue) => {
|
117
|
+
let newAlphabet = {
|
118
|
+
a: 1,
|
119
|
+
b: 4,
|
120
|
+
c: 4,
|
121
|
+
d: 2,
|
122
|
+
e: 1,
|
123
|
+
f: 4,
|
124
|
+
g: 3,
|
125
|
+
h: 3,
|
126
|
+
i: 1,
|
127
|
+
j: 10,
|
128
|
+
k: 5,
|
129
|
+
l: 2,
|
130
|
+
m: 4,
|
131
|
+
n: 2,
|
132
|
+
o: 1,
|
133
|
+
p: 4,
|
134
|
+
q: 10,
|
135
|
+
r: 1,
|
136
|
+
s: 1,
|
137
|
+
t: 1,
|
138
|
+
u: 2,
|
139
|
+
v: 5,
|
140
|
+
w: 4,
|
141
|
+
x: 8,
|
142
|
+
y: 3,
|
143
|
+
z: 10,
|
144
|
+
}
|
145
|
+
let sum = 0
|
146
|
+
let item = serachValue.toLowerCase()
|
147
|
+
|
148
|
+
for (let i = 0; i < item.length; i++) {
|
149
|
+
sum += newAlphabet[item[i]] || 0 // for unknown characters
|
150
|
+
}
|
151
|
+
|
152
|
+
let res = await fetch(`/.netlify/functions/getenable?search=${serachValue}`)
|
153
|
+
let getData = await res.text()
|
154
|
+
if (getData) {
|
155
|
+
document.getElementsByClassName('found-word')[2].innerHTML = 'Yes'
|
156
|
+
document.getElementsByClassName('word-score')[2].innerHTML =
|
157
|
+
sum + ' ' + 'Points'
|
158
|
+
} else {
|
159
|
+
document.getElementsByClassName('found-word')[2].style.background =
|
160
|
+
'#F34423'
|
161
|
+
document.getElementsByClassName('found-word')[2].innerHTML = 'No'
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
fetchEnableDic(serachValue)
|
data/assets/js/wordScrabble.js
CHANGED
@@ -1,510 +1,511 @@
|
|
1
|
-
/***************
|
2
|
-
SCRABBLER_JS
|
3
|
-
***************/
|
4
|
-
|
5
|
-
// grab some html elements
|
6
|
-
let form = document.querySelector('#form')
|
7
|
-
let wordCount = document.querySelector('.wordCount')
|
8
|
-
let main = document.querySelector('.main')
|
9
|
-
let errorMsg = document.querySelector('.errorMsg')
|
10
|
-
|
11
|
-
// getqueryUrl from form
|
12
|
-
const params = new URLSearchParams(window.location.search)
|
13
|
-
let serachValue = params.get('search')
|
14
|
-
let prefixValue = params.get('prefix')
|
15
|
-
let containsValue = params.get('contains')
|
16
|
-
let suffixValue = params.get('suffix')
|
17
|
-
let lengthValue = params.get('length')
|
18
|
-
let dictonary = params.get('dictonary')
|
19
|
-
|
20
|
-
// advanced filter element grabs
|
21
|
-
let tick
|
22
|
-
let startsWith = document.getElementById('startsWith')
|
23
|
-
let mustInclude = document.getElementById('mustInclude')
|
24
|
-
let endsWith = document.getElementById('endsWith')
|
25
|
-
let wordLength = document.getElementById('wordLength')
|
26
|
-
|
27
|
-
let ok = true
|
28
|
-
|
29
|
-
let tab_container = document.querySelector('.tab_container')
|
30
|
-
|
31
|
-
var sortValue
|
32
|
-
var sortBool = false
|
33
|
-
|
34
|
-
let txtBox = document.querySelector('.txtBox')
|
35
|
-
txtBox.value = serachValue
|
36
|
-
|
37
|
-
var theSelect = document.getElementById('select_dropDown')
|
38
|
-
document.querySelector('.select_dropDown2').value = dictonary
|
39
|
-
|
40
|
-
// getWords define...
|
41
|
-
const getData = async (serachValue) => {
|
42
|
-
try {
|
43
|
-
main.innerHTML = `<div class="loader">
|
44
|
-
<img src='/assets/images/loading.gif'>
|
45
|
-
</div>`
|
46
|
-
/// loader
|
47
|
-
const response = await fetch(
|
48
|
-
`/.netlify/functions/getWords?name=${serachValue}`
|
49
|
-
)
|
50
|
-
const data = await response.json()
|
51
|
-
main.innerHTML = ''
|
52
|
-
getWords(data)
|
53
|
-
//getWords calling...
|
54
|
-
} catch (error) {
|
55
|
-
console.log(error)
|
56
|
-
}
|
57
|
-
}
|
58
|
-
//getData calling...
|
59
|
-
if (lengthValue === '1') {
|
60
|
-
errorMsg.innerHTML = 'words length should be more than 1'
|
61
|
-
} else {
|
62
|
-
getData(serachValue.toLowerCase())
|
63
|
-
}
|
64
|
-
|
65
|
-
// getWords function define...
|
66
|
-
function getWords(data) {
|
67
|
-
if (typeof data === 'string') {
|
68
|
-
errorMsg.innerHTML = 'no words found'
|
69
|
-
wordCount.innerHTML = `<strong> 0 words with letters ${serachValue.split(
|
70
|
-
''
|
71
|
-
)}</strong>`
|
72
|
-
} else {
|
73
|
-
let newWordsLength = 0
|
74
|
-
|
75
|
-
// sort eventlistener
|
76
|
-
theSelect.addEventListener('change', () => {
|
77
|
-
sortValue = theSelect[theSelect.selectedIndex].text
|
78
|
-
if (sortValue == 'Z-A') {
|
79
|
-
sortBool = true
|
80
|
-
sortby(sortBool, data)
|
81
|
-
} else {
|
82
|
-
sortBool = false
|
83
|
-
sortby(sortBool, data)
|
84
|
-
}
|
85
|
-
if (sortValue == 'Points') {
|
86
|
-
sortBool = true
|
87
|
-
sortPointsby(sortBool, data)
|
88
|
-
}
|
89
|
-
})
|
90
|
-
|
91
|
-
for (let i = serachValue.length; i >= 1; i--) {
|
92
|
-
let newdata = data.filter((item) => item.length === i)
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
startsWith.
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
mustInclude.
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
endsWith.
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
wordLength.
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
tabs
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
}
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
let
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
}
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
let
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
let
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
}
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
}
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
let
|
398
|
-
let
|
399
|
-
|
400
|
-
|
401
|
-
filter_val[
|
402
|
-
filter_val[
|
403
|
-
filter_val[
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
}
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
new_sections[i]
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
active_now.
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
}
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
tabs
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
activeLetter.
|
460
|
-
|
461
|
-
|
462
|
-
var
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
let
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
}
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
1
|
+
/***************
|
2
|
+
SCRABBLER_JS
|
3
|
+
***************/
|
4
|
+
|
5
|
+
// grab some html elements
|
6
|
+
let form = document.querySelector('#form')
|
7
|
+
let wordCount = document.querySelector('.wordCount')
|
8
|
+
let main = document.querySelector('.main')
|
9
|
+
let errorMsg = document.querySelector('.errorMsg')
|
10
|
+
|
11
|
+
// getqueryUrl from form
|
12
|
+
const params = new URLSearchParams(window.location.search)
|
13
|
+
let serachValue = params.get('search')
|
14
|
+
let prefixValue = params.get('prefix')
|
15
|
+
let containsValue = params.get('contains')
|
16
|
+
let suffixValue = params.get('suffix')
|
17
|
+
let lengthValue = params.get('length')
|
18
|
+
let dictonary = params.get('dictonary')
|
19
|
+
|
20
|
+
// advanced filter element grabs
|
21
|
+
let tick
|
22
|
+
let startsWith = document.getElementById('startsWith')
|
23
|
+
let mustInclude = document.getElementById('mustInclude')
|
24
|
+
let endsWith = document.getElementById('endsWith')
|
25
|
+
let wordLength = document.getElementById('wordLength')
|
26
|
+
|
27
|
+
let ok = true
|
28
|
+
|
29
|
+
let tab_container = document.querySelector('.tab_container')
|
30
|
+
|
31
|
+
var sortValue
|
32
|
+
var sortBool = false
|
33
|
+
|
34
|
+
let txtBox = document.querySelector('.txtBox')
|
35
|
+
txtBox.value = serachValue
|
36
|
+
|
37
|
+
var theSelect = document.getElementById('select_dropDown')
|
38
|
+
document.querySelector('.select_dropDown2').value = dictonary
|
39
|
+
|
40
|
+
// getWords define...
|
41
|
+
const getData = async (serachValue) => {
|
42
|
+
try {
|
43
|
+
main.innerHTML = `<div class="loader">
|
44
|
+
<img src='/assets/images/loading.gif'>
|
45
|
+
</div>`
|
46
|
+
/// loader
|
47
|
+
const response = await fetch(
|
48
|
+
`/.netlify/functions/getWords?name=${serachValue}`
|
49
|
+
)
|
50
|
+
const data = await response.json()
|
51
|
+
main.innerHTML = ''
|
52
|
+
getWords(data)
|
53
|
+
//getWords calling...
|
54
|
+
} catch (error) {
|
55
|
+
console.log(error)
|
56
|
+
}
|
57
|
+
}
|
58
|
+
//getData calling...
|
59
|
+
if (lengthValue === '1') {
|
60
|
+
errorMsg.innerHTML = 'words length should be more than 1'
|
61
|
+
} else {
|
62
|
+
getData(serachValue.toLowerCase())
|
63
|
+
}
|
64
|
+
|
65
|
+
// getWords function define...
|
66
|
+
function getWords(data) {
|
67
|
+
if (typeof data === 'string') {
|
68
|
+
errorMsg.innerHTML = 'no words found'
|
69
|
+
wordCount.innerHTML = `<strong> 0 words with letters ${serachValue.split(
|
70
|
+
''
|
71
|
+
)}</strong>`
|
72
|
+
} else {
|
73
|
+
let newWordsLength = 0
|
74
|
+
|
75
|
+
// sort eventlistener
|
76
|
+
theSelect.addEventListener('change', () => {
|
77
|
+
sortValue = theSelect[theSelect.selectedIndex].text
|
78
|
+
if (sortValue == 'Z-A') {
|
79
|
+
sortBool = true
|
80
|
+
sortby(sortBool, data)
|
81
|
+
} else {
|
82
|
+
sortBool = false
|
83
|
+
sortby(sortBool, data)
|
84
|
+
}
|
85
|
+
if (sortValue == 'Points') {
|
86
|
+
sortBool = true
|
87
|
+
sortPointsby(sortBool, data)
|
88
|
+
}
|
89
|
+
})
|
90
|
+
|
91
|
+
for (let i = serachValue.length; i >= 1; i--) {
|
92
|
+
let newdata = data.filter((item) => item.length === i)
|
93
|
+
|
94
|
+
if (prefixValue) {
|
95
|
+
newdata = newdata.filter((item2) =>
|
96
|
+
item2.startsWith(prefixValue.toLowerCase())
|
97
|
+
)
|
98
|
+
startsWith.classList.add('tick')
|
99
|
+
startsWith.value = prefixValue
|
100
|
+
}
|
101
|
+
|
102
|
+
if (containsValue) {
|
103
|
+
newdata = newdata.filter((item) =>
|
104
|
+
item.includes(containsValue.toLowerCase())
|
105
|
+
)
|
106
|
+
mustInclude.classList.add('tick')
|
107
|
+
mustInclude.value = containsValue
|
108
|
+
}
|
109
|
+
if (suffixValue) {
|
110
|
+
newdata = newdata.filter((item) =>
|
111
|
+
item.endsWith(suffixValue.toLowerCase())
|
112
|
+
)
|
113
|
+
endsWith.classList.add('tick')
|
114
|
+
endsWith.value = suffixValue
|
115
|
+
}
|
116
|
+
if (lengthValue) {
|
117
|
+
newdata = newdata.filter((item) => item.length == lengthValue)
|
118
|
+
wordLength.classList.add('tick')
|
119
|
+
wordLength.value = lengthValue
|
120
|
+
}
|
121
|
+
|
122
|
+
if (newdata.length === 0) {
|
123
|
+
main.innerHTML += ''
|
124
|
+
} else {
|
125
|
+
newWordsLength += newdata.length
|
126
|
+
|
127
|
+
const result = newdata.map((item) => {
|
128
|
+
if (item.length === 1) {
|
129
|
+
ok = false
|
130
|
+
newWordsLength = newWordsLength - 1
|
131
|
+
} else {
|
132
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
133
|
+
sum = 0
|
134
|
+
item = item.toLowerCase()
|
135
|
+
for (let i = 0; i < item.length; i++) {
|
136
|
+
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
137
|
+
}
|
138
|
+
return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
|
139
|
+
<li>${item}
|
140
|
+
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
|
141
|
+
</li></a>`
|
142
|
+
}
|
143
|
+
})
|
144
|
+
|
145
|
+
if (ok) {
|
146
|
+
tab_container.innerHTML += `
|
147
|
+
<input type="button" id="Tab_${i}" onclick="Filtering(${i})" value="${i} Letter"
|
148
|
+
class="tab_link cursorPointer" />
|
149
|
+
`
|
150
|
+
let tabs = document.getElementsByClassName('tab_link')
|
151
|
+
tabs[0] ? tabs[0].classList.add('active-tab') : ''
|
152
|
+
|
153
|
+
main.innerHTML += `
|
154
|
+
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
155
|
+
<div class="wordListHeading">
|
156
|
+
<h3 class="lead">${i} Letter Words</h3>
|
157
|
+
</div>
|
158
|
+
<div class="wordList">
|
159
|
+
<ul class="ul list-unstyled">
|
160
|
+
${result.join('')}
|
161
|
+
</ul>
|
162
|
+
</div>
|
163
|
+
</div>
|
164
|
+
`
|
165
|
+
}
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
if (newWordsLength === 0) {
|
170
|
+
errorMsg.innerHTML = 'no words found'
|
171
|
+
} else {
|
172
|
+
wordCount.innerHTML = `<strong>${newWordsLength} words with letters ${serachValue.split(
|
173
|
+
''
|
174
|
+
)}</strong>`
|
175
|
+
}
|
176
|
+
}
|
177
|
+
}
|
178
|
+
|
179
|
+
// sorting by points
|
180
|
+
function sortPointsby(sortValue, data) {
|
181
|
+
main.innerHTML = ''
|
182
|
+
if (sortValue) {
|
183
|
+
let newWordsLength = 0
|
184
|
+
for (let i = serachValue.length; i >= 1; i--) {
|
185
|
+
var newdata = data.filter((item) => item.length === i)
|
186
|
+
|
187
|
+
if (newdata.length === 0) {
|
188
|
+
main.innerHTML += ''
|
189
|
+
} else {
|
190
|
+
newWordsLength += newdata.length
|
191
|
+
var newArray = []
|
192
|
+
newdata.map((item) => {
|
193
|
+
if (item.length === 1) {
|
194
|
+
ok = false
|
195
|
+
newWordsLength = newWordsLength - 1
|
196
|
+
} else {
|
197
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
198
|
+
let points = 0
|
199
|
+
item = item.toLowerCase()
|
200
|
+
for (let i = 0; i < item.length; i++) {
|
201
|
+
points += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
202
|
+
}
|
203
|
+
const value = {
|
204
|
+
words: item,
|
205
|
+
points: points,
|
206
|
+
}
|
207
|
+
newArray.push(value)
|
208
|
+
}
|
209
|
+
})
|
210
|
+
|
211
|
+
newArray.sort(function (a, b) {
|
212
|
+
return b.points - a.points
|
213
|
+
})
|
214
|
+
|
215
|
+
const result = newArray.map((item) => {
|
216
|
+
return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item.words}">
|
217
|
+
<li>${item.words}
|
218
|
+
<span class="points" value="${item.points}" style="position:relative; top:4px; font-size:12px"> ${item.points}</span>
|
219
|
+
</li></a>`
|
220
|
+
})
|
221
|
+
|
222
|
+
main.innerHTML += `
|
223
|
+
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
224
|
+
<div class="wordListHeading">
|
225
|
+
<h3 class="lead">${i} Letter Words</h3>
|
226
|
+
</div>
|
227
|
+
<div class="wordList">
|
228
|
+
<ul class="ul list-unstyled">
|
229
|
+
${result.join('')}
|
230
|
+
</ul>
|
231
|
+
</div>
|
232
|
+
</div>
|
233
|
+
`
|
234
|
+
}
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
|
239
|
+
// sort by aplhabets
|
240
|
+
function sortby(sortBool, data) {
|
241
|
+
if (sortBool) {
|
242
|
+
main.innerHTML = ''
|
243
|
+
data.reverse()
|
244
|
+
let newWordsLength = 0
|
245
|
+
for (let i = serachValue.length; i >= 1; i--) {
|
246
|
+
var newdata = data.filter((item) => item.length === i)
|
247
|
+
|
248
|
+
if (newdata.length === 0) {
|
249
|
+
main.innerHTML += ''
|
250
|
+
} else {
|
251
|
+
newWordsLength += newdata.length
|
252
|
+
|
253
|
+
const result = newdata.map((item) => {
|
254
|
+
if (item.length === 1) {
|
255
|
+
ok = false
|
256
|
+
newWordsLength = newWordsLength - 1
|
257
|
+
} else {
|
258
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
259
|
+
let sum = 0
|
260
|
+
item = item.toLowerCase()
|
261
|
+
for (let i = 0; i < item.length; i++) {
|
262
|
+
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
263
|
+
}
|
264
|
+
|
265
|
+
return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
|
266
|
+
<li>${item}
|
267
|
+
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
|
268
|
+
</li></a>`
|
269
|
+
}
|
270
|
+
})
|
271
|
+
|
272
|
+
main.innerHTML += `
|
273
|
+
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
274
|
+
<div class="wordListHeading">
|
275
|
+
<h3 class="lead">${i} Letter Words</h3>
|
276
|
+
</div>
|
277
|
+
<div class="wordList">
|
278
|
+
<ul class="ul list-unstyled">
|
279
|
+
${result.join('')}
|
280
|
+
</ul>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
`
|
284
|
+
}
|
285
|
+
}
|
286
|
+
} else {
|
287
|
+
main.innerHTML = ''
|
288
|
+
data.sort()
|
289
|
+
for (let i = serachValue.length; i >= 1; i--) {
|
290
|
+
var newdata = data.filter((item) => item.length === i)
|
291
|
+
if (newdata.length === 0) {
|
292
|
+
main.innerHTML += ''
|
293
|
+
} else {
|
294
|
+
const result = newdata.map((item) => {
|
295
|
+
if (item.length === 1) {
|
296
|
+
ok = false
|
297
|
+
} else {
|
298
|
+
let ScrabbleLetterScore = ScrabbleScore()
|
299
|
+
let sum = 0
|
300
|
+
item = item.toLowerCase()
|
301
|
+
for (let i = 0; i < item.length; i++) {
|
302
|
+
sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
|
303
|
+
}
|
304
|
+
|
305
|
+
return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
|
306
|
+
<li>${item}
|
307
|
+
<span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
|
308
|
+
</li></a>`
|
309
|
+
}
|
310
|
+
})
|
311
|
+
main.innerHTML += `
|
312
|
+
<div class="allGroupWords wordlistContainer" id="alpha_${i}">
|
313
|
+
<div class="wordListHeading">
|
314
|
+
<h3 class="lead">${i} Letter Words</h3>
|
315
|
+
</div>
|
316
|
+
<div class="wordList">
|
317
|
+
<ul class="ul list-unstyled">
|
318
|
+
${result.join('')}
|
319
|
+
</ul>
|
320
|
+
</div>
|
321
|
+
</div>
|
322
|
+
`
|
323
|
+
}
|
324
|
+
}
|
325
|
+
}
|
326
|
+
}
|
327
|
+
|
328
|
+
// Scrabble Point Array
|
329
|
+
const ScrabbleScore = () => {
|
330
|
+
let twl06_sowpods = {
|
331
|
+
a: 1,
|
332
|
+
e: 1,
|
333
|
+
i: 1,
|
334
|
+
o: 1,
|
335
|
+
u: 1,
|
336
|
+
l: 1,
|
337
|
+
n: 1,
|
338
|
+
r: 1,
|
339
|
+
s: 1,
|
340
|
+
t: 1,
|
341
|
+
d: 2,
|
342
|
+
g: 2,
|
343
|
+
b: 3,
|
344
|
+
c: 3,
|
345
|
+
m: 3,
|
346
|
+
p: 3,
|
347
|
+
f: 4,
|
348
|
+
h: 4,
|
349
|
+
v: 4,
|
350
|
+
w: 4,
|
351
|
+
y: 4,
|
352
|
+
k: 5,
|
353
|
+
j: 8,
|
354
|
+
x: 8,
|
355
|
+
q: 10,
|
356
|
+
z: 10,
|
357
|
+
}
|
358
|
+
|
359
|
+
let wwfScore = {
|
360
|
+
a: 1,
|
361
|
+
b: 4,
|
362
|
+
c: 4,
|
363
|
+
d: 2,
|
364
|
+
e: 1,
|
365
|
+
f: 4,
|
366
|
+
g: 3,
|
367
|
+
h: 3,
|
368
|
+
i: 1,
|
369
|
+
j: 10,
|
370
|
+
k: 5,
|
371
|
+
l: 2,
|
372
|
+
m: 4,
|
373
|
+
n: 2,
|
374
|
+
o: 1,
|
375
|
+
p: 4,
|
376
|
+
q: 10,
|
377
|
+
r: 1,
|
378
|
+
s: 1,
|
379
|
+
t: 1,
|
380
|
+
u: 2,
|
381
|
+
v: 5,
|
382
|
+
w: 4,
|
383
|
+
x: 8,
|
384
|
+
y: 3,
|
385
|
+
z: 10,
|
386
|
+
}
|
387
|
+
|
388
|
+
if (dictonary === 'wwf') {
|
389
|
+
return wwfScore
|
390
|
+
} else {
|
391
|
+
return twl06_sowpods
|
392
|
+
}
|
393
|
+
}
|
394
|
+
|
395
|
+
//Handling of filter counter in advanced filter
|
396
|
+
function addFilterCount() {
|
397
|
+
let filter_val = document.getElementsByClassName('filter_val')
|
398
|
+
let filter = document.querySelector('.filter_count')
|
399
|
+
let filter_count = 0
|
400
|
+
|
401
|
+
filter_val[0].value = prefixValue
|
402
|
+
filter_val[1].value = containsValue
|
403
|
+
filter_val[2].value = suffixValue
|
404
|
+
filter_val[3].value = lengthValue
|
405
|
+
|
406
|
+
for (var i = 0; i < 4; i++) {
|
407
|
+
if (filter_val[i].value != '') {
|
408
|
+
filter_count += 1
|
409
|
+
}
|
410
|
+
if (filter_count === 0) {
|
411
|
+
filter.style.display = 'none'
|
412
|
+
} else {
|
413
|
+
filter.style.display = 'inline-block'
|
414
|
+
}
|
415
|
+
|
416
|
+
filter.innerHTML = filter_count
|
417
|
+
}
|
418
|
+
}
|
419
|
+
addFilterCount()
|
420
|
+
|
421
|
+
// handling of filter on scroll
|
422
|
+
window.onscroll = function () {
|
423
|
+
var section = document.querySelectorAll('.wordlistContainer')
|
424
|
+
let new_sections = {}
|
425
|
+
Array.prototype.forEach.call(section, function (e) {
|
426
|
+
if (document.body.clientWidth > 991) {
|
427
|
+
new_sections[e.id] = e.offsetTop - 10
|
428
|
+
} else {
|
429
|
+
new_sections[e.id] = e.offsetTop - 10
|
430
|
+
}
|
431
|
+
})
|
432
|
+
var scrollPosition =
|
433
|
+
document.documentElement.scrollTop || document.body.scrollTop
|
434
|
+
for (i in new_sections) {
|
435
|
+
let sort_val = document.querySelector('.sort-select').value
|
436
|
+
if (
|
437
|
+
i.split('_')[0] == sort_val &&
|
438
|
+
new_sections[i] &&
|
439
|
+
new_sections[i] <= scrollPosition
|
440
|
+
) {
|
441
|
+
document.querySelector('.active-tab').classList.remove('active-tab')
|
442
|
+
var active_now = document.querySelector('#Tab_' + i.split('_')[1])
|
443
|
+
active_now.classList.add('active-tab')
|
444
|
+
// active_now.scrollIntoView()
|
445
|
+
}
|
446
|
+
}
|
447
|
+
}
|
448
|
+
|
449
|
+
// Add Filtering
|
450
|
+
let sections = {}
|
451
|
+
function Filtering(id) {
|
452
|
+
let tabs = document.getElementsByClassName('tab_link')
|
453
|
+
tabs[0] ? tabs[0].classList.add('active-tab') : ''
|
454
|
+
|
455
|
+
Array.from(tabs).map((item) => {
|
456
|
+
item.classList.remove('active-tab')
|
457
|
+
})
|
458
|
+
main.innerHTML += ``
|
459
|
+
let activeLetter = event.target
|
460
|
+
activeLetter.classList.add('active-tab')
|
461
|
+
|
462
|
+
var section = document.querySelectorAll('.wordlistContainer')
|
463
|
+
var sort_val = document.querySelector('.sort-select').value
|
464
|
+
Array.prototype.forEach.call(section, function (e) {
|
465
|
+
if (document.body.clientWidth > 991) {
|
466
|
+
sections[e.id] = e.offsetTop - 10
|
467
|
+
} else {
|
468
|
+
sections[e.id] = e.offsetTop - 10
|
469
|
+
}
|
470
|
+
})
|
471
|
+
|
472
|
+
document.body.scrollTop = sections[sort_val + '_' + id] + 5
|
473
|
+
}
|
474
|
+
|
475
|
+
// next && previous functionality
|
476
|
+
let prev = document.getElementById('prev')
|
477
|
+
let next = document.getElementById('next')
|
478
|
+
|
479
|
+
if (prev) {
|
480
|
+
prev.onclick = scroll_Right
|
481
|
+
}
|
482
|
+
if (next) {
|
483
|
+
next.onclick = scroll_Left
|
484
|
+
}
|
485
|
+
window.addEventListener('resize', function () {
|
486
|
+
scroll_visible()
|
487
|
+
})
|
488
|
+
window.addEventListener('scroll', function () {
|
489
|
+
scroll_visible()
|
490
|
+
})
|
491
|
+
function scroll_visible() {
|
492
|
+
let tab_container = document.querySelector('#tab-container')
|
493
|
+
|
494
|
+
if (tab_container) {
|
495
|
+
if (tab_container.clientWidth === tab_container.scrollWidth) {
|
496
|
+
prev.style.display = 'none'
|
497
|
+
next.style.display = 'none'
|
498
|
+
} else {
|
499
|
+
prev.style.display = 'block'
|
500
|
+
next.style.display = 'block'
|
501
|
+
}
|
502
|
+
}
|
503
|
+
}
|
504
|
+
scroll_visible()
|
505
|
+
|
506
|
+
function scroll_Left() {
|
507
|
+
tab_container.scrollLeft += 130
|
508
|
+
}
|
509
|
+
function scroll_Right() {
|
510
|
+
tab_container.scrollLeft -= 130
|
511
|
+
}
|