import CollapsibleWidget from "./standard_widget.js"; const TPL = `
Note ID:
Created:
Modified:
Type: MIME:
`; class NoteInfoWidget extends CollapsibleWidget { getWidgetTitle() { return "Note info"; } doRenderBody() { this.$body.html(TPL); this.$noteId = this.$body.find(".note-info-note-id"); this.$dateCreated = this.$body.find(".note-info-date-created"); this.$dateModified = this.$body.find(".note-info-date-modified"); this.$type = this.$body.find(".note-info-type"); this.$mime = this.$body.find(".note-info-mime"); } async refreshWithNote(note) { const noteComplement = await this.tabContext.getNoteComplement(); this.$noteId.text(note.noteId); this.$dateCreated .text(noteComplement.dateCreated) .attr("title", noteComplement.dateCreated); this.$dateModified .text(noteComplement.dateModified) .attr("title", noteComplement.dateCreated); this.$type.text(note.type); this.$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;