This page describes changes that affect developers of JavaScript desktop gadgets. For information about changes in other releases, see Release Notes. For more information about the Desktop Gadget API, see Creating a Gadget and the Gadget API Reference.
Two forms of support for scrollbars have been added to the API:
autoscroll
div
and
listbox
.
When autoscroll
is true,
a vertical scrollbar appears
when the gadget is in floating or expanded mode
and there's insufficient vertical space
to display the entire div or listbox.
No scrollbar appears
when the gadget is in the Sidebar.
scrollbar
The following XML code
shows a typical way to use a div
with autoscroll:
<div name="scrollarea" width="100%"
background="#FF0000" x="0" y="55">
<div name="viewport" autoscroll="true"
background="#FFEC8B" x="0" y="0" width="100%" height="500">
<img src="large.gif" width="190" height="500"
x="0" y="0" />
</div>
</div>
A listbox displays a series of list items that the user can select. Two elements have been added to support listboxes:
Note:
As of 5.5, use item
instead of listitem
.
The following snapshot shows a listbox
with five visible listitem
s.
The listbox has a visible scrollbar
because the listbox autoscroll
property
is set to true
and the listbox is not tall enough to display all its items.
The DetailsView
class, which was previously undocumented,
now supports creating a details view
using an XML file to specify the view's content.
The following example illustrates
how you can use this new feature.
function button_onclick() { var details = new DetailsView(); details.SetContent(undefined, undefined, "details_view.xml", false, 0); plugin.showDetailsView(details, "", 0, onDetailsViewFeedback); } function onDetailsViewFeedback() { //Optionally respond to details view's closure. }
We plan to add documentation for DetailsView
.
Until then, you can find an example of using DetailsView
by looking at the HtmlDetailsView
SDK sample.
The
view
object
has one new method
(clearTimeout()
)
and a few new events
(ondock
,
onundock
,
onpopin
).
Two focus-related methods —
focus()
and
killFocus()
—
have been added to the
basicElement object,
and thus to all UI controls/elements.
Another new method,
removeAllElements()
,
is appropriate only for
elements that contain other elements.
Note: This release doesn't have built-in support for specifying focus order or for changing the focus using Tab or Shift-Tab.
The ability to send content items to friends is being phased out.
As a result, the friend_name
and
time_received
properties
of the ContentItem object
have been deprecated
and are no longer documented.
Associated flags
(gddDetailsViewFlagShareWithButton
gddContentItemFlagShared
, and
gddContentItemFlagShareable
)
have also been deprecated.
Note: Communication between gadgets is still supported. See the googleTalk object for details.
The window_height
and window_width
properties of the
plugin
object
have been deprecated.
Please use the
height
and width
properties of
view
or
contentarea
instead.