mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 00:50:13 +01:00
🚨
This commit is contained in:
parent
f1bdb4dcfd
commit
82eafca96d
10 changed files with 14 additions and 14 deletions
|
|
@ -451,9 +451,9 @@ export const resizeTabs = () => {
|
||||||
models.backlink.forEach(item => {
|
models.backlink.forEach(item => {
|
||||||
const mTreeElement = item.element.querySelector(".backlinkMList") as HTMLElement;
|
const mTreeElement = item.element.querySelector(".backlinkMList") as HTMLElement;
|
||||||
if (mTreeElement.style.height && mTreeElement.style.height !== "0px") {
|
if (mTreeElement.style.height && mTreeElement.style.height !== "0px") {
|
||||||
mTreeElement.style.height = (item.element.clientHeight - mTreeElement.previousElementSibling.clientHeight * 2) + "px"
|
mTreeElement.style.height = (item.element.clientHeight - mTreeElement.previousElementSibling.clientHeight * 2) + "px";
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
pdfResize();
|
pdfResize();
|
||||||
}, 200);
|
}, 200);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ export const initFramework = () => {
|
||||||
editIconElement.setAttribute("xlink:href", "#iconPreview");
|
editIconElement.setAttribute("xlink:href", "#iconPreview");
|
||||||
}
|
}
|
||||||
editElement.addEventListener(getEventName(), () => {
|
editElement.addEventListener(getEventName(), () => {
|
||||||
const isReadonly = editIconElement.getAttribute("xlink:href") === "#iconPreview"
|
const isReadonly = editIconElement.getAttribute("xlink:href") === "#iconPreview";
|
||||||
window.siyuan.config.editor.readOnly = isReadonly;
|
window.siyuan.config.editor.readOnly = isReadonly;
|
||||||
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, () => {
|
fetchPost("/api/setting/setEditor", window.siyuan.config.editor, () => {
|
||||||
if (!isReadonly) {
|
if (!isReadonly) {
|
||||||
|
|
@ -115,7 +115,7 @@ export const initFramework = () => {
|
||||||
inputElement.readOnly = true;
|
inputElement.readOnly = true;
|
||||||
editIconElement.setAttribute("xlink:href", "#iconEdit");
|
editIconElement.setAttribute("xlink:href", "#iconEdit");
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
scrimElement.addEventListener(getEventName(), () => {
|
scrimElement.addEventListener(getEventName(), () => {
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ const renderPDF = (id: string) => {
|
||||||
window.siyuan.printWin.once("ready-to-show", () => {
|
window.siyuan.printWin.once("ready-to-show", () => {
|
||||||
// 导出 PDF 预览界面不受主界面缩放影响 https://github.com/siyuan-note/siyuan/issues/6262
|
// 导出 PDF 预览界面不受主界面缩放影响 https://github.com/siyuan-note/siyuan/issues/6262
|
||||||
window.siyuan.printWin.webContents.setZoomFactor(1);
|
window.siyuan.printWin.webContents.setZoomFactor(1);
|
||||||
})
|
});
|
||||||
fetchPost("/api/export/exportTempContent", {content: html}, (response) => {
|
fetchPost("/api/export/exportTempContent", {content: html}, (response) => {
|
||||||
window.siyuan.printWin.loadURL(response.data.url);
|
window.siyuan.printWin.loadURL(response.data.url);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1200,7 +1200,7 @@ export class Gutter {
|
||||||
id,
|
id,
|
||||||
attrs: {breadcrumb: inputElement.checked.toString()}
|
attrs: {breadcrumb: inputElement.checked.toString()}
|
||||||
});
|
});
|
||||||
nodeElement.removeAttribute("data-render")
|
nodeElement.removeAttribute("data-render");
|
||||||
blockRender(protyle, nodeElement);
|
blockRender(protyle, nodeElement);
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -28,9 +28,9 @@ export const blockRender = (protyle: IProtyle, element: Element) => {
|
||||||
const content = Lute.UnEscapeHTMLStr(item.getAttribute("data-content"));
|
const content = Lute.UnEscapeHTMLStr(item.getAttribute("data-content"));
|
||||||
let breadcrumb: boolean | string = item.getAttribute("breadcrumb");
|
let breadcrumb: boolean | string = item.getAttribute("breadcrumb");
|
||||||
if (breadcrumb) {
|
if (breadcrumb) {
|
||||||
breadcrumb = breadcrumb === "true"
|
breadcrumb = breadcrumb === "true";
|
||||||
} else {
|
} else {
|
||||||
breadcrumb = window.siyuan.config.editor.embedBlockBreadcrumb
|
breadcrumb = window.siyuan.config.editor.embedBlockBreadcrumb;
|
||||||
}
|
}
|
||||||
fetchPost("/api/search/searchEmbedBlock", {
|
fetchPost("/api/search/searchEmbedBlock", {
|
||||||
embedBlockID: item.getAttribute("data-node-id"),
|
embedBlockID: item.getAttribute("data-node-id"),
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ export const setFontStyle = (textElement: HTMLElement, textOption: ITextOption)
|
||||||
textElement.innerText = blockRefData[2];
|
textElement.innerText = blockRefData[2];
|
||||||
};
|
};
|
||||||
const setLink = (textOption: string) => {
|
const setLink = (textOption: string) => {
|
||||||
const options = textOption.split(Constants.ZWSP)
|
const options = textOption.split(Constants.ZWSP);
|
||||||
textElement.setAttribute("data-href", options[0]);
|
textElement.setAttribute("data-href", options[0]);
|
||||||
textElement.removeAttribute("data-subtype");
|
textElement.removeAttribute("data-subtype");
|
||||||
textElement.removeAttribute("data-id");
|
textElement.removeAttribute("data-id");
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ export class Link extends ToolbarItem {
|
||||||
dataHref = clipText;
|
dataHref = clipText;
|
||||||
} else {
|
} else {
|
||||||
// 360
|
// 360
|
||||||
const lastSpace = clipText.lastIndexOf(' ')
|
const lastSpace = clipText.lastIndexOf(" ");
|
||||||
if (lastSpace > -1) {
|
if (lastSpace > -1) {
|
||||||
if (protyle.lute.IsValidLinkDest(clipText.substring(lastSpace))) {
|
if (protyle.lute.IsValidLinkDest(clipText.substring(lastSpace))) {
|
||||||
dataHref = clipText.substring(lastSpace);
|
dataHref = clipText.substring(lastSpace);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ export const pasteAsPlainText = async (protyle:IProtyle) => {
|
||||||
writeText("");
|
writeText("");
|
||||||
} else {
|
} else {
|
||||||
protyle.lute.SetHTMLTag2TextMark(true); // 临时设置 Lute 解析参数,行级元素键盘和下划线无法粘贴为纯文本 https://github.com/siyuan-note/siyuan/issues/6220
|
protyle.lute.SetHTMLTag2TextMark(true); // 临时设置 Lute 解析参数,行级元素键盘和下划线无法粘贴为纯文本 https://github.com/siyuan-note/siyuan/issues/6220
|
||||||
const dom = protyle.lute.InlineMd2BlockDOM(clipboard.readText())
|
const dom = protyle.lute.InlineMd2BlockDOM(clipboard.readText());
|
||||||
protyle.lute.SetHTMLTag2TextMark(false);
|
protyle.lute.SetHTMLTag2TextMark(false);
|
||||||
insertHTML(protyle.lute.BlockDOM2Content(dom), protyle, false);
|
insertHTML(protyle.lute.BlockDOM2Content(dom), protyle, false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ export class Tree {
|
||||||
if (item.count) {
|
if (item.count) {
|
||||||
countHTML = `<span class="counter">${item.count}</span>`;
|
countHTML = `<span class="counter">${item.count}</span>`;
|
||||||
}
|
}
|
||||||
const hasChild = (item.children && item.children.length > 0) || (item.blocks && item.blocks.length > 0)
|
const hasChild = (item.children && item.children.length > 0) || (item.blocks && item.blocks.length > 0);
|
||||||
html += `<li class="b3-list-item"
|
html += `<li class="b3-list-item"
|
||||||
${(item.nodeType !== "NodeDocument" && item.type === "backlink") ? 'draggable="true"' : ""}
|
${(item.nodeType !== "NodeDocument" && item.type === "backlink") ? 'draggable="true"' : ""}
|
||||||
${item.id ? 'data-node-id="' + item.id + '"' : ""}
|
${item.id ? 'data-node-id="' + item.id + '"' : ""}
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,8 @@ const loadIcon = (iconURL: string, data: IAppearance) => {
|
||||||
addScript(iconURL, "iconScript");
|
addScript(iconURL, "iconScript");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
export const loadAssets = (data: IAppearance) => {
|
export const loadAssets = (data: IAppearance) => {
|
||||||
const defaultStyleElement = document.getElementById("themeDefaultStyle");
|
const defaultStyleElement = document.getElementById("themeDefaultStyle");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue