Skip to content

Commit f3d7343

Browse files
committed
refactor: clean code
1 parent 1a24976 commit f3d7343

File tree

1 file changed

+0
-64
lines changed

1 file changed

+0
-64
lines changed

src/index.ts

Lines changed: 0 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,6 @@ export default class PluginSnippets extends Plugin {
29312931
// 如果开启了实时预览,并且打开了对应的 CSS 代码片段对话框,则在菜单项上开关代码片段的操作需要忽略
29322932
// 问题案例:全局禁用 CSS,预览一个 CSS 片段,启用片段,在菜单禁用片段会导致预览元素被移除
29332933
// 这是因为从菜单关闭时没有 previewState 参数,此时需要通过是否有实时预览中的代码片段对话框来判断
2934-
this.console.log("如果开启了实时预览,并且打开了对应的代码片段对话框,则在菜单项上开关代码片段的操作需要忽略");
29352934
return;
29362935
}
29372936

@@ -4752,69 +4751,6 @@ export default class PluginSnippets extends Plugin {
47524751
}
47534752

47544753

4755-
// ================================ 其他 ================================
4756-
4757-
4758-
// TODO功能: 桌面端修改代码片段之后同步到打开的新窗口(所有变更都是弹窗确认,避免以后原生改进了 https://github.com/siyuan-note/siyuan/issues/12303 造成冲突)
4759-
// 问:桌面端使用新窗口的情况下插件能实现跨窗口通信吗?A 窗口的插件将状态同步到 B 窗口的插件,然后执行一些操作
4760-
// 答:简单的用 localStorage、复杂的用 broadCast
4761-
// localStorage.setItem 设置,window.addEventListener('storage' 监听
4762-
// 我这边用的 broadCast 的ws方案,代码小多
4763-
4764-
4765-
// 这里的代码可能用得上,先留着
4766-
// 添加菜单选项
4767-
// menu.addItem({
4768-
// icon: "iconSettings",
4769-
// label: "Open Setting",
4770-
// click: () => {
4771-
// openSetting(this.app);
4772-
// }
4773-
// });
4774-
// menu.addItem({
4775-
// icon: "iconInfo",
4776-
// label: "Dialog(open doc first)",
4777-
// accelerator: this.commands[0].customHotkey,
4778-
// click: () => {
4779-
// this.showDialog();
4780-
// }
4781-
// });
4782-
// if (!this.isMobile) {
4783-
// menu.addItem({
4784-
// icon: "iconFace",
4785-
// label: "Open Custom Tab",
4786-
// click: () => {
4787-
// const tab = openTab({
4788-
// app: this.app,
4789-
// custom: {
4790-
// icon: "iconFace",
4791-
// title: "Custom Tab",
4792-
// data: {
4793-
// text: platformUtils.isHuawei() ? "Hello, Huawei!" : "This is my custom tab",
4794-
// },
4795-
// id: this.name + TAB_TYPE
4796-
// },
4797-
// });
4798-
// this.console.log(tab);
4799-
// }
4800-
// });
4801-
// }
4802-
// menu.addItem({
4803-
// icon: "iconDownload",
4804-
// label: "Save Layout",
4805-
// click: () => {
4806-
// saveLayout(() => {
4807-
// showMessage("Layout saved");
4808-
// });
4809-
// }
4810-
// });
4811-
// menu.addSeparator();
4812-
// menu.addItem({
4813-
// icon: "iconSparkles",
4814-
// label: this.data[STORAGE_NAME].readonlyText || "Readonly",
4815-
// type: "readonly",
4816-
// });
4817-
48184754
// ================================ 文件监听功能 ================================
48194755
// AI 写的,没有严格考虑,代码能跑就行
48204756

0 commit comments

Comments
 (0)