Move from file IDs to file paths (with retrocompatibility)
This commit is contained in:
parent
56cf62f1eb
commit
a2503d5def
7 changed files with 62 additions and 49 deletions
|
@ -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}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue