Download main.js from DomeZ/sf-dce: direct link, hf CLI and curl.
- Browser
- Download file 620 Bytes
-
https://huggingface.co/spaces/DomeZ/sf-dce/resolve/main/main.js
- Command line
-
hf download hf://spaces/DomeZ/sf-dce/main.js
-
curl -L -o main.js https://huggingface.co/spaces/DomeZ/sf-dce/resolve/main/main.js
620 Bytes
| /** | |
| * Get elements | |
| */ | |
| const form = document.querySelector("form"); | |
| const langSelect = document.querySelectorAll("select"); | |
| const message = document.querySelector("input[type='text']"); | |
| const submitButton = document.querySelector("input[type='submit']"); | |
| /** | |
| * Event listener | |
| */ | |
| from.addEventListener("submit", (e) => { | |
| e.preventDefault(); | |
| const lang1 = langSelect[0].value; | |
| const lang2 = langSelect[1].value; | |
| const lang3 = langSelect[2].value; | |
| const lang4 = langSelect[3].value; | |
| const lang5 = langSelect[4].value; | |
| const text = message.value; | |
| // Translation code goes here | |
| }); |