add canvas properties with a button to copy reference to clipboard which allows inserting canvas as an image into text notes

This commit is contained in:
zadam
2023-10-19 09:20:23 +02:00
parent b1d4a258a1
commit b01fe5ead9
5 changed files with 73 additions and 4 deletions

View File

@@ -495,6 +495,14 @@ function copyHtmlToClipboard(content) {
navigator.clipboard.write([clipboardItem]);
}
/**
* @param {FNote} note
* @return {string}
*/
function createImageSrcUrl(note) {
return `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`;
}
export default {
reloadFrontendApp,
parseDate,
@@ -533,5 +541,6 @@ export default {
sleep,
escapeRegExp,
areObjectsEqual,
copyHtmlToClipboard
copyHtmlToClipboard,
createImageSrcUrl
};