1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-29 12:59:56 +00:00

Core macros don't allow pragmas in action strings (#7855)

* First commit

* Transclude preferred over macrocall
This commit is contained in:
Jeremy Ruston 2023-11-24 10:48:48 +00:00 committed by GitHub
parent d1c7f79dd2
commit ca41a8db04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 13 deletions

View File

@ -13,7 +13,7 @@ tags: $:/tags/Macro
$(colour-picker-update-recent)$ $(colour-picker-update-recent)$
$actions$ <$transclude $variable="__actions__"/>
<span style="display:inline-block; background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;"/> <span style="display:inline-block; background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;"/>
@ -23,7 +23,7 @@ $actions$
\define colour-picker-recent-inner(actions) \define colour-picker-recent-inner(actions)
\whitespace trim \whitespace trim
<$set name="colour-picker-value" value="$(recentColour)$"> <$set name="colour-picker-value" value="$(recentColour)$">
<$macrocall $name="colour-picker-inner" actions="""$actions$"""/> <$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
</$set> </$set>
\end \end
@ -31,7 +31,7 @@ $actions$
\whitespace trim \whitespace trim
{{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour"> {{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour">
&#32; &#32;
<$macrocall $name="colour-picker-recent-inner" actions="""$actions$"""/> <$macrocall $name="colour-picker-recent-inner" actions=<<__actions__>>/>
</$list> </$list>
\end \end
@ -39,13 +39,13 @@ $actions$
\whitespace trim \whitespace trim
<div class="tc-colour-chooser"> <div class="tc-colour-chooser">
<$macrocall $name="colour-picker-recent" actions="""$actions$"""/> <$macrocall $name="colour-picker-recent" actions=<<__actions__>>/>
--- ---
<$list filter="LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black" variable="colour-picker-value"> <$list filter="LightPink Pink Crimson LavenderBlush PaleVioletRed HotPink DeepPink MediumVioletRed Orchid Thistle Plum Violet Magenta Fuchsia DarkMagenta Purple MediumOrchid DarkViolet DarkOrchid Indigo BlueViolet MediumPurple MediumSlateBlue SlateBlue DarkSlateBlue Lavender GhostWhite Blue MediumBlue MidnightBlue DarkBlue Navy RoyalBlue CornflowerBlue LightSteelBlue LightSlateGrey SlateGrey DodgerBlue AliceBlue SteelBlue LightSkyBlue SkyBlue DeepSkyBlue LightBlue PowderBlue CadetBlue Azure LightCyan PaleTurquoise Cyan Aqua DarkTurquoise DarkSlateGrey DarkCyan Teal MediumTurquoise LightSeaGreen Turquoise Aquamarine MediumAquamarine MediumSpringGreen MintCream SpringGreen MediumSeaGreen SeaGreen Honeydew LightGreen PaleGreen DarkSeaGreen LimeGreen Lime ForestGreen Green DarkGreen Chartreuse LawnGreen GreenYellow DarkOliveGreen YellowGreen OliveDrab Beige LightGoldenrodYellow Ivory LightYellow Yellow Olive DarkKhaki LemonChiffon PaleGoldenrod Khaki Gold Cornsilk Goldenrod DarkGoldenrod FloralWhite OldLace Wheat Moccasin Orange PapayaWhip BlanchedAlmond NavajoWhite AntiqueWhite Tan BurlyWood Bisque DarkOrange Linen Peru PeachPuff SandyBrown Chocolate SaddleBrown Seashell Sienna LightSalmon Coral OrangeRed DarkSalmon Tomato MistyRose Salmon Snow LightCoral RosyBrown IndianRed Red Brown FireBrick DarkRed Maroon White WhiteSmoke Gainsboro LightGrey Silver DarkGrey Grey DimGrey Black" variable="colour-picker-value">
&#32; &#32;
<$macrocall $name="colour-picker-inner" actions="""$actions$"""/> <$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
</$list> </$list>
--- ---
@ -54,7 +54,7 @@ $actions$
&#32; &#32;
<$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/> <$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/>
<$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}> <$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}>
<$macrocall $name="colour-picker-inner" actions="""$actions$"""/> <$macrocall $name="colour-picker-inner" actions=<<__actions__>>/>
</$set> </$set>
</div> </div>

View File

@ -5,13 +5,13 @@ title: $:/core/macros/image-picker
type: text/vnd.tiddlywiki type: text/vnd.tiddlywiki
\define image-picker-thumbnail(actions) \define image-picker-thumbnail(actions)
<$button tag="a" tooltip="""$(imageTitle)$""">$actions$<$transclude tiddler=<<imageTitle>>/></$button> <$button tag="a" tooltip="""$(imageTitle)$"""><$transclude $variable="__actions__"/><$transclude tiddler=<<imageTitle>>/></$button>
\end \end
\define image-picker-list(filter,actions) \define image-picker-list(filter,actions)
\whitespace trim \whitespace trim
<$list filter="""$filter$""" variable="imageTitle"> <$list filter="""$filter$""" variable="imageTitle">
<$macrocall $name="image-picker-thumbnail" actions="""$actions$"""/> <$macrocall $name="image-picker-thumbnail" actions=<<__actions__>>/>
&#32; &#32;
</$list> </$list>
\end \end
@ -25,15 +25,15 @@ type: text/vnd.tiddlywiki
{{$:/language/SystemTiddlers/Include/Prompt}} {{$:/language/SystemTiddlers/Include/Prompt}}
</$checkbox> </$checkbox>
<$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div"> <$reveal state=<<state-system>> type="match" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions="""$actions$"""/> <$macrocall $name="image-picker-list" filter="""$filter$ +[!is[system]]""" actions=<<__actions__>>/>
</$reveal> </$reveal>
<$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div"> <$reveal state=<<state-system>> type="nomatch" text="hide" default="hide" tag="div">
<$macrocall $name="image-picker-list" filter="""$filter$""" actions="""$actions$"""/> <$macrocall $name="image-picker-list" filter="""$filter$""" actions=<<__actions__>>/>
</$reveal> </$reveal>
</$vars> </$vars>
</div> </div>
\end \end
\define image-picker-include-tagged-images(actions) \define image-picker-include-tagged-images(actions)
<$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions="""$actions$"""/> <$macrocall $name="image-picker" filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] -[type[application/pdf]] +[!has[draft.of]sort[title]]" actions=<<__actions__>>/>
\end \end

View File

@ -16,7 +16,7 @@ second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>" emptyMessage="<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter='-[<tag>]'/>"
> >
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/> <$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
$actions$ <$transclude $variable="__actions__"/>
</$list> </$list>
</$set> </$set>
<<delete-tag-state-tiddlers>> <<delete-tag-state-tiddlers>>
@ -102,7 +102,7 @@ second-search-filter: [tags[]is[system]search:title<userInput>sort[]]
<$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}> <$set name="tag" value={{{ [<newTagNameTiddler>get[text]] }}}>
<$button set=<<newTagNameTiddler>> setTo="" class=""> <$button set=<<newTagNameTiddler>> setTo="" class="">
<$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/> <$action-listops $tiddler=<<saveTiddler>> $field=<<__tagField__>> $subfilter="[<tag>trim[]]"/>
$actions$ <$transclude $variable="__actions__"/>
<$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}> <$set name="currentTiddlerCSSEscaped" value={{{ [<saveTiddler>escapecss[]] }}}>
<<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/> <<delete-tag-state-tiddlers>><$action-sendmessage $message="tm-focus-selector" $param=<<get-tagpicker-focus-selector>>/>
</$set> </$set>