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