docs/Script API/classes/Frontend_Script_API._internal_.default-4.html
This widget allows for changing and updating depending on the active note.
_noteId_position$widgetattrschildrencomponentIdinitializednoteContext?parent?settingstooltip
hoistedNoteIdnotenoteIdnotePathntxIdpositionsanitizedClassName
activeContextChangedactiveContextChangedEventcallMethodcanBeShownchildclasscleanupcollapsiblecontentSizedcsscssBlockdoRenderfillingfrocaReloadedEventgetClosestNtxIdgetPositiongetTitlehandleEventhandleEventInChildreniconidinitialRenderCompleteEventisActiveNoteContextisEnabledisHiddenExtisHiddenIntisNoteisNoteContextisVisiblelogRenderingErrornoteSwitchednoteSwitchedAndActivatedEventnoteSwitchedEventnoteTypeMimeChangedEventonContextMenuoptChildoptCssrefreshrefreshIconrefreshWithNoteremoverendersetNoteContextEventsetParenttitletitlePlacementtoggleExttoggleInttriggerCommandtriggerEvent
new default<SettingsT extends AbstractButtonWidgetSettings>(): default<
SettingsT,
>
_noteId: string
_position: number
$widget: JQuery<HTMLElement>
Protectedattrsattrs: Record<string, string>
children: default[]
componentId: string
initialized: null | Promise<void>
OptionalnoteContextnoteContext?: NoteContext
Optionalparentparent?: TypedComponent<any>
Protectedsettingssettings: SettingsT
Protectedtooltiptooltip: Tooltip
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>
callMethod(
fun: (arg: unknown) => Promise<unknown>,
data: unknown,
): undefined | Promise<unknown>
canBeShown(): boolean
child(...components: default[]): default<SettingsT>
class(className: string): default<SettingsT>
cleanup(): void
collapsible(): default<SettingsT>
contentSized(): default<SettingsT>
css(name: string, value: string): default<SettingsT>
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<SettingsT>
Accepts a string of CSS to add with the widget.
for chaining
doRender(): void
Method used for rendering the widget.
Your class should override this method. The method is expected to create a this.$widget containing jQuery object
filling(): default<SettingsT>
frocaReloadedEvent(): Promise<void>
getClosestNtxId(): undefined | null | string
getPosition(): number
getTitle(): null | 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>
icon(icon: StringOrCallback): default<SettingsT>
id(id: string): default<SettingsT>
initialRenderCompleteEvent(): void
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
logRenderingError(e: Error): void
noteSwitched(): Promise<void>
noteSwitchedAndActivatedEvent(
__namedParameters: NoteSwitchedContext,
): Promise<void>
noteSwitchedEvent(__namedParameters: NoteSwitchedContext): Promise<void>
noteTypeMimeChangedEvent(__namedParameters: { noteId: string }): Promise<void>
onContextMenu(handler: ContextMenuHandler): default<SettingsT>
optChild(condition: boolean, ...components: default[]): default<SettingsT>
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<SettingsT>
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.
refresh(): Promise<void>
refreshIcon(): void
refreshWithNote(note: undefined | null | FNote): Promise<void>
Override this method to be able to refresh your widget with each note.
remove(): void
render(): JQuery<HTMLElement>
setNoteContextEvent(__namedParameters: { noteContext: NoteContext }): void
setParent(parent: TypedComponent<any>): default<SettingsT>
title(title: StringOrCallback): default<SettingsT>
titlePlacement(placement: TitlePlacement): default<SettingsT>
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>
Member Visibility
ThemeOSLightDark
Constructors constructor Properties _noteId_position$widgetattrschildrencomponentIdinitializednoteContextparentsettingstooltip Accessors hoistedNoteIdnotenoteIdnotePathntxIdpositionsanitizedClassName Methods activeContextChangedactiveContextChangedEventcallMethodcanBeShownchildclasscleanupcollapsiblecontentSizedcsscssBlockdoRenderfillingfrocaReloadedEventgetClosestNtxIdgetPositiongetTitlehandleEventhandleEventInChildreniconidinitialRenderCompleteEventisActiveNoteContextisEnabledisHiddenExtisHiddenIntisNoteisNoteContextisVisiblelogRenderingErrornoteSwitchednoteSwitchedAndActivatedEventnoteSwitchedEventnoteTypeMimeChangedEventonContextMenuoptChildoptCssrefreshrefreshIconrefreshWithNoteremoverendersetNoteContextEventsetParenttitletitlePlacementtoggleExttoggleInttriggerCommandtriggerEvent