Hello,
I make a plugin to execute some Javascript in all the pages of my JIRA Application.
The web-ressource in my file atlassian-plugin.xml :
<web-resource key="test">
<ressource type="download" location="js/test.js" />
<context>alt.general</context>
</web-resource>
To test the plugin, I put only a console.log("OK") in the file test.js.
I load the plugin in JIRA, but the Javascript code doesn't work...
Note : the plugin work correctly because I have a web-item who work fine.
Oh gosh...
Glad you've found it out! Could have taken more time!
Enjoyr the rest of your dev steps :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank's Micky ^^ !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey!
Still me, live from Summit! Have you tried using your own context instead of atl.* and include them in your Velocity templates with the resource manager? Never had issues with that!
Let me know :)
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I see some topics related to Velocity, but I don't understand exactly what it that...
I don't try this so.
You can give me a basic example :) ?
Basically, i want to put a Javascript librarie on each page of my JIRA application, to use it with the plugin JSIncluder.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Up
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Raphaël,
Have you tried using atl.general? :) (mispelled in your example).
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oops thanks.
But it still doesn't work :( ...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In my plugins I have the following:
<resource type="download" name="filename.js" location="/js/filename.js"/>
<context>myContext</context>
And the path is src/main/resources/js/filename.js
Could you try with the leading "/" ?
Also, inputing an alert is not a good idea to test as the resource can be loaded before page render, what I've done in the past is more defining vars and checking them in console or:
AJS.$(document).ready(function() {
alert('test');
});
which ensures the body is ready before popping the alert.
Let us know if it worked!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also try with the "/", but nothing change...
I prefer put a console.log because its non-blocking, so I try like this :
AJS.$(document).ready(function() {
console.log("OK");
});
But same result : nothing in my console...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you tried using context, not global context? I can't use the SDK now to check atl.general but never had problems with specific ones!
Have you also made sure to refresh your localhost:2990/jira page with no cache (shift + refresh)? New javascript resources are always lagging on my laptop for instance and I've been very frustrated before discovering a simple cache refresh made it work sometimes!
Hope this helps!
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I also try atl.admin but nothing.
I test my plugin on a different instance (because my localhost:2990/jira doesn't work fine...), I try to refresh cache (ctrl + f5, and shift + f5) but... nothing.....
I don't understand why.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.