JIRA Plugin - Popup

Markus Staudt March 31, 2015

Hi,

I am currently trying to open a popup like the one in the image:

popup.PNG

I use the issueaction-log-work style class to get this kind of popup. If I click the link my popup opens as expected except the fact that my css file in the plugin isn't loaded. This is my code:

<web-resource key="pluginname-resources" >
        <dependency>com.atlassian.auiplugin:ajs</dependency>
        <resource type="download" name="pluginname.css" location="/css/pluginname.css" />
         ...
    </web-resource>

<web-item name="issue-send-mail" section="operations-top-level" ... >
        <label key="issue--send--mail.label" />
        <link linkId="issue--send--mail-link">/plugins/servlet/fancyServlet</link>
        <styleClass>issueaction-log-work</styleClass>
</web-item>
<html>
    <head>
        <title>Popup!title>
        $webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources")
    </head>
<body>

.. other stuff ..

</body>
</html>

 

I had the idea that maybe the whole <head>..</head> part is being ignored because there is already a head. If i open the site directly (without popup) my css is being loaded. So I tried to move the $webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources") line:

&lt;html&gt;
    &lt;head&gt;
        &lt;title&gt;Popup!title&gt;
    &lt;/head&gt;
&lt;body&gt;

$webResourceManager.requireResourcesForContext("my.fancy.plugin:pluginname-resources")

.. other stuff ..

&lt;/body&gt;
&lt;/html&gt;

But unfortunately this isn't working, too.

Is there any other way to get my css loaded when opening the page in a popup?

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Answer accepted
Markus Staudt March 31, 2015

I fixed it!

In this question the solution is to use the atl.general context in the web resource definition. So the resources will be included in many pages they don't need to, but this is no big deal (at least for my purposes).

Now, the page that opens my popup already includes my css.

&lt;web-resource key="pluginname-resources" &gt;
        &lt;dependency&gt;com.atlassian.auiplugin:ajs&lt;/dependency&gt;
        &lt;resource type="download" name="pluginname.css" location="/css/pluginname.css" /&gt;

        &lt;context&gt;atl.general&lt;/context&gt;
         ...
    &lt;/web-resource&gt;

 

 

0 votes
Dmitrii Apanasevich
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 31, 2015

Hi!

You need to require resource directly by key

$webResourceManager.requireResource("my.fancy.plugin:pluginname-resources")
TAGS
AUG Leaders

Atlassian Community Events