-
Suggestion
-
Resolution: Fixed
-
None
Plugins often want to include Javascript or CSS resources such as Prototype, which need to be included just once in a page. Putting them inline doesn't work for some resources, so we need a way of letting plugins specify what resources should be put in the HTML header.
They should be able to declare a resource in their atlassian-plugin.xml, then use a simple Velocity macro to have it appear in the HTML header as a script or link tag.
- blocks
-
CONFSERVER-7410 Calendar plugin doesn't work in Clickr theme
-
- Closed
-
- is related to
-
CONFSERVER-1664 Referrer / Trackback management über-issue
- Closed
-
CONFSERVER-7212 Improve caching of static resources
- Closed
-
CONFSERVER-12329 Move included JavaScript tags to the bottom of HTML pages
- Closed
- relates to
-
CONFSERVER-9843 The Warning-, Info-, Tip- and Note-Macros do not expand to full column/screen width
-
- Closed
-
This is done and the documentation has been finalised for 2.8.
Prototype and Scriptaculous are somewhat deprecated in Confluence now, even though they're unlikely to be removed for a while. The best JS library to use for new plugins is JQuery, which we're standardising on for Confluence front-end code. Thus, we won't be improving access to these libraries.
Plugin developers should not use YUI, and this has been removed from the documentation. YUI will be removed from Confluence in 2.9.
The documentation also covers how to add web resources to your plugin so you can include custom resources. This should be used for your plugin's custom JavaScript and CSS, to separate it from your HTML.
There are two limitations with the current work:
We hope to address these shortcomings in Confluence 2.9. The relevant issue is
CONF-11540.