Page 1 of 1

Implement a button to open a keyref

Posted: Wed Oct 19, 2016 10:33 am
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

Re: Implement a button to open a keyref

Posted: Wed Oct 19, 2016 4:37 pm
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

Re: Implement a button to open a keyref

Posted: Thu Oct 20, 2016 10:35 am
by xephon
Wow, again the JSOperation-Swiss-Knife :D

Works awesome, thanks Alex!