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:
parent
546d7bfafc
commit
631dd1cc5f
@ -3,6 +3,12 @@
|
||||
"tiddlywiki/tiddlyweb",
|
||||
"tiddlywiki/filesystem"
|
||||
],
|
||||
"doNotSave": [
|
||||
"$:/StoryList",
|
||||
"$:/HistoryList",
|
||||
"$:/status/IsLoggedIn",
|
||||
"$:/status/UserName"
|
||||
],
|
||||
"includeWikis": [
|
||||
"../tw5.com"
|
||||
]
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user