Skip to content

Commit

Permalink
🚨
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Nov 11, 2022
1 parent 551055f commit 810093c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions app/src/asset/renderAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ export const pdfResize = () => {
};

export const genAssetHTML = (type: string, pathString: string, imgName: string, linkName: string) => {
let html = ""
let html = "";
if (Constants.SIYUAN_ASSETS_AUDIO.includes(type)) {
html = `<div data-node-id="${Lute.NewNodeID()}" data-type="NodeAudio" class="iframe" updated="${dayjs().format("YYYYMMDDHHmmss")}"><div class="iframe-content"><audio controls="controls" src="${pathString}" data-src="${pathString}"></audio>${Constants.ZWSP}</div><div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`;
} else if (Constants.SIYUAN_ASSETS_IMAGE.includes(type)) {
let netHTML = ""
let netHTML = "";
if (!pathString.startsWith("assets/")) {
netHTML = '<span class="img__net"><svg><use xlink:href="#iconLanguage"></use></svg></span>'
netHTML = '<span class="img__net"><svg><use xlink:href="#iconLanguage"></use></svg></span>';
}
html = `<span contenteditable="false" data-type="img" class="img"><span> </span><span><span class="protyle-action protyle-icons"><span class="protyle-icon protyle-icon--only"><svg class="svg"><use xlink:href="#iconMore"></use></svg></span></span><img src="${pathString}" data-src="${pathString}" alt="${imgName}" /><span class="protyle-action__drag"></span>${netHTML}<span class="protyle-action__title"></span></span><span> </span></span>`;
} else if (Constants.SIYUAN_ASSETS_VIDEO.includes(type)) {
Expand All @@ -62,4 +62,4 @@ export const genAssetHTML = (type: string, pathString: string, imgName: string,
html = `<span data-type="a" data-href="${pathString}">${linkName}</span>`;
}
return html;
}
};
1 change: 0 additions & 1 deletion app/src/config/repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ const bindProviderEvent = () => {
const providerPanelElement = repos.element.querySelector("#syncProviderPanel");
providerPanelElement.querySelectorAll(".b3-text-field").forEach(item => {
item.addEventListener("blur", () => {
const provider = window.siyuan.config.sync.provider;
if (window.siyuan.config.sync.provider === 2) {
const s3 = {
endpoint: (providerPanelElement.querySelector("#endpoint") as HTMLInputElement).value,
Expand Down
2 changes: 1 addition & 1 deletion app/src/protyle/upload/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const genUploadedLabel = (responseText: string, protyle: IProtyle) => {
const path = response.data.succMap[key];
const type = pathPosix().extname(key).toLowerCase();
const filename = protyle.options.upload.filename(key);
succFileText += genAssetHTML(type, path, filename.substring(0, filename.length - type.length), filename)
succFileText += genAssetHTML(type, path, filename.substring(0, filename.length - type.length), filename);
if (!Constants.SIYUAN_ASSETS_AUDIO.includes(type) && !Constants.SIYUAN_ASSETS_VIDEO.includes(type) &&
keys.length - 1 !== index) {
succFileText += "\n";
Expand Down

0 comments on commit 810093c

Please sign in to comment.