From 85d257a1ccdf98894127bcbfc973d912a5146506 Mon Sep 17 00:00:00 2001 From: slashinfty Date: Fri, 7 Aug 2020 20:48:15 -0400 Subject: removing jquery --- index.html | 7 +++---- main.js | 20 +++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index bf39a95..8c59681 100644 --- a/index.html +++ b/index.html @@ -8,7 +8,6 @@ YouTube Frame Timer - @@ -42,9 +41,9 @@

Video Time

  -

- +

+ - \ No newline at end of file + diff --git a/main.js b/main.js index d3a3250..97c111f 100644 --- a/main.js +++ b/main.js @@ -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 +} -- cgit v1.2.3