gadgets.views
Method
gadgets.views.bind
<static> String bind(urlTemplate, environment)
Binds a URL template with variables in the passed environment to produce a URL string.
Parameter
| Name | Type | Description |
|---|---|---|
| urlTemplate | String | A URL template for a container view. |
| environment | Array | A set of specified string type variables.(example:[OWNER |
Return value
| Type | Description |
|---|---|
| String | A URL string |
gadgets.views.getCurrentView
<static> gadgets.views.View getCurrentView()
Returns the current view.
Parameter
None
Return value
| Type | Description |
|---|---|
| gadgets.views.View | Current view |
Sample
var view = gadgets.views.getCurrentView();
gadgets.views.getParams
<static> Map.<String, String> getParams()
Returns the parameters passed into this gadget for this view.
Parameter
None
Return value
| Type | Description |
|---|---|
| Map.<String, String> | Parameter map |
gadgets.views.getSupportedViews
<static> Map<gadgets.views.ViewType, String, gadgets.views.View> getSupportedViews()
Returns a map of all supported views. Each gadgets.view.View name is used as a key.
Parameter
None
Return value
| Type | Description |
|---|---|
| Map | All supported views, using their name attribute as a key. |
gadgets.views.requestNavigateTo
It is scheduled to be offered.
gadgets.views.View.bind
String bind(environment)
Binds the view's URL template with variables in the passed environment to produce a URL string.
Parameter
| Name | Type | Description |
|---|---|---|
| environment | Array | A set of specified string type variables.(example: [OWNER |
Return value
| Type | Description |
|---|---|
| String | A URL string |
gadgets.views.View.getName
gadgets.views.ViewType, String getName()
Returns the name of this view.
Parameter
None
Return value
| Type | Description |
|---|---|
| String | View name |
Sample
var view = gadgets.views.getCurrentView();
var name = view.getName();
gadgets.views.View.getUrlTemplate
Not supported.
gadgets.views.View.isOnlyVisibleGadget
boolean isOnlyVisibleGadget()
Returns true if the specified gadget is the only visible gadget in this view. On a canvas page or in maximize mode it is most likely true; on a profile page or in dashboard mode, it is most likely false.
Parameter
None
Return value
| Type | Description |
|---|---|
| boolean | True if the specified gadget is the only visible gadget in this view; otherwise, false. |
Sample
var view = gadgets.views.getCurrentView();
if (view.isOnlyVisibleGadget) {
// ...
} else {
// ...
}
gadgets.views.ViewType
gadgets.views.ViewType.HOME
It is scheduled to be offered.
gadgets.views.ViewType.PROFILE
It is scheduled to be offered.
gadgets.views.ViewType.CANVAS
The canvas view.
gadgets.views.ViewType.PREVIEW
Not supported.
Revision History
- 12/2010
- Initial Release.