OcttKB Cross-Repo Sync (HTML to Raw)

This commit is contained in:
2023-07-23 13:33:31 +00:00
parent 0cfc51da4e
commit 49c7acc7f3
971 changed files with 50 additions and 29 deletions

View File

@@ -0,0 +1,67 @@
created: 20210719102404282
modified: 20230109220740719
tags: TiddlyTools
title: $:/ThirdParty/TiddlyTools/FilterGenerators/Info
\define program() [prefix[$:/ThirdParty/TiddlyTools/FilterGenerators]] [[$:/ThirdParty/TiddlyTools/Macros/edit-list]] +[!sort[modified]]
\define import(tids)
Drag this link to
<$button class="tc-btn-invisible tc-tiddlylink" popup="$:/state/popup/$(currentTiddler)$/$tids$" dragFilter=<<$tids$>>>
''import <$count filter=<<$tids$>>/> $tids$ tiddlers.''
</$button>
<$reveal type="popup" state="$:/state/popup/$(currentTiddler)$/$tids$" class="tc-drop-down" style="padding:1em;">
<$list filter=<<$tids$>>><$link/></$list>
</$reveal>
\end
| author|''[ext[Eric Shulman|mailto:elsdesign@gmail.com]]''|
| source|''http://TiddlyTools.com/filtergenerators.html''|
| updated|''<$view field="modified" format="date" template="DDD, MMM DDth YYYY at 0hh12:0mm:0ssam"/>''|
<<import program>>
~TiddlyTools' ~FilterGenerators define several $:/AdvancedSearch addon tabs to provide a variety of specialized searches.
!! [[$:/ThirdParty/TiddlyTools/FilterGenerators/Titles]]
<<<
''Search for tiddler titles in selected types of tiddlers''
* Finds tiddlers that contain the specified text anywhere in their title
* Select one or more types of tiddlers to search in:<br>&emsp;tiddlers, shadows, system, tags, missing, orphans, images, binaries
<<<
!! [[$:/ThirdParty/TiddlyTools/FilterGenerators/Tags]]
<<<
''Search for tiddlers using a combination of tags''
* Shows checkboxes for all tags in the file, including shadow tags
* Select any combination of tags to search for
* Shows results matching all tags (AND) and one or more tags (OR)
<<<
!! [[$:/ThirdParty/TiddlyTools/FilterGenerators/TagCloud]]
<<<
''Display tags using proportional size based on the number of tiddlers for each tag''
* Select tags to include
* Shows number of matching tiddlers on each tag "pill"
* Sort results by tag title or number of matching tiddlers
* options: min=minimum font size, step=font size increment, max=maximum font size, group=tag count cluster size
<<<
!! [[$:/ThirdParty/TiddlyTools/FilterGenerators/PowerSearch]]
<<<
''Assemble a compound filter to search for matching tiddlers''
<br>Requires: [[TiddlyTools/Macros/edit-list]]
* select types of tiddlers to search
* include/exclude prefixes, suffixes or tags
* find tiddlers that have a specific field (even if blank)
* search in one or more specified fields
* use flags to define the search criteria
* sort results by any tiddler field
* copy the assembled filter syntax to the clipboard
* save assembled filters for later re-use
* add/remove tags, clone/rename, export, or delete matching/selected tiddlers
<<<

View File

@@ -0,0 +1,419 @@
caption: PowerSearch
created: 20191212065707527
creator: EricShulman
modified: 20230109220559886
modifier: EricShulman
tags: $:/tags/AdvancedSearch TiddlyTools
title: $:/ThirdParty/TiddlyTools/FilterGenerators/PowerSearch
\define config() $:/config/TiddlyTools/PowerSearch
\define saved() $:/config/TiddlyTools/PowerSearch/SavedFilters/
\define show() $:/config/TiddlyTools/PowerSearch!!show
\define options() $:/state/popup/TiddlyTools/PowerSearch/options
\define menu() $:/state/popup/TiddlyTools/PowerSearch/menu/
\define default_width() 15em
\define default_columns() 1
\define default_height() auto
\define default_wrap() nowrap
\define styles()
<style>
.powersearch_table { border:0; padding:0; margin:0; float:left; margin-right:0.5em; }
.powersearch_table tr { border:0; padding:0; margin:0; }
.powersearch_table td { border:0; padding:2px; margin:0; }
.powersearch_table .editlist_input { outline:none; }
.powersearch_savedfilters { font-size:100%;line-height:1em;max-height:20em;overflow:auto; }
.powersearch_optionwidth { width:4em !important; }
.powersearch_checkboxwidth input { width:auto !important; }
.powersearch_listitem { overflow:hidden;word-break:break-all;text-overflow:ellipsis; }
.powersearch_modal .tc-modal-header { padding:0em 1em; }
.powersearch_modal .tc-modal-body { padding:1em 1em 0.5em 1em; }
.powersearch_modal .tc-modal-footer { padding:0.5em 1em; }
.powersearch_modal .tc-modal-body p { margin:0; }
</style>
\end
\define get(index,filter,placeholder,multiple)
\define filter() $filter$
<$macrocall $name="edit" tiddler=<<config>> index="$index$" filter=<<filter>> width="$(width)$"
confirm=<<confirm>> multiple="$multiple$" find="or" placeholder="$placeholder$"/>
\end
\define edit(tiddler,index,width,confirm,multiple,filter,find,placeholder)
\define filter() $filter$
\define stip() enter/select a value
\define mtip() enter/select all that apply (use ctrl-click or shift-click)
<$list filter="[[edit-list]is[variable]]" variable="if_edit_list_installed">
<$macrocall $name="edit-list" tiddler="$tiddler$" index="$index$" tooltip={{{ [[$multiple$]match[]then<stip>else<mtip>] }}}
width="$width$" listwidth="fit" fontsize="100%" focusPopup={{{ [<filter>!match[]then[yes]] }}}
confirm="$confirm$" multiple="$multiple$" filter=<<filter>> find="$find$" placeholder="$placeholder$"/>
</$list>
<$list filter="[[edit-list]!is[variable]]" variable="fallback_no_edit_list">
<style> .powersearch_inputwidth { width:$width$; } </style>
<span title={{{ [[$multiple$]match[]then<stip>else<mtip>search-replace[/select],[]search-replace[use ctrl-click or shift-click],[space separated]] }}}>
<$edit-text class="powersearch_inputwidth" tag="input"
tiddler="$tiddler$" field="text" index="$index$" default="" placeholder="$placeholder$"/>
</span>
</$list>
\end
\define shadowList(prefix: "$:/",maxdepth:"4")
\whitespace trim
<$list filter="[all[shadows]removeprefix[$prefix$]splitbefore[/]sort[]suffix[/]]" variable="chunk">
<$vars path={{{ [title[$prefix$]addsuffix<chunk>removesuffix[/]] }}}>
<$text text=<<path>>/>&#10;
<$list filter="[<path>split[/]count[]min[$maxdepth$]!match[$maxdepth$]]">
<$macrocall $name="shadowList" prefix={{{ [title[$prefix$]addsuffix<chunk>] }}}/>
</$list>
</$vars>
</$list>
\end
\define inputs()
<$set name="tidList" filter="tiddlers shadows tiddlers+shadows tags orphans missing">
<$set name="tagsList" filter="[tags[]sort[]] [all[shadows]tags[]sort[]]">
<$set name="sysFields" filter="title text tags created creator modified modifier">
<$set name="tidFields" filter="[all[tiddlers]] -[prefix[$:/state/popup]] +[fields[]!enlist<sysFields>sort[]]">
<$set name="shadowFields" filter="[all[shadows]fields[]!enlist<sysFields>!enlist<tidFields>sort[]]">
<$set name="fieldsList" filter="[enlist<sysFields>] [enlist<tidFields>] [enlist<shadowFields>]">
<$set name="searchList" filter="[enlist<sysFields>] [[*]] [enlist<fieldsList>!enlist<searchList>]">
<$set name="flagsList" filter="words literal whitespace regexp casesensitive anchored">
<$wikify name="shadowList" text=<<shadowList>>>
|powersearch_table|k
| search all|<<get "tids" "[enlist<tidList>]" "tiddlers">> |
| match prefix|<<get "prefix" "[enlist<shadowList>]" "(none)" >> |
| exclude prefix|<<get "notprefix" "[enlist<shadowList>]" "(none)" >> |
| match suffix|<<get "suffix" "[enlist<shadowList>]" "(none)" >> |
| exclude suffix|<<get "notsuffix" "[enlist<shadowList>]" "(none)" >> |
| match tag|<<get "tag" "[enlist<tagsList>]" "(none)" >> |
| exclude tag|<<get "nottag" "[enlist<tagsList>]" "(none)" >> |
| has field|<<get "has" "[enlist<fieldsList>]" "(none)" >> |
| search fields|<<get "field" "[enlist<searchList>]" "title,text,tags" "yes">> |
| using flags|<<get "flags" "[enlist<flagsList>]" "words" "yes">> |
| sort by|<<get "sort" "[enlist<fieldsList>]" "title" >> |
| match term|<<get "term" "" "(none)" >> |
| custom filter|<<get "custom" "" "(none)" >> |
\end
\define savedFilters()
<$vars lf="
">
<$list filter="[prefix<saved>limit[1]]">
<div style="white-space:nowrap;">
<$button class="tc-btn-invisible" tooltip="delete all saved filters"> {{$:/core/images/delete-button}}
<$action-confirm $message="Are you sure you want to delete all saved filters?">
<$action-deletetiddler $filter="[prefix<saved>]" />
</$action-confirm>
</$button>
''Saved filters:'' (<$count filter="[prefix<saved>]"/>)
<hr style="margin:1px 0;">
<div class="powersearch_savedfilters">
<$list filter="[prefix<saved>sort[]]" variable="item">
<$vars popid={{{ [<item>removeprefix<saved>addprefix<menu>addsuffix<qualify>] }}}>
<$vars desc={{{ [<item>get[description]] }}} filt={{{ [<item>get[filter]] }}} cust={{{ [<config>getindex[custom]addsuffix[ ]] }}}>
<$button class="tc-btn-invisible" popup=<<popid>>> {{$:/core/images/menu-button}}</$button>
<$reveal type="popup" state=<<popid>> class="tc-drop-down" style="min-width:auto;">
<$button class="tc-btn-invisible" style="display:block;padding:0 0.5em;" tooltip="delete this filter"> {{$:/core/images/delete-button}} delete this filter
<$action-confirm $message={{{ [<filt>] [<desc>] [[ ]] [[Are you sure you want to delete this filter?]] +[join<lf>] }}}>
<$action-deletetiddler $tiddler=<<item>> />
</$action-confirm>
</$button>
<$button class="tc-btn-invisible" style="display:block;padding:0 0.5em;" tooltip="edit this filter"> {{$:/core/images/edit-button}} edit this filter
<$action-sendmessage $message="tm-edit-tiddler" $param=<<item>> />
</$button>
<$button class="tc-btn-invisible" style="display:block;padding:0 0.5em;" tooltip="add to custom filter"> {{$:/core/images/new-button}} add to custom filter
<$action-setfield $tiddler=<<config>> $index="custom" $value={{{ [<cust>addsuffix<filt>trim[]] }}}/>
</$button>
<$button class="tc-btn-invisible" style="display:block;padding:0 0.5em;" tooltip="copy to clipboard"> {{$:/core/images/copy-clipboard}} copy to clipboard
<$action-sendmessage $message="tm-copy-to-clipboard" $param=<<filt>>/>
</$button>
</$reveal>
<$button class="tc-btn-invisible" tooltip="use this filter"> <$text text=<<desc>>/>
<$action-setfield $tiddler=<<config>> text={{{ [<item>get[text]] }}}/>
</$button>
</$vars>
</$vars>
<br>
</$list>
</div>
\end
\define preFilter() prefix[$(pre)$]
\define notpreFilter() !prefix[$(notpre)$]
\define suffFilter() suffix[$(suff)$]
\define notsuffFilter() !suffix[$(notsuff)$]
\define tagFilter() tag[$(tagval)$]
\define nottagFilter() !tag[$(nottag)$]
\define hasFilter() has:field[$(has)$]
\define searchFilter() search:$(field)$:$(flags)$[$(term)$]
\define filter() [all[$(tids)$]$(preFilter)$$(notpreFilter)$$(suffFilter)$$(notsuffFilter)$$(tagFilter)$$(nottagFilter)$$(hasFilter)$$(searchFilter)$sort[$(sort)$]] $(custom)$
\define filter_exclude() $(filter)$ -[prefix[$:/state/modal]] -[prefix[$:/state/popup]] -[prefix[$:/temp/PowerSearch]] -[prefix[$:/temp/edit-list]]
\define doSearch()
<$vars tids={{{ [<config>getindex[tids]] ~[[tiddlers]] }}}
pre={{{ [<config>getindex[prefix]] }}}
notpre={{{ [<config>getindex[notprefix]] }}}
suff={{{ [<config>getindex[suffix]] }}}
notsuff={{{ [<config>getindex[notsuffix]] }}}
tagval={{{ [<config>getindex[tag]] }}}
nottag={{{ [<config>getindex[nottag]] }}}
has={{{ [<config>getindex[has]] }}}
field={{{ [<config>getindex[field]enlist-input[]join[,]] ~[[title,text,tags]] }}}
flags={{{ [<config>getindex[flags]enlist-input[]join[,]] ~[[words]] }}}
sort={{{ [<config>getindex[sort]] ~[[title]] }}}
custom={{{ [<config>getindex[custom]] }}}
term={{{ [<config>getindex[term]] }}}>
<$vars preFilter={{{ [<pre>!is[blank]then<preFilter>] }}}
notpreFilter={{{ [<notpre>!is[blank]then<notpreFilter>] }}}
suffFilter={{{ [<suff>!is[blank]then<suffFilter>] }}}
notsuffFilter={{{ [<notsuff>!is[blank]then<notsuffFilter>] }}}
tagFilter={{{ [<tagval>!is[blank]then<tagFilter>] }}}
nottagFilter={{{ [<nottag>!is[blank]then<nottagFilter>] }}}
hasFilter={{{ [<has>!is[blank]then<hasFilter>] }}}
searchFilter={{{ [<term>!is[blank]then<searchFilter>] }}}>
<<doSearch_showresults>>
\end
\define doSearch_showresults()
<$vars count={{{ $(filter_exclude)$ +[count[]] }}}>
''<<count>> match<$list filter="[<count>!match[1]]">es</$list>'' &nbsp;
<<toggleList>> <<saveFilter>> <<clearAll>> <<setOptions>> &emsp;
<$vars height={{{ [<config>get[height]] ~[<default_height>] }}} cols={{{ [<config>get[cols]] ~[<default_columns>] }}} wrap={{{ [<config>get[wrap]] ~[<default_wrap>] }}}>
<$list filter="[<count>!match[0]]"> <<modal tag>> <<modal clone>> <<modal export>> <<modal delete>> &nbsp;</$list>
<$reveal state=<<show>> type="match" text="show" style="font-size:90%;line-height:1em;">
columns:
<$select tiddler=<<config>> field="cols" default=<<cols>>><option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option></$select>
<$checkbox tiddler=<<config>> field="wrap" checked="normal" unchecked="nowrap" default=<<wrap>> class="powersearch_checkboxwidth"> wrap </$checkbox>&nbsp;
</$reveal>
<$reveal state=<<show>> type="match" text="show"> <<doSearch_showlist>> </$reveal>
\end
\define doSearch_showlist()
<fieldset style="border-radius:0.5em;">
<legend>
<$button class="tc-btn-invisible" style="font-size:90%;text-align:left;word-break:break-all;"
message="tm-copy-to-clipboard" param=<<filter>> tooltip="Copy filter to clipboard">
''<$text text=<<filter>>/>'' {{$:/core/images/copy-clipboard}}
</$button>
</legend>
<div style="max-height:$(height)$;white-space:$(wrap)$;overflow:auto;font-size:80%;line-height:1em;">
<ol style="margin:0;column-gap:3em;column-count:$(cols)$;column-width:1em;">
<$list filter=<<filter_exclude>>>
<li><div class="powersearch_listitem" title=<<currentTiddler>>><$link/></div></li>
</$list>
</ol>
</div>
</fieldset>
\end
\define toggleList()
<$reveal state=<<show>> type="match" text="">
<$button tooltip="Show results"> {{$:/core/images/chevron-down}}
<$action-setfield $tiddler=<<config>> show="show" />
</$button>
</$reveal>
<$reveal state=<<show>> type="match" text="show">
<$button tooltip="Hide results"> {{$:/core/images/chevron-up}}
<$action-setfield $tiddler=<<config>> $field="show" />
</$button>
</$reveal>
\end
\define saveFilter()
<$vars target={{{ [<now YYYY0MM0DD0hh0mm0ss>addprefix<saved>] }}}>
<$button tooltip="Save current filter"> {{$:/core/images/save-button}}
<$action-setfield $tiddler=<<target>> type="application/json" text={{{ [<config>get[text]] }}}
filter={{{ [<filter>trim[]] }}} description={{{ [<filter>trim[]] }}} tags="$:/tags/Filter" />
</$button>
\end
\define clearAll()
<$tiddler tiddler=<<config>>>
<$button tooltip="Clear all inputs"> {{$:/core/images/close-button}}
<$list filter="tids prefix notprefix suffix notsuffix tag nottag has field term flags sort custom">
<$action-setfield $tiddler=<<config>> $index=<<currentTiddler>> />
</$list>
<$action-deletetiddler $filter="[prefix[$:/state/popup/edit-list/]]"/>
</$button>
\end
\define setOptions()
<$button popup=<<qualify $(options)$>> tooltip="Set display options">
{{$:/core/images/options-button}}
</$button>
<$reveal type="popup" state=<<qualify $(options)$>> position="below"
class="tc-drop-down tt-drop-down tc-popup-keep" style="min-width:auto;padding:0.5em;">
~PowerSearch options
<div class="tt-shadowbox inset" style="text-align:right;">
input width: <$edit-text tiddler=<<config>> field="width" class="powersearch_optionwidth" default="" placeholder=<<default_width>> /><br>
max height: <$edit-text tiddler=<<config>> field="height" class="powersearch_optionwidth" default="" placeholder=<<default_height>> /><br>
<center>
<$checkbox tiddler=<<config>> field="confirm" checked="yes" unchecked="" default="" class="powersearch_checkboxwidth"> confirm inputs </$checkbox>
</center>
</div>
</$reveal>
\end
\define modal(function)
\define select() $(filter_exclude)$ +[encodeuricomponent[]]
<$set name="selected" filter=<<select>>>
<$button message="tm-modal" param="$:/temp/PowerSearch" tooltip="$function$ tiddlers">
<$transclude tiddler="$:/core/images/$function$-button"/>
<$action-setfield $tiddler="$:/temp/PowerSearch" class="powersearch_modal tc-popup-handle"
subtitle=<<modal_title>> text=<<modal_text>> footer=<<modal_footer>>
function="$function$" list=<<selected>> wrap=<<wrap>> cols=<<cols>> nostamp={{$:/config/TimestampDisable}}/>
</$button>
\end
\define modal_title()
\import TiddlyTools/FilterGenerators/PowerSearch
\define filter() $(filter)$
<span style="float:right;font-size:80%;line-height:1em;margin-top:0.5em;">
columns:
<$select field="cols"><option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option></$select>
<$checkbox field="wrap" checked="normal" unchecked="nowrap" class="powersearch_checkboxwidth"> wrap </$checkbox>&emsp;
<$vars tv-config-toolbar-icons="yes" tv-config-toolbar-text="no">{{$:/core/ui/Buttons/timestamp}}</$vars>&emsp;
<<modal_cancel "{{$:/core/images/close-button}}">>
<<modal_ok "{{$:/core/images/done-button}}" >>
</span>
''<$text text={{{ [{!!function}addsuffix[ tiddlers]sentencecase[]] }}}/>:''
<div style="font-size:70%;line-height:1em;margin-bottom:0.5em;">''<$text text=<<filter>>/>''</div>
\end
\define modal_text()
\import TiddlyTools/FilterGenerators/PowerSearch
\define all() $(filter_exclude)$ +[encodeuricomponent[]]
<<styles>>
<div style={{{ [[max-height:calc(60vh - 5em);overflow:auto;font-size:80%;line-height:1em;margin-bottom:0.5em;white-space:]addsuffix{!!wrap}] }}}>
<ol style={{{ [[margin:0;column-gap:3em;column-width:1em;column-count:]addsuffix{!!cols}] }}}>
<$list filter=<<all>> variable="thisTiddler">
<li>
<div class="powersearch_listitem" title={{{ [<thisTiddler>decodeuricomponent[]] }}}>
<$list filter="[<currentTiddler>contains<thisTiddler>]">
<$eventcatcher $click='<$action-listops $subfilter="-[<thisTiddler>]"/>'>
<input type="checkbox" checked="checked"> <$text text={{{ [<thisTiddler>decodeuricomponent[]] }}}/>
</$eventcatcher>
</$list>
<$list filter="[<currentTiddler>!contains<thisTiddler>]">
<$eventcatcher $click='<$action-listops $subfilter="[<thisTiddler>]"/>'>
<input type="checkbox"> <$text text={{{ [<thisTiddler>decodeuricomponent[]] }}}/>
</$eventcatcher>
</$list>
</div>
</li>
</$list>
</ol>
</div>
<$vars count={{{ [<currentTiddler>get[list]enlist-input[]count[]] }}}>
<$list filter="[<count>match[0]]" variable="msg">''Select tiddlers you want to {{!!function}}''</$list>
<$list filter="[<count>!match[0]]" variable="msg">
''Are you sure you want to {{!!function}} <$list filter="[<count>!match[1]]" emptyMessage="this tiddler?">these <<count>> tiddlers?</$list>''
</$list>
\end
\define modal_footer()
\import TiddlyTools/FilterGenerators/PowerSearch
\define select() $(filter_exclude)$ +[encodeuricomponent[]]
<$set name="all" filter=<<select>>>
<div style="text-align:center;">
<div style="float:left;text-align:left;">
<$button>all <$action-setfield list=<<all>>/></$button>
<$button>none <$action-setfield list=""/></$button>
</div>
<div style="float:right;text-align:left;"><<modal_cancel>> <<modal_ok>></div>
<<modal_options>>
\end
\define modal_cancel(label:"cancel")
<$button message="tm-close-tiddler" tooltip="cancel" actions=<<modal_done>>> $label$ </$button>
\end
\define modal_ok(label:{{!!function}})
<$vars ok={{{ [{!!function}!match[tag]] [{$:/temp/PowerSearch/add}!is[blank]] [{$:/temp/PowerSearch/remove}!is[blank]] +[then{!!list}!match[]then[yes]] }}}>
<$list filter="[<ok>match[yes]]" emptyMessage="<$button> @@color:gray;fill:gray; $label$@@</$button>" variable="is_enabled">
<$button message="tm-close-tiddler" tooltip={{!!function}} actions=<<modal_done>>> $label$ <<modal_functions>> </$button>
</$list>
\end
\define modal_done()
<$list filter="[[$:/config/TimestampDisable]is[tiddler]]" variable="reset_timestamp_setting">
<$action-setfield $tiddler="$:/config/TimestampDisable" text={{!!nostamp}}/>
<$list filter="[{!!nostamp}match[]]"><$action-deletetiddler $tiddler="$:/config/TimestampDisable" /></$list>
</$list>
<$action-deletetiddler $filter="[prefix[$:/temp/PowerSearch]]" />
\end
\define modal_options()
\define taglist(tid,filter) <<edit tiddler:"$tid$" width:12em multiple:yes filter:"$filter$" placeholder:"enter/select tags">>
<div style="display:inline-block;">
<$list filter="[{!!function}match[tag]]" variable="function">
<nobr style="text-align:left;">''Add tags:'' <<taglist "$:/temp/PowerSearch/add" "[tags[]sort[]] [all[shadows]tags[]sort[]]">></nobr>
<nobr style="text-align:left;">''Remove tags:'' <<taglist "$:/temp/PowerSearch/remove" "[enlist{$:/temp/PowerSearch!!list}decodeuricomponent[]tags[]sort[]]">></nobr>
</$list>
<$list filter="[{!!function}match[clone]]" variable="function">
<nobr>''Replace'' <$edit-text tiddler="$:/temp/PowerSearch/from" tag="input" size="20" default="" placeholder=""/></nobr>
<nobr>''with'' <$edit-text tiddler="$:/temp/PowerSearch/to" tag="input" size="20" default="" placeholder=""/></nobr>
</$list>
<$list filter="[{!!function}match[export]]" variable="function">
''Filename/format'':
<$edit-text tiddler="$:/temp/PowerSearch/filename" tag="input" size="20" default=""
placeholder={{{ [{$:/temp/PowerSearch/format}suffix[TidFile]then[-- uses tiddler title --]else[tiddlers]] }}}
disabled={{{ [{$:/temp/PowerSearch/format}suffix[TidFile]then[yes]] }}}/>
<$select tiddler="$:/temp/PowerSearch/format" default="$:/core/templates/exporters/JsonFile">
<option value="$:/core/templates/exporters/CsvFile"> csv </option>
<option value="$:/core/templates/exporters/StaticRiver"> html</option>
<option value="$:/core/templates/exporters/JsonFile"> json</option>
<option value="$:/core/templates/exporters/TidFile"> tid </option>
</$select>
</$list>
<$list filter="[{!!function}match[delete]]" variable="function">
&nbsp; <!-- NO OPTIONS -->
</$list>
\end
\define modal_functions()
<$list filter="[{!!function}match[tag]]" variable="function">
<$list filter="[enlist{!!list}decodeuricomponent[]]">
<$action-listops $field="tags" $subfilter="+[append{$:/temp/PowerSearch/add}remove{$:/temp/PowerSearch/remove}]"/>
</$list>
</$list>
<$list filter="[{!!function}match[clone]]" variable="function">
<$list filter="[enlist{!!list}decodeuricomponent[]]">
<$vars newtitle={{{ [<currentTiddler>search-replace{$:/temp/PowerSearch/from},{$:/temp/PowerSearch/to}] }}}>
<$action-createtiddler $basetitle=<<newtitle>> $template=<<currentTiddler>> />
</$vars>
</$list>
</$list>
<$list filter="[{!!function}match[export]]" variable="function">
<$vars format={{{ [[$:/temp/PowerSearch/format]get[text]else[$:/core/templates/exporters/JsonFile]] }}}
filename={{{ [[$:/temp/PowerSearch/filename]get[text]else[tiddlers]] }}}>
<$vars ext={{{ [<format>get[extension]] }}}>
<$vars target={{{ [<ext>addprefix<filename>] }}}>
<$vars list="[enlist{$:/temp/PowerSearch!!list}decodeuricomponent[]]">
<$list filter="[<format>!suffix[TidFile]]">
<$action-sendmessage $message="tm-download-file" $param=<<format>>
exportFilter=<<list>> filename=<<target>> />
</$list>
<$list filter="[<format>suffix[TidFile]]">
<$list filter=<<list>>>
<$action-sendmessage $message="tm-download-file" $param=<<format>>
exportFilter=<<currentTiddler>> filename={{{ [<currentTiddler>addsuffix<ext>] }}} />
</$list>
</$list>
</$vars>
</$vars>
</$vars>
</$vars>
</$list>
<$list filter="[{!!function}match[delete]]" variable="function">
<$action-deletetiddler $filter="[enlist{!!list}decodeuricomponent[]]" />
</$list>
\end
<$vars width={{{ [<config>get[width]] ~[<default_width>] }}} confirm={{{ [<config>get[confirm]] }}}>
<<styles>> <<inputs>> <<savedFilters>>
</$vars>
<div style="clear:both;padding-top:0.5em;">
<<doSearch>>

View File

@@ -0,0 +1,98 @@
caption: TagCloud
created: 20191128174135234
modified: 20230109221623722
tags: TiddlyTools $:/tags/AdvancedSearch
title: $:/ThirdParty/TiddlyTools/FilterGenerators/TagCloud
\define config() $:/config/TiddlyTools/TagCloud
\define options() $:/state/popup/tagcloud
\define default_min() 0.75
\define default_step() 0.25
\define default_max() 4.00
\define default_group() 5
\define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions)
<!-- copied from $:/core/macros/tag - added font-size, margin-bottom and count display in pill -->
<$vars foregroundColor=<<contrastcolour target:"""$colour$""" fallbackTarget:"""$fallbackTarget$""" colourA:"""$colourA$""" colourB:"""$colourB$""">> backgroundColor="""$colour$""">
<div style="display:inline-block;font-size:$(size)$em;line-height:1em;margin-bottom:2px;">
<$element-tag$ $element-attributes$ class="tc-tag-label tc-btn-invisible" style=<<tag-pill-styles>>>
$actions$<$transclude tiddler="""$icon$"""/> <$view tiddler=<<__tag__>> field="title" format="text" /> (<<count>>)
</$element-tag$>
</div>
</$vars>
\end
\define tagcloud_select()
<$set name="taglist" filter="[all[tiddlers+shadows]tags[]sort[]]">
<div style="display:inline-block;float:left;margin-right:1em;margin-bottom:1em;">
Select tags:
<$button class="tc-btn-invisible">
<span style={{{ [<config>get[taglist]else[font-weight:bold;]] }}}>none</span>
<$action-setfield $tiddler=<<config>> taglist="" />
</$button> |
<$button class="tc-btn-invisible">
<span style={{{ [<config>get[taglist]match<taglist>then[font-weight:bold;]] }}}>all</span>
<$action-setfield $tiddler=<<config>> taglist=<<taglist>> />
</$button>
<<tagcloud_options>>
<div style="clear:both;">
<$select tiddler=<<config>> field="taglist" size=5 multiple>
<$list filter="[all[tiddlers+shadows]tags[]sort[]]"><option><<currentTiddler>></option></$list>
</$select>
\end
\define tagcloud_options()
<$let popid={{{ [<options>addsuffix<qualify>] }}}>
<$button class="tc-btn-invisible" style="float:right;" popup=<<popid>> tooltip="Set display options">
{{$:/core/images/options-button}}
</$button>
<$reveal type="popup" state=<<popid>> position="belowleft"
class="tc-drop-down tt-drop-down tc-popup-keep" style="min-width:auto;padding:0.5em;">
<span style="float:right;margin-left:1em;">
<$button class="tc-btn-invisible" style="display:inline;padding:0;width:auto;" tooltip="reset to defaults">{{$:/core/images/refresh-button}}
<$action-deletefield $tiddler=<<config>> min step max group/>
</$button>
<$button class="tc-btn-invisible" style="display:inline;padding:0;width:auto;" tooltip="close">{{$:/core/images/close-button}}
<$action-deletetiddler $tiddler=<<popid>>/>
</$button>
</span>
~TagCloud options
<div class="tt-shadowbox inset" style="clear:both;text-align:right;">
min size: <$edit-text tiddler=<<config>> field="min" class="option" default=<<default_min>> placeholder=<<default_min>> /><br>
step size: <$edit-text tiddler=<<config>> field="step" class="option" default=<<default_step>> placeholder=<<default_step>> /><br>
max size: <$edit-text tiddler=<<config>> field="max" class="option" default=<<default_max>> placeholder=<<default_max>> /><br>
group size: <$edit-text tiddler=<<config>> field="group" class="option" default=<<default_group>> placeholder=<<default_group>> /><br>
</div>
</$reveal>
\end
\define tagcloud_summary()
<br>
There are ''<$text text={{{ [enlist<taglist>count[]]" }}}/> selected tags''<br>
Tagging a total of ''<$text text={{{ [enlist<taglist>tagging[]count[]]" }}}/> tiddlers''<br>
Sort results by:
<$radio tiddler=<<config>> field="sortorder" value="count"> count </$radio>
<$radio tiddler=<<config>> field="sortorder" value="name"> name </$radio>
\end
\define tagcloud_show()
<p style="clear:both;">
<$let min={{{ [<config>get[min]] ~[<default_min>] }}}
step={{{ [<config>get[step]] ~[<default_step>] }}}
max={{{ [<config>get[max]] ~[<default_max>] }}}
group={{{ [<config>get[group]] ~[<default_group>] }}}>
<$set name="sub" filter="[<config>get[sortorder]] ~[[count]] +[match[count]]" value="[tagging[]count[]]" emptyValue="[get[title]]">
<$list filter="[enlist<taglist>!sortsub:integer<sub>]">
<$let count={{{ [<currentTiddler>tagging[]count[]] }}} size={{{ [<count>divide<group>trunc[]multiply<step>add<min>min<max>] }}}><<tag>></$let>
</$list>
\end
<style>
.tt-tagcloud input { width:auto !important; }
.tt-tagcloud input.option { width:3em !important; text-align:right; }
</style>
<div class="tt-tagcloud">
<<tagcloud_select>>
<$set name=taglist filter="[<config>get[taglist]enlist-input[]]">
<<tagcloud_summary>>
<<tagcloud_show>>

View File

@@ -0,0 +1,48 @@
caption: Tags
created: 20191118104819715
modified: 20230109220613590
tags: TiddlyTools $:/tags/AdvancedSearch
title: $:/ThirdParty/TiddlyTools/FilterGenerators/Tags
\define config() $:/config/TiddlyTools/FindTags
<style>
.tt-findTags input { width:auto !important; }
.tt-findTags .columns4 { display:block; column-count:4; column-gap:1em; }
.tt-findTags .small { font-size:80%; line-height:1.3em; }
.tt-findTags .nowrap { white-space:nowrap; }
</style>
<span class="tt-findTags">
find tiddlers tagged with:
<p class="columns4 small nowrap">
<$list filter="[all[tiddlers+shadows]tags[]sort[]]">
<$checkbox tiddler=<<config>> index=<<currentTiddler>> checked=" "
checkactions="""<$action-setfield $tiddler=<<config>> $index=<<currentTiddler>> $value=" " />"""
uncheckactions="""<$action-setfield $tiddler=<<config>> $index=<<currentTiddler>> />""">
<$text text=<<currentTiddler>>/>
</$checkbox><br>
</$list>
</p>
<$wikify name="filter" text="""[all[tiddlers+shadows]<$list filter="[title<config>indexes[]]">tag[<<currentTiddler>>]</$list>] +[sort[]]""">
<$list filter="[<config>indexes[]count[]] -[[0]]">
<$set name="filter_text" filter="[<config>indexes[]join[ AND ]]">
<$wikify name="filter_text" text=<<filter_text>>>
There are <$count filter=<<filter>>/> tiddlers tagged with <<filter_text>>
</$wikify>
</$set>
<blockquote class="columns4 small"> <$list filter=<<filter>>><$link/><br></$list> </blockquote>
</$list>
</$wikify>
<$wikify name="filter" text="""<$list filter="[title<config>indexes[]]">[all[tiddlers+shadows]tag[<<currentTiddler>>]] </$list> +[sort[]]""">
<$list filter="[<config>indexes[]count[]] -[[0]] -[[1]]">
<$set name="filter_text" filter="[<config>indexes[]join[ OR ]]">
<$wikify name="filter_text" text=<<filter_text>>>
There are <$count filter=<<filter>>/> tiddlers tagged with <<filter_text>>
</$wikify>
</$set>
<blockquote class="columns4 small"> <$list filter=<<filter>>><$link/><br></$list> </blockquote>
</$list>
</$wikify>

View File

@@ -0,0 +1,39 @@
caption: Titles
created: 20191126184117322
modified: 20230109220606965
tags: TiddlyTools $:/tags/AdvancedSearch
title: $:/ThirdParty/TiddlyTools/FilterGenerators/Titles
\define config() $:/config/TiddlyTools/FindTitles
<style>
.tt-findTitles input[type=text] { min-width:30vw; }
.tt-findTitles input[type=checkbox] { width:auto !important; }
.tt-findTitles .columns3 { display:block; column-count:3; column-gap:1em; }
.tt-findTitles .small { font-size:80%; line-height:1.3em; }
.tt-findTitles .nowrap { white-space:nowrap; }
</style>
<span class="tt-findTitles">
find titles containing:
<$edit-text tiddler=<<config>> index="text" tag="input" focus="yes"/><br>
in
<$checkbox tiddler=<<config>> index="tiddler" checked="is[tiddler]" unchecked=""> tiddlers </$checkbox>
<$checkbox tiddler=<<config>> index="shadow" checked="is[shadow]" unchecked=""> shadows </$checkbox>
<$checkbox tiddler=<<config>> index="system" checked="is[system]" unchecked=""> system </$checkbox>
<$checkbox tiddler=<<config>> index="tag" checked="is[tag]" unchecked=""> tags </$checkbox>
<$checkbox tiddler=<<config>> index="missing" checked="is[missing]" unchecked=""> missing </$checkbox>
<$checkbox tiddler=<<config>> index="orphan" checked="is[orphan]" unchecked=""> orphans </$checkbox>
<$checkbox tiddler=<<config>> index="image" checked="is[image]" unchecked=""> images </$checkbox>
<$checkbox tiddler=<<config>> index="binary" checked="is[binary]" unchecked=""> binaries </$checkbox>
<$tiddler tiddler=<<config>>>
<$wikify name="is" text="{{##tiddler}}{{##shadow}}{{##system}}{{##tag}}{{##missing}}{{##orphan}}{{##image}}{{##binary}}">
<$wikify name="filter" text="[<<is>>search:title[{{##text}}]sort[]]">
<$reveal default=<<is>> type="nomatch" text="">
<p/>
__There are <$count filter=<<filter>>/> tiddlers matching ''<$text text=<<filter>>/>''__
<blockquote class="columns3 small nowrap">
<$list filter=<<filter>>><$link/><br></$list>
</blockquote>
</$reveal>

View File

@@ -0,0 +1,454 @@
created: 20191214071309583
creator: EricShulman
modified: 20230109220547803
modifier: EricShulman
tags: $:/tags/Macro TiddlyTools
title: $:/ThirdParty/TiddlyTools/Macros/edit-list
\define edit-list(
id:"", tiddler:"", field:"text", index:"", timestamp:"yes",
default:"", placeholder:"", tooltip:"", type:"", width:"15em",
filter:"", find:"", goto:"no", confirm:"no", focus:"no",
focusPopup:"", cancelPopups:"no", listwidth:"100%", listheight:"10", stretch:"no",
show:"no", fontsize:"100%", colors:"no", multiple:"no", view:"<<item>>", mobile:"auto"
)
\whitespace trim
\define filter() $filter$
<!----------------->
<!-- ENVIRONMENT -->
<!----------------->
<$vars tid={{{ [[$tiddler$]!match[]else<currentTiddler>] }}} re="[^a-zA-Z0-9\-\_]">
<$vars id={{{ [[$index$]!match[]else[$field$]] +[addprefix[/]addprefix<tid>addsuffix[_$id$]] }}}>
<$vars id={{{ [<id>search-replace[$:/],[]search-replace:g:regexp<re>,[_]addsuffix<qualify>search-replace:g:[--],[-]search-replace:g:[__],[_]] }}}>
<$vars modal={{{ [[$:/state/modal/edit-list/]addsuffix<id>] }}}>
<$vars popup={{{ [[$:/state/popup/edit-list/]addsuffix<id>] }}}>
<$vars popup={{{ [<filter>!match[]] [[$type$]match[calendar]] +[limit[1]then[$show$]match[no]then<popup>] }}}>
<$vars minmax={{{ [[$:/state/popup/edit-list/minmax/]addsuffix<id>] }}}>
<!--------------->
<!-- VARIABLES -->
<!--------------->
<$vars
field={{{ [[$index$]match[]then[$field$]else[]] }}} index="""$index$""" timestamp="""$timestamp$""" goto_button={{{ [[$goto$]match[yes]] }}}
default="""$default$""" placeholder="""$placeholder$""" tooltip="""$tooltip$""" width={{{ [[$width$]match[auto]then[15em]else[$width$]] }}}
filter=<<filter>> find="""$find$""" confirm="""$confirm$""" listwidth={{{ [[$listwidth$]match[fit]then[auto]else[$listwidth$]] }}}
listheight="""$listheight$""" show="""$show$""" fontsize="""$fontsize$""" stretch={{{ [[$stretch$]match[yes]then[auto]else[$stretch$]] }}}
focus="""$focus$""" focusPopup={{{ [[$focusPopup$]!match[]then<popup>else[$focusPopup$]] }}} multiple={{{ [[$multiple$]match[yes]] }}}
calendar={{{ [[$type$]match[calendar]then[TiddlyTools/Time/Calendar]is[tiddler]then[yes]] }}}
type={{{ [[$type$]match[calendar]then[TiddlyTools/Time/Calendar]is[missing]then[date]else[$type$]] }}}
show={{{ [[$type$]match[calendar]then[TiddlyTools/Time/Calendar]is[missing]then[no]else[$show$]] }}}
>
<!------------------->
<!-- ABBREVIATIONS -->
<!------------------->
<$vars
openpopup="""
<$action-deletetiddler $filter="[prefix[$:/state/popup/edit-list/]] -[prefix[$:/state/popup/edit-list/currentitem/]] -[<minmax>]"/>
<$action-setfield $tiddler=<<popup>> text="show"/>"""
closepopup="""
<$action-deletetiddler $filter="[<popup>]"/>"""
gotoinput="""
<$action-sendmessage $message="tm-focus-selector" $param={{{ [[.editlist_input_]addsuffix<id>] }}}/>"""
gotoselect="""
<$action-sendmessage $message="tm-focus-selector" $param={{{ [[.editlist_popup_select_]addsuffix<id>] }}}/>"""
startmodal="""
<$list filter="[<confirm>match[yes]then<modal>!is[tiddler]]"><$action-setfield $tiddler=<<tid>> title=<<modal>>/>"""
maximize="""
<$action-setfield $tiddler=<<minmax>> hmax="yes" vmax="yes"/>"""
minimize="""
<$action-deletetiddler $filter="[<minmax>]"/>"""
input="""
<$eventcatcher $focusin="<$list filter='[<focusPopup>!match[]]'><<openpopup>></$list><<startmodal>>">
<$eventcatcher $focusout="<$list filter='[<modal>!is[tiddler]]'><<closepopup>></$list>">
<$edit-text tiddler={{{ [<modal>is[tiddler]else<tid>] }}} class={{{ [[tc-popup-handle editlist_input editlist_input_]addsuffix<id>] }}}
tag="input" type=<<type>> field=<<field>> index=<<index>> default=<<default>> placeholder=<<placeholder>> cancelPopups="$cancelPopups$"
focus={{{ [<modal>is[tiddler]then[yes]else<focus>] }}} focusPopup={{{ [[$focusPopup$]!match[yes]then[$focusPopup$]] }}}/>"""
select="""
<$eventcatcher $focusin="<<openpopup>><<startmodal>>">
<$eventcatcher $focusout="<$list filter='[<modal>!is[tiddler]]'><<closepopup>></$list>">
<$eventcatcher $click="<$list filter='[<modal>!is[tiddler]then<multiple>!match[yes]]'><<closepopup>><<goto>></$list>">
<<editlist_select_showheading>>
<$select tiddler={{{ [<modal>is[tiddler]else<tid>] }}} field=<<field>> index=<<index>> multiple=<<multiple>>
class={{{ [[editlist_select editlist_popup_select_]addsuffix<id>] }}} size={{{ [<minmax>get[vmax]match[yes]then[2]] ~[<listheight>regexp[^\d+$]!match[1]else[2]] }}}>
<<editlist_select_showlist>>"""
option="""
<$vars fg={{{ [enlist<dark>match<item>then[white;]else[black;]] }}}>
<$vars colors={{{ [[$colors$]match[yes]then[background-color:]addsuffix<item>addsuffix[;color:]addsuffix<fg>] }}}>
<option style=<<colors>> value=<<item>> title=<<item>>> $view$ </option>"""
dark="""
Black Blue DarkBlue DarkGreen DarkOliveGreen DarkSlateBlue DarkSlateGrey DimGrey ForestGreen Grey Indigo Maroon MediumBlue MidnightBlue Navy Purple"""
save="""
<$list filter="[<modal>is[tiddler]]">
<$vars newval={{{ [<modal>getindex<index>] ~[<modal>get<field>] }}}>
<$action-setfield $timestamp=<<timestamp>> $tiddler=<<tid>> $field=<<field>> $index=<<index>> $value=<<newval>>/>
<$list filter="[<newval>match[]]"><<clear>></$list>"""
clear="""
<$action-setfield $timestamp=<<timestamp>> $tiddler=<<tid>> $field=<<field>> $index=<<index>> $value=""/><!-- WFFL -->
<$action-deletetiddler $tiddler=<<currentitem>>/>
<<closepopup>><<gotoinput>>"""
done="""
<$action-deletetiddler $filter="[<modal>] [<popup>]"/>"""
goto="""
<$list filter="[[$goto$]match[yes]]">
<$vars tid={{{ [<modal>is[tiddler]else<tid>] }}}>
<$list filter="[<multiple>!match[yes]]"><$action-navigate $to={{{ [<tid>getindex<index>] ~[<tid>get<field>] }}}/></$list>
<$list filter="[<multiple>match[yes]]" ><$list filter="[<tid>getindex<index>] ~[<tid>get<field>] +[enlist-input[]]"><$action-navigate/></$list></$list>"""
reset="""
<$list filter="[<modifier>match[shift]]"><$action-setfield $timestamp=<<timestamp>> $tiddler=<<tid>> $field=<<field>> $index=<<index>>/></$list>
<$list filter="[<index>!match[]then<tid>get[text]match[{}]]">
<$action-setfield $timestamp=<<timestamp>> $tiddler=<<tid>> $field="text"/>
<$action-setfield $timestamp=<<timestamp>> $tiddler=<<tid>> $field="type"/>"""
>
<!-------------------->
<!-- MOBILE LISTBOX -->
<!-------------------->
<$vars
currentitem=
{{{ [[$:/state/popup/edit-list/currentitem/]addsuffix<id>] }}}
showitem="""
<$list filter='[<sel>!match[]]' emptyMessage="<input type=checkbox tabindex=-1/>"><input type=checkbox checked=yes tabindex=-1/></$list>
<$text text=$view$/>"""
toggleitem="""
<$list filter='[<multiple>!match[yes]]'><$action-setfield $tiddler=<<curr>> $field=<<field>> $index=<<index>> $value={{{ [<sel>match[]then<item>] }}}/></$list>
<$list filter='[<multiple>match[yes]]' ><$action-listops $tiddler=<<curr>> $field=<<field>> $index=<<index>> $subfilter='+[toggle<item>]' /></$list>"""
trackitem="""
<$action-setfield $tiddler=<<currentitem>> offset=<<i>> item=<<item>>/>"""
gotoitem="""
<$vars i={{{ [<currentitem>get[offset]else<i>] }}}>
<$vars i={{{ [<count>!match[]then<i>min<count>max[1]else<i>] }}}>
<$action-sendmessage $message="tm-focus-selector" $param={{{ [[.editlist_popup_select_]addsuffix<id>addsuffix[_]addsuffix<i>] }}}/>
<$action-deletetiddler $tiddler=<<currentitem>>/>"""
select_mobile="""
<$eventcatcher $focusin="<<openpopup>><<startmodal>>">
<$eventcatcher $focusout="<$list filter='[<modal>!is[tiddler]]'><<closepopup>></$list>">
<$eventcatcher $click="<$list filter='[<modal>!is[tiddler]then<multiple>!match[yes]]'><<closepopup>><<goto>></$list>">
<<editlist_select_showheading>>
<$vars listwidth={{{ [<listwidth>match[100%]then<width>else<listwidth>] }}}>
<$wikify name="fg" text=<<colour select-tag-foreground>>><$vars fg={{{ [<fg>!match[]then<fg>else[black;]] }}}>
<$wikify name="bg" text=<<colour select-tag-background>>><$vars bg={{{ [<bg>!match[]then<bg>else[white;]] }}}>
<$keyboard key="down" actions="<$vars i=1><<gotoitem>>">
<button class={{{ [[editlist_select editlist_popup_select_]addsuffix<id>] }}}
style={{{ [[border:1px solid gray;padding:0;white-space:nowrap;vertical-align:bottom;color:]addsuffix<fg>addsuffix[;background-color:]addsuffix<bg>] }}}>
<$vars curr={{{ [<modal>is[tiddler]else<tid>] }}}><$vars val={{{ [<curr>getindex<index>] ~[<curr>get<field>] }}}>
<<editlist_select_showlist>>"""
option_mobile="""
<$keyboard key="home" actions="<$vars i=1 ><<gotoitem>>">
<$keyboard key="up" actions="<$vars i={{{ [<i>subtract[1]] }}}><<gotoitem>>">
<$keyboard key="page_up" actions="<$vars i={{{ [<i>subtract<listheight>] }}}><<gotoitem>>">
<$keyboard key="page_down" actions="<$vars i={{{ [<i>add<listheight>] }}}><<gotoitem>>">
<$keyboard key="down" actions="<$vars i={{{ [<i>add[1]] }}}><<gotoitem>>">
<$keyboard key="end" actions="<$vars i=<<count>> ><<gotoitem>>">
<$vars fg={{{ [enlist<dark>match<item>then[white;]else[black;]] }}}>
<$vars colors={{{ [[$colors$]match[yes]then[background-color:]addsuffix<item>addsuffix[;color:]addsuffix<fg>] }}}>
<$vars sel={{{ [<multiple>!match[yes]then<val>match<item>] [<multiple>match[yes]then<val>enlist-input[]match<item>] }}}>
<$button class={{{ [[editlist_select editlist_popup_select_]addsuffix<id>addsuffix[_]addsuffix<i>] }}}
style=<<colors>> tooltip=<<item>> actions="<<toggleitem>><<trackitem>><<gotoselect>>"> <<showitem>>
</$button><br>"""
>
<!-- IF MOBILE, USE ALTERNATIVE select() AND option() -->
<$vars mobile_browsers="android ios windowsphone">
<$vars mobile={{{ [[$mobile$]regexp[yes|no]] ~[enlist<mobile_browsers>addprefix[$:/info/browser/is/]get[text]match[yes]] ~[[no]] }}}>
<$vars select={{{ [<mobile>!match[yes]then<select>else<select_mobile>] }}}>
<$vars option={{{ [<mobile>!match[yes]then<option>else<option_mobile>] }}}>
<!------------------------->
<!-- STYLES AND CONTROLS -->
<!------------------------->
<<editlist_styles>>
<div class={{{ [[editlist_wrapper editlist_wrapper_]addsuffix<id>] }}}
style={{{ [<show>match[no]then[margin-bottom:1em;]] [<filter>match[]then<calendar>!match[yes]then[margin-bottom:1em;]] }}}
title=<<tooltip>>>
<<editlist_input>>
<$list filter="[<calendar>match[]] "> <<editlist_select>> </$list>
<$list filter="[<calendar>!match[]]"> <<editlist_calendar>> </$list>
</div>
\end
\define editlist_styles()
<style>
.editlist_wrapper_$(id)$ { position:relative; display:inline-block; width:$(width)$; margin:0; }
.editlist_input_$(id)$ { position:absolute; width:100% !important; height:1.5em; }
.editlist_input_buttons_$(id)$ { position:absolute; width:max-content; right:0; }
.editlist_modal_buttons_$(id)$ { position:absolute; width:max-content; left:$(width)$; }
.editlist_clear { height:1.5em; width:1.5em; padding:0 0.25em 0 0.25em; vertical-align:text-bottom; }
.editlist_popup { height:1.5em; width:1.5em; padding:0 0.25em 0 0.25em; vertical-align:text-bottom; }
.editlist_save { height:1.5em; width:1.5em; padding:0 0.25em 0 0.25em; vertical-align:text-bottom; }
.editlist_cancel { height:1.5em; width:1.5em; padding:0 0.25em 0 0.30em; vertical-align:text-bottom; }
.editlist_popup_wrapper_$(id)$ { position:absolute; width:fit-content; min-width:$(listwidth)$; z-index:1; top:1.6em; }
.editlist_popup_heading_$(id)$ { position:relative; font-size:80%; line-height:1.2em; text-align:center; background:#eee; border:1px solid gray; border-bottom:0; }
.editlist_popup_minmax_$(id)$ { position:absolute; top:-1px; right:calc(-1.5em - 3px); padding-left:3px; transition:2s; }
.editlist_popup_minmax_$(id)$ button { display:block; font-size:100%; line-height:1em; padding:0 0.125em; margin-bottom:1px; }
.editlist_popup_select_$(id)$ { overflow-y:auto; font-size:$(fontsize)$; line-height:1em; }
.editlist_popup_select_$(id)$ option { overflow:hidden;text-overflow:ellipsis; }
.editlist_popup_select_$(id)$ button { width:100%; text-align:left; line-height:1.4em; padding:0 2px; border:0; background:none; overflow:hidden; text-overflow:ellipsis; }
.editlist_popup_select_$(id)$ input { width:auto; }
.editlist_calendar_wrapper { position:absolute; z-index:1; top:1.6em; }
.editlist_calendar { width:18.75em; padding:0.5em; }
.editlist_calendar_format { width:17.5em; }
.editlist_calendar.tc-block-dropdown a { padding-top:0; padding-bottom:0; }
.editlist_wrapper_$(id)$ .fadeIn { opacity:0; }
.editlist_wrapper_$(id)$:hover .fadeIn { opacity:1; }
.editlist_wrapper_$(id)$:focus-within .fadeIn { opacity:1; }
/* FALLBACK IF "FOCUS-WITHIN" NOT AVAILABLE... see https://www.caniuse.com/css-focus-within */
.editlist_input_$(id)$:focus + .editlist_input_buttons_$(id)$ .fadeIn { opacity:1; }
.editlist_clear:focus { opacity:1; }
.editlist_popup:focus { opacity:1; }
.editlist_clear:focus + editlist_popup { opacity:1; }
</style>
<$list filter="[<modal>is[tiddler]] [<popup>is[tiddler]] +[limit[1]]">
<style> .editlist_wrapper_$(id)$ .fadeIn { opacity:1; } </style>
</$list>
<$list filter="[<show>!match[no]]">
<style> .editlist_popup_wrapper_$(id)$ { position:static; margin-top:1.6em; } </style>
</$list>
<$list filter="[<stretch>!match[no]]">
<style> .editlist_wrapper_$(id)$:hover, .editlist_wrapper_$(id)$:focus-within { min-width:$(width)$; width:$(stretch)$ !important; } </style>
<style> .editlist_popup_select_$(id)$:hover, .editlist_popup_select_$(id)$:focus { min-width:$(width)$; width:$(stretch)$ !important; } </style>
</$list>
<$vars curr={{{ [<modal>is[tiddler]else<tid>] }}}>
<$vars val={{{ [<curr>getindex<index>] ~[<curr>get<field>] }}}>
<$vars bwidth={{{ [<val>!match[]then[1.5]] [<popup>!match[]then[1.50]] +[sum[]] }}}>
<$list filter="[<width>!match[100%]]"><<editlist_styles_setinputsize>></$list>
\end
\define editlist_styles_setinputsize()
<!-- MAKE ROOM FOR CLEAR AND/OR POPUP BUTTONS -->
<style>
.editlist_wrapper_$(id)$:hover .editlist_input_$(id)$ { width:calc(100% - $(bwidth)$em) !important; }
.editlist_wrapper_$(id)$:focus-within .editlist_input_$(id)$ { width:calc(100% - $(bwidth)$em) !important; }
</style>
<$list filter="[<modal>is[tiddler]] [<popup>is[tiddler]] +[limit[1]]">
<style> .editlist_input_$(id)$ { width:calc(100% - $(bwidth)$em) !important; } </style>
</$list>
\end
\define editlist_styles_setselectsize()
<!-- WIDTH: MATCH INPUT SIZE, LISTWIDTH PARAM, OR HMAX (AUTO) -->
<style>.editlist_popup_select_$(id)$ { min-width:$(width)$; width:$(listwidth)$; }</style>
<$list filter="[<minmax>get[hmax]]" ><style>.editlist_popup_select_$(id)$ { min-width:$(listwidth)$; width:auto; }</style></$list>
<$list filter="[<mobile>match[yes]]"><style>.editlist_popup_select_$(id)$ { min-width:100%; }</style></$list>
<!-- HEIGHT: USE SIZE, LISTHEIGHT (CSS UNITS), OR VMAX (COUNT) -->
<style>.editlist_popup_select_$(id)$ { height:calc($(size)$ * 1.4em + 0.25em); }</style>
<$list filter="[<listheight>!regexp[^\d+$]]"><style>.editlist_popup_select_$(id)$ { height:$(listheight)$; }</style></$list>
<$list filter="[<listheight>match[fit]] [<minmax>get[vmax]] +[limit[1]]">
<style>.editlist_popup_select_$(id)$ { height:calc($(count)$ * 1.4em + 0.25em); }</style>
<$list filter="[<mobile>match[yes]]"><style>.editlist_popup_select_$(id)$ { height:max-content; }</style></$list>
</$list>
\end
\define editlist_input()
\whitespace trim
<$keyboard key="enter" actions="<<save>><<goto>><<done>>">
<$keyboard key="escape" actions="<<done>>">
<$keyboard key="down" actions="<<openpopup>><<gotoselect>>">
<$keyboard key="up" actions="<<closepopup>><<gotoinput>>">
<<input>>
<span class="editlist_input_buttons_$(id)$"><<editlist_clear>><<editlist_popup>></span>
<span class="editlist_modal_buttons_$(id)$"><<editlist_save>><<editlist_cancel>></span>
\end
\define editlist_clear()
\whitespace trim
<!-- IF INDEX OR FIELD VALUE IS NOT BLANK, SHOW CLEAR BUTTON -->
<$vars tid={{{ [<modal>is[tiddler]else<tid>] }}}>
<$list filter="[<tid>getindex<index>] ~[<tid>get<field>] +[!match[]]" variable="show_clear">
<$eventcatcher $focusin="<$list filter='[<focusPopup>!match[]]'><<openpopup>></$list><<startmodal>>">
<$button class="tc-button editlist_clear fadeIn" tooltip="clear input" actions=<<reset>>>
<div style="transform:translateY(-0.1em);">''x''</div> <<clear>>
</$button>
\end
\define editlist_popup()
\whitespace trim
<!-- IF LIST OR CALENDAR NOT SHOWN, SHOW POPUP BUTTON -->
<$list filter="[<popup>!match[]]" variable="show_popup">
<$vars tip={{{ [<popup>is[missing]then[show ]else[hide ]] [<calendar>match[]then[list]else[calendar]] +[join[]] }}}>
<$eventcatcher $focusin=<<startmodal>>>
<$button class="tc-button editlist_popup fadeIn" tooltip=<<tip>> actions=<<gotoinput>>>
<$list filter="[<popup>is[missing]]" emptyMessage=<<closepopup>>><<openpopup>></$list>
<$list filter="[<calendar>match[]]"> <!-- DOWN OR UP TRIANGLE -->
<div style="font-size:80%;transform:translateY(-0.04em);">
<$list filter="[<popup>is[missing]]" emptyMessage="&#x25B2;">&#x25BC;</$list>
</div>
</$list>
<$list filter="[<calendar>!match[]]"> <!-- CALENDAR EMOJI -->
<span style="font-size:90%;margin-left:-0.2em;vertical-align:text-top;">&#x1F4C5;</span>
</$list>
</$button>
\end
\define editlist_save()
\whitespace trim
<!-- IF MODAL IS ACTIVE, SHOW SAVE BUTTON -->
<$list filter="[<modal>is[tiddler]]">
<$button class="tc-button editlist_save" tooltip="save" actions="<<reset>><<goto>>">
<div style="transform:translateY(-0.05em);">{{$:/core/images/done-button}}</div> <<save>><<done>>
</$button>
\end
\define editlist_cancel()
\whitespace trim
<!-- IF MODAL IS ACTIVE, SHOW CANCEL BUTTON -->
<$list filter="[<modal>is[tiddler]]">
<$button class="tc-button editlist_cancel" tooltip="cancel">
<div style="transform:translateY(-0.05em);">{{$:/core/images/cancel-button}}</div> <<done>>
</$button>
\end
\define editlist_select()
\whitespace trim
<!-- IF NOT FILTERING, DON'T SHOW LIST -->
<$list filter="[<filter>!match[]]" variable="show_select">
<!-- IF FIXED-HEIGHT, OR POPUP IS OPEN, SHOW LIST -->
<$list filter="[<show>!match[no]] [<popup>is[tiddler]] +[limit[1]]" variable="show_select">
<$keyboard key="enter" actions="<<save>><<goto>><<done>>">
<$keyboard key="escape" actions="<<done>>">
<$keyboard key="right" actions="<<maximize>>">
<$keyboard key="left" actions="<<minimize>>">
<$keyboard key="backspace" actions="<<closepopup>><<gotoinput>>">
<div class="editlist_popup_wrapper_$(id)$"><<select>></div>
\end
\define editlist_select_showheading()
\whitespace trim
$(editlist_select_search)$
<div class="editlist_popup_heading_$(id)$">
<$text text={{{ [<total>addsuffix[ items]] }}}/>
<$list filter="[<val>!match[]then<find>!match[]]">
<$list filter="[<found>match[0]] [<found>!match<selected>] +[limit[1]]"> ,&nbsp;<<found>>&nbsp;matches </$list>
</$list>
<$text text={{{ [<selected>!match[0]then[, ]addsuffix<selected>addsuffix[ selected]] }}}/>
<<editlist_select_minmax_goto>>
</div>
\end
\define editlist_select_showlist()
$(editlist_select_search)$
<<editlist_styles_setselectsize>>
<$list filter="[enlist<display>]" variable="item" counter="i"> <<option>> </$list>
\end
\define editlist_select_search()
<$set name="curr" filter="[<modal>is[tiddler]else<tid>]">
<$set name="exclude" filter="[<field>match[tags]then<curr>get[tags]enlist-input[]] :filter[tagging[]count[]match[1]]">
<$set name="all" filter="[subfilter<filter>] -[enlist<exclude>] -[prefix[$:/state/popup/edit-list]]">
<$set name="total" filter="[enlist<all>count[]]">
<$set name="case" filter="[enlist[OR AND EXACT REGEXP]match<find>]" value="casesensitive" emptyValue="">
<$set name="find" filter="[<find>lowercase[]]">
<$set name="find" filter="[enlist[or and exact regexp]match<find>]" value=<<find>> emptyValue="">
<$set name="match" filter="[<find>match[exact]]" value="literal" emptyValue="">
<$set name="regexp" filter="[<find>match[regexp]]" value="regexp" emptyValue="">
<$set name="flags" filter="[<match>!match[]] [<regexp>!match[]] [<case>!match[]] +[join[,]]">
<$set name="val" filter="[<curr>getindex<index>] ~[<curr>get<field>]" select=0>
<$wikify name="or" text=<<editlist_select_or>>>
<$wikify name="and" text=<<editlist_select_and>>>
<$vars selected={{{ [<multiple>match[yes]then<match>!match[exact]then<val>enlist-input[]] ~[<val>] :intersection[enlist<all>] +[count[]] }}}>
<$vars results={{{ [<find>match[or]then<or>] ~[<find>match[and]then<and>] ~[<find>match[exact]then<and>] ~[<find>match[regexp]then<and>] ~[<all>] +[trim[]] }}}>
<$vars found={{{ [enlist<results>count[]] }}}>
<$vars display={{{ [<found>match[0]then<all>] ~[<found>match<selected>then<all>] ~[<results>] }}}>
<$vars count={{{ [enlist<display>count[]] }}}>
<$vars size={{{ [<listheight>match[fit]then<total>] ~[<count>min<listheight>] +[max[1]] }}}>
\end
\define editlist_select_or() <$list filter="[enlist<val>sort[]]" variable="val"> <<editlist_select_and>> </$list>
\define editlist_select_and() <$list filter="[enlist<all>search:title:$(flags)$<val>]"> `[[`<<currentTiddler>>`]]`<br> </$list>
\define editlist_select_minmax_goto()
\whitespace trim
<$list filter="[<listheight>compare:integer:gt[1]] [<listheight>!regexp[^\d+$]] [<listheight>match[fit]]" +[limit[1]]><!-- not a dropdown -->
<div class="editlist_popup_minmax_$(id)$ fadeIn">
<$vars hmax={{{ [<minmax>get[hmax]] }}} vmax={{{ [<minmax>get[vmax]] }}}>
<$list filter="[<hmax>!match[]] ~[<listwidth>!match[auto]]">
<$button tooltip={{{ [<hmax>match[]then[fit width]else[restore width]] }}}>
<$list filter="[<hmax>match[]]" emptyMessage={{$:/core/images/chevron-left}}>{{$:/core/images/chevron-right}}</$list>
<$action-setfield $tiddler=<<minmax>> hmax={{{ [<hmax>match[]then[yes]else[]] }}} />
<$list filter="[<hmax>!match[]then<vmax>match[]]"><$action-deletetiddler $filter="[<minmax>]"/></$list>
<<gotoselect>>
</$button>
</$list>
<$list filter="[<vmax>!match[]] ~[<listheight>!regexp[^\d+$]] ~[<count>compare:integer:gt<listheight>] +[then<listheight>!match[fit]]">
<$button tooltip={{{ [<vmax>match[]then[fit height]else[restore height]] }}}>
<$list filter="[<vmax>match[]]" emptyMessage={{$:/core/images/chevron-up}}>{{$:/core/images/chevron-down}}</$list>
<$action-setfield $tiddler=<<minmax>> vmax={{{ [<vmax>match[]then[yes]else[]] }}} />
<$list filter="[<hmax>match[]then<vmax>!match[]]"><$action-deletetiddler $filter="[<minmax>]"/></$list>
<<gotoselect>>
</$button>
</$list>
<$vars curr={{{ [<modal>is[tiddler]else<tid>] }}}><$vars val={{{ [<curr>getindex<index>] ~[<curr>get<field>] }}}>
<$list filter="[<goto_button>match[yes]then<val>!match[]]">
<$button tooltip="view selected items"> {{$:/core/images/preview-open}} <<goto>></$button>
</$list>
\end
\define editlist_calendar()
<$importvariables filter="TiddlyTools/Time/Calendar">
<$vars showday_popup_extras=<<editlist_selectday>>>
<$vars target={{{ [<modal>is[tiddler]else<tid>] }}}>
<$vars config="$:/state/popup/calendar/config">
<$vars format="YYYY/0MM/0DD" month=<<now "[UTC]MM">> year=<<now "[UTC]YYYY">>>
<$list filter="[<config>]">
<$vars width={{{ [<stretch>match[auto]then<width>else<stretch>] }}}>
<!-- CONVERT WIDTH TO EMWIDTH -->
<$vars emwidth={{{ [<width>removesuffix[em]] }}}>
<$vars emwidth={{{ [<width>removesuffix[in]multiply[6.420]else<emwidth>] }}}> <!-- EMs per inch -->
<$vars emwidth={{{ [<width>removesuffix[cm]multiply[2.530]else<emwidth>] }}}> <!-- EMs per cm -->
<$vars emwidth={{{ [<width>removesuffix[mm]multiply[.2530]else<emwidth>] }}}> <!-- EMs per mm -->
<$vars emwidth={{{ [<width>removesuffix[px]multiply[0.066]else<emwidth>] }}}> <!-- EMs per pixel -->
<$vars emwidth={{{ [<width>removesuffix[pt]multiply[0.089]else<emwidth>] }}}> <!-- EMs per point -->
<!-- GET HEIGHT FROM DAYS PER MONTH -->
<$vars yyyy={{{ [<config>get[year]else<year>] }}} mm={{{ [<config>get[month]else<month>pad[2]] }}}>
<$vars date={{{ [<yyyy>addsuffix<mm>addsuffix[01]] }}}>
<$wikify name="first" text="""<$view tiddler=<<date>> field="title" format="date" template="[UTC]ddd" />""">
<$vars first={{{ [all[shadows]prefix[$:/language/Date/Short/Day/]get[text]allbefore<first>count[]] }}}>
<$vars dpm={{{ [<yyyy>remainder[4]match[0]then[31 29 31 30 31 30 31 31 30 31 30 31]else[31 28 31 30 31 30 31 31 30 31 30 31]] }}}>
<$vars dm={{{ [<dpm>split[ ]nth<mm>] }}}> <!-- days this month -->
<$vars rows={{{ [<first>subtract[1]add<dm>divide[7]add[1]trunc[]] }}}> <!-- rows this month -->
<$vars height={{{ [<rows>multiply[2.5]add[7.25]addsuffix[em]] }}}> <!-- rows + heading + format -->
<!-- SET SCALE AND SPACER -->
<$vars scale={{{ [<stretch>match[no]then[1]] ~[<emwidth>addsuffix[/18.75]] }}}> <!-- 18.75 = 7 days + borders + padding -->
<$vars spacer={{{ [<height>addsuffix[*]addsuffix<scale>] }}}>
<!-- SHOW POPUP OR INLINE CALENDAR -->
<$list filter="[<show>match[no]]" variable="show_popup_calendar">
<$reveal state=<<popup>> type="nomatch" text="" class="editlist_calendar_wrapper tc-popup-keep"><<editlist_calendar_show>></$reveal>
</$list>
<$list filter="[<show>!match[no]]" variable="show_inline_calendar">
<div style="margin-top:1.6em;"><<editlist_calendar_show>></div>
</$list>
\end
\define editlist_calendar_show()
\whitespace trim
<$eventcatcher events="focusin" actions-focusin="<$list filter='[<show>match[no]]'><<openpopup>></$list><<startmodal>>">
<div style="height:calc($(spacer)$);">
<div style="transform-origin:top left;transform:scale(calc($(scale)$));">
<div class="editlist_calendar tc-block-dropdown" style="margin:0;min-width:auto;">
<$macrocall $name="showmonth" yyyy={{{ [<config>get[year]else<year>] }}} mm={{{ [<config>get[month]else<month>] }}} view="edit" />
<div>
<$list filter="[<config>get[format]]">
<$button class="tc-btn-invisible" style="float:right;" tooltip="use default format">{{$:/core/images/close-button}}
<$action-deletefield $tiddler=<<config>> $field="format" />
</$button>
</$list>
format:<br/>
<$edit-text tag="input" class="editlist_calendar_format" tiddler=<<config>> field="format" default=<<format>> placeholder=<<format>> />
</div>
</div>
</div>
</div>
\end
\define editlist_selectday()
\whitespace trim
<!-- ADD CUSTOM CALENDAR SHOWDAY_POPUP_EXTRAS() MACRO WITH SIMPLE "SELECTDAY" BUTTON -->
<$vars UTC="[UTC]" time=<<now "0hh0mm0ss0XXX">>>
<$vars template={{{ [<config>get[format]else<format>addprefix<UTC>] }}}>
<$vars value={{{ [<date>addsuffix<time>format:date<template>] }}}>
<$button class="tc-button tt-button" style="text-align:center;width:100%;margin:0.25em 0;"> ''select this date''
<$action-setfield $timestamp=<<timestamp>> $tiddler=<<target>> $field=<<field>> $index=<<index>> $value=<<value>> />
<$action-deletetiddler $filter="[<calendar_popID>]" />
<$list filter='[<confirm>!match[yes]]'><<closepopup>></$list>
</$button>
\end
| author|''[ext[Eric Shulman|mailto:elsdesign@gmail.com]]''|
| source|''http://TiddlyTools.com/edit-list.html''|
| updated|''<$view field="modified" format="date" template="DDD, MMM DDth YYYY at 0hh12:0mm:0ssam"/>''|
<pre style="font-size:80%;line-height:1em;"><$text text={{TiddlyTools/Macros/edit-list}}/></pre>