Skip to content

Commit

Permalink
feat: ✨ add 'activeFoldersFuzzySearchForm'
Browse files Browse the repository at this point in the history
  • Loading branch information
ksalzke committed Sep 3, 2023
1 parent bae50f3 commit 831152a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fuzzySearchLib.omnifocusjs/Resources/fuzzySearchLib.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,9 @@
var activeTags = flattenedTags.filter(function (tag) { return tag.active; });
return lib.searchForm(activeTags, activeTags.map(function (t) { return t.name; }), null, null);
};
lib.activeFoldersFuzzySearchForm = function () {
var activeFolders = flattenedFolders.filter(function (folder) { return folder.status = Folder.Status.Active; });
return lib.searchForm(activeFolders, activeFolders.map(function (f) { return f.name; }), null, null);
};
return lib;
})();
1 change: 1 addition & 0 deletions src/OmniFocus.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
declare var flattenedProjects: ProjectArray
declare var flattenedTags: TagArray
declare var flattenedTasks: TaskArray
declare var flattenedFolders: FolderArray
declare var tags: Tags
declare var settings: Settings
declare var console: Console
Expand Down
6 changes: 6 additions & 0 deletions src/fuzzySearchLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface FuzzySearchLibrary extends PlugIn.Library {
allTasksFuzzySearchForm?: () => FuzzySearchForm
remainingTasksFuzzySearchForm?: () => FuzzySearchForm
activeTagsFuzzySearchForm?: () => FuzzySearchForm
activeFoldersFuzzySearchForm?: () => FuzzySearchForm
truncateString?: (string: string, length: number) => string
}

Expand Down Expand Up @@ -101,6 +102,11 @@ interface FuzzySearchForm extends Form {
return lib.searchForm(activeTags, activeTags.map(t => t.name), null, null)
}

lib.activeFoldersFuzzySearchForm = () => {
const activeFolders = flattenedFolders.filter(folder => folder.status = Folder.Status.Active)
return lib.searchForm(activeFolders, activeFolders.map(f => f.name), null, null)
}



return lib
Expand Down

0 comments on commit 831152a

Please sign in to comment.