diff --git a/core/language/en-GB/Import.multids b/core/language/en-GB/Import.multids index 30a30cf06..1b1c6f219 100644 --- a/core/language/en-GB/Import.multids +++ b/core/language/en-GB/Import.multids @@ -14,6 +14,7 @@ Listing/Preview/Fields: Fields Listing/Preview/Diff: Diff Listing/Preview/DiffFields: Diff (Fields) Listing/Rename/Tooltip: Rename tiddler before importing +Listing/Rename/Prompt: Rename to: Listing/Rename/ConfirmRename : Rename tiddler Listing/Rename/CancelRename : Cancel Upgrader/Plugins/Suppressed/Incompatible: Blocked incompatible or obsolete plugin diff --git a/core/templates/external-js/save-all-external-js.tid b/core/templates/external-js/save-all-external-js.tid index 49b80d390..51f6d6508 100644 --- a/core/templates/external-js/save-all-external-js.tid +++ b/core/templates/external-js/save-all-external-js.tid @@ -2,6 +2,6 @@ title: $:/core/save/all-external-js \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] \define saveTiddlerFilter() -[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ +[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/core]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ \end {{$:/core/templates/tiddlywiki5-external-js.html}} diff --git a/core/templates/save-all.tid b/core/templates/save-all.tid index cb55922dd..b298ad49f 100644 --- a/core/templates/save-all.tid +++ b/core/templates/save-all.tid @@ -2,6 +2,6 @@ title: $:/core/save/all \import [[$:/core/ui/PageMacros]] [all[shadows+tiddlers]tag[$:/tags/Macro]!has[draft.of]] \define saveTiddlerFilter() -[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ +[is[tiddler]] -[prefix[$:/state/popup/]] -[prefix[$:/temp/]] -[prefix[$:/HistoryList]] -[status[pending]plugin-type[import]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] $(publishFilter)$ \end {{$:/core/templates/tiddlywiki5.html}} diff --git a/core/ui/AdvancedSearch/Shadows.tid b/core/ui/AdvancedSearch/Shadows.tid index 0647b45a4..ac9628b09 100644 --- a/core/ui/AdvancedSearch/Shadows.tid +++ b/core/ui/AdvancedSearch/Shadows.tid @@ -11,7 +11,7 @@ first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/ \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\define input-accept-variant-actions() <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\define input-accept-variant-actions() <$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> <> diff --git a/core/ui/AdvancedSearch/Standard.tid b/core/ui/AdvancedSearch/Standard.tid index 5c91bee28..daf1d9257 100644 --- a/core/ui/AdvancedSearch/Standard.tid +++ b/core/ui/AdvancedSearch/Standard.tid @@ -11,7 +11,7 @@ caption: {{$:/language/Search/Standard/Caption}} \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\define input-accept-variant-actions() <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\define input-accept-variant-actions() <$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> <> diff --git a/core/ui/AdvancedSearch/System.tid b/core/ui/AdvancedSearch/System.tid index 19877db4f..8d7bfb274 100644 --- a/core/ui/AdvancedSearch/System.tid +++ b/core/ui/AdvancedSearch/System.tid @@ -10,7 +10,7 @@ first-search-filter: [is[system]searchsort[title]limit[250]] -[[$:/te \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\define input-accept-variant-actions() <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\define input-accept-variant-actions() <$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> <> diff --git a/core/ui/ImportListing.tid b/core/ui/ImportListing.tid index f6797489f..7a551def3 100644 --- a/core/ui/ImportListing.tid +++ b/core/ui/ImportListing.tid @@ -21,7 +21,7 @@ $(currentTiddler)$!!popup-$(payloadTiddler)$ \end \define renameFieldState() -$:/state/import-rename-$(payloadTiddler)$ +$(currentTiddler)$!!state-rename-$(payloadTiddler)$ \end \define select-all-actions() @@ -51,27 +51,34 @@ $:/state/import-rename-$(payloadTiddler)$ <$checkbox field=<> checked="checked" unchecked="unchecked" default="checked"/> -<$reveal type="nomatch" stateTitle=<> text="yes" tag="div"> -<$reveal type="nomatch" state=<> text="yes" tag="div"> -<$button class="tc-btn-invisible tc-btn-dropdown" set=<> setTo="yes"> -{{$:/core/images/right-arrow}}<$text text={{{[getminlength[1]else]}}}/> +<$reveal type="nomatch" state=<> text="yes" tag="div"> +<$reveal type="nomatch" state=<> text="yes" tag="div" class="tc-flex"> +<$button class="tc-btn-invisible tc-btn-dropdown tc-flex-grow-1" set=<> setTo="yes"> +{{$:/core/images/right-arrow}}<$text text={{{[getminlength[1]else]}}}/> -<$button class="tc-btn-invisible" setTitle=<> setTo="yes" tooltip={{{[addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}} +<$button class="tc-btn-invisible tc-small-gap-left" set=<> setTo="yes" tooltip={{{[addsuffix[Listing/Rename/Tooltip]get[text]]}}}>{{$:/core/images/edit-button}} <$reveal type="match" state=<> text="yes" tag="div"> <$button class="tc-btn-invisible tc-btn-dropdown" set=<> setTo="no"> -{{$:/core/images/down-arrow}}<$text text=<>/> +{{$:/core/images/down-arrow}}<$text text={{{[getminlength[1]else]}}}/> -<$reveal type="match" stateTitle=<> text="yes" tag="div"> -<$edit-text tiddler=<> default=<> tag="input" class="tc-import-rename"/><$button class="tc-btn-invisible" setTitle=<> setTo="no" tooltip={{{[addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<>/> <$button class="tc-btn-invisible" setTitle=<> setTo="no" tooltip={{{[addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<> $value={{{[get[text]minlength[1]else]}}} /><$action-deletetiddler $tiddler=<>/> +<$reveal type="match" state=<> text="yes" tag="div"> +<$text text={{{[addsuffix[Listing/Rename/Prompt]get[text]]}}}/> <$view field=<>/> +<$reveal type="match" state=<> text="yes" tag="tr"> + +
+<$edit-text tiddler=<> default={{{[getminlength[1]else]}}} tag="input" class="tc-import-rename tc-flex-grow-1"/><$button class="tc-btn-invisible" set=<> setTo="no" tooltip={{{[addsuffix[Listing/Rename/CancelRename]get[text]]}}}>{{$:/core/images/close-button}}<$action-deletetiddler $tiddler=<>/><$button class="tc-btn-invisible" set=<> setTo="no" tooltip={{{[addsuffix[Listing/Rename/ConfirmRename]get[text]]}}}>{{$:/core/images/done-button}}<$action-setfield $field=<> $value={{{[get[text]minlength[1]else]}}} /><$action-deletetiddler $tiddler=<>/> +
+ + <$reveal type="match" text="yes" state=<> tag="div"> @@ -84,3 +91,4 @@ $:/state/import-rename-$(payloadTiddler)$ + diff --git a/core/ui/SideBarSegments/search.tid b/core/ui/SideBarSegments/search.tid index 5ed96f1f5..3235afc6d 100644 --- a/core/ui/SideBarSegments/search.tid +++ b/core/ui/SideBarSegments/search.tid @@ -38,7 +38,7 @@ tags: $:/tags/SideBarSegment \define input-accept-actions() <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> -\define input-accept-variant-actions() <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> +\define input-accept-variant-actions() <$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> \define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<>/>"""/> diff --git a/core/wiki/config/shortcuts/shortcuts.multids b/core/wiki/config/shortcuts/shortcuts.multids index 92e9c89e9..4968dbb5c 100644 --- a/core/wiki/config/shortcuts/shortcuts.multids +++ b/core/wiki/config/shortcuts/shortcuts.multids @@ -2,7 +2,7 @@ title: $:/config/shortcuts/ add-field: enter advanced-search: ctrl-shift-A -advanced-search-sidebar: ctrl-Enter +advanced-search-sidebar: alt-Enter cancel-edit-tiddler: escape excise: ctrl-E sidebar-search: ctrl-shift-F @@ -13,7 +13,7 @@ heading-4: ctrl-4 heading-5: ctrl-5 heading-6: ctrl-6 input-accept: Enter -input-accept-variant: Alt-Enter +input-accept-variant: ctrl-Enter input-cancel: Escape input-down: Down input-tab-left: alt-Left diff --git a/editions/tw5.com/tiddlers/filters/examples/reduce Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/reduce Operator (Examples).tid index 80f62582b..9d92ea0c8 100644 --- a/editions/tw5.com/tiddlers/filters/examples/reduce Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/examples/reduce Operator (Examples).tid @@ -6,14 +6,19 @@ type: text/vnd.tiddlywiki \define add-price() [get[price]multiply{!!quantity}add] \define num-items() [get[quantity]add] +\define join-with-commas() [compare:number:gt[0]thenaddsuffix[, ]addsuffixelse] \define display-variable(name) ''<$text text=<<__name__>>/>'': <$text text={{{ [<__name__>getvariable[]] }}}/> \end +\define reduce-tip() +Remember that <<.op reduce>> always produces output, so <<.op else>> will never trigger after <<.op reduce>>. +\end These examples use the following predefined variables: * <> * <> +* <> They also use the following data tiddlers: @@ -32,3 +37,25 @@ Number of items: Total price: <<.operator-example 2 "[tag[shopping]reduce]">> + +Using `` to act differently on the first item than the rest: + +<<.operator-example 3 "[tag[shopping]reduce]">> + +Empty input, no suffix: + +<<.operator-example 4 "[tag[non-existent]reduce]">> + +Note how the output contains a single item with no text. This is not "empty output" for the purposes of the <<.op else>> operator. + +<$macrocall $name=".tip" _=<> /> + +Empty input, no suffix, followed by <<.op else>>: + +<<.operator-example 5 "[tag[non-existent]reduceelse[0]]">> + +Note how the output still contains a single item with no text: <<.op else>> did not trigger. If you want the value to be 0 when <<.op reduce>> has no items to process, you need to specify 0 as the initial value by passing it as a suffix to <<.op reduce>>. + +Empty input, suffix provided: + +<<.operator-example 6 "[tag[non-existent]reduce:0]">> diff --git a/editions/tw5.com/tiddlers/filters/reduce.tid b/editions/tw5.com/tiddlers/filters/reduce.tid index fae41a1eb..d47955da3 100644 --- a/editions/tw5.com/tiddlers/filters/reduce.tid +++ b/editions/tw5.com/tiddlers/filters/reduce.tid @@ -12,6 +12,10 @@ tags: [[Filter Operators]] title: reduce Operator type: text/vnd.tiddlywiki +\define reduce-tip() +The <<.op reduce>> operator will always produce output, even if its input was empty. If its input is empty, the output of <<.op reduce>> will be the initial value of the accumulator, i.e. the value of the suffix. One result of this fact is that the <<.op else>> operator will never be triggered if it follows a <<.op reduce>>. The "Empty input" examples show what happens when <<.op reduce>> receives no input. +\end + <<.from-version "5.1.23">> The <<.op reduce>> operator runs a subfilter for each input title, passing the result of the previous subfilter run as a variable. The initial value of the accumulator can optionally be specified. It returns the result of the final subfilter run. The <<.op reduce>> operator is used to flatten a list of items down to a single item by repeatedly applying a formula. A typical use is to add up the values in a given field of a list of tiddlers. @@ -24,4 +28,6 @@ The following variables are available within the subfilter: * ''revIndex'' - the reverse numeric index of the current list item (with zero being the last item in the list) * ''length'' - the total length of the input list +<$macrocall $name=".tip" _=<> /> + <<.operator-examples "reduce">> diff --git a/languages/zh-Hans/Import.multids b/languages/zh-Hans/Import.multids index a645a7d3c..7f5a59c8d 100644 --- a/languages/zh-Hans/Import.multids +++ b/languages/zh-Hans/Import.multids @@ -13,6 +13,9 @@ Listing/Preview/TextRaw: 文本 (原始) Listing/Preview/Fields: 字段 Listing/Preview/Diff: 差异 Listing/Preview/DiffFields: 差异 (字段) +Listing/Rename/Tooltip: 导入前重新命名条目 +Listing/Rename/ConfirmRename : 重新命名条目 +Listing/Rename/CancelRename : 取消 Upgrader/Plugins/Suppressed/Incompatible: 封锁的不兼容或过时插件 Upgrader/Plugins/Suppressed/Version: 封锁的插件 (由于传入的 <> 较现有版本 <> 旧) Upgrader/Plugins/Upgraded: 升级插件,从 <> 到 <> diff --git a/languages/zh-Hant/Import.multids b/languages/zh-Hant/Import.multids index b39ab3d31..f7ebb74d6 100644 --- a/languages/zh-Hant/Import.multids +++ b/languages/zh-Hant/Import.multids @@ -13,6 +13,9 @@ Listing/Preview/TextRaw: 文字 (原始) Listing/Preview/Fields: 欄位 Listing/Preview/Diff: 差異 Listing/Preview/DiffFields: 差異 (欄位) +Listing/Rename/Tooltip: 導入前重新命名條目 +Listing/Rename/ConfirmRename : 重新命名條目 +Listing/Rename/CancelRename : 取消 Upgrader/Plugins/Suppressed/Incompatible: 封鎖的不相容或過時插件 Upgrader/Plugins/Suppressed/Version: 封鎖的插件 (由於傳入的 <> 較現有版本 <> 舊) Upgrader/Plugins/Upgraded: 升級插件,從 <> 到 <> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 26aed618a..a5c7af4df 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2032,11 +2032,6 @@ html body.tc-body.tc-single-tiddler-window { width: 100%; } -input.tc-import-rename { - width: 85%; - margin-right: 0.5em; -} - /* ** Alerts */ @@ -2775,6 +2770,31 @@ select { fill: <>; } +/* +** Flexbox utility classes +*/ + +.tc-flex { + display: -webkit-flex; + display: flex; +} + +.tc-flex-column { + flex-direction: column; +} + +.tc-flex-row { + flex-direction: row; +} + +.tc-flex-grow-1 { + flex-grow: 1; +} + +.tc-flex-grow-2 { + flex-grow: 2; +} + /* ** Other utility classes */