namespace SAPO.Component.Dialog2
Authors:
jose.p.dias AT co.sapo.pt
nuno-miguel-jesus AT telecom.pt
Since:
February 2012 requires SAPO.Dom.Event

Function Summary
DOMElement alert (String msg, Function cb, Object o)
DOMElement confirm (String msg, Function cb, Object o)
DOMElement notify (String msg, Function cb, Object o)
DOMElement prompt (String msg, String defaultVal, Function cb, Object o)

Function Details

function alert

DOMElement alert(String msg, Function cb, Object o)
Parameters:
msg message to display
cb callback function
o options
  • [ Number[2] dims ] dialog dimensions (defaults to [350, 140])
  • [ String title ] title to display on header
  • [ DomElement parent ] where to instantiate the dialog. by default the parent is document.body
  • [ Number[2] pos ] defaults to parent center
  • [ Boolean skipCenter ] defaults to false
  • [ Number dismissIn ] in seconds. defaults to undefined.
  • [ Object[] buttons ] buttons to display. defaults to 'ok'

function confirm

DOMElement confirm(String msg, Function cb, Object o)
Parameters:
msg message to display
cb callback function
o options
  • [ Number[2] dims ] dialog dimensions (defaults to [350, 140])
  • [ String title ] title to display on header
  • [ DomElement parent ] where to instantiate the dialog. by default the parent is document.body
  • [ Number[2] pos ] defaults to parent center
  • [ Boolean skipCenter ] defaults to false
  • [ Number dismissIn ] in seconds. defaults to undefined.
  • [ Object[] buttons ] buttons to display. defaults to 'ok' and 'cancel'

function notify

DOMElement notify(String msg, Function cb, Object o)
Parameters:
msg message to display
cb callback function - this parameter is not currently in use
o options
  • [ Number[2] dims ] dialog dimensions (defaults to [250, 60])
  • [ String title ] title to display on header
  • [ DomElement parent ] where to instantiate the dialog. by default the parent is document.body
  • [ Number dismissIn ] in seconds. defaults to 3
  • [ Object[] buttons ] buttons to display. defaults to 'ok'

function prompt

DOMElement prompt(String msg, String defaultVal, Function cb, Object o)
Parameters:
msg message to display
defaultVal default value
cb callback function
o options
  • [ Number[2] dims ] dialog dimensions (defaults to [350, 140])
  • [ String title ] title to display on header
  • [ DomElement parent ] where to instantiate the dialog. by default the parent is document.body
  • [ Number[2] pos ] defaults to parent center
  • [ Boolean skipCenter ] defaults to false
  • [ Number dismissIn ] in seconds. defaults to undefined.
  • [ Object[] buttons ] buttons to display. defaults to 'ok' and 'cancel'