2014-02-20 10:00:13 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/filters/indexes.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: filteroperator
|
|
|
|
|
|
|
|
Filter operator for returning the indexes of a data tiddler
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
Export our filter function
|
|
|
|
*/
|
|
|
|
exports.indexes = 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 data = options.wiki.getTiddlerDataCached(title);
|
2014-02-20 10:00:13 +00:00
|
|
|
if(data) {
|
|
|
|
$tw.utils.pushTop(results,Object.keys(data));
|
|
|
|
}
|
2014-04-03 19:49:16 +00:00
|
|
|
});
|
2014-02-20 10:00:13 +00:00
|
|
|
results.sort();
|
|
|
|
return results;
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|