mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-06 12:36:53 +00:00
0cf5dc699e
Long overdue rewrite to make it simpler, and break the filter operators out into individual modules.
29 lines
570 B
JavaScript
29 lines
570 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/searchVia.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator for searching for the text in the operand tiddler
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.searchVia = function(source,operator,options) {
|
|
var term = options.wiki.getTiddlerText(operator.operand,""),
|
|
invert = operator.prefix === "!";
|
|
return options.wiki.search(term,{
|
|
titles: source,
|
|
invert: invert,
|
|
exclude: [operator.operand]
|
|
});
|
|
};
|
|
|
|
})();
|