siyuan-jsdraw-plugin/public/webapp/index.html
MassiveBox 5e51589ffa
Internal file paths are now Markdown image paths
In the last commit, file paths were implemented to be the full path for the API, however that is not necessary.
Before this change: /data/assets/filename.svg
After: assets/filename.svg
The new method is what SiYuan uses for Markdown images, like ![Drawing](assets/filename.svg)
2025-04-03 00:12:36 +02:00

30 lines
No EOL
1,015 B
HTML

<!DOCTYPE html>
<html>
<head>
<script src="draw.js"></script>
<script src="button.js"></script>
<script>
const urlParams = new URLSearchParams(window.location.search);
let path = urlParams.get('path');
if(path === null) {
const fileID = urlParams.get('id'); // legacy support
path = "assets/" + fileID + ".svg";
}
document.addEventListener('DOMContentLoaded', async () => {
const editLink = document.createElement('a');
editLink.href = getEditLink(path);
document.body.appendChild(editLink);
const htmlContainer = document.createElement('div');
htmlContainer.innerHTML = await getSVG(path);
editLink.appendChild(htmlContainer);
addButton(document, path);
});
</script>
<link rel="stylesheet" href="index.css">
</head>
<body>
</body>
</html>