rudimentary find-on-page support for TD

138 views
Skip to first unread message

Simon Huber

unread,
Feb 25, 2019, 8:03:21 PM2/25/19
to TiddlyWikiDev


Hi there,

I've created this little demo here: http://find-on-page-test.tiddlyspot.com/

It allows to find words on the page using a very simple action-widget

it uses window.find() which isn't supported by all browsers but it works in TiddlyDesktop


ctrl-f opens a search panel,
ctrl-g / ctrl-shift-g cycle through the matches


what I've noticed is that matches on tags are found but the selection isn't visible


I'd like to make this work similar to the browser native behavior, that shows all matches selected and the "cycle-match" in a highlight color, but I'm not sure if that's that easy

... anyway, I think many users would be happy about a small tiddlydesktop upgrade in this direction


what do you think?

TonyM

unread,
Feb 25, 2019, 8:20:58 PM2/25/19
to TiddlyWikiDev
Simon,

I am not sure what problem this is solving. In Both Chrome and FireFox Ctrl-f opens find, F3 moves to the next and shift-f3 moves to the last.

Was it just you did not know about f3 so created ctrl-g ? or is F3 not working on TiddlyDesktop?

Firefox even tells you the number found.

Regards
Tony

Simon Huber

unread,
Feb 26, 2019, 8:49:09 AM2/26/19
to TiddlyWikiDev
Simon,

I am not sure what problem this is solving. In Both Chrome and FireFox Ctrl-f opens find, F3 moves to the next and shift-f3 moves to the last.

Was it just you did not know about f3 so created ctrl-g ? or is F3 not working on TiddlyDesktop?

:o) did you try to search on the page in TiddlyDesktop?

Sure, this tries to emulate browser-behavior and finally I'd also like to have a count with matches.
It's for our main tiddlywiki browser without search-on-page working ... TiddlyDesktop. I should have probably stated that more precisely  ^^

TonyM

unread,
Feb 27, 2019, 5:18:50 AM2/27/19
to TiddlyWikiDev
Simon,

Jeremy is the author of tiddlydesktop. It uses a cutdown browser to opperate, I know he was reluctant to add more and more such that it would become a browser but you may be able to persuade him to add this if its practical to do so in a future release.

Regards
Tony

Simon Huber

unread,
Feb 27, 2019, 7:33:04 AM2/27/19
to TiddlyWikiDev
Hi Tony, yeah I know about this little interest conflict. But search-on-page is not a browser-only thing. An address bar would be I guess, this is just functionality for the notebook/application itself 

@TiddlyTweeter

unread,
Feb 27, 2019, 8:24:12 AM2/27/19
to TiddlyWikiDev
Anyone who wants to help JR on TD gets my vote. 

Its a superb solution for desktop users.

MY main concern has been to encourage a fully portable build of it (i.e. that you can use relative addressing to wiki). That would permit repackaging of the app with content wiki. I would definitely use it  ...

Josiah

@TiddlyTweeter

unread,
Feb 27, 2019, 8:27:01 AM2/27/19
to TiddlyWikiDev
Back to topic ... I'll experiment with your search tool in TD and report back.

A dopo
Josiah

@TiddlyTweeter

unread,
Feb 27, 2019, 11:05:16 AM2/27/19
to TiddlyWikiDev
Just NOTING TiddlyDesktop is an awesome install at 250Mb before you even do anything.

@TiddlyTweeter

unread,
Feb 27, 2019, 11:14:48 AM2/27/19
to TiddlyWikiDev
Simon Huber wrote:
I've created this little demo here: http://find-on-page-test.tiddlyspot.com/

It allows to find words on the page using a very simple action-widget

.... what I've noticed is that matches on tags are found but the selection isn't visible.
 
Right. I'm doubtful its workable without visual feedback. I tried. I failed.

Josiah

Simon Huber

unread,
Feb 27, 2019, 11:23:56 AM2/27/19
to TiddlyWikiDev
I have a solution for that, it's just not updated online. The problem is that elements that are draggable (that have the draggable attr. ="true") cannot be found.

My solution is to change the TagTemplate and put a condition inside that  shows tags without dragFilter (which removes the draggable attr.) when the search panel is open.
That would probably work best when it would be a popup, so the condition would be: when that popup state tiddler is present, no dragFilter for tags.
problem: we cannot create popups using keyboard shortcuts, which would be very useful here.
solution: I could add my action-popup widget here

Jeremy Ruston

unread,
Feb 27, 2019, 12:33:52 PM2/27/19
to tiddly...@googlegroups.com
Just to clarify, I'm all in favour of having find-in-page in TiddlyDesktop, and welcome any help. I think Simon's approach is a promising one: to make a find-in-page that works in a standalone TW. The other approach is to extend TiddlyDesktop itself with the functionality.

Best wishes

--
You received this message because you are subscribed to the Google Groups "TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywikide...@googlegroups.com.
To post to this group, send email to tiddly...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywikidev.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywikidev/04c03038-d9bb-4a0c-a0a1-b1b2e165a402%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Simon Huber

unread,
Feb 27, 2019, 12:47:12 PM2/27/19
to TiddlyWikiDev
Just to clarify, I'm all in favour of having find-in-page in TiddlyDesktop, and welcome any help. I think Simon's approach is a promising one: to make a find-in-page that works in a standalone TW. The other approach is to extend TiddlyDesktop itself with the functionality.

That's cool, thanks Jeremy!

Extending TiddlyDesktop itself is cumbersome I found. On the nw.js repo there are some questions about it, but it doesn't seem to be clear if it works using webview or how to do it ... so I thought maybe it's better doing it this way ...

best wishes back

Simon Huber

unread,
Feb 28, 2019, 11:08:43 AM2/28/19
to TiddlyWikiDev
I'm making good progress with this, now I can highlight all matches through a surrounding span which gets removed at every new search.

A global handler, like the keyboardmanager, does the handling, an action-widget provides access to the search functionality


The tiddlyspot page isn't updated, I don't remember the pass anymore. I don't know, shall I make this a PR so that we can work together?

If so, what should this be, a tiddlydesktop extension?

I don't know if I can make it work crossbrowser, some information I found suggests it's possible.
One could get the bounding rects from matches, which could be useful to use elsewhere, so it could be extended in its use.

Anyway, first I'd like to have the functionality working for TiddlyDesktop

best wishes,
Simon

@TiddlyTweeter

unread,
Feb 28, 2019, 2:27:18 PM2/28/19
to TiddlyWikiDev
Simon Huber wrote:
... first I'd like to have the functionality working for TiddlyDesktop

Not that I can help but getting it optimal for TD first sounds right as that is where we are most deficient. IF, after that, it can be generalised, so much the better. 

Thoughts
Josiah

Simon Huber

unread,
Feb 28, 2019, 4:43:18 PM2/28/19
to TiddlyWikiDev
Here's a second link to play around with highlight-all-found-words functionality



Simon Huber

unread,
Feb 28, 2019, 4:49:18 PM2/28/19
to TiddlyWikiDev
it's pretty slow with many matches ...
Reply all
Reply to author
Forward
0 new messages