1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-24 20:27:38 +00:00

New implementation for shadow tiddlers

Now shadow tiddlers are any tiddler whose title starts with "$:/"
This commit is contained in:
Jeremy Ruston
2012-11-11 14:31:45 +00:00
parent d7d6e59865
commit 9612aac296
4 changed files with 34 additions and 30 deletions

View File

@@ -20,6 +20,17 @@ exports.hasField = function(field) {
return $tw.utils.hop(this.fields,field);
};
exports.isShadow = function() {
if(!$tw.utils.hop(this,"shadowFlag")) {
this.shadowFlag = this.fields.title.indexOf("$:/") === 0;
}
return this.shadowFlag;
};
exports.isTemporary = function() {
return this.fields.title.indexOf("$:/temp/") === 0;
};
exports.getFieldString = function(field) {
var value = this.fields[field];
// Check for a missing field