mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +01:00
🚨
This commit is contained in:
parent
8f59465ca6
commit
553891defb
17 changed files with 46 additions and 46 deletions
|
|
@ -1109,7 +1109,7 @@ app.whenReady().then(() => {
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
globalShortcut.register(shortcut, () => {
|
globalShortcut.register(shortcut, () => {
|
||||||
let currentWorkspace;
|
let currentWorkspace;
|
||||||
const currentWebContentsId = (latestActiveWindow && !latestActiveWindow.isDestroyed()) ? latestActiveWindow.webContents.id : undefined
|
const currentWebContentsId = (latestActiveWindow && !latestActiveWindow.isDestroyed()) ? latestActiveWindow.webContents.id : undefined;
|
||||||
workspaces.find(workspaceItem => {
|
workspaces.find(workspaceItem => {
|
||||||
if ((currentWebContentsId || event.sender.id) === workspaceItem.browserWindow.webContents.id) {
|
if ((currentWebContentsId || event.sender.id) === workspaceItem.browserWindow.webContents.id) {
|
||||||
currentWorkspace = workspaceItem;
|
currentWorkspace = workspaceItem;
|
||||||
|
|
|
||||||
|
|
@ -393,21 +393,21 @@ const showToolbar = (element: HTMLElement, range: Range, target?: HTMLElement) =
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTextNode = (element: HTMLElement, isFirst: boolean) => {
|
const getTextNode = (element: HTMLElement, isFirst: boolean) => {
|
||||||
const spans = element.querySelectorAll(".markedContent span")
|
const spans = element.querySelectorAll(".markedContent span");
|
||||||
let index = isFirst ? 0 : spans.length - 1
|
let index = isFirst ? 0 : spans.length - 1;
|
||||||
while (spans[index]) {
|
while (spans[index]) {
|
||||||
if (spans[index].textContent) {
|
if (spans[index].textContent) {
|
||||||
break
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (isFirst) {
|
if (isFirst) {
|
||||||
index++
|
index++;
|
||||||
} else {
|
} else {
|
||||||
index--
|
index--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return spans[index]
|
return spans[index];
|
||||||
}
|
};
|
||||||
|
|
||||||
const getHightlightCoordsByRange = (pdf: any, color: string) => {
|
const getHightlightCoordsByRange = (pdf: any, color: string) => {
|
||||||
const range = window.getSelection().getRangeAt(0);
|
const range = window.getSelection().getRangeAt(0);
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ export const initBlockPopover = (app: App) => {
|
||||||
if (aElement.classList.contains("av__cell")) {
|
if (aElement.classList.contains("av__cell")) {
|
||||||
if (aElement.classList.contains("av__cell--header")) {
|
if (aElement.classList.contains("av__cell--header")) {
|
||||||
const textElement = aElement.querySelector(".av__celltext");
|
const textElement = aElement.querySelector(".av__celltext");
|
||||||
const desc = aElement.getAttribute("data-desc")
|
const desc = aElement.getAttribute("data-desc");
|
||||||
if (textElement.scrollWidth > textElement.clientWidth + 2 || desc) {
|
if (textElement.scrollWidth > textElement.clientWidth + 2 || desc) {
|
||||||
if (desc) {
|
if (desc) {
|
||||||
tip = `${getCellText(aElement)}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
|
tip = `${getCellText(aElement)}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
|
||||||
|
|
@ -56,7 +56,7 @@ export const initBlockPopover = (app: App) => {
|
||||||
}
|
}
|
||||||
} else if (aElement.parentElement.parentElement.classList.contains("av__views")) {
|
} else if (aElement.parentElement.parentElement.classList.contains("av__views")) {
|
||||||
const textElement = aElement.querySelector(".item__text");
|
const textElement = aElement.querySelector(".item__text");
|
||||||
const desc = aElement.getAttribute("data-desc")
|
const desc = aElement.getAttribute("data-desc");
|
||||||
if (textElement.scrollWidth > textElement.clientWidth + 2 || desc) {
|
if (textElement.scrollWidth > textElement.clientWidth + 2 || desc) {
|
||||||
if (desc) {
|
if (desc) {
|
||||||
tip = `${textElement.textContent}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
|
tip = `${textElement.textContent}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
|
||||||
} else {
|
} else {
|
||||||
const ids = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select")).map(item => item.getAttribute("data-node-id"));
|
const ids = Array.from(protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select")).map(item => item.getAttribute("data-node-id"));
|
||||||
if (ids.length === 0) {
|
if (ids.length === 0) {
|
||||||
ids.push(nodeElement.getAttribute("data-node-id"))
|
ids.push(nodeElement.getAttribute("data-node-id"));
|
||||||
}
|
}
|
||||||
copyTextByType(ids, "ref");
|
copyTextByType(ids, "ref");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -694,7 +694,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
|
||||||
assetElement.classList.remove("fn__none");
|
assetElement.classList.remove("fn__none");
|
||||||
assetElement.innerHTML = renderAssetsPreview(dataPath);
|
assetElement.innerHTML = renderAssetsPreview(dataPath);
|
||||||
} else if (type === "doc") {
|
} else if (type === "doc") {
|
||||||
const k = (firstPanelElement.querySelector(".b3-text-field") as HTMLInputElement).value
|
const k = (firstPanelElement.querySelector(".b3-text-field") as HTMLInputElement).value;
|
||||||
fetchPost("/api/history/getDocHistoryContent", {
|
fetchPost("/api/history/getDocHistoryContent", {
|
||||||
historyPath: dataPath,
|
historyPath: dataPath,
|
||||||
highlight: !isSupportCSSHL(),
|
highlight: !isSupportCSSHL(),
|
||||||
|
|
@ -717,7 +717,7 @@ const bindEvent = (app: App, element: Element, dialog?: Dialog) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
titleElement.classList.remove("fn__none")
|
titleElement.classList.remove("fn__none");
|
||||||
titleElement.textContent = target.querySelector(".b3-list-item__text").textContent;
|
titleElement.textContent = target.querySelector(".b3-list-item__text").textContent;
|
||||||
let currentItem = hasClosestByClassName(target, "b3-list") as HTMLElement;
|
let currentItem = hasClosestByClassName(target, "b3-list") as HTMLElement;
|
||||||
if (currentItem) {
|
if (currentItem) {
|
||||||
|
|
|
||||||
|
|
@ -136,13 +136,13 @@ export class Backlink extends Model {
|
||||||
item.addEventListener("blur", (event: KeyboardEvent) => {
|
item.addEventListener("blur", (event: KeyboardEvent) => {
|
||||||
const inputElement = event.target as HTMLInputElement;
|
const inputElement = event.target as HTMLInputElement;
|
||||||
inputElement.classList.add("fn__none");
|
inputElement.classList.add("fn__none");
|
||||||
const filterIconElement = inputElement.nextElementSibling
|
const filterIconElement = inputElement.nextElementSibling;
|
||||||
if (inputElement.value) {
|
if (inputElement.value) {
|
||||||
filterIconElement.classList.add("block__icon--active")
|
filterIconElement.classList.add("block__icon--active");
|
||||||
filterIconElement.setAttribute("aria-label", window.siyuan.languages.filter + " " + inputElement.value)
|
filterIconElement.setAttribute("aria-label", window.siyuan.languages.filter + " " + inputElement.value);
|
||||||
} else {
|
} else {
|
||||||
filterIconElement.classList.remove("block__icon--active")
|
filterIconElement.classList.remove("block__icon--active");
|
||||||
filterIconElement.setAttribute("aria-label", window.siyuan.languages.filter)
|
filterIconElement.setAttribute("aria-label", window.siyuan.languages.filter);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
item.addEventListener("keydown", (event: KeyboardEvent) => {
|
item.addEventListener("keydown", (event: KeyboardEvent) => {
|
||||||
|
|
@ -442,7 +442,7 @@ export class Backlink extends Model {
|
||||||
});
|
});
|
||||||
svgElement.removeAttribute("disabled");
|
svgElement.removeAttribute("disabled");
|
||||||
} else {
|
} else {
|
||||||
const keyword = isMention ? this.inputsElement[1].value : this.inputsElement[0].value
|
const keyword = isMention ? this.inputsElement[1].value : this.inputsElement[0].value;
|
||||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||||
defID: this.blockId,
|
defID: this.blockId,
|
||||||
refTreeID: docId,
|
refTreeID: docId,
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,7 @@ export class Background {
|
||||||
this.addTags(inputElement.value, protyle);
|
this.addTags(inputElement.value, protyle);
|
||||||
}
|
}
|
||||||
inputElement.value = "";
|
inputElement.value = "";
|
||||||
inputElement.dispatchEvent(new CustomEvent("input"))
|
inputElement.dispatchEvent(new CustomEvent("input"));
|
||||||
} else if (event.key === "Escape") {
|
} else if (event.key === "Escape") {
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -385,7 +385,7 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
||||||
if (cellRect.bottom > contentRect.bottom) {
|
if (cellRect.bottom > contentRect.bottom) {
|
||||||
height = contentRect.bottom - cellRect.top;
|
height = contentRect.bottom - cellRect.top;
|
||||||
}
|
}
|
||||||
const width = Math.min(Math.max(cellRect.width, 25), contentRect.width)
|
const width = Math.min(Math.max(cellRect.width, 25), contentRect.width);
|
||||||
style = `style="padding-top: 6.5px;position:absolute;left: ${(cellRect.left < contentRect.left || cellRect.left + width > contentRect.right) ? contentRect.left : cellRect.left}px;top: ${cellRect.top}px;width:${width}px;height: ${height}px"`;
|
style = `style="padding-top: 6.5px;position:absolute;left: ${(cellRect.left < contentRect.left || cellRect.left + width > contentRect.right) ? contentRect.left : cellRect.left}px;top: ${cellRect.top}px;width:${width}px;height: ${height}px"`;
|
||||||
} else {
|
} else {
|
||||||
style = `style="padding-top: 6.5px;position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 25)}px;height: ${height}px"`;
|
style = `style="padding-top: 6.5px;position:absolute;left: ${cellRect.left}px;top: ${cellRect.top}px;width:${Math.max(cellRect.width, 25)}px;height: ${height}px"`;
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,7 @@ export const getEditHTML = (options: {
|
||||||
colData.options = [];
|
colData.options = [];
|
||||||
}
|
}
|
||||||
colData.options.forEach(item => {
|
colData.options.forEach(item => {
|
||||||
const airaLabel = item.desc ? `${escapeAriaLabel(item.name)}<div class='ft__on-surface'>${escapeAriaLabel(item.desc || "")}</div>` : ""
|
const airaLabel = item.desc ? `${escapeAriaLabel(item.name)}<div class='ft__on-surface'>${escapeAriaLabel(item.desc || "")}</div>` : "";
|
||||||
html += `<button class="b3-menu__item${html ? "" : " b3-menu__item--current"}" draggable="true" data-name="${escapeAttr(item.name)}" data-desc="${escapeAttr(item.desc || "")}" data-color="${item.color}">
|
html += `<button class="b3-menu__item${html ? "" : " b3-menu__item--current"}" draggable="true" data-name="${escapeAttr(item.name)}" data-desc="${escapeAttr(item.desc || "")}" data-color="${item.color}">
|
||||||
<svg class="b3-menu__icon fn__grab"><use xlink:href="#iconDrag"></use></svg>
|
<svg class="b3-menu__icon fn__grab"><use xlink:href="#iconDrag"></use></svg>
|
||||||
<div class="fn__flex-1 ariaLabel" data-position="2parentW" aria-label="${airaLabel}">
|
<div class="fn__flex-1 ariaLabel" data-position="2parentW" aria-label="${airaLabel}">
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => {
|
||||||
const currentDate = new Date().getTime();
|
const currentDate = new Date().getTime();
|
||||||
if (cellValue?.value?.date?.isNotEmpty) {
|
if (cellValue?.value?.date?.isNotEmpty) {
|
||||||
value = dayjs(cellValue.value.date.content).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
value = dayjs(cellValue.value.date.content).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||||
const year = value.split("-")[0]
|
const year = value.split("-")[0];
|
||||||
if (year.length !== 4) {
|
if (year.length !== 4) {
|
||||||
value = new Array(4 - year.length).fill(0).join("") + value
|
value = new Array(4 - year.length).fill(0).join("") + value;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
value = dayjs(currentDate).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
value = dayjs(currentDate).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||||
|
|
@ -39,9 +39,9 @@ export const getDateHTML = (data: IAVTable, cellElements: HTMLElement[]) => {
|
||||||
let value2 = "";
|
let value2 = "";
|
||||||
if (cellValue?.value?.date?.isNotEmpty2) {
|
if (cellValue?.value?.date?.isNotEmpty2) {
|
||||||
value2 = dayjs(cellValue.value.date.content2).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
value2 = dayjs(cellValue.value.date.content2).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||||
const year = value.split("-")[0]
|
const year = value.split("-")[0];
|
||||||
if (year.length !== 4) {
|
if (year.length !== 4) {
|
||||||
value = new Array(4 - year.length).fill(0).join("") + value
|
value = new Array(4 - year.length).fill(0).join("") + value;
|
||||||
}
|
}
|
||||||
} else if (hasEndDate) {
|
} else if (hasEndDate) {
|
||||||
value2 = dayjs(currentDate).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
value2 = dayjs(currentDate).format(isNotTime ? "YYYY-MM-DD" : "YYYY-MM-DD HH:mm");
|
||||||
|
|
@ -144,12 +144,12 @@ export const bindDateEvent = (options: {
|
||||||
};
|
};
|
||||||
|
|
||||||
const getFullYearTime = (dateStr: string) => {
|
const getFullYearTime = (dateStr: string) => {
|
||||||
const year = dateStr.split("-")[0]
|
const year = dateStr.split("-")[0];
|
||||||
const date = new Date(dateStr)
|
const date = new Date(dateStr);
|
||||||
if (year.startsWith("00") || year.startsWith("000") || year.length < 3) {
|
if (year.startsWith("00") || year.startsWith("000") || year.length < 3) {
|
||||||
date.setFullYear(parseInt(year))
|
date.setFullYear(parseInt(year));
|
||||||
return date.getTime()
|
return date.getTime();
|
||||||
} else {
|
} else {
|
||||||
return date.getTime()
|
return date.getTime();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ const filterSelectHTML = (key: string, options: {
|
||||||
if (!key ||
|
if (!key ||
|
||||||
(key.toLowerCase().indexOf(item.name.toLowerCase()) > -1 ||
|
(key.toLowerCase().indexOf(item.name.toLowerCase()) > -1 ||
|
||||||
item.name.toLowerCase().indexOf(key.toLowerCase()) > -1)) {
|
item.name.toLowerCase().indexOf(key.toLowerCase()) > -1)) {
|
||||||
const airaLabel = item.desc ? `${escapeAriaLabel(item.name)}<div class='ft__on-surface'>${escapeAriaLabel(item.desc || "")}</div>` : ""
|
const airaLabel = item.desc ? `${escapeAriaLabel(item.name)}<div class='ft__on-surface'>${escapeAriaLabel(item.desc || "")}</div>` : "";
|
||||||
html += `<button data-type="addColOptionOrCell" class="b3-menu__item" data-name="${escapeAttr(item.name)}" data-desc="${escapeAttr(item.desc || "")}" draggable="true" data-color="${item.color}">
|
html += `<button data-type="addColOptionOrCell" class="b3-menu__item" data-name="${escapeAttr(item.name)}" data-desc="${escapeAttr(item.desc || "")}" draggable="true" data-color="${item.color}">
|
||||||
<svg class="b3-menu__icon fn__grab"><use xlink:href="#iconDrag"></use></svg>
|
<svg class="b3-menu__icon fn__grab"><use xlink:href="#iconDrag"></use></svg>
|
||||||
<div class="fn__flex-1 ariaLabel" data-position="2parentW" aria-label="${airaLabel}">
|
<div class="fn__flex-1 ariaLabel" data-position="2parentW" aria-label="${airaLabel}">
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export const searchMarkRender = (protyle: IProtyle, keys: string[], isHL: boolea
|
||||||
let currentNode = treeWalker.nextNode();
|
let currentNode = treeWalker.nextNode();
|
||||||
while (currentNode) {
|
while (currentNode) {
|
||||||
textNodes.push(currentNode);
|
textNodes.push(currentNode);
|
||||||
currentSize += currentNode.textContent.length
|
currentSize += currentNode.textContent.length;
|
||||||
textNodesSize.push(currentSize);
|
textNodesSize.push(currentSize);
|
||||||
currentNode = treeWalker.nextNode();
|
currentNode = treeWalker.nextNode();
|
||||||
}
|
}
|
||||||
|
|
@ -45,9 +45,9 @@ export const searchMarkRender = (protyle: IProtyle, keys: string[], isHL: boolea
|
||||||
range.setStart(currentTextNode, startIndex - (currentNodeIndex ? textNodesSize[currentNodeIndex - 1] : 0));
|
range.setStart(currentTextNode, startIndex - (currentNodeIndex ? textNodesSize[currentNodeIndex - 1] : 0));
|
||||||
|
|
||||||
while (currentNodeIndex < textNodes.length && textNodesSize[currentNodeIndex] < endIndex) {
|
while (currentNodeIndex < textNodes.length && textNodesSize[currentNodeIndex] < endIndex) {
|
||||||
currentNodeIndex++
|
currentNodeIndex++;
|
||||||
}
|
}
|
||||||
currentTextNode = textNodes[currentNodeIndex]
|
currentTextNode = textNodes[currentNodeIndex];
|
||||||
range.setEnd(currentTextNode, endIndex - (currentNodeIndex ? textNodesSize[currentNodeIndex - 1] : 0));
|
range.setEnd(currentTextNode, endIndex - (currentNodeIndex ? textNodesSize[currentNodeIndex - 1] : 0));
|
||||||
|
|
||||||
rangeIndexes.push({range, startIndex});
|
rangeIndexes.push({range, startIndex});
|
||||||
|
|
@ -56,13 +56,13 @@ export const searchMarkRender = (protyle: IProtyle, keys: string[], isHL: boolea
|
||||||
}
|
}
|
||||||
startIndex = endIndex;
|
startIndex = endIndex;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
|
|
||||||
rangeIndexes.sort((b, a) => {
|
rangeIndexes.sort((b, a) => {
|
||||||
if (a.startIndex > b.startIndex) {
|
if (a.startIndex > b.startIndex) {
|
||||||
return -1
|
return -1;
|
||||||
} else {
|
} else {
|
||||||
return 0
|
return 0;
|
||||||
}
|
}
|
||||||
}).forEach((item, index) => {
|
}).forEach((item, index) => {
|
||||||
if (index === protyle.highlight.rangeIndex && isHL) {
|
if (index === protyle.highlight.rangeIndex && isHL) {
|
||||||
|
|
@ -84,4 +84,4 @@ export const searchMarkRender = (protyle: IProtyle, keys: string[], isHL: boolea
|
||||||
|
|
||||||
export const isSupportCSSHL = () => {
|
export const isSupportCSSHL = () => {
|
||||||
return !!(CSS && CSS.highlights);
|
return !!(CSS && CSS.highlights);
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -415,7 +415,7 @@ export const insertHTML = (html: string, protyle: IProtyle, isBlock = false,
|
||||||
(insertBefore ? Array.from(tempElement.content.children) : Array.from(tempElement.content.children).reverse()).forEach((item) => {
|
(insertBefore ? Array.from(tempElement.content.children) : Array.from(tempElement.content.children).reverse()).forEach((item) => {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/13232
|
// https://github.com/siyuan-note/siyuan/issues/13232
|
||||||
if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
|
if (item.getAttribute("data-type") === "NodeHeading" && item.getAttribute("fold") === "1") {
|
||||||
item.removeAttribute("fold")
|
item.removeAttribute("fold");
|
||||||
}
|
}
|
||||||
let addId = item.getAttribute("data-node-id");
|
let addId = item.getAttribute("data-node-id");
|
||||||
if (addId === id) {
|
if (addId === id) {
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ export const reloadProtyle = (protyle: IProtyle, focus: boolean, updateReadonly?
|
||||||
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
|
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
|
||||||
if (tabElement) {
|
if (tabElement) {
|
||||||
const inputsElement = tabElement.querySelectorAll(".b3-text-field") as NodeListOf<HTMLInputElement>;
|
const inputsElement = tabElement.querySelectorAll(".b3-text-field") as NodeListOf<HTMLInputElement>;
|
||||||
const keyword = isMention ? inputsElement[1].value : inputsElement[0].value
|
const keyword = isMention ? inputsElement[1].value : inputsElement[0].value;
|
||||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||||
defID: protyle.element.getAttribute("data-defid"),
|
defID: protyle.element.getAttribute("data-defid"),
|
||||||
refTreeID: protyle.block.rootID,
|
refTreeID: protyle.block.rootID,
|
||||||
|
|
|
||||||
|
|
@ -743,4 +743,4 @@ export const clearTableCell = (protyle: IProtyle, tableBlockElement: HTMLElement
|
||||||
item.innerHTML = "";
|
item.innerHTML = "";
|
||||||
});
|
});
|
||||||
updateTransaction(protyle, tableBlockElement.getAttribute("data-node-id"), tableBlockElement.outerHTML, oldHTML);
|
updateTransaction(protyle, tableBlockElement.getAttribute("data-node-id"), tableBlockElement.outerHTML, oldHTML);
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -1298,7 +1298,7 @@ export class WYSIWYG {
|
||||||
icon: "iconTrashcan",
|
icon: "iconTrashcan",
|
||||||
accelerator: "⌦",
|
accelerator: "⌦",
|
||||||
click() {
|
click() {
|
||||||
clearTableCell(protyle, tableBlockElement as HTMLElement)
|
clearTableCell(protyle, tableBlockElement as HTMLElement);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
|
|
||||||
|
|
@ -1200,7 +1200,7 @@ const renderNextSearchMark = (options: {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let articleId: string
|
let articleId: string;
|
||||||
|
|
||||||
export const getArticle = (options: {
|
export const getArticle = (options: {
|
||||||
id: string,
|
id: string,
|
||||||
|
|
@ -1208,7 +1208,7 @@ export const getArticle = (options: {
|
||||||
edit: Protyle
|
edit: Protyle
|
||||||
value?: string,
|
value?: string,
|
||||||
}) => {
|
}) => {
|
||||||
articleId = options.id
|
articleId = options.id;
|
||||||
checkFold(options.id, (zoomIn) => {
|
checkFold(options.id, (zoomIn) => {
|
||||||
if (articleId !== options.id) {
|
if (articleId !== options.id) {
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue