我正在尝试为jira开发一个插件,我遇到了jquery的问题.我很确定它已经是框架的一部分而我需要做的就是包含它,但似乎没有任何工作.
我已经尝试将它放在我的atlassian-plugin.xml文件中
<web-resource key="jquery" name="jquery" >
<dependency>jira.webresources:jira-global</dependency>
<resource type="download" name="jquery.js" location="/includes/javascript/jquery.js" />
</web-resource>
Run Code Online (Sandbox Code Playgroud)
我没有依赖也试过它
我试过放入#requireResource("jira.webresources:jira-global")我的速度模板,但也没有用.这是我的input.vm文件中的js
<script type="text/javascript">
jQuery(function($) {
$('.questions').hide();
});
</script>
Run Code Online (Sandbox Code Playgroud)
我似乎所做的一切只会导致 Uncaught ReferenceError: jQuery is not defined
在一个松散的结束现在不确定下一步尝试什么!
查看 JIRA Subversion 插件,了解如何定义和包含其资源的示例。这很繁琐,但确实有效。主要文档位于http://confluence.atlassian.com/display/PLUGINFRAMEWORK/Web+Resource+Plugin+Module
插件主页: https ://studio.plugins.atlassian.com/wiki/display/SVN/Subversion+JIRA+plugin
主要插件配置文件 位于https://studio.plugins.atlassian.com/svn/SVN/tags/atlassian-jira-subversion-plugin-0.10.5.4_01/src/main/resources/atlassian-plugin.xml定义的 web-resource 元素表示它依赖于 jira.webresources,这是 JIRA 中 jquery 的来源:
jira.webresources:jira-global
webResourceManager.requireResource("com.atlassian.jira.plugin.ext.subversion:subversion-resource-js");
此调用中的字符串至关重要 - 它必须是顶级 atlassian-plugin 元素的“key”属性加上冒号加上 atlassian-plugin.xml 中资源元素的“key”属性
哈特哈,
〜马特
| 归档时间: |
|
| 查看次数: |
5897 次 |
| 最近记录: |