Gadgets and Dashboards 2.0 : Using the Atlassian Gadgets JavaScript Framework
This page last changed on Oct 14, 2009 by smaddox.
This document assumes that you are familiar with (or have the documentation available for) writing gadgets and you have read Writing an Atlassian Gadget. Using the Atlassian Gadgets JavaScript Framework is the preferred and recommended way of developing gadgets for Atlassian applications. On this page: IntroductionDuring development of our own gadgets, we realised there were a lot of common requirements and functionality between gadgets. This led to the development of the Atlassian Gadgets JavaScript Framework. This framework is the basis of most of the gadgets developed at Atlassian. Terminology: On this page and its child pages,
Feature overview:
Using the FrameworkThese examples assume that you are familiar with the gadget XML format and Atlassian's customisations to it. Here is a basic stub for using the framework: <?xml version="1.0" encoding="UTF-8" ?> <Module> <ModulePrefs title="__MSG_gadget.title__" directory_title="__MSG_gadget.title__" description="__MSG_gadget.description__"> <Require feature="dynamic-height" /> <Require feature="oauthpopup" /> <Require feature="setprefs" /> <Require feature="settitle" /> <Require feature="views" /> <Optional feature="atlassian.util" /> #oauth #supportedLocales("gadget.common,your.gadget.resource.prefix") </ModulePrefs> <Content type="html"> <![CDATA[ /* (1) This resource is required for using the gadget framework */ #requireResource("com.atlassian.jira.gadgets:common") #includeResources() <script type="text/javascript"> (function () { /* (2) Construct and initialise the gadget */ var gadget = AJS.Gadget({ baseUrl: "__ATLASSIAN_BASE_URL__", /* (3) Used to make base url available to gadget */ view: {...view-options...} /* (4) Defines the view logic */ }); })(); </script> ]]> </Content> </Module> The lines of interest are:
Example GadgetsSee the sample OAuth gadget for a simple example of how to use the JavaScript framework. RELATED TOPICS
Including Features into your Gadget |
![]() |
Document generated by Confluence on Nov 22, 2009 17:46 |