Skip to end of metadata
Go to start of metadata

Terminology: On this page and its child pages,

  • when we refer to the 'framework', we mean the Atlassian Gadgets JavaScript Framework.
  • when we refer to a 'gadget', we mean a gadget JavaScript object.

Here is a list of all entries in the cookbook, plus the first few lines of content. Click a link to see the full text for each entry.

Adding a Chart to the Issue Navigator

Place the gadget in the 'JIRA' and 'Charts' categories, include two userprefs and change the gadget configuration field:

Adding a Reload Option to your Gadget

This will add a reload icon to the footer of the gadget and an auto-reload option to the config screen:

Adding Something to your Gadget Footer

Use the following code in your view template function:

Adjusting the Gadget Height when the Window is Resized

Enable the onResizeAdjustHeight option on the view object:

Making Ajax Calls

The framework wraps the OpenSocial gadgets.io.makeRequest method with the standard jQuery interface. You should write code as if you were just using the jQuery interface. For example:

Making your Gadget Reload when Resized

Enable the onResizeReload option on the view object:

Restricting Edit Permissions on your Gadget Preferences

Use the framework and include the views feature:

Showing the Config Screen on Initial Load Only

Include the isConfigured userpref defaulted to 'false':

Specifying Required Features for the Framework

In addition to our full list of features, below is a summary of the features used by the Atlassian Gadgets JavaScript Framework. It is safest just to include all of them:

Specifying Required Resources for the Framework

The framework requires the inclusion of the following resources:

Theming your Gadget Dynamically

It is possible to have the theme dynamically adapt to the space available with some JavaScript like this:

Using Authentication in your Gadget

Specify the appropriate features as 'required' in your gadget XML, include the necessary resources in the CDATA section, and use the useOauth parameter when constructing your gadget:

Using Cookies in your Gadget

Use the gadget object API for createCookie, readCookie and eraseCookie:

Using Special UserPrefs for the Framework

There are a couple of UserPref values that the framework can use to add functionality to the gadget:

RELATED TOPICS

Using the Atlassian Gadgets JavaScript Framework
Gadgets and Dashboards Documentation

  • No labels