1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-23 10:07:19 +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/filesystem"
],
"doNotSave": [
"$:/StoryList",
"$:/HistoryList",
"$:/status/IsLoggedIn",
"$:/status/UserName"
],
"includeWikis": [
"../tw5.com"
]

View File

@ -101,7 +101,10 @@ FileSystemAdaptor.prototype.saveTiddler = function(tiddler,callback) {
if(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
var typeInfo = $tw.config.contentTypeInfo[fileInfo.type];
fs.writeFile(fileInfo.filepath,tiddler.fields.text,{encoding: typeInfo.encoding},function(err) {