In the Oxygen editor, can I add a tooltip to a processing instruction?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
chrispitude
Posts: 907
Joined: Thu May 02, 2019 2:32 pm

In the Oxygen editor, can I add a tooltip to a processing instruction?

Post by chrispitude »

Hello,

We use a <?snps-gentext?> processing instruction in our DITA files to indicate cross-book links whose target text is dynamic and should be recomputed as needed:

Code: Select all

<xref keyref="bookB.topic">Topic Title<?snps-gentext?></xref>
We use some CSS to style this processing instruction as an icon in the Oxygen editor (more details here):

Code: Select all

oxy|processing-instruction[snps-gentext] {
  -oxy-display-tags: none;
  -oxy-editable: false;`
  visibility: -oxy-collapse-text;
  -oxy-alt-text: 'foo';
background-color: red;
}
  oxy|processing-instruction[snps-gentext]:before {
  content: oxy_url('snps-gentext.png');
}
Currently, if a user hovers over this PI icon, the tooltip looks like this:

image.png
image.png (6.17 KiB) Viewed 740 times

Is there some editor CSS that allows tooltips to be specified? I didn't see a tooltip CSS property here:

Framework and Author Mode Customization > CSS Support in Author Mode > CSS Extensions > Additional CSS Properties

It would be nice to put a helpful comment for curious novice users to explain its meaning.

Thanks!
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: In the Oxygen editor, can I add a tooltip to a processing instruction?

Post by Radu »

Hi Chris,

Thanks for the improvement request, we have an existing internal issue and I added your contact details to it:

EXM-44550 Add custom CSS property to define tooltip for element

If we manage to fix it in a future version we'll let you know.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: In the Oxygen editor, can I add a tooltip to a processing instruction?

Post by Radu »

Hi Eduard,

Thanks for the update.
Could you also post a small sample CSS selector showing in what context you would set the tooltip? Do you also need it for processing instructions or for XML elements? Do you want it to be displayed when hovering the actual element or when hovering some static :before or :after content?
In this way if we manage to implement this we'll have some use cases to test against.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
eduarddrenth
Posts: 12
Joined: Thu Oct 03, 2019 2:17 pm

Re: In the Oxygen editor, can I add a tooltip to a processing instruction?

Post by eduarddrenth »

In this xml-snippet:

Code: Select all

<tei:w xml:id="dear-mey-158" next="#dear-mey-159">dear</tei:w>
                    <tei:w xml:id="dear-mey-159" prev="#dear-mey-158">mey</tei:w><tei:join
                        result="w" lemma="dêrmei" target="#dear-mey-158 #dear-mey-159"
                        fa:islemma="yes" pos="adv"/>
I want info from attributes on the join element to be shown as tooltip with the w elements referred from the join element.

Now I display this:
image.png
image.png (7.02 KiB) Viewed 604 times
For which I wrote this css:

Code: Select all

w[next]::before, w[prev]::before {
    content: oxy_xpath(oxy_concat("following-sibling::tei:join[contains(@target,'",attr("xml:id"),"')]/@lemma"));
    display:none
}
w[next], w[prev] {
    background-color: rgb(220,220,220)
}
w[next]:hover::before, w[prev]:hover::before, w[next]:focus::before, w[prev]:focus::before {
    display:inline
}
join[target]::before {
    content: "("
}
join[target]::after {
    content: ")"
}
join[target] {
    content: oxy_concat(attr(lemma),oxy_xpath('if (@pos) then concat(": ",@pos) else ""'));
    font-style:italic
}
It would be nice to have oxy_tooltip in which I would have full control over tooltips shown (for elements): wether a tooltip is shown and the content of the tooltip, look&feel of the tooltip would also be nice.

If you want to know more, please let me know.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: In the Oxygen editor, can I add a tooltip to a processing instruction?

Post by Radu »

Hi Eduard,
Thanks for taking the time to discuss more about your use case, I added your details on the opened internal issue.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply