Home arrow Forum

Remository Forum

 


stmatth

Karma: 1  
Tooltip with nice formatting and markup - 2011/09/04 15:29 Hi again,

I had a look at the code for the tooltip and modified it so that the tooltips again come up as nice html, with the markup, and the possibility to include pictures, but without Javascript, i.e. purely css based.

I had to do some minor changes in glossary_plugin_content.php (only lines 175 and 199), and the style definitions (size of popup, colours etc.) are in puretip.css. It seems that Martin already had done some work on this, as the puretips.css already contained the basic idea.

Some notes:

  • Basic idea is to have a span element in the link which is only displayed in the "hover" state. I modified it a bit more to have two span elements, one showing the term as a header, and the other the definition; together they look like a window with a darker title bar. This is in line 199

  • There was some code that stripped out the html from the definition. That was necessary when it went into the title of the a tag, but for my popups I removed it. This is line 175

  • With markup enabled, a big problem are p tags, which mess things up completely. So I added something to strip out the p tags from the glossary definition, also in line 175 (the markup produces a p at the beginning/end, and these are not necessary


I haven't done a lot of testing on this, but it seems to work so far, so I thought I share it, hoping it helps you with the development.

File Attachment:
File name: puretip.css
File size:1198 bytes

Post edited by: stmatth, at: 2011/09/04 15:30

Post edited by: stmatth, at: 2011/09/04 15:32

Post edited by: stmatth, at: 2011/09/04 15:33
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.
stmatth

Karma: 1  
Re:Tooltip with nice formatting and markup - 2011/09/04 15:31 Something wrong with the upload? Here again
File Attachment:
File name: glossary_plugin_content.php
File size:14267 bytes
Stephan Matthiesen - Science-Texts: editorial team for scientific texts
  | | Sorry, you do not currently have permission to write here.
admin

Karma: 101  
Re:Tooltip with nice formatting and markup - 2011/09/16 17:35 Thanks, I'll look. Martin Brampton aka Counterpoint
http://aliro.org
http://black-sheep-research.com
  | | Sorry, you do not currently have permission to write here.
baladeva

Karma: 0  
Re:Tooltip with nice formatting and markup - 2011/11/04 19:02 do you have any idea on how to turn off the link function, i do not need a link on the term, the hover pop-up is sufficient, regards

Post edited by: baladeva, at: 2011/11/04 19:04
http://www.harekrischna.de/home
  | | Sorry, you do not currently have permission to write here.
emphyrio

Karma: 0  
Re:Tooltip with nice formatting and markup - 2011/11/06 12:29 Yay! Formatting! Exactly what I was looking for.

Using your files as base, I edited glossary_plugin_content.php a little more.

Line 194 was changed to this:
Code:

 <class="glossarylink" href="$ref">$termasfound<span class="glossaryterm">$term</span><span class="glossarydesc">$desc</span></a>

Otherwise, I wouldn't see your pretty styling at all (I have a little icon 'information' next to the glossary links (IMGLINK), this is different code than the regular ONELINK).

Still have one issue left: the height of the tooltip text area is too small. The tooltip text gets cut off. I tried adding some 'height'-statements to puretip.css, but this has no effect. In the screenshot, there should be a lot more text in the tooltip. You can't see the bottom border either, it's cut off.

Do you perhaps know where to edit the height?

Never mind, I found the answer. The tooltip does not extend over the borders of 'contentpaneopen'. I just added some empty lines below the text and voila.

Post edited by: emphyrio, at: 2011/11/06 12:49

Post edited by: emphyrio, at: 2011/11/06 12:51

Post edited by: emphyrio, at: 2011/11/06 13:09
  | | Sorry, you do not currently have permission to write here.
emphyrio

Karma: 0  
Re:Tooltip with nice formatting and markup - 2011/11/06 12:34 @baladeva: to remove the hyperlink, here's some hints (untested!).

Edit glossary_plugin_content.php.
On lines 194 and 199, change where it says:
<a class="glossarylink" ... etc>
to
<span class="glossarylink" ...etc>

Then edit puretip.css, and replace all instances of "a." with "span.".

That's how I would start. And then just see what's happens and go from there
  | | Sorry, you do not currently have permission to write here.
baladeva

Karma: 0  
Re:Tooltip with nice formatting and markup - 2011/11/19 18:49 @emphyrio; yes thank you - it works nice; i only wonder if the rest of the tage "href" - that must be there - maces any problem - because the html should be correct, but yes it works . . http://www.harekrischna.de/home
  | | Sorry, you do not currently have permission to write here.

Login

Subscribe to Premium Support

Get priority support for Remository and Glossary, sign up now for a Premium Support monthly subscription:

Your Remository user name

Or purchase a year's support:

Your Remository user name

Recommended SEF

SEF Advance

Who is Online

Remository welcomes guests and visitors

We have 8 guest online