From 7dfdbae812306875bac2445ca4ee505b406e3be1 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Thu, 29 Aug 2024 17:25:30 +0100 Subject: [PATCH 01/66] Keyboard widget should not crash if the keyboard manager has not been initialised A user reported a problem with using the keyboard widget within a startup action. --- core/modules/widgets/keyboard.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/core/modules/widgets/keyboard.js b/core/modules/widgets/keyboard.js index ce3162f51..9515f5a3b 100644 --- a/core/modules/widgets/keyboard.js +++ b/core/modules/widgets/keyboard.js @@ -96,13 +96,15 @@ KeyboardWidget.prototype.execute = function() { this.param = this.getAttribute("param",""); this.key = this.getAttribute("key",""); this.tag = this.getAttribute("tag",""); - this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); - if(this.key.substr(0,2) === "((" && this.key.substr(-2,2) === "))") { - this.shortcutTiddlers = []; - var name = this.key.substring(2,this.key.length -2); - $tw.utils.each($tw.keyboardManager.lookupNames,function(platformDescriptor) { - self.shortcutTiddlers.push("$:/config/" + platformDescriptor + "/" + name); - }); + if($tw.keyboardManager) { + this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); + if(this.key.substr(0,2) === "((" && this.key.substr(-2,2) === "))") { + this.shortcutTiddlers = []; + var name = this.key.substring(2,this.key.length -2); + $tw.utils.each($tw.keyboardManager.lookupNames,function(platformDescriptor) { + self.shortcutTiddlers.push("$:/config/" + platformDescriptor + "/" + name); + }); + } } // Make child widgets this.makeChildWidgets(); @@ -126,7 +128,7 @@ KeyboardWidget.prototype.refresh = function(changedTiddlers) { this.assignDomNodeClasses(); } // Update the keyInfoArray if one of its shortcut-config-tiddlers has changed - if(this.shortcutTiddlers && $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers)) { + if(this.shortcutTiddlers && $tw.utils.hopArray(changedTiddlers,this.shortcutTiddlers) && $tw.keyboardManager) { this.keyInfoArray = $tw.keyboardManager.parseKeyDescriptors(this.key); } return this.refreshChildren(changedTiddlers); From 220156edeed101ccda0fc16303234765a83d64ac Mon Sep 17 00:00:00 2001 From: Jdigio0213 <106447741+Jdigio0213@users.noreply.github.com> Date: Fri, 30 Aug 2024 03:31:36 -0500 Subject: [PATCH 02/66] Signing CLA (#8565) --- licenses/cla-individual.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index c05d5906f..a77287f1d 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -585,3 +585,5 @@ Michael McDermott, @michaeljmcd, 2024-07-09 @webplusai, 2024/07/23 Val Packett, @valpackett, 2024/07/26 + +@JDIGIO0213, 2024/08/29 \ No newline at end of file From 98d411c08a3511cbed4b0c70422dd2b8bb5d546a Mon Sep 17 00:00:00 2001 From: Leilei332 Date: Fri, 30 Aug 2024 17:39:33 +0800 Subject: [PATCH 03/66] Add empty message to tag picker, search dropdown and advanced search (#8558) * Add empty message to tag picker, search dropdown and advanced search * Add empty message for tag-picker * Use italic font --- core/language/en-GB/EditTemplate.multids | 1 + core/language/en-GB/Search.multids | 2 ++ core/ui/AdvancedSearch/Shadows.tid | 8 ++++++-- core/ui/AdvancedSearch/System.tid | 8 ++++++-- core/ui/DefaultSearchResultList.tid | 4 ++-- core/wiki/macros/tag-picker.tid | 3 +++ 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/core/language/en-GB/EditTemplate.multids b/core/language/en-GB/EditTemplate.multids index c4bfa5e56..9b61f71ec 100644 --- a/core/language/en-GB/EditTemplate.multids +++ b/core/language/en-GB/EditTemplate.multids @@ -26,6 +26,7 @@ Tags/ClearInput/Caption: clear input Tags/ClearInput/Hint: Clear tag input Tags/Dropdown/Caption: tag list Tags/Dropdown/Hint: Show tag list +Tags/EmptyMessage: (no search result) Title/BadCharacterWarning: Warning: avoid using any of the characters <> in tiddler titles Title/Exists/Prompt: Target tiddler already exists Title/Relink/Prompt: Update ''<$text text=<>/>'' to ''<$text text=<>/>'' in the //tags// and //list// fields of other tiddlers diff --git a/core/language/en-GB/Search.multids b/core/language/en-GB/Search.multids index 2a57a6416..f5aa478bf 100644 --- a/core/language/en-GB/Search.multids +++ b/core/language/en-GB/Search.multids @@ -6,6 +6,8 @@ Filter/Hint: Search via a [[filter expression|https://tiddlywiki.com/static/Filt Filter/Matches: //<> matches// Matches: //<> matches// Matches/All: All matches: +Matches/NoMatch: //No match// +Matches/NoResult: //No search result// Matches/Title: Title matches: Search: Search Search/TooShort: Search text too short diff --git a/core/ui/AdvancedSearch/Shadows.tid b/core/ui/AdvancedSearch/Shadows.tid index e2ffa305f..daa8e6c2c 100644 --- a/core/ui/AdvancedSearch/Shadows.tid +++ b/core/ui/AdvancedSearch/Shadows.tid @@ -79,11 +79,15 @@ first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/ <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="
{{$:/language/Search/Search/TooShort}}
" variable="listItem"> -<$set name="resultCount" value="<$count filter='[all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]'/>"> +<$set name="resultCount" value={{{ [all[shadows]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] +[count[]]}}}>
-<> +<% if [match[0]] %> + {{$:/language/Search/Matches/NoMatch}} +<% else %> + <> +<% endif %> <$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"> addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> diff --git a/core/ui/AdvancedSearch/System.tid b/core/ui/AdvancedSearch/System.tid index 6804b80a8..ca9584ed7 100644 --- a/core/ui/AdvancedSearch/System.tid +++ b/core/ui/AdvancedSearch/System.tid @@ -78,11 +78,15 @@ first-search-filter: [is[system]searchsort[title]limit[250]] -[[$:/te <$list filter="[{$:/temp/advancedsearch}minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="
{{$:/language/Search/Search/TooShort}}
" variable="listItem"> -<$set name="resultCount" value="<$count filter='[is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]'/>"> +<$set name="resultCount" value={{{ [is[system]search{$:/temp/advancedsearch}] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]] +[count[]] }}}>
-<> +<% if [match[0]] %> + {{$:/language/Search/Matches/NoMatch}} +<% else %> + <> +<% endif %> <$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"> addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> diff --git a/core/ui/DefaultSearchResultList.tid b/core/ui/DefaultSearchResultList.tid index 223efe6d7..19b3d7187 100644 --- a/core/ui/DefaultSearchResultList.tid +++ b/core/ui/DefaultSearchResultList.tid @@ -9,7 +9,7 @@ second-search-filter: [!is[system]searchsort[title]limit[250]] //{{$:/language/Search/Matches/Title}}// <$list filter="[minlength[1]]" variable="ignore"> -<$list filter={{{ [get[first-search-filter]] }}}> +<$list filter={{{ [get[first-search-filter]] }}} emptyMessage={{$:/language/Search/Matches/NoResult}}> addsuffix[-primaryList]] -[get[text]] +[then[]else[tc-list-item-selected]] }}}> <$transclude tiddler="$:/core/ui/ListItemTemplate"/> @@ -19,7 +19,7 @@ second-search-filter: [!is[system]searchsort[title]limit[250]] //{{$:/language/Search/Matches/All}}// <$list filter="[minlength[1]]" variable="ignore"> -<$list filter={{{ [get[second-search-filter]] }}}> +<$list filter={{{ [get[second-search-filter]] }}} emptyMessage={{$:/language/Search/Matches/NoResult}}> addsuffix[-secondaryList]] -[get[text]] +[then[]else[tc-list-item-selected]] }}}> <$transclude tiddler="$:/core/ui/ListItemTemplate"/> diff --git a/core/wiki/macros/tag-picker.tid b/core/wiki/macros/tag-picker.tid index 8bd3caf4e..697ac777e 100644 --- a/core/wiki/macros/tag-picker.tid +++ b/core/wiki/macros/tag-picker.tid @@ -83,6 +83,9 @@ The second ESC tries to close the "draft tiddler" emptyMessage="
{{$:/language/Search/Search/TooShort}}
" variable="listItem" > <$list filter=<> variable="tag"> + <$list-empty> + {{$:/language/EditTemplate/Tags/EmptyMessage}} + From 5094096a87b6ee1f3fcaba31e5f1bf0290854891 Mon Sep 17 00:00:00 2001 From: btheado Date: Fri, 30 Aug 2024 09:21:24 -0400 Subject: [PATCH 04/66] Add import field to testcase tiddlers (#8499) * Convert "import" field of testcase tiddlers into $data widget with $filter attribute * Add documentation for testcase tiddler import field and fixed typo and grammar --- core/ui/TestCaseTemplate.tid | 1 + editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/ui/TestCaseTemplate.tid b/core/ui/TestCaseTemplate.tid index 8761abdd5..d6fccb956 100644 --- a/core/ui/TestCaseTemplate.tid +++ b/core/ui/TestCaseTemplate.tid @@ -13,6 +13,7 @@ title: $:/core/ui/TestCaseTemplate testActions="Actions" testHideIfPass=<> > + <$data $filter={{!!import}}/> <$data $compound-filter={{!!import-compound}}/> <$data $compound-tiddler=<>/> <%if [{!!description}!is[blank]] %><$data title="Description" text={{!!description}}/><%endif%> diff --git a/editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid b/editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid index fae4bab55..4d30dc75b 100644 --- a/editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid +++ b/editions/tw5.com/tiddlers/concepts/TestCaseTiddlers.tid @@ -1,5 +1,5 @@ created: 20240507221902644 -modified: 20240729083054531 +modified: 20240808020847667 tags: Concepts title: TestCaseTiddlers type: text/vnd.tiddlywiki @@ -14,8 +14,9 @@ Test case tiddlers have the following ''fields'': |<<.field type>> |Needs to be set to `text/vnd.tiddlywiki-multiple` | |<<.field tags>> |Test cases are tagged [[$:/tags/wiki-test-spec]]. Test cases that intentionally fail are tagged [[$:/tags/wiki-test-spec-failing]] | |<<.field description>> |Descriptive heading for the test, intended to make it easy to identify the test | -|<<.field display-format>> |Optional, defaults to `wikitext`. Set to `plaintext` to cause the output to be rended as plain text | -|<<.field import-compound>> |<<.from-version "5.3.6">> A filter string, that defines a list of compound tiddlers, that should be imported. See: <<.wlink DataWidget>> widget | +|<<.field display-format>> |Optional, defaults to `wikitext`. Set to `plaintext` to cause the output to be rendered as plain text | +|<<.field import>> |<<.from-version "5.3.6">> A filter string that defines a list of tiddlers to import | +|<<.field import-compound>> |<<.from-version "5.3.6">> A filter string that defines a list of compound tiddlers to import. See: <<.wlink DataWidget>> widget | Test case tiddlers with the appropriate tag are shown in the $:/ControlPanel ''-> Advanced -> Test Cases '' From 9a4aafdb41de0bea952cfe354bfc50b9a6f45013 Mon Sep 17 00:00:00 2001 From: btheado Date: Fri, 30 Aug 2024 09:21:46 -0400 Subject: [PATCH 05/66] Prevent geospatial plugin exception when geomap contains empty geolayer widget (#8484) * Prevent exception when geomap contains empty geolayer widget * Convert testcase widget into testcase tiddler --- .../tests/widgets/geomap-empty-layer.tid | 19 +++++++++++++++++++ .../tiddlywiki/geospatial/widgets/geomap.js | 10 ++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 plugins/tiddlywiki/geospatial/tests/widgets/geomap-empty-layer.tid diff --git a/plugins/tiddlywiki/geospatial/tests/widgets/geomap-empty-layer.tid b/plugins/tiddlywiki/geospatial/tests/widgets/geomap-empty-layer.tid new file mode 100644 index 000000000..1a8cdb686 --- /dev/null +++ b/plugins/tiddlywiki/geospatial/tests/widgets/geomap-empty-layer.tid @@ -0,0 +1,19 @@ +title: $:/plugins/tiddlywiki/geospatial/tests/widgets/geomap-empty-layer +description: Map using geolayer without json and lat/long attributes +import: $:/plugins/tiddlywiki/geospatial +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Narrative + +Verify exception reported in [[8452|https://github.com/TiddlyWiki/TiddlyWiki5/issues/8452]] is not thrown when the geolayer widget has no attributes ++ +title: Output + +<$geomap startPosition="bounds"> +<$geolayer/> + ++ +title: ExpectedResult + +

\ No newline at end of file diff --git a/plugins/tiddlywiki/geospatial/widgets/geomap.js b/plugins/tiddlywiki/geospatial/widgets/geomap.js index 9d9dfccd6..ba2957db2 100644 --- a/plugins/tiddlywiki/geospatial/widgets/geomap.js +++ b/plugins/tiddlywiki/geospatial/widgets/geomap.js @@ -262,10 +262,12 @@ GeomapWidget.prototype.refreshMap = function() { var bounds = null; $tw.utils.each(this.renderedLayers,function(layer) { var featureBounds = layer.layer.getBounds(); - if(bounds) { - bounds.extend(featureBounds); - } else { - bounds = featureBounds; + if(featureBounds.isValid()) { + if(bounds) { + bounds.extend(featureBounds); + } else { + bounds = featureBounds; + } } }); if(bounds) { From 26acd9be72600b7851e4c6fd5982619997000a3a Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Fri, 30 Aug 2024 14:55:14 +0100 Subject: [PATCH 06/66] Fix whitespace in social media cards Apologies @simonbaird this is the belated fix to the issue you mentioned in https://github.com/TiddlyWiki/TiddlyWiki5/pull/8441#issuecomment-2276175490 --- core/templates/social-metadata.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/templates/social-metadata.tid b/core/templates/social-metadata.tid index f742621e8..eb89418bb 100644 --- a/core/templates/social-metadata.tid +++ b/core/templates/social-metadata.tid @@ -4,7 +4,7 @@ tags: $:/tags/RawMarkupWikified \procedure meta-plain(name,source,name-attribute:"name") \whitespace trim <%if [has[text]] %> - <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [get[text]encodehtml[]] }}}/>"> + <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [get[text]encodehtml[]] }}}/>"> <$text text={{{ [charcode[10]] }}}/> <%endif%> \end meta-plain @@ -13,7 +13,7 @@ tags: $:/tags/RawMarkupWikified \whitespace trim <%if [has[text]] %> <$wikify name="html" text={{{ [get[text]] }}} output="text"> - <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [encodehtml[]] }}}/>"> + <meta <$text text=<>/>="<$text text=<>/>" content="<$text text={{{ [encodehtml[]] }}}/>"> <$text text={{{ [charcode[10]] }}}/> <%endif%> From 16e7510c7268aef00293e138403aede3b8b52bae Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 1 Sep 2024 16:34:44 +0100 Subject: [PATCH 07/66] Update release note --- .../prerelease/tiddlers/Release 5.3.6.tid | 61 ++++++++++++++++--- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/editions/prerelease/tiddlers/Release 5.3.6.tid b/editions/prerelease/tiddlers/Release 5.3.6.tid index b18d56483..d7afb6c5e 100644 --- a/editions/prerelease/tiddlers/Release 5.3.6.tid +++ b/editions/prerelease/tiddlers/Release 5.3.6.tid @@ -1,6 +1,6 @@ caption: 5.3.6 -created: 20240710120027897 -modified: 20240710120027897 +created: 20240830144941926 +modified: 20240830144941926 tags: ReleaseNotes title: Release 5.3.6 type: text/vnd.tiddlywiki @@ -12,20 +12,38 @@ description: Under development ! Translation improvements +<<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8531">> support for new language "Chinese (Hong Kong)" + This release includes improvements to the following translations: -* +* Chinese ! Plugin Improvements !! Geospatial Plugin * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8404">> support for custom wikitext popups to be attached to map features +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8437">> ordering of latitude and longitude in geospatial operators +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8484">> crash when geomap contains an empty geolayer widget !! Markdown Plugin * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8395">> strikethrough, superscript and subscript editor toolbar buttons * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8402">> readability of Markdown links to other tiddlers +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8459">> image toolbar dropdown to editor toolbar +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8492">> colour for target footnote background + +! TestCaseWidget and Related Improvements + +This release includes several fixes and improvements to the TestCaseWidget, its default template, and the related DataWidget: + +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8447">> new `$compound-filter` attribute for the DataWidget that allows other compound tiddlers to be imported. There is also a companion ''import-compound'' field for the TestCaseWidget template +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8514">> the TestCaseWidget default template to make it more modular +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8499">> support for an `import` field in the default TestCaseWidget template, allowing additional tiddlers to be imported +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8416">> [[TestCaseWidget]] default template to allow wikitext within the test case narrative +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8449">> WikiText formatting buttons when editing CompoundTiddlers +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8450">> CompoundTiddlers type `text/vnd.tiddlywiki-multiple` to the editor type dropdown +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8409">> filesystem handling so that [[Compound Tiddlers]] are saved as .tid files ! Widget Improvements @@ -37,11 +55,21 @@ This release includes improvements to the following translations: ! Usability Improvements +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8530">> language descriptions by localising them * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8407">> the contrast of plugin stability badges on hover +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8430">> a "copy to clipboard" button to the view template body template used for code tiddlers +* <<.link-badge-added "github.com/TiddlyWiki/TiddlyWiki5/pull/8441">> support for social media cards to be added to TiddlyWiki +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8518">> type attribute to input fields in control panel, allowing virtual keyboards to switch to the proper one when editing settings +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8558">> empty message to tag picker, search dropdown and advanced search ! Hackability Improvements -* +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8431">> support for the HTML entity `⁠` which can be useful for joining HTML elements without an unwanted linebreak +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8439">> a keyboard shortcut for opening the control panel (by default it is ctrl-alt-C) +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8182">> new [[Hidden Setting: Tag Pill Drag Filter]] that allows configuration of the tiddlers that are transferred when dragging a tag pill +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8384">> tests to ensure that the syntax elements `{% %}` and `{= =}` are reserved for external tooling, and will never be recognised by TiddlyWiki itself +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8462">> new cascades for the view template subtitle and tags +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8500">> excision tool implementation to make the excision tiddler title translatable ! Bug Fixes @@ -49,28 +77,47 @@ This release includes improvements to the following translations: * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8393">> crash when [[WidgetMessage: tm-copy-to-clipboard]] is passed an empty string * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8399">> disengage "select all" when cancelling an import * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8382">> [[transcludes Operator]] and [[backtranscludes Operator]] minor issue with transclusions made via a filtered attribute -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8416">> [[TestCaseWidget]] default template to allow wikitext within the test case narrative +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/discussions/8428">> scroll top position when animation duration is zero +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8476">> importing $:/build tiddler when upgrading to avoid overwriting it +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/d9ac4a823fe0f91c615ed33fa890069f88cc8ab9">> crash with RenderCommand when filename filter returns empty result +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8355">> display of language plugins +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8540">> (and <<.link-badge-here "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8546">>) display of non-square plugin icons +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8517">> appearance of input elements other than type `text` and `search` +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/38081b86c97a795420515156fcd52177574be516">> crash with filesystem adaptor if the wiki folder is missing +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8413">> unwrapped oveflowed code blocks not showing scroll bars when setting "Wrap long lines in code blocks" to "No" in "Theme tweaks" +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/7317">> (and <<.link-badge-here "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8552">>) search input box outline in Chrome-like browsers +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/fa423e508ff5012423a1904bb17c9d61848732ee">> interpretation of success codes in Put saver OPTIONS request +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8485">> duplicated search result in advanced search if more than one tiddler is tagged with $:/tags/SearchResults +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/7dfdbae812306875bac2445ca4ee505b406e3be1">> crash with KeyboardWidget in startup actions ! Node.js Improvements -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8409">> filesystem handling so that [[Compound Tiddlers]] are saved as .tid files +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8339">> server crash when authenticating if newlines are contained in the site title ! Developer Improvements -* +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8423">> the browser checks used in $:/boot/bootprefix.js +* <<.link-badge-extended "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8494">> parse tree format to add `start`/`end` properties to table row and cell elements +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8265">> and simplified plugin library edition usage ! Acknowledgements [[@Jermolene|https://github.com/Jermolene]] would like to thank the contributors to this release who have generously given their time to help improve TiddlyWiki: <<.contributors """ +BramChen btheado flibbles +hoelzro kookma Leilei332 +linonetwo pmario +PotOfCoffee2Go saqimtiaz simonbaird springerspandrel +twMat +valpackett webplusai """>> From 81405ee8f48e956a5b3a8363a6518a20d924b7ad Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 1 Sep 2024 16:57:20 +0100 Subject: [PATCH 08/66] Further tweaks to release note --- editions/prerelease/tiddlers/Release 5.3.6.tid | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editions/prerelease/tiddlers/Release 5.3.6.tid b/editions/prerelease/tiddlers/Release 5.3.6.tid index d7afb6c5e..d90d196be 100644 --- a/editions/prerelease/tiddlers/Release 5.3.6.tid +++ b/editions/prerelease/tiddlers/Release 5.3.6.tid @@ -35,15 +35,15 @@ This release includes improvements to the following translations: ! TestCaseWidget and Related Improvements -This release includes several fixes and improvements to the TestCaseWidget, its default template, and the related DataWidget: +This release includes several fixes and improvements to the TestCaseWidget, its default template, and the related DataWidget and CompoundTiddlers format: * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8447">> new `$compound-filter` attribute for the DataWidget that allows other compound tiddlers to be imported. There is also a companion ''import-compound'' field for the TestCaseWidget template * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8514">> the TestCaseWidget default template to make it more modular -* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8499">> support for an `import` field in the default TestCaseWidget template, allowing additional tiddlers to be imported +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8499">> support for an ''import'' field in the default TestCaseWidget template, allowing additional tiddlers to be imported * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8416">> [[TestCaseWidget]] default template to allow wikitext within the test case narrative * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8449">> WikiText formatting buttons when editing CompoundTiddlers * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8450">> CompoundTiddlers type `text/vnd.tiddlywiki-multiple` to the editor type dropdown -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8409">> filesystem handling so that [[Compound Tiddlers]] are saved as .tid files +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8409">> filesystem handling so that CompoundTiddlers are saved as .tid files ! Widget Improvements From d70b23e439d5d1754d69e29436e8f4124a10b70c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 1 Sep 2024 17:08:08 +0100 Subject: [PATCH 09/66] Add link to Jeremy's QCon talk --- editions/tw5.com/tiddlers/definitions/JeremyRuston.tid | 1 + 1 file changed, 1 insertion(+) diff --git a/editions/tw5.com/tiddlers/definitions/JeremyRuston.tid b/editions/tw5.com/tiddlers/definitions/JeremyRuston.tid index bf139ea1e..a63f3df68 100644 --- a/editions/tw5.com/tiddlers/definitions/JeremyRuston.tid +++ b/editions/tw5.com/tiddlers/definitions/JeremyRuston.tid @@ -15,6 +15,7 @@ I'm the original inventor of TiddlyWiki. You can hire me through [[Intertwingled Further information: +* A recording of the [[keynote I gave at QCon London in April 2024|https://www.infoq.com/presentations/bbc-micro/]], and the [[discussion on talk.tiddlywiki.org|https://talk.tiddlywiki.org/t/recording-of-jeremys-keynote-at-qcon-london-april-2024/10505]]. The talk mixes some nostalgia about my teenage activities with the BBC Micro with thoughts on the development of the software industry and insights gained from working with TiddlyWiki * An [[interview with me in The Inquirer|http://www.theinquirer.net/inquirer/feature/2105529/bt-software-engineer-tells-telco-source]] by Wendy Grossman * A [[hilarious interview with me|https://www.youtube.com/watch?v=auyIhw8MTmQ]] from British television in 1983 * Here's a video of a presentation I did in 2007 called [["How to Start an Open Source Project"|http://vimeo.com/856110]]. From 6b4f0bea98251e95f1783d14994aa867e6ba7c81 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sun, 1 Sep 2024 18:18:42 +0200 Subject: [PATCH 10/66] Update: Simple tm-http-request POST (#8580) --- .../messages/WidgetMessage_ tm-http-request Examples.tid | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Examples.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Examples.tid index 53ea600ca..3df6bd6a9 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Examples.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-http-request Examples.tid @@ -1,5 +1,5 @@ created: 20240609152203076 -modified: 20240614210714914 +modified: 20240901142049810 tags: title: WidgetMessage: tm-http-request Examples type: text/vnd.tiddlywiki @@ -32,6 +32,7 @@ type: text/vnd.tiddlywiki <$action-sendmessage $message="tm-http-request" url="https://httpbin.org/post" + header-content-type="application/json" method="POST" body='{"foo": "bar"}' oncompletion=<> From 8e1cad5a59b1bb85c022de2bfa3a159bdb06e11d Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sun, 1 Sep 2024 18:48:59 +0200 Subject: [PATCH 11/66] Fix HTML nesting error causing typing problem in advanced search filter tab in Firefox (#8577) --- core/ui/AdvancedSearch/Filter.tid | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index 5b82f9b32..35bbd1901 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -63,15 +63,13 @@ caption: {{$:/language/Search/Filter/Caption}} <$list filter="[all[shadows+tiddlers]tag[$:/tags/AdvancedSearch/FilterButton]!has[draft.of]]"><$transclude/>
-<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> +<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results"> <$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> -

<>

<$list filter={{$:/temp/advancedsearch}}> addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> <$transclude tiddler="$:/core/ui/ListItemTemplate"/> -
From f6cd7608f5eee8b0b886fa1a3ace1edef5b6fd95 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 1 Sep 2024 17:54:14 +0100 Subject: [PATCH 12/66] Release note clarification --- editions/prerelease/tiddlers/Release 5.3.6.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/prerelease/tiddlers/Release 5.3.6.tid b/editions/prerelease/tiddlers/Release 5.3.6.tid index d90d196be..211b360cb 100644 --- a/editions/prerelease/tiddlers/Release 5.3.6.tid +++ b/editions/prerelease/tiddlers/Release 5.3.6.tid @@ -35,7 +35,7 @@ This release includes improvements to the following translations: ! TestCaseWidget and Related Improvements -This release includes several fixes and improvements to the TestCaseWidget, its default template, and the related DataWidget and CompoundTiddlers format: +This release includes several fixes and improvements to the TestCaseWidget, its default template, and the related DataWidget and CompoundTiddlers format. These features were first introduced in [[Release 5.3.4]] and are undergoing continuous improvement as we work on integrating them more widely across the system. * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8447">> new `$compound-filter` attribute for the DataWidget that allows other compound tiddlers to be imported. There is also a companion ''import-compound'' field for the TestCaseWidget template * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8514">> the TestCaseWidget default template to make it more modular From 842605d28e78a298ca9feae52c586da831f1a001 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Sun, 1 Sep 2024 19:53:37 +0200 Subject: [PATCH 13/66] fix advanced search filter input eats key presses (#8578) --- core/ui/AdvancedSearch/Filter.tid | 103 +++++++++++++++++------------- 1 file changed, 60 insertions(+), 43 deletions(-) diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index 35bbd1901..a8baf9d30 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -9,14 +9,16 @@ caption: {{$:/language/Search/Filter/Caption}} tag="$:/tags/AdvancedSearch" beforeafter="$beforeafter$" defaultState="$:/core/ui/AdvancedSearch/System" - actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>"/> + actions="<$action-setfield $tiddler='$:/state/advancedsearch/currentTab' text=<>/>" +/> \end \define cancel-search-actions() \whitespace trim -<$list - filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]" - emptyMessage="<$action-deletetiddler $filter='[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]' />"> +<$list filter="[{$:/temp/advancedsearch/input}!match{$:/temp/advancedsearch}]"> + <$list-empty> + <$action-deletetiddler $filter="[[$:/temp/advancedsearch]] [[$:/temp/advancedsearch/input]] [[$:/temp/advancedsearch/selected-item]]"/> + <$action-setfield $tiddler="$:/temp/advancedsearch/input" text={{$:/temp/advancedsearch}}/> <$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/> @@ -24,52 +26,67 @@ caption: {{$:/language/Search/Filter/Caption}} \define input-accept-actions() \whitespace trim -<$list - filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/>"> +<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> + <$list-empty> + <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> + <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> + + <$/list-empty> <$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/> \end \define input-accept-variant-actions() \whitespace trim -<$list - filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" - emptyMessage="<$list filter='[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]'><$list filter='[<__tiddler__>get[text]minlength[1]]'><$action-sendmessage $message='tm-edit-tiddler' $param={{{ [<__tiddler__>get[text]] }}}/>"> +<$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]"> + <$list-empty> + <$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"> + <$list filter="[<__tiddler__>get[text]minlength[1]]"> + <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> + + + <$list filter="[<__tiddler__>get[text]minlength[1]]"> <$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/> - -\end -\whitespace trim -<> - -<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results"> -<$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> -

<>

-<$list filter={{$:/temp/advancedsearch}}> -addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> -<$transclude tiddler="$:/core/ui/ListItemTemplate"/> - + - +\end + +\whitespace trim + +<> + + + +<$reveal state="$:/temp/advancedsearch" type="nomatch" text="" tag="div" class="tc-search-results"> + <$set name="resultCount" value="<$count filter={{$:/temp/advancedsearch}}/>"> +

<>

+ <$list filter={{$:/temp/advancedsearch}}> + addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> + <$transclude tiddler="$:/core/ui/ListItemTemplate"/> + + + From a0be1d63efbfe83abdb36ee482f023e6d3ec0e32 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Mon, 2 Sep 2024 13:41:06 +0200 Subject: [PATCH 14/66] [DOCS] Using Stylesheets -- fix typos (#8581) --- editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid b/editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid index 3d41d3f19..201c2b823 100644 --- a/editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid +++ b/editions/tw5.com/tiddlers/howtos/Using Stylesheets.tid @@ -41,7 +41,7 @@ You can then use your own [[styles and classes in WikiText|Styles and Classes in Custom stylesheets are applied independently from theme stylesheets. Therefore, it is often necessary for the css rules in your custom stylesheet to be more specific than those of the theme you want to override. For example, `html body.tc-body` is more specific than `body.tc-body`. -<<.tip "''You should always start with the least specific value that works!''

">> +<<.tip """You should always start with the least specific value that works!""">> ! Stylesheet Types @@ -76,4 +76,4 @@ The ~TiddlyWiki core provides several [[global macros that are helpful in constr !! See Also -* <> +<> From dafe7884e8650cc0672b3c03914c323276a257a5 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 2 Sep 2024 16:32:48 +0100 Subject: [PATCH 15/66] Add TiddlyPWA to GettingStarted Apologies @valpackett I had not realised that TiddlyPWA was not listed. I'd welcome any improvements to the listing. I copied the functional description from your website but might be a good opportunity to sell the benefits more. I'm doing this as part of a review and improvement of the GettingStarted tiddler. --- .../tiddlers/saving/Saving with TiddlyPWA.tid | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid diff --git a/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid b/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid new file mode 100644 index 000000000..ab2ef2c2b --- /dev/null +++ b/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid @@ -0,0 +1,15 @@ +caption: ~TiddlyPWA +color: #E056B4 +community-author: Val Packett +created: 20240902162617154 +delivery: Progressive Web Application +description: Save to browser storage +method: save +modified: 20240902162617154 +tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows iOS Edge +title: TiddlyPWA - Save to AWS or Google Storage +type: text/vnd.tiddlywiki + +~TiddlyPWA turns TiddlyWiki 5 into an offline-first Progressive Web App with encrypted local persistent storage and efficient synchronization with a self-hosted server that can easily be hosted for free. + +https://tiddly.packett.cool/ From 487f5f5251c138067073ef8e1bb0a076f0d15c8c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 2 Sep 2024 16:33:57 +0100 Subject: [PATCH 16/66] IIS example config shouldn't be tagged "Saving" --- .../saving/Example config-tiddlyweb-host for IIS.txt.meta | 2 +- .../tiddlers/saving/Example package.json for IIS.txt.meta | 2 +- .../tiddlers/saving/Example tiddlywiki.info for IIS.txt.meta | 2 +- .../tw5.com/tiddlers/saving/Example web.config for IIS.txt.meta | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/saving/Example config-tiddlyweb-host for IIS.txt.meta b/editions/tw5.com/tiddlers/saving/Example config-tiddlyweb-host for IIS.txt.meta index 2e5142973..4c9dae0be 100644 --- a/editions/tw5.com/tiddlers/saving/Example config-tiddlyweb-host for IIS.txt.meta +++ b/editions/tw5.com/tiddlers/saving/Example config-tiddlyweb-host for IIS.txt.meta @@ -1,5 +1,5 @@ title: Example config-tiddlyweb-host for IIS created: 20180328145039530 modified: 20180328145234871 -tags: Saving +tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]] type: text/plain diff --git a/editions/tw5.com/tiddlers/saving/Example package.json for IIS.txt.meta b/editions/tw5.com/tiddlers/saving/Example package.json for IIS.txt.meta index 4d673d6d0..e40a98526 100644 --- a/editions/tw5.com/tiddlers/saving/Example package.json for IIS.txt.meta +++ b/editions/tw5.com/tiddlers/saving/Example package.json for IIS.txt.meta @@ -1,5 +1,5 @@ created: 20180328145039530 modified: 20180328145234871 -tags: Saving +tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]] title: Example package.json for IIS type: text/plain diff --git a/editions/tw5.com/tiddlers/saving/Example tiddlywiki.info for IIS.txt.meta b/editions/tw5.com/tiddlers/saving/Example tiddlywiki.info for IIS.txt.meta index 6fb2e36fc..dc5911c97 100644 --- a/editions/tw5.com/tiddlers/saving/Example tiddlywiki.info for IIS.txt.meta +++ b/editions/tw5.com/tiddlers/saving/Example tiddlywiki.info for IIS.txt.meta @@ -1,5 +1,5 @@ created: 20180328151124878 modified: 20180328151214616 -tags: Saving +tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]] title: Example tiddlywiki.info for IIS type: text/plain diff --git a/editions/tw5.com/tiddlers/saving/Example web.config for IIS.txt.meta b/editions/tw5.com/tiddlers/saving/Example web.config for IIS.txt.meta index 749fdcc68..2c8870758 100644 --- a/editions/tw5.com/tiddlers/saving/Example web.config for IIS.txt.meta +++ b/editions/tw5.com/tiddlers/saving/Example web.config for IIS.txt.meta @@ -1,5 +1,5 @@ created: 20180328145259455 modified: 20180701185215523 -tags: Saving +tags: [[Installing TiddlyWiki on Microsoft Internet Information Server]] title: Example web.config for IIS type: text/plain From 2af23a6ca586ca07499245227dbb92dd61cfcdec Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 2 Sep 2024 16:34:11 +0100 Subject: [PATCH 17/66] Remove extraneous camelcase --- editions/tw5.com/tiddlers/saving/Saving on TidGi.tid | 2 +- editions/tw5.com/tiddlers/saving/Saving with FireFox.tid | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/saving/Saving on TidGi.tid b/editions/tw5.com/tiddlers/saving/Saving on TidGi.tid index 8290254c6..26263ed69 100644 --- a/editions/tw5.com/tiddlers/saving/Saving on TidGi.tid +++ b/editions/tw5.com/tiddlers/saving/Saving on TidGi.tid @@ -1,4 +1,4 @@ -caption: TidGi Desktop +caption: ~TidGi Desktop color: #FF8A65 community-author: LinOnetwo created: 20220221080637764 diff --git a/editions/tw5.com/tiddlers/saving/Saving with FireFox.tid b/editions/tw5.com/tiddlers/saving/Saving with FireFox.tid index b64f695c4..2a3b3bd19 100644 --- a/editions/tw5.com/tiddlers/saving/Saving with FireFox.tid +++ b/editions/tw5.com/tiddlers/saving/Saving with FireFox.tid @@ -1,4 +1,4 @@ -caption: Saving with FireFox +caption: Saving with ~FireFox created: 20230803205140949 modified: 20230803213246739 tags: Saving Firefox From 69637640d2eb0cd062b18a453d27f45e0f748d4c Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 2 Sep 2024 16:51:15 +0100 Subject: [PATCH 18/66] Standardise whitespace in conditional shortcut syntax (#8583) --- .../parsers/wikiparser/rules/conditional.js | 4 +-- core/ui/AdvancedSearch/Shadows.tid | 6 ++-- core/ui/AdvancedSearch/System.tid | 6 ++-- core/wiki/macros/tag-picker.tid | 20 ++++++------ .../tests/data/conditionals/Basic.tid | 2 +- .../tests/data/conditionals/BlockMode.tid | 12 +++---- .../tiddlers/tests/data/conditionals/Else.tid | 2 +- .../tests/data/conditionals/Elseif.tid | 2 +- .../tests/data/conditionals/MissingEndIf.tid | 2 +- .../data/conditionals/MultipleResults.tid | 2 +- .../tests/data/conditionals/Nested.tid | 12 +++---- .../tests/data/conditionals/NestedElseif.tid | 16 +++++----- .../tiddlers/empty-tag-node-template.tid | 4 +-- .../tiddlers/releasenotes/Release 5.3.2.tid | 8 ++--- .../tw5.com/tiddlers/system/doc-macros.tid | 2 +- .../tiddlers/system/filter-run-template.tid | 8 ++--- .../tiddlers/system/operator-macros.tid | 4 +-- .../tiddlers/system/operator-template.tid | 8 ++--- .../tiddlers/system/version-macros.tid | 6 ++-- .../tiddlers/widgets/EditTextWidget.tid | 2 +- .../tw5.com/tiddlers/widgets/EditWidget.tid | 2 +- .../wikitext/Conditional Shortcut Syntax.tid | 32 +++++++++---------- .../tiddlywiki/github-fork-ribbon/usage.tid | 8 ++--- 23 files changed, 85 insertions(+), 85 deletions(-) diff --git a/core/modules/parsers/wikiparser/rules/conditional.js b/core/modules/parsers/wikiparser/rules/conditional.js index 23940fd88..c2d6a43b8 100644 --- a/core/modules/parsers/wikiparser/rules/conditional.js +++ b/core/modules/parsers/wikiparser/rules/conditional.js @@ -6,7 +6,7 @@ module-type: wikirule Conditional shortcut syntax ``` -This is a <% if [{something}] %>Elephant<% elseif [{else}] %>Pelican<% else %>Crocodile<% endif %> +This is a <%if [{something}] %>Elephant<%elseif [{else}] %>Pelican<%else%>Crocodile<%endif%> ``` \*/ @@ -27,7 +27,7 @@ exports.init = function(parser) { }; exports.findNextMatch = function(startPos) { - // Look for the next <% if shortcut + // Look for the next <%if shortcut this.matchRegExp.lastIndex = startPos; this.match = this.matchRegExp.exec(this.parser.source); // If not found then return no match diff --git a/core/ui/AdvancedSearch/Shadows.tid b/core/ui/AdvancedSearch/Shadows.tid index daa8e6c2c..043aee590 100644 --- a/core/ui/AdvancedSearch/Shadows.tid +++ b/core/ui/AdvancedSearch/Shadows.tid @@ -83,11 +83,11 @@ first-search-filter: [all[shadows]searchsort[title]limit[250]] -[[$:/
-<% if [match[0]] %> +<%if [match[0]] %> {{$:/language/Search/Matches/NoMatch}} -<% else %> +<%else%> <> -<% endif %> +<%endif%> <$list filter="[all[shadows]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]]"> addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> diff --git a/core/ui/AdvancedSearch/System.tid b/core/ui/AdvancedSearch/System.tid index ca9584ed7..5e1ec0254 100644 --- a/core/ui/AdvancedSearch/System.tid +++ b/core/ui/AdvancedSearch/System.tid @@ -82,11 +82,11 @@ first-search-filter: [is[system]searchsort[title]limit[250]] -[[$:/te
-<% if [match[0]] %> +<%if [match[0]] %> {{$:/language/Search/Matches/NoMatch}} -<% else %> +<%else%> <> -<% endif %> +<%endif%> <$list filter="[is[system]search{$:/temp/advancedsearch}sort[title]limit[250]] -[[$:/temp/advancedsearch]] -[[$:/temp/advancedsearch/input]] -[[$:/temp/advancedsearch/selected-item]]"> addsuffix[-primaryList]] -[[$:/temp/advancedsearch/selected-item]get[text]] +[then[]else[tc-list-item-selected]] }}}> diff --git a/core/wiki/macros/tag-picker.tid b/core/wiki/macros/tag-picker.tid index 697ac777e..4186f4138 100644 --- a/core/wiki/macros/tag-picker.tid +++ b/core/wiki/macros/tag-picker.tid @@ -31,11 +31,11 @@ second-search-filter: [subfilteris[system]search:title \procedure add-tag-actions() <$let tag=<<_tf.getTag>> > <$action-listops $tiddler=<> $field=<> $subfilter='+[toggletrim[]]'/> - <% if [] :intersection[getenlist-input[]] %> + <%if [] :intersection[getenlist-input[]] %> - <% else %> + <%else%> <> - <% endif %> + <%endif%> <> <$action-setfield $tiddler=<> text="yes"/> @@ -46,11 +46,11 @@ second-search-filter: [subfilteris[system]search:title The second ESC tries to close the "draft tiddler" --> \procedure clear-tags-actions-inner() -<% if [has[text]] ~[has[text]] %> +<%if [has[text]] ~[has[text]] %> <> -<% else %> +<%else%> <> -<% endif %> +<%endif%> \end @@ -128,13 +128,13 @@ The second ESC tries to close the "draft tiddler" > {{$:/core/images/down-arrow}} - <% if [has[text]] %> + <%if [has[text]] %> <$button actions=<> class="tc-btn-invisible tc-small-gap tc-btn-dropdown" tooltip={{$:/language/EditTemplate/Tags/ClearInput/Hint}} aria-label={{$:/language/EditTemplate/Tags/ClearInput/Caption}} > {{$:/core/images/close-button}} - <% endif %> + <%endif%> <$let tag=<<_tf.getTag>>> <$button set=<> actions=<> > @@ -144,13 +144,13 @@ The second ESC tries to close the "draft tiddler"
- <% if [has[text]] %> + <%if [has[text]] %>
<$macrocall $name="tag-picker-listTags" filter=<> suffix="-primaryList" />
<$macrocall $name="tag-picker-listTags" filter=<> suffix="-secondaryList" />
- <% endif %> + <%endif%>
\end diff --git a/editions/test/tiddlers/tests/data/conditionals/Basic.tid b/editions/test/tiddlers/tests/data/conditionals/Basic.tid index ff2d2df4d..6e5046f56 100644 --- a/editions/test/tiddlers/tests/data/conditionals/Basic.tid +++ b/editions/test/tiddlers/tests/data/conditionals/Basic.tid @@ -5,7 +5,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Text -This is a <% if [match[one]] %>Elephant<% endif %>, I think. +This is a <%if [match[one]] %>Elephant<%endif%>, I think. + title: Output diff --git a/editions/test/tiddlers/tests/data/conditionals/BlockMode.tid b/editions/test/tiddlers/tests/data/conditionals/BlockMode.tid index 45233baa4..c41b34563 100644 --- a/editions/test/tiddlers/tests/data/conditionals/BlockMode.tid +++ b/editions/test/tiddlers/tests/data/conditionals/BlockMode.tid @@ -6,23 +6,23 @@ tags: [[$:/tags/wiki-test-spec]] title: Output \procedure test(animal) -<% if [match[Elephant]] %> +<%if [match[Elephant]] %> ! It is an elephant -<% else %> +<%else%> -<% if [match[Giraffe]] %> +<%if [match[Giraffe]] %> ! It is a giraffe -<% else %> +<%else%> ! It is completely unknown -<% endif %> +<%endif%> -<% endif %> +<%endif%> \end diff --git a/editions/test/tiddlers/tests/data/conditionals/Else.tid b/editions/test/tiddlers/tests/data/conditionals/Else.tid index 7bc32b34e..ef42f198c 100644 --- a/editions/test/tiddlers/tests/data/conditionals/Else.tid +++ b/editions/test/tiddlers/tests/data/conditionals/Else.tid @@ -5,7 +5,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Text -This is a <% if [match[one]] %>Elephant<% else %>Crocodile<% endif %>, I think. +This is a <%if [match[one]] %>Elephant<%else%>Crocodile<%endif%>, I think. + title: Output diff --git a/editions/test/tiddlers/tests/data/conditionals/Elseif.tid b/editions/test/tiddlers/tests/data/conditionals/Elseif.tid index d37f3380c..068ac31c9 100644 --- a/editions/test/tiddlers/tests/data/conditionals/Elseif.tid +++ b/editions/test/tiddlers/tests/data/conditionals/Elseif.tid @@ -5,7 +5,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Text -This is a <% if [match[one]] %>Elephant<% elseif [match[two]] %>Antelope<% else %>Crocodile<% endif %>, I think. +This is a <%if [match[one]] %>Elephant<%elseif [match[two]] %>Antelope<%else%>Crocodile<%endif%>, I think. + title: Output diff --git a/editions/test/tiddlers/tests/data/conditionals/MissingEndIf.tid b/editions/test/tiddlers/tests/data/conditionals/MissingEndIf.tid index cacaf9869..ff01ca959 100644 --- a/editions/test/tiddlers/tests/data/conditionals/MissingEndIf.tid +++ b/editions/test/tiddlers/tests/data/conditionals/MissingEndIf.tid @@ -5,7 +5,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Text -This is a <% if [match[one]] %>Elephant +This is a <%if [match[one]] %>Elephant + title: Output diff --git a/editions/test/tiddlers/tests/data/conditionals/MultipleResults.tid b/editions/test/tiddlers/tests/data/conditionals/MultipleResults.tid index baa966ed5..866c6d8f5 100644 --- a/editions/test/tiddlers/tests/data/conditionals/MultipleResults.tid +++ b/editions/test/tiddlers/tests/data/conditionals/MultipleResults.tid @@ -5,7 +5,7 @@ tags: [[$:/tags/wiki-test-spec]] title: Output -This is a <% if 1 2 3 4 5 6 %>Elephant<% endif %>, I think. +This is a <%if 1 2 3 4 5 6 %>Elephant<%endif%>, I think. + title: ExpectedResult diff --git a/editions/test/tiddlers/tests/data/conditionals/Nested.tid b/editions/test/tiddlers/tests/data/conditionals/Nested.tid index dffa791fc..e5ea9fc40 100644 --- a/editions/test/tiddlers/tests/data/conditionals/Nested.tid +++ b/editions/test/tiddlers/tests/data/conditionals/Nested.tid @@ -6,15 +6,15 @@ tags: [[$:/tags/wiki-test-spec]] title: Output \procedure test(animal) -<% if [match[Elephant]] %> +<%if [match[Elephant]] %> It is an elephant -<% else %> -<% if [match[Giraffe]] %> +<%else%> +<%if [match[Giraffe]] %> It is a giraffe -<% else %> +<%else%> It is completely unknown -<% endif %> -<% endif %> +<%endif%> +<%endif%> \end <> diff --git a/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid b/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid index 6fba8cac8..bfc3e085c 100644 --- a/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid +++ b/editions/test/tiddlers/tests/data/conditionals/NestedElseif.tid @@ -7,20 +7,20 @@ title: Text \whitespace trim This is a - <% if [match[one]] %> - <% if [match[one]] %> + <%if [match[one]] %> + <%if [match[one]] %> Indian - <% elseif [match[two]] %> + <%elseif [match[two]] %> African - <% else %> + <%else%> Unknown - <% endif %> + <%endif%> Elephant - <% elseif [match[two]] %> + <%elseif [match[two]] %> Antelope - <% else %> + <%else%> Crocodile - <% endif %> + <%endif%> , I think. + title: Output diff --git a/editions/tw5.com/tiddlers/empty-tag-node-template.tid b/editions/tw5.com/tiddlers/empty-tag-node-template.tid index 79905b77c..96c77e76b 100644 --- a/editions/tw5.com/tiddlers/empty-tag-node-template.tid +++ b/editions/tw5.com/tiddlers/empty-tag-node-template.tid @@ -5,8 +5,8 @@ tags: $:/tags/ViewTemplate title: $:/editions/tw5.com/empty-tag-node-template type: -<% if [!has[text]!has[tags]tagging[]] %> +<%if [!has[text]!has[tags]tagging[]] %> The following tiddlers are tagged with <>: <!has[text]!has[tags]tagging[]]" class:"multi-columns">> -<% endif %> \ No newline at end of file +<%endif%> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid b/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid index d99d537c1..56f54cbb0 100644 --- a/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid +++ b/editions/tw5.com/tiddlers/releasenotes/Release 5.3.2.tid @@ -23,13 +23,13 @@ type: text/vnd.tiddlywiki These new token-based shortcuts allow a richer structure and expressivity than existing features such as widgets or pragmas. For example: ``` -<% if [match[Elephant]] %> +<%if [match[Elephant]] %> It is an elephant -<% elseif [match[Giraffe]] %> +<%elseif [match[Giraffe]] %> It is a giraffe -<% else %> +<%else%> It is completely unknown -<% endif %> +<%endif%> ``` Behind the scenes, the conditional shortcut syntax is rendered as the equivalent [[ListWidgets|ListWidget]]. diff --git a/editions/tw5.com/tiddlers/system/doc-macros.tid b/editions/tw5.com/tiddlers/system/doc-macros.tid index d0574fe5f..199479fb8 100644 --- a/editions/tw5.com/tiddlers/system/doc-macros.tid +++ b/editions/tw5.com/tiddlers/system/doc-macros.tid @@ -119,7 +119,7 @@ type: text/vnd.tiddlywiki \procedure .infoBox(text:"", title, icon:"$:/core/images/info-button", class, iconSize:"1.4rem") \function _f.tipClass() [[doc-icon-block]] [!is[blank]then] +[join[ ]]
>> - <%if [!is[blank]] %><div>''<<title>>''</div><% endif %> + <%if [<title>!is[blank]] %><div>''<<title>>''</div><%endif%> <div class="doc-block-icon"><$transclude $tiddler=<<icon>> size=<<iconSize>>/></div> <<text>> </div> diff --git a/editions/tw5.com/tiddlers/system/filter-run-template.tid b/editions/tw5.com/tiddlers/system/filter-run-template.tid index 73b4a2510..c559d8bdd 100644 --- a/editions/tw5.com/tiddlers/system/filter-run-template.tid +++ b/editions/tw5.com/tiddlers/system/filter-run-template.tid @@ -9,18 +9,18 @@ type: text/vnd.tiddlywiki \whitespace trim \procedure .op-place() -<% if [<op-name>!is[blank]] %> +<%if [<op-name>!is[blank]] %> <$macrocall $name=".place" _=<<op-name>> /><span class="tc-tiny-gap">=</span> -<% endif %> +<%endif%> \end \procedure .op-row() -<% if [<op-body>!is[blank]] %> +<%if [<op-body>!is[blank]] %> <tr> <th align="left"><<op-head>></th> <td><<.op-place>><<op-body>></td> </tr> -<% endif %> +<%endif%> \end <$list filter="[all[current]tag[Named Filter Run Prefix]]"> diff --git a/editions/tw5.com/tiddlers/system/operator-macros.tid b/editions/tw5.com/tiddlers/system/operator-macros.tid index 2b19d56db..e2dce9e2d 100644 --- a/editions/tw5.com/tiddlers/system/operator-macros.tid +++ b/editions/tw5.com/tiddlers/system/operator-macros.tid @@ -16,9 +16,9 @@ title: $:/editions/tw5.com/operator-macros <$list filter="[title<.state-prefix>addsuffix{!!title}addsuffix[/]addsuffix<n>]" variable=".state"> <$reveal state=<<.state>> type="nomatch" text="show"> <code><$text text=<<eg>>/></code> - <% if [<ie>!is[blank]] %> + <%if [<ie>!is[blank]] %> <dd>→ <<ie>></dd> - <% endif %> + <%endif%> <dl> <dd><$button actions=<<.operator-example-tryit-actions>>>Try it</$button></dd> </dl> diff --git a/editions/tw5.com/tiddlers/system/operator-template.tid b/editions/tw5.com/tiddlers/system/operator-template.tid index f4f3e08ef..47096f79c 100644 --- a/editions/tw5.com/tiddlers/system/operator-template.tid +++ b/editions/tw5.com/tiddlers/system/operator-template.tid @@ -8,17 +8,17 @@ title: $:/editions/tw5.com/operator-template \whitespace trim \procedure .op-place() -<% if [<op-name>!is[blank]] %> +<%if [<op-name>!is[blank]] %> <$macrocall $name=".place" _=<<op-name>> /><span class="tc-tiny-gap">=</span> -<% endif %> +<%endif%> \end \procedure .op-row() -<% if [<op-body>!is[blank]] %> +<%if [<op-body>!is[blank]] %> <tr> <th align="left"><<op-head>></th><td><<.op-place>><<op-body>></td> </tr> -<% endif %> +<%endif%> \end <$list filter="[all[current]tag[Filter Operators]]"> diff --git a/editions/tw5.com/tiddlers/system/version-macros.tid b/editions/tw5.com/tiddlers/system/version-macros.tid index c03f4237c..35e98cf71 100644 --- a/editions/tw5.com/tiddlers/system/version-macros.tid +++ b/editions/tw5.com/tiddlers/system/version-macros.tid @@ -19,11 +19,11 @@ type: text/vnd.tiddlywiki \end \procedure .from-version(version) -<% if [<version>compare:version:gteq<tf.from-version-reference>] %> +<%if [<version>compare:version:gteq<tf.from-version-reference>] %> <<.from-version-template "doc-from-version doc-from-version-new" "New in v">> -<% else %> +<%else%> <<.from-version-template "doc-from-version" "Introduced in v">> -<% endif %> +<%endif%> \end \procedure .deprecated-since(version, superseded:"") diff --git a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid index dcfd088fb..609cf36ff 100644 --- a/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EditTextWidget.tid @@ -75,7 +75,7 @@ eg="""<$edit-text tiddler=<<currentTiddler>> field="heading" size="25" focus="ye eg="""\procedure onInput() <%if [get[temp]match[$:/]] %> <$action-confirm $message="Yes, this is how system tiddler names begin!"/> - <% endif %> + <%endif%> \end Type a new tiddler name, starting with the system prefix `$:/`: <$edit-text inputActions=<<onInput>> field="temp" class="tc-edit-texteditor"/> diff --git a/editions/tw5.com/tiddlers/widgets/EditWidget.tid b/editions/tw5.com/tiddlers/widgets/EditWidget.tid index 2b72aa8ec..6822d4d77 100644 --- a/editions/tw5.com/tiddlers/widgets/EditWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/EditWidget.tid @@ -26,7 +26,7 @@ The content of the `<$edit>` widget is ignored. ! Examples -!! Edit the contents (text field) of a tiddler titled <%if [<now YYYY-0MM-0DD>is[tiddler]] %> <$tiddler tiddler=<<now YYYY-0MM-0DD>> > <$link/></$tiddler> <%else %> with today’s date <% endif %> +!! Edit the contents (text field) of a tiddler titled <%if [<now YYYY-0MM-0DD>is[tiddler]] %> <$tiddler tiddler=<<now YYYY-0MM-0DD>> > <$link/></$tiddler> <%else %> with today’s date <%endif%> <$macrocall $name=".example" n="1" eg="""<$edit tiddler=<<now YYYY-0MM-0DD>> class="tc-edit-texteditor"/> diff --git a/editions/tw5.com/tiddlers/wikitext/Conditional Shortcut Syntax.tid b/editions/tw5.com/tiddlers/wikitext/Conditional Shortcut Syntax.tid index 8cef3acfb..48ff59757 100644 --- a/editions/tw5.com/tiddlers/wikitext/Conditional Shortcut Syntax.tid +++ b/editions/tw5.com/tiddlers/wikitext/Conditional Shortcut Syntax.tid @@ -11,40 +11,40 @@ Within an "if" or "elseif" clause, the variable `condition` contains the value o A simple example: <$macrocall $name='wikitext-example-without-html' -src='<% if [{$:/info/url/protocol}match[file:]] %> +src='<%if [{$:/info/url/protocol}match[file:]] %> Loaded from a file URI -<% else %> +<%else%> Not loaded from a file URI -<% endif %> +<%endif%> '/> -One or more `<% elseif %>` clauses may be included before the `<% else %>` clause: +One or more `<%elseif%>` clauses may be included before the `<%else%>` clause: <$macrocall $name='wikitext-example-without-html' -src='<% if [{$:/info/url/protocol}match[file:]] %> +src='<%if [{$:/info/url/protocol}match[file:]] %> Loaded from a file URI -<% elseif [{$:/info/url/protocol}match[https:]] %> +<%elseif [{$:/info/url/protocol}match[https:]] %> Loaded from an HTTPS URI -<% elseif [{$:/info/url/protocol}match[http:]] %> +<%elseif [{$:/info/url/protocol}match[http:]] %> Loaded from an HTTP URI -<% else %> +<%else%> Loaded from an unknown protocol -<% endif %> +<%endif%> '/> The conditional shortcut syntax can be nested: <$macrocall $name='wikitext-example-without-html' src='\procedure test(animal) -<% if [<animal>match[Elephant]] %> +<%if [<animal>match[Elephant]] %> It is an elephant -<% else %> - <% if [<animal>match[Giraffe]] %> +<%else%> + <%if [<animal>match[Giraffe]] %> It is a giraffe - <% else %> + <%else%> It is completely unknown - <% endif %> -<% endif %> + <%endif%> +<%endif%> \end <<test "Giraffe">> @@ -56,7 +56,7 @@ src='\procedure test(animal) Notes: -* Clauses are parsed in inline mode by default. Force block mode parsing by following the opening `<% if %>`, `<% elseif %>` or `<% else %>` with two line breaks +* Clauses are parsed in inline mode by default. Force block mode parsing by following the opening `<%if %>`, `<%elseif%>` or `<%else%>` with two line breaks * Widgets and HTML elements must be within a single conditional clause; it is not possible to start an element in one conditional clause and end it in another * The conditional shortcut syntax cannot contain pragmas such as procedure definitions diff --git a/plugins/tiddlywiki/github-fork-ribbon/usage.tid b/plugins/tiddlywiki/github-fork-ribbon/usage.tid index 2c1388da0..c91566b69 100644 --- a/plugins/tiddlywiki/github-fork-ribbon/usage.tid +++ b/plugins/tiddlywiki/github-fork-ribbon/usage.tid @@ -6,11 +6,11 @@ title: $:/plugins/tiddlywiki/github-fork-ribbon/usage \end \procedure ribbonCreateActions() -<% if [[$:/github-ribbon]!is[tiddler]] %> +<%if [[$:/github-ribbon]!is[tiddler]] %> <$action-setfield $tiddler="$:/github-ribbon" $field="text" $value=<<ribbonCode>> tags="$:/tags/PageTemplate" code-body="yes" /> -<% endif %> +<%endif%> <$action-navigate $to="$:/github-ribbon" /> \end @@ -18,9 +18,9 @@ title: $:/plugins/tiddlywiki/github-fork-ribbon/usage <$button actions=<<ribbonCreateActions>> > <%if [[$:/github-ribbon]!is[tiddler]] %> Create -<% else %> +<%else%> Show -<% endif %> ~$:/github-ribbon +<%endif%> ~$:/github-ribbon </$button> \end From 149bba62d2a031a38c4fbdf2bdd67602a645abe6 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston <jeremy@jermolene.com> Date: Mon, 2 Sep 2024 20:57:03 +0100 Subject: [PATCH 19/66] Fix typos in Saving with TiddlyPWA --- editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid b/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid index ab2ef2c2b..c8555bdd0 100644 --- a/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid +++ b/editions/tw5.com/tiddlers/saving/Saving with TiddlyPWA.tid @@ -3,11 +3,11 @@ color: #E056B4 community-author: Val Packett created: 20240902162617154 delivery: Progressive Web Application -description: Save to browser storage +description: Save to Browser Storage method: save modified: 20240902162617154 -tags: Chrome Firefox [[Internet Explorer]] Linux Mac Opera Safari Saving Windows iOS Edge -title: TiddlyPWA - Save to AWS or Google Storage +tags: Chrome Firefox Linux Mac Opera Safari Saving Windows iOS Edge +title: TiddlyPWA - Save to Browser Storage type: text/vnd.tiddlywiki ~TiddlyPWA turns TiddlyWiki 5 into an offline-first Progressive Web App with encrypted local persistent storage and efficient synchronization with a self-hosted server that can easily be hosted for free. From 9a3f1d25e55fa414f69416265f321fe4392ff68a Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Fri, 6 Sep 2024 01:40:18 +0800 Subject: [PATCH 20/66] Update toolbar buttons to use v5.3.2 syntax (#8584) --- core/ui/EditToolbar/cancel.tid | 8 +-- core/ui/EditToolbar/delete.tid | 8 +-- core/ui/EditToolbar/save.tid | 11 ++-- core/ui/ViewToolbar/clone.tid | 8 +-- core/ui/ViewToolbar/close-others.tid | 8 +-- core/ui/ViewToolbar/close.tid | 8 +-- core/ui/ViewToolbar/edit.tid | 8 +-- core/ui/ViewToolbar/export-tiddler.tid | 5 +- core/ui/ViewToolbar/fold-others.tid | 8 +-- core/ui/ViewToolbar/fold.tid | 16 +++--- core/ui/ViewToolbar/info.tid | 17 +++--- core/ui/ViewToolbar/more-tiddler-actions.tid | 37 ++++++------- core/ui/ViewToolbar/new-here.tid | 14 +++-- core/ui/ViewToolbar/new-journal-here.tid | 26 ++++------ core/ui/ViewToolbar/open-window.tid | 8 +-- core/ui/ViewToolbar/permalink.tid | 8 +-- core/ui/ViewToolbar/permaview.tid | 8 +-- .../qrcode/ViewToolbarButton/Button.tid | 52 ++++++------------- .../text-slicer/ui/slice-toolbar-button.tid | 10 ++-- 19 files changed, 113 insertions(+), 155 deletions(-) diff --git a/core/ui/EditToolbar/cancel.tid b/core/ui/EditToolbar/cancel.tid index fe21c2e99..ca2248920 100644 --- a/core/ui/EditToolbar/cancel.tid +++ b/core/ui/EditToolbar/cancel.tid @@ -5,10 +5,10 @@ description: {{$:/language/Buttons/Cancel/Hint}} \whitespace trim <$button actions=<<cancel-delete-tiddler-actions "cancel">> tooltip={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/cancel-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Cancel/Caption}}/></span> -</$list> +<%endif%> </$button> diff --git a/core/ui/EditToolbar/delete.tid b/core/ui/EditToolbar/delete.tid index fcaed4b48..bdc6731b9 100644 --- a/core/ui/EditToolbar/delete.tid +++ b/core/ui/EditToolbar/delete.tid @@ -5,10 +5,10 @@ description: {{$:/language/Buttons/Delete/Hint}} \whitespace trim <$button actions=<<cancel-delete-tiddler-actions "delete">> tooltip={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/delete-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Delete/Caption}}/></span> -</$list> +<%endif%> </$button> diff --git a/core/ui/EditToolbar/save.tid b/core/ui/EditToolbar/save.tid index 3872e7674..b217806bb 100644 --- a/core/ui/EditToolbar/save.tid +++ b/core/ui/EditToolbar/save.tid @@ -4,8 +4,7 @@ caption: {{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}} description: {{$:/language/Buttons/Save/Hint}} \whitespace trim -\define save-tiddler-button() -\whitespace trim +\procedure save-tiddler-button() <$fieldmangler> <$button tooltip={{$:/language/Buttons/Save/Hint}} @@ -13,12 +12,12 @@ description: {{$:/language/Buttons/Save/Hint}} class=<<tv-config-toolbar-class>> > <<save-tiddler-actions>> - <$list filter="[<tv-config-toolbar-icons>match[yes]]"> + <%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/done-button}} - </$list> - <$list filter="[<tv-config-toolbar-text>match[yes]]"> + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Save/Caption}}/></span> - </$list> + <%endif%> </$button> </$fieldmangler> \end diff --git a/core/ui/ViewToolbar/clone.tid b/core/ui/ViewToolbar/clone.tid index 434418106..abe01eda8 100644 --- a/core/ui/ViewToolbar/clone.tid +++ b/core/ui/ViewToolbar/clone.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Clone/Hint}} \whitespace trim <$button message="tm-new-tiddler" param=<<currentTiddler>> tooltip={{$:/language/Buttons/Clone/Hint}} aria-label={{$:/language/Buttons/Clone/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/clone-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Clone/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/close-others.tid b/core/ui/ViewToolbar/close-others.tid index 57fbf222c..19d996fda 100644 --- a/core/ui/ViewToolbar/close-others.tid +++ b/core/ui/ViewToolbar/close-others.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/CloseOthers/Hint}} \whitespace trim <$button message="tm-close-other-tiddlers" param=<<currentTiddler>> tooltip={{$:/language/Buttons/CloseOthers/Hint}} aria-label={{$:/language/Buttons/CloseOthers/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/close-others-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/CloseOthers/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/close.tid b/core/ui/ViewToolbar/close.tid index bd1fbe0ee..da4db1e26 100644 --- a/core/ui/ViewToolbar/close.tid +++ b/core/ui/ViewToolbar/close.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Close/Hint}} \whitespace trim <$button message="tm-close-tiddler" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/close-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Close/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/edit.tid b/core/ui/ViewToolbar/edit.tid index f0ab31e4e..38827aa14 100644 --- a/core/ui/ViewToolbar/edit.tid +++ b/core/ui/ViewToolbar/edit.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Edit/Hint}} \whitespace trim <$button message="tm-edit-tiddler" tooltip={{$:/language/Buttons/Edit/Hint}} aria-label={{$:/language/Buttons/Edit/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/edit-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Edit/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/export-tiddler.tid b/core/ui/ViewToolbar/export-tiddler.tid index 8c39de856..9bb3d8853 100644 --- a/core/ui/ViewToolbar/export-tiddler.tid +++ b/core/ui/ViewToolbar/export-tiddler.tid @@ -3,7 +3,4 @@ tags: $:/tags/ViewToolbar caption: {{$:/core/images/export-button}} {{$:/language/Buttons/ExportTiddler/Caption}} description: {{$:/language/Buttons/ExportTiddler/Hint}} -\define makeExportFilter() -[[$(currentTiddler)$]] -\end -<$macrocall $name="exportButton" exportFilter=<<makeExportFilter>> lingoBase="$:/language/Buttons/ExportTiddler/" baseFilename=<<currentTiddler>>/> \ No newline at end of file +<$transclude $variable="exportButton" exportFilter=`[[$(currentTiddler)$]]` lingoBase="$:/language/Buttons/ExportTiddler/" baseFilename=<<currentTiddler>>/> \ No newline at end of file diff --git a/core/ui/ViewToolbar/fold-others.tid b/core/ui/ViewToolbar/fold-others.tid index 244977509..8734eaf33 100644 --- a/core/ui/ViewToolbar/fold-others.tid +++ b/core/ui/ViewToolbar/fold-others.tid @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/FoldOthers/Hint}} \whitespace trim <$button tooltip={{$:/language/Buttons/FoldOthers/Hint}} aria-label={{$:/language/Buttons/FoldOthers/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-fold-other-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/fold-others-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/FoldOthers/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/fold.tid b/core/ui/ViewToolbar/fold.tid index fd3363688..3c99c6ad6 100644 --- a/core/ui/ViewToolbar/fold.tid +++ b/core/ui/ViewToolbar/fold.tid @@ -7,26 +7,26 @@ description: {{$:/language/Buttons/Fold/Hint}} <$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" default="show"> <$button tooltip={{$:/language/Buttons/Fold/Hint}} aria-label={{$:/language/Buttons/Fold/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/fold-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Fold/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> <$reveal type="match" stateTitle=<<folded-state>> text="hide" default="show"> <$button tooltip={{$:/language/Buttons/Unfold/Hint}} aria-label={{$:/language/Buttons/Unfold/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-fold-tiddler" $param=<<currentTiddler>> foldedState=<<folded-state>>/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/unfold-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Unfold/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> diff --git a/core/ui/ViewToolbar/info.tid b/core/ui/ViewToolbar/info.tid index 02fd9abd7..95245d909 100644 --- a/core/ui/ViewToolbar/info.tid +++ b/core/ui/ViewToolbar/info.tid @@ -4,31 +4,30 @@ caption: {{$:/core/images/info-button}} {{$:/language/Buttons/Info/Caption}} description: {{$:/language/Buttons/Info/Hint}} \whitespace trim -\define button-content() -\whitespace trim -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +\procedure button-content() +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/info-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Info/Caption}}/> </span> -</$list> +<%endif%> \end <$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="popup"> <$button popup=<<tiddlerInfoState>> tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$macrocall $name="button-content" mode="inline"/> +<$transclude $variable="button-content" $mode="inline"/> </$button> </$reveal> <$reveal state="$:/config/TiddlerInfo/Mode" type="match" text="sticky"> <$reveal state=<<tiddlerInfoState>> type="match" text="" default=""> <$button set=<<tiddlerInfoState>> setTo="yes" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$macrocall $name="button-content" mode="inline"/> +<$transclude $variable="button-content" $mode="inline"/> </$button> </$reveal> <$reveal state=<<tiddlerInfoState>> type="nomatch" text="" default=""> <$button set=<<tiddlerInfoState>> setTo="" tooltip={{$:/language/Buttons/Info/Hint}} aria-label={{$:/language/Buttons/Info/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$macrocall $name="button-content" mode="inline"/> +<$transclude $variable="button-content" $mode="inline"/> </$button> </$reveal> </$reveal> \ No newline at end of file diff --git a/core/ui/ViewToolbar/more-tiddler-actions.tid b/core/ui/ViewToolbar/more-tiddler-actions.tid index e7e75a79b..4528a4eee 100644 --- a/core/ui/ViewToolbar/more-tiddler-actions.tid +++ b/core/ui/ViewToolbar/more-tiddler-actions.tid @@ -4,7 +4,6 @@ caption: {{$:/core/images/down-arrow}} {{$:/language/Buttons/More/Caption}} description: {{$:/language/Buttons/More/Hint}} \whitespace trim -\define config-title() $:/config/ViewToolbarButtons/Visibility/$(listItem)$ <$button popup=<<qualify "$:/state/popup/more">> tooltip={{$:/language/Buttons/More/Hint}} @@ -12,33 +11,29 @@ description: {{$:/language/Buttons/More/Hint}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected" > - <$list filter="[<tv-config-toolbar-icons>match[yes]]"> + <%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/down-arrow}} - </$list> - <$list filter="[<tv-config-toolbar-text>match[yes]]"> + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/More/Caption}}/> </span> - </$list> + <%endif%> </$button> <$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="belowleft" animate="yes"> <div class="tc-drop-down"> - <$set name="tv-config-toolbar-icons" value="yes"> - <$set name="tv-config-toolbar-text" value="yes"> - <$set name="tv-config-toolbar-class" value="tc-btn-invisible"> - <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" - variable="listItem" + <$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="tc-btn-invisible"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] -[[$:/core/ui/Buttons/more-tiddler-actions]]" + variable="listItem" + > + <$reveal type="match" state=`$:/config/ViewToolbarButtons/Visibility/$(listItem)$` text="hide"> + <$set name="tv-config-toolbar-class" + filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]" > - <$reveal type="match" state=<<config-title>> text="hide"> - <$set name="tv-config-toolbar-class" - filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]" - > - <$transclude tiddler=<<listItem>> mode="inline"/> - </$set> - </$reveal> - </$list> - </$set> - </$set> - </$set> + <$transclude tiddler=<<listItem>> mode="inline"/> + </$set> + </$reveal> + </$list> + </$let> </div> </$reveal> \ No newline at end of file diff --git a/core/ui/ViewToolbar/new-here.tid b/core/ui/ViewToolbar/new-here.tid index 31e8e4158..15afe2628 100644 --- a/core/ui/ViewToolbar/new-here.tid +++ b/core/ui/ViewToolbar/new-here.tid @@ -4,23 +4,21 @@ caption: {{$:/core/images/new-here-button}} {{$:/language/Buttons/NewHere/Captio description: {{$:/language/Buttons/NewHere/Hint}} \whitespace trim -\define newHereActions() -\whitespace trim +\procedure newHereActions() <$set name="tags" filter="[<currentTiddler>] [enlist{$:/config/NewTiddler/Tags}]"> <$action-sendmessage $message="tm-new-tiddler" tags=<<tags>>/> </$set> \end -\define newHereButton() -\whitespace trim +\procedure newHereButton() <$button actions=<<newHereActions>> tooltip={{$:/language/Buttons/NewHere/Hint}} aria-label={{$:/language/Buttons/NewHere/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/new-here-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NewHere/Caption}}/> </span> -</$list> +<%endif%> </$button> \end <<newHereButton>> diff --git a/core/ui/ViewToolbar/new-journal-here.tid b/core/ui/ViewToolbar/new-journal-here.tid index b64ba7ed7..2df7a2a4e 100644 --- a/core/ui/ViewToolbar/new-journal-here.tid +++ b/core/ui/ViewToolbar/new-journal-here.tid @@ -4,29 +4,21 @@ caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournalH description: {{$:/language/Buttons/NewJournalHere/Hint}} \whitespace trim -\define journalButtonTags() -[[$(currentTiddlerTag)$]] $(journalTags)$ -\end -\define journalButton() -\whitespace trim +\procedure journalButton() <$button tooltip={{$:/language/Buttons/NewJournalHere/Hint}} aria-label={{$:/language/Buttons/NewJournalHere/Caption}} class=<<tv-config-toolbar-class>>> -<$wikify name="journalTitle" text="""<$macrocall $name="now" format=<<journalTitleTemplate>>/>"""> -<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<journalButtonTags>>/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<$wikify name="journalTitle" text="""<$transclude $variable="now" format=<<journalTitleTemplate>>/>"""> +<$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=`[[$(currentTiddlerTag)$]] $(journalTags)$`/> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/new-journal-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NewJournalHere/Caption}}/> </span> -</$list> +<%endif%> </$wikify> </$button> \end -<$set name="journalTitleTemplate" value={{$:/config/NewJournal/Title}}> -<$set name="journalTags" value={{$:/config/NewJournal/Tags}}> -<$set name="currentTiddlerTag" value=<<currentTiddler>>> +<$let journalTitleTemplate={{$:/config/NewJournal/Title}} journalTags={{$:/config/NewJournal/Tags}} currentTiddlerTag=<<currentTiddler>>> <<journalButton>> -</$set> -</$set> -</$set> +</$let> diff --git a/core/ui/ViewToolbar/open-window.tid b/core/ui/ViewToolbar/open-window.tid index d8ef85c83..24e2efcca 100644 --- a/core/ui/ViewToolbar/open-window.tid +++ b/core/ui/ViewToolbar/open-window.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/OpenWindow/Hint}} \whitespace trim <$button message="tm-open-window" tooltip={{$:/language/Buttons/OpenWindow/Hint}} aria-label={{$:/language/Buttons/OpenWindow/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/open-window}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/OpenWindow/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/permalink.tid b/core/ui/ViewToolbar/permalink.tid index 5d0677eed..4e9868b43 100644 --- a/core/ui/ViewToolbar/permalink.tid +++ b/core/ui/ViewToolbar/permalink.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Permalink/Hint}} \whitespace trim <$button message="tm-permalink" tooltip={{$:/language/Buttons/Permalink/Hint}} aria-label={{$:/language/Buttons/Permalink/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/permalink-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Permalink/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/permaview.tid b/core/ui/ViewToolbar/permaview.tid index 4a655b970..1ab129eed 100644 --- a/core/ui/ViewToolbar/permaview.tid +++ b/core/ui/ViewToolbar/permaview.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Permaview/Hint}} \whitespace trim <$button message="tm-permaview" tooltip={{$:/language/Buttons/Permaview/Hint}} aria-label={{$:/language/Buttons/Permaview/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/permaview-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Permaview/Caption}}/> </span> -</$list> +<%endif%> </$button> \ No newline at end of file diff --git a/plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid b/plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid index 2a6335545..7ac85af19 100644 --- a/plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid +++ b/plugins/tiddlywiki/qrcode/ViewToolbarButton/Button.tid @@ -8,50 +8,28 @@ description: Generate QR code for this tiddler \whitespace trim <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/qrcode">> tooltip={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!description}} aria-label={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!short-caption}} class=<<tv-config-toolbar-class>> class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/plugins/tiddlywiki/qrcode/icon}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton!!short-caption}}/> </span> -</$list> +<%endif%> </$button> </span> <$reveal state=<<qualify "$:/state/popup/qrcode">> type="popup" position="below" animate="yes"> + <div class="tc-drop-down"> -<div class="tc-drop-down"> - -{{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton||description}} - -<$set name="tv-config-toolbar-icons" value="yes"> - -<$set name="tv-config-toolbar-text" value="yes"> - -<$set name="tv-config-toolbar-class" value="tc-btn-invisible"> - -<$set name="targetTiddler" value=<<currentTiddler>>> - -<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbarButton/QRcode]!has[draft.of]]"> - -<$button popup=<<qualify "$:/state/popup/qrcode/type">> class="tc-btn-invisible" selectedClass="tc-selected"> - -<$action-sendmessage $message="tm-modal" $param=<<currentTiddler>> currentTiddler=<<targetTiddler>>/> - -<$transclude field="caption" mode="inline"/> - -</$button> - -</$list> - -</$set> - -</$set> - -</$set> - -</$set> - -</div> + {{$:/plugins/tiddlywiki/qrcode/ViewToolbarButton||description}} + <$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="tc-btn-invisible" targetTiddler=<<currentTiddler>>> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbarButton/QRcode]!has[draft.of]]"> + <$button popup=<<qualify "$:/state/popup/qrcode/type">> class="tc-btn-invisible" selectedClass="tc-selected"> + <$action-sendmessage $message="tm-modal" $param=<<currentTiddler>> currentTiddler=<<targetTiddler>>/> + <$transclude field="caption" mode="inline"/> + </$button> + </$list> + </$let> + </div> </$reveal> diff --git a/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button.tid b/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button.tid index ef53223d2..0a9b41414 100644 --- a/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button.tid +++ b/plugins/tiddlywiki/text-slicer/ui/slice-toolbar-button.tid @@ -6,18 +6,18 @@ description: Slice this text tiddler by headings and lists \whitespace trim -\define hint() +\procedure hint() Slice this text tiddler into chunks \end <$list filter="[<currentTiddler>!is[image]!is[binary]]" variable="ignore"> <$button tooltip=<<hint>> aria-label=<<hint>> class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-modal" $param="$:/plugins/tiddlywiki/text-slicer/ui/slice-modal" currentTiddler=<<currentTiddler>>/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/plugins/tiddlywiki/text-slicer/images/text-slicer-icon}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text">Slice tiddler</span> -</$list> +<%endif%> </$button> </$list> From f0cb57fad883ac0b3dccf607108d71bac44ebe2f Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sat, 7 Sep 2024 02:39:41 +0800 Subject: [PATCH 21/66] Update docs for base64 operators (#8575) * Update docs for decodebase64 and encodebase64 operator * Add exmaples for decodebase64 and encodebase64 operator --- .../filters/decodebase64 Operator (Examples).tid | 10 ++++++++++ .../tw5.com/tiddlers/filters/decodebase64 Operator.tid | 8 +++++--- .../filters/encodebase64 Operator (Examples).tid | 10 ++++++++++ .../tw5.com/tiddlers/filters/encodebase64 Operator.tid | 8 +++++--- 4 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 editions/tw5.com/tiddlers/filters/decodebase64 Operator (Examples).tid create mode 100644 editions/tw5.com/tiddlers/filters/encodebase64 Operator (Examples).tid diff --git a/editions/tw5.com/tiddlers/filters/decodebase64 Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/decodebase64 Operator (Examples).tid new file mode 100644 index 000000000..6a79011e3 --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/decodebase64 Operator (Examples).tid @@ -0,0 +1,10 @@ +created: 20240831025944330 +modified: 20240831041423075 +tags: [[decodebase64 Operator]] [[Operator Examples]] +title: decodebase64 Operator (Examples) + +<<.operator-example 1 "[[dGVzdA==]decodebase64[]]">> + +<<.operator-example 2 "[[8J+Yjg==]decodebase64[]]">> + +<<.operator-example 3 "[[8J-Yjg==]decodebase64:urlsafe[]]">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid b/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid index 0d3a61920..5421ddf8f 100644 --- a/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid +++ b/editions/tw5.com/tiddlers/filters/decodebase64 Operator.tid @@ -1,14 +1,16 @@ caption: decodebase64 +created: 20240831034919913 +from-version: 5.2.6 +modified: 20240831034931703 op-input: a [[selection of titles|Title Selection]] op-output: the input with base 64 decoding applied -op-suffix: optional: `binary` to produce binary output, `urlsafe` for URL-safe input op-parameter: op-parameter-name: -op-purpose: apply base 64 decoding to a string +op-purpose: apply [[base 64|Base64]] decoding to a string +op-suffix: optional: `binary` to produce binary output, `urlsafe` for URL-safe input tags: [[Filter Operators]] [[String Operators]] title: decodebase64 Operator type: text/vnd.tiddlywiki -from-version: 5.2.6 See Mozilla Developer Network for details of [[base 64 encoding|https://developer.mozilla.org/en-US/docs/Glossary/Base64]]. TiddlyWiki uses [[library code from @nijikokun|https://gist.github.com/Nijikokun/5192472]] to handle the conversion. diff --git a/editions/tw5.com/tiddlers/filters/encodebase64 Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/encodebase64 Operator (Examples).tid new file mode 100644 index 000000000..c49aff77a --- /dev/null +++ b/editions/tw5.com/tiddlers/filters/encodebase64 Operator (Examples).tid @@ -0,0 +1,10 @@ +created: 20240831025156306 +modified: 20240831041537886 +tags: [[encodebase64 Operator]] [[Operator Examples]] +title: encodebase64 Operator (Examples) + +<<.operator-example 1 "[[test]encodebase64[]]">> + +<<.operator-example 2 "[[😎]encodebase64[]]">> + +<<.operator-example 3 "[[😎]encodebase64:urlsafe[]]">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid b/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid index a7943d726..918d656d2 100644 --- a/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid +++ b/editions/tw5.com/tiddlers/filters/encodebase64 Operator.tid @@ -1,14 +1,16 @@ caption: encodebase64 +created: 20240831034955575 +from-version: 5.2.6 +modified: 20240831035003716 op-input: a [[selection of titles|Title Selection]] op-output: the input with base 64 encoding applied -op-suffix: optional: `binary` to treat input as binary data, `urlsafe` for URL-safe output op-parameter: op-parameter-name: -op-purpose: apply base 64 encoding to a string +op-purpose: apply [[base 64|Base64]] encoding to a string +op-suffix: optional: `binary` to treat input as binary data, `urlsafe` for URL-safe output tags: [[Filter Operators]] [[String Operators]] title: encodebase64 Operator type: text/vnd.tiddlywiki -from-version: 5.2.6 See Mozilla Developer Network for details of [[base 64 encoding|https://developer.mozilla.org/en-US/docs/Glossary/Base64]]. TiddlyWiki uses [[library code from @nijikokun|https://gist.github.com/Nijikokun/5192472]] to handle the conversion. From dcf63b75fa09f52da7cfd5997cb30ab0216025a9 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sat, 7 Sep 2024 02:40:05 +0800 Subject: [PATCH 22/66] Fix suffix does not work for base64 operators (#8574) * Fix suffix does not work for base64 operators * Remove console.log --- core/modules/filters/encodings.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/modules/filters/encodings.js b/core/modules/filters/encodings.js index a43a15f76..231e4d119 100644 --- a/core/modules/filters/encodings.js +++ b/core/modules/filters/encodings.js @@ -18,8 +18,8 @@ Export our filter functions exports.decodebase64 = function(source,operator,options) { var results = []; - var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1; - var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1; + var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1; + var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1; source(function(tiddler,title) { results.push($tw.utils.base64Decode(title,binary,urlsafe)); }); @@ -28,8 +28,8 @@ exports.decodebase64 = function(source,operator,options) { exports.encodebase64 = function(source,operator,options) { var results = []; - var binary = operator.suffixes && operator.suffixes.indexOf("binary") !== -1; - var urlsafe = operator.suffixes && operator.suffixes.indexOf("urlsafe") !== -1; + var binary = operator.suffixes && operator.suffixes[0].indexOf("binary") !== -1; + var urlsafe = operator.suffixes && operator.suffixes[0].indexOf("urlsafe") !== -1; source(function(tiddler,title) { results.push($tw.utils.base64Encode(title,binary,urlsafe)); }); From 38657a232368adced318f1cb0d5f6cfa58c2eb66 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Fri, 6 Sep 2024 20:46:53 +0200 Subject: [PATCH 23/66] tm-new-tiddler - Create empty tags field only if template or additionalFields contain a tags-field (#8559) * create empty tags only if template or additionalFields contain a tags-field * fix typos * add tests for tm-new-tiddler message * tm-new-tiddler add standard test with tags field --- core/modules/widgets/navigator.js | 14 ++-- .../create-a-new-tiddler-with-a-tag.tid | 38 +++++++++++ .../data/messages/tm-new-tiddler/default.tid | 39 +++++++++++ .../new-from-template-with-tag.tid | 44 +++++++++++++ .../new-from-template-without-tag.tid | 65 +++++++++++++++++++ .../messages/tm-new-tiddler/new-with-tag.tid | 40 ++++++++++++ 6 files changed, 235 insertions(+), 5 deletions(-) create mode 100644 editions/test/tiddlers/tests/data/messages/tm-new-tiddler/create-a-new-tiddler-with-a-tag.tid create mode 100644 editions/test/tiddlers/tests/data/messages/tm-new-tiddler/default.tid create mode 100644 editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-with-tag.tid create mode 100644 editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-without-tag.tid create mode 100644 editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-with-tag.tid diff --git a/core/modules/widgets/navigator.js b/core/modules/widgets/navigator.js index efdbba83f..e9bec7682 100755 --- a/core/modules/widgets/navigator.js +++ b/core/modules/widgets/navigator.js @@ -184,7 +184,7 @@ NavigatorWidget.prototype.handleCloseOtherTiddlersEvent = function(event) { // Place a tiddler in edit mode NavigatorWidget.prototype.handleEditTiddlerEvent = function(event) { var editTiddler = $tw.hooks.invokeHook("th-editing-tiddler",event), - win = event.event && event.event.view ? event.event.view : window; + win = event.event && event.event.view ? event.event.view : window; if(!editTiddler) { return false; } @@ -306,7 +306,7 @@ NavigatorWidget.prototype.handleSaveTiddlerEvent = function(event) { var title = event.param || event.tiddlerTitle, tiddler = this.wiki.getTiddler(title), storyList = this.getStoryList(), - win = event.event && event.event.view ? event.event.view : window; + win = event.event && event.event.view ? event.event.view : window; // Replace the original tiddler with the draft if(tiddler) { var draftTitle = (tiddler.fields["draft.title"] || "").trim(), @@ -412,7 +412,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { event = $tw.hooks.invokeHook("th-new-tiddler", event); // Get the story details var storyList = this.getStoryList(), - templateTiddler, additionalFields, title, draftTitle, existingTiddler; + templateTiddler, additionalFields, title, draftTitle, existingTiddler, + templateHasTags = false; // Get the template tiddler (if any) if(typeof event.param === "string") { // Get the template tiddler @@ -457,8 +458,10 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { // Merge tags mergedTags = $tw.utils.pushTop(mergedTags,$tw.utils.parseStringArray(additionalFields.tags)); } + var additionalFieldsHasTags = !!(additionalFields && (additionalFields.tags === "")); if(templateTiddler && templateTiddler.fields.tags) { // Merge tags + templateHasTags = true; mergedTags = $tw.utils.pushTop(mergedTags,templateTiddler.fields.tags); } // Save the draft tiddler @@ -474,7 +477,8 @@ NavigatorWidget.prototype.handleNewTiddlerEvent = function(event) { { title: draftTitle, "draft.of": title, - tags: mergedTags + // If template or additionalFields have "tags" even if empty a tags field will be created. + tags: ((mergedTags.length > 0) || templateHasTags || additionalFieldsHasTags) ? mergedTags : undefined },this.wiki.getModificationFields()); this.wiki.addTiddler(draftTiddler); // Update the story to insert the new draft at the top and remove any existing tiddler @@ -526,7 +530,7 @@ NavigatorWidget.prototype.handleImportTiddlersEvent = function(event) { var systemMessage = $tw.language.getString("Import/Upgrader/Tiddler/Unselected"); $tw.utils.each(messages,function(message,title) { newFields["message-" + title] = message; - if (message.indexOf(systemMessage) !== -1) { + if(message.indexOf(systemMessage) !== -1) { newFields["selection-" + title] = "unchecked"; } }); diff --git a/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/create-a-new-tiddler-with-a-tag.tid b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/create-a-new-tiddler-with-a-tag.tid new file mode 100644 index 000000000..3f9204da8 --- /dev/null +++ b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/create-a-new-tiddler-with-a-tag.tid @@ -0,0 +1,38 @@ +title: Message/tm-new-tiddler/create-a-new-tiddler-with-a-tag +description: tm-new-tiddler message will create a new draft tiddler with a tag +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<pre>{{Draft of 'New Tiddler'||output-template}}</pre> ++ +title: Actions + +<$navigator story="$:/StoryList"> + +<$action-sendmessage $message="tm-new-tiddler" + text="some text" + z-field="a" + tags="test [[with spaces]]" +/> + +</$navigator> + ++ +title: output-template + +<!-- This template is used for saving tiddlers in TiddlyWeb *.tid format --> +<$fields exclude='text bag created modified' template='$name$: $value$ +'></$fields> +<$view field="text" format="text" /> ++ +title: ExpectedResult + +<p><pre>draft.of: New Tiddler +draft.title: New Tiddler +tags: test [[with spaces]] +title: Draft of 'New Tiddler' +z-field: a + +some text</pre></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/default.tid b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/default.tid new file mode 100644 index 000000000..cba16f261 --- /dev/null +++ b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/default.tid @@ -0,0 +1,39 @@ +title: Message/tm-new-tiddler/default +description: tm-new-tiddler message will create a new draft tiddler +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<pre>{{Draft of 'New Tiddler'||output-template}}</pre> ++ +title: Actions + +<$navigator story="$:/StoryList"> + +New in TW v5.3.6 + Create a draft tiddler which should have __no__ tags field + +<$action-sendmessage $message="tm-new-tiddler" + text="some text" + z-field="a" +/> + +</$navigator> + ++ +title: output-template + +<!-- This template is used for saving tiddlers in TiddlyWeb *.tid format --> +<$fields exclude='text bag created modified' template='$name$: $value$ +'></$fields> +<$view field="text" format="text" /> ++ +title: ExpectedResult + +<p><pre>draft.of: New Tiddler +draft.title: New Tiddler +title: Draft of 'New Tiddler' +z-field: a + +some text</pre></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-with-tag.tid b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-with-tag.tid new file mode 100644 index 000000000..aceeffdde --- /dev/null +++ b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-with-tag.tid @@ -0,0 +1,44 @@ +title: Message/tm-new-tiddler/new-from-template-with-tag +description: tm-new-tiddler create a draft from a template. Template has an empty tags field +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<pre>{{ Draft of 'new-tiddler-template 1'||output-template}}</pre> ++ +title: Actions + +<$navigator story="$:/StoryList"> + +<$action-sendmessage $message="tm-new-tiddler" + $param="new-tiddler-template" + text="some text" + z-field="a" +/> + +</$navigator> + ++ +title: new-tiddler-template +asdf: asdf +tags: + ++ +title: output-template + +<!-- This template is used for saving tiddlers in TiddlyWeb *.tid format --> +<$fields exclude='text bag created modified' template='$name$: $value$ +'></$fields> +<$view field="text" format="text" /> ++ +title: ExpectedResult + +<p><pre>asdf: asdf +draft.of: new-tiddler-template 1 +draft.title: new-tiddler-template 1 +tags: +title: Draft of 'new-tiddler-template 1' +z-field: a + +some text</pre></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-without-tag.tid b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-without-tag.tid new file mode 100644 index 000000000..dfb815f09 --- /dev/null +++ b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-from-template-without-tag.tid @@ -0,0 +1,65 @@ +title: Message/tm-new-tiddler/new-from-template-without-tag +description: tm-new-tiddler create 2 drafts from a template. Template has no tags field +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<pre>{{ Draft of 'new-tiddler-template 1'||output-template}}</pre> +<pre>{{ Draft of 'new-tiddler-template 2'||output-template}}</pre> ++ +title: Actions + +<$navigator story="$:/StoryList"> + +New in TW v5.3.6 + Create a new tiddler from a template, which has no tags field + So draft should also have __no__ tags field + +<$action-sendmessage $message="tm-new-tiddler" + $param="new-tiddler-template" + text="some text" + z-field="a" +/> + +Create a new tiddler from a template, which has no tag field +AND __add__ a tags field with the command below + +<$action-sendmessage $message="tm-new-tiddler" + $param="new-tiddler-template" + text="some text" + z-field="a" + tag="" +/> + +</$navigator> + ++ +title: new-tiddler-template +asdf: asdf + ++ +title: output-template + +<!-- This template is used for saving tiddlers in TiddlyWeb *.tid format --> +<$fields exclude='text bag created modified' template='$name$: $value$ +'></$fields> +<$view field="text" format="text" /> ++ +title: ExpectedResult + +<p><pre>asdf: asdf +draft.of: new-tiddler-template 1 +draft.title: new-tiddler-template 1 +title: Draft of 'new-tiddler-template 1' +z-field: a + +some text</pre> +<pre>asdf: asdf +draft.of: new-tiddler-template 2 +draft.title: new-tiddler-template 2 +tag: +title: Draft of 'new-tiddler-template 2' +z-field: a + +some text</pre></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-with-tag.tid b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-with-tag.tid new file mode 100644 index 000000000..9b52e7de1 --- /dev/null +++ b/editions/test/tiddlers/tests/data/messages/tm-new-tiddler/new-with-tag.tid @@ -0,0 +1,40 @@ +title: Message/tm-new-tiddler/new-with-tag +description: tm-new-tiddler message creates a draft tiddler with an empty tag field +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<pre>{{Draft of 'New Tiddler'||output-template}}</pre> ++ +title: Actions + +<$navigator story="$:/StoryList"> + +Create a draft tiddler which __should have a tags field__ + +<$action-sendmessage $message="tm-new-tiddler" + text="some text" + z-field="a" + tag="" +/> + +</$navigator> + ++ +title: output-template + +<!-- This template is used for saving tiddlers in TiddlyWeb *.tid format --> +<$fields exclude='text bag created modified' template='$name$: $value$ +'></$fields> +<$view field="text" format="text" /> ++ +title: ExpectedResult + +<p><pre>draft.of: New Tiddler +draft.title: New Tiddler +tag: +title: Draft of 'New Tiddler' +z-field: a + +some text</pre></p> \ No newline at end of file From 7f2ab57f78e51bddba2193fe2978f96f98deda17 Mon Sep 17 00:00:00 2001 From: Simon Baird <sbaird@redhat.com> Date: Fri, 6 Sep 2024 14:55:51 -0400 Subject: [PATCH 24/66] Fix invalid accept header in put saver (#8547) IIUC the charset doesn't belong in the Accept header. It does belong in a Content-Type header though, see [1] and [2]. FYI this header causes problems for Tiddlyhost which must work around the invalid mime type, see [3] for the nitty-gritty. [1] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept [2] https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type [3] https://github.com/simonbaird/tiddlyhost/commit/10cd3535529adf9ec1241ab8cd639ba1a2abb16f --- core/modules/savers/put.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/modules/savers/put.js b/core/modules/savers/put.js index 87fe5f710..69689e6db 100644 --- a/core/modules/savers/put.js +++ b/core/modules/savers/put.js @@ -20,7 +20,7 @@ Retrieve ETag if available */ var retrieveETag = function(self) { var headers = { - Accept: "*/*;charset=UTF-8" + Accept: "*/*" }; $tw.utils.httpRequest({ url: self.uri(), From dc7f8cb0af68c53607a11760ce869e91a137ac74 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sat, 7 Sep 2024 22:04:55 +0800 Subject: [PATCH 25/66] Add docs for some hidden settings (#8508) * Add docs for $:/config/EmptyStoryMessage in hidden settings * Add docs for $:/config/DefaultTiddlerColour --- ...tting Content to be displayed for empty story.tid | 12 ++++++++++++ .../Hidden Setting Default Tiddler Colour.tid | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Content to be displayed for empty story.tid create mode 100644 editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid diff --git a/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Content to be displayed for empty story.tid b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Content to be displayed for empty story.tid new file mode 100644 index 000000000..f3497d5be --- /dev/null +++ b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Content to be displayed for empty story.tid @@ -0,0 +1,12 @@ +created: 20240811052854726 +modified: 20240811053649554 +tags: [[Hidden Settings]] +title: Hidden Setting: Content to be displayed for empty story + +To display content when the story is empty, create $:/config/EmptyStoryMessage and enter the desired contents. + +The following would show the GettingStarted tiddler when all others are closed. + +``` +{{GettingStarted||$:/core/ui/ViewTemplate}} +``` \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid new file mode 100644 index 000000000..e8bb0dc87 --- /dev/null +++ b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid @@ -0,0 +1,7 @@ +created: 20240907042443909 +modified: 20240907042629405 +tags: [[Hidden Settings]] +title: Hidden Setting: Default Tiddler Colour +type: text/vnd.tiddlywiki + +A default tiddler colour can be specified by creating a tiddler called $:/config/DefaultTiddlerColour containing the title of the tiddler containing the CSS color value. From 4327d58c1b3a90981ad8543633008006e4cf8b5e Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sun, 8 Sep 2024 20:41:32 +0800 Subject: [PATCH 26/66] Fix description for $:/config/DefaultTiddlerColour (#8588) A small fix after #8508 --- .../hiddensettings/Hidden Setting Default Tiddler Colour.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid index e8bb0dc87..649fd7629 100644 --- a/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid +++ b/editions/tw5.com/tiddlers/hiddensettings/Hidden Setting Default Tiddler Colour.tid @@ -4,4 +4,4 @@ tags: [[Hidden Settings]] title: Hidden Setting: Default Tiddler Colour type: text/vnd.tiddlywiki -A default tiddler colour can be specified by creating a tiddler called $:/config/DefaultTiddlerColour containing the title of the tiddler containing the CSS color value. +A default tiddler colour can be specified by creating a tiddler called $:/config/DefaultTiddlerColour containing the CSS color value. From d827c57dcf3229f799d112567a0be2080a9d61c4 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Sun, 8 Sep 2024 16:57:55 +0200 Subject: [PATCH 27/66] Make export macros code readable without changing any functionality (#8513) --- core/wiki/macros/export.tid | 61 ++++++++++++++++++++++++------------- 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/core/wiki/macros/export.tid b/core/wiki/macros/export.tid index 3d0d14760..42d42a48a 100644 --- a/core/wiki/macros/export.tid +++ b/core/wiki/macros/export.tid @@ -7,27 +7,44 @@ $baseFilename$$(extension)$ \define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers") \whitespace trim -<$vars hint={{{ [<__lingoBase__>addsuffix[Hint]get[text]] }}} caption={{{ [<__lingoBase__>addsuffix[Caption]get[text]] }}}> -<span class="tc-popup-keep"><$button popup=<<qualify "$:/state/popup/export">> tooltip=<<hint>> aria-label=<<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=<<caption>>/></span> -</$list> -</$button></span></$vars><$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes"> -<div class="tc-drop-down"> -<$set name="count" value={{{ [subfilter<__exportFilter__>count[]] }}}> -<$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]"> -<$list filter="[<currentTiddler>has[condition]subfilter{!!condition}limit[1]] ~[<currentTiddler>!has[condition]then[true]]" variable="ignore"> -<$button class="tc-btn-invisible"> -<$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> exportFilter=<<__exportFilter__>> filename={{{ [<__baseFilename__>addsuffix{!!extension}] }}}/> -<$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/> -<$transclude field="description"/> -</$button> -</$list> -</$list> -</$set> -</div> +<$vars hint={{{ [<__lingoBase__>addsuffix[Hint]get[text]] }}} + caption={{{ [<__lingoBase__>addsuffix[Caption]get[text]] }}} +> + <span class="tc-popup-keep"> + <$button popup=<<qualify "$:/state/popup/export">> + tooltip=<<hint>> + aria-label=<<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=<<caption>>/></span> + </$list> + </$button> + </span> +</$vars> +<$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes"> + <div class="tc-drop-down"> + <$set name="count" value={{{ [subfilter<__exportFilter__>count[]] }}}> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]"> + <$list filter="[<currentTiddler>has[condition]subfilter{!!condition}limit[1]] ~[<currentTiddler>!has[condition]then[true]]" + variable="ignore" + > + <$button class="tc-btn-invisible"> + <$action-sendmessage $message="tm-download-file" + $param=<<currentTiddler>> + exportFilter=<<__exportFilter__>> + filename={{{ [<__baseFilename__>addsuffix{!!extension}] }}} + /> + <$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/> + <$transclude field="description"/> + </$button> + </$list> + </$list> + </$set> + </div> </$reveal> \end From e1b3308a9ddafebd7352d76b7480037d50515008 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Mon, 9 Sep 2024 10:48:57 +0200 Subject: [PATCH 28/66] Fix float right overflow (#8557) * tc-subtitle is not a sibling to tc-body, So tc-subtitle needs a clearfix to contains float:right * add clearfix to all tiddler elements that could contain floats * add clearfix to tc-tiddler-title in ViewTemplate * add clearfix to plugin/blog/templates * add clearfix to plugin/tour/templates * remove test tiddler * rename draft title class to tc-tiddler-title-draft * undo title field covering * move tc-clearfix to tc-float-right in the base CSS file * rename clearfix CSS class to tc-clearfix * update documentation tiddlers --- core/templates/server/static.tiddler.wikitext.tid | 8 ++++---- core/ui/EditTemplate/controls.tid | 3 +-- core/ui/ViewTemplate/body.tid | 2 +- core/ui/ViewTemplate/subtitle/default.tid | 2 +- core/ui/ViewTemplate/title.tid | 2 +- .../tw5.com/tiddlers/definitions/Tiddlyhost.tid | 7 +++---- editions/tw5.com/tiddlers/definitions/Xememex.tid | 7 +++---- .../tw5.com/tiddlers/wikitext/Utility Classes.tid | 2 +- plugins/tiddlywiki/blog/templates/tiddler.tid | 4 ++-- .../tour/simplified-tiddler-with-tags.tid | 8 ++++---- plugins/tiddlywiki/tour/simplified-tiddler.tid | 4 ++-- themes/tiddlywiki/vanilla/base.tid | 15 +++++++++++---- 12 files changed, 34 insertions(+), 30 deletions(-) diff --git a/core/templates/server/static.tiddler.wikitext.tid b/core/templates/server/static.tiddler.wikitext.tid index 2d2bdaba6..1f2ee3cf4 100644 --- a/core/templates/server/static.tiddler.wikitext.tid +++ b/core/templates/server/static.tiddler.wikitext.tid @@ -1,23 +1,23 @@ title: $:/core/templates/server/static.tiddler.wikitext \whitespace trim -<div class="tc-tiddler-title"> +<div class="tc-tiddler-title tc-clearfix"> <div class="tc-titlebar"> <h2><$text text=<<currentTiddler>>/></h2> </div> </div> -<div class="tc-subtitle"> +<div class="tc-subtitle tc-clearfix"> <$link to={{!!modifier}}> <$view field="modifier"/> </$link> <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/> </div> -<div class="tc-tags-wrapper"> +<div class="tc-tags-wrapper" tc-clearfix> <$list filter="[all[current]tags[]sort[title]]"> <a href={{{ [<currentTiddler>encodeuricomponent[]] }}}> <$macrocall $name="tag-pill" tag=<<currentTiddler>>/> </a> </$list> </div> -<div class="tc-tiddler-body"> +<div class="tc-tiddler-body tc-clearfix"> <$transclude mode="block"/> </div> diff --git a/core/ui/EditTemplate/controls.tid b/core/ui/EditTemplate/controls.tid index e97cedd78..3bb90aac1 100644 --- a/core/ui/EditTemplate/controls.tid +++ b/core/ui/EditTemplate/controls.tid @@ -3,7 +3,7 @@ tags: $:/tags/EditTemplate \define config-title() $:/config/EditToolbarButtons/Visibility/$(listItem)$ \whitespace trim -<div class="tc-tiddler-title tc-tiddler-edit-title"> +<div class="tc-tiddler-title tc-tiddler-edit-title tc-clearfix"> <$view field="title"/> <span class="tc-tiddler-controls tc-titlebar"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"> @@ -14,5 +14,4 @@ tags: $:/tags/EditTemplate </$let> </$list> </span> - <div style="clear: both;"></div> </div> diff --git a/core/ui/ViewTemplate/body.tid b/core/ui/ViewTemplate/body.tid index 34e6aaa38..e4f03ec0e 100644 --- a/core/ui/ViewTemplate/body.tid +++ b/core/ui/ViewTemplate/body.tid @@ -3,7 +3,7 @@ tags: $:/tags/ViewTemplate \import [all[shadows+tiddlers]tag[$:/tags/Macro/View/Body]!is[draft]] [all[shadows+tiddlers]tag[$:/tags/Global/View/Body]!is[draft]] -<$reveal tag="div" class="tc-tiddler-body" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes"> +<$reveal tag="div" class="tc-tiddler-body tc-clearfix" type="nomatch" stateTitle=<<folded-state>> text="hide" retain="yes" animate="yes"> <$transclude tiddler={{{ [<currentTiddler>] :cascade[all[shadows+tiddlers]tag[$:/tags/ViewTemplateBodyFilter]!is[draft]get[text]] :and[!is[blank]else[$:/core/ui/ViewTemplate/body/default]] }}} /> diff --git a/core/ui/ViewTemplate/subtitle/default.tid b/core/ui/ViewTemplate/subtitle/default.tid index 3885dc779..99042c95e 100644 --- a/core/ui/ViewTemplate/subtitle/default.tid +++ b/core/ui/ViewTemplate/subtitle/default.tid @@ -2,7 +2,7 @@ title: $:/core/ui/ViewTemplate/subtitle/default \whitespace trim <$reveal type="nomatch" stateTitle=<<folded-state>> text="hide" tag="div" retain="yes" animate="yes"> -<div class="tc-subtitle"> +<div class="tc-subtitle tc-clearfix"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler"> <$transclude tiddler=<<subtitleTiddler>> mode="inline"/><$list-join> </$list-join> </$list> diff --git a/core/ui/ViewTemplate/title.tid b/core/ui/ViewTemplate/title.tid index 225ea4351..b2cf1bd8e 100644 --- a/core/ui/ViewTemplate/title.tid +++ b/core/ui/ViewTemplate/title.tid @@ -4,7 +4,7 @@ tags: $:/tags/ViewTemplate \whitespace trim \define title-styles() fill:$(foregroundColor)$; -<div class="tc-tiddler-title"> +<div class="tc-tiddler-title tc-clearfix"> <div class="tc-titlebar"> <span class="tc-tiddler-controls"> <$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewToolbar]!has[draft.of]] :filter[lookup[$:/config/ViewToolbarButtons/Visibility/]!match[hide]]" diff --git a/editions/tw5.com/tiddlers/definitions/Tiddlyhost.tid b/editions/tw5.com/tiddlers/definitions/Tiddlyhost.tid index 8dee477da..3a9140237 100644 --- a/editions/tw5.com/tiddlers/definitions/Tiddlyhost.tid +++ b/editions/tw5.com/tiddlers/definitions/Tiddlyhost.tid @@ -1,12 +1,11 @@ -title: Tiddlyhost -tags: Definitions created: 20230410105035569 modified: 20230410105035569 +tags: Definitions +title: Tiddlyhost +type: text/vnd.tiddlywiki <span style="float:right;">[img width=140 [Tiddlyhost Logo]]</span> [[Tiddlyhost.com|https://tiddlyhost.com/]] is a hosting service for TiddlyWiki created by Simon Baird. Once you sign up and confirm your email you can create "sites", (i.e. ~TiddlyWikis), with support for online saving. Sites can be private or public, and you can optionally list them on the taggable and searchable [[Tiddlyhost Hub|https://tiddlyhost.com/hub]] where they'll be discoverable by others. Unlike [[TiddlySpot|Saving on TiddlySpot]], [[Tiddlyhost|https://tiddlyhost.com]] is secure, open source, and has proper support for TiddlyWiki5. It also allows uploading existing ~TiddlyWiki files, supports TiddlyWikiClassic, and lets you claim ownership of your ~TiddlySpot sites. For more information see the [[FAQ|https://github.com/simonbaird/tiddlyhost/wiki/FAQ]] and the [[About|https://tiddlyhost.com/about]] page. - -<div style="clear: both;"/> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/definitions/Xememex.tid b/editions/tw5.com/tiddlers/definitions/Xememex.tid index e69c17e8b..8f3fc1dd6 100644 --- a/editions/tw5.com/tiddlers/definitions/Xememex.tid +++ b/editions/tw5.com/tiddlers/definitions/Xememex.tid @@ -1,7 +1,8 @@ -title: Xememex -tags: Definitions created: 20230410105035569 modified: 20230410105035569 +tags: Definitions +title: Xememex +type: text/vnd.tiddlywiki <span style="float:right;">[img width=340 [Xememex Logo]]</span> @@ -10,5 +11,3 @@ Xememex is a multiuser TiddlyWiki from [[Intertwingled Innovations]]. It allows The largest customer implementation has hundreds of online wikis with thousands of users. See https://manuals.annafreud.org/ Xememex is currently only available under commercial terms from Intertwingled Innovations. Contact [[Jeremy Ruston at Intertwingled Innovations|mailto:jeremy@intertwingledinnovations.com]] for more details. - -<div style="clear: both;"/> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid b/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid index 4a291e34b..b61246960 100644 --- a/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid +++ b/editions/tw5.com/tiddlers/wikitext/Utility Classes.tid @@ -13,7 +13,7 @@ type: text/vnd.tiddlywiki |`tc-max-width-80`|Sets the width of a block-element to use 80% of the maximum container width. This setting is useful with the `tc-center` class | |`tc-edit-max-width `|Expands [[TextWidget]]s to use the maximum available width. See [[ControlPanel -> Info -> Basics|$:/core/ui/ControlPanel/Basics]]| |`tc-first-link-nowrap` |Ensures that any links in the first table column will never wrap to the next line | - +|`tc-clearfix`|<<.from-version "5.3.6">> This class can be used to prevent elements, that have a `class="tc-float-right"` from overflowing their container elements. tc-clearfix is already assigned to all major ViewTemplate and EditTemplate elements. So it only needs to be used where the default does not work out of the box.| !! Table Utility Classes |`tc-table-no-border` |Removes the borders of a table | diff --git a/plugins/tiddlywiki/blog/templates/tiddler.tid b/plugins/tiddlywiki/blog/templates/tiddler.tid index 32e625861..074e89c22 100644 --- a/plugins/tiddlywiki/blog/templates/tiddler.tid +++ b/plugins/tiddlywiki/blog/templates/tiddler.tid @@ -1,8 +1,8 @@ title: $:/plugins/tiddlywiki/blog/templates/tiddler -<div class="tc-tiddler-frame tc-tiddler-view-frame"> +<div class="tc-tiddler-frame tc-tiddler-view-frame tc-clearfix"> -<div class="tc-tiddler-title"> +<div class="tc-tiddler-title tc-clearfix"> <div class="tc-titlebar"> diff --git a/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid b/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid index 9adf981e1..c2c14a7b0 100644 --- a/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid +++ b/plugins/tiddlywiki/tour/simplified-tiddler-with-tags.tid @@ -81,8 +81,8 @@ color:$(foregroundColor)$; \end <$let storyTiddler=<<currentTiddler>>> - <div class="tc-tiddler-frame tc-tiddler-view-frame tc-tiddler-exists tc-tiddler-shadow " role="article"> - <div class="tc-tiddler-title"> + <div class="tc-tiddler-frame tc-tiddler-view-frame tc-tiddler-exists tc-tiddler-shadow tc-clearfix" role="article"> + <div class="tc-tiddler-title tc-clearfix"> <div class="tc-titlebar"> <span class="tc-tiddler-controls"> <$list filter="[<tour-simplified-tiddler-close-button>match[yes]]" variable="ignore"> @@ -94,12 +94,12 @@ color:$(foregroundColor)$; </span> </div> </div> - <div class="tc-tags-wrapper"> + <div class="tc-tags-wrapper tc-clearfix"> <$list filter="[all[current]tags[]sort[title]]" storyview="pop"> <<simplified-tag "$:/plugins/tiddlywiki/tour/introduction-to-tiddlywiki/tiddlers/">> </$list> </div> - <div class="tc-tiddler-body"> + <div class="tc-tiddler-body tc-clearfix"> <$transclude field="text" mode="block"/> </div> </div> diff --git a/plugins/tiddlywiki/tour/simplified-tiddler.tid b/plugins/tiddlywiki/tour/simplified-tiddler.tid index 22a146b9a..302903bee 100644 --- a/plugins/tiddlywiki/tour/simplified-tiddler.tid +++ b/plugins/tiddlywiki/tour/simplified-tiddler.tid @@ -3,7 +3,7 @@ title: $:/plugins/tiddlywiki/tour/simplified-tiddler \whitespace trim <$let storyTiddler=<<currentTiddler>>> <div class="tc-tiddler-frame tc-tiddler-view-frame tc-tiddler-exists tc-tiddler-shadow " role="article"> - <div class="tc-tiddler-title"> + <div class="tc-tiddler-title tc-clearfix"> <div class="tc-titlebar"> <span class="tc-tiddler-controls"> <$list filter="[<tour-simplified-tiddler-close-button>match[yes]]" variable="ignore"> @@ -15,7 +15,7 @@ title: $:/plugins/tiddlywiki/tour/simplified-tiddler </span> </div> </div> - <div class="tc-tiddler-body"> + <div class="tc-tiddler-body tc-clearfix"> <$transclude field="text" mode="block"/> </div> </div> diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index ff64ea23e..65c1a5fe3 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1350,10 +1350,6 @@ canvas.tc-edit-bitmapeditor { display: block; } -.tc-tiddler-body { - clear: both; -} - .tc-single-tiddler-window .tc-tiddler-body, .tc-tiddler-frame .tc-tiddler-body { font-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}}; @@ -2773,6 +2769,16 @@ a.tc-tiddlylink.tc-plugin-info:hover > .tc-plugin-info-chunk .tc-plugin-info-sta float: right; } +/* Float tc-clearfix. Needs to be used by elements that allow float:right in their content. +** So the floating element does not overflow +*/ + +.tc-clearfix:after { + content: ""; + clear: both; + display: table; +} + /* ** Chooser */ @@ -3524,3 +3530,4 @@ span.tc-translink > a:first-child { .tc-tiny-v-gap-bottom { margin-bottom: 3px; } + From 8a8dcf82553fbf5aa0aad8bf24705ac9e7b33553 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 11:49:41 +0200 Subject: [PATCH 29/66] Add startCount to unusedtitle macro, new tests, new docs (#7941) * add startCount to unusedtitle macro, new tests, new docs * rename test files * update .from-version in docs --- core/modules/macros/unusedtitle.js | 10 ++++--- core/modules/utils/utils.js | 6 +++-- core/modules/wiki.js | 16 +++++++---- .../data/macros/unusedtitle/basic-params.tid | 10 ++++++- .../unusedtitle/template-startCount.tid | 27 +++++++++++++++++++ .../data/macros/unusedtitle/template.tid | 2 +- .../tiddlers/macros/UnusedTitleMacro.tid | 7 +++-- .../unusedtitle Macro (Examples 1).tid | 16 ++++++++++- .../tiddlers/macros/examples/unusedtitle.tid | 5 ++-- 9 files changed, 81 insertions(+), 18 deletions(-) create mode 100644 editions/test/tiddlers/tests/data/macros/unusedtitle/template-startCount.tid diff --git a/core/modules/macros/unusedtitle.js b/core/modules/macros/unusedtitle.js index 952bd0264..8a61c425e 100644 --- a/core/modules/macros/unusedtitle.js +++ b/core/modules/macros/unusedtitle.js @@ -16,20 +16,22 @@ exports.name = "unusedtitle"; exports.params = [ {name: "baseName"}, {name: "separator"}, - {name: "template"} + {name: "template"}, + {name: "startCount"} ]; /* Run the macro */ -exports.run = function(baseName,separator,template) { +exports.run = function(baseName,separator,template,startCount) { separator = separator || " "; + startCount = startCount || 0; if(!baseName) { baseName = $tw.language.getString("DefaultNewTiddlerTitle"); } // $tw.wiki.generateNewTitle = function(baseTitle,options) - // options.prefix must be a string! - return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template}); + // options.prefix must be a string! + return this.wiki.generateNewTitle(baseName, {"prefix": separator, "template": template, "startCount": startCount}); }; })(); diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 878f83fbb..234de0c75 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -330,16 +330,18 @@ exports.formatTitleString = function(template,options) { }] ]; while(t.length){ - var matchString = ""; + var matchString = "", + found = false; $tw.utils.each(matches, function(m) { var match = m[0].exec(t); if(match) { + found = true; matchString = m[1].call(null,match); t = t.substr(match[0].length); return false; } }); - if(matchString) { + if(found) { result += matchString; } else { result += t.charAt(0); diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 5673c9e3b..29a839c7a 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -194,18 +194,24 @@ options.prefix must be a string */ exports.generateNewTitle = function(baseTitle,options) { options = options || {}; - var c = 0, - title = baseTitle, - template = options.template, + var title = baseTitle, + template = options.template || "", + // test if .startCount is a positive integer. If not set to 0 + c = (parseInt(options.startCount,10) > 0) ? parseInt(options.startCount,10) : 0, prefix = (typeof(options.prefix) === "string") ? options.prefix : " "; + if (template) { // "count" is important to avoid an endless loop in while(...)!! template = (/\$count:?(\d+)?\$/i.test(template)) ? template : template + "$count$"; - title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":c}); + // .formatTitleString() expects strings as input + title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":c+""}); while(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) { - title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":(++c)}); + title = $tw.utils.formatTitleString(template,{"base":baseTitle,"separator":prefix,"counter":(++c)+""}); } } else { + if (c > 0) { + title = baseTitle + prefix + c; + } while(this.tiddlerExists(title) || this.isShadowTiddler(title) || this.findDraft(title)) { title = baseTitle + prefix + (++c); } diff --git a/editions/test/tiddlers/tests/data/macros/unusedtitle/basic-params.tid b/editions/test/tiddlers/tests/data/macros/unusedtitle/basic-params.tid index 5e1ae482d..c0ec65ec0 100644 --- a/editions/test/tiddlers/tests/data/macros/unusedtitle/basic-params.tid +++ b/editions/test/tiddlers/tests/data/macros/unusedtitle/basic-params.tid @@ -14,7 +14,15 @@ title: Output <<unusedtitle baseName:"About" separator:"-">> +<!-- v5.3.6 startCount --> + +<<unusedtitle startCount:"3">> + +<<unusedtitle startCount:"-1" baseName:"invalid start">> + +<<unusedtitle startCount:"aaa" baseName:"invalid count">> + + title: ExpectedResult -<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p> \ No newline at end of file +<p>New Tiddler</p><p>New Tiddler</p><p>anotherBase</p><p>About</p><p>New Tiddler 3</p><p>invalid start</p><p>invalid count</p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/macros/unusedtitle/template-startCount.tid b/editions/test/tiddlers/tests/data/macros/unusedtitle/template-startCount.tid new file mode 100644 index 000000000..83fc1686b --- /dev/null +++ b/editions/test/tiddlers/tests/data/macros/unusedtitle/template-startCount.tid @@ -0,0 +1,27 @@ +title: Macros/unusedtitle/template-startCount +description: test <<unusedtitle>> with templates and startCount +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +<!-- test template basics --> + +<<unusedtitle template:"$basename$$separator$$count$xx" >> + +<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"4" >> + +<<unusedtitle template:"$basename$$separator$$count:1$xx" startCount:"11">> + +<!-- test parameter edgecases --> + +<<unusedtitle template:"$basename$$separator$$count:2$xx" startCount:"" baseName:"emptyCount">> + +<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"-1" separator:"" baseName:"invalid start" >> + +<<unusedtitle template:"$basename$$separator$$count$xx" startCount:"bbb" separator:"" baseName:"invalid count" >> + ++ +title: ExpectedResult + +<p>New Tiddler 0xx</p><p>New Tiddler 4xx</p><p>New Tiddler 11xx</p><p>emptyCount 00xx</p><p>invalid start 0xx</p><p>invalid count 0xx</p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/macros/unusedtitle/template.tid b/editions/test/tiddlers/tests/data/macros/unusedtitle/template.tid index 66bd0f763..183ad42da 100644 --- a/editions/test/tiddlers/tests/data/macros/unusedtitle/template.tid +++ b/editions/test/tiddlers/tests/data/macros/unusedtitle/template.tid @@ -25,4 +25,4 @@ title: Output + title: ExpectedResult -<p>New Tiddler</p><p>count-missing</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p> \ No newline at end of file +<p>New Tiddler</p><p>count-missing0</p><p>00-new</p><p>00-base</p><p>00-New Tiddler</p><p>00-asdf</p><p>00 asdf</p> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/macros/UnusedTitleMacro.tid b/editions/tw5.com/tiddlers/macros/UnusedTitleMacro.tid index e0cc00433..b39bb5eb1 100644 --- a/editions/tw5.com/tiddlers/macros/UnusedTitleMacro.tid +++ b/editions/tw5.com/tiddlers/macros/UnusedTitleMacro.tid @@ -1,6 +1,6 @@ caption: unusedtitle created: 20210104143546885 -modified: 20210427184035684 +modified: 20240119224103283 tags: Macros [[Core Macros]] title: unusedtitle Macro type: text/vnd.tiddlywiki @@ -18,7 +18,10 @@ It uses the same method as the create new tiddler button, a number is appended t : <<.from-version "5.2.0">> An ''optional'' string specifying the separator between baseName and the unique number. eg: `separator:"-"`. Defaults to a space: `" "`. If you need an empty separator use the ''template''! ; template -: <<.from-version "5.2.0">> A ''optional'' template string can be used to allow you maximum flexibility. If the template string is used, there will always be a counter value. +: <<.from-version "5.2.0">> An ''optional'' template string can be used to allow you maximum flexibility. If the template string is used, there will always be a counter value. + +; startCount +: <<.from-version "5.3.6">> An ''optional'' parameter, that sets the initial value for the new tiddler counter. !! Template String diff --git a/editions/tw5.com/tiddlers/macros/examples/unusedtitle Macro (Examples 1).tid b/editions/tw5.com/tiddlers/macros/examples/unusedtitle Macro (Examples 1).tid index 22ece3997..3853299bf 100644 --- a/editions/tw5.com/tiddlers/macros/examples/unusedtitle Macro (Examples 1).tid +++ b/editions/tw5.com/tiddlers/macros/examples/unusedtitle Macro (Examples 1).tid @@ -1,5 +1,5 @@ created: 20210227212730299 -modified: 20211118025545823 +modified: 20240119151636562 tags: [[Macro Examples]] title: unusedtitle Macro (Examples 1) type: text/vnd.tiddlywiki @@ -16,6 +16,10 @@ type: text/vnd.tiddlywiki <$action-sendmessage $message="tm-new-tiddler" title=<<unusedtitle baseName:"new" template:"$count:2$-$basename$">> /> \end +\define testStartCount() +<$action-createtiddler $basetitle=<<unusedtitle startCount:"10" baseName:"new" separator:"-" template:"$count:2$$separator$$basename$">>/> +\end + ``` <<unusedtitle template:"$count:2$-new">> ``` @@ -43,6 +47,16 @@ New Tiddler Create Tiddler </$button> + +``` +<<unusedtitle startCount:"10" baseName:"new" separator:"-" template:"$count:2$$separator$$basename$">> +``` + +<$button actions=<<testStartCount>>> +<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> +Create Tiddler +</$button> + --- <details> diff --git a/editions/tw5.com/tiddlers/macros/examples/unusedtitle.tid b/editions/tw5.com/tiddlers/macros/examples/unusedtitle.tid index a86f0d16e..fc9ed29ed 100644 --- a/editions/tw5.com/tiddlers/macros/examples/unusedtitle.tid +++ b/editions/tw5.com/tiddlers/macros/examples/unusedtitle.tid @@ -1,5 +1,5 @@ created: 20210104143940715 -modified: 20210228141241657 +modified: 20240119150720917 tags: [[unusedtitle Macro]] [[Macro Examples]] title: unusedtitle Macro (Examples) type: text/vnd.tiddlywiki @@ -9,7 +9,8 @@ type: text/vnd.tiddlywiki <$macrocall $name=".example" n="2" eg="""<<unusedtitle separator:"-">>"""/> <$macrocall $name=".example" n="3" eg="""<<unusedtitle baseName:"anotherBase">>"""/> <$macrocall $name=".example" n="4" eg="""<<unusedtitle baseName:"About" separator:"-">>"""/> -<$macrocall $name=".example" n="5" eg="""<<unusedtitle template:"$count:2$-test">>"""/> +<$macrocall $name=".example" n="5" eg="""<<unusedtitle baseName:"Count" startCount:"3">>"""/> +<$macrocall $name=".example" n="6" eg="""<<unusedtitle template:"$count:2$-test">>"""/> --- From 3434884ea46349f32c8c42362c191dbf79c29180 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 10 Sep 2024 18:13:00 +0800 Subject: [PATCH 30/66] Add a settings page for markdown plugin (#8585) * Add a settings page for markdown plugin * Add link to $:/config/markdown/renderWikiText * Place "Quotes replacement" settings after "Typographer" * Add link to plugin itself & remove transclusion in config tab The transclusion to $:/plugins/tiddlywiki/markdown/settings in config tab is removed to avoid confusion * Add settings tab in plugin info --- plugins/tiddlywiki/markdown/config.tid | 10 ---------- plugins/tiddlywiki/markdown/plugin.info | 2 +- plugins/tiddlywiki/markdown/settings.tid | 19 +++++++++++++++++++ .../tiddlywiki/markdown/settings/breaks.tid | 9 +++++++++ .../tiddlywiki/markdown/settings/linkify.tid | 9 +++++++++ .../tiddlywiki/markdown/settings/quotes.tid | 8 ++++++++ .../markdown/settings/renderWikiText.tid | 9 +++++++++ .../settings/renderWikiTextPragma.tid | 7 +++++++ .../markdown/settings/typographer.tid | 9 +++++++++ 9 files changed, 71 insertions(+), 11 deletions(-) create mode 100644 plugins/tiddlywiki/markdown/settings.tid create mode 100644 plugins/tiddlywiki/markdown/settings/breaks.tid create mode 100644 plugins/tiddlywiki/markdown/settings/linkify.tid create mode 100644 plugins/tiddlywiki/markdown/settings/quotes.tid create mode 100644 plugins/tiddlywiki/markdown/settings/renderWikiText.tid create mode 100644 plugins/tiddlywiki/markdown/settings/renderWikiTextPragma.tid create mode 100644 plugins/tiddlywiki/markdown/settings/typographer.tid diff --git a/plugins/tiddlywiki/markdown/config.tid b/plugins/tiddlywiki/markdown/config.tid index c3fb14c0d..1438d3fa6 100755 --- a/plugins/tiddlywiki/markdown/config.tid +++ b/plugins/tiddlywiki/markdown/config.tid @@ -2,16 +2,6 @@ title: $:/plugins/tiddlywiki/markdown/config ! Plugin Configuration -|!Config |!Default |!Description | -|[[breaks|$:/config/markdown/breaks]]|`false`|markdown-it library config: Convert '\n' in paragraphs into `<br>` | -|[[linkify|$:/config/markdown/linkify]]|`false`|markdown-it library config: Autoconvert URL-like text to links | -|[[renderWikiText|$:/config/markdown/renderWikiText]]|`true`|After Markdown is parsed, should any text elements be handed off to the ~WikiText parser for further processing? | -|[[renderWikiTextPragma|$:/config/markdown/renderWikiTextPragma]]|<code><$view tiddler="$:/plugins/tiddlywiki/markdown" subtiddler="$:/config/markdown/renderWikiTextPragma" mode="inline"/></code>|When handing off to the ~WikiText parser, what parser rules should it follow? | -|[[typographer|$:/config/markdown/typographer]]|`false`|markdown-it library config: Enable some language-neutral replacement + quotes beautification | -|[[quotes|$:/config/markdown/quotes]]|`“”‘’`|markdown-it library config: Double + single quotes replacement pairs, when `typographer` is enabled | - -''IMPORTANT:'' You must reload your wiki for changes to take effect. - <h2 style="margin-top:1.5em">~WikiText Pragma</h2> The value of [[renderWikiTextPragma|$:/config/markdown/renderWikiTextPragma]] has been carefully tuned to properly integrate markdown with ~TiddlyWiki. Changing this setting may produce unexpected results, but the inclusion of the following parser rules should be fine: diff --git a/plugins/tiddlywiki/markdown/plugin.info b/plugins/tiddlywiki/markdown/plugin.info index cf5ecea3a..1288ad068 100755 --- a/plugins/tiddlywiki/markdown/plugin.info +++ b/plugins/tiddlywiki/markdown/plugin.info @@ -2,6 +2,6 @@ "title": "$:/plugins/tiddlywiki/markdown", "name": "Markdown", "description": "Markdown parser based on markdown-it", - "list": "readme config syntax license", + "list": "readme config settings syntax license", "stability": "STABILITY_2_STABLE" } diff --git a/plugins/tiddlywiki/markdown/settings.tid b/plugins/tiddlywiki/markdown/settings.tid new file mode 100644 index 000000000..54207fa10 --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings.tid @@ -0,0 +1,19 @@ +title: $:/plugins/tiddlywiki/markdown/settings +tags: $:/tags/ControlPanel/SettingsTab +caption: Markdown + +These settings let you customise the behaviour of Markdown. See [[plugin|$:/plugins/tiddlywiki/markdown]] readme and config tab for more information. + +''IMPORTANT:'' You must reload your wiki for changes to take effect. + +<$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings/Markdown]]"> + +<div class="tc-control-panel-setting" data-setting-title=<<currentTiddler>> > + +!!.tc-control-panel-accent <$link><$transclude field="caption"/></$link> + +<$transclude/> + +</div> + +</$list> \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/breaks.tid b/plugins/tiddlywiki/markdown/settings/breaks.tid new file mode 100644 index 000000000..95ebc47a8 --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/breaks.tid @@ -0,0 +1,9 @@ +title: $:/plugins/tiddlywiki/markdown/settings/breaks +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Breaks + +markdown-it library config: Convert `\n` in paragraphs into `<br>` + +<$checkbox tiddler="$:/config/markdown/breaks" field="text" checked="true" unchecked="false"> + [[Breaks|$:/config/markdown/breaks]] +</$checkbox> \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/linkify.tid b/plugins/tiddlywiki/markdown/settings/linkify.tid new file mode 100644 index 000000000..c43928ccf --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/linkify.tid @@ -0,0 +1,9 @@ +title: $:/plugins/tiddlywiki/markdown/settings/linkify +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Linkify + +markdown-it library config: Autoconvert URL-like text to links + +<$checkbox tiddler="$:/config/markdown/linkify" field="text" checked="true" unchecked="false"> + [[Linkify|$:/config/markdown/linkify]] +</$checkbox> \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/quotes.tid b/plugins/tiddlywiki/markdown/settings/quotes.tid new file mode 100644 index 000000000..b4247ede6 --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/quotes.tid @@ -0,0 +1,8 @@ +title: $:/plugins/tiddlywiki/markdown/settings/quotes +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Quotes replacement +list-after: $:/plugins/tiddlywiki/markdown/settings/typographer + +markdown-it library config: Double + single quotes replacement pairs, when [[typographer|$:/config/markdown/typographer]] is enabled. + +|[[Quotes replacement|$:/config/markdown/quotes]]|<$edit-text tiddler="$:/config/markdown/quotes" tag="input"/> | \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/renderWikiText.tid b/plugins/tiddlywiki/markdown/settings/renderWikiText.tid new file mode 100644 index 000000000..9b2073c10 --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/renderWikiText.tid @@ -0,0 +1,9 @@ +title: $:/plugins/tiddlywiki/markdown/settings/renderWikiText +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Enable WikiText + +After Markdown is parsed, should any text elements be handed off to the ~WikiText parser for further processing? + +<$checkbox tiddler="$:/config/markdown/renderWikiText" field="text" checked="true" unchecked="false"> + [[Enable WikiText|$:/config/markdown/renderWikiText]] +</$checkbox> \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/renderWikiTextPragma.tid b/plugins/tiddlywiki/markdown/settings/renderWikiTextPragma.tid new file mode 100644 index 000000000..12b4ceefb --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/renderWikiTextPragma.tid @@ -0,0 +1,7 @@ +title: $:/plugins/tiddlywiki/markdown/settings/renderWikiTextPragma +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Enabled WikiText parser rules + +When handing off to the ~WikiText parser, what parser rules should it follow? + +|[[Enabled WikiText parser rules|$:/config/markdown/renderWikiTextPragma]]|<$edit tiddler="$:/config/markdown/renderWikiTextPragma" class="tc-edit-texteditor" autoHeight="yes"/> | \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings/typographer.tid b/plugins/tiddlywiki/markdown/settings/typographer.tid new file mode 100644 index 000000000..5b9153dae --- /dev/null +++ b/plugins/tiddlywiki/markdown/settings/typographer.tid @@ -0,0 +1,9 @@ +title: $:/plugins/tiddlywiki/markdown/settings/typographer +tags: $:/tags/ControlPanel/Settings/Markdown +caption: Typographer + +markdown-it library config: Enable some language-neutral replacement + quotes beautification + +<$checkbox tiddler="$:/config/markdown/typographer" field="text" checked="true" unchecked="false"> + [[Typographer|$:/config/markdown/typographer]] +</$checkbox> \ No newline at end of file From 93543ba213d322e037303424f1a41cbe406802af Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 10 Sep 2024 18:33:28 +0800 Subject: [PATCH 31/66] Add documention for $:/tags/ControlPanel/SettingsTab (#8512) * Add documention for $:/tags/ControlPanel/SettingsTab * Fix tag name --- .../SystemTag_ $__tags_ControlPanel_SettingsTab.tid | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ControlPanel_SettingsTab.tid diff --git a/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ControlPanel_SettingsTab.tid b/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ControlPanel_SettingsTab.tid new file mode 100644 index 000000000..2f08ea686 --- /dev/null +++ b/editions/tw5.com/tiddlers/systemtags/SystemTag_ $__tags_ControlPanel_SettingsTab.tid @@ -0,0 +1,9 @@ +caption: $:/tags/ControlPanel/SettingsTab +created: 20240813060717747 +description: marks elements to be placed under "Settings" tab in Control Panel +modified: 20240813060843043 +tags: SystemTags +title: SystemTag: $:/tags/ControlPanel/SettingsTab +type: text/vnd.tiddlywiki + +The [[system tag|SystemTags]] `$:/tags/ControlPanel/SettingsTab` marks elements to be placed under "Settings" tab in [[$:/ControlPanel]] \ No newline at end of file From 813a574921765bafe0f81cc0ecc6e080c9d84ac3 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Tue, 10 Sep 2024 14:05:05 +0330 Subject: [PATCH 32/66] Docs: list operator "Index" instead of "Property" (#8509) --- editions/tw5.com/tiddlers/filters/list.tid | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/list.tid b/editions/tw5.com/tiddlers/filters/list.tid index be3908b86..8df76103c 100644 --- a/editions/tw5.com/tiddlers/filters/list.tid +++ b/editions/tw5.com/tiddlers/filters/list.tid @@ -1,16 +1,16 @@ +caption: list created: 20140410103123179 -modified: 20211115092315020 +modified: 20240811083650364 +op-input: ignored +op-neg-input: a [[selection of titles|Title Selection]] +op-neg-output: those input titles that are <<.em not>> mentioned at <<.place R>> +op-output: the titles stored as a [[title list|Title List]] at <<.place R>> +op-parameter: a [[reference|TextReference]] to a [[field|TiddlerFields]] or [[index|DataTiddlers]] of a particular tiddler +op-parameter-name: R +op-purpose: select titles via a list field tags: [[Filter Operators]] [[Field Operators]] [[Selection Constructors]] [[Negatable Operators]] title: list Operator type: text/vnd.tiddlywiki -caption: list -op-purpose: select titles via a list field -op-input: ignored -op-neg-input: a [[selection of titles|Title Selection]] -op-parameter: a [[reference|TextReference]] to a [[field|TiddlerFields]] or [[property|DataTiddlers]] of a particular tiddler -op-parameter-name: R -op-output: the titles stored as a [[title list|Title List]] at <<.place R>> -op-neg-output: those input titles that are <<.em not>> mentioned at <<.place R>> <<.place R>> can reference either a field or a property. See [[TextReference]] for the syntax. From 8d9407aad7bb2896c090f03494d3ad539c97dd13 Mon Sep 17 00:00:00 2001 From: Aza K9 <58900639+wolfsprite@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:36:34 +0000 Subject: [PATCH 33/66] Signing CLA (#8502) Co-authored-by: Jeremy Ruston <jeremy@jermolene.com> --- licenses/cla-individual.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/licenses/cla-individual.md b/licenses/cla-individual.md index a77287f1d..ecabb96fd 100644 --- a/licenses/cla-individual.md +++ b/licenses/cla-individual.md @@ -586,4 +586,6 @@ Michael McDermott, @michaeljmcd, 2024-07-09 Val Packett, @valpackett, 2024/07/26 -@JDIGIO0213, 2024/08/29 \ No newline at end of file +@wolfsprite, 2024/08/09 + +@JDIGIO0213, 2024/08/29 From 30bb563ffe33373ea3367a18c388f239e5a0e240 Mon Sep 17 00:00:00 2001 From: Aza K9 <58900639+wolfsprite@users.noreply.github.com> Date: Tue, 10 Sep 2024 10:37:03 +0000 Subject: [PATCH 34/66] Fix Issue With Highlight.js Demo Link (#8503) --- editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid index acdab9ef9..e6e7bd166 100644 --- a/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/CodeblockWidget.tid @@ -1,6 +1,6 @@ caption: codeblock created: 20151103160200000 -modified: 20160817175325205 +modified: 20240809074611002 tags: Widgets title: CodeBlockWidget type: text/vnd.tiddlywiki @@ -22,7 +22,7 @@ The content of the `<$codeblock>` widget is ignored. The `language` attribute accepts either: -* a Highlight.js language code (see https://highlightjs.org/static/demo/ for a list) +* a Highlight.js language code (see https://highlightjs.org/demo for a list) * a MIME type (eg, `text/html` or `image/svg+xml`) ! Examples From 19336dc4375b5a6b9e39f063413e6ee505b228de Mon Sep 17 00:00:00 2001 From: lin onetwo <linonetwo012@gmail.com> Date: Tue, 10 Sep 2024 18:39:50 +0800 Subject: [PATCH 35/66] Update Alternative page layouts.tid (#8461) --- .../tiddlers/customising/Alternative page layouts.tid | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/editions/tw5.com/tiddlers/customising/Alternative page layouts.tid b/editions/tw5.com/tiddlers/customising/Alternative page layouts.tid index 071d00dbd..eb1afd2b7 100644 --- a/editions/tw5.com/tiddlers/customising/Alternative page layouts.tid +++ b/editions/tw5.com/tiddlers/customising/Alternative page layouts.tid @@ -1,5 +1,5 @@ created: 20201123172925848 -modified: 20240627060629394 +modified: 20240801020629394 tags: [[Customise TiddlyWiki]] title: Alternative page layouts type: text/vnd.tiddlywiki @@ -23,9 +23,8 @@ This alternative page template can either be a tweaked and modified version of t tc-page-container tc-language-$(languageTitle)$ your-plugin-name-container \end \procedure redirected-navigate-actions() - <$action-setfield $tiddler="$:/layout" text="" $timestamp="no"> - <$action-navigate $to=<<event-navigateTo>> $scroll="yes" /> - </$action-setfield> + <$action-setfield $tiddler="$:/layout" text="" $timestamp="no" /> + <$action-navigate $to=<<event-navigateTo>> $scroll="yes" /> \end <$navigator story="$:/StoryList" history="$:/HistoryList" openLinkFromInsideRiver={{$:/config/Navigation/openLinkFromInsideRiver}} openLinkFromOutsideRiver={{$:/config/Navigation/openLinkFromOutsideRiver}} relinkOnRename={{$:/config/RelinkOnRename}}> From feec6ef18fd44498ae87af99e217aafb54f10c77 Mon Sep 17 00:00:00 2001 From: btheado <brian.theado@gmail.com> Date: Tue, 10 Sep 2024 06:48:14 -0400 Subject: [PATCH 36/66] Use testcase tiddlers for html examples (#8376) * Convert several html examples into testcase tiddlers * Convert html table exmaple into testcase tiddler --- .../testcases/HTML/BlockModeInHTMLTable.tid | 30 +++++++++++++ .../testcases/HTML/OpenTagBlankLine.tid | 23 ++++++++++ .../HTML/OpenTagBlankLineInBoldSyntax.tid | 22 +++++++++ .../HTML/OpenTagBlankLineInTableSyntax.tid | 22 +++++++++ .../testcases/HTML/OpenTagNoBlankLine.tid | 34 ++++++++++++++ .../WikiText parser mode_ HTML examples.tid | 45 +++---------------- 6 files changed, 137 insertions(+), 39 deletions(-) create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid create mode 100644 editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid diff --git a/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid b/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid new file mode 100644 index 000000000..f7050de7d --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/BlockModeInHTMLTable.tid @@ -0,0 +1,30 @@ +created: 20240713164810184 +description: Block mode for table cells +modified: 20240713164810184 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/BlockModeInHTMLTable +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +Unlike the table wiki syntax, the less convenient `<table>`, `<tr>`, `<td>` html tags can use a blank line +to get block mode punctuation regognised inside of table cells. ++ +title: Output + +<table> +<tr><td> + +* list item one +* list item two +</td><td> + +|nested|table| +</td></tr> +</table> ++ +title: ExpectedResult + +<p><table> +<tr><td><ul><li>list item one</li><li>list item two</li></ul></td><td><table><tbody><tr class="evenRow"><td>nested</td><td>table</td></tr></tbody></table></td></tr> +</table></p> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid new file mode 100644 index 000000000..0c14b0527 --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLine.tid @@ -0,0 +1,23 @@ +created: 20240622142425004 +description: Blank line after open tag +modified: 20240622144230258 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLine +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag allows block mode punctuation to be recognised ++ +title: Output + +<div> + +* blank line after open tag allows +* block mode punctuation (i.e. this list) to +* be recognised +</div> ++ +title: ExpectedResult + +<div><ul><li>blank line after open tag allows</li><li>block mode punctuation (i.e. this list) to</li><li>be recognised</li></ul></div> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid new file mode 100644 index 000000000..f6072bca4 --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInBoldSyntax.tid @@ -0,0 +1,22 @@ +created: 20240622144038465 +description: Blank line after open tag in bold syntax +modified: 20240622145114506 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLineInBoldSyntax +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag allows block mode punctuation to be recognised even when the html is embedded within inline punctuation (bold here). ++ +title: Output + +''<div> + +* list item one +* list item two +</div>'' ++ +title: ExpectedResult + +<p><strong><div><ul><li>list item one</li><li>list item two</li></ul></div></strong></p> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid new file mode 100644 index 000000000..0835c47bc --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagBlankLineInTableSyntax.tid @@ -0,0 +1,22 @@ +created: 20240622144753311 +description: Blank line after open tag in table syntax +modified: 20240622145056299 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagBlankLineInTableSyntax +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +A blank line after an open html tag cannot work when used inside table syntax since each row of a table must be all on one line ++ +title: Output + +|For a blank line after open tag|<div> + +* list is recognised +* but the surrounding table row is not +</div>| ++ +title: ExpectedResult + +<p>|For a blank line after open tag|<div><ul><li>list is recognised</li><li>but the surrounding table row is not</li></ul></div>|</p> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid new file mode 100644 index 000000000..e49fcabfb --- /dev/null +++ b/editions/tw5.com/tiddlers/testcases/HTML/OpenTagNoBlankLine.tid @@ -0,0 +1,34 @@ +created: 20240622143533021 +description: No blank line after open tag +modified: 20240622145145440 +tags: $:/tags/wiki-test-spec +title: TestCases/HTML/OpenTagNoBlankLine +type: text/vnd.tiddlywiki-multiple + +title: Narrative + +Block mode punctuation is not recognised when HTML open tag is not followed by a blank line ++ +title: Output + +<div> +* Open tag without a blank line means +* block mode punctuation (i.e. this list) will +* NOT be recognised. + +Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. + +This also is not a new paragraph. +</div> ++ +title: ExpectedResult + +<p><div> +* Open tag without a blank line means +* block mode punctuation (i.e. this list) will +* NOT be recognised. + +Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. + +This also is not a new paragraph. +</div></p> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid b/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid index fc068e44e..8d5483108 100644 --- a/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid +++ b/editions/tw5.com/tiddlers/wikitext/parser/WikiText parser mode_ HTML examples.tid @@ -1,38 +1,20 @@ created: 20220122153235162 -modified: 20220122180508134 +modified: 20240713165558596 tags: [[WikiText parser mode transitions]] title: WikiText parser mode: HTML examples type: text/vnd.tiddlywiki -<<wikitext-example-without-html "<div> - -* blank line after open tag allows -* block mode punctuation (i.e. this list) to -* be recognised -</div> -">> +<<testcase TestCases/HTML/OpenTagBlankLine>> --- The open tag blank line "trick" also works inside of punctuation only recognised in inline mode (such as [[Formatting in WikiText]]): -<<wikitext-example-without-html "''<div> - -* list item one -* list item two -</div>''">> +<<testcase TestCases/HTML/OpenTagBlankLineInBoldSyntax>> --- -<<wikitext-example-without-html "<div> -* Open tag without a blank line means -* block mode punctuation (i.e. this list) will -* NOT be recognised. - -Paragraphs are only recognised in block mode. Even with blank lines, new paragraphs are not recognised. - -This also is not a new paragraph. -</div>">> +<<testcase TestCases/HTML/OpenTagNoBlankLine>> --- @@ -42,11 +24,7 @@ Adding a blank link after an open tag within a table cell causes the row to span <<wikitext-example-without-html "|table row|all on|one line|is recognised|">> -<<wikitext-example-without-html "|For a blank line after open tag|<div> - -* list is recognised -* but the surrounding table row is not -</div>|">> +<<testcase TestCases/HTML/OpenTagBlankLineInTableSyntax>> --- @@ -58,15 +36,4 @@ Note that <<.wlink MacroCallWidget>> does not have a similar <<.attr mode>> attr --- -The less convenient `<table>`, `<tr>`, `<td>` html tags can be used as a foolproof way to get [[block mode|Block Mode WikiText]] punctuation recognised inside of table cells. - -<<wikitext-example-without-html "<table> -<tr><td> - -* list item one -* list item two -</td><td> - -|nested|table| -</td></tr> -</table>">> \ No newline at end of file +<<testcase TestCases/HTML/BlockModeInHTMLTable>> \ No newline at end of file From 6505e4610fd4dd2b363540fcc88176181ae0b93f Mon Sep 17 00:00:00 2001 From: btheado <brian.theado@gmail.com> Date: Tue, 10 Sep 2024 06:49:04 -0400 Subject: [PATCH 37/66] Use the testcase widget for $action-createtiddler examples (#8232) * Use the testcase widget for the $action-createtiddler widget examples * Use procedure instead of macros for $action-createtiddler examples --- .../ActionCreateTiddlerWidget Example 1.tid | 25 ++++-------- .../ActionCreateTiddlerWidget Example 2.tid | 26 +++++-------- .../ActionCreateTiddlerWidget Example 3.tid | 27 +++++-------- .../ActionCreateTiddlerWidget Example 4.tid | 25 +++++------- .../ActionCreateTiddlerWidget Example 5.tid | 30 +++++--------- .../widgets/ActionCreateTiddlerWidget.tid | 39 ++----------------- .../ActionCreateTiddlerWidget_Example.tid | 24 ++++++++---- 7 files changed, 65 insertions(+), 131 deletions(-) diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 1.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 1.tid index 57aee6673..ccc085e05 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 1.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 1.tid @@ -1,26 +1,15 @@ created: 20200131142401129 -modified: 20211113230406823 +modified: 20240602154417754 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example 1 type: text/vnd.tiddlywiki -\define testCreate() -<$action-createtiddler /> -\end - -This example will create "New Tiddler", "New Tiddler 1", " New Tiddler 2" and so on - -``` -\define testCreate() -<$action-createtiddler /> -\end +<$testcase> +<$data title=Description text="Default widget with no attributes"/> +<$data title=Narrative text='The button in this example uses the $action-createtiddler widget to create "New Tiddler", "New Tiddler 1", " New Tiddler 2" and so on'/> +<$data title=Output text="""\procedure testCreate() <$action-createtiddler /> <$button actions=<<testCreate>> > Create Tiddler -</$button> -``` - -<$button actions=<<testCreate>> > -<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> -Create Tiddler -</$button> - Clicking this button, will also open the Right sidebar: Recent tab +</$button>"""/> +</$testcase> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 2.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 2.tid index 336972a16..a9d204e75 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 2.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 2.tid @@ -1,28 +1,20 @@ created: 20200131144828713 -modified: 20211113011036840 +modified: 20240602160133371 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example 2 type: text/vnd.tiddlywiki -\define testCreate() -<$action-createtiddler $basetitle={{$:/language/DefaultNewTiddlerTitle}} $overwrite="yes"/> -\end +<$testcase> +<$data title=Description text="Transcluded base title"/> +<$data title=Narrative text="""The $action-createtiddler widget in this example uses the base title defined in [[$:/language/DefaultNewTiddlerTitle]]. -This example will use the base title defined in [[$:/language/DefaultNewTiddlerTitle]]. - -It will overwrite the tiddler, if the button is clicked several times. - -``` -\define testCreate() +It will overwrite the tiddler if the button is clicked several times."""/> +<$data $tiddler="$:/language/DefaultNewTiddlerTitle"/> +<$data title=Output text="""\procedure testCreate() <$action-createtiddler $basetitle={{$:/language/DefaultNewTiddlerTitle}} $overwrite="yes"/> \end <$button actions=<<testCreate>> > Create Tiddler -</$button> -``` - -<$button actions=<<testCreate>> > -<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> -Create Tiddler -</$button> - Clicking this button, will also open the Right sidebar: Recent tab +</$button>"""/> +</$testcase> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 3.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 3.tid index 2e137e330..a981bfe92 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 3.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 3.tid @@ -1,28 +1,21 @@ created: 20200131145355658 -modified: 20211113011111052 +modified: 20240602155233116 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example 3 type: text/vnd.tiddlywiki -\define testCreate() -<$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template"/> -\end +<$testcase> +<$data title=Description text="Template and custom base title"/> +<$data title=Narrative text="""The $action-createtiddler widget in this example uses the basetitle attribute and template: [[ActionCreateTiddlerWidget Template]]. -This example will uses a base-title and a template: [[ActionCreateTiddlerWidget Template]] - -It will create: "base", "base 1", "base 2" and so on - -``` -\define testCreate() +Clicking the button will create: "base", "base 1", "base 2" and so on +"""/> +<$data $tiddler="ActionCreateTiddlerWidget Template"/> +<$data title=Output text="""\procedure testCreate() <$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template"/> \end <$button actions=<<testCreate>> > Create Tiddler -</$button> -``` - -<$button actions=<<testCreate>> > -<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> -Create Tiddler -</$button> - Clicking this button will also open the Right sidebar: Recent tab +</$button>"""/> +</$testcase> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 4.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 4.tid index 1335893e5..b633f4359 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 4.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 4.tid @@ -1,28 +1,21 @@ created: 20200131150229551 -modified: 20211113011129601 +modified: 20240602154933113 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example 4 type: text/vnd.tiddlywiki -\define testCreate() -<$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template" aa="new field aa" bb="new field bb" /> -\end - -This example uses a base-title "base" and a template: [[ActionCreateTiddlerWidget Template]]. +<$testcase> +<$data title=Description text="Template with override fields and custom base title"/> +<$data title=Narrative text="""The $action-createtiddler widget in this example uses the basetitle attribute and template: [[ActionCreateTiddlerWidget Template]]. There will be new fields "aa" and "bb" which are added to the new tiddlers. - -``` -\define testCreate() +"""/> +<$data $tiddler="ActionCreateTiddlerWidget Template"/> +<$data title=Output text="""\procedure testCreate() <$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template" aa="new field aa" bb="new field bb" /> \end <$button actions=<<testCreate>> > Create Tiddler -</$button> -``` - -<$button actions=<<testCreate>> > -<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> -Create Tiddler -</$button> - Clicking this button will also open the Right sidebar: Recent tab +</$button>"""/> +</$testcase> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 5.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 5.tid index 03f719b8b..d0346d781 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 5.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget Example 5.tid @@ -1,32 +1,20 @@ created: 20200131144828713 -modified: 20230111220933412 +modified: 20240602155008453 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example 5 type: text/vnd.tiddlywiki -\define testCreate() +<$testcase> +<$data title=Description text="Child action widget uses the created tiddler title"/> +<$data title=Narrative text="""The $action-createtiddler widget in this example uses the <<.var createTiddler-title>> variable to navigate to the created tiddler"""/> +<$data $tiddler="ActionCreateTiddlerWidget Template"/> +<$data title=Output text="""\procedure testCreate() <$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template"> - <$action-sendmessage $message="tm-edit-tiddler" $param=<<createTiddler-title>>/> -</$action-createtiddler> -\end - -This example will use the base title defined in [[ActionCreateTiddlerWidget Template]]. - -It will create: "base", "base 1", "base 2" and so on, and navigate to this tiddler in draft mode. - -``` -\define testCreate() -<$action-createtiddler $basetitle="base" $template="ActionCreateTiddlerWidget Template"> - <$action-sendmessage $message="tm-edit-tiddler" $param=<<createTiddler-title>>/> + <$action-navigate $to=<<createTiddler-title>>/> </$action-createtiddler> \end <$button actions=<<testCreate>> > Create Tiddler -</$button> -``` - -<$button actions=<<testCreate>> > -<$action-setfield $tiddler="$:/state/tab/sidebar--595412856" text="$:/core/ui/SideBar/Recent"/> -Create Tiddler -</$button> - Clicking this button, will also open the Right sidebar: Recent tab +</$button>"""/> +</$testcase> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget.tid index 632b71686..85cb8ade8 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget.tid @@ -1,6 +1,6 @@ caption: action-createtiddler created: 20161020152745942 -modified: 20230115084716196 +modified: 20240602153213986 tags: Widgets ActionWidgets title: ActionCreateTiddlerWidget type: text/vnd.tiddlywiki @@ -37,37 +37,6 @@ The ''action-createtiddler'' widget is invisible. ! Examples -<<< -<$macrocall $name='wikitext-example-without-html' src={{ActionCreateTiddlerWidget Example}}/> -<<< - ---- - -<<< -<$transclude tiddler="ActionCreateTiddlerWidget Example 1" mode=block/> -<<< - ---- - -<<< -{{ActionCreateTiddlerWidget Example 2}} -<<< - ---- - -<<< -{{ActionCreateTiddlerWidget Example 3}} -<<< - ---- - -<<< -{{ActionCreateTiddlerWidget Example 4}} -<<< - ---- - -<<< -{{ActionCreateTiddlerWidget Example 5}} -<<< - +<$list filter="[prefix[ActionCreateTiddlerWidget Example]]"> +<$transclude/> +</$list> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget_Example.tid b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget_Example.tid index 2a431ead9..728ed4576 100644 --- a/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget_Example.tid +++ b/editions/tw5.com/tiddlers/widgets/ActionCreateTiddlerWidget_Example.tid @@ -1,14 +1,24 @@ created: 20161020153426686 -modified: 20211113011019510 +modified: 20240602160452171 tags: ActionCreateTiddlerWidget title: ActionCreateTiddlerWidget Example type: text/vnd.tiddlywiki +<$testcase> +<$data title=Description text="Create a new page control button"/> +<$data title=Narrative text="""Use the $action-createtiddler widget to create and open a new, non-functional page control button tiddler"""/> +<$data title=Output text="""\procedure testCreate() +<$action-createtiddler $basetitle="Homemade Button" tags="$:/tags/PageControls" text={{$:/state/new-button-caption}}> + <$action-navigate $to=<<createTiddler-title>>/> +</$action-createtiddler> +\end + +{{$:/core/ui/SideBarSegments/page-controls}} + Caption for new button: <$edit-text tiddler="$:/state/new-button-caption" tag="input" default=""/> -<$button> -<$action-createtiddler $basetitle="Homemade Button" tags="$:/tags/PageControls" text={{$:/state/new-button-caption}}> -<$action-navigate $to=<<createTiddler-title>>/> -</$action-createtiddler> -Create a new non-functional page control button and open the tiddler -</$button> \ No newline at end of file +<$button actions=<<testCreate>> > +Create Tiddler +</$button>"""/> +<$data title="$:/state/new-button-caption" text="button text "/> +</$testcase> \ No newline at end of file From 1368cd67cac850b95f7d04e3c5ab95f000b56567 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston <jeremy@jermolene.com> Date: Tue, 10 Sep 2024 11:50:08 +0100 Subject: [PATCH 38/66] Fix missing closing tag, and update erroneous docs (#8340) --- core/templates/tiddlywiki5.html.tid | 1 + core/wiki/macros/tag.tid | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/templates/tiddlywiki5.html.tid b/core/templates/tiddlywiki5.html.tid index a94ae2693..721b3d9ce 100644 --- a/core/templates/tiddlywiki5.html.tid +++ b/core/templates/tiddlywiki5.html.tid @@ -57,3 +57,4 @@ title: $:/core/templates/tiddlywiki5.html `{{{ [enlist<saveTiddlerAndShadowsFilter>tag[$:/tags/RawMarkupWikified/BottomBody]] ||$:/core/templates/raw-static-tiddler}}}` </body> </html>` +</$set> diff --git a/core/wiki/macros/tag.tid b/core/wiki/macros/tag.tid index eedbd0c4c..2c539b42e 100644 --- a/core/wiki/macros/tag.tid +++ b/core/wiki/macros/tag.tid @@ -7,7 +7,7 @@ fill:$(foregroundColor)$; color:$(foregroundColor)$; \end -<!-- This has no whitespace trim to avoid modifying $actions$. Closing tags omitted for brevity. --> +<!-- This has no whitespace trim to avoid modifying $actions$ --> \define tag-pill-inner(tag,icon,colour,fallbackTarget,colourA,colourB,element-tag,element-attributes,actions) \whitespace trim <$let From eaf855859556e7a206380a32c86e6f9a9167799d Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 10 Sep 2024 19:00:13 +0800 Subject: [PATCH 39/66] Update PageControls buttons to use v5.3.2 syntax (#8579) * Let PageControls buttons use v5.3.2 syntax * Rewrite buttons and actions * Omit whitespace & use function to avoid duplicating * Omit whitespace in conditional syntax * Define tf.get-tags function to avoid duplicated text substitution * Rewrite advanced search button * Add space in join operator * Rewrite buttons in plugins * Remove tf prefix in new-journal.tid * Remove tf prefix in new-tiddler.tid --- core/ui/Actions/new-journal.tid | 8 ++-- core/ui/Actions/new-tiddler.tid | 6 +-- core/ui/PageControls/advanced-search.tid | 13 +++---- core/ui/PageControls/closeall.tid | 10 ++--- core/ui/PageControls/controlpanel.tid | 13 +++---- core/ui/PageControls/encryption.tid | 16 ++++---- core/ui/PageControls/export-page.tid | 2 +- core/ui/PageControls/fold-all.tid | 10 ++--- core/ui/PageControls/full-screen.tid | 10 ++--- core/ui/PageControls/home.tid | 10 ++--- core/ui/PageControls/import.tid | 10 ++--- core/ui/PageControls/language.tid | 21 +++++----- core/ui/PageControls/layout.tid | 8 ++-- core/ui/PageControls/manager.tid | 13 +++---- core/ui/PageControls/more-page-actions.tid | 38 +++++++++---------- core/ui/PageControls/network-activity.tid | 10 ++--- core/ui/PageControls/new-image.tid | 8 ++-- core/ui/PageControls/new-journal.tid | 11 +++--- core/ui/PageControls/newtiddler.tid | 8 ++-- core/ui/PageControls/palette.tid | 8 ++-- core/ui/PageControls/print.tid | 10 ++--- core/ui/PageControls/refresh.tid | 10 ++--- core/ui/PageControls/savewiki.tid | 10 ++--- core/ui/PageControls/storyview.tid | 13 +++---- core/ui/PageControls/tag-button.tid | 13 +++---- core/ui/PageControls/theme.tid | 8 ++-- core/ui/PageControls/timestamp.tid | 16 ++++---- core/ui/PageControls/unfold-all.tid | 10 ++--- plugins/tiddlywiki/help/help.tid | 16 ++++---- .../markdown-legacy/new-markdown.tid | 8 ++-- plugins/tiddlywiki/markdown/new-markdown.tid | 8 ++-- .../tiddlywiki/tiddlyweb/save-wiki-button.tid | 8 ++-- 32 files changed, 174 insertions(+), 189 deletions(-) diff --git a/core/ui/Actions/new-journal.tid b/core/ui/Actions/new-journal.tid index 9df31cb97..9d663e537 100644 --- a/core/ui/Actions/new-journal.tid +++ b/core/ui/Actions/new-journal.tid @@ -2,10 +2,10 @@ title: $:/core/ui/Actions/new-journal tags: $:/tags/Actions description: create a new journal tiddler -\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \whitespace trim -<$vars journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}> -<$wikify name="journalTitle" text="<$macrocall $name='now' format=<<journalTitleTemplate>>/>"> +\function get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]] +<$let journalTitleTemplate={{$:/config/NewJournal/Title}} textFieldTags={{$:/config/NewJournal/Tags}} tagsFieldTags={{$:/config/NewJournal/Tags!!tags}} journalText={{$:/config/NewJournal/Text}}> +<$wikify name="journalTitle" text="<$transclude $variable='now' format=<<journalTitleTemplate>>/>"> <$reveal type="nomatch" state=<<journalTitle>> text=""> <$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text={{{ [<journalTitle>get[]] }}}/> </$reveal> @@ -13,4 +13,4 @@ description: create a new journal tiddler <$action-sendmessage $message="tm-new-tiddler" title=<<journalTitle>> tags=<<get-tags>> text=<<journalText>>/> </$reveal> </$wikify> -</$vars> +</$let> diff --git a/core/ui/Actions/new-tiddler.tid b/core/ui/Actions/new-tiddler.tid index f71331327..847130800 100644 --- a/core/ui/Actions/new-tiddler.tid +++ b/core/ui/Actions/new-tiddler.tid @@ -2,8 +2,8 @@ title: $:/core/ui/Actions/new-tiddler tags: $:/tags/Actions description: create a new empty tiddler -\define get-tags() $(textFieldTags)$ $(tagsFieldTags)$ \whitespace trim -<$vars textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}> +\function get-tags() [<textFieldTags>] [<tagsFieldTags>] +[join[ ]] +<$let textFieldTags={{$:/config/NewTiddler/Tags}} tagsFieldTags={{$:/config/NewTiddler/Tags!!tags}}> <$action-sendmessage $message="tm-new-tiddler" tags=<<get-tags>>/> -</$vars> +</$let> diff --git a/core/ui/PageControls/advanced-search.tid b/core/ui/PageControls/advanced-search.tid index 1549b07f4..4aa49e6e5 100644 --- a/core/ui/PageControls/advanced-search.tid +++ b/core/ui/PageControls/advanced-search.tid @@ -4,15 +4,14 @@ caption: {{$:/core/images/advanced-search-button}} {{$:/language/Buttons/Advance description: {{$:/language/Buttons/AdvancedSearch/Hint}} \whitespace trim -\define advanced-search-button(class) -\whitespace trim -<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class="""$(tv-config-toolbar-class)$ $class$"""> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +\procedure advanced-search-button(class) +<$button to="$:/AdvancedSearch" tooltip={{$:/language/Buttons/AdvancedSearch/Hint}} aria-label={{$:/language/Buttons/AdvancedSearch/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/advanced-search-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/AdvancedSearch/Caption}}/></span> -</$list> +<%endif%> </$button> \end diff --git a/core/ui/PageControls/closeall.tid b/core/ui/PageControls/closeall.tid index 2665fff0d..23aefa8be 100644 --- a/core/ui/PageControls/closeall.tid +++ b/core/ui/PageControls/closeall.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/CloseAll/Hint}} \whitespace trim <$button message="tm-close-all-tiddlers" tooltip={{$:/language/Buttons/CloseAll/Hint}} aria-label={{$:/language/Buttons/CloseAll/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/close-all-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/CloseAll/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/controlpanel.tid b/core/ui/PageControls/controlpanel.tid index 872d640ac..8b9db8d9a 100644 --- a/core/ui/PageControls/controlpanel.tid +++ b/core/ui/PageControls/controlpanel.tid @@ -4,15 +4,14 @@ caption: {{$:/core/images/options-button}} {{$:/language/Buttons/ControlPanel/Ca description: {{$:/language/Buttons/ControlPanel/Hint}} \whitespace trim -\define control-panel-button(class) -\whitespace trim -<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class="""$(tv-config-toolbar-class)$ $class$"""> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +\procedure control-panel-button(class) +<$button to="$:/ControlPanel" tooltip={{$:/language/Buttons/ControlPanel/Hint}} aria-label={{$:/language/Buttons/ControlPanel/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/options-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/ControlPanel/Caption}}/></span> -</$list> +<%endif%> </$button> \end diff --git a/core/ui/PageControls/encryption.tid b/core/ui/PageControls/encryption.tid index 9f8ae0bd6..572d162de 100644 --- a/core/ui/PageControls/encryption.tid +++ b/core/ui/PageControls/encryption.tid @@ -6,25 +6,25 @@ description: {{$:/language/Buttons/Encryption/Hint}} \whitespace trim <$reveal type="match" state="$:/isEncrypted" text="yes"> <$button message="tm-clear-password" tooltip={{$:/language/Buttons/Encryption/ClearPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/ClearPassword/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/locked-padlock}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Encryption/ClearPassword/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> <$reveal type="nomatch" state="$:/isEncrypted" text="yes"> <$button message="tm-set-password" tooltip={{$:/language/Buttons/Encryption/SetPassword/Hint}} aria-label={{$:/language/Buttons/Encryption/SetPassword/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/unlocked-padlock}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Encryption/SetPassword/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> diff --git a/core/ui/PageControls/export-page.tid b/core/ui/PageControls/export-page.tid index fe036abf7..902f643e9 100644 --- a/core/ui/PageControls/export-page.tid +++ b/core/ui/PageControls/export-page.tid @@ -3,4 +3,4 @@ tags: $:/tags/PageControls caption: {{$:/core/images/export-button}} {{$:/language/Buttons/ExportPage/Caption}} description: {{$:/language/Buttons/ExportPage/Hint}} -<$macrocall $name="exportButton" exportFilter="[!is[system]sort[title]]" lingoBase="$:/language/Buttons/ExportPage/"/> \ No newline at end of file +<$transclude $variable="exportButton" exportFilter="[!is[system]sort[title]]" lingoBase="$:/language/Buttons/ExportPage/"/> \ No newline at end of file diff --git a/core/ui/PageControls/fold-all.tid b/core/ui/PageControls/fold-all.tid index 46c3165b8..dba6bb1b6 100644 --- a/core/ui/PageControls/fold-all.tid +++ b/core/ui/PageControls/fold-all.tid @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/FoldAll/Hint}} \whitespace trim <$button tooltip={{$:/language/Buttons/FoldAll/Hint}} aria-label={{$:/language/Buttons/FoldAll/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-fold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/fold-all-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/FoldAll/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/full-screen.tid b/core/ui/PageControls/full-screen.tid index ada7d5a65..864ee5c26 100644 --- a/core/ui/PageControls/full-screen.tid +++ b/core/ui/PageControls/full-screen.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/FullScreen/Hint}} \whitespace trim <$button message="tm-full-screen" tooltip={{$:/language/Buttons/FullScreen/Hint}} aria-label={{$:/language/Buttons/FullScreen/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/full-screen-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/FullScreen/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/home.tid b/core/ui/PageControls/home.tid index f3a0b1787..6c1d5a789 100644 --- a/core/ui/PageControls/home.tid +++ b/core/ui/PageControls/home.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Home/Hint}} \whitespace trim <$button message="tm-home" tooltip={{$:/language/Buttons/Home/Hint}} aria-label={{$:/language/Buttons/Home/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/home-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Home/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/import.tid b/core/ui/PageControls/import.tid index 39ca51eb6..11474db22 100644 --- a/core/ui/PageControls/import.tid +++ b/core/ui/PageControls/import.tid @@ -6,14 +6,14 @@ description: {{$:/language/Buttons/Import/Hint}} \whitespace trim <div class="tc-file-input-wrapper"> <$button tooltip={{$:/language/Buttons/Import/Hint}} aria-label={{$:/language/Buttons/Import/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/import-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Import/Caption}}/> </span> -</$list> +<%endif%> </$button> <$browse tooltip={{$:/language/Buttons/Import/Hint}}/> -</div> \ No newline at end of file +</div> diff --git a/core/ui/PageControls/language.tid b/core/ui/PageControls/language.tid index 623c71004..3315b5a23 100644 --- a/core/ui/PageControls/language.tid +++ b/core/ui/PageControls/language.tid @@ -4,21 +4,18 @@ caption: {{$:/core/images/globe}} {{$:/language/Buttons/Language/Caption}} description: {{$:/language/Buttons/Language/Hint}} \whitespace trim -\define flag-title() -$(languagePluginTitle)$/icon -\end <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/language">> tooltip={{$:/language/Buttons/Language/Hint}} aria-label={{$:/language/Buttons/Language/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> -<span class="tc-image-button"> -<$set name="languagePluginTitle" value={{$:/language}}> -<$image source=<<flag-title>>/> -</$set> -</span> -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> + <span class="tc-image-button"> + <$set name="languagePluginTitle" value={{$:/language}}> + <$image source=`$(languagePluginTitle)$/icon`/> + </$set> + </span> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Language/Caption}}/></span> -</$list> +<%endif%> </$button> </span> <$reveal state=<<qualify "$:/state/popup/language">> type="popup" position="below" animate="yes"> diff --git a/core/ui/PageControls/layout.tid b/core/ui/PageControls/layout.tid index 703bbcb1b..c9a0f596b 100644 --- a/core/ui/PageControls/layout.tid +++ b/core/ui/PageControls/layout.tid @@ -6,10 +6,10 @@ description: {{$:/language/LayoutSwitcher/Description}} \whitespace trim <$button tooltip={{$:/language/Buttons/LayoutSwitcher/Hint}} aria-label={{$:/language/Buttons/LayoutSwitcher/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-show-switcher" switch="layout"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/layout-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/LayoutSwitcher/Caption}}/></span> -</$list> +<%endif%> </$button> diff --git a/core/ui/PageControls/manager.tid b/core/ui/PageControls/manager.tid index d2144c574..3cc364f80 100644 --- a/core/ui/PageControls/manager.tid +++ b/core/ui/PageControls/manager.tid @@ -4,17 +4,16 @@ caption: {{$:/core/images/list}} {{$:/language/Buttons/Manager/Caption}} description: {{$:/language/Buttons/Manager/Hint}} \whitespace trim -\define manager-button(class) -\whitespace trim -<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class="""$(tv-config-toolbar-class)$ $class$"""> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +\procedure manager-button(class) +<$button to="$:/Manager" tooltip={{$:/language/Buttons/Manager/Hint}} aria-label={{$:/language/Buttons/Manager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/list}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Manager/Caption}}/> </span> -</$list> +<%endif%> </$button> \end diff --git a/core/ui/PageControls/more-page-actions.tid b/core/ui/PageControls/more-page-actions.tid index 3acaef2b6..7453b9df7 100644 --- a/core/ui/PageControls/more-page-actions.tid +++ b/core/ui/PageControls/more-page-actions.tid @@ -12,33 +12,29 @@ description: {{$:/language/Buttons/More/Hint}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected" > - <$list filter="[<tv-config-toolbar-icons>match[yes]]"> + <%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/down-arrow}} - </$list> - <$list filter="[<tv-config-toolbar-text>match[yes]]"> + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/More/Caption}}/> </span> - </$list> + <%endif%> </$button> <$reveal state=<<qualify "$:/state/popup/more">> type="popup" position="below" animate="yes"> <div class="tc-drop-down"> - <$set name="tv-config-toolbar-icons" value="yes"> - <$set name="tv-config-toolbar-text" value="yes"> - <$set name="tv-config-toolbar-class" value="tc-btn-invisible"> - <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" - variable="listItem" + <$let tv-config-toolbar-icons="yes" tv-config-toolbar-text="yes" tv-config-toolbar-class="tc-btn-invisible"> + <$list filter="[all[shadows+tiddlers]tag[$:/tags/PageControls]!has[draft.of]] -[[$:/core/ui/Buttons/more-page-actions]]" + variable="listItem" + > + <$reveal type="match" state=<<config-title>> text="hide"> + <$set name="tv-config-toolbar-class" + filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]" > - <$reveal type="match" state=<<config-title>> text="hide"> - <$set name="tv-config-toolbar-class" - filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]" - > - <$transclude tiddler=<<listItem>> mode="inline"/> - </$set> - </$reveal> - </$list> - </$set> - </$set> - </$set> + <$transclude tiddler=<<listItem>> mode="inline"/> + </$set> + </$reveal> + </$list> + </$let> </div> -</$reveal> \ No newline at end of file +</$reveal> diff --git a/core/ui/PageControls/network-activity.tid b/core/ui/PageControls/network-activity.tid index 763365f37..7be25b261 100644 --- a/core/ui/PageControls/network-activity.tid +++ b/core/ui/PageControls/network-activity.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NetworkActivity/Hint}} \whitespace trim <$button message="tm-http-cancel-all-requests" tooltip={{$:/language/Buttons/NetworkActivity/Hint}} aria-label={{$:/language/Buttons/NetworkActivity/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/network-activity}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NetworkActivity/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/new-image.tid b/core/ui/PageControls/new-image.tid index b37fba7c5..0cf954966 100644 --- a/core/ui/PageControls/new-image.tid +++ b/core/ui/PageControls/new-image.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NewImage/Hint}} \whitespace trim <$button tooltip={{$:/language/Buttons/NewImage/Hint}} aria-label={{$:/language/Buttons/NewImage/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-image}}> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/new-image-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NewImage/Caption}}/> </span> -</$list> +<%endif%> </$button> diff --git a/core/ui/PageControls/new-journal.tid b/core/ui/PageControls/new-journal.tid index 8ae8ee78a..8330b8cb7 100644 --- a/core/ui/PageControls/new-journal.tid +++ b/core/ui/PageControls/new-journal.tid @@ -4,17 +4,16 @@ caption: {{$:/core/images/new-journal-button}} {{$:/language/Buttons/NewJournal/ description: {{$:/language/Buttons/NewJournal/Hint}} \whitespace trim -\define journalButton() -\whitespace trim +\procedure journalButton() <$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>> actions={{$:/core/ui/Actions/new-journal}}> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/new-journal-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NewJournal/Caption}}/> </span> -</$list> +<%endif%> </$button> \end <<journalButton>> diff --git a/core/ui/PageControls/newtiddler.tid b/core/ui/PageControls/newtiddler.tid index cd2f56913..f6a6e6891 100644 --- a/core/ui/PageControls/newtiddler.tid +++ b/core/ui/PageControls/newtiddler.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/NewTiddler/Hint}} \whitespace trim <$button actions={{$:/core/ui/Actions/new-tiddler}} tooltip={{$:/language/Buttons/NewTiddler/Hint}} aria-label={{$:/language/Buttons/NewTiddler/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/new-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/NewTiddler/Caption}}/> </span> -</$list> +<%endif%> </$button> diff --git a/core/ui/PageControls/palette.tid b/core/ui/PageControls/palette.tid index 6fdbdb439..efa016d49 100644 --- a/core/ui/PageControls/palette.tid +++ b/core/ui/PageControls/palette.tid @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/Palette/Hint}} \whitespace trim <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/palette">> tooltip={{$:/language/Buttons/Palette/Hint}} aria-label={{$:/language/Buttons/Palette/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/palette}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Palette/Caption}}/></span> -</$list> +<%endif%> </$button> </span> <$reveal state=<<qualify "$:/state/popup/palette">> type="popup" position="below" animate="yes"> diff --git a/core/ui/PageControls/print.tid b/core/ui/PageControls/print.tid index ef664b6e3..994303d25 100644 --- a/core/ui/PageControls/print.tid +++ b/core/ui/PageControls/print.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Print/Hint}} \whitespace trim <$button message="tm-print" tooltip={{$:/language/Buttons/Print/Hint}} aria-label={{$:/language/Buttons/Print/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/print-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Print/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/refresh.tid b/core/ui/PageControls/refresh.tid index 38692f817..5a8773b77 100644 --- a/core/ui/PageControls/refresh.tid +++ b/core/ui/PageControls/refresh.tid @@ -5,12 +5,12 @@ description: {{$:/language/Buttons/Refresh/Hint}} \whitespace trim <$button message="tm-browser-refresh" tooltip={{$:/language/Buttons/Refresh/Hint}} aria-label={{$:/language/Buttons/Refresh/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/refresh-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Refresh/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/core/ui/PageControls/savewiki.tid b/core/ui/PageControls/savewiki.tid index 60f8dc99f..7e6a18ccc 100644 --- a/core/ui/PageControls/savewiki.tid +++ b/core/ui/PageControls/savewiki.tid @@ -9,13 +9,13 @@ description: {{$:/language/Buttons/SaveWiki/Hint}} <$action-sendmessage $message="tm-save-wiki" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/> </$wikify> <span class="tc-dirty-indicator"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/save-button-dynamic}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/SaveWiki/Caption}}/> </span> -</$list> +<%endif%> </span> -</$button> \ No newline at end of file +</$button> diff --git a/core/ui/PageControls/storyview.tid b/core/ui/PageControls/storyview.tid index c4d0b7365..7738cfa97 100644 --- a/core/ui/PageControls/storyview.tid +++ b/core/ui/PageControls/storyview.tid @@ -4,19 +4,16 @@ caption: {{$:/core/images/storyview-classic}} {{$:/language/Buttons/StoryView/Ca description: {{$:/language/Buttons/StoryView/Hint}} \whitespace trim -\define icon() -$:/core/images/storyview-$(storyview)$ -\end <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/storyview">> tooltip={{$:/language/Buttons/StoryView/Hint}} aria-label={{$:/language/Buttons/StoryView/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> <$set name="storyview" value={{$:/view}}> -<$transclude tiddler=<<icon>>/> +<$transclude tiddler=`$:/core/images/storyview-$(storyview)$`/> </$set> -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/StoryView/Caption}}/></span> -</$list> +<%endif%> </$button> </span> <$reveal state=<<qualify "$:/state/popup/storyview">> type="popup" position="below" animate="yes"> diff --git a/core/ui/PageControls/tag-button.tid b/core/ui/PageControls/tag-button.tid index e2b5c9277..6c04804ce 100644 --- a/core/ui/PageControls/tag-button.tid +++ b/core/ui/PageControls/tag-button.tid @@ -4,17 +4,16 @@ caption: {{$:/core/images/tag-button}} {{$:/language/Buttons/TagManager/Caption} description: {{$:/language/Buttons/TagManager/Hint}} \whitespace trim -\define control-panel-button(class) -\whitespace trim -<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class="""$(tv-config-toolbar-class)$ $class$"""> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +\procedure control-panel-button(class) +<$button to="$:/TagManager" tooltip={{$:/language/Buttons/TagManager/Hint}} aria-label={{$:/language/Buttons/TagManager/Caption}} class=`$(tv-config-toolbar-class)$ $(class)$`> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/tag-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/TagManager/Caption}}/> </span> -</$list> +<%endif%> </$button> \end diff --git a/core/ui/PageControls/theme.tid b/core/ui/PageControls/theme.tid index 2d8eadc7b..60e37a95e 100644 --- a/core/ui/PageControls/theme.tid +++ b/core/ui/PageControls/theme.tid @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/Theme/Hint}} \whitespace trim <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/theme">> tooltip={{$:/language/Buttons/Theme/Hint}} aria-label={{$:/language/Buttons/Theme/Caption}} class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/theme-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Theme/Caption}}/></span> -</$list> +<%endif%> </$button> </span> <$reveal state=<<qualify "$:/state/popup/theme">> type="popup" position="below" animate="yes"> diff --git a/core/ui/PageControls/timestamp.tid b/core/ui/PageControls/timestamp.tid index a54b3f2ca..0186d7c12 100644 --- a/core/ui/PageControls/timestamp.tid +++ b/core/ui/PageControls/timestamp.tid @@ -7,26 +7,26 @@ description: {{$:/language/Buttons/Timestamp/Hint}} <$reveal type="nomatch" state="$:/config/TimestampDisable" text="yes"> <$button tooltip={{$:/language/Buttons/Timestamp/On/Hint}} aria-label={{$:/language/Buttons/Timestamp/On/Caption}} class=<<tv-config-toolbar-class>>> <$action-setfield $tiddler="$:/config/TimestampDisable" $value="yes"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/timestamp-on}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Timestamp/On/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> <$reveal type="match" state="$:/config/TimestampDisable" text="yes"> <$button tooltip={{$:/language/Buttons/Timestamp/Off/Hint}} aria-label={{$:/language/Buttons/Timestamp/Off/Caption}} class=<<tv-config-toolbar-class>>> <$action-setfield $tiddler="$:/config/TimestampDisable" $value="no"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/timestamp-off}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/Timestamp/Off/Caption}}/> </span> -</$list> +<%endif%> </$button> </$reveal> diff --git a/core/ui/PageControls/unfold-all.tid b/core/ui/PageControls/unfold-all.tid index 6e8357a3b..e0d26bc49 100644 --- a/core/ui/PageControls/unfold-all.tid +++ b/core/ui/PageControls/unfold-all.tid @@ -6,12 +6,12 @@ description: {{$:/language/Buttons/UnfoldAll/Hint}} \whitespace trim <$button tooltip={{$:/language/Buttons/UnfoldAll/Hint}} aria-label={{$:/language/Buttons/UnfoldAll/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-unfold-all-tiddlers" $param=<<currentTiddler>> foldedStatePrefix="$:/state/folded/"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]" variable="listItem"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/unfold-all-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"> <$text text={{$:/language/Buttons/UnfoldAll/Caption}}/> </span> -</$list> -</$button> \ No newline at end of file +<%endif%> +</$button> diff --git a/plugins/tiddlywiki/help/help.tid b/plugins/tiddlywiki/help/help.tid index eca5ffaa7..f29d9dbdf 100644 --- a/plugins/tiddlywiki/help/help.tid +++ b/plugins/tiddlywiki/help/help.tid @@ -8,22 +8,22 @@ description: {{$:/language/Buttons/Help/Hint}} \whitespace trim <$list filter="[[$:/config/ShowHelp]get[text]] +[else[no]match[yes]]" variable="ignore"> <$button set="$:/config/ShowHelp" setTo="no" tooltip={{$:/language/Buttons/Help/Hint}} aria-label={{$:/language/Buttons/Help/Caption}} class="""$(tv-config-toolbar-class)$ tc-selected"""> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/help}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Help/Caption}}/></span> -</$list> +<%endif%> </$button> </$list> <$list filter="[[$:/config/ShowHelp]get[text]] +[else[no]!match[yes]]" variable="ignore"> <$button set="$:/config/ShowHelp" setTo="yes" tooltip={{$:/language/Buttons/Help/Hint}} aria-label={{$:/language/Buttons/Help/Caption}} class=<<tv-config-toolbar-class>>> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/help}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/Help/Caption}}/></span> -</$list> +<%endif%> </$button> </$list> \end diff --git a/plugins/tiddlywiki/markdown-legacy/new-markdown.tid b/plugins/tiddlywiki/markdown-legacy/new-markdown.tid index 507c265a5..8d8f587d8 100755 --- a/plugins/tiddlywiki/markdown-legacy/new-markdown.tid +++ b/plugins/tiddlywiki/markdown-legacy/new-markdown.tid @@ -7,10 +7,10 @@ list-after: $:/core/ui/Buttons/new-tiddler \whitespace trim <$button tooltip={{$:/language/Buttons/NewMarkdown/Hint}} aria-label={{$:/language/Buttons/NewMarkdown/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-new-tiddler" type="text/markdown"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/plugins/tiddlywiki/markdown-legacy/images/new-markdown-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/NewMarkdown/Caption}}/></span> -</$list> +<%endif%> </$button> diff --git a/plugins/tiddlywiki/markdown/new-markdown.tid b/plugins/tiddlywiki/markdown/new-markdown.tid index 192543d77..404046360 100755 --- a/plugins/tiddlywiki/markdown/new-markdown.tid +++ b/plugins/tiddlywiki/markdown/new-markdown.tid @@ -7,10 +7,10 @@ list-after: $:/core/ui/Buttons/new-tiddler \whitespace trim <$button tooltip={{$:/language/Buttons/NewMarkdown/Hint}} aria-label={{$:/language/Buttons/NewMarkdown/Caption}} class=<<tv-config-toolbar-class>>> <$action-sendmessage $message="tm-new-tiddler" type="text/markdown"/> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/plugins/tiddlywiki/markdown/images/new-markdown-button}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text={{$:/language/Buttons/NewMarkdown/Caption}}/></span> -</$list> +<%endif%> </$button> diff --git a/plugins/tiddlywiki/tiddlyweb/save-wiki-button.tid b/plugins/tiddlywiki/tiddlyweb/save-wiki-button.tid index ed4c042c7..63ddfc19e 100644 --- a/plugins/tiddlywiki/tiddlyweb/save-wiki-button.tid +++ b/plugins/tiddlywiki/tiddlyweb/save-wiki-button.tid @@ -9,12 +9,12 @@ $:/config/PageControlButtons/Visibility/$(listItem)$ \end <$button popup=<<qualify "$:/state/popup/save-wiki">> tooltip="Status of synchronisation with server" aria-label="Server status" class=<<tv-config-toolbar-class>> selectedClass="tc-selected"> <span class="tc-dirty-indicator"> -<$list filter="[<tv-config-toolbar-icons>match[yes]]"> +<%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/plugins/tiddlywiki/tiddlyweb/icon/cloud}} -</$list> -<$list filter="[<tv-config-toolbar-text>match[yes]]"> +<%endif%> +<%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text="Server status"/></span> -</$list> +<%endif%> </span> </$button> <$reveal state=<<qualify "$:/state/popup/save-wiki">> type="popup" position="belowleft" animate="yes"> From d7b00a6dd0074c79a657f92acf528b0e3883edc7 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 10 Sep 2024 21:33:10 +0800 Subject: [PATCH 40/66] Make overflowed content scrollable (#8524) * Make overflowed content scrollable * Fix removed tab --- themes/tiddlywiki/vanilla/base.tid | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 65c1a5fe3..b24b35cf2 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1350,6 +1350,10 @@ canvas.tc-edit-bitmapeditor { display: block; } +.tc-tiddler-body { + overflow-x: auto; +} + .tc-single-tiddler-window .tc-tiddler-body, .tc-tiddler-frame .tc-tiddler-body { font-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}}; @@ -2220,6 +2224,7 @@ html body.tc-body.tc-single-tiddler-window { .tc-tab-content { margin-top: 14px; + overflow-x: auto; } .tc-tab-content.tc-vertical { From 4f4e0550917fa3f266add8db7eb6ee649ed92c25 Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 17:30:59 +0200 Subject: [PATCH 41/66] Add a search button to the control panel tiddler fields tab (#8157) * add a search button to the control panel tiddler fields tab * minor update * use v5.3.x syntax * use tf. prefix for the function * make show-filter-count a global macro * make table header translatable * add documentation * show-filter-count code cleanup * remove the table-header * remove erroneous caption field --- core/ui/ControlPanel/Basics.tid | 17 +--------- core/wiki/allfields.tid | 33 ++++++++++++++----- core/wiki/macros/show-filter-count.tid | 17 ++++++++++ .../tiddlers/macros/show-filter-count.tid | 21 ++++++++++++ 4 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 core/wiki/macros/show-filter-count.tid create mode 100644 editions/tw5.com/tiddlers/macros/show-filter-count.tid diff --git a/core/ui/ControlPanel/Basics.tid b/core/ui/ControlPanel/Basics.tid index 961cbe161..f494c2af6 100644 --- a/core/ui/ControlPanel/Basics.tid +++ b/core/ui/ControlPanel/Basics.tid @@ -2,22 +2,7 @@ title: $:/core/ui/ControlPanel/Basics tags: $:/tags/ControlPanel/Info caption: {{$:/language/ControlPanel/Basics/Caption}} -\define lingo-base() $:/language/ControlPanel/Basics/ - -\define show-filter-count(filter) -\whitespace trim -<$button class="tc-btn-invisible"> -<$action-setfield $tiddler="$:/temp/advancedsearch" $value="""$filter$"""/> -<$action-setfield $tiddler="$:/temp/advancedsearch/input" $value="""$filter$"""/> -<$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/> -<$action-setfield $tiddler="$:/state/tab--1498284803" $value="$:/core/ui/AdvancedSearch/Filter"/> -<$action-navigate $to="$:/AdvancedSearch"/> -<$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> -''<$count filter="""$filter$"""/>'' - -{{$:/core/images/advanced-search-button}} -</$button> -\end +\procedure lingo-base() $:/language/ControlPanel/Basics/ \whitespace trim |tc-max-width tc-edit-max-width|k diff --git a/core/wiki/allfields.tid b/core/wiki/allfields.tid index f148640d4..8f59a317f 100644 --- a/core/wiki/allfields.tid +++ b/core/wiki/allfields.tid @@ -1,13 +1,30 @@ title: $:/snippets/allfields -\define renderfield(title) -<tr class="tc-view-field"><td class="tc-view-field-name">''<$text text=<<__title__>>/>'':</td><td class="tc-view-field-value">//{{$:/language/Docs/Fields/$title$}}//</td></tr> -\end \whitespace trim + +\procedure lingo-base() $:/language/Docs/Fields/ + +\function tf.getLingoText() [<lingo-base>] [<title>] +[join[]get[text]] + +\procedure renderfield(title) +<tr class="tc-view-field"> + <td class="tc-view-field-name"> + ''<$text text=<<title>>/>'': + </td> + <td class="tc-view-field-value"> + //<<tf.getLingoText>>// + </td> + <td class="tc-view-field-list"> + <$macrocall $name="show-filter-count" filter=`[has[$(title)$]sort[]]`>> + </td> +</tr> +\end + <table class="tc-view-field-table"> -<tbody> -<$list filter="[fields[]sort[title]]" variable="listItem"> -<$macrocall $name="renderfield" title=<<listItem>>/> -</$list> -</tbody> + <tbody> + <!-- <<renderfieldHeader>> --> + <$list filter="[fields[]sort[title]]" variable="listItem"> + <$macrocall $name="renderfield" title=<<listItem>>/> + </$list> + </tbody> </table> diff --git a/core/wiki/macros/show-filter-count.tid b/core/wiki/macros/show-filter-count.tid new file mode 100644 index 000000000..be06fcde1 --- /dev/null +++ b/core/wiki/macros/show-filter-count.tid @@ -0,0 +1,17 @@ +title: $:/core/macros/show-filter-count +tags: $:/tags/Macro $:/tags/Global + +\whitespace trim + +\procedure show-filter-count(filter) +<$button class="tc-btn-invisible"> + <$action-setfield $tiddler="$:/temp/advancedsearch" $value=<<filter>>/> + <$action-setfield $tiddler="$:/temp/advancedsearch/input" $value=<<filter>>/> + <$action-setfield $tiddler="$:/temp/advancedsearch/refresh" text="yes"/> + <$action-setfield $tiddler="$:/state/tab--1498284803" $value="$:/core/ui/AdvancedSearch/Filter"/> + <$action-navigate $to="$:/AdvancedSearch"/> + <$action-sendmessage $message="tm-focus-selector" $param=".tc-advanced-search input"/> + <span class="tc-small-gap-right">''<$count filter=<<filter>>/>''</span> + {{$:/core/images/advanced-search-button}} +</$button> +\end \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/macros/show-filter-count.tid b/editions/tw5.com/tiddlers/macros/show-filter-count.tid new file mode 100644 index 000000000..7e026a590 --- /dev/null +++ b/editions/tw5.com/tiddlers/macros/show-filter-count.tid @@ -0,0 +1,21 @@ + +created: 20240804143842924 +modified: 20240804150223291 +tags: Macros [[Core Macros]] +title: show-filter-count Macro +type: text/vnd.tiddlywiki + +<<.from-version "5.3.6">> -- The <<.def show-filter-count>> [[macro|Macros]] creates an element, that shows a counter and a button to open the provided filter string in $:/AdvancedSearch + +!! Parameters + +; filter +: Needs to be a valid [[filter run|Filters]] + +!! Examples + +<<wikitext-example-without-html src:"""<<show-filter-count filter:"[tag[HelloThere]]">> -- The number and the icon is click-able""">> + +<<wikitext-example-without-html src:"""<<show-filter-count filter:"[has[author]sort[]]">> -- The number and the icon is click-able""">> + +Also see: [[$:/core/ui/ControlPanel/TiddlerFields]] From 232cffb0a1e6c7527fa894285a3f43daca9df1ca Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:13:09 +0200 Subject: [PATCH 42/66] Add type "number: (default)" to compare operator (#8160) * Add type "number: (default)" to compare operator * Update compare Operator.tid * Update compare Operator (Examples).tid * Update compare Operator (Examples).tid --- .../tiddlers/filters/compare Operator.tid | 18 +++++++++--------- .../examples/compare Operator (Examples).tid | 1 + 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/editions/tw5.com/tiddlers/filters/compare Operator.tid b/editions/tw5.com/tiddlers/filters/compare Operator.tid index debf09ead..b86e8c729 100644 --- a/editions/tw5.com/tiddlers/filters/compare Operator.tid +++ b/editions/tw5.com/tiddlers/filters/compare Operator.tid @@ -1,15 +1,15 @@ +caption: compare created: 20200412181551706 modified: 20200412181551706 +op-input: a [[selection of titles|Title Selection]] +op-neg-output: those input titles <<.em not>> matching the specified comparison +op-output: those input titles matching the specified comparison +op-parameter: the value to compare +op-purpose: filter the input by comparing each item against the parameter +op-suffix: the <<.op compare>> operator uses a rich suffix, see below for details tags: [[Filter Operators]] [[Mathematics Operators]] [[String Operators]] [[Negatable Operators]] title: compare Operator type: text/vnd.tiddlywiki -caption: compare -op-purpose: filter the input by comparing each item against the parameter -op-input: a [[selection of titles|Title Selection]] -op-suffix: the <<.op compare>> operator uses a rich suffix, see below for details -op-parameter: the value to compare -op-output: those input titles matching the specified comparison -op-neg-output: those input titles <<.em not>> matching the specified comparison <<.from-version "5.1.22">>The <<.op compare>> filter allows numerical, string and date comparisons to be performed. @@ -21,7 +21,7 @@ The <<.op compare>> operator uses an extended syntax to specify all the options: The ''type'' can be: -* "number" - invalid numbers are interpreted as zero +* "number" - (default) invalid numbers are interpreted as zero * "integer" - invalid integers are interpreted as zero * "string" * "date" - invalid dates are interpreted as 1st January 1970 @@ -43,7 +43,7 @@ For example: ``` [[2]compare:number:eq[3]] returns nothing [[2]compare:number:lt[3]] returns "2" -[[2]compare:number:eq[2]] returns "2" +[[2]compare::eq[2]] returns "2" ``` Note that several of the variants of the <<.op compare>> operator are synonyms for existing operators, and are provided in the interests of consistency. For example, `compare:string:eq[x]` is a synonym for `match[x]`. diff --git a/editions/tw5.com/tiddlers/filters/examples/compare Operator (Examples).tid b/editions/tw5.com/tiddlers/filters/examples/compare Operator (Examples).tid index f729dc5d2..76488503a 100644 --- a/editions/tw5.com/tiddlers/filters/examples/compare Operator (Examples).tid +++ b/editions/tw5.com/tiddlers/filters/examples/compare Operator (Examples).tid @@ -9,3 +9,4 @@ type: text/vnd.tiddlywiki <<.operator-example 3 "[list[Days of the Week]compare:string:gt[M]compare:string:lt[W]]">> <<.operator-example 4 "[[v5.1.23-prerelease]compare:version:gt[v5.1.22]]">> <<.operator-example 5 "[[1]compare:number:gt[2]then[yes]else[no]]">> +<<.operator-example 6 "[[-2]compare::lt[-1]]">> From ffbef16152092df5ad74fb170d85b92439d90b2a Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:13:58 +0200 Subject: [PATCH 43/66] ViewTemplate toolbar add, change aria-label to hint so it is more descriptive (#8323) --- core/ui/EditToolbar/delete.tid | 18 +++++++++++------- core/ui/ViewToolbar/clone.tid | 23 ++++++++++++++--------- core/ui/ViewToolbar/close.tid | 22 +++++++++++++--------- core/ui/ViewToolbar/edit.tid | 22 +++++++++++++--------- 4 files changed, 51 insertions(+), 34 deletions(-) diff --git a/core/ui/EditToolbar/delete.tid b/core/ui/EditToolbar/delete.tid index bdc6731b9..1e6451da1 100644 --- a/core/ui/EditToolbar/delete.tid +++ b/core/ui/EditToolbar/delete.tid @@ -4,11 +4,15 @@ caption: {{$:/core/images/delete-button}} {{$:/language/Buttons/Delete/Caption}} description: {{$:/language/Buttons/Delete/Hint}} \whitespace trim -<$button actions=<<cancel-delete-tiddler-actions "delete">> tooltip={{$:/language/Buttons/Delete/Hint}} aria-label={{$:/language/Buttons/Delete/Caption}} class=<<tv-config-toolbar-class>>> -<%if [<tv-config-toolbar-icons>match[yes]] %> -{{$:/core/images/delete-button}} -<%endif%> -<%if [<tv-config-toolbar-text>match[yes]] %> -<span class="tc-btn-text"><$text text={{$:/language/Buttons/Delete/Caption}}/></span> -<%endif%> +<$button actions=<<cancel-delete-tiddler-actions "delete">> + tooltip={{$:/language/Buttons/Delete/Hint}} + aria-label={{$:/language/Buttons/Delete/Hint}} + class=<<tv-config-toolbar-class>> +> + <%if [<tv-config-toolbar-icons>match[yes]] %> + {{$:/core/images/delete-button}} + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> + <span class="tc-btn-text"><$text text={{$:/language/Buttons/Delete/Caption}}/></span> + <%endif%> </$button> diff --git a/core/ui/ViewToolbar/clone.tid b/core/ui/ViewToolbar/clone.tid index abe01eda8..a4066fc00 100644 --- a/core/ui/ViewToolbar/clone.tid +++ b/core/ui/ViewToolbar/clone.tid @@ -4,13 +4,18 @@ caption: {{$:/core/images/clone-button}} {{$:/language/Buttons/Clone/Caption}} description: {{$:/language/Buttons/Clone/Hint}} \whitespace trim -<$button message="tm-new-tiddler" param=<<currentTiddler>> tooltip={{$:/language/Buttons/Clone/Hint}} aria-label={{$:/language/Buttons/Clone/Caption}} class=<<tv-config-toolbar-class>>> -<%if [<tv-config-toolbar-icons>match[yes]] %> -{{$:/core/images/clone-button}} -<%endif%> -<%if [<tv-config-toolbar-text>match[yes]] %> -<span class="tc-btn-text"> -<$text text={{$:/language/Buttons/Clone/Caption}}/> -</span> -<%endif%> +<$button message="tm-new-tiddler" + param=<<currentTiddler>> + tooltip={{$:/language/Buttons/Clone/Hint}} + aria-label={{$:/language/Buttons/Clone/Hint}} + class=<<tv-config-toolbar-class>> +> + <%if [<tv-config-toolbar-icons>match[yes]] %> + {{$:/core/images/clone-button}} + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> + <span class="tc-btn-text"> + <$text text={{$:/language/Buttons/Clone/Caption}}/> + </span> + <%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/close.tid b/core/ui/ViewToolbar/close.tid index da4db1e26..fcc53cef0 100644 --- a/core/ui/ViewToolbar/close.tid +++ b/core/ui/ViewToolbar/close.tid @@ -4,13 +4,17 @@ caption: {{$:/core/images/close-button}} {{$:/language/Buttons/Close/Caption}} description: {{$:/language/Buttons/Close/Hint}} \whitespace trim -<$button message="tm-close-tiddler" tooltip={{$:/language/Buttons/Close/Hint}} aria-label={{$:/language/Buttons/Close/Caption}} class=<<tv-config-toolbar-class>>> -<%if [<tv-config-toolbar-icons>match[yes]] %> -{{$:/core/images/close-button}} -<%endif%> -<%if [<tv-config-toolbar-text>match[yes]] %> -<span class="tc-btn-text"> -<$text text={{$:/language/Buttons/Close/Caption}}/> -</span> -<%endif%> +<$button message="tm-close-tiddler" + tooltip={{$:/language/Buttons/Close/Hint}} + aria-label={{$:/language/Buttons/Close/Caption}} + class=<<tv-config-toolbar-class>> +> + <%if [<tv-config-toolbar-icons>match[yes]] %> + {{$:/core/images/close-button}} + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> + <span class="tc-btn-text"> + <$text text={{$:/language/Buttons/Close/Caption}}/> + </span> + <%endif%> </$button> \ No newline at end of file diff --git a/core/ui/ViewToolbar/edit.tid b/core/ui/ViewToolbar/edit.tid index 38827aa14..730fd6ed5 100644 --- a/core/ui/ViewToolbar/edit.tid +++ b/core/ui/ViewToolbar/edit.tid @@ -4,13 +4,17 @@ caption: {{$:/core/images/edit-button}} {{$:/language/Buttons/Edit/Caption}} description: {{$:/language/Buttons/Edit/Hint}} \whitespace trim -<$button message="tm-edit-tiddler" tooltip={{$:/language/Buttons/Edit/Hint}} aria-label={{$:/language/Buttons/Edit/Caption}} class=<<tv-config-toolbar-class>>> -<%if [<tv-config-toolbar-icons>match[yes]] %> -{{$:/core/images/edit-button}} -<%endif%> -<%if [<tv-config-toolbar-text>match[yes]] %> -<span class="tc-btn-text"> -<$text text={{$:/language/Buttons/Edit/Caption}}/> -</span> -<%endif%> +<$button message="tm-edit-tiddler" + tooltip={{$:/language/Buttons/Edit/Hint}} + aria-label={{$:/language/Buttons/Edit/Hint}} + class=<<tv-config-toolbar-class>> +> + <%if [<tv-config-toolbar-icons>match[yes]] %> + {{$:/core/images/edit-button}} + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> + <span class="tc-btn-text"> + <$text text={{$:/language/Buttons/Edit/Caption}}/> + </span> + <%endif%> </$button> \ No newline at end of file From 753a8209456597976c5db845433ba6163ef5d5db Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:14:29 +0200 Subject: [PATCH 44/66] Edittemplate toolbar improve accessibility (#8324) * change aria-label from caption to hint to make it more descriptive * add indentation --- core/ui/EditToolbar/cancel.tid | 18 +++++++++++------- core/ui/EditToolbar/save.tid | 2 +- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/core/ui/EditToolbar/cancel.tid b/core/ui/EditToolbar/cancel.tid index ca2248920..ae41fd4af 100644 --- a/core/ui/EditToolbar/cancel.tid +++ b/core/ui/EditToolbar/cancel.tid @@ -4,11 +4,15 @@ caption: {{$:/core/images/cancel-button}} {{$:/language/Buttons/Cancel/Caption}} description: {{$:/language/Buttons/Cancel/Hint}} \whitespace trim -<$button actions=<<cancel-delete-tiddler-actions "cancel">> tooltip={{$:/language/Buttons/Cancel/Hint}} aria-label={{$:/language/Buttons/Cancel/Caption}} class=<<tv-config-toolbar-class>>> -<%if [<tv-config-toolbar-icons>match[yes]] %> -{{$:/core/images/cancel-button}} -<%endif%> -<%if [<tv-config-toolbar-text>match[yes]] %> -<span class="tc-btn-text"><$text text={{$:/language/Buttons/Cancel/Caption}}/></span> -<%endif%> +<$button actions=<<cancel-delete-tiddler-actions "cancel">> + tooltip={{$:/language/Buttons/Cancel/Hint}} + aria-label={{$:/language/Buttons/Cancel/Hint}} + class=<<tv-config-toolbar-class>> +> + <%if [<tv-config-toolbar-icons>match[yes]] %> + {{$:/core/images/cancel-button}} + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> + <span class="tc-btn-text"><$text text={{$:/language/Buttons/Cancel/Caption}}/></span> + <%endif%> </$button> diff --git a/core/ui/EditToolbar/save.tid b/core/ui/EditToolbar/save.tid index b217806bb..d62daf981 100644 --- a/core/ui/EditToolbar/save.tid +++ b/core/ui/EditToolbar/save.tid @@ -8,7 +8,7 @@ description: {{$:/language/Buttons/Save/Hint}} <$fieldmangler> <$button tooltip={{$:/language/Buttons/Save/Hint}} - aria-label={{$:/language/Buttons/Save/Caption}} + aria-label={{$:/language/Buttons/Save/Hint}} class=<<tv-config-toolbar-class>> > <<save-tiddler-actions>> From 0c1d478e19ebf7ae44892b31f6f1e53a512f3fda Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:15:17 +0200 Subject: [PATCH 45/66] Improve hellothere flex cards accessibility (#8325) * add alt-text field to image meta data files * add aria-label to some HelloThere links * improve flex-card procedure to render alt-text for images and aria-hide the new-badge because it causes problems * revert HelloThere modified date --- editions/tw5.com/tiddlers/hellothere/HelloThere.tid | 4 ++-- .../tiddlers/hellothere/badges/ProductHunt-Link.tid | 2 +- editions/tw5.com/tiddlers/images/Blurry Lawn.jpg.meta | 3 ++- .../tw5.com/tiddlers/images/Favicon template.svg.meta | 3 ++- editions/tw5.com/tiddlers/images/Funding.png.meta | 1 + .../tw5.com/tiddlers/images/Grok TiddlyWiki.png.meta | 1 + .../images/Introduction Video Thumbnail.jpg.meta | 1 + .../tiddlers/images/Marketplace Banner.png.meta | 1 + .../tw5.com/tiddlers/images/Motovun Jack.ascii.tid | 1 + .../tw5.com/tiddlers/images/Motovun Jack.jpg.meta | 1 + .../tw5.com/tiddlers/images/Motovun Jack.pdf.meta | 1 + .../tiddlers/images/New Release Banner.png.meta | 1 + .../tw5.com/tiddlers/images/Newnham Horizon.jpg.meta | 1 + .../tw5.com/tiddlers/images/Open Collective Logo.tid | 1 + editions/tw5.com/tiddlers/images/PerlinLight.jpg.meta | 1 + editions/tw5.com/tiddlers/images/Reddit Logo.tid | 1 + .../tw5.com/tiddlers/images/TWEUM Thumbnail.jpg.meta | 1 + .../tw5.com/tiddlers/images/Tiddler Fishes.svg.meta | 1 + .../tw5.com/tiddlers/images/Tiddler Poster.png.meta | 1 + .../tiddlers/images/TiddlyFox Apocalypse.png.meta | 1 + .../tiddlers/images/TiddlyWiki Classic.png.meta | 1 + .../images/TiddlyWiki Newsletter Badge.png.meta | 7 +++++-- .../tw5.com/tiddlers/images/TiddlyWikiLinks.png.meta | 1 + .../tw5.com/tiddlers/images/Tiddlyhost Logo.png.meta | 1 + .../tw5.com/tiddlers/images/Xememex Logo.svg.meta | 1 + editions/tw5.com/tiddlers/images/favicon.png.meta | 1 + .../tw5.com/tiddlers/images/green_favicon.png.meta | 1 + editions/tw5.com/tiddlers/system/wikitext-macros.tid | 11 ++++++++--- 28 files changed, 42 insertions(+), 10 deletions(-) diff --git a/editions/tw5.com/tiddlers/hellothere/HelloThere.tid b/editions/tw5.com/tiddlers/hellothere/HelloThere.tid index db719f1c0..8ceacfe24 100644 --- a/editions/tw5.com/tiddlers/hellothere/HelloThere.tid +++ b/editions/tw5.com/tiddlers/hellothere/HelloThere.tid @@ -9,7 +9,7 @@ type: text/vnd.tiddlywiki Use it to keep your [[to-do list|TaskManagementExample]], to plan an [[essay or novel|"TiddlyWiki for Scholars" by Alberto Molina]], or to organise your wedding. Record every thought that crosses your brain, or build a flexible and responsive website. -TiddlyWiki lets you choose where to keep your data, guaranteeing that in the decades to come you will [[still be able to use|Future Proof]] the notes you take today. +~TiddlyWiki lets you choose where to keep your data, guaranteeing that in the decades to come you will [[still be able to use|Future Proof]] the notes you take today. !! ''Quick Start'' @@ -19,7 +19,7 @@ TiddlyWiki lets you choose where to keep your data, guaranteeing that in the dec </$list> </div> <div class="tc-cards tc-small"> -<$link to="中文社区 - Chinese Community" class="tc-btn-big-green tc-card"> +<$link to="中文社区 - Chinese Community" class="tc-btn-big-green tc-card" aria-label="Chinese Community"> 中文社区<br/>Chinese Community </$link> </div> diff --git a/editions/tw5.com/tiddlers/hellothere/badges/ProductHunt-Link.tid b/editions/tw5.com/tiddlers/hellothere/badges/ProductHunt-Link.tid index 3554c2d74..2dd0a2912 100644 --- a/editions/tw5.com/tiddlers/hellothere/badges/ProductHunt-Link.tid +++ b/editions/tw5.com/tiddlers/hellothere/badges/ProductHunt-Link.tid @@ -1,4 +1,4 @@ title: Product Hunt Link tags: [[HelloThere Badge]] -<a href="https://www.producthunt.com/posts/tiddlywiki-2?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-tiddlywiki-2" alt="Product Hunt: Product of the Day" target="_blank" rel="noopener noreferrer">{{ProductHunt-Badge.svg}}</a> \ No newline at end of file +<a href="https://www.producthunt.com/posts/tiddlywiki-2?utm_source=badge-top-post-badge&utm_medium=badge&utm_souce=badge-tiddlywiki-2" aria-label="Product Hunt: Product of the Day" target="_blank" rel="noopener noreferrer">{{ProductHunt-Badge.svg}}</a> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/images/Blurry Lawn.jpg.meta b/editions/tw5.com/tiddlers/images/Blurry Lawn.jpg.meta index 2dc802bee..49b003bd2 100644 --- a/editions/tw5.com/tiddlers/images/Blurry Lawn.jpg.meta +++ b/editions/tw5.com/tiddlers/images/Blurry Lawn.jpg.meta @@ -1,4 +1,5 @@ title: Blurry Lawn.jpg type: image/jpeg tags: picture external-image -source: https://www.flickr.com/photos/jermy/16386332964/in/photostream \ No newline at end of file +source: https://www.flickr.com/photos/jermy/16386332964/in/photostream +alt-text: Blurry image with green grass with flowsers. diff --git a/editions/tw5.com/tiddlers/images/Favicon template.svg.meta b/editions/tw5.com/tiddlers/images/Favicon template.svg.meta index 8d6a1a197..9ad8a9f86 100644 --- a/editions/tw5.com/tiddlers/images/Favicon template.svg.meta +++ b/editions/tw5.com/tiddlers/images/Favicon template.svg.meta @@ -1,3 +1,4 @@ title: Favicon template.svg tags: picture -type: image/svg+xml \ No newline at end of file +type: image/svg+xml +alt-text: Motovun Jack with blue background. diff --git a/editions/tw5.com/tiddlers/images/Funding.png.meta b/editions/tw5.com/tiddlers/images/Funding.png.meta index b9caa4a72..8d6225a60 100644 --- a/editions/tw5.com/tiddlers/images/Funding.png.meta +++ b/editions/tw5.com/tiddlers/images/Funding.png.meta @@ -1,3 +1,4 @@ title: Funding.png type: image/png tags: picture +alt-text: Hand over a debit-card. diff --git a/editions/tw5.com/tiddlers/images/Grok TiddlyWiki.png.meta b/editions/tw5.com/tiddlers/images/Grok TiddlyWiki.png.meta index a0595cc9f..da5e252a2 100644 --- a/editions/tw5.com/tiddlers/images/Grok TiddlyWiki.png.meta +++ b/editions/tw5.com/tiddlers/images/Grok TiddlyWiki.png.meta @@ -1,3 +1,4 @@ title: Grok TiddlyWiki Banner type: image/png tags: picture +alt-text: Grok TiddlyWiki page and siluette of Motovun Jack. diff --git a/editions/tw5.com/tiddlers/images/Introduction Video Thumbnail.jpg.meta b/editions/tw5.com/tiddlers/images/Introduction Video Thumbnail.jpg.meta index ee1c94cd4..9b2a023c4 100644 --- a/editions/tw5.com/tiddlers/images/Introduction Video Thumbnail.jpg.meta +++ b/editions/tw5.com/tiddlers/images/Introduction Video Thumbnail.jpg.meta @@ -1,3 +1,4 @@ title: Introduction Video Thumbnail.jpg type: image/jpeg tags: picture +alt-text: Screenshot with a headline: TiddlyWiki. Below are several tiddlers randomly stacked. diff --git a/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta b/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta index b693c99e3..14ccdbc0b 100644 --- a/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta +++ b/editions/tw5.com/tiddlers/images/Marketplace Banner.png.meta @@ -1,3 +1,4 @@ title: TiddlyWiki Marketplace Banner type: image/jpeg tags: picture +alt-text: Motovun Jack with a shopping cart. Blue floor, orange background. diff --git a/editions/tw5.com/tiddlers/images/Motovun Jack.ascii.tid b/editions/tw5.com/tiddlers/images/Motovun Jack.ascii.tid index 115cf2e60..db5a9dc28 100644 --- a/editions/tw5.com/tiddlers/images/Motovun Jack.ascii.tid +++ b/editions/tw5.com/tiddlers/images/Motovun Jack.ascii.tid @@ -1,5 +1,6 @@ title: Motovun Jack.ascii tags: picture +alt-text: Motovun Jack ASCII-art. \rules only html <pre style="font-size:10px; font-family: monospace; line-height:13px"> diff --git a/editions/tw5.com/tiddlers/images/Motovun Jack.jpg.meta b/editions/tw5.com/tiddlers/images/Motovun Jack.jpg.meta index 43901f30f..ee2ddbe5b 100644 --- a/editions/tw5.com/tiddlers/images/Motovun Jack.jpg.meta +++ b/editions/tw5.com/tiddlers/images/Motovun Jack.jpg.meta @@ -2,3 +2,4 @@ title: Motovun Jack.jpg type: image/jpeg source: https://www.flickr.com/photos/jermy/6292279493/in/photostream tags: picture +alt-text: Motovun Jack on a stone wall with treas and hills in the background. diff --git a/editions/tw5.com/tiddlers/images/Motovun Jack.pdf.meta b/editions/tw5.com/tiddlers/images/Motovun Jack.pdf.meta index 27cb054c9..0a64294e5 100644 --- a/editions/tw5.com/tiddlers/images/Motovun Jack.pdf.meta +++ b/editions/tw5.com/tiddlers/images/Motovun Jack.pdf.meta @@ -1,3 +1,4 @@ title: Motovun Jack.pdf type: application/pdf tags: picture +alt-text: PDF reader with Motovun Jack siluette on a white background page 1 of 1. diff --git a/editions/tw5.com/tiddlers/images/New Release Banner.png.meta b/editions/tw5.com/tiddlers/images/New Release Banner.png.meta index e5fc745fe..2da8dc356 100644 --- a/editions/tw5.com/tiddlers/images/New Release Banner.png.meta +++ b/editions/tw5.com/tiddlers/images/New Release Banner.png.meta @@ -1,3 +1,4 @@ title: New Release Banner type: image/png tags: picture +alt-text: Release banner, with a custom background and a release version in big letters. diff --git a/editions/tw5.com/tiddlers/images/Newnham Horizon.jpg.meta b/editions/tw5.com/tiddlers/images/Newnham Horizon.jpg.meta index 4e5fb7d8b..8202f6a04 100644 --- a/editions/tw5.com/tiddlers/images/Newnham Horizon.jpg.meta +++ b/editions/tw5.com/tiddlers/images/Newnham Horizon.jpg.meta @@ -2,3 +2,4 @@ title: Newnham Horizon.jpg type: image/jpeg tags: picture external-image source: https://www.flickr.com/photos/jermy/289999155/in/photostream +alt-text: Newham Horizon. Green field, blue skey with some clouds on a sunny day. diff --git a/editions/tw5.com/tiddlers/images/Open Collective Logo.tid b/editions/tw5.com/tiddlers/images/Open Collective Logo.tid index 7dec4d62b..dbafad946 100644 --- a/editions/tw5.com/tiddlers/images/Open Collective Logo.tid +++ b/editions/tw5.com/tiddlers/images/Open Collective Logo.tid @@ -2,5 +2,6 @@ created: 20240621075644739 modified: 20240621075647009 tags: picture title: Open Collective Logo +alt-text: Open Collective Logo <svg style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2" viewBox="0 0 28 28"><path d="M25.509 6.026A13.934 13.934 0 0 1 28 14c0 2.963-.92 5.71-2.491 7.974l-3.626-3.627A8.96 8.96 0 0 0 23 14a8.964 8.964 0 0 0-1.117-4.347l3.626-3.627Z"/><path d="m21.974 2.49-3.627 3.628a9 9 0 1 0 0 15.765l3.627 3.626A13.934 13.934 0 0 1 14 27.999C6.268 28 0 21.733 0 14 0 6.269 6.268 0 14 0c2.963 0 5.711.922 7.974 2.492Z"/></svg> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/images/PerlinLight.jpg.meta b/editions/tw5.com/tiddlers/images/PerlinLight.jpg.meta index 3df28f9c5..aff5d2b80 100644 --- a/editions/tw5.com/tiddlers/images/PerlinLight.jpg.meta +++ b/editions/tw5.com/tiddlers/images/PerlinLight.jpg.meta @@ -1,2 +1,3 @@ title: PerlinLight.jpg type: image/jpeg +alt-text: Backgournd tile with light gray dots randomly scatterd. diff --git a/editions/tw5.com/tiddlers/images/Reddit Logo.tid b/editions/tw5.com/tiddlers/images/Reddit Logo.tid index f4153ebb0..660785858 100644 --- a/editions/tw5.com/tiddlers/images/Reddit Logo.tid +++ b/editions/tw5.com/tiddlers/images/Reddit Logo.tid @@ -1,4 +1,5 @@ title: Reddit Logo +alt-text: Reddit Logo \parameters (size:"22pt") <svg width=<<size>> height=<<size>> viewBox="0 0 20 20"> diff --git a/editions/tw5.com/tiddlers/images/TWEUM Thumbnail.jpg.meta b/editions/tw5.com/tiddlers/images/TWEUM Thumbnail.jpg.meta index 8d35840cf..3ff7014fb 100644 --- a/editions/tw5.com/tiddlers/images/TWEUM Thumbnail.jpg.meta +++ b/editions/tw5.com/tiddlers/images/TWEUM Thumbnail.jpg.meta @@ -1,3 +1,4 @@ title: TWEUM Thumbnail.jpg type: image/jpeg tags: picture +alt-text: TW EU Meeting thumbnail. Skyline of Oxford on a sunny day with blue sky. Motovun Jack and a TiddlyWiki sceenshot in the back. diff --git a/editions/tw5.com/tiddlers/images/Tiddler Fishes.svg.meta b/editions/tw5.com/tiddlers/images/Tiddler Fishes.svg.meta index 257787b66..042c8a89d 100644 --- a/editions/tw5.com/tiddlers/images/Tiddler Fishes.svg.meta +++ b/editions/tw5.com/tiddlers/images/Tiddler Fishes.svg.meta @@ -1,3 +1,4 @@ title: Tiddler Fishes.svg type: image/svg+xml tags: picture +alt-text: 5 coloured sketched fish arranged in a cyrcle. diff --git a/editions/tw5.com/tiddlers/images/Tiddler Poster.png.meta b/editions/tw5.com/tiddlers/images/Tiddler Poster.png.meta index 2466871f0..221569974 100644 --- a/editions/tw5.com/tiddlers/images/Tiddler Poster.png.meta +++ b/editions/tw5.com/tiddlers/images/Tiddler Poster.png.meta @@ -2,3 +2,4 @@ title: Tiddler Poster.png type: image/png source: https://tiddlywiki.com/poster tags: picture +alt-text: Poster with a headline: Your messy thoughts. Organized. Below is an abstract Stickleback fish and tiddlywiki.com URL. diff --git a/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png.meta b/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png.meta index 2c3e7bab3..50d42ef49 100644 --- a/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png.meta +++ b/editions/tw5.com/tiddlers/images/TiddlyFox Apocalypse.png.meta @@ -1,3 +1,4 @@ title: TiddlyFox Apocalypse.png type: image/png tags: picture +alt-text: Motovun Jack's head with a FireFox logo over the head and a date: Nov. 14th 2017 on the left. diff --git a/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png.meta b/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png.meta index 4296f5116..0142e4d67 100644 --- a/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png.meta +++ b/editions/tw5.com/tiddlers/images/TiddlyWiki Classic.png.meta @@ -1,3 +1,4 @@ title: TiddlyWiki Classic.png type: image/png tags: picture +alt-text: TiddlyWiki classic screenshto thumbnail. diff --git a/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png.meta b/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png.meta index b53a63b97..3eb2dbdde 100644 --- a/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png.meta +++ b/editions/tw5.com/tiddlers/images/TiddlyWiki Newsletter Badge.png.meta @@ -1,3 +1,6 @@ -title: TiddlyWiki Newsletter Badge.png -type: image/png +alt-text: Motovun Jack reads a Newsletter. +created: 20240630093143711 +modified: 20240630094906495 tags: picture +title: TiddlyWiki Newsletter Badge.png +type: image/png \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/images/TiddlyWikiLinks.png.meta b/editions/tw5.com/tiddlers/images/TiddlyWikiLinks.png.meta index 5ac185287..ebe0b79ba 100644 --- a/editions/tw5.com/tiddlers/images/TiddlyWikiLinks.png.meta +++ b/editions/tw5.com/tiddlers/images/TiddlyWikiLinks.png.meta @@ -1,3 +1,4 @@ title: TiddlyWikiLinks type: image/png tags: picture +alt-text: Motovun Jack body with "chain liks" around the neck. diff --git a/editions/tw5.com/tiddlers/images/Tiddlyhost Logo.png.meta b/editions/tw5.com/tiddlers/images/Tiddlyhost Logo.png.meta index c0f8f256a..7cae3e920 100644 --- a/editions/tw5.com/tiddlers/images/Tiddlyhost Logo.png.meta +++ b/editions/tw5.com/tiddlers/images/Tiddlyhost Logo.png.meta @@ -1,3 +1,4 @@ title: Tiddlyhost Logo type: image/png tags: picture +atl-text: TiddlyHost logo. \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/images/Xememex Logo.svg.meta b/editions/tw5.com/tiddlers/images/Xememex Logo.svg.meta index 1eab02541..19726a249 100644 --- a/editions/tw5.com/tiddlers/images/Xememex Logo.svg.meta +++ b/editions/tw5.com/tiddlers/images/Xememex Logo.svg.meta @@ -1,2 +1,3 @@ type: image/svg+xml title: Xememex Logo +alt-text Xememex Logo diff --git a/editions/tw5.com/tiddlers/images/favicon.png.meta b/editions/tw5.com/tiddlers/images/favicon.png.meta index 76d0be1a8..45e69d9e7 100644 --- a/editions/tw5.com/tiddlers/images/favicon.png.meta +++ b/editions/tw5.com/tiddlers/images/favicon.png.meta @@ -1,2 +1,3 @@ title: $:/favicon.ico type: image/png +alt-text: Motovun Jack with blue background. diff --git a/editions/tw5.com/tiddlers/images/green_favicon.png.meta b/editions/tw5.com/tiddlers/images/green_favicon.png.meta index 1f2a3ecc0..9c605b1e4 100644 --- a/editions/tw5.com/tiddlers/images/green_favicon.png.meta +++ b/editions/tw5.com/tiddlers/images/green_favicon.png.meta @@ -1,2 +1,3 @@ title: $:/green_favicon.ico type: image/png +alt-text: Motovun Jack with green background. diff --git a/editions/tw5.com/tiddlers/system/wikitext-macros.tid b/editions/tw5.com/tiddlers/system/wikitext-macros.tid index e4a898ad8..796f949a7 100644 --- a/editions/tw5.com/tiddlers/system/wikitext-macros.tid +++ b/editions/tw5.com/tiddlers/system/wikitext-macros.tid @@ -89,10 +89,13 @@ type: text/vnd.tiddlywiki \end \procedure flex-card(class,bordercolor:"",backgroundcolor:"",textcolor:"",imageField:"image",captionField:"caption",subtitle:"",descriptionField:"description",linkField:"link") -<$link class={{{ [<class>addprefix[tc-card ]] }}} to={{{ [<currentTiddler>get<linkField>else<currentTiddler>] }}}> +<$link class={{{ [<class>addprefix[tc-card ]] }}} + to={{{ [<currentTiddler>get<linkField>else<currentTiddler>] }}} + aria-label=<<currentTiddler>> +> <div class="tc-card-accent" style.borderTop={{{ [<bordercolor>!is[blank]addprefix[5px solid ]] }}} style.background={{!!background}} style.backgroundColor=<<backgroundcolor>> style.color=<<textcolor>> style.fill=<<textcolor>>> <$list filter="[<currentTiddler>has[ribbon-text]]" variable="ignore"> - <div class="tc-card-ribbon-wrapper"> + <div class="tc-card-ribbon-wrapper" aria-hidden="true"> <div class="tc-card-ribbon" style.backgroundColor={{{ [<currentTiddler>get[ribbon-color]else[red]] }}}> <div class="tc-card-ribbon-inner"> <$text text={{!!ribbon-text}}/> @@ -102,7 +105,9 @@ type: text/vnd.tiddlywiki </$list> <$list filter="[<currentTiddler>has<imageField>]" variable="ignore"> <div class="tc-card-image"> - <$image source={{{ [<currentTiddler>get<imageField>] }}}/> + <$image source={{{ [<currentTiddler>get<imageField>] }}} + alt={{{ [<currentTiddler>get<imageField>get[alt-text]else[Image.]] }}} + /> </div> </$list> <div class="tc-card-title"><$transclude field=<<captionField>>><$view field="title"/></$transclude></div> From c64bbd984f447ed23d6d76cd570434332f7a128f Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:16:02 +0200 Subject: [PATCH 46/66] Re-activate tabs-macro test, rename expected-* files for easier maintenance (#8403) * re-activate tabs-macro test, rename expected-* files for easier maintenence * make sure the Recent tab in the browser is populated for easy testing --- .../expected-html-tabs-horizontal-all.tid | 5 -- .../expected-html-tabs-horizontal.tid | 5 -- .../expected-html-tabs-vertical.tid | 5 -- .../expected-test-tabs-horizontal-a.tid | 5 ++ .../expected-test-tabs-horizontal-all.tid | 5 ++ .../expected-test-tabs-vertical.tid | 5 ++ .../tests/test-wikitext-tabs-macro.js | 71 +++++++++---------- 7 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal-all.tid delete mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal.tid delete mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-vertical.tid create mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-a.tid create mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-all.tid create mode 100644 editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-vertical.tid diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal-all.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal-all.tid deleted file mode 100644 index 61f8d4971..000000000 --- a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal-all.tid +++ /dev/null @@ -1,5 +0,0 @@ -title: expected-html-tabs-horizontal-all -type: text/html -description: Horizontal tabs with all parameters active. This is the expected HTML output from a test in test-wikitext-tabs-macro.js - -<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">desc</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><h2 class=""><a class="tc-tiddlylink tc-tiddlylink-resolves" href="#TabTwo">TabTwo</a></h2><p><p>Text tab 2</p></p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal.tid deleted file mode 100644 index 0d1f2a416..000000000 --- a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-horizontal.tid +++ /dev/null @@ -1,5 +0,0 @@ -title: expected-html-tabs-horizontal -type: text/html -description: Horizontal tabs test - This is the expected HTML output from a test in test-wikitext-tabs-macro.js - -<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">t 3</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-vertical.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-vertical.tid deleted file mode 100644 index c45891073..000000000 --- a/editions/test/tiddlers/tests/data/tabs-macro/expected-html-tabs-vertical.tid +++ /dev/null @@ -1,5 +0,0 @@ -title: expected-html-tabs-vertical -type: text/html -description: Vertical tabs test -- This is the expected HTML output from the test in test-wikitext-tabs-macro.js - -<p><div class="tc-tab-set tc-vertical"><div class="tc-tab-buttons tc-vertical"><button class="" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" role="switch">t 2</button><button class="" role="switch">t 3</button><button class="" role="switch">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical"><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-a.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-a.tid new file mode 100644 index 000000000..1cb356182 --- /dev/null +++ b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-a.tid @@ -0,0 +1,5 @@ +title: expected-test-tabs-horizontal-a +type: text/html +description: Horizontal tabs test - This is the expected HTML output from a test in test-wikitext-tabs-macro.js + +<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">t 3</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-all.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-all.tid new file mode 100644 index 000000000..418510172 --- /dev/null +++ b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-horizontal-all.tid @@ -0,0 +1,5 @@ +title: expected-test-tabs-horizontal-all +type: text/html +description: Horizontal tabs with all parameters active. This is the expected HTML output from a test in test-wikitext-tabs-macro.js + +<p><div class="tc-tab-set "><div class="tc-tab-buttons "><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">desc</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider "></div><div class="tc-tab-content "><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><h2 class="">TabTwo</h2><p><p>Text tab 2</p></p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-vertical.tid b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-vertical.tid new file mode 100644 index 000000000..3f1f344f9 --- /dev/null +++ b/editions/test/tiddlers/tests/data/tabs-macro/expected-test-tabs-vertical.tid @@ -0,0 +1,5 @@ +title: expected-test-tabs-vertical +type: text/html +description: Vertical tabs test -- This is the expected HTML output from the test in test-wikitext-tabs-macro.js + +<p><div class="tc-tab-set tc-vertical"><div class="tc-tab-buttons tc-vertical"><button class="" data-tab-title="TabOne" role="switch">t 1</button><button aria-checked="true" class=" tc-tab-selected" data-tab-title="TabTwo" role="switch">t 2</button><button class="" data-tab-title="TabThree" role="switch">t 3</button><button class="" data-tab-title="TabFour" role="switch">TabFour</button></div><div class="tc-tab-divider tc-vertical"></div><div class="tc-tab-content tc-vertical"><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal"><p>Text tab 2</p></div><div class=" tc-reveal" hidden="true"></div><div class=" tc-reveal" hidden="true"></div></div></div></p> \ No newline at end of file diff --git a/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js b/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js index 39f061d11..973f6fe66 100644 --- a/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js +++ b/editions/test/tiddlers/tests/test-wikitext-tabs-macro.js @@ -1,7 +1,7 @@ /*\ title: test-wikitext-tabs-macro.js type: application/javascript -tags: [[$:/tags/test-spec-disabled]] +tags: [[$:/tags/test-spec]] Tests the core tabs macro by comparing the HTML output with a stored template. Intended to permit future readability improvements. @@ -17,70 +17,67 @@ Adding new functionality will probably change the "expected" html structure. describe("Tabs-macro HTML tests", function() { - var expected = $tw.wiki.getTiddler("expected-html-tabs-horizontal"), - expectedAll = $tw.wiki.getTiddler("expected-html-tabs-horizontal-all"), - expectedVert = $tw.wiki.getTiddler("expected-html-tabs-vertical"), +// This code can be copy pasted into the browser console for easy testing + + // the expected tiddlers can be found at ./data/tabs-macro/ + var expected = $tw.wiki.getTiddler("expected-test-tabs-horizontal-a"), + expectedAll = $tw.wiki.getTiddler("expected-test-tabs-horizontal-all"), + expectedVert = $tw.wiki.getTiddler("expected-test-tabs-vertical"), coreTabsTiddler = $tw.wiki.getTiddler("$:/core/macros/tabs"); - // Create a wiki - var wiki = new $tw.Wiki(); + // Create a wiki with test tiddlers // Add a couple of tiddlers - wiki.addTiddler({title: "TabOne", text: "Text tab 1", caption:"t 1"}); - wiki.addTiddler({title: "TabTwo", text: "Text tab 2", caption:"t 2"}); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "TabOne", text: "Text tab 1", caption:"t 1"},$tw.wiki.getModificationFields())); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "TabTwo", text: "Text tab 2", caption:"t 2"},$tw.wiki.getModificationFields())); // TabThree shows description used in button-template instead of caption - wiki.addTiddler({title: "TabThree", text: "Text tab 3", caption:"t 3", description:"desc"}); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "TabThree", text: "Text tab 3", caption:"t 3", description:"desc"},$tw.wiki.getModificationFields())); // Tab Four has no caption field, so title will be used - wiki.addTiddler({title: "TabFour", text: "Text tab 4"}); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "TabFour", text: "Text tab 4"},$tw.wiki.getModificationFields())); // Template tiddlers - wiki.addTiddler({ title: "body-template", - text: '!! <<currentTab>>\n\n<$transclude tiddler=<<currentTab>> mode="block"/>'}); - wiki.addTiddler({ title: "button-template", - text: '<$transclude tiddler=<<currentTab>> field="description"><$transclude tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$transclude></$transclude>'}); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "body-template", "code-body":"yes", + text: '!! <<currentTab>>\n\n<$transclude tiddler=<<currentTab>> mode="block"/>'},$tw.wiki.getModificationFields())); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "button-template", "code-body":"yes", + text: '<$transclude tiddler=<<currentTab>> field="description"><$transclude tiddler=<<currentTab>> field="caption"><$macrocall $name="currentTab" $type="text/plain" $output="text/plain"/></$transclude></$transclude>'},$tw.wiki.getModificationFields())); // tabs macro cloned, to be used with \\import - wiki.addTiddler({title: "tabs-macro-definition", text: coreTabsTiddler.fields.text}); + $tw.wiki.addTiddler(new $tw.Tiddler({title: "tabs-macro-definition", "code-body":"yes", text: coreTabsTiddler.fields.text},$tw.wiki.getModificationFields())); // horizontal tabs test uses `tabsList`, `default` and `state` -- unnamed params - wiki.addTiddler({title: "test-tabs-macro-horizontal", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-01">>'}); + $tw.wiki.addTiddler(new $tw.Tiddler( + {title: "test-tabs-horizontal", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-01">>'}, + $tw.wiki.getModificationFields()) + ); // horizontal tabs test adds `template`, `buttonTemplate` and `explicitState` as named params - wiki.addTiddler({title: "test-tabs-macro-horizontal-all", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-01" template:"body-template" buttonTemplate:"button-template" explicitState:"$:/state/explicit">>'}); + $tw.wiki.addTiddler(new $tw.Tiddler( + {title: "test-tabs-horizontal-all", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-01" template:"body-template" buttonTemplate:"button-template" explicitState:"$:/state/explicit">>'}, + $tw.wiki.getModificationFields()) + ); // vertical tabs test. Same params as test 1 - wiki.addTiddler({title: "test-tabs-macro-vertical", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-02" "tc-vertical">>'}); + $tw.wiki.addTiddler(new $tw.Tiddler( + {title: "test-tabs-vertical", text: '\\import [[tabs-macro-definition]]\n<<tabs "TabOne TabTwo TabThree TabFour" "TabTwo" "$:/state/test-tab-02" "tc-vertical">>'}, + $tw.wiki.getModificationFields()) + ); + +// End This code can be copy pasted into the browser console /* ----------------- / Run the tests --------------------*/ // horizontal -/* - xit("should render horizontal tabs v5.2.1", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal")).toBe(expected.fields.text); - }); - - xit("should render horizontal tabs macro with all parameters modified V5.2.1", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal-all")).toBe(expectedAll.fields.text); - }); - - // vertical - xit("should render tabs vertical tabs v5.2.1", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-vertical")).toBe(expectedVert.fields.text); - }); -*/ - // Future tests - // horizontal it("should render 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal")).toBe(expected.fields.text.replace(/\n/g,"")); + expect($tw.wiki.renderTiddler("text/html","test-tabs-horizontal")).toBe(expected.fields.text.replace(/\n/g,"")); }); it("should render all 'horizontal' tabs from v5.2.2 and up with whitespace trim", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-horizontal-all")).toBe(expectedAll.fields.text.replace(/\n/g,"")); + expect($tw.wiki.renderTiddler("text/html","test-tabs-horizontal-all")).toBe(expectedAll.fields.text.replace(/\n/g,"")); }); // vertical it("should render 'vertical' tabs from v5.2.2 and up with whitespace trim", function() { - expect(wiki.renderTiddler("text/html","test-tabs-macro-vertical")).toBe(expectedVert.fields.text.replace(/\n/g,"")); + expect($tw.wiki.renderTiddler("text/html","test-tabs-vertical")).toBe(expectedVert.fields.text.replace(/\n/g,"")); }); }); From d450fce77b0592f1e7b6c19d778f6f6c3e85c60c Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:17:28 +0200 Subject: [PATCH 47/66] Add trimSelection parameter to text editor (#7944) * add trimSelection - both, start, end, no * add documentation for trimSelection to tm-edit-text-operation tiddler * add trimSelection both to all buttions where it makes sense * change "both" to "yes" as a default * fix trimSelection typo * fix trimSelection typo * docs trimSelection add "no" as possible value - it's the default * remove some redundant variable declarations * update from-version * fix comment typos * fix whitespace * make local variables more visible --- .../editor/operations/text/wrap-selection.js | 136 ++++++++++++++---- core/ui/EditorToolbar/bold.tid | 1 + core/ui/EditorToolbar/italic.tid | 1 + core/ui/EditorToolbar/linkify.tid | 1 + core/ui/EditorToolbar/mono-line.tid | 1 + .../stamp-dropdown-item-template.tid | 2 +- core/ui/EditorToolbar/strikethrough.tid | 1 + core/ui/EditorToolbar/subscript.tid | 1 + core/ui/EditorToolbar/superscript.tid | 1 + core/ui/EditorToolbar/transcludify.tid | 1 + core/ui/EditorToolbar/underline.tid | 1 + .../WidgetMessage_ tm-edit-text-operation.tid | 30 ++-- 12 files changed, 138 insertions(+), 39 deletions(-) diff --git a/core/modules/editor/operations/text/wrap-selection.js b/core/modules/editor/operations/text/wrap-selection.js index 6800cbe5b..665d72eb4 100644 --- a/core/modules/editor/operations/text/wrap-selection.js +++ b/core/modules/editor/operations/text/wrap-selection.js @@ -13,37 +13,125 @@ Text editor operation to wrap the selection with the specified prefix and suffix "use strict"; exports["wrap-selection"] = function(event,operation) { - if(operation.selStart === operation.selEnd) { - // No selection; check if we're within the prefix/suffix - if(operation.text.substring(operation.selStart - event.paramObject.prefix.length,operation.selStart + event.paramObject.suffix.length) === event.paramObject.prefix + event.paramObject.suffix) { + var o = operation, + prefix = event.paramObject.prefix, + suffix = event.paramObject.suffix, + trimSelection = event.paramObject.trimSelection || "no", + selLength = o.selEnd - o.selStart; + + // This function detects, if trailing spaces are part of the selection __and__ if the user wants to handle them + // Returns "yes", "start", "end", "no" (default) + // yes .. there are trailing spaces at both ends + // start .. there are trailing spaces at the start + // end .. there are trailing spaces at the end + // no .. no trailing spaces are taken into account + var trailingSpaceAt = function(sel) { + var _start, + _end, + result; + // trimSelection is a user parameter, which this evaluations takes into account + switch(trimSelection) { + case "end": + result = (sel.trimEnd().length !== selLength) ? "end" : "no"; + break; + case "yes": + _start = sel.trimStart().length !== selLength; + _end = sel.trimEnd().length !== selLength; + result = (_start && _end) ? "yes" : (_start) ? "start" : (_end) ? "end" : "no"; + break; + case "start": + result = (sel.trimStart().length !== selLength) ? "start" : "no"; + break; + default: + result = "no"; + break; + } + return result; + } + + function togglePrefixSuffix() { + if(o.text.substring(o.selStart - prefix.length, o.selStart + suffix.length) === prefix + suffix) { // Remove the prefix and suffix - operation.cutStart = operation.selStart - event.paramObject.prefix.length; - operation.cutEnd = operation.selEnd + event.paramObject.suffix.length; - operation.replacement = ""; - operation.newSelStart = operation.cutStart; - operation.newSelEnd = operation.newSelStart; + o.cutStart = o.selStart - prefix.length; + o.cutEnd = o.selEnd + suffix.length; + o.replacement = ""; + o.newSelStart = o.cutStart; + o.newSelEnd = o.newSelStart; } else { // Wrap the cursor instead - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = event.paramObject.prefix + event.paramObject.suffix; - operation.newSelStart = operation.selStart + event.paramObject.prefix.length; - operation.newSelEnd = operation.newSelStart; + o.cutStart = o.selStart; + o.cutEnd = o.selEnd; + o.replacement = prefix + suffix; + o.newSelStart = o.selStart + prefix.length; + o.newSelEnd = o.newSelStart; } - } else if(operation.text.substring(operation.selStart,operation.selStart + event.paramObject.prefix.length) === event.paramObject.prefix && operation.text.substring(operation.selEnd - event.paramObject.suffix.length,operation.selEnd) === event.paramObject.suffix) { + } + + // options: lenPrefix, lenSuffix + function removePrefixSuffix(options) { + options = options || {}; + var _lenPrefix = options.lenPrefix || 0; + var _lenSuffix = options.lenSuffix || 0; + + o.cutStart = o.selStart - _lenPrefix; + o.cutEnd = o.selEnd + _lenSuffix; + o.replacement = (_lenPrefix || _lenSuffix) ? o.selection : o.selection.substring(prefix.length, o.selection.length - suffix.length); + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + } + + function addPrefixSuffix() { + // remove trailing space if requested + switch(trailingSpaceAt(o.selection)) { + case "no": + // has no trailing spaces + o.cutStart = o.selStart; + o.cutEnd = o.selEnd; + o.replacement = prefix + o.selection + suffix; + o.newSelStart = o.selStart; + o.newSelEnd = o.selStart + o.replacement.length; + break; + case "yes": + // handle both ends + o.cutStart = o.selEnd - (o.selection.trimStart().length); + o.cutEnd = o.selection.trimEnd().length + o.selStart; + o.replacement = prefix + o.selection.trim() + suffix; + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + break; + case "start": + // handle leading + o.cutStart = o.selEnd - (o.selection.trimStart().length); + o.cutEnd = o.selEnd; + o.replacement = prefix + o.selection.trimStart() + suffix; + o.newSelStart = o.cutStart; + o.newSelEnd = o.cutStart + o.replacement.length; + break; + case "end": + // handle trailing + o.cutStart = o.selStart; + o.cutEnd = o.selection.trimEnd().length + o.selStart; + o.replacement = prefix + o.selection.trimEnd() + suffix; + o.newSelStart = o.selStart; + o.newSelEnd = o.selStart + o.replacement.length; + break; + } + } + + if(o.selStart === o.selEnd) { + // No selection; Create prefix and suffix. Set cursor in between them: ""|"" + togglePrefixSuffix(); + } else if(o.text.substring(o.selStart, o.selStart + prefix.length) === prefix && + o.text.substring(o.selEnd - suffix.length,o.selEnd) === suffix) { // Prefix and suffix are already present, so remove them - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = operation.selection.substring(event.paramObject.prefix.length,operation.selection.length - event.paramObject.suffix.length); - operation.newSelStart = operation.selStart; - operation.newSelEnd = operation.selStart + operation.replacement.length; + removePrefixSuffix(); + } else if(o.text.substring(o.selStart - prefix.length, o.selStart) === prefix && + o.text.substring(o.selEnd, o.selEnd + suffix.length) === suffix) { + // Prefix and suffix are present BUT not selected -> remove them + removePrefixSuffix({"lenPrefix": prefix.length, "lenSuffix": suffix.length}); } else { // Add the prefix and suffix - operation.cutStart = operation.selStart; - operation.cutEnd = operation.selEnd; - operation.replacement = event.paramObject.prefix + operation.selection + event.paramObject.suffix; - operation.newSelStart = operation.selStart; - operation.newSelEnd = operation.selStart + operation.replacement.length; + addPrefixSuffix(); } }; diff --git a/core/ui/EditorToolbar/bold.tid b/core/ui/EditorToolbar/bold.tid index 1cde1be39..258b13d75 100644 --- a/core/ui/EditorToolbar/bold.tid +++ b/core/ui/EditorToolbar/bold.tid @@ -11,4 +11,5 @@ shortcuts: ((bold)) $param="wrap-selection" prefix="''" suffix="''" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/italic.tid b/core/ui/EditorToolbar/italic.tid index 7f3505ddb..47c86b46d 100644 --- a/core/ui/EditorToolbar/italic.tid +++ b/core/ui/EditorToolbar/italic.tid @@ -11,4 +11,5 @@ shortcuts: ((italic)) $param="wrap-selection" prefix="//" suffix="//" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/linkify.tid b/core/ui/EditorToolbar/linkify.tid index e8b5fed62..f500669ad 100644 --- a/core/ui/EditorToolbar/linkify.tid +++ b/core/ui/EditorToolbar/linkify.tid @@ -12,4 +12,5 @@ tags: $:/tags/EditorToolbar $param="wrap-selection" prefix="[[" suffix="]]" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/mono-line.tid b/core/ui/EditorToolbar/mono-line.tid index 2df863171..cfad08e71 100644 --- a/core/ui/EditorToolbar/mono-line.tid +++ b/core/ui/EditorToolbar/mono-line.tid @@ -11,4 +11,5 @@ shortcuts: ((mono-line)) $param="wrap-selection" prefix="`" suffix="`" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/stamp-dropdown-item-template.tid b/core/ui/EditorToolbar/stamp-dropdown-item-template.tid index 5e5acb162..cef3de8b0 100644 --- a/core/ui/EditorToolbar/stamp-dropdown-item-template.tid +++ b/core/ui/EditorToolbar/stamp-dropdown-item-template.tid @@ -21,7 +21,7 @@ title: $:/core/ui/EditorToolbar/StampDropdown/ItemTemplate $message="tm-edit-text-operation" $param="wrap-selection" prefix={{{ [<currentTiddler>addsuffix[/prefix]get[text]] }}} - suffix={{{ [<currentTiddler>addsuffix[/suffix]get[text]] }}} + suffix={{{ [<currentTiddler>addsuffix[/suffix]get[text]] }}} /> </$list> diff --git a/core/ui/EditorToolbar/strikethrough.tid b/core/ui/EditorToolbar/strikethrough.tid index 0b00df486..51dbbede2 100644 --- a/core/ui/EditorToolbar/strikethrough.tid +++ b/core/ui/EditorToolbar/strikethrough.tid @@ -11,4 +11,5 @@ shortcuts: ((strikethrough)) $param="wrap-selection" prefix="~~" suffix="~~" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/subscript.tid b/core/ui/EditorToolbar/subscript.tid index 1c980a896..4be11ba54 100644 --- a/core/ui/EditorToolbar/subscript.tid +++ b/core/ui/EditorToolbar/subscript.tid @@ -11,4 +11,5 @@ shortcuts: ((subscript)) $param="wrap-selection" prefix=",," suffix=",," + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/superscript.tid b/core/ui/EditorToolbar/superscript.tid index ee4713409..02cb1176e 100644 --- a/core/ui/EditorToolbar/superscript.tid +++ b/core/ui/EditorToolbar/superscript.tid @@ -11,4 +11,5 @@ shortcuts: ((superscript)) $param="wrap-selection" prefix="^^" suffix="^^" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/transcludify.tid b/core/ui/EditorToolbar/transcludify.tid index d24b2041c..61195ed1e 100644 --- a/core/ui/EditorToolbar/transcludify.tid +++ b/core/ui/EditorToolbar/transcludify.tid @@ -12,4 +12,5 @@ tags: $:/tags/EditorToolbar $param="wrap-selection" prefix="{{" suffix="}}" + trimSelection="yes" /> diff --git a/core/ui/EditorToolbar/underline.tid b/core/ui/EditorToolbar/underline.tid index 9f0fc9c30..9d4c4d151 100644 --- a/core/ui/EditorToolbar/underline.tid +++ b/core/ui/EditorToolbar/underline.tid @@ -11,4 +11,5 @@ shortcuts: ((underline)) $param="wrap-selection" prefix="__" suffix="__" + trimSelection="yes" /> diff --git a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid index 72cc90381..9aaca9bf3 100644 --- a/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid +++ b/editions/tw5.com/tiddlers/messages/WidgetMessage_ tm-edit-text-operation.tid @@ -1,6 +1,6 @@ caption: tm-edit-text-operation created: 20160424211339792 -modified: 20230803045746596 +modified: 20240909083525060 tags: Messages title: WidgetMessage: tm-edit-text-operation type: text/vnd.tiddlywiki @@ -11,9 +11,9 @@ type: text/vnd.tiddlywiki Excises the currently selected text into a new tiddler and replaces it with a link, a macro or a transclude of the new tiddler. Parameters include: |!Name |!Description | -|title |Title of the new tiddler the selected content is excised to| -|type |Type of the replacement to be inserted: Can be one of <<.value "transclude">>, <<.value "link">> or <<.value "macro">>| -|macro |In case //type=<<.value "macro">>//, specifies the name of the macro to be inserted. The title of the new tiddler is provided as the first parameter to the macro. Defaults to the [[translink macro|translink Macro]]| +|title |Title of the new tiddler the selected content is excised to | +|type |Type of the replacement to be inserted: Can be one of <<.value "transclude">>, <<.value "link">> or <<.value "macro">> | +|macro |In case //type=<<.value "macro">>//, specifies the name of the macro to be inserted. The title of the new tiddler is provided as the first parameter to the macro. Defaults to the [[translink macro|translink Macro]] | |tagnew |If '<<.value "yes">>', will tag the new tiddler with the title of the tiddler currently being edited | </div> @@ -25,7 +25,7 @@ Excises the currently selected text into a new tiddler and replaces it with a li Replaces ''all'' contents of the editor with the provided text. |!Name |!Description | -|text |Text to be inserted| +|text |Text to be inserted | </div> \end @@ -36,7 +36,7 @@ Replaces ''all'' contents of the editor with the provided text. Replaces the current selection with the provided text. |!Name |!Description | -|text |Text to be inserted| +|text |Text to be inserted | </div> \end @@ -47,8 +47,8 @@ Replaces the current selection with the provided text. Prefixes the currently selected line//(s)// with the provided character. If a line is already prefixed by the provided prefix, the prefix is removed instead. |!Name |!Description | -|character |Prefix character| -|count |Number of characters that make up the prefix| +|character |Prefix character | +|count |Number of characters that make up the prefix | ''Example'' Setting //character="<<.value "!">>"// and //count="<<.value "3">>"// would insert the prefix "<<.value "!!!" >>", which will resolve to a subheading when parsed as WikiText. @@ -61,8 +61,8 @@ Prefixes the currently selected line//(s)// with the provided character. If a li Surrounds the selected //lines// with the provided <<.param "prefix">> and <<.param "suffix">>. |!Name |!Description | -|prefix |String to be prefixed to the selected lines| -|suffix |Suffix to be inserted after the selected lines| +|prefix |String to be prefixed to the selected lines | +|suffix |Suffix to be inserted after the selected lines | </div> @@ -75,8 +75,9 @@ Surrounds the selected //lines// with the provided <<.param "prefix">> and <<.pa Surrounds the current //selection// with the provided <<.param "prefix">> and <<.param "suffix">>. |!Name |!Description | -|prefix |String to be prefixed to the selection| -|suffix |Suffix to be inserted after the selection| +|prefix |String to be prefixed to the selection | +|suffix |Suffix to be inserted after the selection | +|trimSelection |<<.from-version 5.3.6>> Trim leading and trailing white-space from the selection and move it to the surrounding text. Possible values are: `yes`, `no` (default), `start` and `end` | </div> \end @@ -138,11 +139,11 @@ At this point the following text operations have been implemented: |<<.def "wrap-selection">>|<<wrapSelectionDescription>> | |<<.def "save-selection">>|<<saveSelectionDescription>> | |<<.def "make-link">>|<<makeLinkDescription>> | -|<<.def "insert-text">>|<<insertTextDescription>>| +|<<.def "insert-text">>|<<insertTextDescription>> | |<<.def "focus-editor">>|<<.from-version 5.2.0>> <<focusEditorDescription>> | -!Example +! Example An example can be seen in [[$:/core/ui/EditorToolbar/bold]]: @@ -152,6 +153,7 @@ An example can be seen in [[$:/core/ui/EditorToolbar/bold]]: $param="wrap-selection" prefix="''" suffix="''" + trimSelection="yes" /> ``` From 054be1af4ea512773e0cd5d10d92b832535761fe Mon Sep 17 00:00:00 2001 From: Mario Pietsch <pmariojo@gmail.com> Date: Tue, 10 Sep 2024 18:56:10 +0200 Subject: [PATCH 48/66] Add new reference tiddlers for the new v5.3.x concepts (#8164) --- editions/tw5.com/tiddlers/Core Classes.tid | 16 ++++++++++++++++ editions/tw5.com/tiddlers/Core Functions.tid | 8 ++++++++ editions/tw5.com/tiddlers/Core Messages.tid | 10 ++++++++++ editions/tw5.com/tiddlers/Core Procedures.tid | 8 ++++++++ editions/tw5.com/tiddlers/Core Widgets.tid | 10 ++++++++++ editions/tw5.com/tiddlers/concepts/Macros.tid | 4 ++-- editions/tw5.com/tiddlers/concepts/Messages.tid | 9 +++------ .../tw5.com/tiddlers/functions/Functions.tid | 4 ++-- editions/tw5.com/tiddlers/macros/CoreMacros.tid | 3 ++- .../tw5.com/tiddlers/procedures/Procedures.tid | 4 ++-- .../tiddlers/variables/Core Variables.tid | 7 ++++--- .../tw5.com/tiddlers/variables/Variables.tid | 4 ++-- .../tw5.com/tiddlers/widgets/Custom Widgets.tid | 4 ++-- editions/tw5.com/tiddlers/widgets/Widgets.tid | 6 ++---- 14 files changed, 73 insertions(+), 24 deletions(-) create mode 100644 editions/tw5.com/tiddlers/Core Classes.tid create mode 100644 editions/tw5.com/tiddlers/Core Functions.tid create mode 100644 editions/tw5.com/tiddlers/Core Messages.tid create mode 100644 editions/tw5.com/tiddlers/Core Procedures.tid create mode 100644 editions/tw5.com/tiddlers/Core Widgets.tid diff --git a/editions/tw5.com/tiddlers/Core Classes.tid b/editions/tw5.com/tiddlers/Core Classes.tid new file mode 100644 index 000000000..ea21246df --- /dev/null +++ b/editions/tw5.com/tiddlers/Core Classes.tid @@ -0,0 +1,16 @@ +created: 20240421142359127 +modified: 20240422090116239 +tags: Reference +title: Core Classes + +~TiddlyWiki class definitions are ''prefixed'' with `tc-` and are mainly used in the "vanilla base" theme. The ''tc-'' prefix ''is reserved'' for ~TiddlyWiki, so it should not be used for user defined classes. + +Users, especially plugin developers, should use their own prefixes eg: mytc- or something similar. + +The following info can also be found in the $:/ControlPanel ''-> Advanced -> Stylesheets'' tab + +All stylesheets used in this wiki are: <small>(shadow tiddlers are bold)</small> + +<<list-links filter:"[all[shadows+tiddlers]tag[$:/tags/Stylesheet]]">> + +Also see: [[Utility Classes]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Core Functions.tid b/editions/tw5.com/tiddlers/Core Functions.tid new file mode 100644 index 000000000..cf9e6b300 --- /dev/null +++ b/editions/tw5.com/tiddlers/Core Functions.tid @@ -0,0 +1,8 @@ +created: 20240421144224104 +modified: 20240422090925417 +tags: Reference +title: Core Functions + +<!-- TODO Placeholder - Can be improved once the new "dumpvariables" macro is finished --> + +Also see: [[Functions]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Core Messages.tid b/editions/tw5.com/tiddlers/Core Messages.tid new file mode 100644 index 000000000..597bc6643 --- /dev/null +++ b/editions/tw5.com/tiddlers/Core Messages.tid @@ -0,0 +1,10 @@ +created: 20240421144407522 +modified: 20240422091247905 +tags: Reference +title: Core Messages + +{{||Messages}} + +The following widget messages are implemented by the core: + +<<list-links filter:"[tag[Messages]]" class:"multi-columns">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Core Procedures.tid b/editions/tw5.com/tiddlers/Core Procedures.tid new file mode 100644 index 000000000..ce2a01719 --- /dev/null +++ b/editions/tw5.com/tiddlers/Core Procedures.tid @@ -0,0 +1,8 @@ +created: 20240422090331513 +modified: 20240422090918289 +tags: Reference +title: Core Procedures + +<!-- TODO Placeholder - Can be improved once the new "dumpvariables" macro is finished --> + +Also see: [[Procedures]] \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/Core Widgets.tid b/editions/tw5.com/tiddlers/Core Widgets.tid new file mode 100644 index 000000000..c38a3e0c0 --- /dev/null +++ b/editions/tw5.com/tiddlers/Core Widgets.tid @@ -0,0 +1,10 @@ +created: 20240422083130158 +modified: 20240422083155753 +tags: Reference +title: Core Widgets + +{{Widgets}} + +The following classes of widget are built into the core: + +<<list-links "[tag[Widgets]]" class:"multi-columns">> \ No newline at end of file diff --git a/editions/tw5.com/tiddlers/concepts/Macros.tid b/editions/tw5.com/tiddlers/concepts/Macros.tid index 884551996..e71f80077 100644 --- a/editions/tw5.com/tiddlers/concepts/Macros.tid +++ b/editions/tw5.com/tiddlers/concepts/Macros.tid @@ -1,6 +1,6 @@ created: 20140211171341271 -modified: 20230922094937115 -tags: Concepts Reference +modified: 20240422084520179 +tags: Concepts [[Core Macros]] title: Macros type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/concepts/Messages.tid b/editions/tw5.com/tiddlers/concepts/Messages.tid index 77c9df290..968a2509f 100644 --- a/editions/tw5.com/tiddlers/concepts/Messages.tid +++ b/editions/tw5.com/tiddlers/concepts/Messages.tid @@ -1,11 +1,8 @@ created: 20140226083311937 -modified: 20211117042057208 -tags: Concepts Reference +modified: 20240422091319082 +tags: Concepts [[Core Messages]] title: Messages type: text/vnd.tiddlywiki -Widget ''messages'' are generated by [[Widgets]] in response to user actions. Messages have a <<.param name>>, an optional primary <<.param parameter>>, and one or more optional named parameters. These messages travel up the widget tree where they are handled by ancestor widgets or the core itself. +Widget [[messages|Core Messages]] are generated by [[Widgets]] in response to user actions. Messages have a <<.param name>>, an optional primary <<.param parameter>>, and one or more optional named parameters. These messages travel up the widget tree where they are handled by ancestor widgets or the core itself. -The following widget messages are implemented by the core: - -<<list-links "[tag[Messages]]">> diff --git a/editions/tw5.com/tiddlers/functions/Functions.tid b/editions/tw5.com/tiddlers/functions/Functions.tid index 028747a34..0911fdd6d 100644 --- a/editions/tw5.com/tiddlers/functions/Functions.tid +++ b/editions/tw5.com/tiddlers/functions/Functions.tid @@ -1,6 +1,6 @@ created: 20221009124003601 -modified: 20240619211228560 -tags: Concepts Reference +modified: 20240422084850412 +tags: Concepts [[Core Functions]] title: Functions type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/macros/CoreMacros.tid b/editions/tw5.com/tiddlers/macros/CoreMacros.tid index 01879e3ac..2c46555f3 100644 --- a/editions/tw5.com/tiddlers/macros/CoreMacros.tid +++ b/editions/tw5.com/tiddlers/macros/CoreMacros.tid @@ -1,5 +1,6 @@ created: 20150220180315000 -modified: 20150221222052000 +modified: 20240422084600212 +tags: Reference title: Core Macros type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/procedures/Procedures.tid b/editions/tw5.com/tiddlers/procedures/Procedures.tid index 321284f93..1643fac18 100644 --- a/editions/tw5.com/tiddlers/procedures/Procedures.tid +++ b/editions/tw5.com/tiddlers/procedures/Procedures.tid @@ -1,6 +1,6 @@ created: 20221007124007426 -modified: 20240310173130052 -tags: Concepts Reference +modified: 20240422090349758 +tags: Concepts [[Core Procedures]] title: Procedures type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/variables/Core Variables.tid b/editions/tw5.com/tiddlers/variables/Core Variables.tid index ab19181eb..3b2fa070b 100644 --- a/editions/tw5.com/tiddlers/variables/Core Variables.tid +++ b/editions/tw5.com/tiddlers/variables/Core Variables.tid @@ -1,12 +1,13 @@ created: 20150220161908000 -modified: 20150228134138000 +modified: 20240421144847774 +tags: Reference title: Core Variables type: text/vnd.tiddlywiki The following [[variables|Variables]] are built into ~TiddlyWiki's core: -<<list-links "[tag[Core Variables]] -[tag[Configuration Variables]]">> +<<list-links filter:"[tag[Core Variables]] -[tag[Configuration Variables]]" class:"multi-columns">> The core will also use various configuration variables and macros if you define them: -<<list-links "[tag[Configuration Variables]]">> +<<list-links filter:"[tag[Configuration Variables]]" class:"multi-columns">> diff --git a/editions/tw5.com/tiddlers/variables/Variables.tid b/editions/tw5.com/tiddlers/variables/Variables.tid index 116f3c9a0..43387eb4f 100644 --- a/editions/tw5.com/tiddlers/variables/Variables.tid +++ b/editions/tw5.com/tiddlers/variables/Variables.tid @@ -1,6 +1,6 @@ created: 20141002133113496 -modified: 20230422150445336 -tags: Concepts Reference WikiText +modified: 20240422084347375 +tags: Concepts WikiText title: Variables type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/widgets/Custom Widgets.tid b/editions/tw5.com/tiddlers/widgets/Custom Widgets.tid index b8c48b2c3..847bdeed9 100644 --- a/editions/tw5.com/tiddlers/widgets/Custom Widgets.tid +++ b/editions/tw5.com/tiddlers/widgets/Custom Widgets.tid @@ -1,6 +1,6 @@ created: 20221007144237585 -modified: 20230921180332436 -tags: Concepts Reference +modified: 20240422084734129 +tags: Concepts title: Custom Widgets type: text/vnd.tiddlywiki diff --git a/editions/tw5.com/tiddlers/widgets/Widgets.tid b/editions/tw5.com/tiddlers/widgets/Widgets.tid index 66793f47d..1b65189b4 100644 --- a/editions/tw5.com/tiddlers/widgets/Widgets.tid +++ b/editions/tw5.com/tiddlers/widgets/Widgets.tid @@ -1,6 +1,6 @@ created: 20140908130500000 -modified: 20240326164134356 -tags: Concepts Reference +modified: 20240422083334052 +tags: Concepts [[Core Widgets]] title: Widgets type: text/vnd.tiddlywiki @@ -14,6 +14,4 @@ Each class of widget contributes a specific ability to the overall functionality The more specialised widgets use a general-purpose [[widget syntax|Widgets in WikiText]] as their only possible WikiText representation. -The following classes of widget are built into the core: -<<list-links "[tag[Widgets]]" class:"multi-columns">> From a960e4f6589ffb05a024c72dd75aaa99952ea6e7 Mon Sep 17 00:00:00 2001 From: Michael McDermott <michaeljmcd@users.noreply.github.com> Date: Tue, 10 Sep 2024 09:57:06 -0700 Subject: [PATCH 49/66] Make Excision Available for Markdown (#8498) * Updates to make Excision more friendly to Markdown users by adding Markdown as an option in the criteria to use excision and by making the excise operation reuse the type of the tiddler being excised. * Updated excise operation to use Markdown syntax for links. --- core/modules/editor/operations/text/excise.js | 11 +++++++++-- core/ui/EditorToolbar/excise.tid | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/core/modules/editor/operations/text/excise.js b/core/modules/editor/operations/text/excise.js index 8cb3a8486..bb5840c2e 100644 --- a/core/modules/editor/operations/text/excise.js +++ b/core/modules/editor/operations/text/excise.js @@ -12,9 +12,14 @@ Text editor operation to excise the selection to a new tiddler /*global $tw: false */ "use strict"; +function isMarkdown(mediaType) { + return mediaType === 'text/markdown' || mediatype === 'text/x-markdown'; +} + exports["excise"] = function(event,operation) { var editTiddler = this.wiki.getTiddler(this.editTitle), editTiddlerTitle = this.editTitle, + wikiLinks = !isMarkdown(editTiddler.fields.type), excisionBaseTitle = $tw.language.getString("Buttons/Excise/DefaultTitle"); if(editTiddler && editTiddler.fields["draft.of"]) { editTiddlerTitle = editTiddler.fields["draft.of"]; @@ -26,7 +31,8 @@ exports["excise"] = function(event,operation) { { title: excisionTitle, text: operation.selection, - tags: event.paramObject.tagnew === "yes" ? [editTiddlerTitle] : [] + tags: event.paramObject.tagnew === "yes" ? [editTiddlerTitle] : [], + type: editTiddler.fields.type } )); operation.replacement = excisionTitle; @@ -35,7 +41,8 @@ exports["excise"] = function(event,operation) { operation.replacement = "{{" + operation.replacement+ "}}"; break; case "link": - operation.replacement = "[[" + operation.replacement+ "]]"; + operation.replacement = wikiLinks ? "[[" + operation.replacement+ "]]" + : ("[" + operation.replacement + "](<#" + operation.replacement + ">)"); break; case "macro": operation.replacement = "<<" + (event.paramObject.macro || "translink") + " \"\"\"" + operation.replacement + "\"\"\">>"; diff --git a/core/ui/EditorToolbar/excise.tid b/core/ui/EditorToolbar/excise.tid index fe5c5288b..8bb17edd5 100644 --- a/core/ui/EditorToolbar/excise.tid +++ b/core/ui/EditorToolbar/excise.tid @@ -3,7 +3,7 @@ tags: $:/tags/EditorToolbar icon: $:/core/images/excise caption: {{$:/language/Buttons/Excise/Caption}} description: {{$:/language/Buttons/Excise/Hint}} -condition: [<targetTiddler>type[]] [<targetTiddler>get[type]prefix[text/vnd.tiddlywiki]] +[first[]] +condition: [<targetTiddler>type[]] [<targetTiddler>type[text/vnd.tiddlywiki]] [<targetTiddler>type[text/markdown]] [<targetTiddler>type[text/x-markdown]] +[first[]] shortcuts: ((excise)) dropdown: $:/core/ui/EditorToolbar/excise-dropdown From d133c922b7efd22cb13d7616ec63d27c7507dd4d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston <jeremy@jermolene.com> Date: Tue, 10 Sep 2024 18:59:31 +0100 Subject: [PATCH 50/66] Updated release note --- .../prerelease/tiddlers/Release 5.3.6.tid | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/editions/prerelease/tiddlers/Release 5.3.6.tid b/editions/prerelease/tiddlers/Release 5.3.6.tid index 211b360cb..40cca3478 100644 --- a/editions/prerelease/tiddlers/Release 5.3.6.tid +++ b/editions/prerelease/tiddlers/Release 5.3.6.tid @@ -32,6 +32,8 @@ This release includes improvements to the following translations: * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8402">> readability of Markdown links to other tiddlers * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8459">> image toolbar dropdown to editor toolbar * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8492">> colour for target footnote background +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8585">> settings tab +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8498">> support for the excision tool ! TestCaseWidget and Related Improvements @@ -39,7 +41,7 @@ This release includes several fixes and improvements to the TestCaseWidget, its * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8447">> new `$compound-filter` attribute for the DataWidget that allows other compound tiddlers to be imported. There is also a companion ''import-compound'' field for the TestCaseWidget template * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8514">> the TestCaseWidget default template to make it more modular -* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8499">> support for an ''import'' field in the default TestCaseWidget template, allowing additional tiddlers to be imported +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8499">> support for an ''import'' field in TestCaseTiddlers, allowing additional tiddlers to be imported * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8416">> [[TestCaseWidget]] default template to allow wikitext within the test case narrative * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8449">> WikiText formatting buttons when editing CompoundTiddlers * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8450">> CompoundTiddlers type `text/vnd.tiddlywiki-multiple` to the editor type dropdown @@ -61,6 +63,9 @@ This release includes several fixes and improvements to the TestCaseWidget, its * <<.link-badge-added "github.com/TiddlyWiki/TiddlyWiki5/pull/8441">> support for social media cards to be added to TiddlyWiki * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8518">> type attribute to input fields in control panel, allowing virtual keyboards to switch to the proper one when editing settings * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8558">> empty message to tag picker, search dropdown and advanced search +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8524">> handling of tiddler content that horizontally overflows by adding scrollbars +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8157">> a search button to the control panel tiddler fields tab +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8323">> (and <<.link-badge-here "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8324">>) the view and edit toolbars with more descriptive Aria labels ! Hackability Improvements @@ -70,6 +75,11 @@ This release includes several fixes and improvements to the TestCaseWidget, its * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8384">> tests to ensure that the syntax elements `{% %}` and `{= =}` are reserved for external tooling, and will never be recognised by TiddlyWiki itself * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8462">> new cascades for the view template subtitle and tags * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8500">> excision tool implementation to make the excision tiddler title translatable +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8584">> editor toolbar buttons to use the new [[Conditional Shortcut Syntax]] +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8579">> page control toolbar buttons to use the new [[Conditional Shortcut Syntax]] +* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8559">> [[WidgetMessage: tm-new-tiddler]] to allow tiddlers to be created with no tags field +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/7941">> ''startCount'' parameter to [[unusedtitle Macro]] +* <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/7944">> trimSelection parameter to [[WidgetMessage: tm-edit-text-operation]] ! Bug Fixes @@ -86,9 +96,15 @@ This release includes several fixes and improvements to the TestCaseWidget, its * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/38081b86c97a795420515156fcd52177574be516">> crash with filesystem adaptor if the wiki folder is missing * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8413">> unwrapped oveflowed code blocks not showing scroll bars when setting "Wrap long lines in code blocks" to "No" in "Theme tweaks" * <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/7317">> (and <<.link-badge-here "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8552">>) search input box outline in Chrome-like browsers -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/fa423e508ff5012423a1904bb17c9d61848732ee">> interpretation of success codes in Put saver OPTIONS request -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8485">> duplicated search result in advanced search if more than one tiddler is tagged with $:/tags/SearchResults -* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/7dfdbae812306875bac2445ca4ee505b406e3be1">> crash with KeyboardWidget in startup actions +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8578">> problem with rapid typing in the advanced search filter tab +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8535">> crash with EditionsCommand if an edition directory does not have a [[tiddlywiki.info file|tiddlywiki.info Files]] +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/b8fb9e6b21319e790e9aa7453ca265b0ed4898db">> DataWidget to allow title fields to be overwritten +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/fa423e508ff5012423a1904bb17c9d61848732ee">> "Put Saver" to correctly interpret HTTP response codes +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8547">> invalid accept header in "Put Saver" +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8485">> duplicated search results in advanced search when more than one tiddlers are tagged with [[SystemTag: $:/tags/SearchResults]] +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/commit/7dfdbae812306875bac2445ca4ee505b406e3be1">> crash if the KeyboardWidget is used within a [[startup action|StartupActions]] +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8574">> suffix in the [[encodebase64 Operator]] and [[decodebase64 Operator]] +* <<.link-badge-fixed "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8557">> overflow of floated elements ! Node.js Improvements @@ -112,6 +128,7 @@ hoelzro kookma Leilei332 linonetwo +michaeljmcd pmario PotOfCoffee2Go saqimtiaz @@ -120,4 +137,5 @@ springerspandrel twMat valpackett webplusai +wolfsprite """>> From 695e2ee5894277f78b8b8cf6d157a4121f4e9b5d Mon Sep 17 00:00:00 2001 From: Jeremy Ruston <jeremy@jermolene.com> Date: Tue, 10 Sep 2024 19:03:06 +0100 Subject: [PATCH 51/66] Revert "Make overflowed content scrollable (#8524)" This reverts commit d7b00a6dd0074c79a657f92acf528b0e3883edc7. --- editions/prerelease/tiddlers/Release 5.3.6.tid | 1 - themes/tiddlywiki/vanilla/base.tid | 5 ----- 2 files changed, 6 deletions(-) diff --git a/editions/prerelease/tiddlers/Release 5.3.6.tid b/editions/prerelease/tiddlers/Release 5.3.6.tid index 40cca3478..1d2c9b8b8 100644 --- a/editions/prerelease/tiddlers/Release 5.3.6.tid +++ b/editions/prerelease/tiddlers/Release 5.3.6.tid @@ -63,7 +63,6 @@ This release includes several fixes and improvements to the TestCaseWidget, its * <<.link-badge-added "github.com/TiddlyWiki/TiddlyWiki5/pull/8441">> support for social media cards to be added to TiddlyWiki * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8518">> type attribute to input fields in control panel, allowing virtual keyboards to switch to the proper one when editing settings * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8558">> empty message to tag picker, search dropdown and advanced search -* <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8524">> handling of tiddler content that horizontally overflows by adding scrollbars * <<.link-badge-added "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8157">> a search button to the control panel tiddler fields tab * <<.link-badge-improved "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8323">> (and <<.link-badge-here "https://github.com/TiddlyWiki/TiddlyWiki5/pull/8324">>) the view and edit toolbars with more descriptive Aria labels diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index b24b35cf2..65c1a5fe3 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -1350,10 +1350,6 @@ canvas.tc-edit-bitmapeditor { display: block; } -.tc-tiddler-body { - overflow-x: auto; -} - .tc-single-tiddler-window .tc-tiddler-body, .tc-tiddler-frame .tc-tiddler-body { font-size: {{$:/themes/tiddlywiki/vanilla/metrics/bodyfontsize}}; @@ -2224,7 +2220,6 @@ html body.tc-body.tc-single-tiddler-window { .tc-tab-content { margin-top: 14px; - overflow-x: auto; } .tc-tab-content.tc-vertical { From bae2b78925bec393318eac082db97eb95159dbca Mon Sep 17 00:00:00 2001 From: Michael McDermott <michaeljmcd@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:13:54 -0700 Subject: [PATCH 52/66] Added keyboard shortcut option for menubar search. (#8350) --- .../tiddlywiki/menubar/keyboardshortcuts-menubar-search.tid | 5 +++++ plugins/tiddlywiki/menubar/shortcutinfo-menubar-search.tid | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 plugins/tiddlywiki/menubar/keyboardshortcuts-menubar-search.tid create mode 100644 plugins/tiddlywiki/menubar/shortcutinfo-menubar-search.tid diff --git a/plugins/tiddlywiki/menubar/keyboardshortcuts-menubar-search.tid b/plugins/tiddlywiki/menubar/keyboardshortcuts-menubar-search.tid new file mode 100644 index 000000000..cb5fefb55 --- /dev/null +++ b/plugins/tiddlywiki/menubar/keyboardshortcuts-menubar-search.tid @@ -0,0 +1,5 @@ +key: ((menubar-search)) +tags: $:/tags/KeyboardShortcut +title: $:/core/ui/KeyboardShortcuts/menubar-search + +<$action-sendmessage $message="tm-focus-selector" $param=".tc-menubar input"/> diff --git a/plugins/tiddlywiki/menubar/shortcutinfo-menubar-search.tid b/plugins/tiddlywiki/menubar/shortcutinfo-menubar-search.tid new file mode 100644 index 000000000..9f7b0bb0c --- /dev/null +++ b/plugins/tiddlywiki/menubar/shortcutinfo-menubar-search.tid @@ -0,0 +1,4 @@ +tags: +title: $:/config/ShortcutInfo/menubar-search + +Select the menubar search field From fbf619b006d1c1ea342328ee269427784ebd7b71 Mon Sep 17 00:00:00 2001 From: Mohammad Rahmani <830394+kookma@users.noreply.github.com> Date: Thu, 12 Sep 2024 12:39:11 +0330 Subject: [PATCH 53/66] Update ViewTemplateBodyFilters.multids For Readability (#8592) This Cascade from ``` [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]] ``` Simplified. I also suggest using the same convention for all cascades --- core/wiki/config/ViewTemplateBodyFilters.multids | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/wiki/config/ViewTemplateBodyFilters.multids b/core/wiki/config/ViewTemplateBodyFilters.multids index 42a7ad823..a91c039de 100644 --- a/core/wiki/config/ViewTemplateBodyFilters.multids +++ b/core/wiki/config/ViewTemplateBodyFilters.multids @@ -1,7 +1,7 @@ title: $:/config/ViewTemplateBodyFilters/ tags: $:/tags/ViewTemplateBodyFilter -testcase: [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]then[$:/core/ui/TestCaseTemplate]] +testcase: [tag[$:/tags/wiki-test-spec]type[text/vnd.tiddlywiki-multiple]] [tag[$:/tags/wiki-test-spec-failing]type[text/vnd.tiddlywiki-multiple]] :then[[$:/core/ui/TestCaseTemplate]] stylesheet: [tag[$:/tags/Stylesheet]then[$:/core/ui/ViewTemplate/body/rendered-plain-text]] core-ui-tags: [tag[$:/tags/PageTemplate]] [tag[$:/tags/EditTemplate]] [tag[$:/tags/ViewTemplate]] [tag[$:/tags/KeyboardShortcut]] [tag[$:/tags/ImportPreview]] [tag[$:/tags/EditPreview]][tag[$:/tags/EditorToolbar]] [tag[$:/tags/Actions]] :then[[$:/core/ui/ViewTemplate/body/code]] system: [prefix[$:/boot/]] [prefix[$:/core/macros]] [prefix[$:/core/save/]] [prefix[$:/core/templates/]] [prefix[$:/config/]] [prefix[$:/info/]] [prefix[$:/language/]] [prefix[$:/languages/]] [prefix[$:/snippets/]] [prefix[$:/info/]] [prefix[$:/state/]] [prefix[$:/status/]] [prefix[$:/temp/]] :and[!is[image]] :then[[$:/core/ui/ViewTemplate/body/code]] From 18e1ee44d8a0f5e449dfe4b5b6569801fd341a29 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Fri, 13 Sep 2024 02:31:13 +0800 Subject: [PATCH 54/66] Move contents of config tab to readme tab in markdown plugin (#8595) --- plugins/tiddlywiki/markdown/config.tid | 70 ------------------------ plugins/tiddlywiki/markdown/plugin.info | 2 +- plugins/tiddlywiki/markdown/readme.tid | 69 +++++++++++++++++++++++ plugins/tiddlywiki/markdown/settings.tid | 2 +- 4 files changed, 71 insertions(+), 72 deletions(-) delete mode 100755 plugins/tiddlywiki/markdown/config.tid diff --git a/plugins/tiddlywiki/markdown/config.tid b/plugins/tiddlywiki/markdown/config.tid deleted file mode 100755 index 1438d3fa6..000000000 --- a/plugins/tiddlywiki/markdown/config.tid +++ /dev/null @@ -1,70 +0,0 @@ -title: $:/plugins/tiddlywiki/markdown/config - -! Plugin Configuration - -<h2 style="margin-top:1.5em">~WikiText Pragma</h2> - -The value of [[renderWikiTextPragma|$:/config/markdown/renderWikiTextPragma]] has been carefully tuned to properly integrate markdown with ~TiddlyWiki. Changing this setting may produce unexpected results, but the inclusion of the following parser rules should be fine: - -; image -: embed images using ~TiddlyWiki's image syntax: - -<p style="margin-left:1em"> - -``` -[img[An explanatory tooltip|TiddlerTitle]] - -[img width=23 class="tc-image" [https://tiddlywiki.com/fractalveg.jpg]] -``` -</p> - -; prettylink -: create links the ~TiddlyWiki way: - -<p style="margin-left:1em"> - -``` -[[TiddlerTitle]] - -[[Displayed Link Title|Tiddler Title]] - -[[TW5|https://tiddlywiki.com/]] -``` -</p> - -; prettyextlink -: create external links using the following syntax: - -<p style="margin-left:1em"> - -``` -[ext[Open file|index.html]] - -[ext[Open file|../README.md]] -``` -</p> - -; wikilink -: auto-link ~CamelCase titles - -; syslink -: auto-link system tiddlers - -<h2 style="margin-top:1.5em">Typographical Replacements</h2> - -When [[typographer|$:/config/markdown/typographer]] is enabled, markdown-it will provide these typographical replacements: - -``` -(c) (C) → © -(tm) (TM) → ™ -(r) (R) → ® -+- → ± -... → … -?.... → ?.. -!.... → !.. -????? → ??? -!!!!! → !!! -,, → , --- → – ---- → — -``` \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/plugin.info b/plugins/tiddlywiki/markdown/plugin.info index 1288ad068..37211a69e 100755 --- a/plugins/tiddlywiki/markdown/plugin.info +++ b/plugins/tiddlywiki/markdown/plugin.info @@ -2,6 +2,6 @@ "title": "$:/plugins/tiddlywiki/markdown", "name": "Markdown", "description": "Markdown parser based on markdown-it", - "list": "readme config settings syntax license", + "list": "readme settings syntax license", "stability": "STABILITY_2_STABLE" } diff --git a/plugins/tiddlywiki/markdown/readme.tid b/plugins/tiddlywiki/markdown/readme.tid index 1859fd36e..f924ddec8 100755 --- a/plugins/tiddlywiki/markdown/readme.tid +++ b/plugins/tiddlywiki/markdown/readme.tid @@ -29,4 +29,73 @@ var md = $tw.Wiki.parsers["text/markdown"].prototype.md; md.use(plugin1) .use(plugin2, opts, ...); +``` + +! Plugin Configuration + +<h2 style="margin-top:1.5em">~WikiText Pragma</h2> + +The value of [[renderWikiTextPragma|$:/config/markdown/renderWikiTextPragma]] has been carefully tuned to properly integrate markdown with ~TiddlyWiki. Changing this setting may produce unexpected results, but the inclusion of the following parser rules should be fine: + +; image +: embed images using ~TiddlyWiki's image syntax: + +<p style="margin-left:1em"> + +``` +[img[An explanatory tooltip|TiddlerTitle]] + +[img width=23 class="tc-image" [https://tiddlywiki.com/fractalveg.jpg]] +``` +</p> + +; prettylink +: create links the ~TiddlyWiki way: + +<p style="margin-left:1em"> + +``` +[[TiddlerTitle]] + +[[Displayed Link Title|Tiddler Title]] + +[[TW5|https://tiddlywiki.com/]] +``` +</p> + +; prettyextlink +: create external links using the following syntax: + +<p style="margin-left:1em"> + +``` +[ext[Open file|index.html]] + +[ext[Open file|../README.md]] +``` +</p> + +; wikilink +: auto-link ~CamelCase titles + +; syslink +: auto-link system tiddlers + +<h2 style="margin-top:1.5em">Typographical Replacements</h2> + +When [[typographer|$:/config/markdown/typographer]] is enabled, markdown-it will provide these typographical replacements: + +``` +(c) (C) → © +(tm) (TM) → ™ +(r) (R) → ® ++- → ± +... → … +?.... → ?.. +!.... → !.. +????? → ??? +!!!!! → !!! +,, → , +-- → – +--- → — ``` \ No newline at end of file diff --git a/plugins/tiddlywiki/markdown/settings.tid b/plugins/tiddlywiki/markdown/settings.tid index 54207fa10..85f419466 100644 --- a/plugins/tiddlywiki/markdown/settings.tid +++ b/plugins/tiddlywiki/markdown/settings.tid @@ -2,7 +2,7 @@ title: $:/plugins/tiddlywiki/markdown/settings tags: $:/tags/ControlPanel/SettingsTab caption: Markdown -These settings let you customise the behaviour of Markdown. See [[plugin|$:/plugins/tiddlywiki/markdown]] readme and config tab for more information. +These settings let you customise the behaviour of Markdown. See [[plugin|$:/plugins/tiddlywiki/markdown]] readme tab for more information. ''IMPORTANT:'' You must reload your wiki for changes to take effect. From c7ca8359ab4c90653168b30cf6dd5303436bcfda Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Fri, 13 Sep 2024 02:33:57 +0800 Subject: [PATCH 55/66] Add drag and drop handling for export macro & rewrite using v5.3.2 syntax (#8594) --- core/wiki/macros/export.tid | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/core/wiki/macros/export.tid b/core/wiki/macros/export.tid index 42d42a48a..5233da385 100644 --- a/core/wiki/macros/export.tid +++ b/core/wiki/macros/export.tid @@ -1,14 +1,14 @@ title: $:/core/macros/export -tags: $:/tags/Macro +tags: $:/tags/Macro $:/tags/Global -\define exportButtonFilename(baseFilename) -$baseFilename$$(extension)$ +\function exportButtonFilename(baseFilename) +[<baseFilename>] [<extension>] +[join[]] \end -\define exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers") +\procedure exportButton(exportFilter:"[!is[system]sort[title]]",lingoBase,baseFilename:"tiddlers") \whitespace trim -<$vars hint={{{ [<__lingoBase__>addsuffix[Hint]get[text]] }}} - caption={{{ [<__lingoBase__>addsuffix[Caption]get[text]] }}} +<$let hint={{{ [<lingoBase>addsuffix[Hint]get[text]] }}} + caption={{{ [<lingoBase>addsuffix[Caption]get[text]] }}} > <span class="tc-popup-keep"> <$button popup=<<qualify "$:/state/popup/export">> @@ -16,19 +16,20 @@ $baseFilename$$(extension)$ aria-label=<<caption>> class=<<tv-config-toolbar-class>> selectedClass="tc-selected" + dragFilter=<<exportFilter>> > - <$list filter="[<tv-config-toolbar-icons>match[yes]]"> + <%if [<tv-config-toolbar-icons>match[yes]] %> {{$:/core/images/export-button}} - </$list> - <$list filter="[<tv-config-toolbar-text>match[yes]]"> + <%endif%> + <%if [<tv-config-toolbar-text>match[yes]] %> <span class="tc-btn-text"><$text text=<<caption>>/></span> - </$list> + <%endif%> </$button> </span> -</$vars> +</$let> <$reveal state=<<qualify "$:/state/popup/export">> type="popup" position="below" animate="yes"> <div class="tc-drop-down"> - <$set name="count" value={{{ [subfilter<__exportFilter__>count[]] }}}> + <$set name="count" value={{{ [subfilter<exportFilter>count[]] }}}> <$list filter="[all[shadows+tiddlers]tag[$:/tags/Exporter]]"> <$list filter="[<currentTiddler>has[condition]subfilter{!!condition}limit[1]] ~[<currentTiddler>!has[condition]then[true]]" variable="ignore" @@ -36,8 +37,8 @@ $baseFilename$$(extension)$ <$button class="tc-btn-invisible"> <$action-sendmessage $message="tm-download-file" $param=<<currentTiddler>> - exportFilter=<<__exportFilter__>> - filename={{{ [<__baseFilename__>addsuffix{!!extension}] }}} + exportFilter=<<exportFilter>> + filename={{{ [<baseFilename>addsuffix{!!extension}] }}} /> <$action-deletetiddler $tiddler=<<qualify "$:/state/popup/export">>/> <$transclude field="description"/> From 33559075814a7eb4c7270de92f199693300a8c01 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sun, 15 Sep 2024 17:48:08 +0800 Subject: [PATCH 56/66] Seperate clear cookie and disable actions in Browser Storage Plugin (#8602) Added two messages: * `tm-delete-browser-storage` for deleting the cookie saved by the Browser Storage plugin * `tm-disable-browser-storage` for disabling Browser Storage --- plugins/tiddlywiki/browser-storage/startup.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/plugins/tiddlywiki/browser-storage/startup.js b/plugins/tiddlywiki/browser-storage/startup.js index e06d7bf48..2d7287971 100644 --- a/plugins/tiddlywiki/browser-storage/startup.js +++ b/plugins/tiddlywiki/browser-storage/startup.js @@ -54,6 +54,13 @@ exports.startup = function() { $tw.wiki.addTiddler({title: ENABLED_TITLE, text: "no"}); $tw.browserStorage.clearLocalStorage(); }); + // Seperate clear cookie and disable action + $tw.rootWidget.addEventListener("tm-delete-browser-storage",function(event) { + $tw.browserStorage.clearLocalStorage(); + }); + $tw.rootWidget.addEventListener("tm-disable-browser-storage",function(event) { + $tw.wiki.addTiddler({title: ENABLED_TITLE, text: "no"}); + }); // Helpers for protecting storage from eviction var setPersistedState = function(state) { $tw.wiki.addTiddler({title: PERSISTED_STATE_TITLE, text: state}); From 6ae00e49732ded39c69c2b8b2291f1654afae0d4 Mon Sep 17 00:00:00 2001 From: Simon Huber <huber.simon@protonmail.com> Date: Sun, 15 Sep 2024 11:49:09 +0200 Subject: [PATCH 57/66] Improve View Widget Refreshing (#8135) * Update view.js * add viewhandler base class and view subclasses * simplify render methods of wikified views * use fakewidget's text for rendering * simplify wikified refresh methods * remove unneeded self=this * pass mode to makeTranscludeWidget * update view widget * update view widget --- core/modules/widgets/view.js | 434 +++++++++++++++++++++++++---------- 1 file changed, 314 insertions(+), 120 deletions(-) diff --git a/core/modules/widgets/view.js b/core/modules/widgets/view.js index 070836bff..ba0e8e989 100755 --- a/core/modules/widgets/view.js +++ b/core/modules/widgets/view.js @@ -18,6 +18,89 @@ var ViewWidget = function(parseTreeNode,options) { this.initialise(parseTreeNode,options); }; +var ViewHandler = function(widget) { + this.wiki = widget.wiki; + this.widget = widget; + this.document = widget.document; +}; + +/* +Base ViewHandler render method +*/ +ViewHandler.prototype.render = function(parent,nextSibling) { + this.text = this.getValue(); + this.createTextNode(parent,nextSibling); +}; + +/* +Base ViewHandler render method for wikified views +*/ +ViewHandler.prototype.renderWikified = function(parent,nextSibling) { + this.createFakeWidget(); + this.text = this.getValue(); + this.createWikifiedTextNode(parent,nextSibling); +}; + +/* +ViewHandler method to create a simple text node +*/ +ViewHandler.prototype.createTextNode = function(parent,nextSibling) { + if(this.text) { + var textNode = this.document.createTextNode(this.text); + parent.insertBefore(textNode,nextSibling); + this.widget.domNodes.push(textNode); + } else { + this.widget.makeChildWidgets(); + this.widget.renderChildren(parent,nextSibling); + } +}; + +/* +ViewHandler method to always create a text node, even if there's no text +*/ +ViewHandler.prototype.createWikifiedTextNode = function(parent,nextSibling) { + var textNode = this.document.createTextNode(this.text || ""); + parent.insertBefore(textNode,nextSibling); + this.widget.domNodes.push(textNode); +}; + +/* +ViewHandler method to create a fake widget used by wikified views +*/ +ViewHandler.prototype.createFakeWidget = function() { + this.fakeWidget = this.wiki.makeTranscludeWidget(this.widget.viewTitle,{ + document: $tw.fakeDocument, + field: this.widget.viewField, + index: this.widget.viewIndex, + parseAsInline: this.widget.viewMode !== "block", + mode: this.widget.viewMode === "block" ? "block" : "inline", + parentWidget: this.widget, + subTiddler: this.widget.viewSubTiddler + }); + this.fakeNode = $tw.fakeDocument.createElement("div"); + this.fakeWidget.makeChildWidgets(); + this.fakeWidget.render(this.fakeNode,null); +}; + +ViewHandler.prototype.refreshWikified = function(changedTiddlers) { + var refreshed = this.fakeWidget.refresh(changedTiddlers); + if(refreshed) { + var newText = this.getValue(); + if(newText !== this.text) { + this.widget.domNodes[0].textContent = newText; + this.text = newText; + } + } + return refreshed; +}; + +/* +Base ViewHandler refresh method +*/ +ViewHandler.prototype.refresh = function(changedTiddlers) { + return false; +}; + /* Inherit from the base widget class */ @@ -30,14 +113,8 @@ ViewWidget.prototype.render = function(parent,nextSibling) { this.parentDomNode = parent; this.computeAttributes(); this.execute(); - if(this.text) { - var textNode = this.document.createTextNode(this.text); - parent.insertBefore(textNode,nextSibling); - this.domNodes.push(textNode); - } else { - this.makeChildWidgets(); - this.renderChildren(parent,nextSibling); - } + this.view = this.getView(this.viewFormat); + this.view.render(parent,nextSibling); }; /* @@ -52,49 +129,238 @@ ViewWidget.prototype.execute = function() { this.viewFormat = this.getAttribute("format","text"); this.viewTemplate = this.getAttribute("template",""); this.viewMode = this.getAttribute("mode","block"); - switch(this.viewFormat) { - case "htmlwikified": - this.text = this.getValueAsHtmlWikified(this.viewMode); - break; - case "plainwikified": - this.text = this.getValueAsPlainWikified(this.viewMode); - break; - case "htmlencodedplainwikified": - this.text = this.getValueAsHtmlEncodedPlainWikified(this.viewMode); - break; - case "htmlencoded": - this.text = this.getValueAsHtmlEncoded(); - break; - case "htmltextencoded": - this.text = this.getValueAsHtmlTextEncoded(); - break; - case "urlencoded": - this.text = this.getValueAsUrlEncoded(); - break; - case "doubleurlencoded": - this.text = this.getValueAsDoubleUrlEncoded(); - break; - case "date": - this.text = this.getValueAsDate(this.viewTemplate); - break; - case "relativedate": - this.text = this.getValueAsRelativeDate(); - break; - case "stripcomments": - this.text = this.getValueAsStrippedComments(); - break; - case "jsencoded": - this.text = this.getValueAsJsEncoded(); - break; - default: // "text" - this.text = this.getValueAsText(); - break; - } }; /* -The various formatter functions are baked into this widget for the moment. Eventually they will be replaced by macro functions +Initialise the view subclasses */ +ViewWidget.prototype.getView = function(format) { + var View = this.initialiseView(); + View.prototype = Object.create(ViewHandler.prototype); + switch(format) { + case "htmlwikified": + View = this.initialiseHTMLWikifiedView(View); + break; + case "plainwikified": + View = this.initialisePlainWikifiedView(View); + break; + case "htmlencodedplainwikified": + View = this.initialiseHTMLEncodedPlainWikifiedView(View); + break; + case "htmlencoded": + View = this.initialiseHTMLEncodedView(View); + break; + case "htmltextencoded": + View = this.initialiseHTMLTextEncodedView(View); + break; + case "urlencoded": + View = this.initialiseURLEncodedView(View); + break; + case "doubleurlencoded": + View = this.initialiseDoubleURLEncodedView(View); + break; + case "date": + View = this.initialiseDateView(View); + break; + case "relativedate": + View = this.initialiseRelativeDateView(View); + break; + case "stripcomments": + View = this.initialiseStripCommentsView(View); + break; + case "jsencoded": + View = this.initialiseJSEncodedView(View); + break; + default: // "text" + View = this.initialiseTextView(View); + break; + }; + return new View(this); +}; + +/* +Return the function to intitialise the view subclass +*/ +ViewWidget.prototype.initialiseView = function() { + return function(widget) { + ViewHandler.call(this,widget); + }; +}; + +/* +Initialise HTML wikified view methods +*/ +ViewWidget.prototype.initialiseHTMLWikifiedView = function(View) { + + View.prototype.render = function(parent,nextSibling) { + this.renderWikified(parent,nextSibling); + }; + + View.prototype.getValue = function() { + return this.fakeNode.innerHTML; + }; + + View.prototype.refresh = function(changedTiddlers) { + return this.refreshWikified(changedTiddlers); + }; + return View; +}; + +/* +Initialise plain wikified view methods +*/ +ViewWidget.prototype.initialisePlainWikifiedView = function(View) { + + View.prototype.render = function(parent,nextSibling) { + this.renderWikified(parent,nextSibling); + }; + + View.prototype.getValue = function() { + return this.fakeNode.textContent; + }; + + View.prototype.refresh = function(changedTiddlers) { + return this.refreshWikified(changedTiddlers); + }; + return View; +}; + +/* +Initialise HTML encoded plain wikified methods +*/ +ViewWidget.prototype.initialiseHTMLEncodedPlainWikifiedView = function(View) { + + View.prototype.render = function(parent,nextSibling) { + this.renderWikified(parent,nextSibling); + }; + + View.prototype.getValue = function() { + return $tw.utils.htmlEncode(this.fakeNode.textContent); + }; + + View.prototype.refresh = function(changedTiddlers) { + return this.refreshWikified(changedTiddlers); + }; + return View; +}; + +/* +Initialise HTML encoded mehods +*/ +ViewWidget.prototype.initialiseHTMLEncodedView = function(View) { + var self = this; + View.prototype.getValue = function() { + return $tw.utils.htmlEncode(self.getValueAsText()); + }; + return View; +}; + +/* +Initialise HTML text encoded mehods +*/ +ViewWidget.prototype.initialiseHTMLTextEncodedView = function(View) { + var self = this; + View.prototype.getValue = function() { + return $tw.utils.htmlTextEncode(self.getValueAsText()); + }; + return View; +}; + +/* +Initialise URL encoded mehods +*/ +ViewWidget.prototype.initialiseURLEncodedView = function(View) { + var self = this; + View.prototype.getValue = function() { + return $tw.utils.encodeURIComponentExtended(self.getValueAsText()); + }; + return View; +}; + +/* +Initialise double URL encoded mehods +*/ +ViewWidget.prototype.initialiseDoubleURLEncodedView = function(View) { + var self = this; + View.prototype.getValue = function() { + return $tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(self.getValueAsText())); + }; + return View; +}; + +/* +Initialise date mehods +*/ +ViewWidget.prototype.initialiseDateView = function(View) { + var self = this; + View.prototype.getValue = function(format) { + format = format || "YYYY MM DD 0hh:0mm"; + var value = $tw.utils.parseDate(self.getValue()); + if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") { + return $tw.utils.formatDateString(value,format); + } else { + return ""; + } + }; + return View; +}; + +/* +Initialise relative date mehods +*/ +ViewWidget.prototype.initialiseRelativeDateView = function(View) { + var self = this; + View.prototype.getValue = function(format) { + var value = $tw.utils.parseDate(self.getValue()); + if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") { + return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description; + } else { + return ""; + } + }; + return View; +}; + +/* +Initialise stripcomments mehods +*/ +ViewWidget.prototype.initialiseStripCommentsView = function(View) { + var self = this; + View.prototype.getValue = function() { + var lines = self.getValueAsText().split("\n"), + out = []; + for(var line=0; line<lines.length; line++) { + var text = lines[line]; + if(!/^\s*\/\/#/.test(text)) { + out.push(text); + } + } + return out.join("\n"); + }; + return View; +}; + +/* +Initialise JS encoded mehods +*/ +ViewWidget.prototype.initialiseJSEncodedView = function(View) { + var self = this; + View.prototype.getValue = function() { + return $tw.utils.stringify(self.getValueAsText()); + }; + return View; +}; + +/* +Initialise text mehods +*/ +ViewWidget.prototype.initialiseTextView = function(View) { + var self = this; + View.prototype.getValue = function() { + return self.getValueAsText(); + }; + return View; +}; /* Retrieve the value of the widget. Options are: @@ -138,78 +404,6 @@ ViewWidget.prototype.getValueAsText = function() { return this.getValue({asString: true}); }; -ViewWidget.prototype.getValueAsHtmlWikified = function(mode) { - return this.wiki.renderText("text/html","text/vnd.tiddlywiki",this.getValueAsText(),{ - parseAsInline: mode !== "block", - parentWidget: this - }); -}; - -ViewWidget.prototype.getValueAsPlainWikified = function(mode) { - return this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{ - parseAsInline: mode !== "block", - parentWidget: this - }); -}; - -ViewWidget.prototype.getValueAsHtmlEncodedPlainWikified = function(mode) { - return $tw.utils.htmlEncode(this.wiki.renderText("text/plain","text/vnd.tiddlywiki",this.getValueAsText(),{ - parseAsInline: mode !== "block", - parentWidget: this - })); -}; - -ViewWidget.prototype.getValueAsHtmlEncoded = function() { - return $tw.utils.htmlEncode(this.getValueAsText()); -}; - -ViewWidget.prototype.getValueAsHtmlTextEncoded = function() { - return $tw.utils.htmlTextEncode(this.getValueAsText()); -}; - -ViewWidget.prototype.getValueAsUrlEncoded = function() { - return $tw.utils.encodeURIComponentExtended(this.getValueAsText()); -}; - -ViewWidget.prototype.getValueAsDoubleUrlEncoded = function() { - return $tw.utils.encodeURIComponentExtended($tw.utils.encodeURIComponentExtended(this.getValueAsText())); -}; - -ViewWidget.prototype.getValueAsDate = function(format) { - format = format || "YYYY MM DD 0hh:0mm"; - var value = $tw.utils.parseDate(this.getValue()); - if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") { - return $tw.utils.formatDateString(value,format); - } else { - return ""; - } -}; - -ViewWidget.prototype.getValueAsRelativeDate = function(format) { - var value = $tw.utils.parseDate(this.getValue()); - if(value && $tw.utils.isDate(value) && value.toString() !== "Invalid Date") { - return $tw.utils.getRelativeDate((new Date()) - (new Date(value))).description; - } else { - return ""; - } -}; - -ViewWidget.prototype.getValueAsStrippedComments = function() { - var lines = this.getValueAsText().split("\n"), - out = []; - for(var line=0; line<lines.length; line++) { - var text = lines[line]; - if(!/^\s*\/\/#/.test(text)) { - out.push(text); - } - } - return out.join("\n"); -}; - -ViewWidget.prototype.getValueAsJsEncoded = function() { - return $tw.utils.stringify(this.getValueAsText()); -}; - /* Selectively refreshes the widget if needed. Returns true if the widget or any of its children needed re-rendering */ @@ -219,7 +413,7 @@ ViewWidget.prototype.refresh = function(changedTiddlers) { this.refreshSelf(); return true; } else { - return false; + return this.view.refresh(changedTiddlers); } }; From e93515f32a7f96bf4b06990a90cec876308e8ac4 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Sun, 15 Sep 2024 17:49:33 +0800 Subject: [PATCH 58/66] Fix style of codemirror settings page (#8600) A small fix to make its style the same as the TiddlyWiki settings page. --- plugins/tiddlywiki/codemirror/ui/controlpanel/codemirror.tid | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/tiddlywiki/codemirror/ui/controlpanel/codemirror.tid b/plugins/tiddlywiki/codemirror/ui/controlpanel/codemirror.tid index f0e16ddee..29cf88f4c 100644 --- a/plugins/tiddlywiki/codemirror/ui/controlpanel/codemirror.tid +++ b/plugins/tiddlywiki/codemirror/ui/controlpanel/codemirror.tid @@ -13,9 +13,9 @@ list-after: $:/core/ui/ControlPanel/Settings/TiddlyWiki <$list filter="[all[shadows+tiddlers]tag[$:/tags/ControlPanel/Settings/CodeMirror]]"> -<div style="border-top:1px solid #eee;"> +<div class="tc-control-panel-setting" data-setting-title=<<currentTiddler>> > -!! <$link><$transclude field="caption"/></$link> +!!.tc-control-panel-accent <$link><$transclude field="caption"/></$link> <$transclude/> From a510e4ad68994ab16b6e672a89fd20203f77e74d Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Mon, 16 Sep 2024 17:38:27 +0800 Subject: [PATCH 59/66] Use colour-picker macro in Tag Manager (#8606) --- core/ui/TagManager.tid | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/core/ui/TagManager.tid b/core/ui/TagManager.tid index e2d6d2fa8..c14a3f560 100644 --- a/core/ui/TagManager.tid +++ b/core/ui/TagManager.tid @@ -46,6 +46,21 @@ color: #bbb </$reveal> \end +\procedure color-picker-actions() +\whitespace trim +<$action-setfield $tiddler=<<currentTiddler>> color=<<colour-picker-value>>/> +\end + +\procedure color-picker-button() +\whitespace trim +<div class="tc-drop-down-wrapper"> +<$button class="tc-btn-invisible" popup={{{ [[$:/state/tag-manager/color/]addsuffix<currentTiddler>] }}}>{{$:/core/images/palette}}</$button> +<$reveal type="popup" tag="div" class="tc-drop-down" state={{{ [[$:/state/tag-manager/color/]addsuffix<currentTiddler>] }}}> +<$transclude $variable="colour-picker" actions=<<color-picker-actions>>/> +</$reveal> +</div> +\end + \whitespace trim <table class="tc-tag-manager-table"> <tbody> @@ -58,7 +73,7 @@ color: #bbb </tr> <$list filter="[tags[]!is[system]sort[title]]"> <tr> - <td><$edit-text field="color" tag="input" type="color"/></td> + <td><$transclude $variable="color-picker-button"/></td> <td>{{||$:/core/ui/TagTemplate}}</td> <td><$count filter="[all[current]tagging[]]"/></td> <td> From 0f4d6e4e471d71b26bc993511311401890a77cb9 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Mon, 16 Sep 2024 17:38:55 +0800 Subject: [PATCH 60/66] Fix extra p tag in colour-picker (#8605) --- core/wiki/macros/colour-picker.tid | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/wiki/macros/colour-picker.tid b/core/wiki/macros/colour-picker.tid index 1ff1e7b90..7a607a551 100644 --- a/core/wiki/macros/colour-picker.tid +++ b/core/wiki/macros/colour-picker.tid @@ -10,9 +10,7 @@ tags: $:/tags/Macro \define colour-picker-inner(actions) <$button tag="a" tooltip="""$(colour-picker-value)$"""> - $(colour-picker-update-recent)$ - <$transclude $variable="__actions__"/> <span style="display:inline-block; background-color: $(colour-picker-value)$; width: 100%; height: 100%; border-radius: 50%;"/> From 19990802fa75345bb16a118d46ef6f65c80e21d7 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Mon, 16 Sep 2024 17:39:50 +0800 Subject: [PATCH 61/66] Fix missing tiddler with code body isn't displayed properly. (#8604) --- core/ui/ViewTemplate/body/code.tid | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/ui/ViewTemplate/body/code.tid b/core/ui/ViewTemplate/body/code.tid index 9d2250395..ac678dd53 100644 --- a/core/ui/ViewTemplate/body/code.tid +++ b/core/ui/ViewTemplate/body/code.tid @@ -1,4 +1,8 @@ title: $:/core/ui/ViewTemplate/body/code +<%if [<currentTiddler>is[missing]] %> +<$transclude tiddler="$:/language/MissingTiddler/Hint"/> +<%else%> <$transclude $variable="copy-to-clipboard-above-right" src={{{ [<currentTiddler>get[text]] }}} /> <$codeblock code={{{ [<currentTiddler>get[text]] }}} language={{{ [<currentTiddler>get[type]else[text/vnd.tiddlywiki]] }}}/> +<%endif%> \ No newline at end of file From 6dbdbfbe8224985a53aaf93b2308f5bfd2a52143 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Mon, 16 Sep 2024 20:24:58 +0800 Subject: [PATCH 62/66] Fix overflow in table and table-of-contents (#8608) Another approach fix overflow. --- themes/tiddlywiki/vanilla/base.tid | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 65c1a5fe3..4a4867c0b 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -2779,6 +2779,20 @@ a.tc-tiddlylink.tc-plugin-info:hover > .tc-plugin-info-chunk .tc-plugin-info-sta display: table; } +/* Fix overflow in table and toc */ +.tc-tiddler-body .tc-tabbed-table-of-contents { + overflow-x: auto; +} + +.tc-tiddler-body > table { + display: block; + overflow: auto; +} +.tc-tiddler-body > table tbody { + display: table; + width: 100%; +} + /* ** Chooser */ From 0222d4df7c633088e92709fcb592b17725e8758c Mon Sep 17 00:00:00 2001 From: Maurycy Zarzycki <maurycy@evidentlycube.com> Date: Tue, 17 Sep 2024 08:48:32 +0200 Subject: [PATCH 63/66] Add translation changes to Polish from commits: (#8612) * ece8b0ee01f04f9a88066d48500f41bc3765dfff * 5aa3646df5349acc097a2198e47177fc15daa02e * c8cbf6853ecb9e634a65ee3120d4cf41415dd4b2 * 18152aa7c8a4961da0b0fe31565693c515517880 * d2302df197cc2ade1684055cd26c708c1cda496a * 8735d1ac93054c54459832fcc8252ac4d6fa03d2 * 82bf4480de5784eaf4dd07249013ba9e435063c1 * 3af2a0ae6f95cbe76381ab1125f4a29632cf4178 * 57d3e8e765cda7dadce9f021a5caab2dcfb9b4a8 * 5c43512a56b9e08e680ad555439d8932ea2b9164 * 98cd4a09b4edd5e73107573e6cf075a4bb7a1cba * 98d411c08a3511cbed4b0c70422dd2b8bb5d546a --- core/language/en-GB/Misc.multids | 2 +- languages/pl-PL/Buttons.multids | 4 ++++ languages/pl-PL/ControlPanel.multids | 16 ++++++++++++++++ languages/pl-PL/Docs/PaletteColours.multids | 7 +++++++ languages/pl-PL/EditTemplate.multids | 1 + languages/pl-PL/Fields.multids | 1 + languages/pl-PL/Misc.multids | 2 ++ languages/pl-PL/Search.multids | 2 ++ languages/pl-PL/Snippets/FunctionDefinition.tid | 7 +++++++ languages/pl-PL/Snippets/ProcedureDefinition.tid | 7 +++++++ .../pl-PL/Types/text_vnd.tiddlywiki_multiple.tid | 6 ++++++ 11 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 languages/pl-PL/Snippets/FunctionDefinition.tid create mode 100644 languages/pl-PL/Snippets/ProcedureDefinition.tid create mode 100644 languages/pl-PL/Types/text_vnd.tiddlywiki_multiple.tid diff --git a/core/language/en-GB/Misc.multids b/core/language/en-GB/Misc.multids index d8c091375..2a771e090 100644 --- a/core/language/en-GB/Misc.multids +++ b/core/language/en-GB/Misc.multids @@ -42,7 +42,7 @@ Error/RetrievingSkinny: Error retrieving skinny tiddler list Error/SavingToTWEdit: Error saving to TWEdit Error/WhileSaving: Error while saving Error/XMLHttpRequest: XMLHttpRequest error code -Error/ZoominTextNode: Story View Error: It appears you tried to interact with a tiddler that displays in a custom container. This is most likely caused by using `$:/tags/StoryTiddlerTemplateFilter` with a template that contains text or whitespace at the start. Please use the pragma `\whitespace trim` and ensure the whole contents of the tiddler is wrapped in a single HTML element. The text that caused this issue: +Error/ZoominTextNode: Błąd Widoku: Wykryto błędną interakcję z tiddlerem, który wyświetlany jest w niestandardowym kontenerze. Jest to najprawdopodobniej spowodowane użyciem `$:/tags/StoryTiddlerTemplateFilter` z motywem, który ma tekst lub białe znaki na początku. Użyj pragmy `\whitespace trim` i upewnij się, że cała treść tiddlera opakowana jest w jeden element HTML. Tekst, który spowodał problem: InternalJavaScriptError/Title: Internal JavaScript Error InternalJavaScriptError/Hint: Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser LayoutSwitcher/Description: Open the layout switcher diff --git a/languages/pl-PL/Buttons.multids b/languages/pl-PL/Buttons.multids index 911559337..07d44db5a 100644 --- a/languages/pl-PL/Buttons.multids +++ b/languages/pl-PL/Buttons.multids @@ -79,6 +79,7 @@ NewMarkdown/Caption: nowy Markdown tiddler NewMarkdown/Hint: Stwórz nowego tiddlera o typie Markdown NewTiddler/Caption: nowy tiddler NewTiddler/Hint: Stwórz nowego tiddlera +OpenControlPanel/Hint: Otwórz panel kontrolny OpenWindow/Caption: otwórz w nowym oknie OpenWindow/Hint: Otwórz tego tiddlera w nowym oknie Palette/Caption: paleta @@ -103,6 +104,8 @@ ShowSideBar/Caption: pokaż menu boczne ShowSideBar/Hint: Pokaż menu boczne TagManager/Caption: menedżer tagów TagManager/Hint: Otwórz menedżer tagów +TestCaseImport/Caption: importuj tiddlery +TestCaseImport/Hint: Importuj tiddlery Timestamp/Caption: aktualizacje czasu Timestamp/Hint: Wybierz czy zmiany mają aktualizować czas Timestamp/On/Caption: zmiany czasu są włączone @@ -129,6 +132,7 @@ Excise/Caption/Replace/Link: link Excise/Caption/Replace/Transclusion: transkluzja Excise/Caption/Tag: Otaguj nowego tiddlera nazwą tego Excise/Caption/TiddlerExists: Uwaga: tiddler już istnieje +Excise/DefaultTitle: Nowe Wycięcie Excise/Hint: Wytnij zaznaczony tekst i wstaw go do nowego tidlera Heading1/Caption: nagłówek 1 Heading1/Hint: Zmień zaznaczony tekst na nagłówek 1. stopnia diff --git a/languages/pl-PL/ControlPanel.multids b/languages/pl-PL/ControlPanel.multids index 2ee8983c2..220de0267 100644 --- a/languages/pl-PL/ControlPanel.multids +++ b/languages/pl-PL/ControlPanel.multids @@ -198,6 +198,12 @@ Settings/TitleLinks/Yes/Description: Wyświetlaj nazwy jako linki Settings/MissingLinks/Caption: Wiki Linki Settings/MissingLinks/Hint: Wybierz czy linkować do nieistniejących jeszcze tiddlerów Settings/MissingLinks/Description: Włacz linowanie do nieistniejących tiddlerów +SocialCard/Caption: Karta Mediów Społecznościowych +SocialCard/Domain/Prompt: Domena wyświetlana przy linku (np, ''tiddlywiki.com'') +SocialCard/Hint: Informacje wykorzysytwane przez media społecznościowe i komunikatury by wyświetlić kartę z podglądem link do tej TiddlyWiki przy wklejeniu linka +SocialCard/PreviewUrl/Prompt: Pełen adres do obrazka podglądku dla tej TiddlyWiki +SocialCard/PreviewUrl/Preview: Podgląd obrazka: +SocialCard/Url/Prompt: Pełen adres do tej TiddlyWiki StoryTiddler/Caption: Widok Tiddlera StoryTiddler/Hint: Ta kaskada określa szablon używany podczas wyświetlania tiddlera w Story River. StoryView/Caption: Widok Story River @@ -206,6 +212,12 @@ Stylesheets/Caption: Style: Stylesheets/Expand/Caption: Rozwiń Wszystko Stylesheets/Hint: To jest wyrenderowany CSS obecnych tiddlerów otagowanych jako <<tag "$:/tags/Stylesheet">> Stylesheets/Restore/Caption: Przywróć +TestCases/Caption: Przypadki Testowe +TestCases/Hint: Przypadki testowe służą do nauki oraz testowania systemu +TestCases/All/Caption: Wszystkie Przypadki Testowe +TestCases/All/Hint: Wszystkie Przypadki Testowe +TestCases/Failed/Caption: Nieudane Przypadki Testowe +TestCases/Failed/Hint: Tylko Nieudane Przypadki Testowe Theme/Caption: Motyw Theme/Prompt: Obecny motyw: TiddlerFields/Caption: Pola tiddlerów @@ -229,3 +241,7 @@ ViewTemplateBody/Caption: Treść Wyświetlanego Tiddlera ViewTemplateBody/Hint: Ta kaskada określa szablon wyświetlania treści tiddlera (czyli jego tekstu, w przeciwieństwie do kaskady 'Widok Tiddlera'). ViewTemplateTitle/Caption: Tytuł Wyświetlanego Tiddlera ViewTemplateTitle/Hint: Ta kaskada określa szablon wyświetlania tytułu tiddlera. +ViewTemplateSubtitle/Caption: Podtytuł Wyświetlanego Tiddlera +ViewTemplateSubtitle/Hint: Ta kaskada określa szablon wyświetlania podtytułu tiddlera. +ViewTemplateTags/Caption: Tagi Wyświetlanego Tiddlera +ViewTemplateTags/Hint: Ta kaskada określa szablon wyświetlania tagów tiddlera. \ No newline at end of file diff --git a/languages/pl-PL/Docs/PaletteColours.multids b/languages/pl-PL/Docs/PaletteColours.multids index 2fe037cfb..be660c954 100644 --- a/languages/pl-PL/Docs/PaletteColours.multids +++ b/languages/pl-PL/Docs/PaletteColours.multids @@ -65,6 +65,13 @@ sidebar-tab-foreground-selected: Tekst wybranej zakładki w menu bocznym sidebar-tab-foreground: Tekst zakładki w menu bocznym sidebar-tiddler-link-foreground-hover: Tekst po najechaniu linku do tiddlera w menu bocznym sidebar-tiddler-link-foreground: Tekst linka do tiddlera w menu bocznym +stability-stable: Odznaka dla stanu wtyczki "stabilna" (stable) +stability-experimental: Odznaka dla stanu wtyczki "eksperymentalna" (experimental) +stability-deprecated: Odznaka dla stanu wtyczki "wycofana" (deprecated) +stability-legacy: Odznaka dla stanu wtyczki "stara" (legacy) +testcase-accent-level-1: Akcent kolorystyczny niezagnieżdzonego przypadku testowego +testcase-accent-level-2: Akcent kolorystyczny pojedynczo zagnieżdzonego przypadku testowego +testcase-accent-level-3: Akcent kolorystyczny podwójnie zagnieżdzonego przypadku testowego site-title-foreground: Tekst nazwy strony static-alert-foreground: Tekst statycznego alertu tab-background-selected: Tło wybranej zakładki diff --git a/languages/pl-PL/EditTemplate.multids b/languages/pl-PL/EditTemplate.multids index ca3590d4d..6d581fd52 100644 --- a/languages/pl-PL/EditTemplate.multids +++ b/languages/pl-PL/EditTemplate.multids @@ -26,6 +26,7 @@ Tags/ClearInput/Caption: wyczyść Tags/ClearInput/Hint: Wyczyść tagi Tags/Dropdown/Caption: lista tagów Tags/Dropdown/Hint: Pokaż listę tagów +Tags/EmptyMessage: (brak wyników) Title/BadCharacterWarning: Uwaga: unikaj używania któregokolwiek z tych znaków w nazwach tiddlerów: <<bad-chars>> Title/Exists/Prompt: Docelowy tiddler już istnieje Title/Relink/Prompt: Zaktualizuj ''<$text text=<<fromTitle>>/>'' na ''<$text text=<<toTitle>>/>'' w //tagach// i //listach// pól innych tiddlerów diff --git a/languages/pl-PL/Fields.multids b/languages/pl-PL/Fields.multids index 6b1fe1c41..cab393782 100644 --- a/languages/pl-PL/Fields.multids +++ b/languages/pl-PL/Fields.multids @@ -29,6 +29,7 @@ name: Czytelna nazwa powiązana z tiddlerem wtyczki parent-plugin: Określa nadrzędną wtyczkę plugin-priority: Numeryczna wartość określająca tiddlera wtyczki plugin-type: Typ tiddlera wtyczki +stability: Stan rozwoju wtyczki: wycofany (deprecated), eksperymentalny (experimental), stabilny (stable), stary (legacy) revision: Numer rewizji tiddlera przechowywany na serwerze released: Data wydania TiddlyWiki source: URL źródłowy powiązany z tiddlerem diff --git a/languages/pl-PL/Misc.multids b/languages/pl-PL/Misc.multids index 211798bc8..9e26d5897 100644 --- a/languages/pl-PL/Misc.multids +++ b/languages/pl-PL/Misc.multids @@ -42,6 +42,7 @@ Error/RetrievingSkinny: Bład przy pobieraniu listy tiddlerów Error/SavingToTWEdit: Bład przy zapisywaniu do TWEdit Error/WhileSaving: Bład przy zapisywaniu Error/XMLHttpRequest: Kod błedu XMLHttpRequest +Error/ZoominTextNode: Story View Error: It appears you tried to interact with a tiddler that displays in a custom container. This is most likely caused by using `$:/tags/StoryTiddlerTemplateFilter` with a template that contains text or whitespace at the start. Please use the pragma `\whitespace trim` and ensure the whole contents of the tiddler is wrapped in a single HTML element. The text that caused this issue: InternalJavaScriptError/Title: Wewnętrzny bład JavaScript InternalJavaScriptError/Hint: Ups, to się nie powinno zdarzyć. Zalecamy ponowne uruchomienie TiddlyWiki poprzez odświeżenie strony w przeglądarce. LayoutSwitcher/Description: Otwórzy wybór motywu @@ -70,6 +71,7 @@ OfficialPluginLibrary: Oficjalna Biblioteka Wtyczek ~TiddlyWiki OfficialPluginLibrary/Hint: Oficjalna biblioteka wtyczek ~TiddlyWiki z tiddlywiki.com. Wtyczki, motywi i paczki językowe są utrzymywane przez główny zespół TiddlyWiki. PageTemplate/Description: domyślny motyw ~TiddlyWiki PageTemplate/Name: Domyślny szablon strony +PluginReloadWarning: Zapisz {{$:/core/ui/Buttons/save-wiki}} i odśwież {{$:/core/ui/Buttons/refresh}} ~TiddlyWiki by zastosować zmiany we wtyczkach używajacych ~JavaScriptu RecentChanges/DateFormat: 0DD-0MM-YYYY Shortcuts/Input/AdvancedSearch/Hint: Otwórzy panel zaawansowanego wyszukiwania z poziomu menu bocznego Shortcuts/Input/Accept/Hint: Zaakceptuj zaznaczenia diff --git a/languages/pl-PL/Search.multids b/languages/pl-PL/Search.multids index dd635338d..a9a77ac18 100644 --- a/languages/pl-PL/Search.multids +++ b/languages/pl-PL/Search.multids @@ -6,6 +6,8 @@ Filter/Hint: Szukaj przy pomocy [[wyrażenia filtrującego|https://tiddlywiki.co Filter/Matches: //<small>trafienia: <<resultCount>></small>// Matches: //<small>trafienia: <<resultCount>></small>// Matches/All: Wszystkie trafienia +Matches/NoMatch: //Brak trafień// +Matches/NoResult: //Brak wyników// Matches/Title: Trafienia w nazwach: Search: Szukaj Search/TooShort: Zbyt krótki tekst wyszukiwania diff --git a/languages/pl-PL/Snippets/FunctionDefinition.tid b/languages/pl-PL/Snippets/FunctionDefinition.tid new file mode 100644 index 000000000..5f6436f46 --- /dev/null +++ b/languages/pl-PL/Snippets/FunctionDefinition.tid @@ -0,0 +1,7 @@ +title: $:/language/Snippets/FunctionDefinition +tags: $:/tags/TextEditor/Snippet +caption: Definicja funkcji + +\function f.name(param1,param2:"default value") [<param1>!is[blank]else<param2>] + +<<f.name>> \ No newline at end of file diff --git a/languages/pl-PL/Snippets/ProcedureDefinition.tid b/languages/pl-PL/Snippets/ProcedureDefinition.tid new file mode 100644 index 000000000..a74204f58 --- /dev/null +++ b/languages/pl-PL/Snippets/ProcedureDefinition.tid @@ -0,0 +1,7 @@ +title: $:/language/Snippets/ProcedureDefinition +tags: $:/tags/TextEditor/Snippet +caption: Definicja procedury + +\procedure procName(param1:"default value",param2) +Wstaw tekstu tutaj. +\end \ No newline at end of file diff --git a/languages/pl-PL/Types/text_vnd.tiddlywiki_multiple.tid b/languages/pl-PL/Types/text_vnd.tiddlywiki_multiple.tid new file mode 100644 index 000000000..678b748ea --- /dev/null +++ b/languages/pl-PL/Types/text_vnd.tiddlywiki_multiple.tid @@ -0,0 +1,6 @@ + +title: $:/language/Docs/Types/text/vnd.tiddlywiki-multiple +description: Zbiorczy tiddler +name: text/vnd.tiddlywiki-multiple +group: Developer +group-sort: 2 \ No newline at end of file From 8d80ff297c75232b1a75ae15d9a869d36d5f7f33 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 17 Sep 2024 14:51:13 +0800 Subject: [PATCH 64/66] Fix colour-picker dropdown auto close when selecting or typing a color (#8610) --- core/ui/TagManager.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/TagManager.tid b/core/ui/TagManager.tid index c14a3f560..e554d66cc 100644 --- a/core/ui/TagManager.tid +++ b/core/ui/TagManager.tid @@ -55,7 +55,7 @@ color: #bbb \whitespace trim <div class="tc-drop-down-wrapper"> <$button class="tc-btn-invisible" popup={{{ [[$:/state/tag-manager/color/]addsuffix<currentTiddler>] }}}>{{$:/core/images/palette}}</$button> -<$reveal type="popup" tag="div" class="tc-drop-down" state={{{ [[$:/state/tag-manager/color/]addsuffix<currentTiddler>] }}}> +<$reveal type="popup" tag="div" class="tc-drop-down tc-popup-keep" state={{{ [[$:/state/tag-manager/color/]addsuffix<currentTiddler>] }}}> <$transclude $variable="colour-picker" actions=<<color-picker-actions>>/> </$reveal> </div> From 73225d09d7568b450652ad9b73f702d9d0eed783 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 17 Sep 2024 14:52:46 +0800 Subject: [PATCH 65/66] Fix shadow tiddler with code body displayed as missing (#8609) Fix problem introduced in #8604 --- core/ui/ViewTemplate/body/code.tid | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/ui/ViewTemplate/body/code.tid b/core/ui/ViewTemplate/body/code.tid index ac678dd53..380df84b7 100644 --- a/core/ui/ViewTemplate/body/code.tid +++ b/core/ui/ViewTemplate/body/code.tid @@ -1,6 +1,6 @@ title: $:/core/ui/ViewTemplate/body/code -<%if [<currentTiddler>is[missing]] %> +<%if [<currentTiddler>is[missing]] :and[!is[shadow]] %> <$transclude tiddler="$:/language/MissingTiddler/Hint"/> <%else%> <$transclude $variable="copy-to-clipboard-above-right" src={{{ [<currentTiddler>get[text]] }}} /> From c38641157088fdd76b357edf0a71fe250eed2937 Mon Sep 17 00:00:00 2001 From: Leilei332 <LeiYiXia29@outlook.com> Date: Tue, 17 Sep 2024 20:16:18 +0800 Subject: [PATCH 66/66] Make stability badge text translatable (#8614) --- core/language/en-GB/ControlPanel.multids | 4 ++++ core/ui/Components/plugin-info.tid | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/language/en-GB/ControlPanel.multids b/core/language/en-GB/ControlPanel.multids index a1b164c5c..7adf4aa04 100644 --- a/core/language/en-GB/ControlPanel.multids +++ b/core/language/en-GB/ControlPanel.multids @@ -96,6 +96,10 @@ Plugins/PluginWillRequireReload: (requires reload) Plugins/Plugins/Caption: Plugins Plugins/Plugins/Hint: Plugins Plugins/Reinstall/Caption: reinstall +Plugins/Stability/Deprecated: DEPRECATED +Plugins/Stability/Experimental: EXPERIMENTAL +Plugins/Stability/Legacy: LEGACY +Plugins/Stability/Stable: STABLE Plugins/Themes/Caption: Themes Plugins/Themes/Hint: Theme plugins Plugins/Update/Caption: update diff --git a/core/ui/Components/plugin-info.tid b/core/ui/Components/plugin-info.tid index d7f408bd9..50766e51d 100644 --- a/core/ui/Components/plugin-info.tid +++ b/core/ui/Components/plugin-info.tid @@ -47,13 +47,13 @@ $:/config/Plugins/Disabled/$(currentTiddler)$ <h2> <div> <%if [<currentTiddler>get[stability]match[STABILITY_0_DEPRECATED]] %> - <span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated">DEPRECATED</span> + <span class="tc-plugin-info-stability tc-plugin-info-stability-deprecated"><<lingo "Stability/Deprecated">></span> <%elseif [<currentTiddler>get[stability]match[STABILITY_1_EXPERIMENTAL]] %> - <span class="tc-plugin-info-stability tc-plugin-info-stability-experimental">EXPERIMENTAL</span> + <span class="tc-plugin-info-stability tc-plugin-info-stability-experimental"><<lingo "Stability/Experimental">></span> <%elseif [<currentTiddler>get[stability]match[STABILITY_2_STABLE]] %> - <span class="tc-plugin-info-stability tc-plugin-info-stability-stable">STABLE</span> + <span class="tc-plugin-info-stability tc-plugin-info-stability-stable"><<lingo "Stability/Stable">></span> <%elseif [<currentTiddler>get[stability]match[STABILITY_3_LEGACY]] %> - <span class="tc-plugin-info-stability tc-plugin-info-stability-legacy">LEGACY</span> + <span class="tc-plugin-info-stability tc-plugin-info-stability-legacy"><<lingo "Stability/Legacy">></span> <%endif%> <em><$view field="version"/></em></div> </h2>