assets/js/X-letter.js in word-games-theme-0.9.3 vs assets/js/X-letter.js in word-games-theme-0.9.4
- old
+ new
@@ -1,12 +1,14 @@
---
---
const getScript=document.currentScript
const letterLen = getScript.dataset.letter
-
const ablank = getScript.dataset.ablank
+const siteName = getScript.dataset.name
+const siteUrl = getScript.dataset.url
+
let errorMsg = document.querySelector('.errorMsg')
let script = document.currentScript
let wordCount = document.querySelector('.wordCount')
let main = document.querySelector('.main')
@@ -18,10 +20,11 @@
let exculdeValue = params.get('exculde')
let includeValue = params.get('include')
let lengthValue = params.get('length')
let dictonary = params.get('dictionary')
+
let tab_link_wrapper = document.querySelector('.tab_link_wrapper')
tab_link_wrapper.style.display = "none"
let txtBox = document.querySelector('.txtBox')
txtBox.focus()
@@ -75,10 +78,11 @@
}
const getData = async (serachValue) => {
try {
main.innerHTML = `<div class="loader">
<img src='/assets/images/loading.gif'>
+ <div style="font-weight:900;font-size:14px" >Finding words - Powered by ${siteUrl.replace(/^https?:\/\//, '')}</div>
</div>`
const response = await fetch(
`/.netlify/functions/getWords?name=${serachValue}`
)
const data = await response.json()
@@ -90,11 +94,11 @@
}
// calling function
getData(serachValue.toLowerCase())
function x_with_letters(data) {
- console.log(data);
+ // console.log(data);
if (typeof data === 'string') {
errorMsg.innerHTML = 'No words found'
wordCount.innerHTML = `<strong>Found 0 words with letters ${serachValue.split(
''
)}</strong>`
@@ -257,9 +261,18 @@
// </a>
// `
// let tabs = document.getElementsByClassName('tab_link')
// tabs[0] ? tabs[0].classList.add('active-tab') : ''
+
+
+if(siteName == "wordswithletters"){
+ let home_page_search_result = document.querySelector("#home_page_search_result")
+ let homePageSearchResult = `/result?search=${serachValue}&dictionary=Dictionary&prefix=&contains=&suffix=&exculde=&inculde=&length=`;
+ home_page_search_result.href = homePageSearchResult
+ home_page_search_result.innerHTML = `See words of any length with letters ${serachValue.split("")}`
+}
+
main.innerHTML += `
<div class="allGroupWords">
<div class="wordListHeading">
<h3 class="lead">${itemLength} Letter Words</h3>