Awaken Scripting User Guide |
|||||
|
|||||
Name
|
Required / Optional
|
Explanation
|
title
|
Optional
|
The title to use within the toast. Defaults to "" (blank).
|
message
|
Optional
|
The text to display in the body of the toast. Defaults to "" (blank).
|
duration
|
Optional
|
After the toast has been displayed maximised for 2 seconds, the duration in milliseconds that the toast will displayed minimised. Specify 0 to leave open until user closes it, defaults to 5000.
|
Name
|
Required / Optional
|
Explanation
|
text
|
Required
|
The text to display in the body of the toast.
|
type
|
Optional
|
The type of toast to display (Script.Toast.Type.Success, Script.Toast.Type.Error, Script.Toast.Type.Warning, Script.Toast.Type.Information or Script.Toast.Type.Loading). Defaults to Script.Toast.TypeInformation.
|
title
|
Optional
|
The title to use within the toast. Defaults to "" (blank).
|
duration
|
Optional
|
After the toast has been displayed maximised for 2 seconds, the duration in milliseconds that the toast will displayed minimised. Specify 0 to leave open until user closes it, defaults to 5000.
|
closable
|
Optional
|
Boolean (true or false). Specifies whether the user is able to manually close the toast. Note that if the duration is set to 0, then this is forced to true. Defaults to true.
|
id
|
Optional
|
Provide a unique identifier to be able to refer back to at a later date (e.g, to remove it). The id is returned from the Show function, and if the id of a created toast is the same as an existing toast then it will replace the existing toast. If an id is not specified, one is generated automatically.
|
Script.Toast.Show(
"Retrieving information for: " + [var_csCallerName],
Script.Toast.Type.Loading,
"Retrieving Customer Details",
0,
true,
"customerDetails"
);
|
Name
|
Required / Optional
|
Explanation
|
text
|
Required
|
The text to display in the body of the toast.
|
title
|
Optional
|
The title to use within the toast. Defaults to "" (blank).
|
type
|
Optional
|
The type of toast to display (Script.Toast.Type.Success, Script.Toast.Type.Error, Script.Toast.Type.Warning, Script.Toast.Type.Information or Script.Toast.Type.Loading). Defaults to Script.Toast.TypeInformation.
|
initialShowDuration
|
Optional
|
How long in milliseconds the toast is initially displayed maximised. Specify 0 to never appear maximised, defaults to 2000.
|
duration
|
Optional
|
After the toast has been displayed maximised for 2 seconds, the duration in milliseconds that the toast will displayed minimised. Specify 0 to leave open until user closes it, defaults to 5000.
|
closable
|
Optional
|
Boolean (true or false). Specifies whether the user is able to manually close the toast. Note that if the duration is set to 0, then this is forced to true. Defaults to true.
|
id
|
Optional
|
Provide a unique identifier to be able to refer back to at a later date (e.g, to remove it). The id is returned from the Show function, and if the id of a created toast is the same as an existing toast then it will replace the existing toast. If an id is not specified, one is generated automatically. Mutually exclusive with sender.
|
sender
|
Optional
|
Provide a JavaScript object containing an id and name. The id provided will function the same as the id above, and the name will be displayed as faded text below the message. Mutually exclusive with id.
|
minimize
|
Optional
|
Boolean (true or false). Specifies whether the toast will minimise after the initialShowDuration, or remain maximised for both the initialShowDuration and duration. Defaults to true.
|
icon
|
Optional
|
Provide a Font Awesome icon name to change the icon that is displayed on the toast. Only icon names that are available to the version of Font Awesome listed in the Third Party Libraries are available, and it is possible to specify the colour of the icon from a limited list of fa-white, fa-grey, fa-black, fa-red, fa-orange, fa-yellow, and fa-green. Default is specified by the type.
|
Script.Toast.Show({
id: "BasketToast",
title: "Item added to basket",
text: [Selected Quantity] + "x " + [Product Name],
icon: "fa-cart-arrow-down fa-green",
initialShowDuration: 3000,
duration: 7000
});
|
var myToast = Script.Toast.Success("Title", "Text", 0);
if (myCondition == "yes") { Script.Toast.Hide(myToast); }
|