mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-09-03 08:38:54 +00:00
Add global setting to enable filter observation
This commit is contained in:
@@ -5,6 +5,11 @@ list-after: $:/plugins/tiddlywiki/internals/filterinspection/InspectResultsTab
|
||||
|
||||
Log traces of this filter expression in the background. A trace will be generated every time the filter is evaluated, regardless of the context. The trace is only saved if the results are different from previous traces.
|
||||
|
||||
<$checkbox tiddler="$:/config/FilterObservationionEnabled" field="text" checked="yes" unchecked="no" default="no">
|
||||
Enable background filter observation
|
||||
</$checkbox>
|
||||
|
||||
|
||||
<$button>
|
||||
<%if [all[shadows+tiddlers]tag[$:/tags/InspectableFilter]get[text]match{$:/temp/advancedsearch}count[]match[0]] %>
|
||||
<$action-createtiddler $basetitle="$:/config/inspectable-filters/filter" tags="$:/tags/InspectableFilter" type="text/plain" text={{$:/temp/advancedsearch}}/>
|
||||
|
||||
@@ -25,6 +25,10 @@ exports.startup = function() {
|
||||
var accumulator = [];
|
||||
// Add our hook for each filter evaluation
|
||||
$tw.hooks.addHook("th-filter-evaluation",function(filterString,wrappers) {
|
||||
// Check that filter observation is enabled
|
||||
if($tw.wiki.getTiddlerText("$:/config/FilterObservationionEnabled","no") !== "yes") {
|
||||
return wrappers;
|
||||
}
|
||||
// Get the list of filters to be inspected
|
||||
var inspectedFilters = [];
|
||||
$tw.wiki.eachTiddlerPlusShadows(function(tiddler,title) {
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
title: $:/temp/advancedsearch
|
||||
|
||||
[all[shadows+tiddlers]tag[HelloThere]] -[all[shadows+tiddlers]prefix[A]] :filter[<currentTiddler>tag[Community]]
|
||||
@@ -0,0 +1,2 @@
|
||||
title: $:/config/FilterObservationionEnabled
|
||||
text: yes
|
||||
Reference in New Issue
Block a user