generated from THeK3nger/obsidian-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added: Natural date dropdown suggestions.
- Loading branch information
jamesb
committed
Sep 25, 2021
1 parent
15551d8
commit 1460dfb
Showing
8 changed files
with
140 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
{ | ||
"queueTagMap": { | ||
"IW-Queue": ["iw-queue"], | ||
"Tasks": ["tasks"] | ||
}, | ||
"defaultPriorityMin": 17, | ||
"defaultPriorityMax": 64, | ||
"queueTagMap": {}, | ||
"defaultPriorityMin": 10, | ||
"defaultPriorityMax": 50, | ||
"queueFolderPath": "IW-Queues", | ||
"queueFileName": "Tasks.md", | ||
"defaultQueueType": "simple", | ||
"skipAddNoteWindow": true, | ||
"queueFileName": "IW-Queue.md", | ||
"defaultQueueType": "afactor", | ||
"skipAddNoteWindow": false, | ||
"autoAddNewNotes": false, | ||
"defaultFirstRepDate": "tomorrow", | ||
"defaultFirstRepDate": "today", | ||
"askForNextRepDate": false, | ||
"vimMode": false, | ||
"defaultPriority": 30, | ||
"queueFilePath": "queue.md", | ||
"defaultAFactor": 2, | ||
"defaultInterval": 1 | ||
"dropdownNaturalDates": {"today": "today", "tomorrow": "tomorrow", "in two days": "in two days", "next week": "next week"} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import IW from 'src/main'; | ||
import { TextInputSuggest } from './suggest' | ||
|
||
export class NaturalDateSuggest extends TextInputSuggest<string> { | ||
private plugin: IW; | ||
constructor(plugin: IW, inputEl: HTMLInputElement) { | ||
super(plugin.app, inputEl); | ||
this.plugin = plugin; | ||
} | ||
|
||
getSuggestions(inputStr: string): string[] { | ||
return Object.keys(this.plugin.settings.dropdownNaturalDates) | ||
.filter(date => date.contains(inputStr)); | ||
} | ||
|
||
renderSuggestion(date: string, el: HTMLElement): void { | ||
el.setText(date); | ||
} | ||
|
||
selectSuggestion(date: string): void { | ||
this.inputEl.value = date; | ||
this.inputEl.trigger("input"); | ||
this.close(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters