Gadgets and Dashboards 2.0 : Gadget Developers' JavaScript Cookbook
This page last changed on Jul 27, 2009 by smaddox.
Terminology: On this page and its child pages,
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{info:title=Documentation under development} Adding a Reload Option to your GadgetThis 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 FooterUse the following code in your view template function: Adjusting the Gadget Height when the Window is ResizedEnable the onResizeAdjustHeight option on the view object: Making Ajax CallsThe 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 ResizedEnable the onResizeReload option on the view object: Restricting Edit Permissions on your Gadget PreferencesUse 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 FrameworkThe framework uses the following features (it is safest just to include all of them): Specifying Required Resources for the FrameworkThe framework requires the inclusion of the following resources: Theming your Gadget DynamicallyIt is possible to have the theme dynamically adapt to the space available with some JavaScript like this: Using Authentication in your GadgetSpecify 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 GadgetUse the gadget object API for createCookie, readCookie and eraseCookie: Using Special UserPrefs for the FrameworkThere are a couple of UserPref values that the framework can use to add functionality to the gadget: RELATED TOPICSUsing the Atlassian Gadgets JavaScript Framework |
![]() |
Document generated by Confluence on Nov 22, 2009 17:46 |