Hi,
I need to add my JS files and CSS files into velocity template.
so, i have added webresource module by follow below link:
https://developer.atlassian.com/display/CONFDEV/Web+Resource+Module
query here:
it does not seems included as it does not work and also not found in firebug.
have added it as below: please correct me what should be the location... and what's wrong.
src/main/Resource/templates/js files
src/main/Resource/templates/cs files
code:
<web-resource name="Admin Web Resources" key="resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="admin.js" location="admin.js"/>
<!-- added below js files -->
<resource type="download" name="jquery-1.9.1.min.js" location="templates/jquery-1.9.1.min.js" />
<resource type="download" name="jquery-ui-1.10.2.custom.min.js" location="templates/jquery-ui-1.10.2.custom.min.js" />
<!-- end js files -->
</web-resource>
<!-- css files -->
<web-resource key="example-resources" name="Web Resources for Content in Editor">
<resource name="fullcalendar.css" type="download" location="templates/fullcalendar.css"/>
<resource name="fullcalendar.print.css" type="download" location="templates/fullcalendar.print.css"/>
<context>editor-content</context>
</web-resource>
Thank You,
Community moderators have prevented the ability to post new answers.
In my Velocity template (in Jira 6.0) this worked:
$webResourceManager.requireResource("your-plugin-key:resourcekey")
(When I tried it #requireResource macro wasn't parsed but instead displayed as text on screen).
Note I didn't need to add anything to my back-end action (which extends JiraWebActionSupport) for this to work.
You have to add this in your <head> section
<html> <head> $webResourceManager.requireResource("your-plugin-key:resourcekey") ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You have to call for dependency. In your velocity use:
#requireResource("your-plugin-key:resourcekey")
Your-plugin-key, you can get from atlassian-plugin.xml, it's attribute "key" in root tag
<atlassian-plugin key="somekey">...</atlassian-plugin>
resourcekey, is "resources" from your example. key attribute from
<web-resource name="Admin Web Resources" key="resources">
Hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You added the dependency. But did you call it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.