From 189b6016b62c54087ce70d5923c293a2efa22698 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sat, 27 Jul 2024 15:43:10 +0200 Subject: [PATCH 01/68] Fix empty-tag-node-template. removing redundant DOM elements if no list is shown (#8432) --- editions/tw5.com/tiddlers/empty-tag-node-template.tid | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/editions/tw5.com/tiddlers/empty-tag-node-template.tid b/editions/tw5.com/tiddlers/empty-tag-node-template.tid index 6827c6fe2..79905b77c 100644 --- a/editions/tw5.com/tiddlers/empty-tag-node-template.tid +++ b/editions/tw5.com/tiddlers/empty-tag-node-template.tid @@ -5,7 +5,8 @@ tags: $:/tags/ViewTemplate title: $:/editions/tw5.com/empty-tag-node-template type: -<$list filter='[!has[text]!has[tags]] :filter[tagging[]]'> +<% if [!has[text]!has[tags]tagging[]] %> The following tiddlers are tagged with <>: - -<!has[text]!has[tags]tagging[]]" class:"multi-columns">> \ No newline at end of file + +<!has[text]!has[tags]tagging[]]" class:"multi-columns">> +<% endif %> \ No newline at end of file From 6002235db722b7fecf317a4420ff3e6f026ede52 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:10:58 +0330 Subject: [PATCH 02/68] Replace Macro with Myfun when Calling Example Function (#8277) --- editions/tw5.com/tiddlers/functions/Functions.tid | 14 +++++++------- ...es depends on how the variable was declared.tid | 10 +++++----- ...ur of variables invoked via normal wikitext.tid | 4 ++-- ... of variables invoked via widget attributes.tid | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/editions/tw5.com/tiddlers/functions/Functions.tid b/editions/tw5.com/tiddlers/functions/Functions.tid index dadce73a1..028747a34 100644 --- a/editions/tw5.com/tiddlers/functions/Functions.tid +++ b/editions/tw5.com/tiddlers/functions/Functions.tid @@ -1,5 +1,5 @@ created: 20221009124003601 -modified: 20230419103154328 +modified: 20240619211228560 tags: Concepts Reference title: Functions type: text/vnd.tiddlywiki @@ -11,17 +11,17 @@ type: text/vnd.tiddlywiki Functions are usually defined with the [[Pragma: \function]]: ``` -\function my-function(parameter:"2") -[multiply[1.5]] +\function myfun(param:"2") +[multiply[1.5]] \end ``` Functions can be invoked in several ways: -* Directly transclude functions with the syntax `<>` -* Assign functions to widget attributes with the syntax `
>>` -* Invoke functions via the [[function Operator]] with the syntax `[function[myfn],[value],...]` -* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fn[value]]` or `[.myfn[value]]` +* Directly transclude functions with the syntax `<>` +* Assign functions to widget attributes with the syntax `
>>` +* Invoke functions via the [[function Operator]] with the syntax `[function[myfun],[value],...]` +* Directly invoke functions whose names contain a period as custom filter operators with the syntax `[my.fun[value]]` or `[.myfun[value]]` !! How Functions Work diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid index 319bf2c78..98fbf6b28 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of invoked variables depends on how the variable was declared.tid @@ -1,5 +1,5 @@ created: 20230726145210484 -modified: 20230726145757234 +modified: 20240619211734149 tags: [[Variable Usage]] title: Behaviour of invoked variables depends on how the variable was declared type: text/vnd.tiddlywiki @@ -8,19 +8,19 @@ type: text/vnd.tiddlywiki \procedure p1(a1) $a1$ - <<__a1__>> - <> \function f1(a1) "$a1$" "-" [<__a1__>] ="-" [] :and[join[ ]] -Invoked in normal wikitext context: `<$transclude $variable=macro/>` or `<>` +Invoked in normal wikitext context: `<$transclude $variable=myvar/>` or `<>` {{Behaviour of variables invoked via normal wikitext}} -Invoked via widget attribute: `
>/>` +Invoked via widget attribute: `
>/>` {{Behaviour of variables invoked via widget attributes}} -Invoked via filter operator parameter: `[]` +Invoked via filter operator parameter: `[]` {{Behaviour of variables invoked via filter operator parameter}} -Invoked via function call in a filter expression: `[function[macro]]` +Invoked via function call in a filter expression: `[function[.myfun]]` {{Behaviour of variables invoked via filter expression function call}} diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid index 0caa74c26..0eae9acff 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via normal wikitext.tid @@ -1,5 +1,5 @@ created: 20230726142925020 -modified: 20230726150648189 +modified: 20240619211452297 tags: [[Variable Usage]] title: Behaviour of variables invoked via normal wikitext type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|All wikitext and variable substitution and textual substitution takes place| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|All wikitext and variable substitution takes place| -|\function|Invoking a function in this way (`<>`) is a synonym for `<$text text={{{[function[macro]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file +|\function|Invoking a function in this way (`<<.myfun>>`) is a synonym for `<$text text={{{[function[.myfun]]}}}/>`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded| \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid index 3bf06e219..3784c94e3 100644 --- a/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid +++ b/editions/tw5.com/tiddlers/variables/Behaviour of variables invoked via widget attributes.tid @@ -1,5 +1,5 @@ created: 20230726143332803 -modified: 20230726150616232 +modified: 20240619210723396 tags: [[Variable Usage]] title: Behaviour of variables invoked via widget attributes type: text/vnd.tiddlywiki @@ -8,4 +8,4 @@ type: text/vnd.tiddlywiki |!how declared|!behaviour| |\define|Textual substitution of parameters is performed on the body text. No further processing takes place. The result after textual substitution is used as the attribute's value| |<<.wlink SetWidget>>, <<.wlink LetWidget>>, <<.wlink VarsWidget>>, \procedure, \widget|Body text is retrieved as-is and used as the attribute's value.| -|\function|When a function is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file +|\function|When a function (e.g. `.myfun`) is invoked as `
>/>`, it is a synonym for `
`. As with any filtered transclusion (i.e. triple curly braces), all results except the first are discarded. That first result is used as the attribute's value. Note that functions are recursively processed even when invoked in this form. In other words a filter expression in a function can invoke another function and the processing will continue| \ No newline at end of file From 82bf4480de5784eaf4dd07249013ba9e435063c1 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:11:53 +0330 Subject: [PATCH 03/68] Add Shortcut to Open Control Panel (#8439) This PR adds a new keyboard shortcut key for opening the $:/ControlPanel --- core/language/en-GB/Buttons.multids | 1 + core/ui/KeyboardShortcuts/open-control-panel.tid | 8 ++++++++ core/wiki/config/ShortcutInfo.multids | 1 + core/wiki/config/shortcuts/shortcuts.multids | 1 + 4 files changed, 11 insertions(+) create mode 100644 core/ui/KeyboardShortcuts/open-control-panel.tid diff --git a/core/language/en-GB/Buttons.multids b/core/language/en-GB/Buttons.multids index 15273d18e..30f89eec7 100644 --- a/core/language/en-GB/Buttons.multids +++ b/core/language/en-GB/Buttons.multids @@ -80,6 +80,7 @@ NewMarkdown/Caption: new Markdown tiddler NewMarkdown/Hint: Create a new Markdown tiddler NewTiddler/Caption: new tiddler NewTiddler/Hint: Create a new tiddler +OpenControlPanel/Hint: Open control panel OpenWindow/Caption: open in new window OpenWindow/Hint: Open tiddler in new window Palette/Caption: palette diff --git a/core/ui/KeyboardShortcuts/open-control-panel.tid b/core/ui/KeyboardShortcuts/open-control-panel.tid new file mode 100644 index 000000000..adb99048a --- /dev/null +++ b/core/ui/KeyboardShortcuts/open-control-panel.tid @@ -0,0 +1,8 @@ +title: $:/core/ui/KeyboardShortcuts/open-control-panel +tags: $:/tags/KeyboardShortcut +key: ((open-control-panel)) + +\whitespace trim +<$navigator story="$:/StoryList" history="$:/HistoryList"> +<$action-navigate $to="$:/ControlPanel" $scroll="yes"/> + diff --git a/core/wiki/config/ShortcutInfo.multids b/core/wiki/config/ShortcutInfo.multids index bebd02dea..b2c843f35 100644 --- a/core/wiki/config/ShortcutInfo.multids +++ b/core/wiki/config/ShortcutInfo.multids @@ -32,6 +32,7 @@ mono-line: {{$:/language/Buttons/MonoLine/Hint}} new-image: {{$:/language/Buttons/NewImage/Hint}} new-journal: {{$:/language/Buttons/NewJournal/Hint}} new-tiddler: {{$:/language/Buttons/NewTiddler/Hint}} +open-control-panel: {{$:/language/Buttons/OpenControlPanel/Hint}} picture: {{$:/language/Buttons/Picture/Hint}} preview: {{$:/language/Buttons/Preview/Hint}} quote: {{$:/language/Buttons/Quote/Hint}} diff --git a/core/wiki/config/shortcuts/shortcuts.multids b/core/wiki/config/shortcuts/shortcuts.multids index 551833012..470988a9a 100644 --- a/core/wiki/config/shortcuts/shortcuts.multids +++ b/core/wiki/config/shortcuts/shortcuts.multids @@ -28,6 +28,7 @@ list-bullet: ctrl-shift-L list-number: ctrl-shift-N mono-block: ctrl-shift-M mono-line: ctrl-M +open-control-panel: ctrl-alt-C picture: ctrl-shift-I preview: alt-P quote: ctrl-Q From b452a1ee00cddd518436b4991b10a9395177f5c4 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Sun, 28 Jul 2024 16:13:20 +0330 Subject: [PATCH 04/68] Wikitext Procedures (#8390) --- editions/tw5.com/tiddlers/system/wikitext-macros.tid | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index 9746af1ae..e4a898ad8 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -1,6 +1,6 @@ code-body: yes created: 20150117184156000 -modified: 20240315144208842 +modified: 20240716181836632 tags: $:/tags/Macro title: $:/editions/tw5.com/wikitext-macros type: text/vnd.tiddlywiki @@ -80,12 +80,12 @@ type: text/vnd.tiddlywiki \end \procedure tw-code(tiddler) -<$codeblock language={{$tiddler$!!type}} code={{$tiddler$}}/> +<$codeblock language={{{ [get[type]] }}} code={{{ [get[text]] }}}/> \end \procedure tw-code-link(tiddler) -[[$tiddler$]]: -<> +<$link to=<>/>: +<$transclude $variable=tw-code tiddler=<> /> \end \procedure flex-card(class,bordercolor:"",backgroundcolor:"",textcolor:"",imageField:"image",captionField:"caption",subtitle:"",descriptionField:"description",linkField:"link") From bb9c64b38ee1c317f93cad8c7b407b94eecbc791 Mon Sep 17 00:00:00 2001 From: btheado Date: Sun, 28 Jul 2024 08:44:09 -0400 Subject: [PATCH 05/68] Fix olc-decode and geopoint latitude and longitude order in the geospatial plugin (#8437) * Reverse latitude and longitude in olc-decode tests to match proper geojson output format * Reverse latitude and longitude in olc-decode to match proper geojson output format * Reverse latitude and longitude in geopoint expected results to match proper geojson format * Reverse latitude and longitude in geolookup expected results to match proper geojson format * Corrected the Oxford to New York distances * Oxford is actually 12 miles closer to New York than Winchester Used calculator at https://www.nhc.noaa.gov/gccalc.shtml to check Reversed latitude and longitude to correct the geojson * Reversed the latitude and longitude turf.point arguments in the geopoint function * Swapped latitude and longitude in geopoint function calls --- .../tiddlers/real-estate-demo/schema.json | 4 ++-- editions/geospatialdemo/tiddlers/ui/geomarker.tid | 6 +++--- plugins/tiddlywiki/geospatial/operators/helper.js | 2 +- plugins/tiddlywiki/geospatial/operators/olc.js | 12 ++++++------ .../geospatial/tests/operators/geodistance.tid | 2 +- .../geospatial/tests/operators/geolookup.tid | 6 +++--- .../geospatial/tests/operators/geonearestpoint.tid | 4 ++-- .../geospatial/tests/operators/geonearestpoint2.tid | 6 +++--- .../geospatial/tests/operators/geopoint.tid | 2 +- .../geospatial/tests/operators/olc-decode.tid | 4 ++-- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/editions/geospatialdemo/tiddlers/real-estate-demo/schema.json b/editions/geospatialdemo/tiddlers/real-estate-demo/schema.json index e7decf5a1..31cca45b4 100644 --- a/editions/geospatialdemo/tiddlers/real-estate-demo/schema.json +++ b/editions/geospatialdemo/tiddlers/real-estate-demo/schema.json @@ -16,7 +16,7 @@ {"name": "nearest-volcano", "caption": "Nearest Volcano", "type": "string", "display": "[{$:/geospatialdemo/features/harvard-volcanoes-of-the-world}geonearestpoint]"} ], "variables": { - "coords": "[] :map[geopoint{!!long},{!!lat}]", - "census-data": "[] :map[geopoint{!!long},{!!lat}geolookup{$:/geospatialdemo/features/canada-census-subdivision-millesime}]" + "coords": "[] :map[geopoint{!!lat},{!!long}]", + "census-data": "[] :map[geopoint{!!lat},{!!long}geolookup{$:/geospatialdemo/features/canada-census-subdivision-millesime}]" } } diff --git a/editions/geospatialdemo/tiddlers/ui/geomarker.tid b/editions/geospatialdemo/tiddlers/ui/geomarker.tid index cf561c704..89e9fd950 100644 --- a/editions/geospatialdemo/tiddlers/ui/geomarker.tid +++ b/editions/geospatialdemo/tiddlers/ui/geomarker.tid @@ -73,7 +73,7 @@ title: ui/geomarker !! Distance to other markers <$let - thisLocation={{{ [geopoint{!!long},{!!lat}] }}} + thisLocation={{{ [geopoint{!!lat},{!!long}] }}} >