This commit is contained in:
Vanessa 2024-02-25 22:28:35 +08:00
parent 77c9cac3d4
commit 671667981d
12 changed files with 13 additions and 14 deletions

View file

@ -216,7 +216,7 @@ export class BlockPanel {
this.element = undefined;
this.targetElement = undefined;
// 移除弹出上使用右键菜单
const menuLevel = parseInt(window.siyuan.menus.menu.element.dataset.from)
const menuLevel = parseInt(window.siyuan.menus.menu.element.dataset.from);
if (window.siyuan.menus.menu.element.dataset.from !== "app" && menuLevel && menuLevel >= level) {
// https://github.com/siyuan-note/siyuan/issues/9854 右键菜单不是从浮窗中弹出的则不进行移除
window.siyuan.menus.menu.remove();

View file

@ -182,7 +182,7 @@ const hidePopover = (event: MouseEvent & { path: HTMLElement[] }) => {
if (blockElement) {
for (let i = window.siyuan.blockPanels.length - 1; i >= 0; i--) {
const item = window.siyuan.blockPanels[i];
const itemLevel = parseInt(item.element.getAttribute("data-level"))
const itemLevel = parseInt(item.element.getAttribute("data-level"));
if ((item.targetElement || typeof item.x === "number") &&
itemLevel > (maxEditLevels[item.element.getAttribute("data-oid")] || 0) &&
item.element.getAttribute("data-pin") === "false" &&

View file

@ -9,12 +9,12 @@ const _NODE_ENV = NODE_ENV;
const altNumber = navigator.platform.toUpperCase().indexOf("MAC") > -1 ? "⌃" : "⌥";
const getFunctionKey = () => {
const fData: { [key: number]: string } = {}
const fData: { [key: number]: string } = {};
for (let i = 1; i <= 32; i++) {
fData[i + 111] = "F" + i;
}
return fData;
}
};
export abstract class Constants {
public static readonly SIYUAN_VERSION: string = _SIYUAN_VERSION;

View file

@ -16,7 +16,7 @@ export const abcRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
}
if (abcElements.length > 0) {
addScript(`${cdn}/js/abcjs/abcjs-basic-min.js?v=6.2.2`, "protyleAbcjsScript").then(() => {
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
abcElements.forEach((e: HTMLDivElement) => {
if (e.getAttribute("data-render") === "true") {
return;

View file

@ -4,7 +4,6 @@ import {upDownHint} from "../../../util/upDownHint";
import {fetchPost} from "../../../util/fetch";
import {escapeHtml} from "../../../util/escape";
import {transaction} from "../../wysiwyg/transaction";
import {genIconHTML} from "../util";
import {unicode2Emoji} from "../../../emoji";
import {getColIconByType} from "./col";
import {showMessage} from "../../../dialog/message";

View file

@ -30,7 +30,7 @@ export const chartRender = (element: Element, cdn = Constants.PROTYLE_CDN) => {
});
}
}
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
echartsElements.forEach(async (e: HTMLDivElement) => {
if (e.getAttribute("data-render") === "true") {
return;

View file

@ -36,7 +36,7 @@ export const flowchartRender = (element: Element, cdn = Constants.PROTYLE_CDN) =
};
const initFlowchart = (flowchartElements: Element[]) => {
const wysiswgElement = hasClosestByClassName(flowchartElements[0], "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(flowchartElements[0], "protyle-wysiwyg", true);
flowchartElements.forEach((item: HTMLElement) => {
if (item.getAttribute("data-render") === "true") {
return;

View file

@ -15,7 +15,7 @@ export const graphvizRender = (element: Element, cdn = Constants.PROTYLE_CDN) =>
return;
}
addScript(`${cdn}/js/graphviz/viz.js?v=0.0.0`, "protyleGraphVizScript").then(() => {
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
graphvizElements.forEach((e: HTMLDivElement) => {
if (e.getAttribute("data-render") === "true") {
return;

View file

@ -57,7 +57,7 @@ export const mermaidRender = (element: Element, cdn = Constants.PROTYLE_CDN) =>
};
const initMermaid = (mermaidElements: Element[]) => {
const wysiswgElement = hasClosestByClassName(mermaidElements[0], "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(mermaidElements[0], "protyle-wysiwyg", true);
mermaidElements.forEach(async (item: HTMLElement) => {
if (item.getAttribute("data-render") === "true") {
return;

View file

@ -27,7 +27,7 @@ export const mindmapRender = (element: Element, cdn = Constants.PROTYLE_CDN) =>
});
}
}
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
mindmapElements.forEach((e: HTMLDivElement) => {
if (e.getAttribute("data-render") === "true") {
return;

View file

@ -15,7 +15,7 @@ export const plantumlRender = (element: Element, cdn = Constants.PROTYLE_CDN) =>
return;
}
addScript(`${cdn}/js/plantuml/plantuml-encoder.min.js?v=0.0.0`, "protylePlantumlScript").then(() => {
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true)
const wysiswgElement = hasClosestByClassName(element, "protyle-wysiwyg", true);
plantumlElements.forEach((e: HTMLDivElement) => {
if (e.getAttribute("data-render") === "true") {
return;

View file

@ -299,7 +299,7 @@ export const disabledProtyle = (protyle: IProtyle) => {
protyle.wysiwyg.element.querySelectorAll(".render-node .protyle-action__edit").forEach(item => {
item.classList.add("fn__none");
if (item.classList.contains("protyle-icon--first")) {
item.nextElementSibling?.classList.add("protyle-icon--first")
item.nextElementSibling?.classList.add("protyle-icon--first");
}
});
protyle.wysiwyg.element.style.userSelect = "text";
@ -357,7 +357,7 @@ export const enableProtyle = (protyle: IProtyle) => {
protyle.wysiwyg.element.querySelectorAll(".render-node .protyle-action__edit").forEach(item => {
item.classList.remove("fn__none");
if (item.classList.contains("protyle-icon--first")) {
item.nextElementSibling?.classList.remove("protyle-icon--first")
item.nextElementSibling?.classList.remove("protyle-icon--first");
}
});
protyle.wysiwyg.element.querySelectorAll('[contenteditable="false"][spellcheck]').forEach(item => {