Implement a button to open a keyref

xephon
Posts: 100
Joined: Mon Nov 24, 2014 1:49 pm
Location: Münster/Germany

Implement a button to open a keyref

Post by xephon » Wed Oct 19, 2016 10:33 am

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
Join the DOCTALES DITA development team :arrow: https://doctales.atlassian.net/wiki

alex_jitianu
Posts: 771
Joined: Wed Nov 16, 2005 11:11 am

Re: Implement a button to open a keyref

Post by alex_jitianu » Wed Oct 19, 2016 4:37 pm

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: 100
Joined: Mon Nov 24, 2014 1:49 pm
Location: Münster/Germany

Re: Implement a button to open a keyref

Post by xephon » Thu Oct 20, 2016 10:35 am

Wow, again the JSOperation-Swiss-Knife :D

Works awesome, thanks Alex!
Join the DOCTALES DITA development team :arrow: https://doctales.atlassian.net/wiki

Post Reply