Startings of a UI for inspectable filters

This commit is contained in:
Jeremy Ruston
2025-04-11 15:42:54 +01:00
parent b632b75f70
commit 8dbb41ba2a
6 changed files with 37 additions and 5 deletions
@@ -2,6 +2,7 @@ created: 20131127215321439
modified: 20140912135951542
title: $:/DefaultTiddlers
[[$:/plugins/internals/config]]
[[$:/AdvancedSearch]]
[[inspect Operator]]
[[inspect-filter Macro]]
@@ -3,6 +3,7 @@ modified: 20140912135951542
title: $:/DefaultTiddlers
type: text/vnd.tiddlywiki
[[$:/plugins/internals/config]]
[[$:/AdvancedSearch]]
[[inspect Operator]]
[[inspect-filter Macro]]
+22
View File
@@ -0,0 +1,22 @@
title: $:/plugins/internals/config
tags: $:/tags/ControlPanel
caption: Internals
Configuration for the Internals Plugin.
!! Logged Filters
Until there is a UI to create them, you can clone an existing inspectable filter record and modify it.
<$list filter="[all[shadows+tiddlers]tag[$:/tags/InspectableFilter]!has[draft.of]sort[]]" variable="inspectableFilter">
<div>
<$link to=<<inspectableFilter>>><$text text=<<inspectableFilter>>/></$link>: <$text text={{{ [<inspectableFilter>get[text]] }}}/>
</div>
<ol>
<$list filter="[all[shadows+tiddlers]tag[$:/tags/FilterInspectionOutput]!has[draft.of]!sort[modified]] :filter[<inspectableFilter>get[text]match{!!filter}]" variable="inspectionOutput">
<li>
<$link to=<<inspectionOutput>>><$text text=<<inspectionOutput>>/></$link>
</li>
</$list>
</ol>
</$list>
@@ -19,11 +19,14 @@ exports.startup = function() {
$tw.plugins.internals = {
getWrappers: getWrappers
};
var inspectedFilters = [
"[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!is[draft]]"
],
accumulator = [];
var accumulator = [];
$tw.hooks.addHook("th-filter-evaluation",function(filterString,wrappers) {
var inspectedFilters = [];
$tw.wiki.eachTiddlerPlusShadows(function(tiddler,title) {
if(tiddler.fields.tags && tiddler.fields.tags.indexOf("$:/tags/InspectableFilter") !== -1 && !tiddler.fields["draft.of"] && tiddler.fields.text) {
inspectedFilters.push(tiddler.fields.text);
}
});
// Check whether this is a filter we want to inspect
if(inspectedFilters.indexOf(filterString) === -1) {
return wrappers;
+1 -1
View File
@@ -2,6 +2,6 @@
"title": "$:/plugins/tiddlywiki/internals",
"name": "Internals",
"description": "Tools for exploring the internals of TiddlyWiki",
"list": "readme",
"list": "readme config",
"stability": "STABILITY_2_STABLE"
}
@@ -0,0 +1,5 @@
title: $:/plugins/internals/testfilter
tags: $:/tags/InspectableFilter
type: text/plain
[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!is[draft]]