2014-03-14 15:23:28 +00:00
|
|
|
/*\
|
|
|
|
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) {
|
2014-04-03 19:49:16 +00:00
|
|
|
var results = [];
|
|
|
|
source(function(tiddler,title) {
|
2015-07-10 15:43:50 +00:00
|
|
|
var pluginInfo = options.wiki.getPluginInfo(title) || options.wiki.getTiddlerDataCached(title,{tiddlers:[]});
|
2014-09-26 20:33:47 +00:00
|
|
|
if(pluginInfo && pluginInfo.tiddlers) {
|
2014-08-30 19:44:26 +00:00
|
|
|
$tw.utils.each(pluginInfo.tiddlers,function(fields,title) {
|
|
|
|
results.push(title);
|
|
|
|
});
|
|
|
|
}
|
2014-04-03 19:49:16 +00:00
|
|
|
});
|
2014-03-14 15:23:28 +00:00
|
|
|
results.sort();
|
|
|
|
return results;
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|