Update index.html

This commit is contained in:
The Ghost of FOSS' Future 2024-09-17 19:11:54 -05:00 committed by GitHub
parent ae036b662b
commit 53f2a80ced
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -333,13 +333,17 @@
}; };
function quickSaveFile(content) { function quickSaveFile(content) {
const fileName = prompt("File name to quick save as:", `${currentFile}`) || `${currentFile}`; const fileName = prompt("File name to quick save as:", `${currentFile}`);
const blob = new Blob([content], { type: "text/plain" }); if (fileName) {
const a = document.createElement("a"); const blob = new Blob([content], { type: "text/plain" });
a.href = URL.createObjectURL(blob); const a = document.createElement("a");
a.download = fileName; a.href = URL.createObjectURL(blob);
a.click(); a.download = fileName;
URL.revokeObjectURL(a.href); a.click();
URL.revokeObjectURL(a.href);
} else {
alert("No filename provided. Canceling save...")
}
} }
async function saveAs(content) { async function saveAs(content) {