()
| 306 | |
| 307 | // Copy to clipboard |
| 308 | const copyLink = () => { |
| 309 | if (elements.textArea.value !== '') { |
| 310 | let copyBtn = elements.copyText.childNodes[3]; |
| 311 | if (copyBtn.style.backgroundColor === 'rgb(87, 132, 245)') { |
| 312 | const copiedText = elements.textArea.value; |
| 313 | navigator.clipboard.writeText(copiedText); |
| 314 | const input = elements.copyText.querySelector('input.text'); |
| 315 | input.select(); |
| 316 | |
| 317 | copyBtn.style.backgroundColor = '#2bbe60'; |
| 318 | elements.copyText.classList.add('active'); |
| 319 | |
| 320 | setTimeout(() => { |
| 321 | elements.copyText.classList.remove('active'); |
| 322 | }, 2500); |
| 323 | } |
| 324 | } |
| 325 | }; |
| 326 | |
| 327 | //Event Handlers |
| 328 |
nothing calls this directly
no outgoing calls
no test coverage detected