\n
");
- result.push(utils.htmlEncode(tid.fields.text));
+ result.push(utils.htmlEncode(text));
result.push("
\n
");
return result.join("");
};
diff --git a/js/WikiStore.js b/js/WikiStore.js
index 7d8306554..a4c9951e0 100755
--- a/js/WikiStore.js
+++ b/js/WikiStore.js
@@ -1,6 +1,12 @@
/*\
title: js/WikiStore.js
+WikiStore uses the .cache member of tiddlers to store the following information:
+
+ parseTree: Caches the parse tree for the tiddler
+ renderers: Caches rendering functions for this tiddler (indexed by MIME type)
+ renditions: Caches the renditions produced by those functions (indexed by MIME type)
+
\*/
(function(){
@@ -125,7 +131,7 @@ WikiStore.prototype.getTiddler = function(title) {
WikiStore.prototype.getTiddlerText = function(title) {
var t = this.getTiddler(title);
- return t instanceof Tiddler ? t.fields.text : null;
+ return t instanceof Tiddler ? t.text : null;
};
WikiStore.prototype.deleteTiddler = function(title) {
@@ -143,8 +149,8 @@ WikiStore.prototype.tiddlerExists = function(title) {
};
WikiStore.prototype.addTiddler = function(tiddler) {
- this.tiddlers[tiddler.fields.title] = tiddler;
- this.touchTiddler("modified",tiddler.fields.title);
+ this.tiddlers[tiddler.title] = tiddler;
+ this.touchTiddler("modified",tiddler.title);
};
WikiStore.prototype.forEachTiddler = function(/* [sortField,[excludeTag,]]callback */) {
@@ -159,22 +165,10 @@ WikiStore.prototype.forEachTiddler = function(/* [sortField,[excludeTag,]]callba
for(t in this.tiddlers) {
tiddlers.push(this.tiddlers[t]);
}
- tiddlers.sort(function (a,b) {
- var aa = a.fields[sortField] || 0,
- bb = b.fields[sortField] || 0;
- if(aa < bb) {
- return -1;
- } else {
- if(aa > bb) {
- return 1;
- } else {
- return 0;
- }
- }
- });
+ tiddlers.sort(function (a,b) {return Tiddler.compareTiddlerFields(a,b,sortField);});
for(t=0; t