Skip to main content

Dialogs

Import :

const Dialogs = brackets.getModule("widgets/Dialogs")

DIALOG_BTN_CANCEL : string

CANCEL dialog button ID

Kind: global constant

DIALOG_BTN_OK : string

OK dialog button ID

Kind: global constant

DIALOG_BTN_DONTSAVE : string

DONT SAVE dialog button ID

Kind: global constant

DIALOG_BTN_SAVE_AS : string

SAVE AS dialog button ID

Kind: global constant

DIALOG_CANCELED : string

CANCELED dialog button ID

Kind: global constant

DIALOG_BTN_DOWNLOAD : string

DOWNLOAD dialog button ID

Kind: global constant

DIALOG_BTN_CLASS_PRIMARY : string

Primary button class name

Kind: global constant

DIALOG_BTN_CLASS_NORMAL : string

Normal button class name

Kind: global constant

DIALOG_BTN_CLASS_LEFT : string

Left-aligned button class name

Kind: global constant

showModalDialogUsingTemplate(template, [autoDismiss]) ⇒ Dialog

Creates a new modal dialog from a given template. The template can either be a string or a jQuery object representing a DOM node that is not in the current DOM.

Kind: global function

ParamTypeDescription
templatestringA string template or jQuery object to use as the dialog HTML.
[autoDismiss]booleanWhether to automatically dismiss the dialog when one of the buttons is clicked. Default true. If false, you'll need to manually handle button clicks and the Esc key, and dismiss the dialog yourself when ready by calling close() on the returned dialog.

showModalDialog(dlgClass, [title], [message], buttons, [autoDismiss]) ⇒ Dialog

Creates a new general purpose modal dialog using the default template and the template variables given as parameters as described.

Kind: global function

ParamTypeDescription
dlgClassstringA class name identifier for the dialog. Typically one of DefaultDialogs.*
[title]stringThe title of the dialog. Can contain HTML markup. Defaults to "".
[message]stringThe message to display in the dialog. Can contain HTML markup. Defaults to "".
buttonsArray.<Object>An array of buttons where each button has a class, id tooltip, and text property. The id is used in "data-button-id". Defaults to a single Ok button. Typically className is one of DIALOG_BTN_CLASS_, id is one of DIALOG_BTN_
[autoDismiss]booleanWhether to automatically dismiss the dialog when one of the buttons is clicked. Default true. If false, you'll need to manually handle button clicks and the Esc key, and dismiss the dialog yourself when ready by calling close() on the returned dialog.

showConfirmDialog(title, message, [autoDismiss]) ⇒ Dialog

Display a confirmation dialog with OK and CANCEL button

Kind: global function
Returns: Dialog - the created dialog instance

ParamTypeDescription
titlestringdialog title
messagestringmessage to display in the dialog
[autoDismiss]booleanwhether to automatically dismiss the dialog or not

showInfoDialog(title, message, [autoDismiss]) ⇒ Dialog

Display information dialog

Kind: global function
Returns: Dialog - the created dialog instance

ParamTypeDescription
titlestringdialog title
messagestringmessage to display in the dialog
[autoDismiss]booleanwhether to automatically dismiss the dialog or not

showErrorDialog(title, message, [autoDismiss]) ⇒ Dialog

Display error dialog

Kind: global function
Returns: Dialog - the created dialog instance

ParamTypeDescription
titlestringdialog title
messagestringmessage to display in the dialog
[autoDismiss]booleanwhether to automatically dismiss the dialog or not

cancelModalDialogIfOpen(dlgClass, [buttonId])

Immediately closes any dialog instances with the given class. The dialog callback for each instance will be called with the special buttonId DIALOG_CANCELED (note: callback is run asynchronously).

Kind: global function

ParamTypeDescription
dlgClassstringThe class name identifier for the dialog.
[buttonId]stringThe button id to use when closing the dialog. Defaults to DIALOG_CANCELED

addLinkTooltips(elementOrDialog)

Ensures that all anchor tags with a URL have a tooltip showing the same URL

Kind: global function

ParamTypeDescription
elementOrDialogjQueryObject | DialogDialog intance, or root of other DOM tree to add tooltips to