Welcome Developers!

Welcome!

Return to Developer Documentation.

Library: gadgets001.js
Overview
This library augments gadgets.window with functionality to change the height of a gadget dynamically.
  • source: gadgets001.js
Constructors
gadgets.Prefs(opt_moduleId)
Creates a new Prefs object.
parameters
String, Number opt_moduleId An optional parameter specifying the module id to create prefs for; if not provided, the default module id is used
methods
Namespaces
gadgets.util
Provides general-purpose utility functions.
methods
gadgets.io
Provides remote content retrieval functions.
methods
gadgets.json
Provides operations for translating objects to and from JSON.
methods
gadgets.window
Provides operations for getting information about and modifying the window the gadget is placed in.
methods
Functions
gadgets.util.getFeatureParameters(feature)
Gets the feature parameters.
parameters
String feature The feature to get parameters for
returns
Object The parameters for the given feature, or null
gadgets.util.hasFeature(feature)
Returns whether the current feature is supported.
parameters
String feature The feature to test for
returns
Boolean True if the feature is supported
gadgets.util.registerOnLoadHandler(callback)
Registers an onload handler.
parameters
Function callback The handler to run
gadgets.io.makeRequest(url, callback, opt_params)
Fetches content from the provided URL and feeds that content into the callback function. Example:
gadgets.io.makeRequest(url, fn,
{contentType: gadgets.io.ContentType.FEED});
parameters
String url The URL where the content is located
Function callback The function to call with the data from the URL once it is fetched
Map.<gadgets.io.RequestParameters, Object> opt_params Additional parameters to pass to the request
gadgets.io.encodeValues(fields)
Converts an input object into a URL-encoded data string. (key=value&...)
parameters
Object fields The post fields you wish to encode
returns
String The processed post data in www-form-urlencoded format.
gadgets.io.getProxyUrl(url)
Gets the proxy version of the passed-in URL.
parameters
String url The URL to get the proxy URL for
returns
String The proxied version of the URL
gadgets.Prefs.getString(key)
Retrieves a preference as a string.
parameters
String key The preference to fetch
returns
String The preference; if not set, an empty string
gadgets.Prefs.getInt(key)
Retrieves a preference as an integer.
parameters
String key The preference to fetch
returns
Number The preference; if not set, 0
gadgets.Prefs.getFloat(key)
Retrieves a preference as a floating-point value.
parameters
String key The preference to fetch
returns
Number The preference; if not set, 0
gadgets.Prefs.getBool(key)
Retrieves a preference as a boolean.
parameters
String key The preference to fetch
returns
Boolean The preference; if not set, false
gadgets.Prefs.set(key, val)
Stores a preference. To use this call, the gadget must require the feature setprefs.

Note: If the gadget needs to store an Array it should use setArray instead of this call.

parameters
String key The pref to store
Object val The values to store
gadgets.Prefs.getArray(key)
Retrieves a preference as an array. UserPref values that were not declared as lists are treated as one-element arrays.
parameters
String key The preference to fetch
returns
Array.<String> The preference; if not set, an empty array
gadgets.Prefs.setArray(key, val)
Stores an array preference. To use this call, the gadget must require the feature setprefs.
parameters
String key The pref to store
Array val The values to store
gadgets.Prefs.getMsg(key)
Fetches an unformatted message.
parameters
String key The message to fetch
returns
String The message
gadgets.Prefs.getCountry()
Gets the current country, returned as ISO 3166-1 alpha-2 code.
returns
String The country for this module instance
gadgets.Prefs.getLang()
Gets the current language the gadget should use when rendering, returned as a ISO 639-1 language code.
returns
String The language for this module instance
gadgets.Prefs.getModuleId()
Gets the module id for the current instance.
returns
String, Number The module id for this module instance
gadgets.json.stringify(v)
Converts a JavaScript value to a JSON string.
parameters
Object v The object to convert
returns
String The JSON equivalent
gadgets.json.parse(text)
Parses a JSON string, producing a JavaScript value.
parameters
String text The string to transform into an object — usually the result of a previous stringify call
returns
Object The object parsed from the passed in text; false if an error occurred
gadgets.window.getViewportDimensions()
Detects the inner dimensions of a frame. See: http://www.quirksmode.org/viewport/compatibility.html for more information.
returns
Object An object with width and height properties.
gadgets.window.adjustHeight(opt_height)
Adjusts the gadget height
parameters
Number opt_height An optional preferred height in pixels. If not specified, will attempt to fit the gadget to its content.
Objects
gadgets.views
Implements the gadgets.views API spec. See http://code.google.com/apis/gadgets/docs/reference/gadgets.views.html
Generated by JsDoc Toolkit 1.4.0 on Thu, 13 Mar 2008 20:18:59 GMT.