[TW5] New Plugin: tobibeer/preview 0.5.2

674 views
Skip to first unread message

Tobias Beer

unread,
Jan 15, 2016, 10:20:10 AM1/15/16
to tiddl...@googlegroups.com
Hi everyone,

After David's request here I did some tests and ended up creating
a new plugin called tobibeer/preview now released as version 0.5.2:


The plugin $:/plugins/tobibeer/preview enhances the core LinkWidget

to display a preview of tiddlers when hovering an internal link.

  • link preview popups can even be nested a few levels
  • you can define a delay or keyboard modifier keys in the configuration
    • or exclude elements cia css classes or titles using an exclude filter
    • and make preview popups "sticky" using the class tc-popup-keep
  • design a custom template or use custom styles via css
Best wishes,

Tobias.

David Gifford

unread,
Jan 15, 2016, 1:07:39 PM1/15/16
to TiddlyWiki
Now if there were a way to create "static bundles" - where you create a static of one tiddler, but any tiddlers that it references are also available. So that hovering over a link in a static opened the popup to the bundled tiddler, or clicking on a tab opens it up...

Dave

Jon

unread,
Jan 15, 2016, 2:59:06 PM1/15/16
to TiddlyWiki
Very useful, thanks Tobias.
Jon

Jon

unread,
Jan 15, 2016, 3:35:40 PM1/15/16
to TiddlyWiki
Hi Tobias,

When I changed tc-popup-keep to tc-popup (and saved & re-loaded), the behaviour hasn't changed - still need to click away for pop-up to close.
Also, what does the modifier key do?

Great plug-in - I'll be using this a lot!

Thanks
Jon

Jon

unread,
Jan 15, 2016, 3:50:06 PM1/15/16
to TiddlyWiki
Hi Tobias,

Noticed that the popup is translucent so if link is within some text, it's unreadable.

Regards
Jon

Tobias Beer

unread,
Jan 16, 2016, 10:44:00 AM1/16/16
to TiddlyWiki
Hi Jon,

I'll have to check what I say in the docs, but a popup that is "sticky" is not one that would not close when you leave it but one that stays open even if you click inside.

In other words, if you want a popup that closes when you leave it, that would be a new feature …that I could implement perhaps using "tc-popup-temporary" or something.

The result of using a configured "modifier key" is that when you mouse over the link you do not have to wait for the delay but the popup opens immediately… be because most of the time you do not want a popup to open the very moment you hover it.

Best wishes,

Tobias.

Tobias Beer

unread,
Jan 16, 2016, 10:45:40 AM1/16/16
to TiddlyWiki
Hi Dave,

I did not understand your 'static tiddler' idea… especially not considering how that term is used in the context of TiddlyWiki.

Tobias Beer

unread,
Jan 16, 2016, 10:47:19 AM1/16/16
to TiddlyWiki
As for the "translucent" popup… that would be missing styles in the core. Did you install tobibeer/appear? If so, did you change the classes?

Best wishes, Tobias.

David Gifford

unread,
Jan 16, 2016, 11:25:53 AM1/16/16
to tiddl...@googlegroups.com
Hi Tobias

What I mean is, wouldn't it be great to be able to export tiddlers as static htmls, but have any tiddlers related to them 'bundled' with them in the export process, so that you end up with a static html that allows you to hover on a link and have a popup appear. Not a big deal but it would be cool

Dave

On Sat, Jan 16, 2016 at 9:45 AM, Tobias Beer <beert...@gmail.com> wrote:
Hi Dave,

I did not understand your 'static tiddler' idea… especially not considering how that term is used in the context of TiddlyWiki.

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/KkKJ-4_wuXA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/8dc0a0c5-9565-4596-9ba1-b65ddb13ac99%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
David Gifford
Christian Reformed World Missions, Mexico City

Jon

unread,
Jan 16, 2016, 11:33:42 AM1/16/16
to TiddlyWiki
Hi Tobias,

I thought I'd installed 'appear', but I didn't drag the right bit - working properly now - thanks.
That new feature would be good (if you can fit it in between the million other things you're working on!)
With regard to the modifier key, pressing Ctrl should open the link immediately on hover? This doesn't seem to work on mine - the link opens with the same delay with or without the key.

Just noticed in $:/plugins/tobibeer/preview/defaults/keys, the key is written in capitals, when I changed it to "Ctrl" it worked as expected

Thanks
Jon

Tobias Beer

unread,
Jan 16, 2016, 4:32:33 PM1/16/16
to TiddlyWiki
Hi Jon, the modifier keys do not open tiddlers, (just popups) they only ignore the delay… and they should be case insensitive… could be they're not case insensitive on one end of the operation. ;-)

Jon

unread,
Jan 16, 2016, 4:38:59 PM1/16/16
to TiddlyWiki
Hi Tobias,

Yes, I meant that.
As I say, it works once the case is changed.
Thanks for very useful addition to my wiki!

Regards
Jon

Tobias Beer

unread,
Jan 18, 2016, 12:55:30 PM1/18/16
to TiddlyWiki
Hi Jon,
 
Just noticed in $:/plugins/tobibeer/preview/defaults/keys, the key is written in capitals, when I changed it to "Ctrl" it worked as expected

May I ask; Are you able to use CTRL+ENTER in edit mode to save a tiddler?

Best wishes,

Tobias.

Jon

unread,
Jan 18, 2016, 1:59:59 PM1/18/16
to TiddlyWiki
Hi Tobias,

I'd forgotten about that shortcut - yes, I can do that.

Regards
Jon

Surya

unread,
Sep 2, 2018, 9:27:19 PM9/2/18
to TiddlyWiki
Hello Tobias,

I am also very interested in a solution for what Jon asked :-)
How can I make it, that the preview-popup closes when I move the mouse away from an internal link (without clicking anywhere)?

Thanks for your help!
Surya

Surya

unread,
Sep 7, 2018, 6:04:14 PM9/7/18
to TiddlyWiki
Hello all,

maybe Tobias is in holiday or something else...

Does anybody from youknow, how I can make it, that the preview-popup closes when I move the mouse away from an internal link (without clicking anywhere)? (the plugin from http://tobibeer.github.io/tw5-plugins/#preview)

Would be fantastic!
Thanks a lot, Surya

Mat

unread,
Sep 7, 2018, 7:21:52 PM9/7/18
to TiddlyWiki
Surya wrote:

Does anybody from youknow, how I can make it, that the preview-popup closes when I move the mouse away from an internal link (without clicking anywhere)? (the plugin from http://tobibeer.github.io/tw5-plugins/#preview)


You can use this basic idea for a pure css "show when hovering" popup.

<div class="hover-to-show">
   [[visible link]]
   
<span class="hover-to-show-inner">
      content in popup
   
</span>
</div>

<style>
.hover-to-show-inner {
 
display:none;
}

 
.hover-to-show:hover .hover-to-show-inner {
  position
:absolute;
  display
:block;
  width
:150%;
  margin
-left:-155%; margin-top:-1.5em;
  background
:white;
  border
:1px solid silver;
  border
-radius:4px;
 
/* ...etc... */
 
}
</style>

<:-)

 

Surya

unread,
Sep 7, 2018, 8:26:07 PM9/7/18
to TiddlyWiki
Ah great :-)
I'll try it- but where ;-)

Should I write it in

$:/plugins/tobibeer/preview/styles


or in another tiddler of that plugin or in a new tiddler tagged with "$:/tags/Stylesheet"?


Mat

unread,
Sep 8, 2018, 5:51:05 AM9/8/18
to TiddlyWiki
Surya wrote:
Ah great :-)
I'll try it- but where ;-)

OK first note that my solution does not automatically make all links show popups. You must manually specify the individual links that should do so, i.e it is used like so;

lorem impsum <<hoverlink "hey there">> lorem ipsum

I.e, the div defined above is put in a macro called e.g "hoverlink" like so:

title: hoverlink/macro
tags
: $:/tags/macro
text
:
\define hoverlink(title)
<div class="hover-to-show">
   
[[$title$]]
   
<span class="hover-to-show-inner">
     
<$transclude tiddler="""$title$""" mode=block/>
   
</span>
</
div>
\end

In addition you need a stylesheet for the styles above:

title: hoverlink/stylesheet
tags
: $:/tags/Stylesheet
type
: stylesheet (...or whatever that type name is that you see when you select from the "type" dropdown in edit mode)
text
:
.hover-to-show {
 display
:inline;

}
.hover-to-show-inner {
 display
:none;
}

.hover-to-show:hover .hover-to-show-inner {
 position
:absolute;
 display
:block;
 width
:150%;
 margin
-left:-155%; margin-top:-1.5em;
 background
:white;
 border
:1px solid silver;
 border
-radius:4px;
 
/* ...etc... */
}


Hope this helps. But again, you'll manually have to macrocall the individual links as explained above.


<:-)

Mohammad

unread,
Sep 8, 2018, 7:12:24 AM9/8/18
to TiddlyWiki
Mat,
 Is there anyway to determine the correct position of popup?
The problem is on hover a small popup is shown but it does not consider the dynamic position to stay in view (e.g, when the link is close to one edge of window)

Mohammad

Surya

unread,
Sep 8, 2018, 3:16:59 PM9/8/18
to tiddl...@googlegroups.com
Hi Mat,
oh shit, I am sorry, then it is unfortunately not the right solution for me.
For me it should show automatically all internal links as preview-popups.
But nevertheless thanks for your help!



Hello @all,
does anybody has a solution for the question "how can I make it, that the preview of internal links closes, when the mouse moves out of the preview (without clicking anywhere)?




@Mohammad:
I have the tiddler

"$:/plugins/tobibeer/preview/styles", tagged with "$:/tags/Stylesheet". In this tiddler is written, how it should be shown- I edited it for my needs and with this everything is okay for me.

.tc-popup.tc-preview-tiddler{ max-width:880px; width:100%; padding:1em; }
Maybe this helps you?

Surya

Mat

unread,
Sep 8, 2018, 6:31:15 PM9/8/18
to TiddlyWiki
Mohammad wrote:
Mat,
 Is there anyway to determine the correct position of popup?

Yes. If you make the outer div "position:relative" and the inner span "position:absolute", you should be able to set the position of the popup at any position relative to the link. 

<:-)

Mohammad

unread,
Sep 9, 2018, 11:43:26 PM9/9/18
to TiddlyWiki
Hi Surya,
 Does it dynamically determine the best position of popup? I mean when the link is clode to bottom edge the popup should be above the link and when the link is close to the upper edge the popup should be opened below the link. The same is true for left and right edge to have the popup right and left of the link!

I appreciate to share your experiences with this!

Mohammad

Surya

unread,
Sep 10, 2018, 5:22:25 PM9/10/18
to TiddlyWiki
Hello Mohammad,
no, it doesn't dynamically determine the best position of popup. But that doesn't mind for me, because, when a link is for example at the end of the page and the preview takes more place, than I can scroll it down.
The preview is always shown under the link.

Example what it looks like:         This is an internal link
                                                This is the preview of that link with more text and more text
                                                and more text and more text and more text and more text
                                                and more text and more text and more text and more text

I am sorry, I don't know how to solve it to make your wish come true.
Surya

Mohammad

unread,
Sep 11, 2018, 11:55:56 AM9/11/18
to TiddlyWiki
Thank you Surya for sharing!

Best
Mohammad

Mohammad

unread,
Sep 11, 2018, 11:55:57 AM9/11/18
to TiddlyWiki
Thank you Surya for sharing!

Best
Mohammad

On Tuesday, September 11, 2018 at 1:52:25 AM UTC+4:30, Surya wrote:

Boris Kalinin

unread,
May 26, 2020, 2:36:57 PM5/26/20
to TiddlyWiki
Hi Surya!

Have you found the answer to that question? I am struggling with this problem too.

Sincerely, Boris

воскресенье, 9 сентября 2018 г., 0:16:59 UTC+5 пользователь Surya написал:
Reply all
Reply to author
Forward
0 new messages