From d5030eb87b7a21c5b76978aeed819eedc4740245 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Tue, 14 Jun 2022 09:45:49 +0100 Subject: [PATCH 1/3] Prevent Chrome from offering password autocomplete for search boxes Fixes #6723 --- core/ui/SideBarSegments/search.tid | 2 ++ plugins/tiddlywiki/menubar/items/search.tid | 2 ++ 2 files changed, 4 insertions(+) diff --git a/core/ui/SideBarSegments/search.tid b/core/ui/SideBarSegments/search.tid index 91d4fe922..baa0be649 100644 --- a/core/ui/SideBarSegments/search.tid +++ b/core/ui/SideBarSegments/search.tid @@ -51,12 +51,14 @@ tags: $:/tags/SideBarSegment <$keyboard key="((input-tab-right))" actions=<>> <$keyboard key="((input-tab-left))" actions=<>> <$keyboard key="((advanced-search-sidebar))" actions=<>> +
<$macrocall $name="keyboard-driven-input" tiddler=<> storeTitle=<> selectionStateTitle=<> refreshTitle="$:/temp/search/refresh" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<> class="tc-popup-handle" filterMinLength={{$:/config/Search/MinLength}} inputCancelActions=<> inputAcceptActions=<> inputAcceptVariantActions=<> cancelPopups="yes" configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]"/> + diff --git a/plugins/tiddlywiki/menubar/items/search.tid b/plugins/tiddlywiki/menubar/items/search.tid index df4cad072..9d228d7a2 100644 --- a/plugins/tiddlywiki/menubar/items/search.tid +++ b/plugins/tiddlywiki/menubar/items/search.tid @@ -23,11 +23,13 @@ tags: $:/tags/MenuBar <$keyboard key="((input-tab-right))" actions=<>> <$keyboard key="((input-tab-left))" actions=<>> +
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/menubarsearch" storeTitle=<> selectionStateTitle=<> refreshTitle="$:/temp/menubarsearch/refresh" tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown" class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes" inputAcceptActions=<> inputAcceptVariantActions=<> inputCancelActions=<> filterMinLength={{$:/config/Search/MinLength}} configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" /> +
From a29889a7412fcba45d7779e8a8ee9ca91b499946 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Fri, 17 Jun 2022 14:03:36 +0100 Subject: [PATCH 2/3] Fix layout bug introduced in d5030eb87b7a21c5b76978aeed819eedc4740245 Thanks @pmario --- core/ui/SideBarSegments/search.tid | 2 +- plugins/tiddlywiki/menubar/items/search.tid | 2 +- themes/tiddlywiki/vanilla/base.tid | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/core/ui/SideBarSegments/search.tid b/core/ui/SideBarSegments/search.tid index baa0be649..938cedfd1 100644 --- a/core/ui/SideBarSegments/search.tid +++ b/core/ui/SideBarSegments/search.tid @@ -51,7 +51,7 @@ tags: $:/tags/SideBarSegment <$keyboard key="((input-tab-right))" actions=<>> <$keyboard key="((input-tab-left))" actions=<>> <$keyboard key="((advanced-search-sidebar))" actions=<>> -
+ <$macrocall $name="keyboard-driven-input" tiddler=<> storeTitle=<> selectionStateTitle=<> refreshTitle="$:/temp/search/refresh" type="search" tag="input" focus={{$:/config/Search/AutoFocus}} focusPopup=<> diff --git a/plugins/tiddlywiki/menubar/items/search.tid b/plugins/tiddlywiki/menubar/items/search.tid index 9d228d7a2..e40f27ab5 100644 --- a/plugins/tiddlywiki/menubar/items/search.tid +++ b/plugins/tiddlywiki/menubar/items/search.tid @@ -23,7 +23,7 @@ tags: $:/tags/MenuBar <$keyboard key="((input-tab-right))" actions=<>> <$keyboard key="((input-tab-left))" actions=<>> - + <$macrocall $name="keyboard-driven-input" tiddler="$:/temp/menubarsearch" storeTitle=<> selectionStateTitle=<> refreshTitle="$:/temp/menubarsearch/refresh" tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown" class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes" diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 774e3ee69..a530bb274 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -279,6 +279,10 @@ kbd { color: <>; } +form.tc-form-inline { + display: inline; +} + /* Markdown likes putting code elements inside pre elements */ From 0391e1855cd5c770928a3b4252aef54ed0a51385 Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Thu, 16 Jun 2022 17:00:20 +0100 Subject: [PATCH 3/3] Fix new selection tracker to return relative coordinates --- plugins/tiddlywiki/dynannotate/modules/selection-tracker.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/tiddlywiki/dynannotate/modules/selection-tracker.js b/plugins/tiddlywiki/dynannotate/modules/selection-tracker.js index 616bedd29..6b74d0c4b 100644 --- a/plugins/tiddlywiki/dynannotate/modules/selection-tracker.js +++ b/plugins/tiddlywiki/dynannotate/modules/selection-tracker.js @@ -139,9 +139,9 @@ SelectionTracker.prototype.handleSelectionChange = function() { var variables = {}; // Get the bounds of the container and the selection var selectionRectangle = selection.getRangeAt(0).getBoundingClientRect(), - trackingRectangle = anchor.container.parentNode.getBoundingClientRect(); - variables["tv-selection-posx"] = (selectionRectangle.left).toString(); - variables["tv-selection-posy"] = (selectionRectangle.top).toString(); + offsetParentRectangle = anchor.container.offsetParent.getBoundingClientRect(); + variables["tv-selection-posx"] = (selectionRectangle.left - offsetParentRectangle.left).toString(); + variables["tv-selection-posy"] = (selectionRectangle.top - offsetParentRectangle.top).toString(); variables["tv-selection-width"] = (selectionRectangle.width).toString(); variables["tv-selection-height"] = (selectionRectangle.height).toString(); variables["tv-selection-coords"] = "(" + variables["tv-selection-posx"] + "," + variables["tv-selection-posy"] + "," + variables["tv-selection-width"] + "," + variables["tv-selection-height"] + ")";