appscms-tools-theme 1.0.6 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +0,0 @@
1
- const Advancedbtn = document.querySelector('.Advancedbtn')
2
- Advancedbtn.style.display = 'none'
3
-
4
- const sortSelect = document.querySelector('#sort-select')
5
- sortSelect.style.display = 'none'
@@ -1,5 +0,0 @@
1
- const advancedFilter = document.querySelector('.advancedFilter')
2
- const fillterWrapper = document.querySelector('.fillterWrapper')
3
- advancedFilter.addEventListener('click', () => {
4
- fillterWrapper.classList.toggle('active')
5
- })
@@ -1,2 +0,0 @@
1
- const advancedFilter = document.querySelector('.advancedFilter')
2
- advancedFilter.style.display = ' none'
@@ -1,162 +0,0 @@
1
- // getqueryUrl from form
2
- const params = new URLSearchParams(window.location.search)
3
- let serachValue = params.get('search')
4
-
5
- // DICTONARY
6
- const fetchTWL06Dic = async (serachValue) => {
7
- let newAlphabet = {
8
- a: 1,
9
- e: 1,
10
- i: 1,
11
- o: 1,
12
- u: 1,
13
- l: 1,
14
- n: 1,
15
- r: 1,
16
- s: 1,
17
- t: 1,
18
- d: 2,
19
- g: 2,
20
- b: 3,
21
- c: 3,
22
- m: 3,
23
- p: 3,
24
- f: 4,
25
- h: 4,
26
- v: 4,
27
- w: 4,
28
- y: 4,
29
- k: 5,
30
- j: 8,
31
- x: 8,
32
- q: 10,
33
- z: 10,
34
- }
35
-
36
- let sum = 0
37
- let item = serachValue.toLowerCase()
38
-
39
- for (let i = 0; i < item.length; i++) {
40
- sum += newAlphabet[item[i]] || 0 // for unknown characters
41
- }
42
-
43
- try {
44
- let res = await fetch(`/.netlify/functions/gettwl06?search=${serachValue}`)
45
- let getData = await res.text()
46
-
47
- if (getData) {
48
- document.getElementsByClassName('found-word')[0].innerHTML = 'Yes'
49
- document.getElementsByClassName('word-score')[0].innerHTML =
50
- sum + ' ' + 'Points'
51
- } else {
52
- document.getElementsByClassName('found-word')[0].style.background =
53
- '#F34423'
54
- document.getElementsByClassName('found-word')[0].innerHTML = 'No'
55
- }
56
- } catch (error) {
57
- console.log(error)
58
- }
59
- }
60
- fetchTWL06Dic(serachValue)
61
-
62
- const fetchSOWPODSDic = async (serachValue) => {
63
- let newAlphabet = {
64
- a: 1,
65
- e: 1,
66
- i: 1,
67
- o: 1,
68
- u: 1,
69
- l: 1,
70
- n: 1,
71
- r: 1,
72
- s: 1,
73
- t: 1,
74
- d: 2,
75
- g: 2,
76
- b: 3,
77
- c: 3,
78
- m: 3,
79
- p: 3,
80
- f: 4,
81
- h: 4,
82
- v: 4,
83
- w: 4,
84
- y: 4,
85
- k: 5,
86
- j: 8,
87
- x: 8,
88
- q: 10,
89
- z: 10,
90
- }
91
- let sum = 0
92
-
93
- let item = serachValue.toLowerCase()
94
-
95
- for (let i = 0; i < item.length; i++) {
96
- sum += newAlphabet[item[i]] || 0 // for unknown characters
97
- }
98
-
99
- let res = await fetch(`/.netlify/functions/getsowpods?search=${serachValue}`)
100
- let getData = await res.text()
101
- if (getData) {
102
- document.getElementsByClassName('found-word')[1].innerHTML = 'Yes'
103
- document.getElementsByClassName('word-score')[1].innerHTML =
104
- sum + ' ' + 'Points'
105
- } else {
106
- document.getElementsByClassName('found-word')[1].style.background =
107
- '#F34423'
108
- document.getElementsByClassName('found-word')[1].innerHTML = 'No'
109
- }
110
- }
111
- fetchSOWPODSDic(serachValue)
112
-
113
- const fetchEnableDic = async (serachValue) => {
114
- let newAlphabet = {
115
- a: 1,
116
- b: 4,
117
- c: 4,
118
- d: 2,
119
- e: 1,
120
- f: 4,
121
- g: 3,
122
- h: 3,
123
- i: 1,
124
- j: 10,
125
- k: 5,
126
- l: 2,
127
- m: 4,
128
- n: 2,
129
- o: 1,
130
- p: 4,
131
- q: 10,
132
- r: 1,
133
- s: 1,
134
- t: 1,
135
- u: 2,
136
- v: 5,
137
- w: 4,
138
- x: 8,
139
- y: 3,
140
- z: 10,
141
- }
142
- let sum = 0
143
- let item = serachValue.toLowerCase()
144
-
145
- for (let i = 0; i < item.length; i++) {
146
- sum += newAlphabet[item[i]] || 0 // for unknown characters
147
- }
148
-
149
- let res = await fetch(`/.netlify/functions/getenable?search=${serachValue}`)
150
- let getData = await res.text()
151
- if (getData) {
152
- document.getElementsByClassName('found-word')[2].innerHTML = 'Yes'
153
- document.getElementsByClassName('word-score')[2].innerHTML =
154
- sum + ' ' + 'Points'
155
- } else {
156
- document.getElementsByClassName('found-word')[2].style.background =
157
- '#F34423'
158
- document.getElementsByClassName('found-word')[2].innerHTML = 'No'
159
- }
160
- }
161
-
162
- fetchEnableDic(serachValue)
@@ -1,363 +0,0 @@
1
- // grab some html elements
2
- let form = document.querySelector('#form')
3
- let wordCount = document.querySelector('.wordCount')
4
- let main = document.querySelector('.main')
5
- let errorMsg = document.querySelector('.errorMsg')
6
-
7
- // getqueryUrl from form
8
- const params = new URLSearchParams(window.location.search)
9
- let serachValue = params.get('search')
10
- let prefixValue = params.get('prefix')
11
- let containsValue = params.get('contains')
12
- let suffixValue = params.get('suffix')
13
- let lengthValue = params.get('length')
14
- let dictonary = params.get('dictonary')
15
-
16
- let ok = true
17
-
18
- let tab_container = document.querySelector('.tab_container')
19
-
20
- var sortValue
21
- var sortBool = false
22
- var theSelect = document.getElementById('select_dropDown')
23
-
24
- // getWords define...
25
- const getData = async (serachValue) => {
26
- try {
27
- main.innerHTML = `<div class="loader">
28
- <img src='/assets/images/loading.gif'>
29
- </div>`
30
- /// loader
31
- const response = await fetch(
32
- `/.netlify/functions/getWords?name=${serachValue}`
33
- )
34
- const data = await response.json()
35
- main.innerHTML = ''
36
- getWords(data)
37
- //getWords calling...
38
- } catch (error) {
39
- console.log(error)
40
- }
41
- }
42
- //getData calling...
43
- if (lengthValue === '1') {
44
- errorMsg.innerHTML = 'words length should be more than 1'
45
- } else {
46
- getData(serachValue.toLowerCase())
47
- }
48
-
49
- // getWords function define...
50
- function getWords(data) {
51
- if (typeof data === 'string') {
52
- errorMsg.innerHTML = 'no words found'
53
- wordCount.innerHTML = `<strong> 0 words with letters ${serachValue.split(
54
- ''
55
- )}</strong>`
56
- } else {
57
- let newWordsLength = 0
58
-
59
- // sort eventlistener
60
- theSelect.addEventListener('change', () => {
61
- sortValue = theSelect[theSelect.selectedIndex].text
62
- if (sortValue == 'Z-A') {
63
- sortBool = true
64
- sortby(sortBool, data)
65
- } else {
66
- sortBool = false
67
- sortby(sortBool, data)
68
- }
69
- })
70
-
71
- for (let i = serachValue.length; i >= 1; i--) {
72
- let newdata = data.filter((item) => item.length === i)
73
- if (prefixValue) {
74
- newdata = newdata.filter((item2) =>
75
- item2.startsWith(prefixValue.toLowerCase())
76
- )
77
- }
78
- if (containsValue) {
79
- newdata = newdata.filter((item) =>
80
- item.includes(containsValue.toLowerCase())
81
- )
82
- }
83
- if (suffixValue) {
84
- newdata = newdata.filter((item) =>
85
- item.endsWith(suffixValue.toLowerCase())
86
- )
87
- }
88
- if (lengthValue) {
89
- newdata = newdata.filter((item) => item.length == lengthValue)
90
- }
91
- if (newdata.length === 0) {
92
- main.innerHTML += ''
93
- } else {
94
- newWordsLength += newdata.length
95
-
96
- const result = newdata.map((item) => {
97
- if (item.length === 1) {
98
- ok = false
99
- newWordsLength = newWordsLength - 1
100
- } else {
101
- let ScrabbleLetterScore = ScrabbleScore()
102
- sum = 0
103
- item = item.toLowerCase()
104
- for (let i = 0; i < item.length; i++) {
105
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
106
- }
107
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
108
- <li>${item}
109
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
110
- </li></a>`
111
- }
112
- })
113
-
114
- if (ok) {
115
- tab_container.innerHTML += `
116
- <input type="button" id="Tab_${i}" onclick="Filtering(${i})" value="${i} Letter"
117
- class="tab_link cursorPointer" />
118
- `
119
- let tabs = document.getElementsByClassName('tab_link')
120
- tabs[0] ? tabs[0].classList.add('active-tab') : ''
121
-
122
- main.innerHTML += `
123
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
124
- <div class="wordListHeading">
125
- <h3 class="lead">${i} Letter Words</h3>
126
- </div>
127
- <div class="wordList">
128
- <ul class="ul list-unstyled">
129
- ${result.join('')}
130
- </ul>
131
- </div>
132
- </div>
133
- `
134
- }
135
- }
136
- }
137
-
138
- if (newWordsLength === 0) {
139
- errorMsg.innerHTML = 'no words found'
140
- } else {
141
- wordCount.innerHTML = `<strong>${newWordsLength} words with letters ${serachValue.split(
142
- ''
143
- )}</strong>`
144
- }
145
- }
146
- }
147
-
148
- // sort by aplhabets
149
- function sortby(sortBool, data) {
150
- if (sortBool) {
151
- main.innerHTML = ''
152
- data.reverse()
153
- let newWordsLength = 0
154
- for (let i = serachValue.length; i >= 1; i--) {
155
- var newdata = data.filter((item) => item.length === i)
156
-
157
- if (newdata.length === 0) {
158
- main.innerHTML += ''
159
- } else {
160
- newWordsLength += newdata.length
161
-
162
- const result = newdata.map((item) => {
163
- if (item.length === 1) {
164
- ok = false
165
- newWordsLength = newWordsLength - 1
166
- } else {
167
- let ScrabbleLetterScore = ScrabbleScore()
168
- let sum = 0
169
- item = item.toLowerCase()
170
- for (let i = 0; i < item.length; i++) {
171
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
172
- }
173
-
174
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
175
- <li>${item}
176
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
177
- </li></a>`
178
- }
179
- })
180
-
181
- main.innerHTML += `
182
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
183
- <div class="wordListHeading">
184
- <h3 class="lead">${i} Letter Words</h3>
185
- </div>
186
- <div class="wordList">
187
- <ul class="ul list-unstyled">
188
- ${result.join('')}
189
- </ul>
190
- </div>
191
- </div>
192
- `
193
- }
194
- }
195
- } else {
196
- main.innerHTML = ''
197
- data.sort()
198
- for (let i = serachValue.length; i >= 1; i--) {
199
- var newdata = data.filter((item) => item.length === i)
200
- if (newdata.length === 0) {
201
- main.innerHTML += ''
202
- } else {
203
- const result = newdata.map((item) => {
204
- if (item.length === 1) {
205
- ok = false
206
- } else {
207
- let ScrabbleLetterScore = ScrabbleScore()
208
- let sum = 0
209
- item = item.toLowerCase()
210
- for (let i = 0; i < item.length; i++) {
211
- sum += ScrabbleLetterScore[item[i]] || 0 // for unknown characters
212
- }
213
-
214
- return `<a class="anchor__style" title="Lookup python in Dictionary" target="_blank" href="/word-meaning?search=${item}">
215
- <li>${item}
216
- <span class="points" value="${sum}" style="position:relative; top:4px; font-size:12px"> ${sum}</span>
217
- </li></a>`
218
- }
219
- })
220
- main.innerHTML += `
221
- <div class="allGroupWords wordlistContainer" id="alpha_${i}">
222
- <div class="wordListHeading">
223
- <h3 class="lead">${i} Letter Words</h3>
224
- </div>
225
- <div class="wordList">
226
- <ul class="ul list-unstyled">
227
- ${result.join('')}
228
- </ul>
229
- </div>
230
- </div>
231
- `
232
- }
233
- }
234
- }
235
- }
236
-
237
- // Scrabble Point Counts
238
- const ScrabbleScore = () => {
239
- let twl06_sowpods = {
240
- a: 1,
241
- e: 1,
242
- i: 1,
243
- o: 1,
244
- u: 1,
245
- l: 1,
246
- n: 1,
247
- r: 1,
248
- s: 1,
249
- t: 1,
250
- d: 2,
251
- g: 2,
252
- b: 3,
253
- c: 3,
254
- m: 3,
255
- p: 3,
256
- f: 4,
257
- h: 4,
258
- v: 4,
259
- w: 4,
260
- y: 4,
261
- k: 5,
262
- j: 8,
263
- x: 8,
264
- q: 10,
265
- z: 10,
266
- }
267
-
268
- let wwfScore = {
269
- a: 1,
270
- b: 4,
271
- c: 4,
272
- d: 2,
273
- e: 1,
274
- f: 4,
275
- g: 3,
276
- h: 3,
277
- i: 1,
278
- j: 10,
279
- k: 5,
280
- l: 2,
281
- m: 4,
282
- n: 2,
283
- o: 1,
284
- p: 4,
285
- q: 10,
286
- r: 1,
287
- s: 1,
288
- t: 1,
289
- u: 2,
290
- v: 5,
291
- w: 4,
292
- x: 8,
293
- y: 3,
294
- z: 10,
295
- }
296
-
297
- if (dictonary === 'wwf') {
298
- return wwfScore
299
- } else {
300
- return twl06_sowpods
301
- }
302
- }
303
-
304
- // Implement Filtering
305
- let sections = {}
306
- function Filtering(id) {
307
- let tabs = document.getElementsByClassName('tab_link')
308
- tabs[0] ? tabs[0].classList.add('active-tab') : ''
309
-
310
- Array.from(tabs).map((item) => {
311
- item.classList.remove('active-tab')
312
- })
313
- main.innerHTML += ``
314
- let activeLetter = event.target
315
- // console.log(activeLetter)
316
- activeLetter.classList.add('active-tab')
317
-
318
- var section = document.querySelectorAll('.wordlistContainer')
319
- var sort_val = document.querySelector('.sort-select').value
320
- sections = {}
321
- Array.prototype.forEach.call(section, function (e) {
322
- if (document.body.clientWidth > 991) {
323
- sections[e.id] = e.offsetTop - 10
324
- } else {
325
- sections[e.id] = e.offsetTop - 10
326
- console.log(sections)
327
- }
328
- })
329
- document.body.scrollTop = sections[sort_val + '_' + id] + 5
330
- }
331
-
332
- let prev = document.getElementById('prev')
333
- let next = document.getElementById('next')
334
-
335
- if (prev) {
336
- prev.onclick = scroll_Right
337
- }
338
- if (next) {
339
- next.onclick = scroll_Left
340
- }
341
- window.addEventListener('resize', function () {
342
- scroll_visible()
343
- })
344
- function scroll_visible() {
345
- let tab_container = document.querySelector('#tab-container')
346
- console.log(tab_container)
347
- if (tab_container) {
348
- if (tab_container.clientWidth === tab_container.scrollWidth) {
349
- prev.style.display = 'none'
350
- next.style.display = 'none'
351
- } else {
352
- prev.style.display = 'block'
353
- next.style.display = 'block'
354
- }
355
- }
356
- }
357
- scroll_visible()
358
- function scroll_Left() {
359
- tab_container.scrollLeft += 130
360
- }
361
- function scroll_Right() {
362
- tab_container.scrollLeft -= 130
363
- }