-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add frontend note prompt API #4397
base: master
Are you sure you want to change the base?
Conversation
@@ -77,30 +77,52 @@ export default class AddLinkDialog extends BasicWidget { | |||
|
|||
const linkTitle = this.getLinkType() === 'reference-link' ? null : this.$linkTitle.val(); | |||
|
|||
this.textTypeWidget.addLink(this.$autoComplete.getSelectedNotePath(), linkTitle); | |||
if (this.textTypeWidget) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check appears to be needed because in the context of a script extension theremay not be a textTypeWidget.
this.textTypeWidget.addLink(this.$autoComplete.getSelectedNotePath(), linkTitle); | ||
} | ||
if (this.resolve) { | ||
this.resolve({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thoughts on this return structure @zadam ?
@@ -121,7 +143,7 @@ export default class AddLinkDialog extends BasicWidget { | |||
}; | |||
|
|||
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, { | |||
allowExternalLinks: true, | |||
allowExternalLinks: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zadam when using the text editor control+L (i.e. using this dialog directly) I was never actually able to get an external link selected. Are we best off disabling it here, or should we fix external link selection inside the note selector?
@benkaiser I don't like that the Add Link dialog now does two things - it inserts the link into the text note AND resolves the link. What if you just want the latter and not the former? Add Link dialog is also more specialized than mere selecting note (it allows defining a different link title) What I thought you want to do is to create a pure note selection dialog ... Alternatively, the Add Link dialog could be generalized in the sense that it would just resolve the selected note / title, and then the triggering code would handle inserting the content into the text note. |
We would like to allow users with custom scripts to leverage the internal note selector interface. This allows for easily creating links to internal notes from custom rendered views.
Fixes #4395 .