This commit is contained in:
Vanessa 2024-03-29 09:47:40 +08:00
parent 15f1510d6c
commit 13332781c9
7 changed files with 13 additions and 13 deletions

View file

@ -1041,7 +1041,7 @@ app.whenReady().then(() => {
return;
}
if (globalShortcut.isRegistered(shortcut)) {
globalShortcut.unregister(shortcut)
globalShortcut.unregister(shortcut);
}
if (index === 0) {
globalShortcut.register(shortcut, () => {

View file

@ -186,7 +186,7 @@ export const keymap = {
},
_setkeymap(app: App) {
const data: Config.IKeymap = JSON.parse(JSON.stringify(Constants.SIYUAN_KEYMAP));
const oldToggleWin = window.siyuan.config.keymap.general.toggleWin.custom
const oldToggleWin = window.siyuan.config.keymap.general.toggleWin.custom;
keymap.element.querySelectorAll("label.b3-list-item input").forEach((item) => {
const keys = item.getAttribute("data-key").split(Constants.ZWSP);
const newHotkey = item.getAttribute("data-value");

View file

@ -171,7 +171,7 @@ export const openSnippets = () => {
}, (searchResponse) => {
dialog.element.querySelectorAll(`.fn__flex-1 > div > [data-type="${inputItem.dataset.type}"]`).forEach((snipeetPanel: Element) => {
snipeetPanel.classList.add("fn__none");
})
});
searchResponse.data.snippets.forEach((snippetItem: ISnippet) => {
if (snippetItem.type === inputItem.dataset.type) {
dialog.element.querySelector(`[data-id="${snippetItem.id}"]`).classList.remove("fn__none");
@ -180,7 +180,7 @@ export const openSnippets = () => {
});
}
});
})
});
});
};

View file

@ -98,7 +98,7 @@ const editLayout = (layoutName?: string) => {
});
dialog.destroy();
});
}
};
const togglePinDock = (dock: Dock, icon: string) => {
return {

View file

@ -331,7 +331,7 @@ ${window.siyuan.languages.insertRowBefore.replace("${x}", '<span class="fn__spac
}
insertRows(blockElement, protyle, parseInt(inputElement.value), rowElements[0].previousElementSibling.getAttribute("data-id"));
menu.close();
})
});
inputElement.addEventListener("keydown", (event: KeyboardEvent) => {
if (!event.isComposing && event.key === "Enter") {
insertRows(blockElement, protyle, parseInt(inputElement.value), rowElements[0].previousElementSibling.getAttribute("data-id"));

View file

@ -15,11 +15,11 @@ import {hintRef} from "../../hint/extend";
const renderCellURL = (urlContent: string) => {
let host = urlContent;
let suffix = ""
let suffix = "";
try {
const urlObj = new URL(urlContent);
host = urlObj.host;
suffix = urlObj.href.replace(urlObj.origin, "")
suffix = urlObj.href.replace(urlObj.origin, "");
if (suffix.length > 12) {
suffix = suffix.substring(0, 4) + "..." + suffix.substring(suffix.length - 6);
}
@ -404,9 +404,9 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
addDragFill(cellElements[0]);
let textPlain = inputElement.value;
if (isDynamicRef(textPlain)) {
textPlain = textPlain.substring(2, 22 + 2)
textPlain = textPlain.substring(2, 22 + 2);
} else {
textPlain = textPlain.substring(2)
textPlain = textPlain.substring(2);
}
hintRef(textPlain, protyle, "av");
avMaskElement?.remove();
@ -630,7 +630,7 @@ export const renderCell = (cellValue: IAVCellValue) => {
} else if (["email", "phone"].includes(cellValue.type)) {
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${cellValue ? cellValue[cellValue.type as "email"].content : ""}</span>`;
} else if ("url" === cellValue.type) {
text = renderCellURL(cellValue?.url?.content || "")
text = renderCellURL(cellValue?.url?.content || "");
} else if (cellValue.type === "block") {
if (cellValue?.isDetached) {
text = `<span class="av__celltext">${cellValue.block.content || ""}</span>
@ -709,7 +709,7 @@ const renderRollup = (cellValue: IAVCellValue) => {
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${emailContent}</span>`;
}
} else if ("url" === cellValue.type) {
const urlContent = cellValue?.url?.content || ""
const urlContent = cellValue?.url?.content || "";
if (urlContent) {
text = renderCellURL(urlContent);
}

View file

@ -137,7 +137,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
}
const contenteditableElement = getContenteditableElement(tempElement.content.firstElementChild);
if (contenteditableElement && contenteditableElement.childNodes.length === 1 && contenteditableElement.firstElementChild?.getAttribute("data-type") === "block-ref") {
const selectCellElement = blockElement.querySelector(".av__cell--select") as HTMLElement
const selectCellElement = blockElement.querySelector(".av__cell--select") as HTMLElement;
if (selectCellElement) {
const avID = blockElement.dataset.avId;
const sourceId = contenteditableElement.firstElementChild.getAttribute("data-id");