mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
fixes for relative paths
This commit is contained in:
parent
cf5ec44303
commit
b25deea21d
@ -26,7 +26,7 @@ async function show() {
|
|||||||
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
|
$fileSize.text((attributeMap.fileSize || "?") + " bytes");
|
||||||
$fileType.text(currentNote.mime);
|
$fileType.text(currentNote.mime);
|
||||||
|
|
||||||
$imageView.prop("src", `/api/images/${currentNote.noteId}/${currentNote.title}`);
|
$imageView.prop("src", `api/images/${currentNote.noteId}/${currentNote.title}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
$imageDownloadButton.click(() => utils.download(getFileUrl()));
|
$imageDownloadButton.click(() => utils.download(getFileUrl()));
|
||||||
|
@ -122,7 +122,7 @@ async function renderTooltip(note, attributes) {
|
|||||||
}
|
}
|
||||||
else if (note.type === 'image') {
|
else if (note.type === 'image') {
|
||||||
content += $("<img>")
|
content += $("<img>")
|
||||||
.prop("src", `/api/images/${note.noteId}/${note.title}`)
|
.prop("src", `api/images/${note.noteId}/${note.title}`)
|
||||||
.prop('outerHTML');
|
.prop('outerHTML');
|
||||||
}
|
}
|
||||||
// other types of notes don't have tooltip preview
|
// other types of notes don't have tooltip preview
|
||||||
|
@ -91,7 +91,7 @@ function SetupModel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// not using server.js because it loads too many dependencies
|
// not using server.js because it loads too many dependencies
|
||||||
const resp = await $.post('/api/setup/sync-from-server', {
|
const resp = await $.post('api/setup/sync-from-server', {
|
||||||
syncServerHost: syncServerHost,
|
syncServerHost: syncServerHost,
|
||||||
syncProxy: syncProxy,
|
syncProxy: syncProxy,
|
||||||
username: username,
|
username: username,
|
||||||
|
2
src/public/libraries/ckeditor/ckeditor.js
vendored
2
src/public/libraries/ckeditor/ckeditor.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -43,7 +43,7 @@ async function saveImage(buffer, originalName, parentNoteId) {
|
|||||||
return {
|
return {
|
||||||
fileName,
|
fileName,
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
url: `/api/images/${note.noteId}/${fileName}`
|
url: `api/images/${note.noteId}/${fileName}`
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,8 @@ function findImageLinks(content, foundLinks) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// removing absolute references to server to keep it working between instances
|
// removing absolute references to server to keep it working between instances
|
||||||
return content.replace(/src="[^"]*\/api\/images\//g, 'src="/api/images/');
|
// we also omit / at the beginning to keep the paths relative
|
||||||
|
return content.replace(/src="[^"]*\/api\/images\//g, 'src="api/images/');
|
||||||
}
|
}
|
||||||
|
|
||||||
function findHyperLinks(content, foundLinks) {
|
function findHyperLinks(content, foundLinks) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user