关于全屏的处理建议
entps opened this issue · 7 comments
entps commented
实话实说,在 zotero 、logseq、notion、思源笔记等应用上使用过 excalidraw 插件,本插件做的是最理想的,非常好用,对我而言目前只有一个在 macos 上的全屏问题,,这或许是思源本身的问题,也或许是其他问题引起的,作者能否将全屏独立出一个按钮出来,类似于现在界面上的保存按钮,通过按钮来实现全屏和退出全屏,这或许可以解决当前全屏在macos中不可用的问题
BryceAndJuly commented
那你就试一下吧,替换当前的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
);
default.mp4
entps commented
好的,谢谢
…---- 回复的原邮件 ----
| 发件人 | ***@***.***> |
| 日期 | 2024年09月24日 18:19 |
| 收件人 | ***@***.***> |
| 抄送至 | ***@***.***>***@***.***> |
| 主题 | Re: [BryceAndJuly/Whiteboard] 关于全屏的处理建议 (Issue #30) |
那你就试一下吧,替换当前的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>');constfullScreenBtn=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
https://github.com/user-attachments/assets/823c0c5d-0717-4f16-8997-014ab5bd4eba
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
entps commented
谳谢,非常完美的解决了全屏的问题
在 2024年9月24日 ***@***.***> 写道:
那你就试一下吧,替换当前的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
https://github.com/user-attachments/assets/823c0c5d-0717-4f16-8997-014ab5bd4eba
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***>
entps commented
全屏完美,,另一个问题是 Excalidraw 中如何添加 Lax公式支持?
吴建忠
13928500723
***@***.***
佛山市恩特普斯管理咨询有限公司 资深实施顾问
在 2024年9月24日 ***@***.***> 写道:
那你就试一下吧,替换当前的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
https://github.com/user-attachments/assets/823c0c5d-0717-4f16-8997-014ab5bd4eba
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***
entps commented
我试着改快捷方式,发现用alt都都不行,,,需要改为其他键,查了一个原因是因为 macos 没有 option 键的直接写法,,对应的也不是 altkey
吴建忠
13928500723
***@***.***
佛山市恩特普斯管理咨询有限公司 资深实施顾问
在 2024年9月24日 ***@***.***> 写道:
那你就试一下吧,替换当前的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
https://github.com/user-attachments/assets/823c0c5d-0717-4f16-8997-014ab5bd4eba
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: ***@***.***
BryceAndJuly commented
另一个问题是 Excalidraw 中如何添加 Lax公式支持?
不知道,没了解过,刚刚看了一下官网在线的Excalidrawhttps://excalidraw.com/,没发现支持Latex公式。
思源不是支持那个Katex嘛,可以用这个来写公式,然后通过拖拽嵌入的方式来放入白板。
或者你可以给思源提Issue让它支持Latex。
BryceAndJuly commented
我试着改快捷方式,发现用alt都都不行,,,需要改为其他键,查了一个原因是因为 macos 没有 option 键的直接写法,,对应的也不是 altkey
macOS的事我不太了解,改成啥都好,能用就行。