Simple Example Gadgets

Rating: No reviews yet
Downloads: 958
Released: May 20, 2007
Updated: Jun 29, 2007 by WLSGadgetsTeam
Dev status: -not yet defined by owner-

Recommended Download

Source Code Hello World
source code, 2K, uploaded Jun 28, 2007 - 249 downloads

Other Available Downloads

Source Code Just HTML
source code, 3K, uploaded Jun 28, 2007 - 138 downloads
Source Code Just HTML with width detection
source code, 45K, uploaded Jun 28, 2007 - 108 downloads
Source Code Flash with width detection
source code, 82K, uploaded Jun 28, 2007 - 100 downloads
Source Code Dropdown gadget
source code, 3K, uploaded Jun 28, 2007 - 121 downloads
Source Code Dropdown Gadget with Edit Mode
source code, 4K, uploaded Jun 28, 2007 - 139 downloads
Source Code Just HTML with events
source code, 4K, uploaded Jun 29, 2007 - 103 downloads

Release Notes

These simple example gadgets should help you get started in the world of Gadget Development.

Hello World
This extremely simple gadget is included in the cookbook as an example of gadget structure only.

This gadget shows two different ways of putting HTML into your gadget: Via the innerHTML property of a div and via the DOM. The first method is of most use when you wish to get long strings of HTML into the gadget quickly; the second is the preferred method when you want a fine degree of programmatic control.

Just HTML with width detection
This gadget displays a text message showing the width it has available, and displays either a large or a small image depending on that width. As gadgets can be placed in columns with a wide variety of widths, and some layouts may not be appropriate for the narrower ones, code of this kind makes fallback positions available.

Flash with width detection
As with the previous gadget, this scales its content—in this case a Flash movie—to fit the space available. If the gadget is placed in a column smaller than the default width of the movie, an appropriate height and width are calculated.

Just HTML with events
This gadget creates HTML using both the innerHTML and DOM methods and demonstrates how to add events to them (in this case a simple pop-up that says “hello”).

This gadget shows the use of get/set prefs to display a message of the user’s choosing. In addition, it detects whether the gadget is in Author or Viewer mode, hiding the dropdown for changing the message when in Viewer mode.

Dropdown with edit mode
This is a more elaborate version of the Dropdown gadget, with the dropdowns controlling the message displayed and the color of the message displayed in a separate screen. When in Author mode the space owner can swap between the message screen and the edit screen by clicking a button.

Reviews for this release

No reviews yet for this release.