$decodeXMLCharacters
|
String |
Decodes XML entities, such as <, >, &, " and ' to XML characters. |
Sytaxis:
object.$decodeXMLCharacters(value) Arguments:
Name |
Type |
O/R |
Description |
value |
String |
Required |
String value to decode. |
|
$encodeXMLCharacters
|
String |
Encodes XML characters, such as &, <, >, " and ' to XML entities. |
Sytaxis:
object.$encodeXMLCharacters(value) Arguments:
Name |
Type |
O/R |
Description |
value |
String |
Required |
String value to encode. |
|
$init
|
Void |
Forces Ample SDK to start initialization immediately. Call this method to initialize Ample SDK in case you loaded framework resources after the page load. |
Sytaxis:
object.$init()
|
$instance
|
Element
|
UI element definition API. Finds corresponding to the HTML DOM element in the Ample SDK DOM. |
Sytaxis:
object.$instance(node) Arguments:
Name |
Type |
O/R |
Description |
node |
HTMLElement |
Required |
DOM HTML element |
|
ajax
|
XMLHttpRequest
|
Performs an asynchronous HTTP (Ajax) request. |
Sytaxis:
object.ajax(settings) Arguments:
Name |
Type |
O/R |
Description |
settings |
Object |
Required |
Properties bag. List of properties supported:
- type - The type of request to make ("POST" or "GET"), default is "GET".
- url - A string containing the URL to which the request is sent.
- async - By default, all requests are sent asynchronous.
- data - Data to be sent to the server.
- dataType - The type of data that you're expecting back from the server ("xml", "html", "script", "json" or "text").
- timeout - A timeout (in milliseconds) for the request.
- success(data, status, xhr) - A function to be called if the request succeeds. Parameter status can have of the following values: "success", "notmodified", "error", "timeout", "abort", or "parsererror".
- error(xhr, status) - A function to be called if the request fails.
- complete(xhr, status) - A function to be called when the request finishes
- username - A username to be used in response to an HTTP access authentication request.
- password - A password to be used in response to an HTTP access authentication request.
- headers - Headers bag
|
|
bind
|
Void |
Registers a handler with document |
Sytaxis:
object.bind(type, handler, [capture]) Arguments:
Name |
Type |
O/R |
Description |
type |
String |
Required |
Event name |
handler |
Function |
Required |
Handler function |
capture |
Boolean |
Optional |
If true, the handler will be executed during capture phase only |
|
bookmark
|
Variant |
Manages browser history entries. When no arguments passed it returns the current hash value, otherwise adds a page with specifyed hash into the browser history. The hashchange event is not fired at this point. |
Sytaxis:
object.bookmark() Sytaxis: (2)
object.bookmark(hash, [title]) Arguments:
Name |
Type |
O/R |
Description |
hash |
String |
Required |
Hash value. |
title |
String |
Optional |
Title value. |
|
close
|
Void |
Closes Ample SDK fragment. This method can only be called while page is loading. |
Sytaxis:
object.close()
|
config
|
Variant |
Sets or retrieves a parameter. List of parameters:
- version - Read-only. Ample SDK version
- locale - Ample SDK culture
- user-agent - Ample SDK user agent string
- user-locale - User locale
- module-history-fix - fix IE hash problem
- fix-ie-css-transitions - fix IE6-9 transition style property
- enable-css-hover - Enables :hover on all elements
- enable-transitions - Enable/Disable transitions
- enable-style - Enable/Disable style property
- enable-guard - Enable/Disable API validation
|
Sytaxis:
object.config(name) Arguments:
Name |
Type |
O/R |
Description |
name |
String |
Required |
Parameter name |
Sytaxis: (2)
object.config(name, value) Arguments:
Name |
Type |
O/R |
Description |
name |
String |
Required |
Parameter name |
value |
Variant |
Required |
Parameter value |
|
data
|
Variant |
Gets value at named data store for the specified element or sets arbitrary data associated with the specified element. |
Sytaxis:
object.data(element, name) Arguments:
Name |
Type |
O/R |
Description |
element |
Element
|
Required |
The DOM element. |
name |
String |
Required |
A string key name. |
Sytaxis: (2)
object.data(element, name, value) Arguments:
Name |
Type |
O/R |
Description |
element |
Element
|
Required |
The DOM element. |
name |
String |
Required |
A string key name. |
value |
Variant |
Required |
The data value. |
|
extend
|
Object |
Core extensibility API. The source object members get signed automatically. |
Sytaxis:
object.extend(target, source) Arguments:
Name |
Type |
O/R |
Description |
target |
Object |
Required |
Target object for extension. |
source |
Object |
Required |
Source object to extend from. |
Sytaxis: (2)
object.extend(element) Arguments:
Name |
Type |
O/R |
Description |
element |
Function |
Required |
Element definition. Must have Element in its prototype chain.
|
Sytaxis: (3)
object.extend(attribute) Arguments:
Name |
Type |
O/R |
Description |
attribute |
Function |
Required |
Attribute definition. Must have Attr in its prototype chain.
|
Sytaxis: (4)
object.extend(event) Arguments:
Name |
Type |
O/R |
Description |
event |
Function |
Required |
Event interface definition. Must have Event in its prototype chain.
|
Sytaxis: (5)
object.extend(pi) Arguments:
Name |
Type |
O/R |
Description |
pi |
Function |
Required |
Processing instruction definition. Must have ProcessingInstruction in its prototype chain.
|
|
get
|
XMLHttpRequest
|
Loads data from the server using a HTTP GET request. |
Sytaxis:
object.get(url, [data, success]) Arguments:
Name |
Type |
O/R |
Description |
url |
String |
Required |
A string containing the URL to which the request is sent. |
data |
Variant |
Optional |
A map or string that is sent to the server with the request. |
success |
Function |
Optional |
A callback function that is executed if the request succeeds. Consult ajax function for parameters. |
|
guard
|
Void |
Helps validating API in custom extensions. |
Sytaxis:
object.guard(arguments, parameters) Arguments:
Name |
Type |
O/R |
Description |
arguments |
Arguments
|
Required |
arguments object. |
parameters |
Array
|
Required |
array of parameter definitions. Each parameter definition is an array in the following format: {String} name, {Function} type[, {Boolean} optional, {Boolean} allownull] |
|
include
|
Void |
Loads JavaScript file. Calls to ample.include() from within the loaded file will properly resolve relative file locations. |
Sytaxis:
object.include(src) Arguments:
Name |
Type |
O/R |
Description |
src |
String |
Required |
Location of a file. |
|
modal
|
Void |
Sets element in a modal state when element reference provided, Unsets modal state from the modal element if null passed. UI Events originated outside this element get supressed, except for one modal that is fired upon a click outside modal area.
|
Sytaxis:
object.modal(element) Arguments:
Name |
Type |
O/R |
Description |
element |
Element
|
Required |
Element to be set as modal or null to reset. |
|
open
|
Void |
Opens Ample SDK fragment. This method can only be called while page is loading. |
Sytaxis:
object.open()
|
param
|
String |
Creates a serialized representation of an array or object, suitable for use in a URL query string or Ajax request. |
Sytaxis:
object.param(value) Arguments:
Name |
Type |
O/R |
Description |
value |
Variant |
Required |
An array or object to serialize. |
|
post
|
XMLHttpRequest
|
Loads data from the server using a HTTP POST request. |
Sytaxis:
object.post(url, [data, success]) Arguments:
Name |
Type |
O/R |
Description |
url |
String |
Required |
A string containing the URL to which the request is sent. |
data |
Variant |
Optional |
A map or string that is sent to the server with the request. |
success |
Function |
Optional |
A callback function that is executed if the request succeeds. Consult ajax function for parameters. |
|
publish
|
Void |
Signs and publishes source object as member of target. |
Sytaxis:
object.publish(source, name, [target]) Arguments:
Name |
Type |
O/R |
Description |
source |
Object |
Required |
Object to be published. |
name |
String |
Required |
Name of object. |
target |
Object |
Optional |
Target for export. If not specified, window is in use. |
|
query
|
Query
|
jQuery-like API to Ample SDK document. |
Sytaxis:
object.query(query, [context, resolver]) Arguments:
Name |
Type |
O/R |
Description |
query |
String |
Required |
CSS selector. |
context |
Node
|
Optional |
Context object. If not specified, ample document object is in use. |
resolver |
Function |
Optional |
Namespace resolver function. If not specified, selector will match against tag names. |
Sytaxis: (2)
object.query(xml) Arguments:
Name |
Type |
O/R |
Description |
xml |
String |
Required |
Valid XML string. |
Sytaxis: (3)
object.query(element) Arguments:
Name |
Type |
O/R |
Description |
element |
Element
|
Required |
An Ample SDK Element object. |
Sytaxis: (4)
object.query(nodelist) Arguments:
Name |
Type |
O/R |
Description |
nodelist |
NodeList
|
Required |
An Ample SDK NodeList object. |
Sytaxis: (5)
object.query(query) Arguments:
Name |
Type |
O/R |
Description |
query |
Query
|
Required |
Result of other call to ample.query |
|
ready
|
Void |
Registers a handler to be executed when page has been completely loaded. |
Sytaxis:
object.ready(handler) Arguments:
Name |
Type |
O/R |
Description |
handler |
Function |
Required |
Handler function. |
|
resolveUri
|
String |
Resolves uri against base uri. |
Sytaxis:
object.resolveUri(uri, baseUri) Arguments:
Name |
Type |
O/R |
Description |
uri |
String |
Required |
Uri value to resolve. |
baseUri |
String |
Required |
Base uri value to resolve against. |
|
trigger
|
Void |
Triggers an event on document. |
Sytaxis:
object.trigger(type, [detail]) Arguments:
Name |
Type |
O/R |
Description |
type |
String |
Required |
Event name |
detail |
Variant |
Optional |
Event detail |
|
unbind
|
Void |
Unregisters a handler from document |
Sytaxis:
object.unbind(type, handler, [capture]) Arguments:
Name |
Type |
O/R |
Description |
type |
String |
Required |
Event name |
handler |
Function |
Required |
Handler function |
capture |
Boolean |
Optional |
If true, the handler will be executed during capture phase only |
|