Skip to main content

gadgets.MiniMessage

Constructor​

gadgets.MiniMessage​

gadgets.MiniMessage(opt_moduleId, opt_container)

A constructor that creates a message.

Parameter​
NameTypeDescription
opt_moduleIdStringModule ID.
opt_containerElementHTML container element that displays a message.
Sample​
var msg = gadgets.MiniMessage();

Method​

gadgets.MiniMessage.createDismissibleMessage​

Element createDismissibleMessage(message, opt_callback)

Creates a message that the user can close.

Parameter​
NameTypeDescription
messageStringObject
opt_callbackFunctionThe callback function that is called when the message is closed.
Return value​
TypeDescription
ElementHTML element of the generated message.
Sample​
var msg = gadgets.MiniMessage();
msg.createDismissibleMessage("This is a high score.");

gadgets.MiniMessage.createStaticMessage​

Element createStaticMessage(message)

Creates a static message that can only be closed with dissmissMessage().

Parameter​
NameTypeDescription
messageStringObject
Return value​
TypeDescription
ElementHTML element of the generated message.
Sample​
var msg = gadgets.MiniMessage();
msg.createStaticMessage("This is a high score.");

gadgets.MiniMessage.createTimerMessage​

Element createTimerMessage(message, seconds, opt_callback)

Creates a message that is displayed for only the specified number of seconds.

Parameter​
NameTypeDescription
messageStringObject
secondsnumberNumber of seconds until the message closes.
opt_callbackFunctionThe callback function that is called when the message is closed.
Return value​
TypeDescription
ElementHTML element of the generated message.
Sample​
var msg = gadgets.MiniMessage();
msg.createTimerMessage("This is a high score.", 5);

gadgets.MiniMessage.dismissMessage​

dismissMessage(message)

Closes the message.

Parameter​
NameTypeDescription
messageStringObject
Return value​

None

Sample​
var msg = gadgets.MiniMessage();
var m = msg.createStaticMessage("This is a high score.");
msg.dismissMessage(m);

Revision History​

  • 12/2010
    • Initial Release.