You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Defines hooks to assist with module initialization.This module defines 3 methods for client modules to attach callbacks: - htmlReady - When the main application template is rendered - extensionsLoaded - When the extension manager has loaded all extensions - appReady - When Brackets completes loading all modules and extensionsThese are *not* jQuery events. Each method is similar to $(document).readyin that it will call the handler immediately if brackets is already doneloading.
9
+
Defines hooks to assist with module initialization.
10
+
11
+
This module defines 3 methods for client modules to attach callbacks:
12
+
- htmlReady - When the main application template is rendered
13
+
- extensionsLoaded - When the extension manager has loaded all extensions
14
+
- appReady - When Brackets completes loading all modules and extensions
15
+
16
+
These are *not* jQuery events. Each method is similar to $(document).ready
17
+
in that it will call the handler immediately if brackets is already done
18
+
loading.
19
+
20
+
**Kind**: global constant
21
+
<aname="HTML_READY"></a>
22
+
23
+
## HTML\_READY : <code>string</code>
24
+
Fires when the base htmlContent/main-view.html is loaded
25
+
26
+
**Kind**: global constant
27
+
<aname="APP_READY"></a>
28
+
29
+
## APP\_READY : <code>string</code>
30
+
Fires when all extensions are loaded
31
+
32
+
**Kind**: global constant
33
+
<aname="EXTENSIONS_LOADED"></a>
34
+
35
+
## EXTENSIONS\_LOADED : <code>string</code>
36
+
Fires after extensions have been loaded
10
37
11
38
**Kind**: global constant
12
39
<aname="appReady"></a>
13
40
14
41
## appReady(handler)
15
-
Adds a callback for the ready hook. Handlers are called afterhtmlReady is done, the initial project is loaded, and all extensions areloaded.
42
+
Adds a callback for the ready hook. Handlers are called after
43
+
htmlReady is done, the initial project is loaded, and all extensions are
44
+
loaded.
16
45
17
46
**Kind**: global function
18
47
@@ -23,7 +52,8 @@ Adds a callback for the ready hook. Handlers are called afterhtmlReady is done,
23
52
<aname="htmlReady"></a>
24
53
25
54
## htmlReady(handler)
26
-
Adds a callback for the htmlReady hook. Handlers are called after themain application html template is rendered.
55
+
Adds a callback for the htmlReady hook. Handlers are called after the
56
+
main application html template is rendered.
27
57
28
58
**Kind**: global function
29
59
@@ -34,7 +64,8 @@ Adds a callback for the htmlReady hook. Handlers are called after themain appli
34
64
<aname="extensionsLoaded"></a>
35
65
36
66
## extensionsLoaded(handler)
37
-
Adds a callback for the extensionsLoaded hook. Handlers are called after theextensions have been loaded
67
+
Adds a callback for the extensionsLoaded hook. Handlers are called after the
Sorted array of all the color names in the CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)and "rebeccapurple" from CSS Color Module Level 4
9
+
Sorted array of all the color names in the CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)
10
+
and "rebeccapurple" from CSS Color Module Level 4
10
11
11
12
**Kind**: global constant
12
13
<aname="@type"></a>
13
14
14
15
## @type : <code>RegExp</code>
15
-
Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits),rgb()/rgba() function format, hsl()/hsla() function format, 0x notation formator color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)or "rebeccapurple" from CSS Color Module Level 4.
16
+
Regular expression that matches reasonably well-formed colors in hex format (3 or 6 digits),
17
+
rgb()/rgba() function format, hsl()/hsla() function format, 0x notation format
18
+
or color name format according to CSS Color Module Level 3 (http://www.w3.org/TR/css3-color/)
Utilities functions to display deprecation warning in the console.
10
10
11
11
**Kind**: global variable
12
-
<aname="_trimStack"></a>
13
-
14
-
## \_trimStack()
15
-
Trim the stack so that it does not have the call to this module,and all the calls to require.js to load the extension that showsthis deprecation warning.
Show a deprecation warning if there are listeners for the event``` DeprecationWarning.deprecateEvent(exports, MainViewManager, "workingSetAdd", "workingSetAdd", "DocumentManager.workingSetAdd", "MainViewManager.workingSetAdd");```
29
+
Show a deprecation warning if there are listeners for the event
30
+
31
+
```
32
+
DeprecationWarning.deprecateEvent(exports,
33
+
MainViewManager,
34
+
"workingSetAdd",
35
+
"workingSetAdd",
36
+
"DocumentManager.workingSetAdd",
37
+
"MainViewManager.workingSetAdd");
38
+
```
35
39
36
40
**Kind**: global function
37
41
@@ -46,13 +50,14 @@ Show a deprecation warning if there are listeners for the event``` Deprecat
46
50
47
51
<aname="deprecateConstant"></a>
48
52
49
-
## deprecateConstant(old, new)
53
+
## deprecateConstant(obj, oldId, newId)
50
54
Create a deprecation warning and action for updated constants
Copy file name to clipboardExpand all lines: docs/API-Reference/utils/DragAndDrop.md
+6-16Lines changed: 6 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,33 +15,23 @@ Returns true if the drag and drop items contains valid drop objects.
15
15
| --- | --- | --- |
16
16
| items | <code>Array.<DataTransferItem></code> | Array of items being dragged |
17
17
18
-
<aname="stopURIListPropagation"></a>
19
-
20
-
## stopURIListPropagation(files, event)
21
-
Determines if the event contains a type list that has a URI-list.If it does and contains an empty file list, then what is being dropped is a URL.If that is true then we stop the event propagation and default behavior to save Brackets editor from the browser taking over.
22
-
23
-
**Kind**: global function
24
-
25
-
| Param | Type | Description |
26
-
| --- | --- | --- |
27
-
| files | <code>Array.<File></code> | Array of File objects from the event datastructure. URLs are the only drop item that would contain a URI-list. |
28
-
| event | <code>event</code> | The event datastucture containing datatransfer information about the drag/drop event. Contains a type list which may or may not hold a URI-list depending on what was dragged/dropped. Interested if it does. |
29
-
30
18
<aname="openDroppedFiles"></a>
31
19
32
-
## openDroppedFiles(files) ⇒ <code>Promise</code>
20
+
## openDroppedFiles(paths) ⇒ <code>Promise</code>
33
21
Open dropped files
34
22
35
23
**Kind**: global function
36
-
**Returns**: <code>Promise</code> - Promise that is resolved if all files are opened, or rejected if there was an error.
24
+
**Returns**: <code>Promise</code> - Promise that is resolved if all files are opened, or rejected
25
+
if there was an error.
37
26
38
27
| Param | Type | Description |
39
28
| --- | --- | --- |
40
-
|files| <code>Array.<string></code> | Array of files dropped on the application. |
29
+
|paths| <code>Array.<string></code> | Array of file paths dropped on the application. |
41
30
42
31
<aname="attachHandlers"></a>
43
32
44
33
## attachHandlers()
45
-
Attaches global drag & drop handlers to this window. This enables dropping files/folders to open them, and alsoprotects the Brackets app from being replaced by the browser trying to load the dropped file in its place.
34
+
Attaches global drag & drop handlers to this window. This enables dropping files/folders to open them, and also
35
+
protects the Brackets app from being replaced by the browser trying to load the dropped file in its place.
### new DropdownEventHandler($list, selectionCallback, closeCallback, keyDownCallback)
28
-
Object to handle events for a dropdown list.DropdownEventHandler handles these events:Mouse:- click - execute selection callback and dismiss list- mouseover - highlight item- mouseleave - remove mouse highlightingKeyboard:- Enter - execute selection callback and dismiss list- Esc - dismiss list- Up/Down - change selection- PageUp/Down - change selectionItems whose "a" has the .disabled class do not respond to selection.
20
+
Object to handle events for a dropdown list.
21
+
22
+
DropdownEventHandler handles these events:
23
+
24
+
Mouse:
25
+
- click - execute selection callback and dismiss list
26
+
- mouseover - highlight item
27
+
- mouseleave - remove mouse highlighting
28
+
29
+
Keyboard:
30
+
- Enter - execute selection callback and dismiss list
31
+
- Esc - dismiss list
32
+
- Up/Down - change selection
33
+
- PageUp/Down - change selection
34
+
35
+
Items whose "a" has the .disabled class do not respond to selection.
29
36
30
37
31
38
| Param | Type | Description |
@@ -41,81 +48,11 @@ Object to handle events for a dropdown list.DropdownEventHandler handles these
41
48
Public open method
42
49
43
50
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
Try to select item at the given index. If it's disabled or a divider, keep trying by incrementingindex by 'direction' each time (wrapping around if needed).
83
-
84
-
**Kind**: instance method of [<code>DropdownEventHandler</code>](#DropdownEventHandler)
85
-
86
-
| Param | Type | Description |
87
-
| --- | --- | --- |
88
-
| index | <code>number</code> | If out of bounds, index either wraps around to remain in range (e.g. -1 yields last item, length+1 yields 2nd item) or if noWrap set, clips instead (e.g. -1 yields first item, length+1 yields last item). |
89
-
| direction | <code>number</code> | Either +1 or -1 |
90
-
|[noWrap]| <code>boolean</code> | Clip out of range index values instead of wrapping. Default false (wrap). |
0 commit comments