PrettyPaste: Add Fork and New button

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2022-01-16 13:21:15 +05:30
parent 372bbf28d3
commit 449f0c38a9
7 changed files with 80 additions and 7 deletions

View File

@@ -6,6 +6,15 @@ const textarea = document.querySelector('textarea');
const select = document.querySelector('select');
const submitButton = document.querySelector('button[type="submit"]');
window.onload = () => {
if (localStorage["forkText"] !== null) {
const textArea = document.getElementById('textarea_content');
textArea.textContent = localStorage["forkText"];
localStorage.clear();
onInput();
}
}
const onInput = () => {
submitButton.classList.toggle('hidden', !textarea.value);
select.classList.toggle('hidden', !textarea.value);