docs/Script API/classes/Frontend_Script_API._internal_.default-6.html
The editor can operate into two distinct modes:
_noteId_position$widgetattrschildrencomponentIdinitializednoteContext?parent?spacedUpdate
hoistedNoteIdnotenoteIdnotePathntxIdpositionsanitizedClassName
activeContextChangedactiveContextChangedEventaddImageaddIncludeNoteaddIncludeNoteToTextCommandaddLinkaddLinkToEditoraddLinkToTextCommandaddTextToActiveEditorEventaddTextToEditorcallMethodcanBeShownchildclasscleanupcollapsiblecontentSizedcreateEditorcreateNoteForReferenceLinkcsscssBlockdataSaveddoRefreshdoRenderentitiesReloadedEventexecuteWithTextEditorEventfillingfocusfollowLinkUnderCursorCommandfrocaReloadedEventgetClosestNtxIdgetDatagetEditorgetPositiongetSelectedTexthandleEventhandleEventInChildrenhasSelectionidinitEditorinsertDateTimeToTextCommandisActiveisActiveNoteContextisEnabledisHiddenExtisHiddenIntisNoteisNoteContextisVisibleloadIncludedNoteloadReferenceLinkTitlelogRenderingErrornoteSwitchednoteSwitchedAndActivatedEventnoteSwitchedEventnoteTypeMimeChangedEventonLanguageChangedopenImageInCurrentTabopenImageInNewTaboptChildoptCssparseFromImagereadOnlyTemporarilyDisabledEventrefreshrefreshCodeBlockOptionsrefreshIncludedNoterefreshIncludedNoteEventrefreshWithNotereinitializeremoverenderscrollToEndsetNoteContextEventsetParentsetupImageOpeningshowtoggleExttoggleInttriggerCommandtriggerEventgetType
new default(): default
_noteId: string
_position: number
$widget: JQuery<HTMLElement>
Protectedattrsattrs: Record<string, string>
children: default[]
componentId: string
initialized: null | Promise<void>
OptionalnoteContextnoteContext?: NoteContext
Optionalparentparent?: TypedComponent<any>
spacedUpdate: default
get hoistedNoteId(): undefined | string
get note(): undefined | null | FNote
get noteId(): undefined | string
get notePath(): undefined | null | string
get ntxId(): undefined | null | string
get position(): number
set position(newPosition: number): void
get sanitizedClassName(): string
activeContextChanged(): Promise<void>
activeContextChangedEvent(
__namedParameters: { noteContext: NoteContext },
): Promise<void>
addImage(noteId: string): Promise<void>
addIncludeNote(noteId: string, boxSize?: string): void
OptionalboxSize: stringaddIncludeNoteToTextCommand(): void
addLink(
notePath: string,
linkTitle: null | string,
externalLink?: boolean,
): Promise<void>
addLinkToEditor(linkHref: string, linkTitle: string): Promise<void>
addLinkToTextCommand(): void
addTextToActiveEditorEvent(
__namedParameters: CommandData & { text: string },
): void
addTextToEditor(text: string): Promise<void>
callMethod(
fun: (arg: unknown) => Promise<unknown>,
data: unknown,
): undefined | Promise<unknown>
canBeShown(): boolean
child(...components: default[]): default
class(className: string): default
cleanup(): void
collapsible(): default
contentSized(): default
createEditor(): Promise<void>
createNoteForReferenceLink(title: string): Promise<undefined | string>
css(name: string, value: string): default
Sets the CSS attribute of the given name to the given value.
the name of the CSS attribute to set (e.g. padding-left).
the value of the CSS attribute to set (e.g. 12px).
self for chaining.
cssBlock(block: string): default
Accepts a string of CSS to add with the widget.
for chaining
dataSaved(): void
doRefresh(note: FNote): Promise<void>
doRender(): void
entitiesReloadedEvent(
__namedParameters: { loadResults: default },
): Promise<void>
executeWithTextEditorEvent(
__namedParameters: CommandData & ExecuteCommandData<TextEditor> & {
callback?: GetTextEditorCallback;
},
): Promise<void>
filling(): default
focus(): void
followLinkUnderCursorCommand(): Promise<void>
frocaReloadedEvent(): Promise<void>
getClosestNtxId(): undefined | null | string
getData(): { content: string }
promise resolving note data. Note data is an object with content.
getEditor(): TextEditor
getPosition(): number
getSelectedText(): string
handleEvent<T extends EventNames>(
name: T,
data: EventData<T>,
): undefined | null | Promise<unknown>
handleEventInChildren<T extends EventNames>(
name: T,
data: EventData<T>,
): null | Promise<unknown>
By default:
activeContextChanged is intercepted and converted to a setNoteContext event to avoid refresh().entitiesReloaded and refreshData are passed as-is.hasSelection(): boolean
id(id: string): default
initEditor(): Promise<void>
insertDateTimeToTextCommand(): void
isActive(): boolean
isActiveNoteContext(): boolean
isEnabled(): undefined | null | boolean
Indicates if the widget is enabled. Widgets are enabled by default. Generally setting this to false will cause the widget not to be displayed, however it will still be available on the DOM but hidden.
If the widget is not enabled, it will not receive refreshWithNote updates.
true when an active note exists
isHiddenExt(): boolean
isHiddenInt(): boolean
isNote(noteId: string): boolean
isNoteContext(
ntxId: undefined | null | string | string[],
): undefined | null | boolean | ""
isVisible(): boolean
loadIncludedNote(noteId: string, $el: JQuery<HTMLElement>): Promise<void>
loadReferenceLinkTitle(
$el: JQuery<HTMLElement>,
href?: null | string,
): Promise<void>
logRenderingError(e: Error): void
noteSwitched(): Promise<void>
noteSwitchedAndActivatedEvent(
__namedParameters: NoteSwitchedContext,
): Promise<void>
noteSwitchedEvent(__namedParameters: NoteSwitchedContext): Promise<void>
noteTypeMimeChangedEvent(__namedParameters: { noteId: string }): Promise<void>
onLanguageChanged(): Promise<void>
openImageInCurrentTab($img: JQuery<HTMLElement>): Promise<void>
openImageInNewTab($img: JQuery<HTMLElement>): Promise<void>
optChild(condition: boolean, ...components: default[]): default
Conditionally adds the given components as children to this component.
whether to add the components.
the components to be added as children to this component provided the condition is truthy.
self for chaining.
optCss(condition: boolean, name: string, value: string): default
Sets the CSS attribute of the given name to the given value, but only if the condition provided is truthy.
true in order to apply the CSS, false to ignore it.
the name of the CSS attribute to set (e.g. padding-left).
the value of the CSS attribute to set (e.g. 12px).
self for chaining.
parseFromImage(
$img: JQuery<HTMLElement>,
): Promise<
| null
| {
noteId: any;
viewScope: { attachmentId?: undefined; viewMode?: undefined };
}
| {
noteId: undefined
| string;
viewScope: { attachmentId: any; viewMode: string };
},
>
readOnlyTemporarilyDisabledEvent(
__namedParameters: { noteContext: NoteContext },
): Promise<void>
refresh(): Promise<void>
refreshCodeBlockOptions(): void
refreshIncludedNote($container: JQuery<HTMLElement>, noteId: string): void
refreshIncludedNoteEvent(__namedParameters: { noteId: string }): Promise<void>
refreshWithNote(note: undefined | null | FNote): Promise<void>
Override this method to be able to refresh your widget with each note.
reinitialize(data: string): Promise<void>
remove(): void
render(): JQuery<HTMLElement>
scrollToEnd(): void
setNoteContextEvent(__namedParameters: { noteContext: NoteContext }): void
setParent(parent: TypedComponent<any>): default
setupImageOpening(singleClickOpens: boolean): void
show(): void
toggleExt(show: undefined | null | boolean | ""): void
toggleInt(show: undefined | null | boolean): void
triggerCommand<K extends keyof CommandMappings>(
name: K,
data?: CommandMappings[K],
): undefined | null | Promise<unknown>
Optionaldata: CommandMappings[K]triggerEvent<T extends EventNames>(
name: T,
data: EventData<T>,
): undefined | null | Promise<unknown>
StaticgetTypegetType(): string
Member Visibility
ThemeOSLightDark
Constructors constructor Properties _noteId_position$widgetattrschildrencomponentIdinitializednoteContextparentspacedUpdate Accessors hoistedNoteIdnotenoteIdnotePathntxIdpositionsanitizedClassName Methods activeContextChangedactiveContextChangedEventaddImageaddIncludeNoteaddIncludeNoteToTextCommandaddLinkaddLinkToEditoraddLinkToTextCommandaddTextToActiveEditorEventaddTextToEditorcallMethodcanBeShownchildclasscleanupcollapsiblecontentSizedcreateEditorcreateNoteForReferenceLinkcsscssBlockdataSaveddoRefreshdoRenderentitiesReloadedEventexecuteWithTextEditorEventfillingfocusfollowLinkUnderCursorCommandfrocaReloadedEventgetClosestNtxIdgetDatagetEditorgetPositiongetSelectedTexthandleEventhandleEventInChildrenhasSelectionidinitEditorinsertDateTimeToTextCommandisActiveisActiveNoteContextisEnabledisHiddenExtisHiddenIntisNoteisNoteContextisVisibleloadIncludedNoteloadReferenceLinkTitlelogRenderingErrornoteSwitchednoteSwitchedAndActivatedEventnoteSwitchedEventnoteTypeMimeChangedEventonLanguageChangedopenImageInCurrentTabopenImageInNewTaboptChildoptCssparseFromImagereadOnlyTemporarilyDisabledEventrefreshrefreshCodeBlockOptionsrefreshIncludedNoterefreshIncludedNoteEventrefreshWithNotereinitializeremoverenderscrollToEndsetNoteContextEventsetParentsetupImageOpeningshowtoggleExttoggleInttriggerCommandtriggerEventgetType