mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-08-30 13:02:53 +00:00
38 lines
680 B
JavaScript
38 lines
680 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/is/orphan.js
|
|
type: application/javascript
|
|
module-type: isfilteroperator
|
|
|
|
Filter function for [is[orphan]]
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.orphan = function(source,prefix,options) {
|
|
var results = [],
|
|
orphanTitles = options.wiki.getOrphanTitles();
|
|
if(prefix === "!") {
|
|
source(function(tiddler,title) {
|
|
if(orphanTitles.indexOf(title) === -1) {
|
|
results.push(title);
|
|
}
|
|
});
|
|
} else {
|
|
source(function(tiddler,title) {
|
|
if(orphanTitles.indexOf(title) !== -1) {
|
|
results.push(title);
|
|
}
|
|
});
|
|
}
|
|
return results;
|
|
};
|
|
|
|
})();
|