Update index.html
This commit is contained in:
parent
ae036b662b
commit
53f2a80ced
1 changed files with 11 additions and 7 deletions
18
index.html
18
index.html
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue