1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +00:00

SaverHandler: Don't generate file if autosave disabled

This commit is contained in:
Jermolene 2019-03-05 15:43:14 +00:00
parent a9e595c3f6
commit 0c2689dd78

View File

@ -151,8 +151,12 @@ Save the wiki contents. Options are:
SaverHandler.prototype.saveWiki = function(options) { SaverHandler.prototype.saveWiki = function(options) {
options = options || {}; options = options || {};
var self = this, var self = this,
method = options.method || "save", method = options.method || "save";
variables = options.variables || {}, // Ignore autosave if disabled
if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") {
return false;
}
var variables = options.variables || {},
template = options.template || "$:/core/save/all", template = options.template || "$:/core/save/all",
downloadType = options.downloadType || "text/plain", downloadType = options.downloadType || "text/plain",
text = this.wiki.renderTiddler(downloadType,template,options), text = this.wiki.renderTiddler(downloadType,template,options),
@ -171,10 +175,6 @@ SaverHandler.prototype.saveWiki = function(options) {
} }
} }
}; };
// Ignore autosave if disabled
if(method === "autosave" && this.wiki.getTiddlerText(this.titleAutoSave,"yes") !== "yes") {
return false;
}
// Call the highest priority saver that supports this method // Call the highest priority saver that supports this method
for(var t=this.savers.length-1; t>=0; t--) { for(var t=this.savers.length-1; t>=0; t--) {
var saver = this.savers[t]; var saver = this.savers[t];