mirror of
https://gitlab.com/octtspacc/OcttKB
synced 2025-06-06 00:29:12 +02:00
OcttKB Cross-Repo Sync (HTML to Raw)
This commit is contained in:
26
Wiki-OcttKB/plugins/commander/$__Commander.tid
Normal file
26
Wiki-OcttKB/plugins/commander/$__Commander.tid
Normal file
@ -0,0 +1,26 @@
|
||||
icon: $:/plugins/kookma/commander/images/commander.svg
|
||||
title: $:/Commander
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\import [all[shadows+tiddlers]tag[$:/tags/Commander/Macro]]
|
||||
{{$:/plugins/kookma/commander/search/ui}}
|
||||
<!-- Create the search filter based on searchbox and selective operation (if active) -->
|
||||
<$vars searchTerms={{{ [<searchboxTid>get[text]minlength{$:/plugins/kookma/commander/config/minlength}]~[[$:/errorCode:-23500]] }}} pattern="^\["><!-- this part checks the combo search and selective ops-->
|
||||
<$set name="filtertext" filter="[<searchTerms>regexp<pattern>]" value="[subfilter<searchTerms>]" emptyValue="[!is[system]search<searchTerms>]">
|
||||
<$set name="searchfilter" filter="[<selectiveOpsTid>get[text]match[yes]]"
|
||||
value="[subfilter<filtertext>!prefix[$:/temp/commander]]+[tag<workingTag>]" emptyValue="[subfilter<filtertext>!prefix[$:/temp/commander]]" >
|
||||
<small style="margin-left:17ch;"><i><$count filter="[subfilter<filtertext>!prefix[$:/temp/commander]!is[missing]]" /> matches </i></small>
|
||||
|
||||
<!-- Display search results and let selective operation -->
|
||||
<<commander-slider title:"$:/plugins/kookma/commander/search/selection" default:"open">>
|
||||
|
||||
<!-- Display operation UIs-->
|
||||
<<tabs "[all[shadows+tiddlers]tag[$:/tags/Commander]!has[draft.of]]" default:"$:/plugins/kookma/commander/tiddler/ui">>
|
||||
|
||||
</$set>
|
||||
</$set>
|
||||
<$vars>
|
||||
|
||||
---
|
||||
|
||||
<<commander-slider title:"$:/plugins/kookma/commander/log/ui">>
|
@ -0,0 +1,5 @@
|
||||
tags:
|
||||
title: $:/language/Buttons/Commander/Caption
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
commander
|
@ -0,0 +1,5 @@
|
||||
tags:
|
||||
title: $:/language/Buttons/Commander/Hint
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Tiddler Commander
|
@ -0,0 +1,22 @@
|
||||
caption: {{$:/plugins/kookma/commander/images/file-alt}} {{$:/language/Buttons/Commander/Caption}}
|
||||
description: Open tiddler commander
|
||||
list-after: $:/core/ui/Buttons/advanced-search
|
||||
tags: $:/tags/PageControls
|
||||
title: $:/plugins/kookma/commander/buttons/pagecontrol
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\whitespace trim
|
||||
\define commander-button(class)
|
||||
<$button to="$:/Commander" tooltip={{$:/language/Buttons/Commander/Hint}} aria-label={{$:/language/Buttons/Commander/Caption}} class="""$(tv-config-toolbar-class)$ $class$""">
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/plugins/kookma/commander/images/commander.svg}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$:/language/Buttons/Commander/Caption}}/></span>
|
||||
</$list>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
<$list filter="[list[$:/StoryList]] +[field:title[$:/Commander]]" emptyMessage=<<commander-button>>>
|
||||
<<commander-button "tc-selected">>
|
||||
</$list>
|
@ -0,0 +1,5 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/config/AutoFocus
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
yes
|
@ -0,0 +1,5 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/config/commonfields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
created creator modified modifier revision bag
|
@ -0,0 +1,5 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/config/minlength
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
3
|
@ -0,0 +1,10 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/config/relink
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define relink-plugin-notExisted() Update title in //tags// and //list// fields of other tiddlers
|
||||
<$checkbox tiddler="$:/config/RelinkOnRename" field="text" checked="yes" unchecked="no" default="no">
|
||||
<$list filter="[[$:/plugins/flibbles/relink]] +[has[title]]" emptyMessage=<<relink-plugin-notExisted>> >
|
||||
Use //Relink// to update title across all other tiddlers
|
||||
</$list>
|
||||
</$checkbox>
|
@ -0,0 +1,8 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/config/systemfields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
title text tags
|
||||
created modified craetor modifier
|
||||
type bag revision
|
||||
list caption
|
@ -0,0 +1,23 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/field/macros/add
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define add-new-field-bulk(datafieldsTid:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<<create-log-tiddler "add-new-field-bulk">>
|
||||
<$vars datafieldsTid=<<__datafieldsTid__>> >
|
||||
<$list filter="[subfilter<searchfilter>]" variable="newTitle">
|
||||
<<add-bulk-fields>>
|
||||
<$wikify name=newFields text=<<getFieldsname>> >
|
||||
<$macrocall $name="log-add-single-operation" msg={{{[<newFields>addprefix[new fields:]addsuffix[added]]}}} tidItem=<<newTitle>> />
|
||||
</$wikify>
|
||||
</$list>
|
||||
</$vars>
|
||||
</$list>
|
||||
\end
|
||||
<!-- from TiddlyWiki 5.2.0, field name with mixed case is allowed -->
|
||||
\define getFieldsname()
|
||||
<$list filter="[<__datafieldsTid__>indexes[]prefix[fldn]]" variable=item>
|
||||
{{{ [<__datafieldsTid__>getindex<item>trim[]] }}}
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,69 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/field/macros/bulkfields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define numfilter() [range[1,$(flt)$]]
|
||||
\define id_fldName() fldn$(cnt)$
|
||||
\define id_fldValue() fldv$(cnt)$
|
||||
|
||||
<!-- from TiddlyWiki 5.2.0, field name with mixed case is allowed -->
|
||||
\define add-bulk-fields()
|
||||
<$set name="flt" tiddler=<<datafieldsTid>> field="counter" emptyValue="1"><!-- when the datafieldsTid is not exist, there is at least one field row -->
|
||||
<$list filter=<<numfilter>> variable="cnt">
|
||||
<$list filter="[<datafieldsTid>getindex<id_fldName>]" variable="newField">
|
||||
<$action-setfield $tiddler=<<newTitle>>
|
||||
$field={{{ [<newField>trim[]] }}}
|
||||
$value={{{ [<datafieldsTid>getindex<id_fldValue>] }}} />
|
||||
</$list>
|
||||
</$list>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\define getInputs()
|
||||
<$edit-text tiddler=<<datafieldsTid>> index=<<id_fldName>> tag=input default="" placeholder="field name" />
|
||||
<$edit-text tiddler=<<datafieldsTid>> index=<<id_fldValue>> tag=input default="" placeholder="field value"/>
|
||||
\end
|
||||
|
||||
\define add-reset()
|
||||
<$button>insert
|
||||
<$action-setfield $tiddler=<<datafieldsTid>> counter={{{[<datafieldsTid>get[counter]add[1]]~[[2]]}}}/>
|
||||
</$button>
|
||||
<$button>reset
|
||||
<$action-setfield $tiddler=<<datafieldsTid>> counter="1"/>
|
||||
<$action-setfield $tiddler=<<datafieldsTid>> text=""/>
|
||||
</$button>
|
||||
\end
|
||||
|
||||
\define create-field-inputbox()
|
||||
<$wikify name=flt text={{{ [<datafieldsTid>get[counter]]~[[1]] }}} >
|
||||
<$list filter=<<numfilter>> variable=cnt>
|
||||
|
||||
<<getInputs>>
|
||||
</$list>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define add-more-fields-ui(datafieldsTid:"")
|
||||
<$vars datafieldsTid=<<__datafieldsTid__>> >
|
||||
<<add-reset>>
|
||||
<<create-field-inputbox>>
|
||||
</$vars>
|
||||
\end
|
||||
|
||||
\define add-more-fields-selective-ui(datafieldsTid:"", stateTiddler:"$:/state/commander/tiddler-addfields-status")
|
||||
<$checkbox
|
||||
tiddler=<<__stateTiddler__>>
|
||||
field="text"
|
||||
checked="addfields" unchecked="nofields"
|
||||
default="nofields" >
|
||||
Add fields
|
||||
</$checkbox>
|
||||
<$reveal type="match" state=<<__stateTiddler__>> text="addfields" default="nofields" >
|
||||
<$vars datafieldsTid=<<__datafieldsTid__>> >
|
||||
<<add-reset>>
|
||||
<div style="padding-left:88px;">
|
||||
<<create-field-inputbox>>
|
||||
</div>
|
||||
</$vars>
|
||||
</$reveal>
|
||||
\end
|
@ -0,0 +1,35 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/field/macros/remove
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define remove-old-field-bulk(oldField:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<$list filter="[<__oldField__>!is[blank]]">
|
||||
<<create-log-tiddler "remove-old-field-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>]+[!is[missing]]+[has:field[$oldField$]]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-remove-field" $param=<<__oldField__>> />
|
||||
</$fieldmangler>
|
||||
<$macrocall $name="log-add-single-operation" msg="""old field `$oldField$` removed""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define set-field-value-bulk(fieldName:"Empty", fieldValue:"Empty")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<$list filter="[<__fieldName__>!is[blank]]" variable=null>
|
||||
<$list filter="[<__fieldValue__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "set-field-value-create-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>]-[$fieldName$[$fieldValue$]]">
|
||||
<$list filter="[<currentTiddler>has:field[$fieldName$]]" variable=ignore
|
||||
emptyMessage="""<$macrocall $name="log-add-single-operation" msg="//has not `$fieldName$` field. Operation ignored//" tidItem=<<currentTiddler>> />""" >
|
||||
<$action-setfield $field=<<__fieldName__>> $value=<<__fieldValue__>> />
|
||||
<$macrocall $name="log-add-single-operation" msg="""field `$fieldName$` got a value""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
@ -0,0 +1,23 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/field/macros/rename
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define rename-field-bulk(oldField:"", newField:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore>
|
||||
<$list filter="[<__oldField__>!is[blank]]" variable=null>
|
||||
<$list filter="[<__newField__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "rename-field-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>]">
|
||||
<$list filter="[<currentTiddler>has:field[$oldField$]]" variable=ignore
|
||||
emptyMessage="""<$macrocall $name="log-add-single-operation" msg="//has not field `$oldField$`. Operation ignored.//" tidItem=<<currentTiddler>> /> """>
|
||||
<$set name=oldValue tiddler=<<currentTiddler>> field=<<__oldField__>> >
|
||||
<$action-setfield $tiddler=<<currentTiddler>> $field=<<__newField__>> $value=<<oldValue>>/>
|
||||
</$set>
|
||||
<$action-deletefield $tiddler=<<currentTiddler>> $field=<<__oldField__>> />
|
||||
<$macrocall $name="log-add-single-operation" msg="""fied `$oldField$` renamed to `$newField$`""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,21 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/field/macros/set
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define set-field-value-bulk(fieldName:"", fieldValue:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<$list filter="[<__fieldName__>!is[blank]]" variable=null>
|
||||
<$list filter="[<__fieldValue__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "set-field-value-create-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>]-[$fieldName$[$fieldValue$]]">
|
||||
<$list filter="[<currentTiddler>has:field[$fieldName$]]" variable=ignore
|
||||
emptyMessage="""<$macrocall $name="log-add-single-operation" msg="//has not `$fieldName$` field. Operation ignored//" tidItem=<<currentTiddler>> />""" >
|
||||
<$action-setfield $field=<<__fieldName__>> $value=<<__fieldValue__>> />
|
||||
<$macrocall $name="log-add-single-operation" msg="""field `$fieldName$` got a value""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
@ -0,0 +1,12 @@
|
||||
caption: Field
|
||||
list-after: $:/plugins/kookma/commander/tag/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/field/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/FieldOps]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/field/uicomp/add-fields"
|
||||
class:"tc-vertical cmd-tab-colorful cmd-tab-wd"
|
||||
>>
|
||||
|
@ -0,0 +1,15 @@
|
||||
caption: Add fields
|
||||
tags: $:/tags/Commander/FieldOps
|
||||
title: $:/plugins/kookma/commander/field/uicomp/add-fields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<!-- create the interface-->
|
||||
<$macrocall $name="add-more-fields-ui" datafieldsTid="$:/temp/commander/tiddler/datafields/addfield" />
|
||||
|
||||
|
||||
<!-- call action macro -->
|
||||
<$button class="cmd-btn cmd-btn-wd"> Add new fields
|
||||
<$macrocall $name="add-new-field-bulk"
|
||||
datafieldsTid="$:/temp/commander/tiddler/datafields/addfield" />
|
||||
</$button><br>
|
||||
,,Note: This will overwrite the existing fileds!,,
|
@ -0,0 +1,14 @@
|
||||
caption: Remove fields
|
||||
list-after: $:/plugins/kookma/commander/field/uicomp/add-fields
|
||||
tags: $:/tags/Commander/FieldOps
|
||||
title: $:/plugins/kookma/commander/field/uicomp/remove-fields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<label class="kk-cmd-label">Old field</label><$select class="cmd-select-wd" tiddler="$:/temp/commander/field-remove" default="">
|
||||
<$list filter="[subfilter<searchfilter>fields[]sort[]] -title -tags" >
|
||||
<option><$view field="title"/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Remove old field
|
||||
<$macrocall $name="remove-old-field-bulk" oldField={{$:/temp/commander/field-remove}} />
|
||||
</$button>
|
@ -0,0 +1,28 @@
|
||||
caption: Rename fields
|
||||
list-after: $:/plugins/kookma/commander/field/uicomp/remove-fields
|
||||
tags: $:/tags/Commander/FieldOps
|
||||
title: $:/plugins/kookma/commander/field/uicomp/rename-fields
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<label class="kk-cmd-label">Old field</label><$select class="cmd-select-wd"
|
||||
tiddler="$:/temp/commander/rename-field/old" default="" >
|
||||
<$list filter="[subfilter<searchfilter>fields[]sort[]] -[<systemFieldsTid>get[text]split[ ]]" >
|
||||
<option><$view field="title"/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
||||
<label class="kk-cmd-label">New field</label><$edit-text
|
||||
tiddler="$:/temp/commander/rename-field/new"
|
||||
tag="input"
|
||||
default=""
|
||||
class="cmd-txt-area"
|
||||
placeholder=" new field name"
|
||||
/>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Rename field
|
||||
<$macrocall $name="rename-field-bulk"
|
||||
oldField={{$:/temp/commander/rename-field/old}}
|
||||
newField={{{ [[$:/temp/commander/rename-field/new]get[text]lowercase[]trim[]split[ ]join[_]] }}} />
|
||||
</$button>
|
||||
|
||||
<!-- new field name is checked to be lowecase and leading and trailing spaces are removed and space between words replaced by underscore (_).
|
||||
-->
|
@ -0,0 +1,24 @@
|
||||
caption: Set field value
|
||||
list-after: $:/plugins/kookma/commander/field/uicomp/rename-fields
|
||||
tags: $:/tags/Commander/FieldOps
|
||||
title: $:/plugins/kookma/commander/field/uicomp/set-field-value
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<label class="kk-cmd-label">Field name</label><$select class="cmd-select-wd"
|
||||
tiddler="$:/temp/commander/field-name" default="" >
|
||||
<$list filter="[subfilter<searchfilter>fields[]sort[]] -[<systemFieldsTid>get[text]split[ ]]" >
|
||||
<option><$view field="title"/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
||||
<label class="kk-cmd-label">Field value</label><$edit-text
|
||||
tiddler="$:/temp/commander/field-value"
|
||||
tag="input" default=""
|
||||
class="cmd-txt-area" placeholder=" field value"/>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Set field value
|
||||
<$macrocall
|
||||
$name="set-field-value-bulk"
|
||||
fieldName={{$:/temp/commander/field-name}}
|
||||
fieldValue={{$:/temp/commander/field-value}}
|
||||
/>
|
||||
</$button>
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/Drafts}}
|
||||
filter: [has[draft.of]sort[title]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/Drafts
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/Missing}}
|
||||
filter: [all[missing]sort[title]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/Missing
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/Orphans}}
|
||||
filter: [all[orphans]sort[title]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/Orphans
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/RecentSystemTiddlers}}
|
||||
filter: [has[modified]!sort[modified]limit[50]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/RecentSystemTiddlers
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/RecentTiddlers}}
|
||||
filter: [!is[system]has[modified]!sort[modified]limit[50]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/RecentTiddlers
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: Tiddlers modified since the wiki was loaded
|
||||
filter: [haschanged[]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/SessionTiddlers
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: {{$:/language/Filters/StoryList}}
|
||||
filter: [list[$:/StoryList]] -$:/AdvancedSearch
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/StoryList
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: General filter
|
||||
filter: [all[shadows+tiddlers]search[your keywrods]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/geneal
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,5 @@
|
||||
description: Temporary and state tiddlers
|
||||
filter: [prefix[$:/temp]] [prefix[$:/state]]
|
||||
tags: $:/tags/Commander/Filter
|
||||
title: $:/plugins/kookma/commander/filters/temp-and-state
|
||||
type: text/vnd.tiddlywiki
|
@ -0,0 +1,13 @@
|
||||
caption: Help
|
||||
icon: $:/core/images/help
|
||||
list-after: $:/plugins/kookma/commander/setting/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/help/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/Help]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/help/uicomp/quick-tutorial"
|
||||
class:"tc-vertical cmd-tab-colorful cmd-tab-wd">>
|
||||
|
||||
|
@ -0,0 +1,30 @@
|
||||
caption: Quick tutorial
|
||||
tags: $:/tags/Commander/Help
|
||||
title: $:/plugins/kookma/commander/help/uicomp/quick-tutorial
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
# Use ''Combo search'' to list possible tiddlers
|
||||
#* example: `concept` performs a standard search and find all matches in title, text, and tags
|
||||
#* example: `[tag[xx]]` finds all tiddlers tagged with //xx//
|
||||
#* example: `[prefix[tt]` finds all tiddlers have title started with //tt//
|
||||
#* example: `[has[draft.of]sort[title]]` finds all draft tiddlers
|
||||
|
||||
# Use ''Select tiddlers'' for the resulting list to identify which specific tiddlers to do a batch operation on
|
||||
#* this step lets you to do a batch operation on selected tiddlers NOT all items by ''Combo search''!
|
||||
#* it is possible to select/deselect all tiddlers from ''Combo search'' result at once! Note that, by default all tiddlers are considered for bulk operation until selective operation is activated!
|
||||
# From ''Batch operations tabs'' select the batch operation you wish to perform on selected tiddlers
|
||||
#* example: title, tag, and field operations
|
||||
#* example: Snr operation
|
||||
#* Inspect tab can be used to inspect tiddlers before or after performing operations
|
||||
|
||||
* Notes:
|
||||
** Multiple batch operations can be done on the same set (unless you change something in the search criteria)
|
||||
** Sometimes it is useful to use an intermediate batch to help, like tag tiddlers with a "working" tag, using multiple searches, then then use the "working" tag to apply a batch operation to
|
||||
|
||||
<div class="commander-alert">''Note'': For good operation a tiddler width of 800px is recommended. You can also use //Sidebar layout// as `Fluid story`.</div>
|
||||
|
||||
|
||||
For detailed docummention go to [[Demo page|https://kookma.github.io/TW-Commander/]]
|
||||
|
||||
!!! Footenote
|
||||
# [[Use filter expression|https://tiddlywiki.com/prerelease/#Filters:Filters%20%5B%5BFilter%20Expression%5D%5D%20%5B%5BFilter%20Syntax%5D%5D%20%5B%5BFilter%20Operators%5D%5D%20%5B%5BFilter%20Parameter%5D%5D%20%5B%5BFilter%20Run%5D%5D%20%5B%5BFilter%20Step%5D%5D%20%5B%5BFilter%20Whitespace%5D%5D]]
|
@ -0,0 +1,53 @@
|
||||
caption: Regular expressions
|
||||
list-after: $:/plugins/kookma/commander/help/uicomp/snr
|
||||
tags: $:/tags/Commander/Help
|
||||
title: $:/plugins/kookma/commander/help/uicomp/regular-expression
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
!! Regular Expressions Quick Reference
|
||||
|
||||
|''FLAGS'' |<|<|h
|
||||
| i |ignore case|case insensitive matching|
|
||||
| |whole words|match strings of a-z, 0-9 and _|
|
||||
| g |global|field start=^, field end=$, all matches|
|
||||
| m |multi-line|line start=^, line end=$, first match|
|
||||
| |first match|field start=^, field end=$, first match|
|
||||
|''MATCH'' |<|<|h
|
||||
|''Anchors''|<|<|
|
||||
| ^ |start of scope|see Flags, match is zero length|
|
||||
| $ |end of scope|see Flags, match is zero length|
|
||||
| \b |word boundary|anchor to edge of word, zero length|
|
||||
| \B |not word boundary|anchor inside word, zero length|
|
||||
|''Character Classes''|<|<|
|
||||
| [c] |class of characters|any one matches, e.g. [abc123]|
|
||||
| [^c] |negated class of characters|any one doesn't match, e.g. [^abc123]|
|
||||
|''Shorthand Character Classes''|<|<|
|
||||
| . |any character except newline|same as [^\n]|
|
||||
| \d |decimal|same as [0-9]|
|
||||
| \D |not decimal|same as [^0-9]|
|
||||
| \s |white-space|same as [\ \t\n]|
|
||||
| \S |not white-space|same as [^\ \t\n]|
|
||||
| \t |tab|same as [\t]|
|
||||
| \n |newline|same as [\n]|
|
||||
| \w |word character|same as [a-zA-Z0-9_]|
|
||||
| \W |not word character|same as [^a-zA-Z0-9_]|
|
||||
|''Capturing Groups''|<|<|
|
||||
| (match) |match placed in variable $x|can be used in Replace|
|
||||
| (\x) |repeats match pattern of $x|can be used in Replace|
|
||||
|''Quantifiers''|<|<|
|
||||
| ? |single match|match 0 or 1 time|
|
||||
| * |greedy match 0+|match 0 or as many times as possible|
|
||||
| *? |lazy match 0+|match 0 or as few times as possible|
|
||||
| + |greedy match 1+|match 1 or as many times as possible|
|
||||
| +? |lazy match 1+|match 1 or as few times as possible|
|
||||
| {x} |match x times|match x times|
|
||||
| {x,y} |match x to y times|match x times to exactly y times|
|
||||
| {x,} |match x or more times|match x times or as many as possible|
|
||||
|''Escapes''|<|<|
|
||||
| \ |escape special characters|add to \ [ ] ( ) { } ^ $ . ? * + for literals|
|
||||
|''REPLACE'' |<|<|h
|
||||
| $& |return the full match|<|
|
||||
| $x |return $x where x is the numeric index of a Capturing Group|<|
|
||||
|''NOTE'' |<|<|h
|
||||
|This Reference supports most ordinary uses of regular expressions.<br> For advanced options: [[MDN Reference|https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#Using_simple_patterns]]; examples: [[regular-expressions.info|https://www.regular-expressions.info/tutorial.html]].|<|<|
|
||||
|
@ -0,0 +1,24 @@
|
||||
caption: Relink on rename
|
||||
list-after: $:/plugins/kookma/commander/help/uicomp/regular-expression
|
||||
tags: $:/tags/Commander/Help
|
||||
title: $:/plugins/kookma/commander/help/uicomp/relink
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
!! Relink on rename
|
||||
When Tiddler Commander is used to rename bulk tiddlers in operation like
|
||||
|
||||
* Title operation
|
||||
** add/remove prefix
|
||||
** add/remove suffix
|
||||
** remove chars from the begining or end of title
|
||||
* ~SnR
|
||||
** Search and replace in tiddlers title
|
||||
|
||||
It is possible to update all links to title. This includes //tags// and //list//. If [[Relink|https://flibbles.github.io/tw5-relink/]] plugin is installed, then not only title will be updated in //tags// and //list// field, but also in all filters, transclusions, text field and evrywhere.
|
||||
|
||||
<div class="commander-alert"> ''Note'': Relink does not update all forms of title e.g those created from different segments, but it will update any occurances</div>
|
||||
|
||||
|
||||
!! How to integrate with ''Relink''?
|
||||
|
||||
Simply install the [[Relink|https://flibbles.github.io/tw5-relink/]] plugin and it will be appeared as an option when Tiddler Commander title operations including ~SnR are performed!
|
@ -0,0 +1,40 @@
|
||||
caption: Search-n-Replace
|
||||
list-after: $:/plugins/kookma/commander/help/uicomp/quick-tutorial
|
||||
tags: $:/tags/Commander/Help
|
||||
title: $:/plugins/kookma/commander/help/uicomp/snr
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
!! Search and replace using Snr
|
||||
Snr stands for search and replace, is a powerful tool uses regular expression for searching all fields and lets replace chars, words, phrases with new values.
|
||||
|
||||
!! How to use
|
||||
* Enter a search filter or keywords in ''Combo search'' box like `[tag[myTag]]` or `concept`
|
||||
* Use ''Select tiddlers'' for the resulting list to identify which specific tiddlers to do a Snr operation on
|
||||
** If selective operation is unchecked, all tiddlers from step one will be included in Snr operation.
|
||||
* From ''Tiddler title'' drop down menu select a tiddler
|
||||
* From ''Field name'' drop down menu select a tiddler field like `text`
|
||||
** all fileds even `title` can be selected
|
||||
* In the ''Search text'' type the search term for example `this`
|
||||
* In the ''Replace with'' type the term you want to replace with like `that`
|
||||
* Check the ''Differences'' and if you are satisfied with the result, press the `Replace?` button
|
||||
* You can press `Replace all?` if you want to search and replace in all selected tiddlers
|
||||
|
||||
;Remarks
|
||||
: The `Replace all?` lets you to search and replace in all selected tiddlers at once! It is possible to search and replace even in `title` field!
|
||||
|
||||
<$list filter="[[snr.png]is[tiddler]]"><<image-pretty img:"snr.png" width:"60%" align:"center" caption:"Fig 1. Search and replace using regular expression">></$list>
|
||||
|
||||
!! Special characters
|
||||
<<<
|
||||
As `SNR` uses ''regexp'' pattern to make search and replace, when special characters are used in the ''Search text'' box, they shall be escaped among them are `*`, `+`, `[]`, `?` ...
|
||||
To use these characters do like below
|
||||
|
||||
```
|
||||
\[ \] \( \) \{ \} \. \* \+ \? \^ \$ \\ \|
|
||||
```
|
||||
<<<
|
||||
|
||||
!! Warning
|
||||
<<<
|
||||
* SNR replace the contents of tiddlers.<br> ''//The action can not be undone//''. So always make a backup before performing any replace action
|
||||
<<<
|
@ -0,0 +1,20 @@
|
||||
caption: Warning
|
||||
list-after: $:/plugins/kookma/commander/help/uicomp/relink
|
||||
tags: $:/tags/Commander/Help
|
||||
title: $:/plugins/kookma/commander/help/uicomp/warning
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
;Note i
|
||||
:Tiddler Commander is a very powerful tool, it can change any field in any tiddler.// Make sure what you are doing//!
|
||||
|
||||
;Note ii
|
||||
:Tiddler Commander uses two steps tiddler selection. It uses a combo search box to screen (using standard or filter search) possible tiddlers and then uses a selective list of tiddlers from first step for batch operation!
|
||||
:# If selective operation is unchecked, then all tiddlers from step one are used for batch operation
|
||||
:# If selective operation is checked, then user has to manually select among tiddlers, and the selected ones are used for batch operation
|
||||
|
||||
;Note iii
|
||||
://Commander do not perform operation on shadow tiddlers//, unless they are overriden. Because shadow tiddlers aren’t stored as ''real'' tiddlers. They are intentionally excluded from most operations by default so that they don’t clutter filters made by users unless explicitly required.
|
||||
|
||||
<div class="commander-alert">''Warning''
|
||||
Before using Tiddler commander for bulk operation on your own valuable, irreplaceable data, ''backup them''.
|
||||
</div>
|
@ -0,0 +1,10 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/history
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Full change log https://kookma.github.io/TW-Commander/#ChangeLog
|
||||
|
||||
* ''2.1.3'' -- 2021.10.24 -- commander icon fixed
|
||||
* ''2.1.2'' -- 2021.01.02 -- Saq Imtiaz release
|
||||
* ''2.1.0'' -- 2020.03.25 -- stable release
|
||||
* ''0.1.0'' -- 2019.02.12 -- mature public release
|
@ -0,0 +1,5 @@
|
||||
caption: file-alt (Regular)
|
||||
title: $:/plugins/kookma/commander/images/commander.svg
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<svg class="tc-image-file-alt tc-image-button" width="22pt" height="22pt" viewBox="0 0 384 512"><path d="M288 248v28c0 6.6-5.4 12-12 12H108c-6.6 0-12-5.4-12-12v-28c0-6.6 5.4-12 12-12h168c6.6 0 12 5.4 12 12zm-12 72H108c-6.6 0-12 5.4-12 12v28c0 6.6 5.4 12 12 12h168c6.6 0 12-5.4 12-12v-28c0-6.6-5.4-12-12-12zm108-188.1V464c0 26.5-21.5 48-48 48H48c-26.5 0-48-21.5-48-48V48C0 21.5 21.5 0 48 0h204.1C264.8 0 277 5.1 286 14.1L369.9 98c9 8.9 14.1 21.2 14.1 33.9zm-128-80V128h76.1L256 51.9zM336 464V176H232c-13.3 0-24-10.7-24-24V48H48v416h288z"/></svg>
|
@ -0,0 +1,120 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/inspect/comp/edit-fileds
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define lingo-base() $:/language/EditTemplate/
|
||||
\define config-title()
|
||||
$:/config/EditTemplateFields/Visibility/$(currentField)$
|
||||
\end
|
||||
|
||||
\define config-filter()
|
||||
[[hide]] -[title{$(config-title)$}]
|
||||
\end
|
||||
|
||||
\define new-field()
|
||||
<$vars name={{$:/temp/newfieldname}}>
|
||||
<$reveal type="nomatch" text="" default=<<name>>>
|
||||
<$button class="cmd-btn">
|
||||
<$action-sendmessage $message="tm-add-field"
|
||||
$name=<<name>>
|
||||
$value={{$:/temp/newfieldvalue}}/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/newfieldname"/>
|
||||
<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/>
|
||||
<<lingo Fields/Add/Button>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" text="" default=<<name>>>
|
||||
<$button class="cmd-btn">
|
||||
<<lingo Fields/Add/Button>>
|
||||
</$button>
|
||||
</$reveal>
|
||||
</$vars>
|
||||
\end
|
||||
|
||||
\define compInspect-edit-fileds(commonFields:"")
|
||||
|
||||
<div class="tc-edit-fields">
|
||||
<table class="tc-edit-fields">
|
||||
<tbody>
|
||||
<$list filter="[all[current]fields[]] +[sort[title]]" variable="currentField">
|
||||
<$list filter=<<config-filter>> variable="temp">
|
||||
<tr class="tc-edit-field">
|
||||
<td class="tc-edit-field-name">
|
||||
<$text text=<<currentField>>/>:</td>
|
||||
<td class="tc-edit-field-value">
|
||||
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>
|
||||
</td>
|
||||
<td class="tc-edit-field-remove">
|
||||
<$button class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Field/Remove/Hint}} aria-label={{$:/language/EditTemplate/Field/Remove/Caption}}>
|
||||
<$action-deletefield $field=<<currentField>>/>
|
||||
{{$:/core/images/delete-button}}
|
||||
</$button>
|
||||
</td>
|
||||
</tr>
|
||||
</$list>
|
||||
</$list>
|
||||
|
||||
|
||||
<$list filter="created creator modified modifier -[enlist<__commonFields__>]" variable="currentField">
|
||||
<tr class="tc-edit-field">
|
||||
<td class="tc-edit-field-name">
|
||||
<$text text=<<currentField>>/>:</td>
|
||||
<td class="tc-edit-field-value">
|
||||
<$edit-text tiddler=<<currentTiddler>> field=<<currentField>> placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}}/>
|
||||
</td>
|
||||
<td class="tc-edit-field-remove">
|
||||
<$button class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Field/Remove/Hint}} aria-label={{$:/language/EditTemplate/Field/Remove/Caption}}>
|
||||
<$action-deletefield $field=<<currentField>>/>
|
||||
{{$:/core/images/delete-button}}
|
||||
</$button>
|
||||
</td>
|
||||
</tr>
|
||||
</$list>
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<$fieldmangler>
|
||||
<div class="tc-edit-field-add">
|
||||
<em class="tc-edit">
|
||||
<<lingo Fields/Add/Prompt>>
|
||||
</em>
|
||||
<span class="tc-edit-field-add-name">
|
||||
<$edit-text tiddler="$:/temp/newfieldname" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Name/Placeholder}} focusPopup=<<qualify "$:/state/popup/field-dropdown">> class="tc-edit-texteditor tc-popup-handle"/>
|
||||
</span>
|
||||
<$button popup=<<qualify "$:/state/popup/field-dropdown">> class="tc-btn-invisible tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Field/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Field/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button>
|
||||
<$reveal state=<<qualify "$:/state/popup/field-dropdown">> type="nomatch" text="" default="">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<$linkcatcher to="$:/temp/newfieldname">
|
||||
<div class="tc-dropdown-item">
|
||||
<<lingo Fields/Add/Dropdown/User>>
|
||||
</div>
|
||||
<$list filter="[!is[shadow]!is[system]fields[]search:title{$:/temp/newfieldname}sort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type" variable="currentField">
|
||||
<$link to=<<currentField>>>
|
||||
<<currentField>>
|
||||
</$link>
|
||||
</$list>
|
||||
<div class="tc-dropdown-item">
|
||||
<<lingo Fields/Add/Dropdown/System>>
|
||||
</div>
|
||||
<$list filter="[fields[]search:title{$:/temp/newfieldname}sort[]] -[!is[shadow]!is[system]fields[]]" variable="currentField">
|
||||
<$link to=<<currentField>>>
|
||||
<<currentField>>
|
||||
</$link>
|
||||
</$list>
|
||||
</$linkcatcher>
|
||||
</div>
|
||||
</$reveal>
|
||||
<span class="tc-edit-field-add-value">
|
||||
<$edit-text tiddler="$:/temp/newfieldvalue" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor"/>
|
||||
</span>
|
||||
<span class="tc-edit-field-add-button">
|
||||
<$macrocall $name="new-field"/>
|
||||
</span>
|
||||
</div>
|
||||
</$fieldmangler>
|
||||
\end
|
@ -0,0 +1,29 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/inspect/comp/edit-preview
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define compInspect-edit-preview(tiddler, commonFields:"")
|
||||
<div class="tc-edit-fields">
|
||||
<table class="tc-edit-fields">
|
||||
<tbody>
|
||||
<tr class="tc-edit-field"><td class="tc-edit-field-name">title:</td>
|
||||
<td class="tc-edit-field-value"><$link to=<<__tiddler__>> ><$text text=<<__tiddler__>> /></$link></td>
|
||||
</tr>
|
||||
<tr class="tc-edit-field"><td class="tc-edit-field-name">tags:</td>
|
||||
<td class="tc-edit-field-value">{{$tiddler$||$:/core/ui/EditTemplate/tags}}</td>
|
||||
</tr>
|
||||
<tr class="tc-edit-field"><td class="tc-edit-field-name">text:</td>
|
||||
<td class="tc-edit-field-value"><$macrocall $name=compInspect-get-field tiddler=<<__tiddler__>> field="text" tag="textarea" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<$tiddler tiddler=<<__tiddler__>> >
|
||||
<$macrocall $name="compInspect-edit-fileds" commonFields=<<__commonFields__>> />
|
||||
</$tiddler>
|
||||
\end
|
||||
|
||||
\define compInspect-get-field(tiddler, field, tag:"input")
|
||||
<$edit-text class="tc-edit-texteditor" tiddler=<<__tiddler__>> field=<<__field__>> tag=<<__tag__>> default="" placeholder={{$:/language/EditTemplate/Body/Placeholder}}/>
|
||||
\end
|
@ -0,0 +1,40 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/inspect/comp/main
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define compInspect(filter, stateTiddler:"thisTiddler")
|
||||
<$set name="state"
|
||||
value={{{ [[$:/state/compInspect/]addsuffix<__stateTiddler__>] }}} >
|
||||
<$vars
|
||||
slStateTid={{{ [<state>addsuffix[/]addsuffix[selectState-tiddler]] }}}
|
||||
rvStateTid={{{ [<state>addsuffix[/]addsuffix[revealState-tiddler]] }}}
|
||||
chStateTid={{{ [<state>addsuffix[/]addsuffix[checkboxState-tiddler]] }}} >
|
||||
|
||||
Select tiddler <$macrocall $name=compSelect filter=<<__filter__>> stateTiddler=<<slStateTid>> />
|
||||
|
||||
<$macrocall $name="check-common-fields" stateTiddler=<<chStateTid>> />
|
||||
|
||||
<$reveal stateTitle=<<rvStateTid>> type="nomatch" text="edit">
|
||||
<$button class="tc-btn-invisible" setTitle=<<rvStateTid>> setTo="edit" tooltip="edit tiddler">{{$:/core/images/edit-button}}</$button>
|
||||
<$macrocall $name=compInspect-show-preview tiddler={{{ [<slStateTid>get[text]]+[subfilter<__filter__>] }}} commonFields={{{ [<chStateTid>get[text]] }}}/>
|
||||
</$reveal>
|
||||
<$reveal stateTitle=<<rvStateTid>> type="match" text="edit">
|
||||
<$button class="tc-btn-invisible" setTitle=<<rvStateTid>> setTo="" tooltip="confirm changes">{{$:/core/images/done-button}}</$button>
|
||||
<$macrocall $name=compInspect-edit-preview tiddler={{{ [<slStateTid>get[text]]+[subfilter<__filter__>] }}} commonFields={{{ [<chStateTid>get[text]] }}}/>
|
||||
</$reveal>
|
||||
|
||||
</$vars>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\define check-common-fields(stateTiddler)
|
||||
<$vars commonFields={{{[<commonFieldsTid>get[text]]}}}>
|
||||
<$checkbox
|
||||
tiddler=<<__stateTiddler__>>
|
||||
field="text"
|
||||
checked=<<commonFields>>
|
||||
unchecked=""
|
||||
default=""
|
||||
> Exclude common fields?</$checkbox>
|
||||
</$vars>
|
||||
\end
|
@ -0,0 +1,34 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/inspect/comp/select
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define compSelect(filter:"", stateTiddler:"", default:"", class:"", showButtons:"show")
|
||||
<$select tiddler=<<__stateTiddler__>> default=<<__default__>> class=<<__class__>> >
|
||||
<option value="">None</option>
|
||||
<$list filter=<<__filter__>> variable=item>
|
||||
<option value=<<item>>><$text text=<<item>> /></option>
|
||||
</$list>
|
||||
</$select>
|
||||
<$reveal type="match" text="show" default=<<__showButtons__>> >
|
||||
<$vars myfilter=<<__filter__>> mystateTiddler=<<__stateTiddler__>> myitem={{{ [<__stateTiddler__>get[text]] }}} >
|
||||
<$button actions=<<cs-prev-item>> class="cmd-btn"> prev </$button>
|
||||
<$button actions=<<cs-next-item>> class="cmd-btn"> next </$button>
|
||||
</$vars>
|
||||
</$reveal>
|
||||
\end
|
||||
|
||||
\define cs-prev-item()
|
||||
<$list filter="[subfilter<myfilter>] +[before<myitem>]" variable="prev-item" >
|
||||
<$action-setfield $tiddler=<<mystateTiddler>> text=<<prev-item>> />
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define cs-next-item()
|
||||
<$list filter="[subfilter<myfilter>] +[after<myitem>]" variable="next-item" >
|
||||
<$action-setfield $tiddler=<<mystateTiddler>> text=<<next-item>> />
|
||||
</$list>
|
||||
\end
|
||||
|
||||
<!-- used by
|
||||
- $:/plugins/kookma/commander/compInspect/main
|
||||
-->
|
@ -0,0 +1,31 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/inspect/comp/show-preview
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define compInspect-show-preview(tiddler, commonFields:"")
|
||||
<$vars mainFields="title tags text">
|
||||
<table class="cmd-ci-table">
|
||||
<tr><td class="leftcol">title</td>
|
||||
<td class="rightcol"><$link to=<<__tiddler__>> ><$text text=<<__tiddler__>> /></$link></td>
|
||||
</tr>
|
||||
|
||||
<tr><td class="leftcol">tags</td>
|
||||
<td style="padding:3px;"><$macrocall $name=showTags tiddler=<<__tiddler__>> /></td>
|
||||
</tr>
|
||||
<tr><td class="leftcol">text</td>
|
||||
<td><$transclude tiddler=<<__tiddler__>> field="text" mode="block"/></td>
|
||||
</tr>
|
||||
<$list filter="[<__tiddler__>fields[]] -[enlist<mainFields>] -[enlist<__commonFields__>]" variable="otherFld">
|
||||
<tr><td class="leftcol"><<otherFld>></td>
|
||||
<td class="rightcol"><$transclude tiddler=<<__tiddler__>> field=<<otherFld>> mode="inline"/></td>
|
||||
</tr>
|
||||
</$list>
|
||||
</table>
|
||||
</$vars>
|
||||
\end
|
||||
|
||||
\define showTags(tiddler)
|
||||
<$list filter="[<__tiddler__>tags[]]" variable=tagItem >
|
||||
<$macrocall $name=tag tag=<<tagItem>> />
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,10 @@
|
||||
caption: Inspect
|
||||
list-after: $:/plugins/kookma/commander/field/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/inspect/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/InspectOps]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/inspect/uicomp/Inspection"
|
||||
class:"tc-vertical cmd-tab-wd">>
|
@ -0,0 +1,10 @@
|
||||
caption: Inspect
|
||||
tags: $:/tags/Commander/InspectOps
|
||||
title: $:/plugins/kookma/commander/inspect/uicomp/Inspection
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<$macrocall
|
||||
$name=compInspect
|
||||
filter=<<searchfilter>>
|
||||
stateTiddler="commander"
|
||||
/>
|
@ -0,0 +1,15 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/license
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Distributed under an MIT license.
|
||||
|
||||
Copyright (c) 2018-2020 [[Mohammad Rahmani|https://github.com/kookma]]
|
||||
|
||||
<<<
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
<<<
|
@ -0,0 +1,30 @@
|
||||
caption: Log status
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/log/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<div class="commander-alert" style="padding:5px;font-size:0.90em;">
|
||||
<$button class="tc-btn-invisible tc-tiddlylink" actions=<<delete-all-log-tiddlers>>>Clear log</$button>
|
||||
<$set name="resultCount" value="""<$count filter="[tag[$:/tags/Commander/LogOps]]" />""">
|
||||
<div class="tc-search-results">
|
||||
<span class="kk-commander-log-note">Recent number of operations: <<resultCount>></span><br>
|
||||
<$list filter="[tag[$:/tags/Commander/LogOps]] +[!sort[created]]" variable="logTid">
|
||||
<b><$view tiddler=<<logTid>> field="created" format="date" template="YYYY-0MM-0DD 0hh:0mm:0ss"/>
|
||||
<$view tiddler=<<logTid>> field="caption">
|
||||
<$view tiddler=<<logTid>> field="title"></$view>
|
||||
</$view>
|
||||
</b>
|
||||
<ol><$list filter="[<logTid>indexes[]]" variable="item">
|
||||
<li><$link to=<<item>>><<item>></$link>
|
||||
<$set name="myItem" tiddler=<<logTid>> index=<<item>> >
|
||||
<$list filter="[<myItem>!search[existed]]" variable="ignore"
|
||||
emptyMessage="""<span style="color:red;"><<myItem>></span>""" >
|
||||
<span class="kk-commander-log-item"><<myItem>></span>
|
||||
</$list>
|
||||
</$set>
|
||||
</li>
|
||||
</$list></ol>
|
||||
</$list>
|
||||
</div>
|
||||
</$set>
|
||||
</div>
|
@ -0,0 +1,30 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/compConfirmAction
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define compConfirmAction(
|
||||
btnLabel:"Delete these tiddlers",
|
||||
confirmMessage:"Are you sure you wish to delete",
|
||||
stateTiddler:""
|
||||
countFilter:"",
|
||||
actionMacro:"")
|
||||
<$set name=resultCount value={{{ [subfilter<__countFilter__>count[]] }}} >
|
||||
<$reveal type="gt" text="0" default=<<resultCount>> >
|
||||
<$button popup=<<qualify """$stateTiddler$""">> class="cmd-btn">$btnLabel$</$button>
|
||||
</$reveal>
|
||||
<$reveal state=<<qualify """$stateTiddler$""">> type="popup" position="belowleft" animate="yes">
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<div class="tc-dropdown-item-plain">
|
||||
$confirmMessage$ <<resultCount>> tiddler(s)?
|
||||
</div>
|
||||
<div class="tc-dropdown-item-plain">
|
||||
<$button class="cmd-btn"> $btnLabel$
|
||||
<$macrocall $name=<<__actionMacro__>> />
|
||||
</$button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</$reveal>
|
||||
</$set>
|
||||
\end
|
@ -0,0 +1,15 @@
|
||||
description: some macro are not used REMOVE THEM
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/definition
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define tempPath() $:/temp/commander
|
||||
|
||||
\define searchboxTid() $(tempPath)$/search-box
|
||||
\define selectiveOpsTid() $(tempPath)$/selective-operation
|
||||
|
||||
|
||||
\define workingTag() $:/tags/Commander/Working
|
||||
\define exportTagTid() $:/temp/commander/exportTag
|
||||
\define systemFieldsTid() $:/plugins/kookma/commander/config/systemfields
|
||||
\define commonFieldsTid() $:/plugins/kookma/commander/config/commonfields
|
@ -0,0 +1,27 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/logging
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define set-title() $:/temp/commander/logs/tid-{{{[tag[$:/tags/Commander/LogOps]count[]add[1]]}}}
|
||||
|
||||
\define create-log-tiddler(msg)
|
||||
<$wikify name="myTitle" text="""<<set-title>>""">
|
||||
<$wikify name="myCaption" text="""<$macrocall $name="set-caption" msg=<<__msg__>> />""">
|
||||
<$action-createtiddler $basetitle=<<myTitle>>
|
||||
$savetitle="$:/state/commander/log-tiddler"
|
||||
tags="$:/tags/Commander/LogOps"
|
||||
type="application/json"
|
||||
caption=<<__msg__>>
|
||||
/>
|
||||
</$wikify>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define log-add-single-operation(msg:"commander operation", tidItem:"no item")
|
||||
<$action-setfield $tiddler={{$:/state/commander/log-tiddler}} $index=<<__tidItem__>> $value=<<__msg__>> />
|
||||
\end
|
||||
|
||||
|
||||
\define delete-all-log-tiddlers()
|
||||
<$action-deletetiddler $filter="[tag[$:/tags/Commander/LogOps]]" />
|
||||
\end
|
@ -0,0 +1,17 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/remove-workingtag
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define remove-working-tag(oldTag)
|
||||
<$list filter="[all[shadows+tiddlers]tag<workingTag>limit[1]]" variable=ignore>
|
||||
<<create-log-tiddler "remove-workingTag">>
|
||||
<$list filter="[all[shadows+tiddlers]tag<workingTag>]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<__oldTag__>> />
|
||||
</$fieldmangler>
|
||||
<$macrocall $name="log-add-single-operation" msg="""working tag `$oldTag$` removed""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
|
@ -0,0 +1,28 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/slider
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define commander-slider(title, default:"closed")
|
||||
<$set name="revealState" value=<<qualify "$:/state/commander/reveal/$title$">>>
|
||||
<h2>
|
||||
<$reveal type="nomatch" state=<<revealState>> text="open" default="$default$">
|
||||
<$button class="tc-btn-invisible tc-tiddlylink" set=<<revealState>> setTo="open">
|
||||
{{$:/core/images/right-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state=<<revealState>> text="open" default="$default$">
|
||||
<$button class="tc-btn-invisible tc-tiddlylink" set=<<revealState>> setTo="closed">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
<$view tiddler="$title$" field="caption">
|
||||
<$view tiddler="$title$" field="title"></$view>
|
||||
</$view>
|
||||
|
||||
</h2>
|
||||
|
||||
<$reveal type="match" state=<<revealState>> text="open" default="$default$">
|
||||
<$transclude tiddler="$title$" mode="block" />
|
||||
</$reveal>
|
||||
</$set>
|
||||
\end
|
@ -0,0 +1,48 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/macros/utility
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define display(label,text)
|
||||
<$set name="stateTid" value="$:/temp/commander/display/popup/$label$" >
|
||||
<$button popup=<<stateTid>> class="tc-btn-invisible"><span style="text-decoration: underline">$label$</span></$button>
|
||||
<$reveal type="nomatch" text="" default="" state=<<stateTid>> animate="yes">
|
||||
<span style="color:blue;"><$text text=<<__text__>> /></span></$reveal>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
\define is-filterSeearch-newer-than-selectedTitles(TidA, TidB)
|
||||
<$set name="tidAMod" value={{{ [[$TidA$]get[modified]] }}}>
|
||||
<$set name="tidBMod" value={{{ [[$TidB$]get[modified]] }}}>
|
||||
<$set name="tidAText" value={{{ [[$TidA$]get[text]] }}}>
|
||||
<$set name="tidBText" value={{{ [[$TidB$]get[text]] }}}>
|
||||
<$list filter="[<__TidB__>get[text]minlength[1]]" variable=ignore>
|
||||
<$reveal type="nomatch" default=<<tidAText>> text=<<tidBText>>>
|
||||
<$list filter="[<tidAMod>] [<tidBMod>] +[nsort[]last[1]removesuffix<tidBMod>]">
|
||||
A new filter search has been detected, click on the search button to apply it.
|
||||
</$list>
|
||||
</$reveal>
|
||||
</$list>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
</$set>
|
||||
\end
|
||||
|
||||
!!Remarks
|
||||
;is-filterSeearch-newer-than-selectedTitles
|
||||
* Checks `TidA` and `TidB` for modified date and text
|
||||
* If They are not empty, then
|
||||
** checks if the text of two are equal, if not
|
||||
** checks to see if `TidB` is newer or not
|
||||
** if newer shows a message, to apply the new search filter
|
||||
* Note
|
||||
** `TidA="$:/temp/commander"`
|
||||
** `TidB="$:/temp/commander/search-box"`
|
||||
* is-filterSeearch-newer-than-selectedTitles is called from $:/plugins/kookma/commander/search/ui
|
||||
|
||||
;display
|
||||
* gets a label and a text
|
||||
* create an inline label
|
||||
* on click label, the text is displayed as temporary popup
|
||||
* losing focus, the text goes hidden
|
||||
* this macro is used in customized compSelective to show the active filter
|
@ -0,0 +1,34 @@
|
||||
tags:
|
||||
title: $:/plugins/kookma/commander/readme
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
; Tiddler Commander
|
||||
Tiddler Commander, in short ''Commander'' is a unique tool for batch operations on tiddlers. Commander has the below features
|
||||
|
||||
* Bulk tiddler creation/deletion
|
||||
* Combo search to filter and select tiddlers
|
||||
* Title operation: add, remove prefixes and suffixes, also remove cahras form begining and end of title (on renaming tiddlers, [[relink|$:/plugins/kookma/commander/help/uicomp/relink]] can be used to update title in other tiddlers)
|
||||
* Tag operation: add, remove, replace
|
||||
* Field operation: add, remove, rename, and set field value
|
||||
* SNR, search and replace in all fields including text, tags, //title//, and common fields
|
||||
* Inspect, to review and inspect tiddlers in one place, scroll among them and edit all fields (including common fields), tags, text (title is an exception!)
|
||||
* Log, create logs of all operations
|
||||
* Search, //save and load// any combination of filter search
|
||||
|
||||
; Start Commander
|
||||
* Normally Commander adds its icon: <span class="cmd-doc">{{$:/plugins/kookma/commander/images/commander.svg}}</span> to page controls.
|
||||
* Open the right sidebar and click on the <span class="cmd-doc">{{$:/plugins/kookma/commander/images/commander.svg}}</span> Commander is started
|
||||
* In standard Tiddlywiki, control buttons are shown on the right sidebar under site title.
|
||||
|
||||
; Code and demo
|
||||
For learning plugin features, syntax, tutorial and examples see the plugin demo and code pages
|
||||
|
||||
* Demo: https://kookma.github.io/TW-Commander/
|
||||
* Code: https://github.com/kookma/TW-Commander
|
||||
|
||||
<style>
|
||||
.cmd-doc svg{
|
||||
width: 1.2em;
|
||||
height: 1.2em;
|
||||
vertical-align: middle;}
|
||||
</style>
|
@ -0,0 +1,20 @@
|
||||
list-after: $:/plugins/kookma/commander/search/filter-button/search
|
||||
tags: $:/tags/Commander/Search/FilterButton
|
||||
title: $:/plugins/kookma/commander/search/filter-button/clear
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\import $:/plugins/kookma/commander/macros/definition
|
||||
|
||||
<$reveal type="nomatch" stateTitle=<<searchboxTid>> stateField="text" text="">
|
||||
<$button class="tc-btn-invisible" tooltip="clear search box and selected tiddlers">
|
||||
<$action-setfield $tiddler=<<searchboxTid>> $field="text" $value=""/>
|
||||
<$action-setfield $tiddler="$:/temp/commander" $field="text" $value=""/>
|
||||
<$action-setfield $tiddler="$:/state/commander/snr/select-tiddler" $field="text" $value=""/><!-- SNR selection -->
|
||||
<$action-setfield $tiddler="$:/state/compInspect/temp/commander/selectState-tiddler" $field="text" $value=""/> <!-- Inspect selection -->
|
||||
{{$:/core/images/close-button}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
|
||||
<!--
|
||||
there is extra action should be removed
|
||||
-->
|
@ -0,0 +1,26 @@
|
||||
tags: $:/tags/Commander/Search/FilterButton
|
||||
title: $:/plugins/kookma/commander/search/filter-button/dropdown
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\import $:/plugins/kookma/commander/macros/definition
|
||||
\whitespace trim
|
||||
|
||||
<span class="tc-popup-keep">
|
||||
<$button popup=<<qualify "$:/state/commander/filterDropdown">> class="tc-btn-invisible" tooltip="select a search filter">
|
||||
{{$:/core/images/down-arrow}}
|
||||
</$button>
|
||||
</span>
|
||||
|
||||
<$reveal state=<<qualify "$:/state/commander/filterDropdown">> type="popup" position="belowleft" animate="yes">
|
||||
<$set name="tv-show-missing-links" value="yes">
|
||||
<$linkcatcher to=<<searchboxTid>> >
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Commander/Filter]!is[draft]]">
|
||||
<$link to={{!!filter}}><$let tv-wikilinks="no"><$transclude field="description"/></$let></$link>
|
||||
</$list>
|
||||
</div>
|
||||
</div>
|
||||
</$linkcatcher>
|
||||
</$set>
|
||||
</$reveal>
|
@ -0,0 +1,42 @@
|
||||
list-after: $:/plugins/kookma/commander/search/filter-button/clear
|
||||
tags: $:/tags/Commander/Search/FilterButton
|
||||
title: $:/plugins/kookma/commander/search/filter-button/save
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\import $:/plugins/kookma/commander/macros/definition
|
||||
|
||||
<$reveal type="nomatch" stateTitle=<<searchboxTid>> stateField="text" text="">
|
||||
<$button class="tc-btn-invisible" tooltip="save current search" popup=<<qualify "$:/state/commander/SaveDropdown">> >
|
||||
{{$:/core/images/file}}
|
||||
</$button>
|
||||
</$reveal>
|
||||
|
||||
<$reveal state=<<qualify "$:/state/commander/SaveDropdown">> type="popup" class="tc-popup-keep" position="belowleft" animate="yes">
|
||||
<div class="tc-block-dropdown-wrapper">
|
||||
<div class="tc-block-dropdown tc-edit-type-dropdown">
|
||||
<div class="tc-dropdown-item-plain">
|
||||
Save new search filter<br><br>
|
||||
<$edit-text
|
||||
tiddler="$:/temp/commander/save-new-filter"
|
||||
tag="input"
|
||||
default=""
|
||||
class="cmd-txt-area"
|
||||
placeholder="description for new filter"
|
||||
/> <br><br>
|
||||
|
||||
<$button class="tc-btn"> Save new filter
|
||||
<$macrocall $name="create-new-filter"
|
||||
description={{$:/temp/commander/save-new-filter}}
|
||||
basetitle="$:/plugins/kookma/commander/filters/yourFilter"
|
||||
filter={{{[<searchboxTid>get[text]]}}} />
|
||||
<$action-deletetiddler $tiddler="$:/temp/commander/save-new-filter"/>
|
||||
<$action-deletetiddler $tiddler=<<qualify "$:/state/commander/SaveDropdown">> />
|
||||
</$button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</$reveal>
|
||||
|
||||
<!-- ToDO
|
||||
correct classes for textbox
|
||||
-->
|
@ -0,0 +1,14 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/search/macros/create-new-filter
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define create-new-filter(description:"", basetitle:"", filter:"")
|
||||
<$list filter="[<__description__>!is[blank]]" variable="ignore">
|
||||
<$action-createtiddler
|
||||
$basetitle="""$basetitle$"""
|
||||
tags="$:/tags/Commander/Filter"
|
||||
description=<<__description__>>
|
||||
filter="""$filter$"""
|
||||
/>
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,17 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/search/macros/select-deselect
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define select-all()
|
||||
<$list filter="[subfilter<filtertext>!is[missing]!tag<workingTag>]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<workingTag>> />
|
||||
</$fieldmangler>
|
||||
\end
|
||||
|
||||
\define deselect-all()
|
||||
<$list filter="[tag<workingTag>]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<workingTag>> />
|
||||
</$fieldmangler>
|
||||
\end
|
@ -0,0 +1,9 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/search/macros/warning
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define warn-for-selectedTids-from-previous-operation()
|
||||
<$list filter="[tag<workingTag>]-[subfilter<filtertext>]+[count[]!match[0]] ">
|
||||
<span style="color:red;font-size:0.85em">There are remained selected tiddlers from previous search! Remove them by pressing ''deselect all''!</span>
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,27 @@
|
||||
caption: Select tiddlers
|
||||
title: $:/plugins/kookma/commander/search/selection
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\import $:/plugins/kookma/commander/macros/definition
|
||||
<$checkbox tiddler=<<selectiveOpsTid>> field="text" checked="yes" unchecked="no" default="no" uncheckactions=<<deselect-all>> > Selective operation?</$checkbox>
|
||||
|
||||
<$reveal type="nomatch" stateTitle=<<selectiveOpsTid>> stateField="text" text="yes" tag="div" class="kk-commander-tiddler-list kk-commander-columns3">
|
||||
<$list filter="[subfilter<filtertext>!prefix[$:/temp/commander]!is[missing]]"><$link/><br></$list>
|
||||
</$reveal>
|
||||
<$reveal type="match" stateTitle=<<selectiveOpsTid>> stateField="text" text="yes" tag="div">
|
||||
<$button actions=<<select-all>> > Select all</$button> <$button actions=<<deselect-all>> > Deselect all</$button>
|
||||
<small style="margin-left:10px;">Number of tiddlers selected: <$count filter="[tag<workingTag>]" /></small><br>
|
||||
<<warn-for-selectedTids-from-previous-operation>>
|
||||
</$reveal>
|
||||
|
||||
|
||||
<$reveal type="match" stateTitle=<<selectiveOpsTid>> stateField="text" text="yes" tag="div" class="kk-commander-tiddler-list kk-commander-columns3">
|
||||
<$list filter="[subfilter<filtertext>!prefix[$:/temp/commander]!is[missing]]">
|
||||
<$checkbox tag=<<workingTag>>> <$link/></$checkbox><br>
|
||||
</$list>
|
||||
</$reveal>
|
||||
|
||||
<!-- Description
|
||||
This tiddler implement interface to selectivly add tiddlers for commander operations.
|
||||
Each selected tiddler gets a working tag
|
||||
-->
|
@ -0,0 +1,9 @@
|
||||
caption: Commander filter search
|
||||
code-body: yes
|
||||
title: $:/plugins/kookma/commander/search/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<div class="tc-search tc-advanced-search" style="margin-bottom:-12px;"><!-- negative margin for displaying matches -->
|
||||
Combo search <$edit-text tiddler=<<searchboxTid>> type="search" tag="input" default="" placeholder="enter keywords or make a filter search e.g. [tag[myTag]]" focus={{$:/plugins/kookma/commander/config/AutoFocus}}/>
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Commander/Search/FilterButton]!has[draft.of]]"><$transclude/></$list>
|
||||
</div>
|
@ -0,0 +1,11 @@
|
||||
caption: Setting
|
||||
icon: $:/core/images/options-button
|
||||
list-after: $:/plugins/kookma/commander/inspect/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/setting/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/Setting]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/setting/uicomp/snr"
|
||||
class:"tc-vertical cmd-tab-colorful cmd-tab-wd">>
|
@ -0,0 +1,25 @@
|
||||
caption: Temporary tiddlers
|
||||
list-after: $:/plugins/kookma/commander/setting/uicomp/relink
|
||||
tags: $:/tags/Commander/Setting
|
||||
title: $:/plugins/kookma/commander/setting/uicomp/delete-all-temp-tiddlers
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define delete-all-temps()
|
||||
<$action-deletetiddler $filter="[search:title[$:/temp/commander/]]" />
|
||||
\end
|
||||
|
||||
<$set name=numTids value={{{ [search:title[$:/temp/commander/]count[]] }}}>
|
||||
<$reveal type="match" text="0" default=<<numTids>> >
|
||||
No temporary tiddlers is existed to delete!
|
||||
</$reveal>
|
||||
<$reveal type="gt" text="0" default=<<numTids>> >
|
||||
Number of temporary tiddlers (including log tiddlers): <<numTids>><br>
|
||||
</$reveal>
|
||||
</$set>
|
||||
|
||||
<$macrocall $name="compConfirmAction"
|
||||
btnLabel="Delete temp tiddlers"
|
||||
confirmMessage="Are you sure you wish to delete"
|
||||
stateTiddler="$:/state/commander/setting/delete-temps"
|
||||
countFilter="[search:title[$:/temp/commander/]]"
|
||||
actionMacro="delete-all-temps"/>
|
@ -0,0 +1,8 @@
|
||||
caption: Search minimum length
|
||||
tags: $:/tags/Commander/Setting
|
||||
title: $:/plugins/kookma/commander/setting/uicomp/minlength
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Controls the minimum length of a search string before results are displayed.
|
||||
|
||||
<label class="kk-cmd-label">Minlength</label><$edit-text tiddler="$:/plugins/kookma/commander/config/minlength" field=text default=3 placeholder="enter a number" tag=input/>
|
@ -0,0 +1,17 @@
|
||||
caption: Search filter
|
||||
tags: $:/tags/Commander/Setting
|
||||
title: $:/plugins/kookma/commander/setting/uicomp/search-filters
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
The below list shows the Commander search filter. To edit click on the link and edit tiddler for filter syntax or description
|
||||
|
||||
<details>
|
||||
<summary>Commander saved filter search</summary>
|
||||
<dl>
|
||||
<$list filter="[all[tiddlers+shadows]tag[$:/tags/Commander/Filter]]" >
|
||||
<dt><$link/></dt>
|
||||
<dd><span style="display:inline-block;font-weight:700;width:100px">Description:</span><$view field="description"/></dd>
|
||||
<dd><span style="display:inline-block;font-weight:700;width:100px">Filter:</span><$view field="filter"/></dd>
|
||||
</$list>
|
||||
</dl>
|
||||
</details>
|
@ -0,0 +1,14 @@
|
||||
caption: Snr setting
|
||||
tags: $:/tags/Commander/Setting
|
||||
title: $:/plugins/kookma/commander/setting/uicomp/snr
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<snr-difftext-cleanup>>
|
||||
<div style="padding-left:25px;font-size:0.9em">
|
||||
|
||||
The cleanup attribute determines which optional post-processing should be applied to the diffs:
|
||||
|
||||
* none: no cleanup is performed
|
||||
* semantic (default): rewrites the diffs for human readability
|
||||
* efficient: rewrites the diffs to minimise the number of operations for subsequent processing
|
||||
</div>
|
@ -0,0 +1,118 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/snr/macros/actions
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define regexp-flags()
|
||||
{{$:/state/commander/snr/gm}}{{$:/state/commander/snr/case-sensitive}}{{$:/state/commander/snr/unicode}}
|
||||
\end
|
||||
|
||||
\define snr-ui-show-diffs()
|
||||
<form class="cmd-snr-form" style="width:100%;">
|
||||
<fieldset>
|
||||
<legend style="color:#FF0000;">Differences</legend>
|
||||
Tiddler: <$link to={{$:/state/commander/snr/select-tiddler}}><$text text={{$:/state/commander/snr/select-tiddler}}/></$link>
|
||||
|
||||
<$wikify name=flags text=<<regexp-flags>> >
|
||||
|
||||
<$macrocall $name="replace-text-diff"
|
||||
tiddler={{$:/state/commander/snr/select-tiddler}}
|
||||
field={{$:/state/commander/snr/select-tiddler/field}}
|
||||
replace={{$:/state/commander/snr/replace-text}}
|
||||
replaceWith={{$:/state/commander/snr/replace-text-with}}
|
||||
flags=<<flags>>
|
||||
wholeWords={{$:/state/commander/snr/whole-words}}
|
||||
/>
|
||||
|
||||
</$wikify>
|
||||
</fieldset>
|
||||
</form>
|
||||
\end
|
||||
|
||||
\define snr-check-diffs(tiddler:"", field:"")
|
||||
\whitespace trim
|
||||
<$wikify name=flags text=<<regexp-flags>> >
|
||||
<$wikify name="result" text="""
|
||||
<$macrocall $name="replace-text"
|
||||
tiddler=<<__tiddler__>>
|
||||
field=<<__field__>>
|
||||
replace={{$:/state/commander/snr/replace-text}}
|
||||
replaceWith={{$:/state/commander/snr/replace-text-with}}
|
||||
flags=<<flags>>
|
||||
wholeWords={{$:/state/commander/snr/whole-words}}
|
||||
/>""">
|
||||
<$reveal type="match" text={{{ [<__tiddler__>get<__field__>] }}} default=<<result>> >
|
||||
same
|
||||
</$reveal>
|
||||
<$reveal type="nomatch" text={{{ [<__tiddler__>get<__field__>] }}} default=<<result>> >
|
||||
different
|
||||
</$reveal>
|
||||
</$wikify>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define search-replace-in-tiddler-field(tiddler:"",field:"",replace:"",replaceWith:"")
|
||||
<$wikify name=ss text=<<snr-check-diffs """$tiddler$""" """$field$""">> >
|
||||
<$list filter="[<ss>] -same" variable=ignore>
|
||||
<$list filter="[<__tiddler__>has[title]]" variable="ignore">
|
||||
<$wikify name=flags text=<<regexp-flags>> >
|
||||
<$macrocall $name="replace-text-button"
|
||||
tiddler=<<__tiddler__>>
|
||||
field=<<__field__>>
|
||||
replace=<<__replace__>>
|
||||
replaceWith=<<__replaceWith__>>
|
||||
flags=<<flags>>
|
||||
wholeWords={{$:/state/commander/snr/whole-words}}
|
||||
/>
|
||||
<$macrocall $name="log-add-single-operation" msg="""`$field$` field has been changed""" tidItem=<<__tiddler__>> />
|
||||
<$macrocall $name="clear-select-tiddler-if-field-is-title" tiddler=<<__tiddler__>> field=<<__field__>> />
|
||||
</$wikify>
|
||||
</$list>
|
||||
</$list>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define clear-select-tiddler-if-field-is-title(tiddler, field)
|
||||
<$list filter="[<__field__>] +[search[title]]" variable="ignore">
|
||||
<$action-setfield $tiddler="$:/state/commander/snr/select-tiddler" text=""/>
|
||||
<$action-setfield $tiddler="$:/temp/commander/selected-titles" $index=<<__tiddler__>> />
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define search-replace-in-field-bulk()
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<<create-log-tiddler "SNR operation">>
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]]" >
|
||||
<$macrocall
|
||||
$name="search-replace-in-tiddler-field"
|
||||
tiddler=<<currentTiddler>>
|
||||
field={{$:/state/commander/snr/select-tiddler/field}}
|
||||
replace={{$:/state/commander/snr/replace-text}}
|
||||
replaceWith={{$:/state/commander/snr/replace-text-with}}
|
||||
/>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define search-replace-in-field-single-tiddler()
|
||||
<<create-log-tiddler "SNR operation">>
|
||||
<$macrocall
|
||||
$name="search-replace-in-tiddler-field"
|
||||
tiddler={{$:/state/commander/snr/select-tiddler}}
|
||||
field={{$:/state/commander/snr/select-tiddler/field}}
|
||||
replace={{$:/state/commander/snr/replace-text}}
|
||||
replaceWith={{$:/state/commander/snr/replace-text-with}}
|
||||
/>
|
||||
\end
|
||||
|
||||
\define snr-actions()
|
||||
<$button actions=<<search-replace-in-field-single-tiddler>> tooltip="search and replace in a single tiddler" class="cmd-btn">
|
||||
Replace?
|
||||
</$button>
|
||||
<!-- replace in bulk tiddler with confirmation -->
|
||||
<$macrocall $name="compConfirmAction"
|
||||
countFilter=<<searchfilter>>
|
||||
actionMacro="search-replace-in-field-bulk"
|
||||
stateTiddler="$:/state/commander/SelectiveReplaceAllDropdown"
|
||||
confirmMessage="Are you sure you wish to replace text in"
|
||||
btnLabel="Replace all?"/>
|
||||
\end
|
@ -0,0 +1,56 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/snr/macros/inputs
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define snr-ui-inputs()
|
||||
<form class="cmd-snr-form">
|
||||
<fieldset>
|
||||
<legend>Search and Replace</legend>
|
||||
|
||||
<div class="item">
|
||||
<label>Tiddler title</label>
|
||||
<$select tiddler="$:/state/commander/snr/select-tiddler" default="" class="cmd-snr-textbox">
|
||||
<option value="">None</option>
|
||||
<$list filter="[subfilter<searchfilter>]" >
|
||||
<option value=<<currentTiddler>>><$text text=<<currentTiddler>>/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<label>Field name</label>
|
||||
<$select tiddler="$:/state/commander/snr/select-tiddler/field" default="text">
|
||||
<$list filter="[subfilter<searchfilter>fields[]]">
|
||||
<option value=<<currentTiddler>>><$text text=<<currentTiddler>>/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<label>Search text</label>
|
||||
<$edit-text
|
||||
tiddler="$:/state/commander/snr/replace-text"
|
||||
tag="input"
|
||||
default=""
|
||||
placeholder=" text to replace"
|
||||
class="cmd-snr-textbox"/>
|
||||
</div>
|
||||
|
||||
<div class="item">
|
||||
<label>Replace with </label>
|
||||
<$edit-text
|
||||
tiddler="$:/state/commander/snr/replace-text-with"
|
||||
tag="input"
|
||||
default=""
|
||||
placeholder=" new text"
|
||||
class="cmd-snr-textbox"/>
|
||||
</div>
|
||||
<!-- Use relink to update titles -->
|
||||
<$list filter="[[$:/state/commander/snr/select-tiddler/field]get[text]match[title]]" variable=ignore>
|
||||
<div class="item-relink">{{$:/plugins/kookma/commander/config/relink}}</div>
|
||||
</$list>
|
||||
</fieldset>
|
||||
</form>
|
||||
|
||||
|
||||
\end
|
@ -0,0 +1,60 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/snr/macros/regexp-flags
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define snr-regexp-flags()
|
||||
|
||||
<form class="cmd-snr-form">
|
||||
<fieldset>
|
||||
<legend>Search flags</legend>
|
||||
|
||||
<$checkbox
|
||||
tiddler="$:/state/commander/snr/case-sensitive"
|
||||
field="text"
|
||||
checked="i"
|
||||
unchecked=""
|
||||
/> ignore case<br>
|
||||
|
||||
<$checkbox
|
||||
tiddler="$:/state/commander/snr/whole-words"
|
||||
field="text"
|
||||
checked="words"
|
||||
unchecked="characters"
|
||||
/> whole words<br>
|
||||
|
||||
<$checkbox
|
||||
tiddler="$:/state/commander/snr/unicode"
|
||||
field="text"
|
||||
checked="u"
|
||||
unchecked=""
|
||||
/> unicode<br>
|
||||
|
||||
<br>
|
||||
|
||||
<$radio
|
||||
tiddler="$:/state/commander/snr/gm"
|
||||
field="text"
|
||||
value=""> first match
|
||||
</$radio><br>
|
||||
|
||||
<$radio
|
||||
tiddler="$:/state/commander/snr/gm"
|
||||
field="text"
|
||||
value="g"> global match
|
||||
</$radio><br>
|
||||
|
||||
<$radio
|
||||
tiddler="$:/state/commander/snr/gm"
|
||||
field="text"
|
||||
value="m"> multiline mode
|
||||
</$radio><br>
|
||||
|
||||
<$radio
|
||||
tiddler="$:/state/commander/snr/gm"
|
||||
field="text"
|
||||
value="mg"> global multiline mode
|
||||
</$radio>
|
||||
|
||||
</fieldset>
|
||||
</form>
|
||||
\end
|
@ -0,0 +1,50 @@
|
||||
/*\
|
||||
created: 20190214160253135
|
||||
type: application/javascript
|
||||
title: $:/plugins/kookma/commander/snr/macros/regexpsub.js
|
||||
modified: 20200307092210323
|
||||
module-type: macro
|
||||
|
||||
Make regular expression substitutions
|
||||
Developed by Mark S
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
"use strict";
|
||||
|
||||
exports.name = "regexpsub";
|
||||
|
||||
exports.params = [
|
||||
{name: "searchValue"},
|
||||
{name: "replaceValue"},
|
||||
{name: "sourceText"},
|
||||
{name: "flags"},
|
||||
{name: "wholeWords"}
|
||||
];
|
||||
|
||||
/*
|
||||
Run the macro
|
||||
*/
|
||||
exports.run = function(searchValue, replaceValue, sourceText, flags = "gi", wholeWords = "characters") {
|
||||
|
||||
try {
|
||||
|
||||
var searchText;
|
||||
if(wholeWords.toLowerCase() === 'words'){
|
||||
searchText = "\\b" + searchValue + "\\b";
|
||||
} else{
|
||||
searchText = searchValue;
|
||||
}
|
||||
|
||||
searchText = new RegExp(searchText, flags);
|
||||
return sourceText.replace(searchText,replaceValue);
|
||||
|
||||
}
|
||||
catch(err) {
|
||||
return "ERROR IN REG EXPRESSION. YOU MAY NEED TO ESCAPE VALUES";
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
})();
|
@ -0,0 +1,5 @@
|
||||
created: 20190214160253135
|
||||
modified: 20200307092210323
|
||||
module-type: macro
|
||||
title: $:/plugins/kookma/commander/snr/macros/regexpsub.js
|
||||
type: application/javascript
|
@ -0,0 +1,66 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/snr/macros/replace-text
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define nothing-to-replace(tiddler, field:"text")
|
||||
<$diff-text source={{{ [<__tiddler__>get<__field__>] }}} dest={{{ [<__tiddler__>get<__field__>] }}} />
|
||||
\end
|
||||
|
||||
\define replace-text(tiddler:"",field:"text",replace:"",replaceWith:"",flags:"", wholeWords:"")
|
||||
\whitespace trim
|
||||
<$wikify name="source" text="""<$view tiddler=<<__tiddler__>> field=<<__field__>> mode="block" format="text"/>""">
|
||||
<$wikify name="result"
|
||||
text="""<$macrocall $name="regexpsub" $type="text/plain"
|
||||
sourceText=<<source>>
|
||||
searchValue=<<__replace__>>
|
||||
replaceValue=<<__replaceWith__>>
|
||||
flags=<<__flags__>>
|
||||
wholeWords=<<__wholeWords__>> />"""
|
||||
>
|
||||
<$text text=<<result>>/>
|
||||
</$wikify>
|
||||
</$wikify>
|
||||
\end
|
||||
|
||||
\define replace-text-diff(tiddler:"", field:"text", replace, replaceWith, flags:"", wholeWords:"")
|
||||
<$list filter="[<__tiddler__>get<__field__>minlength[1]]" variable=null emptyMessage="No tiddler is selected, or tiddler is empty.">
|
||||
<$list filter="[<__replace__>minlength[1]]" variable=null emptyMessage=<<nothing-to-replace """$tiddler$""" """$field$""">> >
|
||||
|
||||
<$wikify name="result"
|
||||
text="""<$macrocall $name="replace-text"
|
||||
tiddler=<<__tiddler__>> field=<<__field__>>
|
||||
replace=<<__replace__>>
|
||||
replaceWith=<<__replaceWith__>>
|
||||
flags=<<__flags__>>
|
||||
wholeWords=<<__wholeWords__>> />"""
|
||||
>
|
||||
<$diff-text source={{{ [<__tiddler__>get<__field__>] }}} dest=<<result>> cleanup={{$:/state/commander/snr/setting/cleanup}}/>
|
||||
</$wikify>
|
||||
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define replace-text-button(tiddler:"", field:"text", replace:"", replaceWith:"", flags:"", wholeWords:"")
|
||||
\whitespace trim
|
||||
<$list filter="[<__tiddler__>get<__field__>minlength[1]]" variable=null>
|
||||
<$list filter="[<__replace__>minlength[1]]" variable=null>
|
||||
<$wikify name="result"
|
||||
text="""<$macrocall $name="replace-text"
|
||||
tiddler=<<__tiddler__>>
|
||||
field=<<__field__>>
|
||||
replace=<<__replace__>>
|
||||
replaceWith=<<__replaceWith__>>
|
||||
flags=<<__flags__>>
|
||||
wholeWords=<<__wholeWords__>> />"""
|
||||
>
|
||||
<$reveal type="nomatch" default="title" text=<<__field__>> >
|
||||
<$action-setfield $tiddler=<<__tiddler__>> $field=<<__field__>> $value=<<result>>/>
|
||||
</$reveal>
|
||||
<$reveal type="match" default="title" text=<<__field__>> >
|
||||
<$action-sendmessage $message="tm-rename-tiddler" from=<<__tiddler__>> to=<<result>> />
|
||||
</$reveal>
|
||||
</$wikify>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,14 @@
|
||||
caption: Snr
|
||||
icon: $:/core/images/gitter
|
||||
list-after: $:/plugins/kookma/commander/inspect/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/snr/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
Search and replcae in tiddler fields!
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/SnrOps]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/snr/uicomp/replace-text"
|
||||
class:"tc-vertical cmd-tab-colorful cmd-tab-wd">>
|
||||
|
@ -0,0 +1,16 @@
|
||||
caption: Search and replace
|
||||
icon: $:/core/images/gitter
|
||||
tags: $:/tags/Commander/SnrOps
|
||||
title: $:/plugins/kookma/commander/snr/uicomp/replace-text
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<div class="cmd-snr-row">
|
||||
<div class="cmd-snr-double-column">
|
||||
<<snr-ui-inputs>>
|
||||
</div>
|
||||
<div class="cmd-snr-column">
|
||||
<<snr-regexp-flags>>
|
||||
</div>
|
||||
</div>
|
||||
<<snr-ui-show-diffs>>
|
||||
<<snr-actions>>
|
@ -0,0 +1,10 @@
|
||||
.commander-alert {
|
||||
padding: 0.75rem 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
border: 1px dotted gray;
|
||||
border-radius: 0.25rem;
|
||||
color: #0c5460;
|
||||
background-color: #d1ecf1;
|
||||
border-color: #bee5eb;
|
||||
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/alert
|
||||
type: text/css
|
@ -0,0 +1,14 @@
|
||||
/**
|
||||
.cmd-btn{
|
||||
font-size:0.85em;
|
||||
font-size:300;
|
||||
color: #666666;
|
||||
background-color: #d8d8d8;
|
||||
padding: 3px 8px 3px 8px;
|
||||
border: 1px solid #a1a1a1;
|
||||
}
|
||||
**/
|
||||
|
||||
.cmd-btn-wd{
|
||||
width:20ch;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/buttons
|
||||
type: text/css
|
@ -0,0 +1,13 @@
|
||||
/*compInspect table*/
|
||||
.cmd-ci-table
|
||||
{border-collapse: collapse;}
|
||||
|
||||
.cmd-ci-table .leftcol{
|
||||
width:20%;
|
||||
vertical-align: top;
|
||||
text-align: right;
|
||||
background-color:#f0f0f0;
|
||||
}
|
||||
.cmd-ci-table .rightcol{
|
||||
width:650px;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/compInspect/table
|
||||
type: text/css
|
@ -0,0 +1,26 @@
|
||||
.kk-commander-log-note{
|
||||
font-style:italic; font-size:small;
|
||||
}
|
||||
.kk-commander-log-item {
|
||||
color:green;
|
||||
}
|
||||
|
||||
/* This is missing and I added it */
|
||||
.cmd-txt-area{
|
||||
min-width:25ch;
|
||||
}
|
||||
|
||||
.cmd-txt-area2{
|
||||
min-width:50ch;
|
||||
}
|
||||
|
||||
/* Correct this later*/
|
||||
.kk-cmd-label{
|
||||
display:inline-block;
|
||||
width:85px;
|
||||
}
|
||||
|
||||
.kk-cmd-label2{
|
||||
display:inline-block;
|
||||
width:120px;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/new
|
||||
type: text/css
|
@ -0,0 +1,7 @@
|
||||
.cmd-sl{
|
||||
width:8ch;
|
||||
}
|
||||
|
||||
.cmd-select-wd{
|
||||
min-width:25ch;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/select-width
|
||||
type: text/css
|
@ -0,0 +1,29 @@
|
||||
.cmd-snr-row {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
width: 100%;
|
||||
}
|
||||
.cmd-snr-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-basis: 100%;
|
||||
flex: 1
|
||||
}
|
||||
|
||||
.cmd-snr-double-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-basis: 100%;
|
||||
flex: 2
|
||||
}
|
||||
|
||||
@media screen and (min-width: 800px) {
|
||||
.cmd-snr-column {
|
||||
flex: 1
|
||||
}
|
||||
|
||||
.cmd-snr-double-column {
|
||||
flex: 2
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/snr/flexbox
|
||||
type: text/css
|
@ -0,0 +1,28 @@
|
||||
.cmd-snr-form{
|
||||
width:100%;
|
||||
}
|
||||
|
||||
.cmd-snr-textbox {
|
||||
width:100%;
|
||||
box-sizing: border-box;
|
||||
max-width:40ch;
|
||||
}
|
||||
|
||||
.cmd-snr-form select, .cmd-snr-form input{
|
||||
margin: 0.2rem;
|
||||
}
|
||||
.cmd-snr-form legend{
|
||||
background: #f5f5f5;
|
||||
padding: 3px 6px;
|
||||
}
|
||||
|
||||
.cmd-snr-form { padding:20px; }
|
||||
.cmd-snr-form .item { padding: 2px; margin:2px; }
|
||||
.cmd-snr-form .item label { display:inline-block; width:100px; margin-left:5px; }
|
||||
.cmd-snr-form .item input { display:inline-block; }
|
||||
.cmd-snr-form .item select { display:inline-block; }
|
||||
|
||||
/* only for relink checkbox on renaming tiddler */
|
||||
.cmd-snr-form .item-relink { padding: 2px; margin:2px; }
|
||||
|
||||
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/snr/form
|
||||
type: text/css
|
@ -0,0 +1,15 @@
|
||||
.kk-commander-tiddler-list {
|
||||
font-size:small;
|
||||
border-left:0.5px
|
||||
dotted grey;
|
||||
padding-left:10px;
|
||||
overflow-y:auto;
|
||||
max-width:100%;
|
||||
max-height:$(height)$;
|
||||
}
|
||||
|
||||
.kk-commander-columns1 { display:block; column-count:1; column-gap:1em; }
|
||||
.kk-commander-columns2 { display:block; column-count:2; column-gap:1em; }
|
||||
.kk-commander-columns3 { display:block; column-count:3; column-gap:1em; }
|
||||
.kk-commander-columns4 { display:block; column-count:4; column-gap:1em; }
|
||||
.kk-commander-columns5 { display:block; column-count:5; column-gap:1em; }
|
@ -0,0 +1,3 @@
|
||||
tags: $:/tags/Stylesheet
|
||||
title: $:/plugins/kookma/commander/stylesheet/tiddler-list
|
||||
type: text/css
|
@ -0,0 +1,53 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/tag/macros/add-remove-replace
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define add-new-tag-bulk(newTag:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore><!--check if filter is empty -->
|
||||
<$list filter="[<__newTag__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "add-new-tag-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>!tag<__newTag__>]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<__newTag__>> />
|
||||
</$fieldmangler>
|
||||
<$macrocall $name="log-add-single-operation" msg="""new tag `$newTag$` added""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define remove-old-tag-bulk(oldTag:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore>
|
||||
<$list filter="[<__oldTag__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "remove-old-tag-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>tag<__oldTag__>]">
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<__oldTag__>> />
|
||||
</$fieldmangler>
|
||||
<$macrocall $name="log-add-single-operation" msg="""old tag `$oldTag$` removed""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
|
||||
\define replace-tag-bulk(oldTag:"", newTag:"")
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]limit[1]]" variable=ignore>
|
||||
<$list filter="[<__oldTag__>!is[blank]]" variable=null>
|
||||
<$list filter="[<__newTag__>!is[blank]]" variable=null>
|
||||
<<create-log-tiddler "replace-tag-bulk">>
|
||||
<$list filter="[subfilter<searchfilter>]">
|
||||
<$list filter="[<currentTiddler>tag<__oldTag__>]" variable=ignore
|
||||
emptyMessage="""<$macrocall $name="log-add-single-operation" msg="//has not tag `$oldTag$`. Operation ignored.//" tidItem=<<currentTiddler>> /> """>
|
||||
<$fieldmangler>
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<__newTag__>> />
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<__oldTag__>> />
|
||||
</$fieldmangler>
|
||||
<$macrocall $name="log-add-single-operation" msg="""tag `$oldTag$` replaced with `$newTag$`""" tidItem=<<currentTiddler>> />
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
@ -0,0 +1,10 @@
|
||||
caption: Tag
|
||||
list-after: $:/plugins/kookma/commander/title/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/tag/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/TagOps]!has[draft.of]]" default:"$:/plugins/kookma/commander/tag/uicomp/add-remove-tags"
|
||||
class:"tc-vertical cmd-tab-wd">>
|
||||
|
@ -0,0 +1,24 @@
|
||||
caption: Add remove tags
|
||||
tags: $:/tags/Commander/TagOps
|
||||
title: $:/plugins/kookma/commander/tag/uicomp/add-remove-tags
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<label class="kk-cmd-label">New tag</label><$edit-text
|
||||
tiddler="$:/temp/commander/tag-add-remove/new"
|
||||
tag="input"
|
||||
default=""
|
||||
class="cmd-txt-area"
|
||||
placeholder=" new tag"/>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Add new tag
|
||||
<$macrocall $name="add-new-tag-bulk" newTag={{$:/temp/commander/tag-add-remove/new}} />
|
||||
</$button>
|
||||
|
||||
<label class="kk-cmd-label">Old tag</label><$select class="cmd-select-wd" tiddler="$:/temp/commander/tag-add-remove/old" default="" >
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]tags[]sort[]]-[<workingTag>]" >
|
||||
<option><$view field="title"/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Remove old tag
|
||||
<$macrocall $name="remove-old-tag-bulk" oldTag={{$:/temp/commander/tag-add-remove/old}} />
|
||||
</$button>
|
||||
|
@ -0,0 +1,25 @@
|
||||
caption: Replace tags
|
||||
list-after: $:/plugins/kookma/commander/tag/uicomp/add-remove-tags
|
||||
tags: $:/tags/Commander/TagOps
|
||||
title: $:/plugins/kookma/commander/tag/uicomp/replace-tags
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<label class="kk-cmd-label">Old tag</label><$select class="cmd-select-wd" tiddler="$:/temp/commander/replace-tags/old" default="">
|
||||
<$list filter="[subfilter<searchfilter>!is[missing]tags[]sort[]]-[<workingTag>]" >
|
||||
<option><$view field="title"/></option>
|
||||
</$list>
|
||||
</$select>
|
||||
|
||||
<label class="kk-cmd-label">New tag</label><$edit-text
|
||||
tiddler="$:/temp/commander/replace-tags/new"
|
||||
tag="input"
|
||||
default=""
|
||||
class="cmd-txt-area"
|
||||
placeholder=" new tag"
|
||||
/>
|
||||
<$button class="cmd-btn cmd-btn-wd"> Replace tag
|
||||
<$macrocall $name="replace-tag-bulk"
|
||||
oldTag={{$:/temp/commander/replace-tags/old}}
|
||||
newTag={{$:/temp/commander/replace-tags/new}} />
|
||||
</$button>
|
||||
|
@ -0,0 +1,6 @@
|
||||
caption: base
|
||||
tags: $:/tags/Commander/Template
|
||||
title: $:/plugins/kookma/commander/template/base
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
This is a simple one!
|
@ -0,0 +1,35 @@
|
||||
caption: documentation
|
||||
tags: $:/tags/Commander/Template
|
||||
title: $:/plugins/kookma/commander/template/doc
|
||||
type: text/vnd.tiddlywiki
|
||||
version: beta
|
||||
|
||||
!! Introduction
|
||||
<<<
|
||||
short introduction
|
||||
<<<
|
||||
|
||||
!! Content and parameters
|
||||
<<<
|
||||
The content, attributes and parameters
|
||||
|
||||
|!Parameter |!Description |
|
||||
|par1 |description |
|
||||
|par2 |description |
|
||||
<<<
|
||||
|
||||
!! Example i
|
||||
<<<
|
||||
example here
|
||||
<<<
|
||||
|
||||
!! Example ii
|
||||
<<<
|
||||
another example here
|
||||
<<<
|
||||
|
||||
!! References
|
||||
<<<
|
||||
# one
|
||||
# Two
|
||||
<<<
|
@ -0,0 +1,29 @@
|
||||
caption: simple
|
||||
tags: $:/tags/Commander/Template
|
||||
title: $:/plugins/kookma/commander/template/simple
|
||||
type: text/vnd.tiddlywiki
|
||||
version: beta
|
||||
|
||||
! Heading one
|
||||
This is sunsection i
|
||||
|
||||
!! Heading two
|
||||
This is subsection ii.
|
||||
|
||||
* one
|
||||
* two
|
||||
* three
|
||||
|
||||
!!! Heading three
|
||||
This is subsction iii
|
||||
|
||||
```
|
||||
A sample code
|
||||
```
|
||||
|
||||
!! Sample table
|
||||
|Table 1. This is caption|c
|
||||
|Heading one|Heading Two|Heading Three|h
|
||||
|r1|100|200|
|
||||
|r2|02|03|
|
||||
|r3|-1|-2|
|
@ -0,0 +1,57 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/tiddler/macros/create
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define log-create(msg:"Tiddler existed, operation ignored")
|
||||
<$action-setfield $tiddler={{$:/state/commander/log-tiddler}} $index="$(newTitle)$" $value="$msg$" />
|
||||
\end
|
||||
|
||||
\define bulk-tiddler-creator(baseTitle, baseTags, datafieldsTid, numberTiddler:"1")
|
||||
<$list filter="[<__baseTitle__>!is[blank]]" variable=ignore>
|
||||
<<create-log-tiddler "bulk-tiddler-creator">>
|
||||
<$list filter="[range[9]addprefix[00]] [range[10,99]addprefix[0]] [range[100,500]] +[limit<__numberTiddler__>]" variable="L1">
|
||||
<$list filter="[<__baseTitle__>addsuffix<L1>]" variable="newTitle">
|
||||
<$list filter="[<newTitle>] -[has[title]]" variable="ignore" emptyMessage=<<log-create>> >
|
||||
<$action-createtiddler $basetitle=<<newTitle>> tags=<<__baseTags__>> />
|
||||
<$vars datafieldsTid=<<__datafieldsTid__>> >
|
||||
<<add-bulk-fields>>
|
||||
</$vars>
|
||||
<<log-create "Tiddler created">>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define oneTid-with-template()
|
||||
<$tiddler tiddler=<<newTitle>> >
|
||||
<$action-setfield $tiddler=<<myTemplate>> title=<<currentTiddler>> />
|
||||
<$fieldmangler>
|
||||
<$list filter="[enlist<myTags>]" variable=newTag>
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<newTag>> />
|
||||
</$list><!--next remove extra tag used by template from new created tiddler-->
|
||||
<$action-sendmessage $message="tm-remove-tag" $param="$:/tags/Commander/Template" />
|
||||
</$fieldmangler>
|
||||
</$tiddler>
|
||||
\end
|
||||
|
||||
|
||||
\define bulk-tiddler-with-template-creator(baseTitle, baseTags, datafieldsTid, numberTiddler:"1", template:"")
|
||||
<$list filter="[<__baseTitle__>!is[blank]]" variable=ignore>
|
||||
<<create-log-tiddler "bulk-tiddler-creator with template">>
|
||||
<$vars datafieldsTid=<<__datafieldsTid__>>
|
||||
myTags=<<__baseTags__>>
|
||||
myTemplate=<<__template__>> >
|
||||
<$list filter="[range[9]addprefix[00]] [range[10,99]addprefix[0]] [range[100,500]] +[limit<__numberTiddler__>]" variable="L1">
|
||||
<$list filter="[<__baseTitle__>addsuffix<L1>]" variable="newTitle">
|
||||
<$list filter="[<newTitle>!has[title]]" variable="ignore" emptyMessage=<<log-create>> >
|
||||
<<oneTid-with-template>>
|
||||
<<add-bulk-fields>>
|
||||
<<log-create "Tiddler created">>
|
||||
</$list>
|
||||
</$list>
|
||||
</$list>
|
||||
</$vars>
|
||||
</$list>
|
||||
\end
|
||||
|
@ -0,0 +1,17 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/tiddler/macros/delete
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define log-delete-selectively(item, msg:"Tiddler deleted")
|
||||
<$action-setfield $tiddler={{$:/state/commander/log-tiddler}} $index=<<__item__>> $value="$msg$" />
|
||||
\end
|
||||
|
||||
\define delete-tiddlers-selective-bulk()
|
||||
<$list filter="[subfilter<searchfilter>limit[1]]" variable="ignore"><!-- at least searchfilter shall return one tiddler-->
|
||||
<<create-log-tiddler "delete-tiddler-selectively">>
|
||||
<$list filter="[subfilter<searchfilter>]" variable="Item">
|
||||
<$action-deletetiddler $tiddler=<<Item>> />
|
||||
<$macrocall $name="log-delete-selectively" item=<<Item>> />
|
||||
</$list>
|
||||
</$list>
|
||||
\end
|
@ -0,0 +1,61 @@
|
||||
tags: $:/tags/Commander/Macro
|
||||
title: $:/plugins/kookma/commander/tiddler/macros/export
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
\define add-export-tag()
|
||||
<$list filter=<<searchfilter>> >
|
||||
<$fieldmangler>
|
||||
<$list filter="[enlist{$(exportTagTid)$}]~[[exported]]" variable="exportTag" ><!-- add all export tags-->
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<exportTag>> />
|
||||
</$list>
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<workingTag>> />
|
||||
</$fieldmangler>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define remove-export-tag()
|
||||
<$list filter=<<searchfilter>> >
|
||||
<$fieldmangler>
|
||||
<$list filter="[<selectiveOpsTid>get[text]match[yes]]" variable=ignore>
|
||||
<$action-sendmessage $message="tm-add-tag" $param=<<workingTag>> />
|
||||
</$list>
|
||||
<$list filter="[enlist{$(exportTagTid)$}]~[[exported]]" variable="exportTag" ><!-- remove all export tags-->
|
||||
<$action-sendmessage $message="tm-remove-tag" $param=<<exportTag>> />
|
||||
</$list>
|
||||
</$fieldmangler>
|
||||
</$list>
|
||||
\end
|
||||
|
||||
\define log-export-selectively(msg:"Tiddler exported")
|
||||
<$list filter="[subfilter<searchfilter>]" variable="item">
|
||||
<$action-setfield $tiddler={{$:/state/commander/log-tiddler}} $index=<<item>> $value="$msg$" />
|
||||
</$list>
|
||||
\end
|
||||
|
||||
|
||||
\define commander-exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers")
|
||||
<span class="tc-popup-keep"><$button popup=<<qualify "$:/state/popup/export">> tooltip={{$lingoBase$Hint}} aria-label={{$lingoBase$Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected">
|
||||
<$list filter="[<tv-config-toolbar-icons>match[yes]]">
|
||||
{{$:/core/images/export-button}}
|
||||
</$list>
|
||||
<$list filter="[<tv-config-toolbar-text>match[yes]]">
|
||||
<span class="tc-btn-text"><$text text={{$lingoBase$Caption}}/></span>
|
||||
</$list>
|
||||
</$button></span><$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes">
|
||||
<div class="tc-drop-down">
|
||||
<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]">
|
||||
<$set name="extension" value={{!!extension}}>
|
||||
<$button class="tc-btn-invisible">
|
||||
<<create-log-tiddler "exportButton: bulk tiddlers exported">>
|
||||
<$macrocall $name="log-export-selectively"/><!--log any tiddler exported-->
|
||||
<<add-export-tag>><!-- by Mohammad-->
|
||||
<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter="""$exportFilter$""" filename=<<exportButtonFilename """$baseFilename$""">>/>
|
||||
<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/>
|
||||
<$transclude field="description"/>
|
||||
<<remove-export-tag>><!-- by Mohammad-->
|
||||
</$button>
|
||||
</$set>
|
||||
</$list>
|
||||
</div>
|
||||
</$reveal>
|
||||
\end
|
@ -0,0 +1,10 @@
|
||||
caption: Tiddler
|
||||
list-before: $:/plugins/kookma/commander/title/ui
|
||||
tags: $:/tags/Commander
|
||||
title: $:/plugins/kookma/commander/tiddler/ui
|
||||
type: text/vnd.tiddlywiki
|
||||
|
||||
<<tabs
|
||||
tabsList:"[all[shadows+tiddlers]tag[$:/tags/Commander/TiddlerOps]!has[draft.of]]"
|
||||
default:"$:/plugins/kookma/commander/tiddler/uicomp/create-tiddlers"
|
||||
class:"tc-vertical cmd-tab-colorful cmd-tab-wd">>
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user