diff options
author | slashinfty <matt.braddock@gmail.com> | 2020-08-07 20:48:15 -0400 |
---|---|---|
committer | slashinfty <matt.braddock@gmail.com> | 2020-08-07 20:48:15 -0400 |
commit | 85d257a1ccdf98894127bcbfc973d912a5146506 (patch) | |
tree | 08650e401cb081e4e43ffadb88d36a12cec0e55a /main.js | |
parent | 2c0a0a13aeb2c00f7805e22175656b11845f9c1e (diff) |
removing jquery
Diffstat (limited to 'main.js')
-rw-r--r-- | main.js | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -41,15 +41,17 @@ function compute() { let modMessage = `Mod Message: Time starts at ${parseFloat(startFrame).toFixed(3)} and ends at ${parseFloat(endFrame).toFixed(3)} at ${frameRate} fps to get a final time of ${finalTime}.`; let credits = `Retimed using [yt-frame-timer](https://mattbraddock.com/yt-frame-timer)`; document.getElementById('time').value = finalTime; - document.getElementById('modMessage').innerHTML = modMessage + ' ' + credits; - - // Allow user to copy mod message to clipboard + document.getElementById('modMessage').innerText = modMessage + ' ' + credits; document.getElementById("modMessageButton").disabled = false; - $("#modMessageButton").click(function () { - navigator.clipboard.writeText(modMessage + ' ' + credits) - .then(() => { alert(`The mod message has been copied to clipboard! Please paste it into the comment of the run you are verifying.`) }) - .catch((error) => { alert(`Failed to copy to clipboard! ${error}`) }) - }); +} + +function copyModMessage() { + // Allow user to copy mod message to clipboard + const textArea = document.getElementById('modMessage'); + textArea.focus(); + textArea.select(); + document.execCommand('copy'); + alert(`The mod message has been copied to clipboard! Please paste it into the comment of the run you are verifying.`); } const validateFPS = (event) => { @@ -79,4 +81,4 @@ const parseForTime = (event) => { // Update the DOM document.getElementById(event.target.id).value = `${finalFrame}`; } -}
\ No newline at end of file +} |