Implement a button to open a keyref

Post here questions and problems related to editing and publishing DITA content.
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Implement a button to open a keyref

Post by xephon »

Hi,

it is possible to simulate a button to open a DITA keyref with plain CSS:

Code: Select all

*[keyref]:before {
link : oxy_concat("" , attr(keyref , keyref)) ;
content : uri(../../img/link.png) "[" attr(keyref) "]" ;
text-decoration-line : underline ;
}
Is it possible to do the same thing with a oxy_button?

Greetings,
Stefan
stefan-jung.org – Your DITA/DITA-OT XML consultant
alex_jitianu
Posts: 1008
Joined: Wed Nov 16, 2005 11:11 am

Re: Implement a button to open a keyref

Post by alex_jitianu »

Hi,

You could use a button bound to a JSOperation, like this:

Code: Select all

*[keyref]:before {
text-decoration-line : underline ;
content: oxy_action(
name, attr(keyref),
operation, 'ro.sync.ecss.extensions.commons.operations.JSOperation',
arg-script, oxy_concat('function doOperation(){ var url = Packages.ro.sync.ecss.dita.DITAAccess.resolveKeyRef(new java.net.URL("',
oxy_base-uri(),
'"),"',
attr(keyref)
'", false); Packages.ro.sync.exml.workspace.api.PluginWorkspaceProvider.getPluginWorkspace().open(url); }')
) !important

}
Best regards,
Alex
xephon
Posts: 140
Joined: Mon Nov 24, 2014 1:49 pm
Location: Greven/Germany

Re: Implement a button to open a keyref

Post by xephon »

Wow, again the JSOperation-Swiss-Knife :D

Works awesome, thanks Alex!
stefan-jung.org – Your DITA/DITA-OT XML consultant
Post Reply