mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-19 22:26:18 +00:00
![Jermolene](/assets/img/avatar_default.png)
For backwards compatibility, we now explicitly request the cacheable version of this method. Fixes #1873
33 lines
735 B
JavaScript
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;
|
|
};
|
|
|
|
})();
|