Atlassian Jira 4.4 플러그인에 웹 리소스를 포함시키는 방법은 무엇입니까?jira 플러그인의 정적 리소스 (예 : JQuery) 사용
골드 피처-의 plugin.xml : 속도 템플릿 리소스를 포함
$("#projects").change(function() {
$(location).attr('href', "/jira/secure/StatisticsModuleAction!project.jspa?project=" + $(this).find("option:selected").text());});
:
<web-resource key="statistics-resources" name="statistics">
<resource type="download" name="statistics.js" location="js/statistics/statistics.js"/>
<dependency>jira.webresources:jira-global</dependency>
<context>com.cs.jira.plugins.statistics-resources</context>
</web-resource>
statistics.js
$webResourceManager.requireResourcesForContext("com.cs.jira.plugins.statistics-resources")
전에서 자바 스크립트 함수를 호출하려고 내 statistics.js,이 오류가 발생합니다.
Uncaught TypeError: Property '$' of object [object Window] is not a function
그럼 내가 외부 jQuery 라이브러리를 포함하려고 :
이 어떻게 제대로 내 자원을 포함 할 수 있습니다 : 내가 batch.js 다른 오류가 발생했습니다Uncaught TypeError: Object [object Object] has no method 'handleAccessKeys'
<web-resource key="statistics-resources" name="statistics">
<resource type="download" name="jquery-1.8.2.js" location="js/lib/jquery-1.8.2.js"/>
<resource type="download" name="statistics.js" location="js/statistics/statistics.js"/>
<dependency>jira.webresources:jira-global</dependency>
<context>com.cs.jira.plugins.statistics-resources</context>
</web-resource>
?
플러그인에서 jQuery를 사용해야합니까? 순수한 자바 스크립트를 사용해 볼 수 있습니다. – maxwell
https://developer.atlassian.com/display/AUI/Getting+Started+with+AUI 및 https://developer.atlassian.com/display/JIRADEV/Web+Resource+Plugin+Module로 시작하겠습니다. – mdoar