mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Allow arbitrary labels to be added via web clipper
This commit is contained in:
parent
540d19c67c
commit
fdffc27bb6
@ -75,7 +75,7 @@ function addClipping(req) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function createNote(req) {
|
function createNote(req) {
|
||||||
let {title, content, pageUrl, images, clipType} = req.body;
|
let {title, content, pageUrl, images, clipType, labels} = req.body;
|
||||||
|
|
||||||
if (!title || !title.trim()) {
|
if (!title || !title.trim()) {
|
||||||
title = `Clipped note from ${pageUrl}`;
|
title = `Clipped note from ${pageUrl}`;
|
||||||
@ -100,6 +100,13 @@ function createNote(req) {
|
|||||||
note.setLabel('pageUrl', pageUrl);
|
note.setLabel('pageUrl', pageUrl);
|
||||||
note.setLabel('iconClass', 'bx bx-globe');
|
note.setLabel('iconClass', 'bx bx-globe');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (labels) {
|
||||||
|
for (const labelName in labels) {
|
||||||
|
console.log('set label ' + labelName + ' on the new note!');
|
||||||
|
note.setLabel(labelName, labels[labelName]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const rewrittenContent = processContent(images, note, content);
|
const rewrittenContent = processContent(images, note, content);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user