1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-26 07:13:15 +00:00
TiddlyWiki5/core/modules/filters/plugintiddlers.js
Jermolene 32f6d7f1b0 Revert getTiddlerData() and add getTiddlerDataCached()
For backwards compatibility, we now explicitly request the cacheable
version of this method.

Fixes #1873
2015-07-10 16:43:50 +01:00

33 lines
735 B
JavaScript

/*\
title: $:/core/modules/filters/plugintiddlers.js
type: application/javascript
module-type: filteroperator
Filter operator for returning the titles of the shadow tiddlers within a plugin
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.plugintiddlers = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerDataCached(title,{tiddlers:[]});
if(pluginInfo && pluginInfo.tiddlers) {
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
results.push(title);
});
}
});
results.sort();
return results;
};
})();