Move from file IDs to file paths (with retrocompatibility)

This commit is contained in:
MassiveBox 2025-04-02 20:15:48 +02:00
parent 56cf62f1eb
commit a2503d5def
Signed by: massivebox
GPG key ID: 9B74D3A59181947D
7 changed files with 62 additions and 49 deletions

View file

@ -27,9 +27,9 @@ async function getFile(path) {
}
async function getSVG(fileID) {
async function getSVG(path) {
const resp = await getFile("/data/assets/" + fileID + '.svg');
const resp = await getFile(path);
if(resp == null) {
return FALLBACK;
}
@ -37,10 +37,10 @@ async function getSVG(fileID) {
}
function getEditLink(fileID) {
function getEditLink(path) {
const data = encodeURIComponent(
JSON.stringify({
id: fileID
path: path,
})
)
return `siyuan://plugins/siyuan-jsdraw-pluginwhiteboard/?icon=iconDraw&title=Drawing&data=${data}`;