Download highlightNote.js from CalebKoster/Translation_Note_Alignment: direct link, hf CLI and curl.
- Browser
- Download file 492 Bytes
-
https://huggingface.co/spaces/CalebKoster/Translation_Note_Alignment/resolve/main/highlightNote.js
- Command line
-
hf download hf://spaces/CalebKoster/Translation_Note_Alignment/highlightNote.js
-
curl -L -o highlightNote.js https://huggingface.co/spaces/CalebKoster/Translation_Note_Alignment/resolve/main/highlightNote.js
492 Bytes
| function highlightNote(noteId, verseText, startPos, endPos) { | |
| const noteElement = document.getElementById(noteId); | |
| if(noteElement) { | |
| const highlightedText = `<span class="highlight">${verseText.substring(startPos, endPos)}</span>`; | |
| const verseTextElement = document.querySelector('.verse-text'); | |
| if (verseTextElement) { | |
| verseTextElement.innerHTML = verseText.substring(0, startPos) + highlightedText + verseText.substring(endPos); | |
| } | |
| } | |
| } |