Sha256: c76104af48647d58ffae745a0cafb83df832e2f9e5fb9ba9b9e86902dc80a954

Contents?: true

Size: 1.48 KB

Versions: 7

Compression:

Stored size: 1.48 KB

Contents

let letterCloseButton = document.querySelector('.letter-close-button')
let txtBox = document.querySelector('.txtBox')
let focusBorder = document.querySelector('.focus-border')
txtBox.focus()

$(function () {
    $('[data-toggle="tooltip"]').tooltip()
})

document.querySelector(".serachBtn").value = ""

function myFunction(x) {
    if (x.matches) {
        txtBox.addEventListener("click", () => {
            document.documentElement.scrollTop = 200
            setTimeout(() => {
                document.documentElement.scrollTop = 200
            }, 150);
        })
    } else {
        console.log("false");
    }
}
var x = window.matchMedia("(max-width: 768px)")
myFunction(x)
x.addListener(myFunction)

txtBox.addEventListener('input', (e) => {
    if (e.target.value === "") {
        letterCloseButton.classList.remove("close_ltr_icon")
    }
    else {
        letterCloseButton.classList.add("close_ltr_icon")
    }

    focusBorder.classList.remove("focus-border")
    e.target.value = e.target.value.replace(/[^a-zA-Z? ]/g, "")
    let rangeOfBlankTile = 3
    if (rangeOfBlankTile === "") {
        rangeOfBlankTile = 3
    }
    e.target.value = e.target.value.replace(/ /g, '?')
    let data = []
    data = e.target.value.split('').filter((i) => i === '?')
    if (data.length > rangeOfBlankTile) {
        e.target.value = e.target.value.replace(/\?$/, '')
    }
})

letterCloseButton.addEventListener("click", () => {
    txtBox.value = ""
    letterCloseButton.classList.remove("close_ltr_icon")
})

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
word-games-theme-1.8.6 assets/js/default.js
word-games-theme-1.8.5 assets/js/default.js
word-games-theme-1.8.2 assets/js/default.js
word-games-theme-1.8.1 assets/js/default.js
word-games-theme-1.8.0 assets/js/default.js
word-games-theme-1.7.9 assets/js/default.js
word-games-theme-1.7.4 assets/js/default.js