basic book rendering of code and image notes

This commit is contained in:
zadam
2019-10-02 19:40:22 +02:00
parent dd147a7209
commit dec2c218f7
4 changed files with 19 additions and 6 deletions

View File

@@ -36,6 +36,18 @@ class NoteDetailBook {
return $content;
}
}
else if (note.type === 'code') {
const fullNote = await server.get('notes/' + note.noteId);
if (fullNote.content.trim() === "") {
return "";
}
return $("<pre>").text(fullNote.content);
}
else if (note.type === 'image') {
return $("<img>").attr("src", `api/images/${note.noteId}/${note.title}`);
}
else {
return "<em>Content of this note cannot be displayed in the book format</em>";
}

View File

@@ -820,8 +820,9 @@ a.external:not(.no-arrow):after, a[href^="http://"]:not(.no-arrow):after, a[href
}
.note-book {
border-radius: 5px;
border-radius: 10px;
background-color: var(--accented-background-color);
padding: 15px;
margin-top: 10px;
margin: 10px;
margin-left: 0;
}