mirror of
https://github.com/zadam/trilium.git
synced 2025-06-05 17:38:47 +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");
|
||||
$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()));
|
||||
|
@ -122,7 +122,7 @@ async function renderTooltip(note, attributes) {
|
||||
}
|
||||
else if (note.type === 'image') {
|
||||
content += $("<img>")
|
||||
.prop("src", `/api/images/${note.noteId}/${note.title}`)
|
||||
.prop("src", `api/images/${note.noteId}/${note.title}`)
|
||||
.prop('outerHTML');
|
||||
}
|
||||
// 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
|
||||
const resp = await $.post('/api/setup/sync-from-server', {
|
||||
const resp = await $.post('api/setup/sync-from-server', {
|
||||
syncServerHost: syncServerHost,
|
||||
syncProxy: syncProxy,
|
||||
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 {
|
||||
fileName,
|
||||
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
|
||||
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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user