1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

Added ability to disable file saving for specific tiddlers

This commit is contained in:
Jeremy Ruston 2013-03-25 19:50:33 +00:00
parent 546d7bfafc
commit 631dd1cc5f
2 changed files with 10 additions and 1 deletions

View File

@ -3,6 +3,12 @@
"tiddlywiki/tiddlyweb", "tiddlywiki/tiddlyweb",
"tiddlywiki/filesystem" "tiddlywiki/filesystem"
], ],
"doNotSave": [
"$:/StoryList",
"$:/HistoryList",
"$:/status/IsLoggedIn",
"$:/status/UserName"
],
"includeWikis": [ "includeWikis": [
"../tw5.com" "../tw5.com"
] ]

View File

@ -101,7 +101,10 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) {
if(err) { if(err) {
return callback(err); return callback(err);
} }
if(fileInfo.hasMetaFile) { if($tw.boot.wikiInfo.doNotSave && $tw.boot.wikiInfo.doNotSave.indexOf(tiddler.fields.title) !== -1) {
// Don't save the tiddler if it's on the blacklist
callback(null,{},0);
} else if(fileInfo.hasMetaFile) {
// Save the tiddler as a separate body and meta file // Save the tiddler as a separate body and meta file
var typeInfo = $tw.config.contentTypeInfo[fileInfo.type]; var typeInfo = $tw.config.contentTypeInfo[fileInfo.type];
fs.writeFile(fileInfo.filepath,tiddler.fields.text,{encoding: typeInfo.encoding},function(err) { fs.writeFile(fileInfo.filepath,tiddler.fields.text,{encoding: typeInfo.encoding},function(err) {