1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-26 05:07:39 +00:00

Add support for autosave

Causes the wiki to be autosaved whenever clicking “done” after editing
a tiddler. Only works with savers that support autosave. We should
probably make autosave configurable
This commit is contained in:
Jermolene
2014-02-04 21:21:01 +00:00
parent 4882f70557
commit 1d685df928
12 changed files with 44 additions and 55 deletions

View File

@@ -93,6 +93,13 @@ exports.startup = function() {
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-auto-save-wiki",function(event) {
$tw.wiki.saveWiki({
method: "autosave",
template: event.param,
downloadType: "text/plain"
});
});
$tw.rootWidget.addEventListener("tw-download-file",function(event) {
$tw.wiki.saveWiki({
method: "download",