From 6b23de81d81279171fd46ecda107c91ff7e00634 Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Thu, 21 Nov 2024 22:03:15 +0800 Subject: [PATCH] Migrate some old macros to new syntax --- core/wiki/macros/colour-picker.tid | 39 +++++++++++++++--------------- core/wiki/macros/translink.tid | 26 ++++++++++---------- 2 files changed, 32 insertions(+), 33 deletions(-) diff --git a/core/wiki/macros/colour-picker.tid b/core/wiki/macros/colour-picker.tid index 7a607a551..ecbc87d2c 100644 --- a/core/wiki/macros/colour-picker.tid +++ b/core/wiki/macros/colour-picker.tid @@ -1,58 +1,57 @@ title: $:/core/macros/colour-picker tags: $:/tags/Macro -\define colour-picker-update-recent() +\procedure colour-picker-update-recent() <$action-listops $tiddler="$:/config/ColourPicker/Recent" - $subfilter="$(colour-picker-value)$ [list[$:/config/ColourPicker/Recent]remove[$(colour-picker-value)$]] +[limit[8]]" + $subfilter="[] [list[$:/config/ColourPicker/Recent]remove] +[limit[8]]" /> \end -\define colour-picker-inner(actions) -<$button tag="a" tooltip="""$(colour-picker-value)$"""> -$(colour-picker-update-recent)$ -<$transclude $variable="__actions__"/> - - - +\procedure colour-picker-inner(actions) +<$button tag="a" tooltip=<>> +<> +<$transclude $variable="actions"/> +> style.width="100%" style.height="100%" style.borderRadius="50%"/> \end -\define colour-picker-recent-inner(actions) +\procedure colour-picker-recent-inner(actions) \whitespace trim -<$set name="colour-picker-value" value="$(recentColour)$"> -<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> +<$set name="colour-picker-value" value=<>> +<$transclude $variable="colour-picker-inner" actions=<>/> \end -\define colour-picker-recent(actions) +\procedure colour-picker-recent(actions) \whitespace trim {{$:/language/ColourPicker/Recent}}<$list filter="[list[$:/config/ColourPicker/Recent]]" variable="recentColour"> -<$macrocall $name="colour-picker-recent-inner" actions=<<__actions__>>/> +<$transclude $variable="colour-picker-recent-inner" actions=<>/> \end -\define colour-picker(actions) +\procedure colour-picker(actions) \whitespace trim
-<$macrocall $name="colour-picker-recent" actions=<<__actions__>>/> +<$transclude $variable="colour-picker-recent" 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"> -<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> +<$transclude $variable="colour-picker-inner" actions=<>/> --- -<$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder=""/> - +<$edit-text tiddler="$:/config/ColourPicker/New" tag="input" default="" placeholder="" class="tc-small-gap-right"/> <$edit-text tiddler="$:/config/ColourPicker/New" type="color" tag="input"/> <$set name="colour-picker-value" value={{$:/config/ColourPicker/New}}> -<$macrocall $name="colour-picker-inner" actions=<<__actions__>>/> +<%if [{$:/config/ColourPicker/New}!is[blank]] %> +<$transclude $variable="colour-picker-inner" actions=<>/> +<%endif%>
diff --git a/core/wiki/macros/translink.tid b/core/wiki/macros/translink.tid index 9cc465422..1301c8606 100644 --- a/core/wiki/macros/translink.tid +++ b/core/wiki/macros/translink.tid @@ -1,28 +1,28 @@ title: $:/core/macros/translink tags: $:/tags/Macro -\define translink(title,mode:"block") +\procedure translink(title,mode:"block") \whitespace trim -<$list filter="[<__mode__>match[block]]"> +<%if [match[block]] %>