11/*
22 * Copyright (c) 2012 Adobe Systems Incorporated. All rights reserved.
3- *
3+ *
44 * Permission is hereby granted, free of charge, to any person obtaining a
5- * copy of this software and associated documentation files (the "Software"),
6- * to deal in the Software without restriction, including without limitation
7- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8- * and/or sell copies of the Software, and to permit persons to whom the
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
99 * Software is furnished to do so, subject to the following conditions:
10- *
10+ *
1111 * The above copyright notice and this permission notice shall be included in
1212 * all copies or substantial portions of the Software.
13- *
13+ *
1414 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1616 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
17+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2020 * DEALINGS IN THE SOFTWARE.
21- *
21+ *
2222 */
2323
2424
2828/**
2929 * DocumentManager maintains a list of currently 'open' Documents. It also owns the list of files in
3030 * the working set, and the notion of which Document is currently shown in the main editor UI area.
31- *
31+ *
3232 * Document is the model for a file's contents; it dispatches events whenever those contents change.
3333 * To transiently inspect a file's content, simply get a Document and call getText() on it. However,
3434 * to be notified of Document changes or to modify a Document, you MUST call addRef() to ensure the
3535 * Document instance 'stays alive' and is shared by all other who read/modify that file. ('Open'
3636 * Documents are all Documents that are 'kept alive', i.e. have ref count > 0).
3737 *
3838 * To get a Document, call getDocumentForPath(); never new up a Document yourself.
39- *
39+ *
4040 * Secretly, a Document may use an Editor instance to act as the model for its internal state. (This
4141 * is unavoidable because CodeMirror does not separate its model from its UI). Documents are not
4242 * modifiable until they have a backing 'master Editor'. Creation of the backing Editor is owned by
5454 *
5555 * - dirtyFlagChange -- When any Document's isDirty flag changes. The 2nd arg to the listener is the
5656 * Document whose flag changed.
57- * - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the
57+ * - documentSaved -- When a Document's changes have been saved. The 2nd arg to the listener is the
5858 * Document that has been saved.
5959 * - documentRefreshed -- When a Document's contents have been reloaded from disk. The 2nd arg to the
6060 * listener is the Document that has been refreshed.
7272 * The 2nd arg to the listener is the array of removed FileEntry objects.
7373 * - workingSetSort -- When the workingSet array is reordered without additions or removals.
7474 * Listener receives no arguments.
75- *
75+ *
7676 * - workingSetDisableAutoSorting -- Dispatched in addition to workingSetSort when the reorder was caused
7777 * by manual dragging and dropping. Listener receives no arguments.
7878 *
8282 *
8383 * These are jQuery events, so to listen for them you do something like this:
8484 * $(DocumentManager).on("eventname", handler);
85- *
85+ *
8686 * Document objects themselves also dispatch some events - see Document docs for details.
8787 */
8888define ( function ( require , exports , module ) {
@@ -182,7 +182,7 @@ define(function (require, exports, module) {
182182 return _workingSet . slice ( 0 ) ;
183183 }
184184
185- /**
185+ /**
186186 * Returns the index of the file matching fullPath in the working set.
187187 * Returns -1 if not found.
188188 * @param {!string } fullPath
@@ -198,7 +198,7 @@ define(function (require, exports, module) {
198198 } ) ;
199199 }
200200
201- /**
201+ /**
202202 * Returns the index of the file matching fullPath in _workingSetAddedOrder.
203203 * Returns -1 if not found.
204204 * @param {!string } fullPath
@@ -465,7 +465,7 @@ define(function (require, exports, module) {
465465 * Changes currentDocument to the given Document, firing currentDocumentChange, which in turn
466466 * causes this Document's main editor UI to be shown in the editor pane, updates the selection
467467 * in the file tree / working set UI, etc. This call may also add the item to the working set.
468- *
468+ *
469469 * @param {!Document } document The Document to make current. May or may not already be in the
470470 * working set.
471471 */
@@ -543,7 +543,7 @@ define(function (require, exports, module) {
543543 . fail ( function ( ) {
544544 // File chosen to be switched to could not be opened, and the original file
545545 // is still in editor. Close it again so code will try to open the next file,
546- // or empty the editor if there are no other files.
546+ // or empty the editor if there are no other files.
547547 closeFullEditor ( file ) ;
548548 } ) ;
549549 } else {
@@ -843,7 +843,7 @@ define(function (require, exports, module) {
843843 * @param {boolean } isFolder True if path is a folder; False if it is a file.
844844 */
845845 function notifyPathNameChanged ( oldName , newName , isFolder ) {
846- // Update open documents. This will update _currentDocument too, since
846+ // Update open documents. This will update _currentDocument too, since
847847 // the current document is always open.
848848 var keysToDelete = [ ] ;
849849 CollectionUtils . forEach ( _openDocuments , function ( doc , path ) {
@@ -875,7 +875,7 @@ define(function (require, exports, module) {
875875 }
876876
877877 /**
878- * Called after a file or folder has been deleted. This function is responsible
878+ * Called after a file or folder has been deleted. This function is responsible
879879 * for updating underlying model data and notifying all views of the change.
880880 *
881881 * @param {string } path The path of the file/folder that has been deleted
@@ -980,8 +980,6 @@ define(function (require, exports, module) {
980980
981981 // Setup preferences
982982 _prefs = PreferencesManager . getPreferenceStorage ( module ) ;
983- //TODO: Remove preferences migration code
984- PreferencesManager . handleClientIdChange ( _prefs , "com.adobe.brackets.DocumentManager" ) ;
985983
986984 // Performance measurements
987985 PerfUtils . createPerfMeasurement ( "DOCUMENT_MANAGER_GET_DOCUMENT_FOR_PATH" , "DocumentManager.getDocumentForPath()" ) ;
0 commit comments