Page 1 of 1

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

Posted: Fri Mar 24, 2023 7:15 pm
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

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!

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

Posted: Mon Mar 27, 2023 7:57 am
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

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

Posted: Wed Mar 29, 2023 2:57 pm
by eduarddrenth
See also common-problems/topic20889.html, from 2018!

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

Posted: Thu Mar 30, 2023 11:59 am
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

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

Posted: Thu Apr 06, 2023 3:40 pm
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
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.

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

Posted: Fri Apr 07, 2023 7:54 am
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