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

Added ability to read shadow tiddlers

This commit is contained in:
Jeremy Ruston 2011-12-03 17:02:34 +00:00
parent a896ac0d56
commit f5665b47f3
2 changed files with 28 additions and 3 deletions

View File

@ -14,11 +14,17 @@ TiddlyWiki.prototype.clear = function() {
TiddlyWiki.prototype.getTiddler = function(title) { TiddlyWiki.prototype.getTiddler = function(title) {
var t = this.tiddlers[title]; var t = this.tiddlers[title];
return t instanceof Tiddler ? t : null; if(t instanceof Tiddler) {
return t;
} else if(this.shadows) {
return this.shadows.getTiddler(title);
} else {
return null;
}
}; };
TiddlyWiki.prototype.getTiddlerText = function(title) { TiddlyWiki.prototype.getTiddlerText = function(title) {
var t = this.tiddlers[title]; var t = this.getTiddler(title);
return t instanceof Tiddler ? t.fields.text : null; return t instanceof Tiddler ? t.fields.text : null;
}; };
@ -26,7 +32,7 @@ TiddlyWiki.prototype.deleteTiddler = function(title) {
delete this.tiddlers[title]; delete this.tiddlers[title];
}; };
TiddlyWiki.prototype.isTiddler = function(title) { TiddlyWiki.prototype.tiddlerExists = function(title) {
return this.tiddlers[title] instanceof Tiddler; return this.tiddlers[title] instanceof Tiddler;
}; };

View File

@ -1,3 +1,22 @@
/*
Wikifier for TiddlyWiki format text
The wikifier parses wikitext into an intermediate tree from which the HTML is generated. The tree
looks like this:
this.tree = [
{type: "div", attributes: {
attr1: value,
attr2: value
}, children: [
{child},
{child},
]}
];
*/
/*global require: false, exports: false, process: false */ /*global require: false, exports: false, process: false */
"use strict"; "use strict";