import NoteContextAwareWidget from "../note_context_aware_widget.js"; const TPL = `
This note was originally taken from:
`; export default class NotePropertiesWidget extends NoteContextAwareWidget { isEnabled() { return this.note && !!this.note.getLabelValue('pageUrl'); } getTitle() { return { show: this.isEnabled(), activate: true, title: 'Info', icon: 'bx bx-info-square' }; } doRender() { this.$widget = $(TPL); this.contentSized(); this.$pageUrl = this.$widget.find('.page-url'); } async refreshWithNote(note) { const pageUrl = note.getLabelValue('pageUrl'); this.$pageUrl .attr('href', pageUrl) .attr('title', pageUrl) .text(pageUrl); } }