Skip to content

Commit 5e9a8af

Browse files
Merge pull request adobe#11375 from adobe/abose/instant_search
Instant Search.
2 parents 6c74071 + b58c862 commit 5e9a8af

32 files changed

Lines changed: 1620 additions & 202 deletions

src/editor/EditorManager.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ define(function (require, exports, module) {
472472
* Semi-private: should only be called within this module or by Document.
473473
* @param {!Document} document Document whose main/full Editor to create
474474
* @param {!Pane} pane Pane in which the editor will be hosted
475-
* @param {!Object} editorOptions If specified, contains editor options that
475+
* @param {!Object} editorOptions If specified, contains editor options that
476476
* can be passed to CodeMirror
477477
* @return {!Editor}
478478
*/
@@ -533,7 +533,7 @@ define(function (require, exports, module) {
533533
* Create and/or show the editor for the specified document
534534
* @param {!Document} document - document to edit
535535
* @param {!Pane} pane - pane to show it in
536-
* @param {!Object} editorOptions - If specified, contains
536+
* @param {!Object} editorOptions - If specified, contains
537537
* editor options that can be passed to CodeMirror
538538
* @private
539539
*/
@@ -623,7 +623,7 @@ define(function (require, exports, module) {
623623
* Opens the specified document in the given pane
624624
* @param {!Document} doc - the document to open
625625
* @param {!Pane} pane - the pane to open the document in
626-
* @param {!Object} editorOptions - If specified, contains
626+
* @param {!Object} editorOptions - If specified, contains
627627
* editor options that can be passed to CodeMirror
628628
* @return {boolean} true if the file can be opened, false if not
629629
*/

src/extensibility/ExtensionManager.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ define(function (require, exports, module) {
276276
loadTheme(id);
277277
exports.trigger("statusChange", id);
278278
}
279-
279+
280280
function deduceMetadata() {
281281
var match = path.match(/\/([^\/]+)$/),
282282
name = (match && match[1]) || path,
@@ -408,12 +408,12 @@ define(function (require, exports, module) {
408408
}
409409
return result.promise();
410410
}
411-
411+
412412
/**
413413
* @private
414-
*
414+
*
415415
* Disables or enables the installed extensions.
416-
*
416+
*
417417
* @param {string} id The id of the extension to disable or enable.
418418
* @param {boolean} enable A boolean indicating whether to enable or disable.
419419
* @return {$.Promise} A promise that's resolved when the extension action is
@@ -438,21 +438,21 @@ define(function (require, exports, module) {
438438
}
439439
return result.promise();
440440
}
441-
441+
442442
/**
443443
* Disables the installed extension with the given id.
444-
*
444+
*
445445
* @param {string} id The id of the extension to disable.
446446
* @return {$.Promise} A promise that's resolved when the extenion is disabled or
447447
* rejected with an error that prevented the disabling.
448448
*/
449449
function disable(id) {
450450
return _enableOrDisable(id, false);
451451
}
452-
452+
453453
/**
454454
* Enables the installed extension with the given id.
455-
*
455+
*
456456
* @param {string} id The id of the extension to enable.
457457
* @return {$.Promise} A promise that's resolved when the extenion is enabled or
458458
* rejected with an error that prevented the enabling.
@@ -514,7 +514,7 @@ define(function (require, exports, module) {
514514
}
515515
exports.trigger("statusChange", id);
516516
}
517-
517+
518518
/**
519519
* Returns true if an extension is marked for removal.
520520
* @param {string} id The id of the extension to check.
@@ -523,7 +523,7 @@ define(function (require, exports, module) {
523523
function isMarkedForRemoval(id) {
524524
return !!(_idsToRemove[id]);
525525
}
526-
526+
527527
/**
528528
* Returns true if there are any extensions marked for removal.
529529
* @return {boolean} true if there are extensions to remove
@@ -534,7 +534,7 @@ define(function (require, exports, module) {
534534

535535
/**
536536
* Marks an extension for disabling later, or unmarks an extension previously marked.
537-
*
537+
*
538538
* @param {string} id The id of the extension
539539
* @param {boolean} mark Whether to mark or unmark the extension.
540540
*/
@@ -549,7 +549,7 @@ define(function (require, exports, module) {
549549

550550
/**
551551
* Returns true if an extension is mark for disabling.
552-
*
552+
*
553553
* @param {string} id The id of the extension to check.
554554
* @return {boolean} true if it's been mark for disabling, false otherwise.
555555
*/
@@ -564,7 +564,7 @@ define(function (require, exports, module) {
564564
function hasExtensionsToDisable() {
565565
return Object.keys(_idsToDisable).length > 0;
566566
}
567-
567+
568568
/**
569569
* Unmarks all the extensions that have been marked for disabling.
570570
*/
@@ -644,14 +644,14 @@ define(function (require, exports, module) {
644644
}
645645
);
646646
}
647-
647+
648648
/**
649649
* Disables extensions marked for disabling.
650-
*
650+
*
651651
* If the return promise is rejected, the argument will contain an array of objects. Each
652652
* element is an object identifying the extension failed with "item" property set to the
653653
* extension id which has failed to be disabled and "error" property set to the error.
654-
*
654+
*
655655
* @return {$.Promise} A promise that's resolved when all extensions marked for disabling are
656656
* disabled or rejected if one or more extensions can't be disabled.
657657
*/
@@ -934,4 +934,4 @@ define(function (require, exports, module) {
934934
exports._getAutoInstallFiles = _getAutoInstallFiles;
935935
exports._reset = _reset;
936936
exports._setExtensions = _setExtensions;
937-
});
937+
});

src/extensibility/ExtensionManagerDialog.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ define(function (require, exports, module) {
116116
removeErrors,
117117
updateErrors,
118118
disableErrors;
119-
119+
120120
removeExtensionsPromise = ExtensionManager.removeMarkedExtensions()
121121
.fail(function (errorArray) {
122122
removeErrors = errorArray;
@@ -129,7 +129,7 @@ define(function (require, exports, module) {
129129
.fail(function (errorArray) {
130130
disableErrors = errorArray;
131131
});
132-
132+
133133
Async.waitForAll([removeExtensionsPromise, updateExtensionsPromise, disableExtensionsPromise], true)
134134
.always(function () {
135135
dlg.close();
@@ -151,7 +151,7 @@ define(function (require, exports, module) {
151151
CommandManager.execute(Commands.APP_RELOAD);
152152
}
153153
}
154-
154+
155155
if (removeErrors) {
156156
removeErrors.forEach(function (errorObj) {
157157
ids.push(errorObj.item);
@@ -162,7 +162,7 @@ define(function (require, exports, module) {
162162
message: StringUtils.format(Strings.EXTENSION_MANAGER_REMOVE_ERROR, ids.join(", "))
163163
});
164164
}
165-
165+
166166
if (updateErrors) {
167167
// This error case should be very uncommon.
168168
// Just let the user know that we couldn't update
@@ -185,7 +185,7 @@ define(function (require, exports, module) {
185185
message: StringUtils.format(Strings.EXTENSION_MANAGER_UPDATE_ERROR, ids.join(", "))
186186
});
187187
}
188-
188+
189189
if (disableErrors) {
190190
ids.length = 0;
191191
disableErrors.forEach(function (errorObj) {

src/extensibility/Package.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ define(function (require, exports, module) {
434434

435435
/**
436436
* Disables the extension at the given path.
437-
*
437+
*
438438
* @param {string} path The absolute path to the extension to disable.
439439
* @return {$.Promise} A promise that's resolved when the extenion is disabled, or
440440
* rejected if there was an error.
@@ -451,10 +451,10 @@ define(function (require, exports, module) {
451451
});
452452
return result.promise();
453453
}
454-
454+
455455
/**
456456
* Enables the extension at the given path.
457-
*
457+
*
458458
* @param {string} path The absolute path to the extension to enable.
459459
* @return {$.Promise} A promise that's resolved when the extenion is enable, or
460460
* rejected if there was an error.
@@ -473,7 +473,7 @@ define(function (require, exports, module) {
473473
});
474474
return result.promise();
475475
}
476-
476+
477477
/**
478478
* Install an extension update located at path.
479479
* This assumes that the installation was previously attempted

src/extensions/default/DebugCommands/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ define(function (require, exports, module) {
8787
prefs.definePreference("openPrefsInSplitView", "boolean", true, {
8888
description: Strings.DESCRIPTION_OPEN_PREFS_IN_SPLIT_VIEW
8989
});
90-
90+
9191
prefs.definePreference("openUserPrefsInSecondPane", "boolean", true, {
9292
description: Strings.DESCRIPTION_OPEN_USER_PREFS_IN_SECOND_PANE
9393
});
@@ -285,7 +285,7 @@ define(function (require, exports, module) {
285285
defaultPrefsFile = FileSystem.getFileForPath(defaultPrefsPath),
286286
DEFAULT_PREFS_PANE = "first-pane",
287287
USER_PREFS_PANE = "second-pane";
288-
288+
289289
// Exchange the panes, if default preferences need to be opened
290290
// in the right pane.
291291
if (!prefs.get("openUserPrefsInSecondPane")) {

src/extensions/default/InlineTimingFunctionEditor/unittests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ define(function (require, exports, module) {
165165
expect(match[0]).toEqual("ease-in-out");
166166
expect(match.originalString).toBeFalsy();
167167
});
168-
168+
169169
it("should match linear function in declaration in strict mode", function () {
170170
match = TimingFunctionUtils.timingFunctionMatch("transition-timing-function: linear;", false);
171171
expect(match.length).toEqual(1);

src/extensions/default/PrefsCodeHints/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define(function (require, exports, module) {
5555
description: Strings.DESCRIPTION_PATH
5656
}
5757
};
58-
58+
5959
var stringMatcherOptions = {
6060
preferPrefixMatches: true
6161
};

src/filesystem/FileSystemEntry.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,12 +440,13 @@ define(function (require, exports, module) {
440440
* @param {function(FileSystemEntry): boolean} visitor - A visitor function, which is
441441
* applied to descendent FileSystemEntry objects. If the function returns false for
442442
* a particular Directory entry, that directory's descendents will not be visited.
443-
* @param {{maxDepth: number, maxEntriesCounter: {value: number}}} options
443+
* @param {{maxDepth: number, maxEntriesCounter: {value: number}, sortList: boolean}} options
444444
* @param {function(?string)=} callback Callback with single FileSystemError string parameter.
445445
*/
446446
FileSystemEntry.prototype._visitHelper = function (stats, visitedPaths, visitor, options, callback) {
447447
var maxDepth = options.maxDepth,
448-
maxEntriesCounter = options.maxEntriesCounter;
448+
maxEntriesCounter = options.maxEntriesCounter,
449+
sortList = options.sortList;
449450

450451
if (maxEntriesCounter.value-- <= 0 || maxDepth-- < 0) {
451452
// The outer FileSystemEntry.visit call is responsible for applying
@@ -491,13 +492,30 @@ define(function (require, exports, module) {
491492

492493
var nextOptions = {
493494
maxDepth: maxDepth,
494-
maxEntriesCounter: maxEntriesCounter
495+
maxEntriesCounter: maxEntriesCounter,
496+
sortList : sortList
495497
};
496498

497-
entries.forEach(function (entry, index) {
498-
var stats = entriesStats[index];
499-
entry._visitHelper(stats, visitedPaths, visitor, nextOptions, helperCallback);
500-
});
499+
//sort entries if required
500+
function compareFilesWithIndices(index1, index2) {
501+
return entries[index1]._name.toLocaleLowerCase().localeCompare(entries[index2]._name.toLocaleLowerCase());
502+
}
503+
if (sortList) {
504+
var fileIndexes = [], i = 0;
505+
for (i = 0; i < entries.length; i++) {
506+
fileIndexes[i] = i;
507+
}
508+
fileIndexes.sort(compareFilesWithIndices);
509+
fileIndexes.forEach(function (fileIndex) {
510+
var stats = entriesStats[fileIndexes[fileIndex]];
511+
entries[fileIndexes[fileIndex]]._visitHelper(stats, visitedPaths, visitor, nextOptions, helperCallback);
512+
});
513+
} else {
514+
entries.forEach(function (entry, index) {
515+
var stats = entriesStats[index];
516+
entry._visitHelper(stats, visitedPaths, visitor, nextOptions, helperCallback);
517+
});
518+
}
501519
}.bind(this));
502520
};
503521

src/htmlContent/findreplace-bar.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@
2929
</div>
3030
<!-- For Find in Files, the filter picker will be added here programmatically. -->
3131
</div>
32+
<div id="indexing-spinner" class="indexing-group forced-hidden">
33+
<div class="spinner inline spin"></div>
34+
<div class="indexing-message">{{Strings.FIND_IN_FILES_INDEXING}}</div>
35+
</div>
3236
{{/multifile}}

src/htmlContent/main-view.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,4 @@
107107
<div id="codehint-menu-bar">
108108
<ul data-dropdown="dropdown"></ul>
109109
</div>
110-
<div id="hidden-editors"></div>
110+
<div id="hidden-editors"></div>

0 commit comments

Comments
 (0)