aboutsummaryrefslogtreecommitdiffhomepage
path: root/main.js
diff options
context:
space:
mode:
authorslashinfty <matt.braddock@gmail.com> 2020-08-07 20:48:15 -0400
committerslashinfty <matt.braddock@gmail.com> 2020-08-07 20:48:15 -0400
commit85d257a1ccdf98894127bcbfc973d912a5146506 (patch)
tree08650e401cb081e4e43ffadb88d36a12cec0e55a /main.js
parent2c0a0a13aeb2c00f7805e22175656b11845f9c1e (diff)
removing jquery
Diffstat (limited to 'main.js')
-rw-r--r--main.js20
1 files changed, 11 insertions, 9 deletions
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
+}