Skip to content

Commit

Permalink
added save_to_file js
Browse files Browse the repository at this point in the history
  • Loading branch information
Bikatr7 committed May 14, 2024
1 parent ebe6488 commit 44d6738
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/gui/save_to_file.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
(text) => {
const blob = new Blob([text], { type: 'text/plain;charset=utf-8' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a');
a.href = url;
a.download = 'downloaded_text.txt';
a.click();
URL.revokeObjectURL(url);
}
3 changes: 3 additions & 0 deletions modules/common/file_ensurer.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ class FileEnsurer():
## favicon
favicon_path = os.path.join(gui_lib, "Kudasai_Logo.png")

## js save to file
js_save_to_file_path = os.path.join(gui_lib, "save_to_file.js")

DEFAULT_KIJIKU_RULES = {
"base translation settings": {
"prompt_assembly_mode": 1,
Expand Down

0 comments on commit 44d6738

Please sign in to comment.