Skip to content

Commit 16e2eae

Browse files
devvaannshabose
authored andcommitted
docs: add new files to API docs and fix mentioned issues
1 parent 4443de2 commit 16e2eae

File tree

8 files changed

+382
-31
lines changed

8 files changed

+382
-31
lines changed
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
### Import :
2+
```js
3+
const DefaultDialogs = brackets.getModule("widgets/DefaultDialogs")
4+
```
5+
6+
<a name="module_DefaultDialogs"></a>
7+
8+
## DefaultDialogs
9+
Constants representing dialog IDs
10+
These IDs are used to identify different types of dialogs
11+
12+
13+
* [DefaultDialogs](#module_DefaultDialogs)
14+
* [.DIALOG_ID_ERROR](#module_DefaultDialogs.DIALOG_ID_ERROR) : <code>string</code>
15+
* [.DIALOG_ID_INFO](#module_DefaultDialogs.DIALOG_ID_INFO) : <code>string</code>
16+
* [.DIALOG_ID_SAVE_CLOSE](#module_DefaultDialogs.DIALOG_ID_SAVE_CLOSE) : <code>string</code>
17+
* [.DIALOG_ID_EXT_CHANGED](#module_DefaultDialogs.DIALOG_ID_EXT_CHANGED) : <code>string</code>
18+
* [.DIALOG_ID_EXT_DELETED](#module_DefaultDialogs.DIALOG_ID_EXT_DELETED) : <code>string</code>
19+
* [.DIALOG_ID_CHANGE_EXTENSIONS](#module_DefaultDialogs.DIALOG_ID_CHANGE_EXTENSIONS) : <code>string</code>
20+
21+
<a name="module_DefaultDialogs.DIALOG_ID_ERROR"></a>
22+
23+
### DefaultDialogs.DIALOG\_ID\_ERROR : <code>string</code>
24+
ID for error dialog
25+
26+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
27+
<a name="module_DefaultDialogs.DIALOG_ID_INFO"></a>
28+
29+
### DefaultDialogs.DIALOG\_ID\_INFO : <code>string</code>
30+
ID for information dialog (currently uses the same template as DIALOG_ID_ERROR)
31+
32+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
33+
<a name="module_DefaultDialogs.DIALOG_ID_SAVE_CLOSE"></a>
34+
35+
### DefaultDialogs.DIALOG\_ID\_SAVE\_CLOSE : <code>string</code>
36+
ID for save and close dialog
37+
38+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
39+
<a name="module_DefaultDialogs.DIALOG_ID_EXT_CHANGED"></a>
40+
41+
### DefaultDialogs.DIALOG\_ID\_EXT\_CHANGED : <code>string</code>
42+
ID for `external change detected` dialog
43+
44+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
45+
<a name="module_DefaultDialogs.DIALOG_ID_EXT_DELETED"></a>
46+
47+
### DefaultDialogs.DIALOG\_ID\_EXT\_DELETED : <code>string</code>
48+
ID for `external deletion detected` dialog
49+
50+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
51+
<a name="module_DefaultDialogs.DIALOG_ID_CHANGE_EXTENSIONS"></a>
52+
53+
### DefaultDialogs.DIALOG\_ID\_CHANGE\_EXTENSIONS : <code>string</code>
54+
ID for `change extensions` dialog
55+
56+
**Kind**: static constant of [<code>DefaultDialogs</code>](#module_DefaultDialogs)
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
### Import :
2+
```js
3+
const Dialogs = brackets.getModule("widgets/Dialogs")
4+
```
5+
6+
<a name="DIALOG_BTN_CANCEL"></a>
7+
8+
## DIALOG\_BTN\_CANCEL : <code>string</code>
9+
`CANCEL` dialog button ID
10+
11+
**Kind**: global constant
12+
<a name="DIALOG_BTN_OK"></a>
13+
14+
## DIALOG\_BTN\_OK : <code>string</code>
15+
`OK` dialog button ID
16+
17+
**Kind**: global constant
18+
<a name="DIALOG_BTN_DONTSAVE"></a>
19+
20+
## DIALOG\_BTN\_DONTSAVE : <code>string</code>
21+
`DONT SAVE` dialog button ID
22+
23+
**Kind**: global constant
24+
<a name="DIALOG_BTN_SAVE_AS"></a>
25+
26+
## DIALOG\_BTN\_SAVE\_AS : <code>string</code>
27+
`SAVE AS` dialog button ID
28+
29+
**Kind**: global constant
30+
<a name="DIALOG_CANCELED"></a>
31+
32+
## DIALOG\_CANCELED : <code>string</code>
33+
`CANCELED` dialog button ID
34+
35+
**Kind**: global constant
36+
<a name="DIALOG_BTN_DOWNLOAD"></a>
37+
38+
## DIALOG\_BTN\_DOWNLOAD : <code>string</code>
39+
`DOWNLOAD` dialog button ID
40+
41+
**Kind**: global constant
42+
<a name="DIALOG_BTN_CLASS_PRIMARY"></a>
43+
44+
## DIALOG\_BTN\_CLASS\_PRIMARY : <code>string</code>
45+
Primary button class name
46+
47+
**Kind**: global constant
48+
<a name="DIALOG_BTN_CLASS_NORMAL"></a>
49+
50+
## DIALOG\_BTN\_CLASS\_NORMAL : <code>string</code>
51+
Normal button class name
52+
53+
**Kind**: global constant
54+
<a name="DIALOG_BTN_CLASS_LEFT"></a>
55+
56+
## DIALOG\_BTN\_CLASS\_LEFT : <code>string</code>
57+
Left-aligned button class name
58+
59+
**Kind**: global constant
60+
<a name="showModalDialogUsingTemplate"></a>
61+
62+
## showModalDialogUsingTemplate(template, [autoDismiss]) ⇒ [<code>Dialog</code>](#new_Dialog_new)
63+
Creates a new modal dialog from a given template.
64+
The template can either be a string or a jQuery object representing a DOM node that is *not* in the current DOM.
65+
66+
**Kind**: global function
67+
68+
| Param | Type | Description |
69+
| --- | --- | --- |
70+
| template | <code>string</code> | A string template or jQuery object to use as the dialog HTML. |
71+
| [autoDismiss] | <code>boolean</code> | Whether 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. |
72+
73+
<a name="showModalDialog"></a>
74+
75+
## showModalDialog(dlgClass, [title], [message], [buttons], [autoDismiss]) ⇒ [<code>Dialog</code>](#new_Dialog_new)
76+
Creates a new general purpose modal dialog using the default template and the template variables given
77+
as parameters as described.
78+
79+
**Kind**: global function
80+
81+
| Param | Type | Description |
82+
| --- | --- | --- |
83+
| dlgClass | <code>string</code> | A class name identifier for the dialog. Typically one of DefaultDialogs.* |
84+
| [title] | <code>string</code> | The title of the dialog. Can contain HTML markup. Defaults to "". |
85+
| [message] | <code>string</code> | The message to display in the dialog. Can contain HTML markup. Defaults to "". |
86+
| [buttons] | <code>Array.&lt;{className: string, id: string, text: string, tooltip:string}&gt;</code> | 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_* |
87+
| [autoDismiss] | <code>boolean</code> | Whether 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. |
88+
89+
<a name="showConfirmDialog"></a>
90+
91+
## showConfirmDialog(title, message, [autoDismiss]) ⇒ [<code>Dialog</code>](#new_Dialog_new)
92+
Display a confirmation dialog with `OK` and `CANCEL` button
93+
94+
**Kind**: global function
95+
**Returns**: [<code>Dialog</code>](#new_Dialog_new) - the created dialog instance
96+
97+
| Param | Type | Description |
98+
| --- | --- | --- |
99+
| title | <code>string</code> | dialog title |
100+
| message | <code>string</code> | message to display in the dialog |
101+
| [autoDismiss] | <code>boolean</code> | whether to automatically dismiss the dialog or not |
102+
103+
<a name="showInfoDialog"></a>
104+
105+
## showInfoDialog(title, message, [autoDismiss]) ⇒ [<code>Dialog</code>](#new_Dialog_new)
106+
Display information dialog
107+
108+
**Kind**: global function
109+
**Returns**: [<code>Dialog</code>](#new_Dialog_new) - the created dialog instance
110+
111+
| Param | Type | Description |
112+
| --- | --- | --- |
113+
| title | <code>string</code> | dialog title |
114+
| message | <code>string</code> | message to display in the dialog |
115+
| [autoDismiss] | <code>boolean</code> | whether to automatically dismiss the dialog or not |
116+
117+
<a name="showErrorDialog"></a>
118+
119+
## showErrorDialog(title, message, [autoDismiss]) ⇒ [<code>Dialog</code>](#new_Dialog_new)
120+
Display error dialog
121+
122+
**Kind**: global function
123+
**Returns**: [<code>Dialog</code>](#new_Dialog_new) - the created dialog instance
124+
125+
| Param | Type | Description |
126+
| --- | --- | --- |
127+
| title | <code>string</code> | dialog title |
128+
| message | <code>string</code> | message to display in the dialog |
129+
| [autoDismiss] | <code>boolean</code> | whether to automatically dismiss the dialog or not |
130+
131+
<a name="cancelModalDialogIfOpen"></a>
132+
133+
## cancelModalDialogIfOpen(dlgClass, [buttonId])
134+
Immediately closes any dialog instances with the given class. The dialog callback for each instance will
135+
be called with the special buttonId DIALOG_CANCELED (note: callback is run asynchronously).
136+
137+
**Kind**: global function
138+
139+
| Param | Type | Description |
140+
| --- | --- | --- |
141+
| dlgClass | <code>string</code> | The class name identifier for the dialog. |
142+
| [buttonId] | <code>string</code> | The button id to use when closing the dialog. Defaults to DIALOG_CANCELED |
143+
144+
<a name="addLinkTooltips"></a>
145+
146+
## addLinkTooltips(elementOrDialog)
147+
Ensures that all <a> tags with a URL have a tooltip showing the same URL
148+
149+
**Kind**: global function
150+
151+
| Param | Type | Description |
152+
| --- | --- | --- |
153+
| elementOrDialog | <code>jQueryObject</code> \| [<code>Dialog</code>](#new_Dialog_new) | Dialog intance, or root of other DOM tree to add tooltips to |
154+

docs/API-Reference/widgets/DropdownButton.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ DropdownButton dispatches the following events:
5252
* [DropdownButton(label, items, [itemRenderer], [options])](#DropdownButton)
5353
* [.items](#DropdownButton+items) : <code>Array.&lt;\*&gt;</code>
5454
* [.itemsSearchFilterText](#DropdownButton+itemsSearchFilterText) : <code>null</code>
55+
* [.$button](#DropdownButton+$button) : <code>jQueryObject</code>
56+
* [.$dropdown](#DropdownButton+$dropdown) : <code>jQueryObject</code>
5557
* [.dropdownExtraClasses](#DropdownButton+dropdownExtraClasses) : <code>string</code>
5658
* [.setButtonLabel(label)](#DropdownButton+setButtonLabel)
5759
* [.isOpen()](#DropdownButton+isOpen)
@@ -75,6 +77,18 @@ Items in dropdown list - may be changed any time dropdown isn't open
7577
This is filter text corresponding to each items. it will be used to filter the items based on
7678
the keyboard key presses the user does to enter search filter in popup.
7779

80+
**Kind**: instance property of [<code>DropdownButton</code>](#DropdownButton)
81+
<a name="DropdownButton+$button"></a>
82+
83+
### dropdownButton.$button : <code>jQueryObject</code>
84+
The clickable button. Available as soon as the DropdownButton is constructed.
85+
86+
**Kind**: instance property of [<code>DropdownButton</code>](#DropdownButton)
87+
<a name="DropdownButton+$dropdown"></a>
88+
89+
### dropdownButton.$dropdown : <code>jQueryObject</code>
90+
The dropdown element. Only non-null while open.
91+
7892
**Kind**: instance property of [<code>DropdownButton</code>](#DropdownButton)
7993
<a name="DropdownButton+dropdownExtraClasses"></a>
8094

docs/API-Reference/widgets/NotificationUI.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ The `createFromTemplate` API can be configured with numerous options. See API op
4646

4747
* [widgets/NotificationUI](#module_widgets/NotificationUI)
4848
* [.API](#module_widgets/NotificationUI..API)
49-
* [.NOTIFICATION_STYLES_CSS_CLASS](#module_widgets/NotificationUI..NOTIFICATION_STYLES_CSS_CLASS) : <code>object</code>
50-
* [.CLOSE_REASON](#module_widgets/NotificationUI..CLOSE_REASON) : <code>object</code>
49+
* [.NOTIFICATION_STYLES_CSS_CLASS](#module_widgets/NotificationUI..NOTIFICATION_STYLES_CSS_CLASS) : <code>enum</code>
50+
* [.CLOSE_REASON](#module_widgets/NotificationUI..CLOSE_REASON) : <code>enum</code>
5151
* [.createFromTemplate(template, [elementID], [options])](#module_widgets/NotificationUI..createFromTemplate) ⇒ <code>Notification</code>
5252
* [.createToastFromTemplate(title, template, [options])](#module_widgets/NotificationUI..createToastFromTemplate) ⇒ <code>Notification</code>
5353

@@ -59,16 +59,34 @@ This section outlines the properties and methods available in this module
5959
**Kind**: inner property of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
6060
<a name="module_widgets/NotificationUI..NOTIFICATION_STYLES_CSS_CLASS"></a>
6161

62-
### widgets/NotificationUI.NOTIFICATION\_STYLES\_CSS\_CLASS : <code>object</code>
62+
### widgets/NotificationUI.NOTIFICATION\_STYLES\_CSS\_CLASS : <code>enum</code>
6363
CSS class names for notification styles.
6464

65-
**Kind**: inner constant of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
65+
**Kind**: inner enum of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
66+
**Properties**
67+
68+
| Name | Type | Default |
69+
| --- | --- | --- |
70+
| INFO | <code>string</code> | <code>&quot;style-info&quot;</code> |
71+
| WARNING | <code>string</code> | <code>&quot;style-warning&quot;</code> |
72+
| SUCCESS | <code>string</code> | <code>&quot;style-success&quot;</code> |
73+
| ERROR | <code>string</code> | <code>&quot;style-error&quot;</code> |
74+
| DANGER | <code>string</code> | <code>&quot;style-danger&quot;</code> |
75+
6676
<a name="module_widgets/NotificationUI..CLOSE_REASON"></a>
6777

68-
### widgets/NotificationUI.CLOSE\_REASON : <code>object</code>
78+
### widgets/NotificationUI.CLOSE\_REASON : <code>enum</code>
6979
Closing notification reason.
7080

71-
**Kind**: inner constant of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
81+
**Kind**: inner enum of [<code>widgets/NotificationUI</code>](#module_widgets/NotificationUI)
82+
**Properties**
83+
84+
| Name | Type | Default |
85+
| --- | --- | --- |
86+
| TIMEOUT | <code>string</code> | <code>&quot;closeTimeout&quot;</code> |
87+
| CLICK_DISMISS | <code>string</code> | <code>&quot;clickDismiss&quot;</code> |
88+
| CLOSE_BTN_CLICK | <code>string</code> | <code>&quot;closeBtnClick&quot;</code> |
89+
7290
<a name="module_widgets/NotificationUI..createFromTemplate"></a>
7391

7492
### widgets/NotificationUI.createFromTemplate(template, [elementID], [options]) ⇒ <code>Notification</code>

src/widgets/DefaultDialogs.js

Lines changed: 40 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,50 @@
1919
*
2020
*/
2121

22+
// @INCLUDE_IN_API_DOCS
23+
2224
define(function (require, exports, module) {
2325

26+
/**
27+
* Constants representing dialog IDs
28+
* These IDs are used to identify different types of dialogs
29+
*
30+
* @module DefaultDialogs
31+
*/
32+
33+
/**
34+
* ID for error dialog
35+
* @constant {string}
36+
*/
37+
exports.DIALOG_ID_ERROR = "error-dialog";
38+
39+
/**
40+
* ID for information dialog (currently uses the same template as DIALOG_ID_ERROR)
41+
* @constant {string}
42+
*/
43+
exports.DIALOG_ID_INFO = "error-dialog"; // uses the same template for now--could be different in future
44+
45+
/**
46+
* ID for save and close dialog
47+
* @constant {string}
48+
*/
49+
exports.DIALOG_ID_SAVE_CLOSE = "save-close-dialog";
50+
51+
/**
52+
* ID for `external change detected` dialog
53+
* @constant {string}
54+
*/
55+
exports.DIALOG_ID_EXT_CHANGED = "ext-changed-dialog";
56+
57+
/**
58+
* ID for `external deletion detected` dialog
59+
* @constant {string}
60+
*/
61+
exports.DIALOG_ID_EXT_DELETED = "ext-deleted-dialog";
2462

2563
/**
26-
* List of constants for the default dialogs IDs.
64+
* ID for `change extensions` dialog
65+
* @constant {string}
2766
*/
28-
exports.DIALOG_ID_ERROR = "error-dialog";
29-
exports.DIALOG_ID_INFO = "error-dialog"; // uses the same template for now--could be different in future
30-
exports.DIALOG_ID_SAVE_CLOSE = "save-close-dialog";
31-
exports.DIALOG_ID_EXT_CHANGED = "ext-changed-dialog";
32-
exports.DIALOG_ID_EXT_DELETED = "ext-deleted-dialog";
3367
exports.DIALOG_ID_CHANGE_EXTENSIONS = "change-marked-extensions";
3468
});

0 commit comments

Comments
 (0)