BryceAndJuly/Whiteboard

关于全屏的处理建议

entps opened this issue · 7 comments

实话实说,在 zotero 、logseq、notion、思源笔记等应用上使用过 excalidraw 插件,本插件做的是最理想的,非常好用,对我而言目前只有一个在 macos 上的全屏问题,,这或许是思源本身的问题,也或许是其他问题引起的,作者能否将全屏独立出一个按钮出来,类似于现在界面上的保存按钮,通过按钮来实现全屏和退出全屏,这或许可以解决当前全屏在macos中不可用的问题

那你就试一下吧,替换当前的Whiteboard/index.html

其实只是在末尾</script>标签前加了以下几行,在底下发的新的index.html搜临时添加全屏按钮能搜到。

// 临时添加全屏按钮
saveBtn.insertAdjacentHTML(
    "beforebegin",
    '<div id="fullScreen" style="position: fixed;width: 30px;height: 36px;top: 34px;left: 134px;padding: 0 7px;transform: translate(-50%, -50%);z-index: 3;text-align: center;line-height: 36px;font-size: 12px;border-radius: 8px;cursor: pointer;user-select: none;background-color: transparent;border: 1px solid #2323291c;">全屏</div>'
);
const fullScreenBtn = document.getElementById("fullScreen");
fullScreenBtn.addEventListener(
    "click",
    (e) => {
        e.stopPropagation();
        e.preventDefault();
        if (window?.frameElement?.parentElement?.parentElement?.parentElement?.parentElement?.parentElement?.classList?.contains("protyle")) {
            if (window?.frameElement?.parentElement?.parentElement?.parentElement?.parentElement?.parentElement?.classList?.contains("fullscreen")) {
                window.frameElement.parentElement.parentElement.parentElement.parentElement.parentElement.classList.remove("fullscreen");
            } else {
                window.frameElement.parentElement.parentElement.parentElement.parentElement.parentElement.classList.add("fullscreen");
            }
        }
    },
    true
);

index.zip

default.mp4

另一个问题是 Excalidraw 中如何添加 Lax公式支持?

不知道,没了解过,刚刚看了一下官网在线的Excalidrawhttps://excalidraw.com/,没发现支持Latex公式。
思源不是支持那个Katex嘛,可以用这个来写公式,然后通过拖拽嵌入的方式来放入白板。
或者你可以给思源提Issue让它支持Latex。

我试着改快捷方式,发现用alt都都不行,,,需要改为其他键,查了一个原因是因为 macos 没有 option 键的直接写法,,对应的也不是 altkey

macOS的事我不太了解,改成啥都好,能用就行。