window

Contains utility functions for opening dialogs.

Methods:

alert
confirm
dialog
error
image_preview
select_dialog

Direct Link

alert

( [title], text, [options] )
Builds a ProBoards alert dialog box with a single 'Ok' button. If options is supplied, title must be supplied as well.

Parameters

  • [title] String Optional
    The title of this dialog box.
    Defaults To: Alert
  • text String
    The text for this dialog.
  • [options] Object Optional
    Takes an options object that accepts any options to pb.window.dialog.

Direct Link

confirm

( question, onYes, [options] )
Builds a ProBoards confirmation dialog box with the option to choose 'Yes' or 'No'.

Parameters

  • question String
    The text for this dialog.
  • onYes Function
    Function to run if they choose 'Yes'.
  • [options] Object Optional
    Additional options:
    • [title] String Optional
      The title of the dialog box.
      Defaults To: Confirm
    • [overlay] Boolean Optional
      True will apply an overlay over the page when the confirmation dialog is open.
      Defaults To: false
    • [onNo] Function Optional
      Function to run if they choose 'No'.
    • [onClose] Function Optional
      Function to run if they close the dialog without making a selection.

Returns

JQuery Object
The created confirm element.

Direct Link

dialog

( ID, options )
Builds a ProBoards dialog box. Specifying an existing ID will allow you to re-use an existing dialog. For more information on the options that can be passed in to the options Object, please see the API documentation for jQueryUI's dialog widget.

Parameters

  • ID String
    The ID of this dialog.
  • options Object
    This accepts any options that are allowed by jQuery UI's dialog widget.

Returns

JQuery Object
The created dialog element.

Direct Link

error

( HTML )
Displays a simple ProBoards error dialog box.

Parameters

  • HTML String
    The HTML to put in the dialog box.

Direct Link

image_preview

( URL )
Displays a large preview dialog for full size images.

Parameters

  • URL String
    The URL of the image for which to display a preview.

Direct Link

select_dialog

( options )
Builds a dialog with one or more selectable items and calls a return function on finish.

Parameters

  • options Object
    Additional options:
    • [title] String Optional
      The title of this selection dialog.
      Defaults To: Selection
    • [selected] Array Optional
      IDs of options that will start selected.
    • [max] Number Optional
      The maximum number of selectable choices. A value of 0 means there is no limit. A value of 1 will make the list a click-to-select list.
    • [options] Array Optional
      Array of Objects where each object contains a label and value:
      • label String
        Option label.
      • value String|Number
        Option ID/value.
    • [onComplete] Function Optional
      Function called when selections have been made. The first argument is an array of selected IDs/values.

Returns

JQuery Object
The created select dialog element.