CSS and JS files in custom controls

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

CSS and JS files in custom controls

rovsh
Hello,

We have a custom control which has its own Javascript and CSS files. Within control's XBL file we reference these JS and CSS files as follows:
JavaScript:
    <xbl:script src="/js/mycustomcontrol.js"/>
CSS:
        <xbl:resources>
            <xbl:style src="/css/mycustomcontrol.css"/>
        </xbl:resources>

How should we package the custom control and its resources (JS, CSS) so that these resources will be loaded like native controls of Orbeon? (something like this: native controls load their resources from this path - /4.2.0.201305301915/xbl/orbeon/tabview/tabview.css)
Currently, they are placed within Orbeon resources/xbl folder inside Orbeon WAR. Please let me know if I was not clear in my help request. :)

-Rovsh
Reply | Threaded
Open this post in threaded view
|

Re: CSS and JS files in custom controls

Erik Bruchez
Administrator
JS and CSS should be packaged alongside the XBL. See for example:

    https://github.com/orbeon/orbeon-forms/tree/master/src/resources-packaged/xbl/orbeon/grid

(We might move to create an `assets` directory there instead, but that doesn't change anything really.)

They are automatically aggregated and loaded by Orbeon when the XBL control is in use.

-Erik