From 6f88a57a410545efe30a2c0bd29cd2f997e1be2a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 21 Mar 2013 22:21:00 +0000 Subject: [PATCH] Add wiki.countTiddlers() method --- core/modules/wiki.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/modules/wiki.js b/core/modules/wiki.js index b2b35eab1..cf14d57a6 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -207,6 +207,11 @@ exports.getTiddlers = function(sortField,excludeTag) { return titles; }; +exports.countTiddlers = function(excludeTag) { + var tiddlers = this.getTiddlers(null,excludeTag); + return $tw.utils.count(tiddlers); +}; + /* Sort an array of tiddler titles by a specified field titles: array of titles (sorted in place) @@ -282,7 +287,7 @@ exports.getTiddlerLinks = function(title) { } }; if(parser) { - checkParseTree(parser.tree) + checkParseTree(parser.tree); } return links; });