【发布时间】:2014-08-30 08:39:15
【问题描述】:
我正在尝试在我的 JIRA 中使用一些 AUI - 在我自己用 JAVA 编写的自定义字段的编辑模式下。 我找到了这个页面:https://docs.atlassian.com/aui/latest/sandbox/#,以后我想使用设置示例 Auiselect2。
https://docs.atlassian.com/aui/5.5.1/docs/auiselect2.html - 这里写着,这只是实验性的,所以我应该做哪些步骤来使用它?在下面的示例中,您可以看到,我试图添加此功能,但它简单并不起作用。我正在使用文档中提到的示例 -
edit.vm:
$webResourceManager.requireResource("cz.firma.rozy:zakaznik")
<form class="aui">
<select id="select2-example" multiple>
<option value="CONF">Confluence</option>
<option value="JIRA">JIRA</option>
<option value="BAM">Bamboo</option>
<option value="JAG">JIRA Agile</option>
<option value="CAP">JIRA Capture</option>
<option value="AUI">AUI</option>
</select>
</form>
和 zakaznik.js
AJS.$(function() {
AJS.$("#select2-example").auiSelect2();
});
而我的 atlassian-plugin.xml 是:
<web-resource key="zakaznik-resources" name="zakaznik Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<dependency>com.atlassian.auiplugin:jquery</dependency>
<dependency>com.atlassian.auiplugin:jquery-ui-other</dependency>
<dependency>com.atlassian.auiplugin:aui-select2</dependency>
<context>atl.general</context>
<context>atl.admin</context>
<resource type="download" name="zakaznik.css" location="/css/zakaznik.css"/>
<resource type="download" name="zakaznik.js" location="/js/zakaznik.js"/>
<resource type="download" name="images/" location="/images"/>
<context>zakaznik</context>
</web-resource>
...
<customfield-type name="Pridani zakaznika" i18n-name-key="customer-add.name" key="customer-add" class="cz.firma.rozy.jira.customfields.CustomerCustomField">
<description key="customer-add.description">Plugin, ktery prida zakaznika z abry</description>
<resource name="view" type="velocity" location="templates/viewCustomer.vm"/>
<resource name="edit" type="velocity" location="templates/edit.vm"/>
</customfield-type>
但是当我访问编辑模式时,没有 jQuery 完成 - 并且浏览器控制台没有写入任何错误或警告。
【问题讨论】:
标签: javascript jquery velocity custom-fields jira-plugin