From e1b3308a9ddafebd7352d76b7480037d50515008 Mon Sep 17 00:00:00 2001 From: Mario Pietsch Date: Mon, 9 Sep 2024 10:48:57 +0200 Subject: [PATCH] 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 -
+

<$text text=<>/>

-
+
<$link to={{!!modifier}}> <$view field="modifier"/> <$view field="modified" format="date" template={{$:/language/Tiddler/DateFormat}}/>
-
+
<$list filter="[all[current]tags[]sort[title]]"> encodeuricomponent[]] }}}> <$macrocall $name="tag-pill" tag=<>/>
-
+
<$transclude mode="block"/>
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 -
+
<$view field="title"/> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditToolbar]!has[draft.of]]" variable="listItem"> @@ -14,5 +14,4 @@ tags: $:/tags/EditTemplate -
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=<> text="hide" retain="yes" animate="yes"> +<$reveal tag="div" class="tc-tiddler-body tc-clearfix" type="nomatch" stateTitle=<> text="hide" retain="yes" animate="yes"> <$transclude tiddler={{{ [] :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=<> text="hide" tag="div" retain="yes" animate="yes"> -
+
<$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate/Subtitle]!has[draft.of]]" variable="subtitleTiddler"> <$transclude tiddler=<> mode="inline"/><$list-join>  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)$; -
+
<$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 [img width=140 [Tiddlyhost Logo]] [[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. - -
\ 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 [img width=340 [Xememex Logo]] @@ -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. - -
\ 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 -
+
-
+
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=<>> -
-
+
+
<$list filter="[match[yes]]" variable="ignore"> @@ -94,12 +94,12 @@ color:$(foregroundColor)$;
-
+
<$list filter="[all[current]tags[]sort[title]]" storyview="pop"> <>
-
+
<$transclude field="text" mode="block"/>
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=<>>
-
+
<$list filter="[match[yes]]" variable="ignore"> @@ -15,7 +15,7 @@ title: $:/plugins/tiddlywiki/tour/simplified-tiddler
-
+
<$transclude field="text" mode="block"/>
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; } +