import StandardWidget from "./standard_widget.js"; const TPL = `
Note ID:
Created:
Modified:
Type: MIME:
`; class NoteInfoWidget extends StandardWidget { getWidgetTitle() { return "Note info"; } doRenderBody() { this.$body.html(TPL); } async refreshWithNote(note) { const $noteId = this.$body.find(".note-info-note-id"); const $dateCreated = this.$body.find(".note-info-date-created"); const $dateModified = this.$body.find(".note-info-date-modified"); const $type = this.$body.find(".note-info-type"); const $mime = this.$body.find(".note-info-mime"); const noteComplement = await this.tabContext.getNoteComplement(); $noteId.text(note.noteId); $dateCreated .text(noteComplement.dateCreated) .attr("title", noteComplement.dateCreated); $dateModified .text(noteComplement.dateModified) .attr("title", noteComplement.dateCreated); $type.text(note.type); $mime .text(note.mime) .attr("title", note.mime); } syncDataListener({data}) { if (data.find(sd => sd.entityName === 'notes' && this.isNote(sd.entityId))) { this.refresh(); } } } export default NoteInfoWidget;