Skip to content

Commit

Permalink
refactor entire plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkmm committed Dec 30, 2023
1 parent 907c92e commit 2df36d1
Show file tree
Hide file tree
Showing 16 changed files with 723 additions and 131 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ now can remove almost all the buttons
- clean up

## 0.1.5 2023.12.17
- add more buttons
- add more buttons

## 1.0.0 2023.12.23
- refactor entire plugin, support more listening implementation
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Forum / thread (Chinese):https://ld246.com/article/1701669406727

# TODO
- friendly interface
- use `MutationObserver` instead of `DOMNodeInserted`

# Credits
https://github.com/siyuan-note/siyuan
Expand Down
2 changes: 0 additions & 2 deletions README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ repo/源码:https://github.com/zxkmm/siyuan_rmv_btn

# TODO
- friendly interface
- use `MutationObserver` instead of `DOMNodeInserted`

# 鸣谢
https://github.com/siyuan-note/siyuan
https://github.com/muhanstudio
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "siyuan_rmv_btn",
"version": "0.1.5",
"version": "1.0.0",
"type": "module",
"description": "A plugin to remove menu items you don't really need.",
"repository": "https://github.com/zxkmm/siyuan_rmv_btn",
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan_rmv_btn",
"author": "zxkmm",
"url": "https://github.com/zxkmm/siyuan_rmv_btn",
"version": "0.1.5",
"version": "1.0.0",
"minAppVersion": "2.10.14",
"backends": [
"windows",
Expand Down
2 changes: 1 addition & 1 deletion scripts/make_dev_link.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import readline from 'node:readline';

//Please write the "workspace/data/plugins" directory here
//请在这里填写你的 "workspace/data/plugins" 目录
let targetDir = '/home/zxkmm/文档/sydev/data/plugins/';
let targetDir = '/home/zxkmm/文档/sy_rls_test/data/plugins/';
//Like this
// let targetDir = `H:\\SiYuanDevSpace\\data\\plugins`;
//********************************************************************************************
Expand Down
25 changes: 15 additions & 10 deletions src/i18n/en_US.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"console_hint": "siyuan_rmv_btn: you never define which items to hide. pls go to setting and define which to hide. if you didnt meant to fill all the boxes, fill _NONE_ into blank boxes. ",
"note_desc": "If items you are trying to hide is related to SiYuan's commercial part, please consider to donate to @D and @V (not me) because they lives by writing open-source codes.<br>v0.1.3",
"note_title": "Notice",
"rm_menu_title": "Items' labels you don't need",
"rm_menu_desc": "seperate by english or chinese half-width comma AKA \",\" or \"\"",
"rm_top_title": "Top bar icons you don't need",
"rm_top_desc": "❗EXPERIMENTAL❗<br>seperate by english or chinese half-width comma AKA \",\" or \"\"<br>options:<br>barSync: the sync button<br>barBack: the back button<br>barForward: the forward button<br>barPlugins: the plugin button<br>barSearch: search button<br>barMode: daylight/night mode button<br>barExit: exit button (only iPad)<br>",
"rm_side_title": "Side bar icons you don't need",
"rm_side_desc": "❗EXPERIMENTAL❗<br>seperate by english or chinese half-width comma AKA \",\" or \"\"<br>options:<br>outline: the outline icon<br>inbox: the inbox icon<br>bookmark: the bookmark icon<br>tag: the tag icon<br>backlink: the backlink icon<br>globalGraph: the global graph icon<br>graph: the single notebook graph icon<br>"
}
"totalSwitch": "Total Switch",
"totalSwitchdesc": "If the items you want to hide are related to the commercial part of Source, please consider donating to @D and @V (not me) as they live by writing open-source code.<br> v1.0.0",
"listenImplementation": "Listen Implementation",
"listenImplementationdesc": "It is recommended to choose the DOMNodeInserted option for the best overall performance, but this option will output a warning in the terminal. If you cannot accept this, please choose one of the other two implementations.",
"reload_hint": "Reload the interface to apply the latest changes.",
"old_config_exist": "Remove Button Plugin:<br> Due to a <b><u>performance improvement</u></b> refactoring of the configuration storage system in the latest version, please <b><u>uninstall and reinstall</u></b> the Remove Button Plugin after seeing this prompt. Enter the configuration in the settings interface again to ensure performance and stability. Thank you for your understanding. <br> This prompt will appear <b><u>only once per device</u></b> after <b><u>correct reinstallation</u></b>. If you still see this prompt after reinstalling, please uninstall the Remove Button Plugin first and report the bug to the developer.",
"rm_menu_title": "Menu Items to Hide",
"rm_menu_desc": "Enter the label names of the interface language (e.g., \"Copy, Move\" without quotes). If using multiple languages, please enter the label names for all languages (e.g., \"Copy, Copy, Move, Move\" without quotes).<br>Separate with English or Chinese half-width commas, i.e., \",\" or \"\".",
"rm_top_title": "Top and Bottom Bar Buttons to Hide",
"rm_top_desc": "❗ Do not hide functional icons such as the close button unless absolutely necessary ❗<br>Enter the provided label name strings (e.g., \"barSync, barBack\" without quotes)<br>Separate with English or Chinese half-width commas, i.e., \",\" or \"\".<br>Options:<br>barSync: Sync button<br>barBack: Back button<br>barForward: Forward button<br>barPlugins: Plugins button<br>barSearch: Search button<br>barMode: Day/Night mode button<br>barExit: Exit button (iPad only)<br>windowControls: Window control button<br>toolbarVIP: Crown icon<br>statusHelp: Bottom bar help button<br>barDock: Hide sidebar button in the bottom bar<br>",
"rm_side_title": "Sidebar Buttons to Hide",
"rm_side_desc": "Enter the provided label name strings (e.g., \"outline, tag\" without quotes)<br>Separate with English or Chinese half-width commas, i.e., \",\" or \"\".<br>Options:<br>outline: Outline icon<br>inbox: Inbox icon<br>bookmark: Bookmark icon<br>tag: Tag icon<br>backlink: Backlink icon<br>globalGraph: Global graph icon<br>graph: Individual notebook graph icon<br>",
"ignore_warning": "remove button plugin: the warning above is just because you choosed a high performance observing implementation, if you don't like it, you may choose the other two selections in the setting panel. thank you"

}
12 changes: 8 additions & 4 deletions src/i18n/zh_CN.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"console_hint": "思源移除按钮提示:您从未定义要隐藏哪些项目。请前往设置并定义要隐藏的项目。如果您并不打算填写所有的框,请在空白框中填写_NONE_。",
"note_desc": "如果您要隐藏的项目与思源的商业部分有关,请考虑向@D和@V捐赠(不是我),因为他们以编写开源代码生活。<br> v0.1.4",
"note_title": "注意事项",
"totalSwitch":"总开关",
"totalSwitchdesc":"如果您要隐藏的项目与思源的商业部分有关,请考虑向@D和@V捐赠(不是我),因为他们以编写开源代码生活。<br> v1.0.0",
"listenImplementation": "监听实现",
"listenImplementationdesc":"建议首选综合性能最佳的DOMNodeInserted, 但是这个选项会在终端输出一个warning,如果您无法接受,请选择另外两个实现",
"reload_hint":"重载界面以应用最新更改",
"old_config_exist": "移除按钮插件:<br> 由于最新版本对配置存储系统进行了<b><u>提高性能</u></b>的重构,请在看到这个提示后,<b><u>卸载并重新安装</u></b>移除按钮插件,并重新在设置界面键入配置, 以保证性能和稳定性,谢谢您的理解. <br>此提示在您正确<b><u>重新安装后</u></b>,每个设备<b><u>仅会弹出一次</u></b> <br>如果重新安装后依然不断看到此提示, 请先卸载移除按钮插件, 并向开发者汇报bug",
"rm_menu_title": "要隐藏的菜单项",
"rm_menu_desc": "填写界面语言的标签名(如“复制,移动”(不包括双引号)),若使用多语言,请同时填写所有语言的标签名(如“复制,Copy,移动,Move”(不包括双引号))。<br>用英文或中文半角逗号,即\",\"\"\"隔开。",
"rm_top_title": "要隐藏的顶栏按钮和底栏按钮",
"rm_top_desc": "❗请勿隐藏功能性图标,如关闭按钮等,除非确实需要❗<br>填写提供的标签名字符串(如“barSync,barBack”(不包括双引号))<br>用英文或中文半角逗号,即\",\"\"\"隔开。<br>选项:<br>barSync 同步按钮<br>barBack 返回按钮<br>barForward 前进按钮<br>barPlugins 插件按钮<br>barSearch 搜索按钮<br>barMode 日间 夜间模式按钮<br>barExit 退出按钮(仅限iPad)<br>windowControls 窗口控制按钮<br>toolbarVIP 皇冠图标<br>statusHelp 底栏帮助按钮 <br>barDock 底栏中的隐藏侧栏按钮<br>",
"rm_side_title": "要隐藏的侧栏按钮",
"rm_side_desc": "填写提供的标签名字符串(如“outline,tag”(不包括双引号))<br>用英文或中文半角逗号,即\",\"\"\"隔开。<br>选项:<br>outline 大纲图标<br>inbox 收件箱图标<br>bookmark 书签图标<br>tag 标签图标<br>backlink 反链图标<br>globalGraph 全局图谱图标<br>graph 单个笔记本图谱图标<br>"
"rm_side_desc": "填写提供的标签名字符串(如“outline,tag”(不包括双引号))<br>用英文或中文半角逗号,即\",\"\"\"隔开。<br>选项:<br>outline 大纲图标<br>inbox 收件箱图标<br>bookmark 书签图标<br>tag 标签图标<br>backlink 反链图标<br>globalGraph 全局图谱图标<br>graph 单个笔记本图谱图标<br>",
"ignore_warning": "移除按钮插件: 上方的warning是因为您选择了高性能的监听方式,若不喜欢,请在设置页面选择另外两种方式,谢谢"
}
Loading

0 comments on commit 2df36d1

Please sign in to comment.