mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 18:59:42 +00:00
32f6d7f1b0
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;
|
|
};
|
|
|
|
})();
|