assets/js/createWordle.js in word-games-theme-1.2.8 vs assets/js/createWordle.js in word-games-theme-1.2.9

- old
+ new

@@ -11,10 +11,15 @@ let openPopup = document.querySelector(".open-popup") const alertContainer = document.querySelector(".alert-container") let errorMsg = document.querySelector("#errorMsg") +let facebookSHareLink = document.querySelector(".facebook-share-link") +let twitterSHareLink = document.querySelector(".twitter-share-link") +let whatsappSHareLink = document.querySelector(".whatsapp-share-link") + + customWord.focus() let dictionary async function getData() { @@ -48,9 +53,15 @@ copy_btn.innerHTML = "Copy" copy_btn.style.background = "dodgerblue" wordlePlayButton.setAttribute("href", `/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`) wordleGameLink.setAttribute("href", `/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`) wordleGameLink.innerHTML = `${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}` + + facebookSHareLink.setAttribute("href", + `https://www.facebook.com/share.php?u=${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`) + twitterSHareLink.setAttribute("href", + `https://www.twitter.com/compose/tweet?&text=${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`) + whatsappSHareLink.setAttribute("href", `whatsapp://send?text=${window.location.protocol + "//" + window.location.hostname}/word-game-play?q=${btoa(customWord.value.toLocaleLowerCase())}`) } } } form.addEventListener('submit', createWordle);