-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(...texts) => | ||
{ | ||
console.log("Starting save_to_zip function"); | ||
|
||
const sectionNames = [ | ||
"Indexed Text", "Indexing Results", "Indexing Debug Log", | ||
"Preprocessed Text", "Preprocessing Results", "Preprocessing Debug Log", | ||
"Translated Text", "JE Check Text", "Translator Debug Log", | ||
"Overall Debug Log", "Error Log" | ||
]; | ||
|
||
texts.forEach((text, index) => | ||
{ | ||
console.log(`Processing section: ${sectionNames[index]}`); | ||
const fileName = `${sectionNames[index].replace(/ /g, '_').toLowerCase()}.txt`; | ||
const blob = new Blob([text], { type: 'text/plain' }); | ||
const url = URL.createObjectURL(blob); | ||
console.log("URL created:", url); | ||
|
||
const a = document.createElement('a'); | ||
a.href = url; | ||
a.download = fileName; | ||
console.log("Download link created for", fileName); | ||
|
||
a.click(); | ||
console.log("Download initiated for", fileName); | ||
|
||
URL.revokeObjectURL(url); | ||
console.log("URL revoked for", fileName); | ||
}); | ||
|
||
console.log("save_to_zip function completed"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters