note revisions for images, WIP

This commit is contained in:
zadam
2019-11-08 23:09:57 +01:00
parent 712f67e983
commit 58a857cf79
6 changed files with 44 additions and 5 deletions

View File

@@ -61,6 +61,11 @@ $list.on('change', async () => {
else if (note.type === 'code') {
$content.html($("<pre>").text(fullNoteRevision.content));
}
else if (note.type === 'image') {
$content.html($("<img>")
.attr("src", `data:${note.mime};base64,` + fullNoteRevision.content)
.css("width", "100%"));
}
else {
$content.text("Preview isn't available for this note type.");
}