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
Scans all the given Documents for changes on disk, and sorts them into four buckets,populating the corresponding arrays: toReload - changed on disk; unchanged within Brackets toClose - deleted on disk; unchanged within Brackets editConflicts - changed on disk; also dirty in Brackets deleteConflicts - deleted on disk; also dirty in Brackets
42
-
43
-
**Kind**: global function
44
-
**Returns**: <code>$.Promise</code> - Resolved when all scanning done, or rejected immediately if there's any error while reading file timestamps. Errors are logged but no UI is shown.
45
-
46
-
| Param | Type |
47
-
| --- | --- |
48
-
| docs | <code>Array.<Document></code> |
49
-
50
-
<aname="syncUnopenWorkingSet"></a>
51
-
52
-
## syncUnopenWorkingSet()
53
-
Scans all the files in the working set that do not have Documents (and thus were not scannedby findExternalChanges()). If any were deleted on disk, removes them from the working set.
54
-
55
-
**Kind**: global function
56
-
<aname="reloadDoc"></a>
57
-
58
-
## reloadDoc(doc) ⇒ <code>$.Promise</code>
59
-
Reloads the Document's contents from disk, discarding any unsaved changes in the editor.
60
-
61
-
**Kind**: global function
62
-
**Returns**: <code>$.Promise</code> - Resolved after editor has been refreshed; rejected if unable to load the file's new content. Errors are logged but no UI is shown.
63
-
64
-
| Param | Type |
65
-
| --- | --- |
66
-
| doc | <code>Document</code> |
67
-
68
-
<aname="reloadChangedDocs"></a>
69
-
70
-
## reloadChangedDocs() ⇒ <code>$.Promise</code>
71
-
Reloads all the documents in "toReload" silently (no prompts). The operations are all runin parallel.
72
-
73
-
**Kind**: global function
74
-
**Returns**: <code>$.Promise</code> - Resolved/rejected after all reloads done; will be rejected if any one file's reload failed. Errors are logged (by reloadDoc()) but no UI is shown.
Walks through all the documents in "editConflicts" & "deleteConflicts" and prompts the userabout each one. Processing is sequential: if the user chooses to reload a document, the nextprompt is not shown until after the reload has completed.
95
-
96
-
**Kind**: global function
97
-
**Returns**: <code>$.Promise</code> - Resolved/rejected after all documents have been prompted and (if applicable) reloaded (and any resulting error UI has been dismissed). Rejected if any one reload failed.
98
-
99
-
| Param | Type | Description |
100
-
| --- | --- | --- |
101
-
| title | <code>string</code> | Title of the dialog. |
102
-
103
6
<aname="syncOpenDocuments"></a>
104
7
105
8
## syncOpenDocuments(title)
106
-
Check to see whether any open files have been modified by an external app since the last timeBrackets synced up with the copy on disk (either by loading or saving the file). For cleanfiles, we silently upate the editor automatically. For files with unsaved changes, we promptthe user.
9
+
Check to see whether any open files have been modified by an external app since the last time
10
+
Brackets synced up with the copy on disk (either by loading or saving the file). For clean
11
+
files, we silently upate the editor automatically. For files with unsaved changes, we prompt
This is the view layer (template) for the file tree in the sidebar. It takes a FileTreeViewModeland renders it to the given element using Preact. User actions are signaled via an ActionCreator(in the Flux sense).
10
-
11
-
**Kind**: global variable
12
-
<aname="pathComputer"></a>
13
-
14
-
## pathComputer
15
-
Mixin that allows a component to compute the full path to its directory entry.
16
-
17
-
**Kind**: global variable
18
-
<aname="pathComputer.myPath"></a>
19
-
20
-
### pathComputer.myPath()
21
-
Computes the full path of the file represented by this input.
22
-
23
-
**Kind**: static method of [<code>pathComputer</code>](#pathComputer)
24
-
<aname="renameBehavior"></a>
25
-
26
-
## renameBehavior
27
-
This is a mixin that provides rename input behavior. It is responsible for taking keyboard inputand invoking the correct action based on that input.
Stop clicks from propagating so that clicking on the rename input doesn'tcause directories to collapse.
41
-
42
-
**Kind**: static method of [<code>renameBehavior</code>](#renameBehavior)
43
-
<aname="renameBehavior.handleKeyDown"></a>
44
-
45
-
### renameBehavior.handleKeyDown()
46
-
If the user presses enter or escape, we either successfully complete or cancel, respectively,the rename or create operation that is underway.
47
-
48
-
**Kind**: static method of [<code>renameBehavior</code>](#renameBehavior)
49
-
<aname="renameBehavior.handleInput"></a>
50
-
51
-
### renameBehavior.handleInput()
52
-
The rename or create operation can be completed or canceled by actions outside ofthis component, so we keep the model up to date by sending every update via an action.
53
-
54
-
**Kind**: static method of [<code>renameBehavior</code>](#renameBehavior)
55
-
<aname="renameBehavior.handleBlur"></a>
56
-
57
-
### renameBehavior.handleBlur()
58
-
If we leave the field for any reason, complete the rename.
59
-
60
-
**Kind**: static method of [<code>renameBehavior</code>](#renameBehavior)
61
-
<aname="dragAndDrop"></a>
62
-
63
-
## dragAndDrop
64
-
This is a mixin that provides drag and drop move function.
65
-
66
-
**Kind**: global variable
67
-
<aname="extendable"></a>
68
-
69
-
## extendable
70
-
Mixin for components that support the "icons" and "addClass" extension points.`fileNode` and `directoryNode` support this.
Calls the addClass providers to get the classes (in string form) to add for the currentfile or directory.
89
-
90
-
**Kind**: static method of [<code>extendable</code>](#extendable)
91
-
**Returns**: <code>string</code> - classes for the current node
92
-
93
-
| Param | Type | Description |
94
-
| --- | --- | --- |
95
-
| classes | <code>string</code> | Initial classes for this node |
96
-
97
-
<aname="fileSelectionBox"></a>
98
-
99
-
## fileSelectionBox
100
-
Displays the absolutely positioned box for the selection or context in thefile tree. Its position is determined by passed-in info about the scroller in whichthe tree resides and the top of the selected node (as reported by the node itself).Props:* selectionViewInfo: Immutable.Map with width, scrollTop, scrollLeft and offsetTop for the tree container* visible: should this be visible now* selectedClassName: class name applied to the element that is selected
101
-
102
-
**Kind**: global variable
103
-
<aname="selectionExtension"></a>
104
-
105
-
## selectionExtension
106
-
On Windows and Linux, the selection bar in the tree does not extend over the scroll bar.The selectionExtension sits on top of the scroll bar to make the selection bar appear to span thewhole width of the sidebar.Props:* selectionViewInfo: Immutable.Map with width, scrollTop, scrollLeft and offsetTop for the tree container* visible: should this be visible now* selectedClassName: class name applied to the element that is selected* className: class to be applied to the extension element
9
+
This is the view layer (template) for the file tree in the sidebar. It takes a FileTreeViewModel
10
+
and renders it to the given element using Preact. User actions are signaled via an ActionCreator
11
+
(in the Flux sense).
107
12
108
13
**Kind**: global variable
109
14
<aname="componentDidMount"></a>
110
15
111
16
## componentDidMount()
112
-
When this component is displayed, we scroll it into view and select the portionof the filename that excludes the extension.
17
+
When this component is displayed, we scroll it into view and select the portion
18
+
of the filename that excludes the extension.
113
19
114
20
**Kind**: global function
115
21
<aname="getInitialState"></a>
@@ -118,43 +24,6 @@ When this component is displayed, we scroll it into view and select the portion
118
24
Ensures that we always have a state object.
119
25
120
26
**Kind**: global function
121
-
<aname="shouldComponentUpdate"></a>
122
-
123
-
## shouldComponentUpdate()
124
-
Thanks to immutable objects, we can just do a start object identity check to knowwhether or not we need to re-render.
125
-
126
-
**Kind**: global function
127
-
<aname="componentDidUpdate"></a>
128
-
129
-
## componentDidUpdate()
130
-
If this node is newly selected, scroll it into view. Also, move the selection orcontext boxes as appropriate.
131
-
132
-
**Kind**: global function
133
-
<aname="handleClick"></a>
134
-
135
-
## handleClick()
136
-
When the user clicks on the node, we'll either select it or, if they've clicked twicewith a bit of delay in between, we'll invoke the `startRename` action.
137
-
138
-
**Kind**: global function
139
-
<aname="selectNode"></a>
140
-
141
-
## selectNode()
142
-
select the current node in the file tree on mouse down event on files.This is to increase click responsiveness of file tree.
143
-
144
-
**Kind**: global function
145
-
<aname="handleDoubleClick"></a>
146
-
147
-
## handleDoubleClick()
148
-
When the user double clicks, we will select this file and add it to the workingset (via the `selectInWorkingSet` action.)
149
-
150
-
**Kind**: global function
151
-
<aname="getDataForExtension"></a>
152
-
153
-
## getDataForExtension() ⇒ <code>Object</code>
154
-
Create the data object to pass to extensions.
155
-
156
-
**Kind**: global function
157
-
**Returns**: <code>Object</code> - Data for extensions
158
27
<aname="componentDidMount"></a>
159
28
160
29
## componentDidMount()
@@ -163,45 +32,22 @@ When this component is displayed, we scroll it into view and select the folder n
163
32
**Kind**: global function
164
33
<aname="shouldComponentUpdate"></a>
165
34
166
-
## shouldComponentUpdate()
167
-
We need to update this component if the sort order changes or our entry objectchanges. Thanks to immutability, if any of the directory contents change, ourentry object will change.
168
-
169
-
**Kind**: global function
170
-
<aname="handleClick"></a>
171
-
172
-
## handleClick()
173
-
If you click on a directory, it will toggle between open and closed.
174
-
175
-
**Kind**: global function
176
-
<aname="selectNode"></a>
177
-
178
-
## selectNode()
179
-
select the current node in the file tree
180
-
181
-
**Kind**: global function
182
-
<aname="getDataForExtension"></a>
183
-
184
-
## getDataForExtension() ⇒ <code>Object</code>
185
-
Create the data object to pass to extensions.
186
-
187
-
**Kind**: global function
188
-
**Returns**: <code>Object</code> - Data for extensions
189
-
<aname="shouldComponentUpdate"></a>
190
-
191
35
## shouldComponentUpdate()
192
36
Need to re-render if the sort order or the contents change.
193
37
194
38
**Kind**: global function
195
39
<aname="componentDidUpdate"></a>
196
40
197
41
## componentDidUpdate()
198
-
When the component has updated in the DOM, reposition it to where the currentlyselected node is located now.
42
+
When the component has updated in the DOM, reposition it to where the currently
43
+
selected node is located now.
199
44
200
45
**Kind**: global function
201
46
<aname="componentDidUpdate"></a>
202
47
203
48
## componentDidUpdate()
204
-
When the component has updated in the DOM, reposition it to where the currentlyselected node is located now.
49
+
When the component has updated in the DOM, reposition it to where the currently
50
+
selected node is located now.
205
51
206
52
**Kind**: global function
207
53
<aname="shouldComponentUpdate"></a>
@@ -235,7 +81,8 @@ Renders the file tree to the given element.
235
81
<aname="addIconProvider"></a>
236
82
237
83
## addIconProvider(callback, [priority])
238
-
Adds an icon provider. The callback is invoked before each working set item is created, and canreturn content to prepend to the item if it supports the icon.
84
+
Adds an icon provider. The callback is invoked before each working set item is created, and can
85
+
return content to prepend to the item if it supports the icon.
239
86
240
87
**Kind**: global function
241
88
@@ -247,7 +94,8 @@ Adds an icon provider. The callback is invoked before each working set item is c
247
94
<aname="addClassesProvider"></a>
248
95
249
96
## addClassesProvider(callback, [priority])
250
-
Adds a CSS class provider, invoked before each working set item is created or updated. When calledto update an existing item, all previously applied classes have been cleared.
97
+
Adds a CSS class provider, invoked before each working set item is created or updated. When called
98
+
to update an existing item, all previously applied classes have been cleared.
<aname="Contains the treeData used to generate the file tree and methods used to update thattreeData.Instances dispatch the following events_- change (FileTreeViewModel.EVENT_CHANGE constant)_ Fired any time theres a change that should be reflected in the view."></a>
6
+
<a name="Contains the treeData used to generate the file tree and methods used to update that
7
+
treeData.
7
8
8
-
## Contains the treeData used to generate the file tree and methods used to update thattreeData.Instances dispatch the following events:- change (FileTreeViewModel.EVENT\_CHANGE constant): Fired any time theres a change that should be reflected in the view.
9
+
Instances dispatch the following events_
10
+
- change (FileTreeViewModel.EVENT_CHANGE constant)_ Fired any time theres a change that should be reflected in the view."></a>
11
+
12
+
## Contains the treeData used to generate the file tree and methods used to update that
13
+
treeData.
14
+
15
+
Instances dispatch the following events:
16
+
- change (FileTreeViewModel.EVENT\_CHANGE constant): Fired any time theres a change that should be reflected in the view.
9
17
**Kind**: global class
10
18
<aname="Immutable"></a>
11
19
12
20
## Immutable
13
-
The view model (or a Store in the Flux terminology) used by the file tree.Many of the view model's methods are implemented by pure functions, which can behelpful for composability. Many of the methods commit the new treeData and send achange event when they're done whereas the functions do not do this.
21
+
The view model (or a Store in the Flux terminology) used by the file tree.
22
+
23
+
Many of the view model's methods are implemented by pure functions, which can be
24
+
helpful for composability. Many of the methods commit the new treeData and send a
25
+
change event when they're done whereas the functions do not do this.
14
26
15
27
**Kind**: global variable
28
+
<aname="EVENT_CHANGE"></a>
29
+
30
+
## EVENT\_CHANGE : <code>string</code>
31
+
**Kind**: global constant
16
32
<aname="isFile"></a>
17
33
18
34
## isFile(entry) ⇒ <code>boolean</code>
@@ -25,15 +41,3 @@ Determine if an entry from the treeData map is a file.
25
41
| --- | --- | --- |
26
42
| entry | <code>Immutable.Map</code> | entry to test |
0 commit comments