Init
This commit is contained in:
commit
36e95249b1
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
# 忽略的目录
|
||||
08-Assets/Scripts/__pycache__/
|
||||
.trash/
|
||||
|
||||
# 忽略的文件
|
||||
08-Assets/Scripts/MyLibrary.bib
|
||||
.obsidian/workspace
|
||||
.obsidian/plugins/recent-files-obsidian/data.json
|
||||
.obsidian/plugins/remember-cursor-position/cursor-positions.json
|
||||
.obsidian/workspace.json
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
[submodule "08-Assets/Images"]
|
||||
path = 08-Assets/Images
|
||||
url = https://github.com/blueroseslol/ImageBag.git
|
||||
[submodule "08-Assets/Others"]
|
||||
path = 08-Assets/Others
|
||||
url = http://blueroses.top:8888/BlueRose/BlueRoseNoteOtherAsset.git
|
28
.obsidian/app.json
vendored
Normal file
28
.obsidian/app.json
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"attachmentFolderPath": "08-Assets",
|
||||
"trashOption": "local",
|
||||
"promptDelete": false,
|
||||
"pdfExportSettings": {
|
||||
"includeName": true,
|
||||
"pageSize": "A4",
|
||||
"landscape": false,
|
||||
"margin": "0",
|
||||
"downscalePercent": 90
|
||||
},
|
||||
"alwaysUpdateLinks": true,
|
||||
"foldIndent": true,
|
||||
"foldHeading": true,
|
||||
"showLineNumber": true,
|
||||
"newFileLocation": "folder",
|
||||
"newFileFolderPath": "01-Diary/本周事务",
|
||||
"fileSortOrder": "alphabetical",
|
||||
"legacyEditor": false,
|
||||
"livePreview": true,
|
||||
"defaultViewMode": "source",
|
||||
"newLinkFormat": "shortest",
|
||||
"userIgnoreFilters": [
|
||||
"09-Templates/"
|
||||
],
|
||||
"readableLineLength": false,
|
||||
"lineWrap": true
|
||||
}
|
21
.obsidian/appearance.json
vendored
Normal file
21
.obsidian/appearance.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"baseFontSize": 16,
|
||||
"translucency": false,
|
||||
"theme": "obsidian",
|
||||
"cssTheme": "Blue Topaz",
|
||||
"enabledCssSnippets": [
|
||||
"S - Images Adjustments",
|
||||
"S - Admonitions",
|
||||
"S - Aside",
|
||||
"S - Checkboxes",
|
||||
"S - Embed Adjustments",
|
||||
"S - Encoded Icons",
|
||||
"S - External Link Icons",
|
||||
"S - Kanban",
|
||||
"【日记】Time",
|
||||
"【自定义】mytools 样式",
|
||||
"【图标】iconfont"
|
||||
],
|
||||
"baseFontSizeAction": false,
|
||||
"accentColor": ""
|
||||
}
|
3
.obsidian/bookmarks.json
vendored
Normal file
3
.obsidian/bookmarks.json
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
{
|
||||
"items": []
|
||||
}
|
39
.obsidian/community-plugins.json
vendored
Normal file
39
.obsidian/community-plugins.json
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
[
|
||||
"calendar",
|
||||
"code-block-copy",
|
||||
"cm-editor-syntax-highlight-obsidian",
|
||||
"templater-obsidian",
|
||||
"quickadd",
|
||||
"obsidian-copy-block-link",
|
||||
"remember-cursor-position",
|
||||
"tag-wrangler",
|
||||
"obsidian-kanban",
|
||||
"obsidian-charts",
|
||||
"obsidian-style-settings",
|
||||
"obsidian-icon-folder",
|
||||
"folder-note-plugin",
|
||||
"wikilinks-to-mdlinks-obsidian",
|
||||
"Enhanced editing",
|
||||
"obsidian-core-search-assistant-plugin",
|
||||
"obsidian-float-toc-plugin",
|
||||
"tag-word-cloud",
|
||||
"obsidian-tabs",
|
||||
"obsidian-excel-to-markdown-table",
|
||||
"obsidian-shellcommands",
|
||||
"various-complements",
|
||||
"pane-relief",
|
||||
"obsidian-collapse-all-plugin",
|
||||
"obsidian-git",
|
||||
"open-vscode",
|
||||
"obsidian-image-auto-upload-plugin",
|
||||
"obsidian-hover-editor",
|
||||
"obsidian-admonition",
|
||||
"workspaces-plus",
|
||||
"Enhanced-editing",
|
||||
"obsidian42-brat",
|
||||
"obsidian-editing-toolbar",
|
||||
"remotely-save",
|
||||
"table-editor-obsidian",
|
||||
"dataview",
|
||||
"obsidian-view-mode-by-frontmatter"
|
||||
]
|
30
.obsidian/core-plugins-migration.json
vendored
Normal file
30
.obsidian/core-plugins-migration.json
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"file-explorer": true,
|
||||
"global-search": true,
|
||||
"switcher": true,
|
||||
"graph": true,
|
||||
"backlink": true,
|
||||
"outgoing-link": false,
|
||||
"tag-pane": true,
|
||||
"page-preview": true,
|
||||
"daily-notes": true,
|
||||
"templates": false,
|
||||
"note-composer": true,
|
||||
"command-palette": true,
|
||||
"slash-command": true,
|
||||
"editor-status": false,
|
||||
"starred": false,
|
||||
"markdown-importer": false,
|
||||
"zk-prefixer": false,
|
||||
"random-note": false,
|
||||
"outline": true,
|
||||
"word-count": true,
|
||||
"slides": true,
|
||||
"audio-recorder": false,
|
||||
"workspaces": true,
|
||||
"file-recovery": true,
|
||||
"publish": false,
|
||||
"sync": false,
|
||||
"canvas": true,
|
||||
"bookmarks": true
|
||||
}
|
20
.obsidian/core-plugins.json
vendored
Normal file
20
.obsidian/core-plugins.json
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
[
|
||||
"file-explorer",
|
||||
"global-search",
|
||||
"switcher",
|
||||
"graph",
|
||||
"backlink",
|
||||
"canvas",
|
||||
"tag-pane",
|
||||
"page-preview",
|
||||
"daily-notes",
|
||||
"note-composer",
|
||||
"command-palette",
|
||||
"slash-command",
|
||||
"bookmarks",
|
||||
"outline",
|
||||
"word-count",
|
||||
"slides",
|
||||
"workspaces",
|
||||
"file-recovery"
|
||||
]
|
4
.obsidian/daily-notes.json
vendored
Normal file
4
.obsidian/daily-notes.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"folder": "01-Diary/日志存档",
|
||||
"template": "09-Templates/日志模板"
|
||||
}
|
58
.obsidian/graph.json
vendored
Normal file
58
.obsidian/graph.json
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"collapse-filter": false,
|
||||
"search": "",
|
||||
"showTags": false,
|
||||
"showAttachments": false,
|
||||
"hideUnresolved": true,
|
||||
"showOrphans": true,
|
||||
"collapse-color-groups": false,
|
||||
"colorGroups": [
|
||||
{
|
||||
"query": "tag:#dailynote",
|
||||
"color": {
|
||||
"a": 1,
|
||||
"rgb": 13070326
|
||||
}
|
||||
},
|
||||
{
|
||||
"query": "path:02-Reading/mdnotes",
|
||||
"color": {
|
||||
"a": 1,
|
||||
"rgb": 11924170
|
||||
}
|
||||
},
|
||||
{
|
||||
"query": "path:02-Reading/3-people",
|
||||
"color": {
|
||||
"a": 1,
|
||||
"rgb": 15451397
|
||||
}
|
||||
},
|
||||
{
|
||||
"query": "path:02-Reading/2-topics",
|
||||
"color": {
|
||||
"a": 1,
|
||||
"rgb": 3726463
|
||||
}
|
||||
},
|
||||
{
|
||||
"query": "tag:#WeeklyNote",
|
||||
"color": {
|
||||
"a": 1,
|
||||
"rgb": 714229
|
||||
}
|
||||
}
|
||||
],
|
||||
"collapse-display": false,
|
||||
"showArrow": false,
|
||||
"textFadeMultiplier": 0,
|
||||
"nodeSizeMultiplier": 1.77176470588235,
|
||||
"lineSizeMultiplier": 0.561176470588235,
|
||||
"collapse-forces": false,
|
||||
"centerStrength": 0.11978021978022,
|
||||
"repelStrength": 9.60302197802198,
|
||||
"linkStrength": 0.568063186813187,
|
||||
"linkDistance": 134,
|
||||
"scale": 0.10716329989134475,
|
||||
"close": false
|
||||
}
|
157
.obsidian/hotkeys.json
vendored
Normal file
157
.obsidian/hotkeys.json
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
{
|
||||
"insert-current-time": [],
|
||||
"daily-notes": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt"
|
||||
],
|
||||
"key": "T"
|
||||
}
|
||||
],
|
||||
"daily-notes:goto-next": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt"
|
||||
],
|
||||
"key": "["
|
||||
}
|
||||
],
|
||||
"daily-notes:goto-prev": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt"
|
||||
],
|
||||
"key": "]"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:13aa960e-9e3e-4aec-b6aa-35adf841a841": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Shift"
|
||||
],
|
||||
"key": "I"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:5e2dd8d4-b939-4d12-a766-9f8d4dc7e9db": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod",
|
||||
"Shift"
|
||||
],
|
||||
"key": "R"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:afb39300-74a3-4d3a-9b5f-0ba1690692a7": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod",
|
||||
"Shift"
|
||||
],
|
||||
"key": "E"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:b6c263c0-d19c-4c71-a702-4ebde741bfea": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Mod"
|
||||
],
|
||||
"key": "P"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:5dc244e3-4243-46a2-b865-4a8cbbc00d88": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod",
|
||||
"Shift"
|
||||
],
|
||||
"key": "P"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:9ccf74df-935e-4554-abef-7e7188ebccba": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Shift"
|
||||
],
|
||||
"key": "R"
|
||||
}
|
||||
],
|
||||
"slides:start": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod",
|
||||
"Shift"
|
||||
],
|
||||
"key": "P"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:38c1c363-5d3e-4203-b7f4-7e18d7c7b9f1": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Shift"
|
||||
],
|
||||
"key": "T"
|
||||
}
|
||||
],
|
||||
"quickadd:runQuickAdd": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "Q"
|
||||
}
|
||||
],
|
||||
"editor:attach-file": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "Insert"
|
||||
}
|
||||
],
|
||||
"obsidian-excalidraw-plugin:toggle-lock": [],
|
||||
"workspace:toggle-pin": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "L"
|
||||
}
|
||||
],
|
||||
"app:show-debug-info": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod",
|
||||
"Shift"
|
||||
],
|
||||
"key": "Z"
|
||||
}
|
||||
],
|
||||
"obsidian-mind-map:app:markmap-preview": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Alt",
|
||||
"Mod"
|
||||
],
|
||||
"key": "M"
|
||||
}
|
||||
],
|
||||
"templater-obsidian:create-new-note-from-template": [],
|
||||
"editor:toggle-source": [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "0"
|
||||
}
|
||||
],
|
||||
"quickadd:choice:345b5f19-f072-4738-93f8-f53ff692e098": [
|
||||
{
|
||||
"modifiers": [],
|
||||
"key": "F5"
|
||||
}
|
||||
]
|
||||
}
|
4
.obsidian/note-composer.json
vendored
Normal file
4
.obsidian/note-composer.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"askBeforeMerging": true,
|
||||
"replacementText": "none"
|
||||
}
|
135
.obsidian/plugins/Enhanced-editing/README.md
vendored
Normal file
135
.obsidian/plugins/Enhanced-editing/README.md
vendored
Normal file
@ -0,0 +1,135 @@
|
||||
**【增强编辑】插件旨在增强Obsidian软件的文本编辑操作,力求人性化、智能化、自动化处理当前页面文字。**
|
||||
|
||||
## 📣 赞助声明
|
||||
欢迎向蚕子(QQ:312815311) 提出操作需求和功能建议,愿我们为增强Obsidian的编辑功能来共同努力!
|
||||
如感觉此插件能够提升您的编辑效率,期待赞助支持一下国产插件。
|
||||
|
||||

|
||||
金额不限,仅限微信;备注留名,不胜感谢
|
||||
|
||||
## 📣 功能说明
|
||||
### ☑️ 状态栏命令菜单
|
||||
- 支持【状态栏菜单】激活语法格式刷功能
|
||||
- 支持【状态栏菜单】执行实用增强命令
|
||||
- 支持【状态栏菜单】开启插件设置面板及快捷键面板
|
||||

|
||||
|
||||
### ☑️ 转换内部链接
|
||||
**1. 按下「Alt+Z」快捷键,在选文两端添加或去除 \[\[ ]] 符号**
|
||||

|
||||
|
||||
- 若未选中文本,视光标位置分两种情况处理
|
||||
- 若光标处在\[\[链接|文字]]当中,则自动去除外围的链接符号
|
||||
- 若光标未处在链接当中,则直接输出\[\[字符
|
||||
- 支持批量转换用换行符分隔的被选中的多行文本或用顿号分隔的被选中的多个字符串。
|
||||
- 所选文本中如出现 "|[]?\*<>/: 等符号,此功能不会执行。
|
||||
|
||||
**2. 按下「Alt+Q」快捷键,将选文转换为 \[\[|选文]] 样式,方便选择笔记名**
|
||||

|
||||
|
||||
**3. 执行「批量转换内链」命令,将当前笔记中的潜在链接一次性转换为 `[[笔记名]]` 内部链接样式**
|
||||
|
||||
### ☑️ 智能符号
|
||||
**3. 按下「Alt+;」快捷键,自动转换、匹配或跳过各种类型的括号符号**
|
||||

|
||||
|
||||
- 行首遇特殊字符时的**转换为专用字符**(参考Easy Typing插件)
|
||||
- 》 → >
|
||||
- 、 → /
|
||||
|
||||
- 判断前两字符并**替换为对应的符号**
|
||||
- 【( 或 [( 替换为 〖
|
||||
- (< 或 (< 替换为 〈
|
||||
- (【 或 ([ 替换为 〔
|
||||
- “ 【 或 "[ 替换为 『
|
||||
- ‘ 【 或 '[ 替换为 「
|
||||
- …… 替换为 ^
|
||||
|
||||
- 判断光标以前最近的前括号,会**匹配对应的后括号**
|
||||
- 原文是〖文字|- 按「Alt+;」快捷键后,在光标|处生成〗符号,以下同理。
|
||||
- 《文字|》〈文字|〉[文字|]{文字|}【文字|】〖文字|〗〔文字|〕『文字|』「文字|」
|
||||
|
||||
- 判断光标以前最近的Md语法(前半截字符组),会**匹配对应的后半截字符组**。
|
||||
- [[链接]] ==高亮== **加粗** ~~删除~~ %%注释%%
|
||||
|
||||
- 原来是 [[文字|]]其它文字,在光标|处按「Alt+;」快捷键,**光标会跳到]]符号后面**
|
||||
- 即判断后面为链接、粗体、高亮、删除线等MD语法的后半截字符组时 自动跳过
|
||||
|
||||
- 判断当前行内容,如为 Dataview、Query、Mermaid等单词,则**转为代码块语法**
|
||||
- dv → ```dataview```
|
||||
- qy → ```query```
|
||||
- mm → ```mermaid```
|
||||
- 也支持 js css ph c java py等语言名称缩写
|
||||
|
||||
- 判断当前行内容,如为 `Callout语法类型 对齐方式 +/` 样式,则**转为Callout语法引用块**
|
||||

|
||||
|
||||
### ☑️ 转换 Html 语法
|
||||
- 转换文字颜色「Ctrl+Shift+1-5」∶将选文转为或去除 5种自定义颜色
|
||||
- 转换背景颜色「Ctrl+Alt+1-5」∶将选文背景转为或去除 5种自定义颜色
|
||||
|
||||
### ☑️ 转换 MarkDown 语法
|
||||
- 转换粗体语法「Alt+C」∶将选文转为或去除 **粗体** 效果
|
||||
- 转换斜体语法「Alt+X」∶将选文转为或去除 _斜体_ 效果
|
||||
- 转换行内代码「Alt+D」∶将选文转为或去除 `行内代码` 效果
|
||||
- 转换删除线「Alt+S」∶将选文转为或去除 ~~删除线~~ 效果
|
||||
- 转换下划线「Alt+H」∶将选文转为或去除 下划线 效果
|
||||
- 转换代码块「未设置」∶将选文转为或去除 ```代码块``` 效果
|
||||
- 转换上标语法「Alt+U」∶将选文转为或去除 上标 效果
|
||||
- 转换下标语法「Alt+N」∶将选文转为或去除 下标 效果
|
||||
- 转换待办状态「未设置」:转换选文行首的待办状态,顺序为 -[ x-!?><+] 效果
|
||||
- 转换挖空「未设置」:将选文转为或去除 {{c1::选文}} 效果
|
||||
- 转换标题语法「Ctrl+1-6」∶指定或取消当前行文本为N级标题
|
||||
|
||||
- 转换无语法文本「Ctrl+Alt+Z」∶去除选文中所有markdown语法字符
|
||||
- 获取无语法文本「Ctrl+Alt+C」∶去除选文中的所有markdown语法字符,并写入剪贴板
|
||||
|
||||
### ☑️ 增减常见括号
|
||||
- 【选文】「未设置」:在选文两端添加或去除 【】符号
|
||||
- (选文)「未设置」:在选文两端添加或去除 ()符号
|
||||
- 「选文」「未设置」:在选文两端添加或去除 「」符号
|
||||
- 《选文》「未设置」:在选文两端添加或去除 《》符号
|
||||
|
||||
### ☑️ 全局转换操作
|
||||
- 英转中文标点「未设置」∶将笔记中的英文标点转换为中文标点,如,.?!"等
|
||||
- 中转英文标点「未设置」∶将笔记中的中文标点转换为英文标点,如,。?!“等
|
||||
- 转换路径语法「未设置」∶将 c:\\windows 与 [](file:///c:\/windows) 路径语法相互转换
|
||||
- 简体转为繁体「未设置」:将笔记中的简体汉字转换为繁体汉字
|
||||
- 繁体转为简体「未设置」:将笔记中的繁体汉字转换为简体汉字
|
||||
|
||||
### ☑️ 个性增强功能
|
||||
- 智能粘贴「Ctrl+Alt+V」∶将复制的Office表格直接粘贴为MarkDown语法表格
|
||||
- 修复错误语法「未设置」∶修复错误的MD语法,如1。列表、【】()链接、[[]]()回链等
|
||||
- 修复意外断行「未设置」∶修复笔记中的意外断行(删除结尾不是句式标点的换行符)
|
||||
- 搜索当前文本「未设置」:通过搜索面板在当前文档中搜索划选内容。
|
||||
- 获取时间信息「未设置」∶获取当前行中的时间信息,并控制链接笔记中的视频进行跳转播放
|
||||
- 获取标注文本「未设置」∶获取标题、高亮、注释及前缀(#标注\批注\反思)等文本内容
|
||||
- 选择当前整段「未设置」:选择光标所在的当前整段文本。
|
||||
- 选择当前整句「未设置」:选择光标所在的当前整句(中文)文本。
|
||||
- 自动设置标题「未设置」∶将选文中的单行文本(末尾非标点或数字)转为标题
|
||||
- 指定当前文件名「未设置」:划选文字后指定为当前笔记的文件名。
|
||||
- 嵌入当前网址页面「未设置」∶在行末插入Html代码来嵌入所选网址页面。
|
||||
- 获取相对路径「未设置」:获取当前笔记在库目录内的相对路径。
|
||||
|
||||
### ☑️ 插入或去除空行(空格)
|
||||
- 编辑区内按下回车补加一次换行(有开关)
|
||||
- 批量插入空行「Ctrl+Shift+L」∶在划选的文本行或全文中间批量插入空白行
|
||||
- 批量去除空行「Ctrl+Alt+L」∶批量去除划选文本或全文中的空白行
|
||||
- 上方插入空行「未设置」∶在当前文本行的上行插入空白行
|
||||
- 下方插入空行「未设置」∶在当前文本行的下行插入空白行
|
||||
- 末尾追加空格「未设置」∶在每行文本的末尾追加两个空格
|
||||
- 去除末尾空格「未设置」∶批量去除每个文本行末尾的空格字符
|
||||
- 添加中英间隔「未设置」:在正文的汉字与字母之间批量添加空格,如 china 中国。
|
||||
- 去除所有空格「未设置」:去除正文中所有的全、半角空格
|
||||
|
||||
|
||||
## 📣 安装方法
|
||||
【增强编辑】插件短期内不会上架社区商店
|
||||
|
||||
### ☑️ 手动安装:
|
||||
手动下载最新的压缩包,然后将其中文件(main.js, manifest.json) 解压到 **库目录/.obsidian/plugins/ZH增强编辑** 文件夹即可.
|
||||
|
||||
### ☑️ BRAT 插件安装:
|
||||
- 安装 BRAT 插件: [点此安装](https://github.com/TfTHacker/obsidian42-brat)
|
||||
- 在 BART 插件设置面板添加: obsidian-canzi/Enhanced-editing
|
||||
|
16
.obsidian/plugins/Enhanced-editing/data.json
vendored
Normal file
16
.obsidian/plugins/Enhanced-editing/data.json
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"isTab": false,
|
||||
"version": "0.5.2",
|
||||
"hColor": "",
|
||||
"bColor": "",
|
||||
"hColor1": "#F36208",
|
||||
"hColor2": "#81B300",
|
||||
"hColor3": "#2485E3",
|
||||
"hColor4": "#C32E94",
|
||||
"hColor5": "#13C6C3",
|
||||
"bColor1": "#FFB78B",
|
||||
"bColor2": "#CDF469",
|
||||
"bColor3": "#A0CCF6",
|
||||
"bColor4": "#F0A7D8",
|
||||
"bColor5": "#ADEFEF"
|
||||
}
|
3313
.obsidian/plugins/Enhanced-editing/main.js
vendored
Normal file
3313
.obsidian/plugins/Enhanced-editing/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/Enhanced-editing/manifest.json
vendored
Normal file
10
.obsidian/plugins/Enhanced-editing/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "Enhanced-editing",
|
||||
"name": "增强编辑",
|
||||
"version": "0.5.2",
|
||||
"minAppVersion": "0.10.0",
|
||||
"description": "增强大量文本编辑功能,如(允许批量)转换内部链接、转换Markdown或Html语法(支持格式刷)、智能化补充括号、智能化粘贴表格或代码、(批量)增减空行或空格、修复错误语法或标点等。",
|
||||
"author": "obsidian-canzi",
|
||||
"authorUrl": "https://github.com/obsidian-canzi/Enhanced-editing",
|
||||
"isDesktopOnly": false
|
||||
}
|
55
.obsidian/plugins/Enhanced-editing/styles.css
vendored
Normal file
55
.obsidian/plugins/Enhanced-editing/styles.css
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
.Enhanced-editing-menu .menu-item input[type="color"] {
|
||||
width:15px;
|
||||
height:20px;
|
||||
border: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.Enhanced-editing-menu .menu-item input[type="color"]::-webkit-color-swatch {
|
||||
height:15px;
|
||||
position:relative;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.Enhanced-editing-menu .menu-item.inputitem {
|
||||
line-height:0;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
|
||||
.Enhanced-editing-menu .menu-item.fontcoloritem {
|
||||
color: #7d7d7d75;
|
||||
border-top: 1px solid;
|
||||
line-height:0;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
}
|
||||
.Enhanced-editing-menu .menu-item.buttonitem {
|
||||
line-height:0;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
margin-left: -2px;
|
||||
}
|
||||
|
||||
.Enhanced-editing-menu button.highlight_btn {
|
||||
margin: 0;
|
||||
margin-top: 2px;
|
||||
padding: 4px 4px;
|
||||
background-color:transparent;
|
||||
}
|
||||
|
||||
.Enhanced-editing-menu button>svg{
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
body .recent-files-donation{
|
||||
text-align:left;
|
||||
}
|
||||
|
19
.obsidian/plugins/Templater/data.json
vendored
Normal file
19
.obsidian/plugins/Templater/data.json
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"command_timeout": 5,
|
||||
"template_folder": "09-Templates",
|
||||
"templates_pairs": [
|
||||
[
|
||||
"toDOCX",
|
||||
"python ./02-Reading/pdfs/paper2docx.py <% tp.file.path() %>"
|
||||
],
|
||||
[
|
||||
"getCitationKeys",
|
||||
"python ./02-Reading/pdfs/getCitationKeys.py"
|
||||
]
|
||||
],
|
||||
"trigger_on_file_creation": true,
|
||||
"enable_system_commands": true,
|
||||
"shell_path": "",
|
||||
"empty_file_template": "09-Templates/草稿模板",
|
||||
"syntax_highlighting": true
|
||||
}
|
3572
.obsidian/plugins/Templater/main.js
vendored
Normal file
3572
.obsidian/plugins/Templater/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/Templater/manifest.json
vendored
Normal file
10
.obsidian/plugins/Templater/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "templater-obsidian",
|
||||
"name": "Templater",
|
||||
"version": "1.8.1",
|
||||
"description": "Create and use templates",
|
||||
"minAppVersion": "0.11.13",
|
||||
"author": "SilentVoid",
|
||||
"authorUrl": "https://github.com/SilentVoid13",
|
||||
"isDesktopOnly": false
|
||||
}
|
256
.obsidian/plugins/Templater/styles.css
vendored
Normal file
256
.obsidian/plugins/Templater/styles.css
vendored
Normal file
@ -0,0 +1,256 @@
|
||||
.templater_div {
|
||||
border-top: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
|
||||
.templater_div > .setting-item {
|
||||
border-top: none !important;
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.templater_div > .setting-item > .setting-item-control {
|
||||
justify-content: space-around;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.templater_div > .setting-item > .setting-item-control > .setting-editor-extra-setting-button {
|
||||
align-self: center;
|
||||
}
|
||||
|
||||
.templater_title {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
margin-top: 5px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.templater_template {
|
||||
align-self: center;
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.templater_cmd {
|
||||
margin-left: 5px;
|
||||
margin-right: 5px;
|
||||
font-size: 14px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.templater_div2 > .setting-item {
|
||||
align-content: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.templater_button:hover {
|
||||
background-color: #00496A !important;
|
||||
}
|
||||
|
||||
.templater-prompt-div {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.templater-prompt-form {
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
.templater-prompt-input {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.cm-s-obsidian .templater-command-bg {
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
background-color: var(--background-primary-alt);
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command{
|
||||
color: #d4d4d4;
|
||||
font-size: 0.85em;
|
||||
font-family: var(--font-monospace);
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .templater-inline .cm-templater-command {
|
||||
background-color: var(--background-primary-alt);
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-templater-opening-tag {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-templater-closing-tag {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-templater-interpolation-tag {
|
||||
color: #008BFF;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-templater-execution-tag {
|
||||
color: #C0D700;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-templater-raw-tag {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-keyword {
|
||||
color: #00A7AA;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-atom {
|
||||
color: #F39B35;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-number {
|
||||
color: #A06FCA;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-type {
|
||||
color: #A06FCA;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-def {
|
||||
color: #98E342;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-property {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-variable {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-variable-2 {
|
||||
color: #da7dae;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-variable-3 {
|
||||
color: #A06FCA;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-type.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-property.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-callee {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-operator {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-qualifier {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-tag.cm-bracket {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-attribute {
|
||||
color: #A06FCA;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-comment {
|
||||
color: #696d70;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-comment.cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-comment.cm-attribute {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-string {
|
||||
color: #E6DB74;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-string-2 {
|
||||
color: #F39B35;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-meta {
|
||||
color: #D4D4D4;
|
||||
background: inherit;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-builtin {
|
||||
color: #FC4384;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-header {
|
||||
color: #da7dae;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-hr {
|
||||
color: #98E342;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-link {
|
||||
color: #696d70;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.cm-error {
|
||||
border-bottom: 1px solid #C42412;
|
||||
}
|
||||
|
||||
|
||||
.cm-s-obsidian pre.HyperMD-codeblock .cm-keyword {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.CodeMirror-activeline-background {
|
||||
background: #272727;
|
||||
}
|
||||
|
||||
.cm-s-obsidian .cm-templater-command.CodeMirror-matchingbracket {
|
||||
outline: 1px solid grey;
|
||||
color: #D4D4D4 !important;
|
||||
}
|
10
.obsidian/plugins/calendar/data.json
vendored
Normal file
10
.obsidian/plugins/calendar/data.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"shouldConfirmBeforeCreate": true,
|
||||
"weekStart": "locale",
|
||||
"wordsPerDot": 250,
|
||||
"showWeeklyNote": false,
|
||||
"weeklyNoteFormat": "",
|
||||
"weeklyNoteTemplate": "",
|
||||
"weeklyNoteFolder": "",
|
||||
"localeOverride": "system-default"
|
||||
}
|
4457
.obsidian/plugins/calendar/main.js
vendored
Normal file
4457
.obsidian/plugins/calendar/main.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
.obsidian/plugins/calendar/manifest.json
vendored
Normal file
10
.obsidian/plugins/calendar/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "calendar",
|
||||
"name": "Calendar",
|
||||
"description": "Calendar view of your daily notes",
|
||||
"version": "1.5.10",
|
||||
"author": "Liam Cain",
|
||||
"authorUrl": "https://github.com/liamcain/",
|
||||
"isDesktopOnly": false,
|
||||
"minAppVersion": "0.9.11"
|
||||
}
|
30660
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/main.js
vendored
Normal file
30660
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/manifest.json
vendored
Normal file
10
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "cm-editor-syntax-highlight-obsidian",
|
||||
"name": "Editor Syntax Highlight",
|
||||
"author": "death_au",
|
||||
"authorUrl": "https://github.com/deathau",
|
||||
"description": "Show syntax highlighing in code blocks the editor",
|
||||
"isDesktopOnly": false,
|
||||
"version": "0.1.3",
|
||||
"minAppVersion": "0.10.0"
|
||||
}
|
177
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/styles.css
vendored
Normal file
177
.obsidian/plugins/cm-editor-syntax-highlight-obsidian/styles.css
vendored
Normal file
@ -0,0 +1,177 @@
|
||||
@charset "UTF-8";
|
||||
.cm-s-obsidian pre.HyperMD-codeblock span.cm-formatting-code-block {
|
||||
color: var(--text-muted);
|
||||
}
|
||||
|
||||
.cm-s-obsidian pre.HyperMD-codeblock .cm-keyword {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.theme-dark .cm-s-obsidian {
|
||||
/*
|
||||
|
||||
Name: yoncé
|
||||
Author: Thomas MacLean (http://github.com/thomasmaclean)
|
||||
|
||||
Original yoncé color scheme by Mina Markham (https://github.com/minamarkham)
|
||||
|
||||
*/
|
||||
/**/
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock {
|
||||
color: #d4d4d4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-keyword,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-keyword,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-keyword {
|
||||
color: #00A7AA;
|
||||
font-weight: normal;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-atom,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-atom,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-atom {
|
||||
color: #F39B35;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-number,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-number,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-number {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-type,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-type,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-type {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-def {
|
||||
color: #98E342;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-property,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-property,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-property {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-2,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable-2,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable-2 {
|
||||
color: #da7dae;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian span.cm-hmd-frontmatter.cm-variable-3,
|
||||
.theme-dark .cm-s-obsidian span.cm-math.cm-variable-3,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock span.cm-variable-3 {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-type.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-type.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-type.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-property.cm-def,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-property.cm-def,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-property.cm-def {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-callee,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-callee,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-callee {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-operator,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-operator,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-operator {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-qualifier,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-qualifier,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-qualifier {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-tag,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-tag,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-tag.cm-bracket,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-tag.cm-bracket,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-tag.cm-bracket {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-attribute {
|
||||
color: #A06FCA;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment {
|
||||
color: #696d70;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-tag,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment.cm-tag,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment.cm-tag {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-comment.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-comment.cm-attribute,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-comment.cm-attribute {
|
||||
color: #D4D4D4;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-string,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-string,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-string {
|
||||
color: #E6DB74;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-string-2,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-string-2,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-string-2 {
|
||||
color: #F39B35;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-meta,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-meta,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-meta {
|
||||
color: #D4D4D4;
|
||||
background: inherit;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-builtin,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-builtin,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-builtin {
|
||||
color: #FC4384;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-header,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-header,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-header {
|
||||
color: #da7dae;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-hr,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-hr,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-hr {
|
||||
color: #98E342;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-link,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-link,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-link {
|
||||
color: #696d70;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.cm-error,
|
||||
.theme-dark .cm-s-obsidian .cm-math.cm-error,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .cm-error {
|
||||
border-bottom: 1px solid #C42412;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-activeline-background,
|
||||
.theme-dark .cm-s-obsidian .cm-math.CodeMirror-activeline-background,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .CodeMirror-activeline-background {
|
||||
background: #272727;
|
||||
}
|
||||
.theme-dark .cm-s-obsidian .cm-hmd-frontmatter.CodeMirror-matchingbracket,
|
||||
.theme-dark .cm-s-obsidian .cm-math.CodeMirror-matchingbracket,
|
||||
.theme-dark .cm-s-obsidian pre.HyperMD-codeblock .CodeMirror-matchingbracket {
|
||||
outline: 1px solid grey;
|
||||
color: #D4D4D4 !important;
|
||||
}
|
130
.obsidian/plugins/code-block-copy/main.js
vendored
Normal file
130
.obsidian/plugins/code-block-copy/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
8
.obsidian/plugins/code-block-copy/manifest.json
vendored
Normal file
8
.obsidian/plugins/code-block-copy/manifest.json
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"id": "code-block-copy",
|
||||
"name": "Copy button for code blocks",
|
||||
"author": "Daniel Brandenburg",
|
||||
"description": "Copy button for code blocks",
|
||||
"isDesktopOnly": false,
|
||||
"version": "0.1.0"
|
||||
}
|
41
.obsidian/plugins/code-block-copy/styles.css
vendored
Normal file
41
.obsidian/plugins/code-block-copy/styles.css
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
.copy-code-button {
|
||||
color: var(--background-primary);
|
||||
background-color: var(--text-faint);
|
||||
border-radius: 1px 1px 0px 0px;
|
||||
/* right-align */
|
||||
display: block;
|
||||
margin-left: auto;
|
||||
margin-right: 0;
|
||||
margin-bottom: -2px;
|
||||
padding: 3px 8px;
|
||||
font-size: 0.8em;
|
||||
position: absolute;
|
||||
top: 0px;
|
||||
right: 0px;
|
||||
}
|
||||
|
||||
.copy-code-button:hover {
|
||||
cursor: pointer;
|
||||
background-color: var(--text-normal);
|
||||
}
|
||||
|
||||
.copy-code-button:focus {
|
||||
/* Avoid an ugly focus outline on click in Chrome,
|
||||
but darken the button for accessibility.
|
||||
See https://stackoverflow.com/a/25298082/1481479 */
|
||||
background-color: var(--text-normal);
|
||||
outline: 0;
|
||||
}
|
||||
|
||||
.copy-code-button:active {
|
||||
background-color: var(--text-normal);
|
||||
}
|
||||
|
||||
.highlight pre {
|
||||
/* Avoid pushing up the copy buttons. */
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.has-copy-button {
|
||||
position: relative;
|
||||
}
|
21
.obsidian/plugins/dataview/data.json
vendored
Normal file
21
.obsidian/plugins/dataview/data.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"renderNullAs": "\\-",
|
||||
"taskLinkLocation": "end",
|
||||
"taskLinkText": "🔗",
|
||||
"taskCompletionTracking": false,
|
||||
"taskCompletionText": "completion",
|
||||
"warnOnEmptyResult": true,
|
||||
"refreshEnabled": true,
|
||||
"refreshInterval": 1000,
|
||||
"defaultDateFormat": "yyyy-MM-dd",
|
||||
"defaultDateTimeFormat": "yyyy-MM-dd HH:mm:ss",
|
||||
"maxRecursiveRenderDepth": 6,
|
||||
"tableIdColumnName": "File",
|
||||
"tableGroupColumnName": "Group",
|
||||
"inlineQueryPrefix": "=",
|
||||
"inlineJsQueryPrefix": "$=",
|
||||
"enableDataviewJs": true,
|
||||
"enableInlineDataviewJs": true,
|
||||
"prettyRenderInlineFields": true,
|
||||
"schemaVersion": 1
|
||||
}
|
21107
.obsidian/plugins/dataview/main.js
vendored
Normal file
21107
.obsidian/plugins/dataview/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/dataview/manifest.json
vendored
Normal file
10
.obsidian/plugins/dataview/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "dataview",
|
||||
"name": "Dataview",
|
||||
"version": "0.5.53",
|
||||
"minAppVersion": "0.13.11",
|
||||
"description": "Complex data views for the data-obsessed.",
|
||||
"author": "Michael Brenan <blacksmithgu@gmail.com>",
|
||||
"authorUrl": "https://github.com/blacksmithgu",
|
||||
"isDesktopOnly": false
|
||||
}
|
146
.obsidian/plugins/dataview/styles.css
vendored
Normal file
146
.obsidian/plugins/dataview/styles.css
vendored
Normal file
@ -0,0 +1,146 @@
|
||||
/** Live Preview padding fixes, specifically for DataviewJS custom HTML elements. */
|
||||
.is-live-preview .block-language-dataviewjs > p, .is-live-preview .block-language-dataviewjs > span {
|
||||
line-height: 1.0;
|
||||
}
|
||||
|
||||
.block-language-dataview {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
/*****************/
|
||||
/** Table Views **/
|
||||
/*****************/
|
||||
|
||||
/* List View Default Styling; rendered internally as a table. */
|
||||
.table-view-table {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.table-view-table > thead > tr, .table-view-table > tbody > tr {
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.table-view-table > tbody > tr:hover {
|
||||
background-color: var(--text-selection) !important;
|
||||
}
|
||||
|
||||
.table-view-table > thead > tr > th {
|
||||
font-weight: 700;
|
||||
font-size: larger;
|
||||
border-top: none;
|
||||
border-left: none;
|
||||
border-right: none;
|
||||
border-bottom: solid;
|
||||
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.table-view-table > tbody > tr > td {
|
||||
text-align: left;
|
||||
border: none;
|
||||
font-weight: 400;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.table-view-table ul, .table-view-table ol {
|
||||
margin-block-start: 0.2em !important;
|
||||
margin-block-end: 0.2em !important;
|
||||
}
|
||||
|
||||
/** Rendered value styling for any view. */
|
||||
.dataview-result-list-root-ul {
|
||||
padding: 0em !important;
|
||||
margin: 0em !important;
|
||||
}
|
||||
|
||||
.dataview-result-list-ul {
|
||||
margin-block-start: 0.2em !important;
|
||||
margin-block-end: 0.2em !important;
|
||||
}
|
||||
|
||||
/** Generic grouping styling. */
|
||||
.dataview.result-group {
|
||||
padding-left: 8px;
|
||||
}
|
||||
|
||||
/*******************/
|
||||
/** Inline Fields **/
|
||||
/*******************/
|
||||
|
||||
.dataview.inline-field-key {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
font-family: var(--font-monospace);
|
||||
background-color: var(--background-primary-alt);
|
||||
color: var(--text-nav-selected);
|
||||
}
|
||||
|
||||
.dataview.inline-field-value {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
font-family: var(--font-monospace);
|
||||
background-color: var(--background-secondary-alt);
|
||||
color: var(--text-nav-selected);
|
||||
}
|
||||
|
||||
.dataview.inline-field-standalone-value {
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
font-family: var(--font-monospace);
|
||||
background-color: var(--background-secondary-alt);
|
||||
color: var(--text-nav-selected);
|
||||
}
|
||||
|
||||
/***************/
|
||||
/** Task View **/
|
||||
/***************/
|
||||
|
||||
.dataview.task-list-item, .dataview.task-list-basic-item {
|
||||
margin-top: 3px;
|
||||
margin-bottom: 3px;
|
||||
transition: 0.4s;
|
||||
}
|
||||
|
||||
.dataview.task-list-item:hover, .dataview.task-list-basic-item:hover {
|
||||
background-color: var(--text-selection);
|
||||
box-shadow: -40px 0 0 var(--text-selection);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/*****************/
|
||||
/** Error Views **/
|
||||
/*****************/
|
||||
|
||||
div.dataview-error-box {
|
||||
width: 100%;
|
||||
min-height: 150px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border: 4px dashed var(--background-secondary);
|
||||
}
|
||||
|
||||
.dataview-error-message {
|
||||
color: var(--text-muted);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
/*************************/
|
||||
/** Additional Metadata **/
|
||||
/*************************/
|
||||
|
||||
.dataview.small-text {
|
||||
font-size: smaller;
|
||||
color: var(--text-muted);
|
||||
margin-left: 3px;
|
||||
}
|
||||
|
||||
.dataview.small-text::before {
|
||||
content: "(";
|
||||
}
|
||||
|
||||
.dataview.small-text::after {
|
||||
content: ")";
|
||||
}
|
9
.obsidian/plugins/folder-note-plugin/data.json
vendored
Normal file
9
.obsidian/plugins/folder-note-plugin/data.json
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"folderNoteHide": true,
|
||||
"folderNoteType": "inside",
|
||||
"folderNoteName": "_about_",
|
||||
"folderNoteKey": "ctrl",
|
||||
"folderNoteAutoRename": true,
|
||||
"folderDelete2Note": false,
|
||||
"folderNoteStrInit": "# {{FOLDER_NAME}} Overview\n```ccard\ntype: folder_brief_live\nimagePrefix: '08-Assets/'\nnoteOnly: true\nstyle: card\n```"
|
||||
}
|
9281
.obsidian/plugins/folder-note-plugin/main.js
vendored
Normal file
9281
.obsidian/plugins/folder-note-plugin/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/folder-note-plugin/manifest.json
vendored
Normal file
10
.obsidian/plugins/folder-note-plugin/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "folder-note-plugin",
|
||||
"name": "Folder Note",
|
||||
"version": "0.7.3",
|
||||
"minAppVersion": "0.9.12",
|
||||
"description": "Click a folder node to show a note describing the folder.",
|
||||
"author": "xpgo",
|
||||
"authorUrl": "https://github.com/xpgo/obsidian-folder-note",
|
||||
"isDesktopOnly": false
|
||||
}
|
229
.obsidian/plugins/folder-note-plugin/styles.css
vendored
Normal file
229
.obsidian/plugins/folder-note-plugin/styles.css
vendored
Normal file
@ -0,0 +1,229 @@
|
||||
/* hide the folder note file node */
|
||||
div.is-folder-note {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* indicate the folder has note */
|
||||
div.has-folder-note {
|
||||
color: var(--text-nav-selected);
|
||||
}
|
||||
|
||||
/*---------------------------------------------
|
||||
Cute card view
|
||||
-----------------------------------------------*/
|
||||
|
||||
.cute-card-band {
|
||||
width: 100%;
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
margin-top: 15px;
|
||||
margin-bottom: 5px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
grid-template-rows: auto;
|
||||
grid-gap: 20px;
|
||||
}
|
||||
|
||||
@media (min-width: 30em) {
|
||||
.cute-card-band {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 60em) {
|
||||
.cute-card-band {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
.cute-card-view {
|
||||
background: var(--background-accent);
|
||||
text-decoration: none !important;
|
||||
color: var(--text-normal);
|
||||
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100%;
|
||||
position: relative;
|
||||
top: 0;
|
||||
transition: all 0.1s ease-in;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.cute-card-view:hover {
|
||||
top: -2px;
|
||||
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.cute-card-view article {
|
||||
padding: 15px;
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.cute-card-view h1 {
|
||||
font-size: 1.2rem;
|
||||
margin: 0;
|
||||
color: var(--text-accent);
|
||||
}
|
||||
|
||||
.cute-card-view a {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.cute-card-view p {
|
||||
flex: 1;
|
||||
line-height: 1.0;
|
||||
}
|
||||
|
||||
.cute-card-view span {
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
color: var(--text-faint);
|
||||
letter-spacing: 0.05em;
|
||||
}
|
||||
|
||||
.cute-card-view .thumb {
|
||||
padding-bottom: 60%;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.cute-card-view .thumb-color {
|
||||
padding-bottom: 10%;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.cute-card-view .thumb-color-folder {
|
||||
background-color: slateblue;
|
||||
}
|
||||
|
||||
.cute-card-view .thumb-color-note {
|
||||
background-color: salmon;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*---------------------------------------------
|
||||
strip card view
|
||||
-----------------------------------------------*/
|
||||
|
||||
.strip-card-band {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.strip-card-view {
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
margin-top: 1.0rem;
|
||||
margin-bottom: 1.0rem;
|
||||
display: -webkit-box;
|
||||
display: -webkit-flex;
|
||||
display: -ms-flexbox;
|
||||
display: flex;
|
||||
-webkit-box-orient: horizontal;
|
||||
-webkit-box-direction: normal;
|
||||
-webkit-flex-direction: row;
|
||||
-ms-flex-direction: row;
|
||||
flex-direction: row;
|
||||
-webkit-box-align: stretch;
|
||||
-webkit-align-items: stretch;
|
||||
-ms-flex-align: stretch;
|
||||
align-items: stretch;
|
||||
min-height: 8rem;
|
||||
-webkit-border-radius: 10px;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
-webkit-transition: all .3s ease;
|
||||
-o-transition: all .3s ease;
|
||||
transition: all .3s ease;
|
||||
-webkit-box-shadow: 0 1px 1px 0 rgba(31, 35, 46, 0.15);
|
||||
box-shadow: 0 1px 1px 0 rgba(31, 35, 46, 0.15);
|
||||
/* add by xpgo */
|
||||
background: var(--background-accent);
|
||||
text-decoration: none !important;
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
.strip-card-view:hover {
|
||||
-webkit-transform: translate(0px, -2px);
|
||||
-ms-transform: translate(0px, -2px);
|
||||
transform: translate(0px, -2px);
|
||||
-webkit-box-shadow: 0 15px 45px -10px rgba(10, 16, 34, 0.2);
|
||||
box-shadow: 0 15px 45px -10px rgba(10, 16, 34, 0.2);
|
||||
}
|
||||
|
||||
.strip-card-view .thumb {
|
||||
width: 20%;
|
||||
max-width: 100%;
|
||||
min-height: 9rem;
|
||||
-webkit-background-size: cover;
|
||||
background-size: cover;
|
||||
background-position: 50% 50%;
|
||||
}
|
||||
|
||||
.strip-card-view .thumb-color {
|
||||
width: 20%;
|
||||
max-width: 100%;
|
||||
min-height: 9rem;
|
||||
-webkit-background-size: cover;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
/* add by xpgo */
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 10px;
|
||||
text-transform: uppercase;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
text-align: center;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.strip-card-view .thumb-color-folder {
|
||||
background-color: slateblue;
|
||||
}
|
||||
|
||||
.strip-card-view .thumb-color-note {
|
||||
background-color: salmon;
|
||||
}
|
||||
|
||||
.strip-card-view article {
|
||||
padding: 1rem;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.strip-card-view h1 {
|
||||
font-size: 1.5rem;
|
||||
margin: 0 0 10px;
|
||||
color: var(--text-accent);
|
||||
}
|
||||
|
||||
.strip-card-view a {
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
.strip-card-view p {
|
||||
margin-top: 0;
|
||||
flex: 1;
|
||||
line-height: 1.0;
|
||||
}
|
||||
|
||||
.strip-card-view span {
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
color: var(--text-faint);
|
||||
letter-spacing: 0.05em;
|
||||
}
|
29
.obsidian/plugins/obsidian-admonition/data.json
vendored
Normal file
29
.obsidian/plugins/obsidian-admonition/data.json
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
"userAdmonitions": {},
|
||||
"syntaxHighlight": false,
|
||||
"copyButton": false,
|
||||
"version": "9.0.5",
|
||||
"autoCollapse": false,
|
||||
"defaultCollapseType": "open",
|
||||
"injectColor": true,
|
||||
"parseTitles": true,
|
||||
"dropShadow": true,
|
||||
"hideEmpty": false,
|
||||
"open": {
|
||||
"admonitions": true,
|
||||
"icons": true,
|
||||
"other": true,
|
||||
"advanced": false
|
||||
},
|
||||
"icons": [],
|
||||
"useFontAwesome": true,
|
||||
"rpgDownloadedOnce": false,
|
||||
"msDocConverted": false,
|
||||
"useSnippet": false,
|
||||
"snippetPath": "custom-admonitions.216f1e",
|
||||
"syncLinks": true,
|
||||
"allowMSSyntax": true,
|
||||
"msSyntaxIndented": true,
|
||||
"livePreviewMS": true,
|
||||
"enableMarkdownProcessor": false
|
||||
}
|
515
.obsidian/plugins/obsidian-admonition/main.js
vendored
Normal file
515
.obsidian/plugins/obsidian-admonition/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/obsidian-admonition/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-admonition/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-admonition",
|
||||
"name": "Admonition",
|
||||
"version": "9.0.5",
|
||||
"minAppVersion": "0.14.0",
|
||||
"description": "Enhanced callouts for Obsidian.md",
|
||||
"author": "Jeremy Valentine",
|
||||
"authorUrl": "",
|
||||
"isDesktopOnly": false
|
||||
}
|
1
.obsidian/plugins/obsidian-admonition/styles.css
vendored
Normal file
1
.obsidian/plugins/obsidian-admonition/styles.css
vendored
Normal file
File diff suppressed because one or more lines are too long
46
.obsidian/plugins/obsidian-bartender/data.json
vendored
Normal file
46
.obsidian/plugins/obsidian-bartender/data.json
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
{
|
||||
"statusBarOrder": [
|
||||
"44751841237401602368623156",
|
||||
"12843970849669122596921091",
|
||||
"86515888475340801543377291",
|
||||
"21212843474944064247010",
|
||||
"59523608157880323101081134",
|
||||
"4185832177008644156991330",
|
||||
"35658965975040004261697505",
|
||||
"86589804862504962434026302",
|
||||
"6265085974544384162810726"
|
||||
],
|
||||
"ribbonBarOrder": [
|
||||
"79372327069941761204210982",
|
||||
"798508723260620822378052",
|
||||
"10343183191900161451753391",
|
||||
"88573907954565123003701357",
|
||||
"62657388095733763115464037",
|
||||
"60992143375728644142598242",
|
||||
"70995981201571844078151274",
|
||||
"76874417040261121352673776",
|
||||
"20512377258639363877619960",
|
||||
"6844575847022592185085343",
|
||||
"4384744997388288661022522",
|
||||
"4370133518647296621305815"
|
||||
],
|
||||
"fileExplorerOrder": {},
|
||||
"actionBarOrder": {
|
||||
"markdown-table-editor-view": [
|
||||
"3424304410656768167261794",
|
||||
"19187852294225921578290960",
|
||||
"30107033550192642960974060",
|
||||
"73781782889103362323969276"
|
||||
],
|
||||
"markdown": [
|
||||
"6146527697305603961893867",
|
||||
"3424304410656768167261794",
|
||||
"19187852294225921578290960",
|
||||
"30107033550192642960974060",
|
||||
"73781782889103362323969276"
|
||||
]
|
||||
},
|
||||
"autoHide": false,
|
||||
"autoHideDelay": 500,
|
||||
"dragDelay": 200
|
||||
}
|
13
.obsidian/plugins/obsidian-bartender/main.js
vendored
Normal file
13
.obsidian/plugins/obsidian-bartender/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
.obsidian/plugins/obsidian-bartender/manifest.json
vendored
Normal file
1
.obsidian/plugins/obsidian-bartender/manifest.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"id":"obsidian-bartender","name":"Bartender","version":"0.5.2","minAppVersion":"0.12.5","description":"Allows for rearranging the elements in the status bar and sidebar ribbon","author":"NothingIsLost","authorUrl":"https://github.com/nothingislost","isDesktopOnly":false}
|
140
.obsidian/plugins/obsidian-bartender/styles.css
vendored
Normal file
140
.obsidian/plugins/obsidian-bartender/styles.css
vendored
Normal file
@ -0,0 +1,140 @@
|
||||
:root {
|
||||
--left-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M58.079 20.579L28.663 50l29.417 29.421l8.842 -8.842L46.338 50l20.583 -20.579z"></path></svg>');
|
||||
--right-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M41.921 79.421L71.338 50l-29.417 -29.421l-8.842 8.842L53.663 50l-20.583 20.579z"></path></svg>');
|
||||
--up-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M26.221 55.388l5.892 5.892L50 43.392l17.888 17.888l5.892 -5.892L50 31.608z"></path></svg>');
|
||||
--down-indicator: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 100 100"><path fill="black" d="M67.888 38.721L50 56.608L32.113 38.721l-5.892 5.892L50 68.392l23.779 -23.779z"></path></svg>');
|
||||
}
|
||||
|
||||
.side-dock-actions .sortable-ghost,
|
||||
.status-bar .sortable-ghost,
|
||||
.view-actions .sortable-ghost,
|
||||
.workspace-tab-header-container .sortable-ghost {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator {
|
||||
cursor: grab;
|
||||
padding: 0px 4px;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
justify-content: center;
|
||||
height: 1em;
|
||||
}
|
||||
|
||||
div.separator svg {
|
||||
background-color: currentColor;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator .glyph {
|
||||
/* margin-top: -4px; */
|
||||
display: flex;
|
||||
align-self: flex-end;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator:hover {
|
||||
/* some themes highlight the hovered icon and it looks bad on the separator */
|
||||
background: none;
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.separator svg {
|
||||
-webkit-mask-image: var(--up-indicator);
|
||||
}
|
||||
.side-dock-ribbon div.separator.is-collapsed.sortable-chosen svg {
|
||||
/* so that the icon updates to show the expand icon on drag start */
|
||||
-webkit-mask-image: var(--up-indicator);
|
||||
}
|
||||
.side-dock-ribbon div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--down-indicator);
|
||||
}
|
||||
|
||||
/* for minimal floating ribbon support */
|
||||
|
||||
.hider-ribbon .side-dock-ribbon div.separator {
|
||||
height: 26px;
|
||||
}
|
||||
|
||||
.hider-ribbon .side-dock-ribbon div.separator .glyph {
|
||||
display: flex;
|
||||
align-self: flex-end;
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator svg {
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator.is-collapsed.sortable-chosen svg {
|
||||
/* so that the icon updates to show the expand icon on drag start */
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
.hider-ribbon .side-dock-ribbon div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--right-indicator);
|
||||
}
|
||||
|
||||
.view-actions div.separator.is-collapsed {
|
||||
transform: rotateY(180deg);
|
||||
}
|
||||
|
||||
.status-bar .is-hidden,
|
||||
.side-dock-ribbon .is-hidden,
|
||||
.view-actions .is-hidden {
|
||||
/* if you're mad about this !important
|
||||
set the --is-hidden-display variable to override it */
|
||||
--is-hidden-display: none;
|
||||
display: var(--is-hidden-display) !important;
|
||||
}
|
||||
|
||||
.status-bar div.separator {
|
||||
--cursor: grab; /* to deal with minimal theme */
|
||||
cursor: grab;
|
||||
padding: 0px 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
/* line-height: 1; */
|
||||
}
|
||||
|
||||
.status-bar div.separator .glyph {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.status-bar div.separator svg,
|
||||
.status-bar div.separator.is-collapsed.sortable-chosen svg {
|
||||
-webkit-mask-image: var(--right-indicator);
|
||||
}
|
||||
|
||||
.status-bar div.separator.is-collapsed svg {
|
||||
-webkit-mask-image: var(--left-indicator);
|
||||
}
|
||||
|
||||
.side-dock-ribbon div.side-dock-ribbon-action.sortable-chosen,
|
||||
.side-dock-ribbon div.separator.sortable-chosen,
|
||||
.status-bar div.separator.sortable-chosen {
|
||||
--cursor: grabbing;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
body.is-dragging .tooltip {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-header,
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-container-before,
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-container-after {
|
||||
background: none;
|
||||
}
|
||||
.workspace-tab-header-container.is-dragging .workspace-tab-header-inner-icon:hover {
|
||||
background: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="file-explorer"] .nav-header .search-input-container {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace-leaf-content[data-type="file-explorer"] .nav-header .search-input-container.is-active {
|
||||
display: block;
|
||||
}
|
||||
|
||||
div.nav-action-button[data-sort-method] + div.nav-action-button.drag-to-rearrange {
|
||||
display: none;
|
||||
}
|
||||
|
||||
div.nav-action-button[data-sort-method="custom"] + div.nav-action-button.drag-to-rearrange {
|
||||
display: block;
|
||||
}
|
200
.obsidian/plugins/obsidian-charts/main.js
vendored
Normal file
200
.obsidian/plugins/obsidian-charts/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/obsidian-charts/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-charts/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-charts",
|
||||
"name": "Obsidian Charts",
|
||||
"version": "3.7.1",
|
||||
"minAppVersion": "0.12.7",
|
||||
"description": "This Plugin lets you create Charts within Obsidian",
|
||||
"author": "phibr0",
|
||||
"authorUrl": "https://github.com/phibr0",
|
||||
"isDesktopOnly": false
|
||||
}
|
30
.obsidian/plugins/obsidian-charts/styles.css
vendored
Normal file
30
.obsidian/plugins/obsidian-charts/styles.css
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
.picker_wrapper.popup,
|
||||
.picker_wrapper.popup .picker_arrow::before,
|
||||
.picker_wrapper.popup .picker_arrow::after,
|
||||
.picker_editor > input {
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.picker_editor > input {
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
div.chart-error {
|
||||
padding: 1rem;
|
||||
border-radius: 1rem;
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
div.chart-error pre > code {
|
||||
color: crimson !important;
|
||||
}
|
||||
|
||||
.print .block-language-chart {
|
||||
/* Hardcoded with for printed Charts, see #41 */
|
||||
width: 500px !important;
|
||||
}
|
||||
|
||||
a[href="https://ko-fi.com/phibr0"] > img
|
||||
{
|
||||
height: 3em;
|
||||
}
|
541
.obsidian/plugins/obsidian-collapse-all-plugin/main.js
vendored
Normal file
541
.obsidian/plugins/obsidian-collapse-all-plugin/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/obsidian-collapse-all-plugin/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-collapse-all-plugin/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-collapse-all-plugin",
|
||||
"name": "Collapse All",
|
||||
"version": "1.5.3",
|
||||
"minAppVersion": "0.12.11",
|
||||
"description": "This plugin adds a button to collapse or expand all folders in the file explorer.",
|
||||
"author": "OfficerHalf",
|
||||
"authorUrl": "https://nathan-smith.org/",
|
||||
"isDesktopOnly": false
|
||||
}
|
1
.obsidian/plugins/obsidian-collapse-all-plugin/styles.css
vendored
Normal file
1
.obsidian/plugins/obsidian-collapse-all-plugin/styles.css
vendored
Normal file
@ -0,0 +1 @@
|
||||
Not Found
|
236
.obsidian/plugins/obsidian-collapse-all/main.js
vendored
Normal file
236
.obsidian/plugins/obsidian-collapse-all/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/obsidian-collapse-all/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-collapse-all/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-collapse-all-plugin",
|
||||
"name": "Collapse All",
|
||||
"version": "1.2.0",
|
||||
"minAppVersion": "0.12.10",
|
||||
"description": "This plugin adds a button to collapse or expand all folders in the file explorer.",
|
||||
"author": "OfficerHalf",
|
||||
"authorUrl": "https://nathan-smith.org/",
|
||||
"isDesktopOnly": false
|
||||
}
|
159
.obsidian/plugins/obsidian-copy-block-link/main.js
vendored
Normal file
159
.obsidian/plugins/obsidian-copy-block-link/main.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10
.obsidian/plugins/obsidian-copy-block-link/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-copy-block-link/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-copy-block-link",
|
||||
"name": "Copy Block Link",
|
||||
"version": "1.0.4",
|
||||
"minAppVersion": "0.12.12",
|
||||
"description": "Get links to blocks and headings from Obsidian's right click menu",
|
||||
"author": "mgmeyers",
|
||||
"authorUrl": "https://github.com/mgmeyers/obsidian-copy-block-link",
|
||||
"isDesktopOnly": false
|
||||
}
|
4462
.obsidian/plugins/obsidian-core-search-assistant-plugin/main.js
vendored
Normal file
4462
.obsidian/plugins/obsidian-core-search-assistant-plugin/main.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
10
.obsidian/plugins/obsidian-core-search-assistant-plugin/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-core-search-assistant-plugin/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-core-search-assistant-plugin",
|
||||
"name": "Core Search Assistant",
|
||||
"version": "0.9.1",
|
||||
"minAppVersion": "0.15.6",
|
||||
"description": "Enhance built-in search: keyboard interface, card preview, bigger preview",
|
||||
"author": "qawatake",
|
||||
"authorUrl": "https://github.com/qawatake/obsidian-core-search-assistant-plugin",
|
||||
"isDesktopOnly": true
|
||||
}
|
60
.obsidian/plugins/obsidian-core-search-assistant-plugin/styles.css
vendored
Normal file
60
.obsidian/plugins/obsidian-core-search-assistant-plugin/styles.css
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
/* search result item */
|
||||
.core-search-assistant_search-result-items-focus .tree-item-self {
|
||||
background-color: var(--background-secondary-alt);
|
||||
color: var(--text-normal);
|
||||
}
|
||||
.core-search-assistant_search-result-items-focus .tree-item-flair {
|
||||
background-color: var(--interactive-accent);
|
||||
color: var(--text-on-accent);
|
||||
}
|
||||
|
||||
/* outline on search mode */
|
||||
body {
|
||||
--search-mode-outline: var(--interactive-accent);
|
||||
}
|
||||
|
||||
/* option modal */
|
||||
.core-search-assistant_option-modal div.modal {
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
.core-search-assistant_option-modal kbd.suggestion-hotkey {
|
||||
float: right;
|
||||
margin-left: 0;
|
||||
margin-right: 10px;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
.core-search-assistant_option-modal span.suggestion-icon {
|
||||
float: left;
|
||||
margin-left: 0;
|
||||
padding: 0 10px;
|
||||
height: 1.5em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.core-search-assistant_option-modal div.suggestion-item {
|
||||
position: relative;
|
||||
padding-left: 10px;
|
||||
cursor: default;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
.core-search-assistant_option-modal div.suggestion-item.is-selected {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
/*
|
||||
text color
|
||||
*/
|
||||
span {
|
||||
--highlight-search-match: var(--text-normal);
|
||||
}
|
||||
|
||||
/*
|
||||
background color
|
||||
*/
|
||||
span {
|
||||
--highlight-search-match-bg: var(--text-highlight-bg);
|
||||
--focus-search-match-bg: #ff9633;
|
||||
}
|
6
.obsidian/plugins/obsidian-editing-toolbar/.github/FUNDING.yml
vendored
Normal file
6
.obsidian/plugins/obsidian-editing-toolbar/.github/FUNDING.yml
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
github: cumany
|
||||
custom:
|
||||
[
|
||||
"https://www.buymeacoffee.com/cuman",
|
||||
"https://user-images.githubusercontent.com/42957010/172568261-8a732d3d-303a-4367-993e-23c3efbf62a8.png",
|
||||
]
|
38
.obsidian/plugins/obsidian-editing-toolbar/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
38
.obsidian/plugins/obsidian-editing-toolbar/.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
20
.obsidian/plugins/obsidian-editing-toolbar/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.obsidian/plugins/obsidian-editing-toolbar/.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
22
.obsidian/plugins/obsidian-editing-toolbar/.gitignore
vendored
Normal file
22
.obsidian/plugins/obsidian-editing-toolbar/.gitignore
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
# Intellij
|
||||
*.iml
|
||||
.idea
|
||||
|
||||
# npm
|
||||
node_modules
|
||||
package-lock.json
|
||||
|
||||
# build
|
||||
main.js
|
||||
.DS_Store
|
||||
*.js.map
|
||||
.env
|
||||
|
||||
# obsidian
|
||||
data.json
|
||||
|
||||
#history
|
||||
.history
|
||||
|
||||
#DS Store
|
||||
.DS_Store
|
373
.obsidian/plugins/obsidian-editing-toolbar/LICENSE
vendored
Normal file
373
.obsidian/plugins/obsidian-editing-toolbar/LICENSE
vendored
Normal file
@ -0,0 +1,373 @@
|
||||
Mozilla Public License Version 2.0
|
||||
==================================
|
||||
|
||||
1. Definitions
|
||||
--------------
|
||||
|
||||
1.1. "Contributor"
|
||||
means each individual or legal entity that creates, contributes to
|
||||
the creation of, or owns Covered Software.
|
||||
|
||||
1.2. "Contributor Version"
|
||||
means the combination of the Contributions of others (if any) used
|
||||
by a Contributor and that particular Contributor's Contribution.
|
||||
|
||||
1.3. "Contribution"
|
||||
means Covered Software of a particular Contributor.
|
||||
|
||||
1.4. "Covered Software"
|
||||
means Source Code Form to which the initial Contributor has attached
|
||||
the notice in Exhibit A, the Executable Form of such Source Code
|
||||
Form, and Modifications of such Source Code Form, in each case
|
||||
including portions thereof.
|
||||
|
||||
1.5. "Incompatible With Secondary Licenses"
|
||||
means
|
||||
|
||||
(a) that the initial Contributor has attached the notice described
|
||||
in Exhibit B to the Covered Software; or
|
||||
|
||||
(b) that the Covered Software was made available under the terms of
|
||||
version 1.1 or earlier of the License, but not also under the
|
||||
terms of a Secondary License.
|
||||
|
||||
1.6. "Executable Form"
|
||||
means any form of the work other than Source Code Form.
|
||||
|
||||
1.7. "Larger Work"
|
||||
means a work that combines Covered Software with other material, in
|
||||
a separate file or files, that is not Covered Software.
|
||||
|
||||
1.8. "License"
|
||||
means this document.
|
||||
|
||||
1.9. "Licensable"
|
||||
means having the right to grant, to the maximum extent possible,
|
||||
whether at the time of the initial grant or subsequently, any and
|
||||
all of the rights conveyed by this License.
|
||||
|
||||
1.10. "Modifications"
|
||||
means any of the following:
|
||||
|
||||
(a) any file in Source Code Form that results from an addition to,
|
||||
deletion from, or modification of the contents of Covered
|
||||
Software; or
|
||||
|
||||
(b) any new file in Source Code Form that contains any Covered
|
||||
Software.
|
||||
|
||||
1.11. "Patent Claims" of a Contributor
|
||||
means any patent claim(s), including without limitation, method,
|
||||
process, and apparatus claims, in any patent Licensable by such
|
||||
Contributor that would be infringed, but for the grant of the
|
||||
License, by the making, using, selling, offering for sale, having
|
||||
made, import, or transfer of either its Contributions or its
|
||||
Contributor Version.
|
||||
|
||||
1.12. "Secondary License"
|
||||
means either the GNU General Public License, Version 2.0, the GNU
|
||||
Lesser General Public License, Version 2.1, the GNU Affero General
|
||||
Public License, Version 3.0, or any later versions of those
|
||||
licenses.
|
||||
|
||||
1.13. "Source Code Form"
|
||||
means the form of the work preferred for making modifications.
|
||||
|
||||
1.14. "You" (or "Your")
|
||||
means an individual or a legal entity exercising rights under this
|
||||
License. For legal entities, "You" includes any entity that
|
||||
controls, is controlled by, or is under common control with You. For
|
||||
purposes of this definition, "control" means (a) the power, direct
|
||||
or indirect, to cause the direction or management of such entity,
|
||||
whether by contract or otherwise, or (b) ownership of more than
|
||||
fifty percent (50%) of the outstanding shares or beneficial
|
||||
ownership of such entity.
|
||||
|
||||
2. License Grants and Conditions
|
||||
--------------------------------
|
||||
|
||||
2.1. Grants
|
||||
|
||||
Each Contributor hereby grants You a world-wide, royalty-free,
|
||||
non-exclusive license:
|
||||
|
||||
(a) under intellectual property rights (other than patent or trademark)
|
||||
Licensable by such Contributor to use, reproduce, make available,
|
||||
modify, display, perform, distribute, and otherwise exploit its
|
||||
Contributions, either on an unmodified basis, with Modifications, or
|
||||
as part of a Larger Work; and
|
||||
|
||||
(b) under Patent Claims of such Contributor to make, use, sell, offer
|
||||
for sale, have made, import, and otherwise transfer either its
|
||||
Contributions or its Contributor Version.
|
||||
|
||||
2.2. Effective Date
|
||||
|
||||
The licenses granted in Section 2.1 with respect to any Contribution
|
||||
become effective for each Contribution on the date the Contributor first
|
||||
distributes such Contribution.
|
||||
|
||||
2.3. Limitations on Grant Scope
|
||||
|
||||
The licenses granted in this Section 2 are the only rights granted under
|
||||
this License. No additional rights or licenses will be implied from the
|
||||
distribution or licensing of Covered Software under this License.
|
||||
Notwithstanding Section 2.1(b) above, no patent license is granted by a
|
||||
Contributor:
|
||||
|
||||
(a) for any code that a Contributor has removed from Covered Software;
|
||||
or
|
||||
|
||||
(b) for infringements caused by: (i) Your and any other third party's
|
||||
modifications of Covered Software, or (ii) the combination of its
|
||||
Contributions with other software (except as part of its Contributor
|
||||
Version); or
|
||||
|
||||
(c) under Patent Claims infringed by Covered Software in the absence of
|
||||
its Contributions.
|
||||
|
||||
This License does not grant any rights in the trademarks, service marks,
|
||||
or logos of any Contributor (except as may be necessary to comply with
|
||||
the notice requirements in Section 3.4).
|
||||
|
||||
2.4. Subsequent Licenses
|
||||
|
||||
No Contributor makes additional grants as a result of Your choice to
|
||||
distribute the Covered Software under a subsequent version of this
|
||||
License (see Section 10.2) or under the terms of a Secondary License (if
|
||||
permitted under the terms of Section 3.3).
|
||||
|
||||
2.5. Representation
|
||||
|
||||
Each Contributor represents that the Contributor believes its
|
||||
Contributions are its original creation(s) or it has sufficient rights
|
||||
to grant the rights to its Contributions conveyed by this License.
|
||||
|
||||
2.6. Fair Use
|
||||
|
||||
This License is not intended to limit any rights You have under
|
||||
applicable copyright doctrines of fair use, fair dealing, or other
|
||||
equivalents.
|
||||
|
||||
2.7. Conditions
|
||||
|
||||
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
|
||||
in Section 2.1.
|
||||
|
||||
3. Responsibilities
|
||||
-------------------
|
||||
|
||||
3.1. Distribution of Source Form
|
||||
|
||||
All distribution of Covered Software in Source Code Form, including any
|
||||
Modifications that You create or to which You contribute, must be under
|
||||
the terms of this License. You must inform recipients that the Source
|
||||
Code Form of the Covered Software is governed by the terms of this
|
||||
License, and how they can obtain a copy of this License. You may not
|
||||
attempt to alter or restrict the recipients' rights in the Source Code
|
||||
Form.
|
||||
|
||||
3.2. Distribution of Executable Form
|
||||
|
||||
If You distribute Covered Software in Executable Form then:
|
||||
|
||||
(a) such Covered Software must also be made available in Source Code
|
||||
Form, as described in Section 3.1, and You must inform recipients of
|
||||
the Executable Form how they can obtain a copy of such Source Code
|
||||
Form by reasonable means in a timely manner, at a charge no more
|
||||
than the cost of distribution to the recipient; and
|
||||
|
||||
(b) You may distribute such Executable Form under the terms of this
|
||||
License, or sublicense it under different terms, provided that the
|
||||
license for the Executable Form does not attempt to limit or alter
|
||||
the recipients' rights in the Source Code Form under this License.
|
||||
|
||||
3.3. Distribution of a Larger Work
|
||||
|
||||
You may create and distribute a Larger Work under terms of Your choice,
|
||||
provided that You also comply with the requirements of this License for
|
||||
the Covered Software. If the Larger Work is a combination of Covered
|
||||
Software with a work governed by one or more Secondary Licenses, and the
|
||||
Covered Software is not Incompatible With Secondary Licenses, this
|
||||
License permits You to additionally distribute such Covered Software
|
||||
under the terms of such Secondary License(s), so that the recipient of
|
||||
the Larger Work may, at their option, further distribute the Covered
|
||||
Software under the terms of either this License or such Secondary
|
||||
License(s).
|
||||
|
||||
3.4. Notices
|
||||
|
||||
You may not remove or alter the substance of any license notices
|
||||
(including copyright notices, patent notices, disclaimers of warranty,
|
||||
or limitations of liability) contained within the Source Code Form of
|
||||
the Covered Software, except that You may alter any license notices to
|
||||
the extent required to remedy known factual inaccuracies.
|
||||
|
||||
3.5. Application of Additional Terms
|
||||
|
||||
You may choose to offer, and to charge a fee for, warranty, support,
|
||||
indemnity or liability obligations to one or more recipients of Covered
|
||||
Software. However, You may do so only on Your own behalf, and not on
|
||||
behalf of any Contributor. You must make it absolutely clear that any
|
||||
such warranty, support, indemnity, or liability obligation is offered by
|
||||
You alone, and You hereby agree to indemnify every Contributor for any
|
||||
liability incurred by such Contributor as a result of warranty, support,
|
||||
indemnity or liability terms You offer. You may include additional
|
||||
disclaimers of warranty and limitations of liability specific to any
|
||||
jurisdiction.
|
||||
|
||||
4. Inability to Comply Due to Statute or Regulation
|
||||
---------------------------------------------------
|
||||
|
||||
If it is impossible for You to comply with any of the terms of this
|
||||
License with respect to some or all of the Covered Software due to
|
||||
statute, judicial order, or regulation then You must: (a) comply with
|
||||
the terms of this License to the maximum extent possible; and (b)
|
||||
describe the limitations and the code they affect. Such description must
|
||||
be placed in a text file included with all distributions of the Covered
|
||||
Software under this License. Except to the extent prohibited by statute
|
||||
or regulation, such description must be sufficiently detailed for a
|
||||
recipient of ordinary skill to be able to understand it.
|
||||
|
||||
5. Termination
|
||||
--------------
|
||||
|
||||
5.1. The rights granted under this License will terminate automatically
|
||||
if You fail to comply with any of its terms. However, if You become
|
||||
compliant, then the rights granted under this License from a particular
|
||||
Contributor are reinstated (a) provisionally, unless and until such
|
||||
Contributor explicitly and finally terminates Your grants, and (b) on an
|
||||
ongoing basis, if such Contributor fails to notify You of the
|
||||
non-compliance by some reasonable means prior to 60 days after You have
|
||||
come back into compliance. Moreover, Your grants from a particular
|
||||
Contributor are reinstated on an ongoing basis if such Contributor
|
||||
notifies You of the non-compliance by some reasonable means, this is the
|
||||
first time You have received notice of non-compliance with this License
|
||||
from such Contributor, and You become compliant prior to 30 days after
|
||||
Your receipt of the notice.
|
||||
|
||||
5.2. If You initiate litigation against any entity by asserting a patent
|
||||
infringement claim (excluding declaratory judgment actions,
|
||||
counter-claims, and cross-claims) alleging that a Contributor Version
|
||||
directly or indirectly infringes any patent, then the rights granted to
|
||||
You by any and all Contributors for the Covered Software under Section
|
||||
2.1 of this License shall terminate.
|
||||
|
||||
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
|
||||
end user license agreements (excluding distributors and resellers) which
|
||||
have been validly granted by You or Your distributors under this License
|
||||
prior to termination shall survive termination.
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 6. Disclaimer of Warranty *
|
||||
* ------------------------- *
|
||||
* *
|
||||
* Covered Software is provided under this License on an "as is" *
|
||||
* basis, without warranty of any kind, either expressed, implied, or *
|
||||
* statutory, including, without limitation, warranties that the *
|
||||
* Covered Software is free of defects, merchantable, fit for a *
|
||||
* particular purpose or non-infringing. The entire risk as to the *
|
||||
* quality and performance of the Covered Software is with You. *
|
||||
* Should any Covered Software prove defective in any respect, You *
|
||||
* (not any Contributor) assume the cost of any necessary servicing, *
|
||||
* repair, or correction. This disclaimer of warranty constitutes an *
|
||||
* essential part of this License. No use of any Covered Software is *
|
||||
* authorized under this License except under this disclaimer. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
************************************************************************
|
||||
* *
|
||||
* 7. Limitation of Liability *
|
||||
* -------------------------- *
|
||||
* *
|
||||
* Under no circumstances and under no legal theory, whether tort *
|
||||
* (including negligence), contract, or otherwise, shall any *
|
||||
* Contributor, or anyone who distributes Covered Software as *
|
||||
* permitted above, be liable to You for any direct, indirect, *
|
||||
* special, incidental, or consequential damages of any character *
|
||||
* including, without limitation, damages for lost profits, loss of *
|
||||
* goodwill, work stoppage, computer failure or malfunction, or any *
|
||||
* and all other commercial damages or losses, even if such party *
|
||||
* shall have been informed of the possibility of such damages. This *
|
||||
* limitation of liability shall not apply to liability for death or *
|
||||
* personal injury resulting from such party's negligence to the *
|
||||
* extent applicable law prohibits such limitation. Some *
|
||||
* jurisdictions do not allow the exclusion or limitation of *
|
||||
* incidental or consequential damages, so this exclusion and *
|
||||
* limitation may not apply to You. *
|
||||
* *
|
||||
************************************************************************
|
||||
|
||||
8. Litigation
|
||||
-------------
|
||||
|
||||
Any litigation relating to this License may be brought only in the
|
||||
courts of a jurisdiction where the defendant maintains its principal
|
||||
place of business and such litigation shall be governed by laws of that
|
||||
jurisdiction, without reference to its conflict-of-law provisions.
|
||||
Nothing in this Section shall prevent a party's ability to bring
|
||||
cross-claims or counter-claims.
|
||||
|
||||
9. Miscellaneous
|
||||
----------------
|
||||
|
||||
This License represents the complete agreement concerning the subject
|
||||
matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent
|
||||
necessary to make it enforceable. Any law or regulation which provides
|
||||
that the language of a contract shall be construed against the drafter
|
||||
shall not be used to construe this License against a Contributor.
|
||||
|
||||
10. Versions of the License
|
||||
---------------------------
|
||||
|
||||
10.1. New Versions
|
||||
|
||||
Mozilla Foundation is the license steward. Except as provided in Section
|
||||
10.3, no one other than the license steward has the right to modify or
|
||||
publish new versions of this License. Each version will be given a
|
||||
distinguishing version number.
|
||||
|
||||
10.2. Effect of New Versions
|
||||
|
||||
You may distribute the Covered Software under the terms of the version
|
||||
of the License under which You originally received the Covered Software,
|
||||
or under the terms of any subsequent version published by the license
|
||||
steward.
|
||||
|
||||
10.3. Modified Versions
|
||||
|
||||
If you create software not governed by this License, and you want to
|
||||
create a new license for such software, you may create and use a
|
||||
modified version of this License if you rename the license and remove
|
||||
any references to the name of the license steward (except to note that
|
||||
such modified license differs from this License).
|
||||
|
||||
10.4. Distributing Source Code Form that is Incompatible With Secondary
|
||||
Licenses
|
||||
|
||||
If You choose to distribute Source Code Form that is Incompatible With
|
||||
Secondary Licenses under the terms of this version of the License, the
|
||||
notice described in Exhibit B of this License must be attached.
|
||||
|
||||
Exhibit A - Source Code Form License Notice
|
||||
-------------------------------------------
|
||||
|
||||
This Source Code Form is subject to the terms of the Mozilla Public
|
||||
License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
If it is not possible or desirable to put the notice in a particular
|
||||
file, then You may include the notice in a location (such as a LICENSE
|
||||
file in a relevant directory) where a recipient would be likely to look
|
||||
for such a notice.
|
||||
|
||||
You may add additional accurate notices of copyright ownership.
|
||||
|
||||
Exhibit B - "Incompatible With Secondary Licenses" Notice
|
||||
---------------------------------------------------------
|
||||
|
||||
This Source Code Form is "Incompatible With Secondary Licenses", as
|
||||
defined by the Mozilla Public License, v. 2.0.
|
105
.obsidian/plugins/obsidian-editing-toolbar/README-zh_cn.md
vendored
Normal file
105
.obsidian/plugins/obsidian-editing-toolbar/README-zh_cn.md
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
# obsidian-editing-toolbar 插件
|
||||
|
||||
感谢 [cmenu](https://github.com/chetachiezikeuzor/cMenu-Plugin)插件的开发,给我了很多灵感,但这个插件已经一年多没有维护了,于是我重新魔改了它,并增加了很多有趣的功能,包括置顶工具栏,光标跟随等,于是 Cmenu toolbar 就诞生了。
|
||||
**Obsidian Editing Toolbar**是一个提供类似于 MS-Word 的工具栏的插件,并增加了一个最小的和用户友好的文本编辑器模式,以获得更顺畅的写作/编辑体验。不需要记住复杂的 markdown 命令,类似于富文本编辑器的所见即所得。
|
||||
这个插件是专门为那些希望有一个简单的文本编辑器来帮助标记他们的笔记设计的。它解决了必须记住许多热键或命令来实现所需要的功能的问题。一个简单的工具条可以改善你在 Obsidian 中的写作体验。
|
||||
|
||||
> 建议配合[增强编辑插件](https://github.com/obsidian-canzi/Enhanced-editing),可以添加更多的实用的编辑指令。
|
||||
|
||||

|
||||
|
||||
## 目录导航
|
||||
|
||||
- [如何安装](#如何安装)
|
||||
- [视频介绍](#视频介绍)
|
||||
- [功能特性](#功能特性)
|
||||
- [跟其他插件协作](#跟其他插件协作)
|
||||
- [完整示例库分享](#完整示例库分享)
|
||||
|
||||
## 如何安装
|
||||
|
||||
1. brat 安装。插件目前还没有上架官方商店可以通过 [BRAT Plugin](https://obsidian.md/plugins?id=obsidian42-brat)去安装。
|
||||
`cumany/obsidian-editing-toolbar`
|
||||
2. 手动安装 参考教程
|
||||
[Plugins mini FAQ ](https://forum.obsidian.md/t/plugins-mini-faq/7737)
|
||||
[如何安装 obsdiain 插件](https://publish.obsidian.md/chinesehelp/01+2021%E6%96%B0%E6%95%99%E7%A8%8B/%E5%A6%82%E4%BD%95%E5%AE%89%E8%A3%85obsdiain%E6%8F%92%E4%BB%B6)
|
||||
|
||||
## 视频介绍
|
||||
|
||||
[谁说 Obsidian 不如语雀,这个插件让你使用 ob 不用再记那么多指令了,ob 工具栏你值得拥有](https://www.bilibili.com/video/BV1mY4y1T7g2/)
|
||||
|
||||
## 功能特性
|
||||
|
||||
功能在延续之前 cmenu 功能的基础上增加了下面额外的功能。
|
||||
|
||||
1. 增加新的工具栏样式 tiny
|
||||
|
||||

|
||||
2. 增加工具栏位置选项,top,following
|
||||
|
||||

|
||||

|
||||
|
||||
3. 增加一些内置命令
|
||||
1. change-font-color
|
||||
字体颜色调色板和格式刷
|
||||
2. change-background-color
|
||||
背景颜色调色板和格式刷
|
||||
3. indent-list
|
||||
列表缩进
|
||||
4. undent-list
|
||||
列表反缩进
|
||||
5. editor-undo
|
||||
6. editor-redo
|
||||
7. hrline
|
||||
会插入一个`---`分割线
|
||||
8. justify 两端对齐
|
||||
插入一个 html 代码,让文字两端对齐`<p align="justify">.....</p>`
|
||||
9. left
|
||||
插入一个 html 代码,让文字左对齐`<p align="left">.....</p>`
|
||||
10. right
|
||||
插入一个 html 代码,让文字右对齐`<p align="right">.....</p>`
|
||||
11. center 居中对齐
|
||||
插入一个 html 代码,让文字居中`<center>.....</center>`
|
||||
12. fullscreen-focus
|
||||
默认绑定快捷键`Ctrl+shift+F11`。
|
||||
将使笔记页面全屏显示,让你更专注于写作本身。要退出全屏,请按 ESC 或再次执行全屏命令。
|
||||
13. workplace-fullscreen-focus
|
||||
默认绑定快捷键`Ctrl+F11`。
|
||||
与全屏聚焦模式不同,这个模式只是隐藏了左右侧边栏的面板,它只是工作区全屏。
|
||||
14. head 1-6 级标题设置
|
||||
默认绑定快捷键`Ctrl+1,ctrl+2,...Ctrl+6`。
|
||||
|
||||

|
||||
15. 支持自定义命令图标
|
||||
|
||||

|
||||
16. 支持修改命令名称
|
||||
|
||||

|
||||
17. 支持添加子菜单
|
||||
|
||||

|
||||
18. 支持菜单拖动排序
|
||||
19. 增加格式刷功能 内置字体颜色和背景颜色两种格式刷(鼠标中键或者右键可取消格式刷状态)
|
||||
|
||||

|
||||
20. 工具栏图标宽度自适应收缩
|
||||
|
||||

|
||||
|
||||
### 跟其他插件协作
|
||||
|
||||
1. [emjoi toolbar ](obsidian://show-plugin?id=obsidian-emoji-toolbar)快捷插入表情
|
||||

|
||||
|
||||
|
||||
2. [Obsidian-Table-Generator](https://github.com/Quorafind/Obsidian-Table-Generator/) & [ob-table-enhance](https://github.com/Stardusten/ob-table-enhancer) 快捷插入表格并编辑
|
||||

|
||||
|
||||
> 上面插件均可从示例库获取,示例库的插件一般都经过了优化并修复了一些错误
|
||||
☟☟☟
|
||||
### 完整示例库分享
|
||||
|
||||
这是可以让你大开眼界的 Obsidian 示例库,里面有很多眼花缭乱的功能和示例,相信你看过一定会惊叹,这是 Obsidian 吗?
|
||||
[Blue-topaz-examples](https://github.com/cumany/Blue-topaz-examples)
|
99
.obsidian/plugins/obsidian-editing-toolbar/README.md
vendored
Normal file
99
.obsidian/plugins/obsidian-editing-toolbar/README.md
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
# obsidian-editing-toolbar Plugin
|
||||
|
||||

|
||||
|
||||
Thanks to the [cmenu](https://github.com/chetachiezikeuzor/cMenu-Plugin) plugin, which gave me a lot of inspiration, but this plugin has not been maintained for more than a year, so I re-modified it and added a lot of interesting features, including the top toolbar, cursor following, etc., so editing toolbar was created.
|
||||
|
||||
**Obsidian Editing Toolbar** is a plugin that provides a toolbar similar to MS-Word,and adds a minimal and user friendly text editor modal for a smoother writing/editing experience . This plugin makes text editing and firing commands easier for those that don't wish to configure a multitude of hotkeys.No need to remember complex markdown commands, similar to a rich text editor as WYSIWYG.
|
||||
This plugin was specifically designed for note-takers that want to have a simple text editor to aid in marking up their notes. It solves the issue of having to memorize numerous hotkeys and/or use multiple key presses to get the desired markup. A simple toolbar to improve your writing experience in Obsidian!
|
||||
|
||||
> It is recommended to work with [Enhanced Editing Plugin](https://github.com/obsidian-canzi/Enhanced-editing), which can add more useful editing commands.
|
||||
|
||||
_[点击这里](./README-zh_cn.md)查看中文文档。_
|
||||
|
||||
## TOC
|
||||
|
||||
- [obsidian-editing-toolbar Plugin](#obsidian-editing-toolbar-plugin)
|
||||
- [TOC](#toc)
|
||||
- [how-to-install](#how-to-install)
|
||||
- [Video Introduction](#video-introduction)
|
||||
- [Key Features](#key-features)
|
||||
- [Work with other plugins](#work-with-other-plugins)
|
||||
- [Full Vault showcase](#full-vault-showcase)
|
||||
|
||||
## how-to-install
|
||||
|
||||
Please Refer: [How to install Obsidian Plugins](https://forum.obsidian.md/t/plugins-mini-faq/7737)
|
||||
|
||||
## Video Introduction
|
||||
|
||||
[About Cmenu toolbar](https://www.bilibili.com/video/BV1mY4y1T7g2/)
|
||||
|
||||
## Key Features
|
||||
|
||||
1. add a new toolbar style tiny
|
||||
|
||||

|
||||
|
||||
2. add toolbar position options, top, following
|
||||
|
||||

|
||||

|
||||
|
||||
3. add some built-in commands
|
||||
1. change-font-color
|
||||
2. change-background-color
|
||||
3. indent-list
|
||||
4. undent-list
|
||||
5. editor-undo
|
||||
6. editor-redo
|
||||
7. hrline
|
||||
will insert a `---` split line
|
||||
8. justify Both ends aligned
|
||||
Inserts an html code to align the text at both ends `<p align="justify">..... </p>`
|
||||
9. left
|
||||
Insert an html code to align the text left `<p align="left">..... </p>`
|
||||
10. right
|
||||
Insert an html code to align the text right `<p align="right">..... </p>`
|
||||
11. center
|
||||
Insert an html code to center the text `<center>..... </center>`
|
||||
12. fullscreen-focus
|
||||
Default binding shortcut key `Ctrl+shift+F11`
|
||||
Will make the notes page display full screen, let you focus more on the writing itself. To exit full screen press ESC or execute the full screen command again
|
||||
13. workplace-fullscreen-focus
|
||||
Default binding shortcut key `Ctrl+F11`
|
||||
Unlike fullscreen-focus mode, this one just hides the left and right sidebar panels, it's only workspace full screen
|
||||
14. head 1-6 level heading settings
|
||||
Default binding shortcut key `Ctrl+1,ctrl+2,...Ctrl+6`
|
||||

|
||||
15. support custom command icons
|
||||

|
||||
16. Support modify command name
|
||||

|
||||
17. Support for adding submenus
|
||||

|
||||
18. Support menu dragging and sorting
|
||||
19. Add formatting brush function Built-in two kinds of formatting brush for font color and background color (middle mouse button or right click can cancel the formatting brush status)
|
||||

|
||||
20. Adaptive shrinkage of toolbar icon width
|
||||

|
||||
|
||||
|
||||
|
||||
### Work with other plugins
|
||||
|
||||
1. [emjoi toolbar ](obsidian://show-plugin?id=obsidian-emoji-toolbar) Quickly Insert a emoji
|
||||

|
||||
|
||||
|
||||
2. [Obsidian-Table-Generator](https://github.com/Quorafind/Obsidian-Table-Generator/) & [ob-table-enhance](https://github.com/Stardusten/ob-table-enhancer) Quickly Insert a table and edit
|
||||

|
||||
|
||||
> The above plugins are available from the example vault , all of which have been optimized and have some bugs fixed
|
||||
☟☟☟
|
||||
|
||||
|
||||
### Full Vault showcase
|
||||
|
||||
This is the Obsidian example vault is amazing, there are a lot of dazzling features and showcase, I believe you will wonder a bit, is this Obsidian?
|
||||
[Blue-topaz-examples](https://github.com/cumany/Blue-topaz-examples)
|
10
.obsidian/plugins/obsidian-editing-toolbar/build/manifest.json
vendored
Normal file
10
.obsidian/plugins/obsidian-editing-toolbar/build/manifest.json
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
"id": "obsidian-editing-toolbar",
|
||||
"name": "Obsidian Editing Toolbar",
|
||||
"version": "2.1.0",
|
||||
"minAppVersion": "0.9.12",
|
||||
"description": "The Obsidian Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.",
|
||||
"author": "Cuman",
|
||||
"authorUrl": "https://github.com/cumany/obsidian-editing-toolbar",
|
||||
"isDesktopOnly": true
|
||||
}
|
846
.obsidian/plugins/obsidian-editing-toolbar/build/styles.css
vendored
Normal file
846
.obsidian/plugins/obsidian-editing-toolbar/build/styles.css
vendored
Normal file
@ -0,0 +1,846 @@
|
||||
|
||||
|
||||
#cMenuToolbarModalBar {
|
||||
width: auto;
|
||||
height: auto;
|
||||
padding: 3px;
|
||||
display: grid;
|
||||
user-select: none;
|
||||
border-radius: 6px;
|
||||
position: absolute;
|
||||
transition: 200ms ease;
|
||||
-webkit-transition: 200ms ease;
|
||||
min-width: fit-content;
|
||||
justify-content: space-around;
|
||||
z-index: var(--layer-status-bar);
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex {
|
||||
display: flex;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarFlex :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]) {
|
||||
min-width: 20px;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: 2px;
|
||||
border: none;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
padding: 5px 6px;
|
||||
box-shadow: none;
|
||||
margin-left: 3px;
|
||||
margin-right: 3px;
|
||||
position: relative;
|
||||
border-radius: 3px;
|
||||
font-size: initial !important;
|
||||
background-color: var(--background-primary-alt);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
|
||||
/* #cMenuToolbarModalBar button.cMenuToolbarCommandItem svg {
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
} */
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTINGS BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonAdd {
|
||||
background-color: var(--interactive-accent);
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonDelete {
|
||||
background-color: #989cab;
|
||||
}
|
||||
|
||||
.modal.mod-settings
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh,
|
||||
button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonRefresh {
|
||||
background-color: var(--text-accent);
|
||||
}
|
||||
|
||||
button.cMenuToolbarSettingsButton {
|
||||
padding: 4px 14px;
|
||||
border-radius: 6px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SETTING ITEMS
|
||||
----------------------------------------------------------------*/
|
||||
.setting-item.cMenuToolbarCommandItem:first-child {
|
||||
padding-top: 18px;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandItem {
|
||||
cursor: grab;
|
||||
padding: 18px 0 18px 0;
|
||||
}
|
||||
|
||||
.sortable-fallback {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.sortable-grab {
|
||||
cursor: grabbing !important;
|
||||
}
|
||||
|
||||
.sortable-ghost {
|
||||
opacity: 0.4;
|
||||
cursor: grabbing;
|
||||
}
|
||||
|
||||
.sortable-chosen {
|
||||
cursor: grabbing;
|
||||
padding: 18px 0 18px 18px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
.sortable-drag {
|
||||
cursor: grabbing;
|
||||
box-shadow: 0px 3px 32px rgb(31 38 135 / 15%);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer {
|
||||
border-top: 1px solid var(--background-modifier-border);
|
||||
border-bottom: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar CLASS CHANGES
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic
|
||||
{
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem])
|
||||
{
|
||||
min-height:28px ;
|
||||
}
|
||||
#cMenuToolbarModalBar.cMenuToolbarDefaultAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 6px;
|
||||
|
||||
border: none;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
.cMenuToolbarDefaultAesthetic {
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ,#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic ~#cMenuToolbarPopoverBar {
|
||||
backdrop-filter: blur(6px);
|
||||
-webkit-backdrop-filter: blur(6px);
|
||||
box-shadow:none;
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar ICONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbarIconPick {
|
||||
line-height: normal;
|
||||
vertical-align: middle;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.cMenuToolbarIconPick svg {
|
||||
width: 17px;
|
||||
height: 17px;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR MENU
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-menu {
|
||||
text-align: center;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item {
|
||||
font-size: 12px;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
border-radius: 5px;
|
||||
height: auto;
|
||||
padding: 8px 5px 0px 5px;
|
||||
margin: 0 auto;
|
||||
width: fit-content;
|
||||
color: var(--text-faint);
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.settings-item .menu-item-title {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item .selected:hover,
|
||||
.cMenuToolbar-statusbar-menu .menu-item.selected:not(.is-disabled):not(.is-label) {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-title {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .slider {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 4px;
|
||||
height: fit-content;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item.buttonitem button.cMenuToolbarSettingsButton {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg path {
|
||||
fill: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu .menu-item-icon svg {
|
||||
stroke: var(--text-muted);
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-menu > .menu-item {
|
||||
display: inline-flex;
|
||||
padding: 0px 0px 5px 5px;
|
||||
align-items: center;
|
||||
}
|
||||
.cMenuToolbar-statusbar-menu > .menu-item:is([data-section="ButtonAdd"]) .menu-item-icon{
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar STATUS BAR BUTTONS
|
||||
----------------------------------------------------------------*/
|
||||
|
||||
.cMenuToolbar-statusbar-button {
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.cMenuToolbar-statusbar-button svg {
|
||||
display: flex;
|
||||
width: 1.3em;
|
||||
height: 1.3em;
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
cMenuToolbar SUPPORT
|
||||
---------------------------------------------`-------------------*/
|
||||
|
||||
.cDonationSection {
|
||||
width: 60%;
|
||||
height: 50vh;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
color: var(--text-normal);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar{
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic .cMenuToolbarCommandItem{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarGlassAesthetic [class^=cMenuToolbarCommandsubItem]{
|
||||
|
||||
background-color:#ffffff00;
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem{
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
place-items: center;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* #cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem svg{
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
} */
|
||||
|
||||
|
||||
|
||||
div.modal-container.cMenuToolbar-Modal:not(.changename) .modal-bg
|
||||
{
|
||||
background-color:transparent!important;
|
||||
backdrop-filter: none!important;
|
||||
position: relative;
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal:not(.changename) .modal {
|
||||
padding: 10px 30px;
|
||||
min-width: 130px;
|
||||
position: absolute;
|
||||
bottom: 2em;
|
||||
right: 0.5em;
|
||||
background-color: rgb(var(--background-primary-rgb),0.5);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
.modal-container.cMenuToolbar-Modal .modal-title
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
width: 90%;
|
||||
|
||||
}
|
||||
body.theme-dark .modal-container.cMenuToolbar-Modal .modal input[type='range'] {
|
||||
background-color: var(--background-secondary);
|
||||
}
|
||||
/*tiny 样式*/
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic {
|
||||
align-items: center;
|
||||
justify-items: center;
|
||||
border: none;
|
||||
backdrop-filter: none;
|
||||
background-color: var(--background-secondary);
|
||||
box-shadow: 0 3px 6px -4px rgb(0 0 0 / 12%), 0 6px 16px 0 rgb(0 0 0 / 8%), 0 9px 28px 8px rgb(0 0 0 / 5%);
|
||||
}
|
||||
|
||||
|
||||
#cMenuToolbarModalBar.cMenuToolbarTinyAesthetic .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
margin-left: 0px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar .cMenuToolbarCommandItem {
|
||||
margin: auto;
|
||||
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
|
||||
margin-left: 4px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color:transparent;
|
||||
backdrop-filter: blur(8px);
|
||||
-webkit-backdrop-filter: blur(8px);
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar).cMenuToolbarTinyAesthetic:not(.top) button[class^=cMenuToolbarCommandsubItem] {
|
||||
margin: auto;
|
||||
padding: 0px;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
display: flex;
|
||||
border-radius: 3px;
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
position: relative;
|
||||
background-color: transparent;
|
||||
|
||||
place-items: center;
|
||||
clear: both;
|
||||
max-width: 28px;
|
||||
max-height: 23px;
|
||||
|
||||
}
|
||||
button[class^=cMenuToolbarCommandsubItem]::after {
|
||||
|
||||
content: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
margin-left: 1px;
|
||||
margin-top:6px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--background-modifier-border);
|
||||
box-shadow: 0 2px 8px var(--background-modifier-box-shadow);
|
||||
position: absolute;
|
||||
z-index: var(--layer-menu);
|
||||
user-select: none;
|
||||
transform: translateY(90%) translateX(-40%);
|
||||
-webkit-transform: translateY(90%) translateX(-40%);
|
||||
display: flex;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem svg
|
||||
{
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button.menu-item
|
||||
{
|
||||
background-color: var(--background-primary);
|
||||
line-height:2em;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem button:hover
|
||||
{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem .menu-item {
|
||||
|
||||
margin-right: 4px;
|
||||
padding: 0px 4px 0px 4px;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem {
|
||||
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
position: absolute;
|
||||
margin-left: 18px;
|
||||
bottom: 8%;
|
||||
background-size: 4px 4px;
|
||||
background-image: url("data:image/svg+xml,%3Csvg width='4' height='4' version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1024 1024' enable-background='new 0 0 1024 1024' xml:space='preserve'%3E%3Cpath fill='%23666' d='M13.24 80.11 l461.75 560.8 q14.56 16.02 36.41 16.02 q21.85 0 36.42 -16.02 l463.2 -560.8 q10.2 -10.19 12.38 -24.75 q2.18 -14.57 -3.64 -27.68 q-5.82 -13.11 -18.21 -20.39 q-12.39 -7.29 -26.95 -7.29 l-924.95 0 q-20.4 0 -34.23 13.11 q-13.84 13.11 -15.29 32.77 q-1.46 19.66 13.11 34.23 Z'/%3E%3C/svg%3E");
|
||||
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
background-position: center;
|
||||
|
||||
background-repeat: no-repeat;
|
||||
min-width: unset;
|
||||
border-left: 2px solid transparent;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .triangle-icon
|
||||
{
|
||||
margin-left: 16px;
|
||||
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar):not(.top) button.cMenuToolbarCommandsubItem-font-color .x-color-picker-wrapper
|
||||
{
|
||||
top:auto;
|
||||
bottom:calc(100% + 1em);
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem
|
||||
{
|
||||
visibility:hidden;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandsubItem-font-color .subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem]:hover >.subitem {
|
||||
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button[class^=cMenuToolbarCommandsubItem] >.subitem:hover {
|
||||
visibility:visible;
|
||||
transition: all 0.3s linear;
|
||||
-webkit-transition: all 0.3s linear;
|
||||
}
|
||||
|
||||
.cMenuToolbarCommandsubItem-font-color button
|
||||
{
|
||||
background-color: transparent;
|
||||
}
|
||||
.cMenuToolbarCommandsubItem-font-color button:hover
|
||||
{
|
||||
background-color: var(--interactive-normal);
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandItem .setting-item-info {
|
||||
|
||||
flex:30%;
|
||||
margin: 0;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub
|
||||
{
|
||||
border-left: 1px solid var(--background-modifier-border);
|
||||
flex-flow: column;
|
||||
min-height: 45px;
|
||||
display: flex;
|
||||
padding: 0;
|
||||
margin-left: 10px;
|
||||
flex: 70%;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty
|
||||
{
|
||||
border: 2px dashed rgba(var(--interactive-accent-rgb),0.5);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub:empty::before {
|
||||
content: "✖️Drag it here";
|
||||
margin: auto;
|
||||
font-size: 12px;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .cMenuToolbarCommandItem
|
||||
{
|
||||
flex: auto;
|
||||
margin-left: 2em;;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarSettingsTabsContainer_sub .setting-item-control
|
||||
{
|
||||
flex: 0;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbarCommandSubItem>.setting-item-info
|
||||
{
|
||||
flex: 70px;
|
||||
}
|
||||
.cMenuToolbarCommandSubItem>.setting-item-control
|
||||
{
|
||||
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsButton.cMenuToolbarSettingsButtonaddsub {
|
||||
background-color: var(--background-secondary-alt);
|
||||
}
|
||||
|
||||
|
||||
.setting-item button.cMenuToolbarSettingsIcon{
|
||||
display: block;
|
||||
transform: translateX(-30%);
|
||||
-webkit-transform: translateX(-30%);
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon:empty::before{
|
||||
content: "❗";
|
||||
}
|
||||
.setting-item button.cMenuToolbarSettingsIcon svg{
|
||||
max-width: 1.5em;
|
||||
max-height: 1.5em;
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon:hover{
|
||||
background-color: var(--interactive-accent-hover);
|
||||
}
|
||||
.modal.mod-settings button:not(.mod-cta):not(.mod-warning).cMenuToolbarSettingsIcon
|
||||
{
|
||||
background-color: transparent;
|
||||
box-shadow: 0 1px 1px 0px var(--background-modifier-border);
|
||||
}
|
||||
@media screen and (min-width: 781px){
|
||||
.cMenuToolbar-Modal .wideInputPromptInputEl {
|
||||
width: 40rem;
|
||||
max-width: 100%;
|
||||
height: 20rem;
|
||||
background-color: rgb(var(--background-primary-rgb),0.8);
|
||||
}
|
||||
}
|
||||
|
||||
.cMenuToolbarcustomIcon svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
|
||||
.cMenuToolbarSettingsButton svg {
|
||||
max-width: 1.3em;
|
||||
max-height: 1.3em;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.cmdr-page-header
|
||||
{
|
||||
min-width: 1em;;
|
||||
}
|
||||
|
||||
|
||||
.x-color-picker-wrapper {
|
||||
right: 0px;
|
||||
top:1.8em;
|
||||
min-width: 1px;
|
||||
padding: 10px;
|
||||
box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14);
|
||||
position: absolute;
|
||||
width: fit-content;
|
||||
font-weight: 400;
|
||||
font-family: Source Sans Pro,sans-serif;
|
||||
border-radius: 4px;
|
||||
background-color: var(--background-primary);
|
||||
}
|
||||
.markdown-source-view.mod-cm6 .x-color-picker-wrapper table.x-color-picker-table#x-color-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper table.x-color-picker-table#x-backgroundcolor-picker-table {
|
||||
width: unset;
|
||||
border-collapse: separate;
|
||||
border-spacing: 6px;
|
||||
margin: auto !important;
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table th {
|
||||
border: 0;
|
||||
text-align: left;
|
||||
font-weight: normal;
|
||||
background: transparent !important;
|
||||
color: #718096;
|
||||
}
|
||||
.x-color-picker-wrapper #x-color-picker-table td {
|
||||
font-size: 1px;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper #x-backgroundcolor-picker-table td {
|
||||
font-size: 1px;
|
||||
border-radius: 50%;
|
||||
padding: 9px;
|
||||
cursor: pointer;
|
||||
border: solid 1px var(--background-modifier-border);
|
||||
}
|
||||
.x-color-picker-wrapper .x-color-picker-table tr td:hover {
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
}
|
||||
.x-color-picker-wrapper tbody>tr:hover
|
||||
{
|
||||
background-color:transparent !important;
|
||||
}
|
||||
/**top**/
|
||||
#cMenuToolbarModalBar.top {
|
||||
display: flex;
|
||||
flex-wrap: nowrap;
|
||||
position: relative;
|
||||
height: 38px;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar.top :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):not(.cMenuToolbar-Divider-Line)
|
||||
{
|
||||
font-size: 10px;
|
||||
margin-right: 0px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
#cMenuToolbarModalBar.top button.cMenuToolbarCommandItem:hover {
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
|
||||
|
||||
#cMenuToolbarPopoverBar{
|
||||
|
||||
padding: 0 10px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
width: fit-content;
|
||||
z-index: var(--layer-status-bar);
|
||||
background-color: var(--background-secondary);
|
||||
background-clip: padding-box;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 3px 6px -4px rgba(0,0,0,.12),0 6px 16px 0 rgba(0,0,0,.08),0 9px 28px 8px rgba(0,0,0,.05);
|
||||
box-shadow: 0 0 8px rgba(0,0,0,.15)\9;
|
||||
margin-left: auto;
|
||||
margin-right: 25px;
|
||||
transition: all 0.1s linear;
|
||||
-webkit-transition: all 0.1s linear;
|
||||
margin-top: 32px;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]){
|
||||
|
||||
height: 26px;
|
||||
margin-left: 4px;
|
||||
font-size: 10px;
|
||||
margin-right: 4px;
|
||||
clear: both;
|
||||
opacity: 1;
|
||||
flex-shrink:0;
|
||||
height: 26px;
|
||||
padding: 0;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
box-shadow: none;
|
||||
border-radius: 2px;
|
||||
display: inline-flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.2s linear;
|
||||
-webkit-transition: all 0.2s linear;
|
||||
|
||||
}
|
||||
#cMenuToolbarPopoverBar :is(.cMenuToolbarCommandItem,button[class^=cMenuToolbarCommandsubItem]):hover{
|
||||
background-color: var(--interactive-hover);
|
||||
}
|
||||
|
||||
#cMenuToolbarModalBar .more-menu {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
box-shadow:none;
|
||||
margin-left: 4px;
|
||||
border-left: 1px inset var( --background-modifier-form-field);
|
||||
height: 24px;
|
||||
opacity: 0.8;
|
||||
}
|
||||
/*Divider-Line**/
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line
|
||||
{
|
||||
padding: 0;
|
||||
|
||||
line-height: 0px;
|
||||
border-left: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
border-right: 200px solid rgba(var(--interactive-accent-rgb),0.05);
|
||||
text-align: center;
|
||||
background: rgba(var(--interactive-accent-rgb),0.2);
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:not(:last-child)
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info
|
||||
{
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control
|
||||
{
|
||||
justify-content: flex-start;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-info .setting-item-name
|
||||
{
|
||||
font-size: 12px;
|
||||
text-align: right;
|
||||
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child
|
||||
{
|
||||
padding: 0;
|
||||
background-color: transparent!important;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child svg
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
.cMenuToolbarSettingsTabsContainer .cMenuToolbar-Divider-Line .setting-item-control button:last-child::before
|
||||
{
|
||||
content: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 1024 1024' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M511.674077 66.707284c-246.52265 0-446.347744 199.835328-446.347744 446.347744s199.825095 446.356954 446.347744 446.356954c246.50423 0 446.348768-199.844537 446.348768-446.356954S758.177284 66.707284 511.674077 66.707284zM744.967424 667.159826c21.8701 21.8701 21.8701 57.310264 0 79.199807-21.8701 21.851681-57.30924 21.851681-79.198783-0.019443L511.674077 592.264045 357.56007 746.359632c-21.8701 21.8701-57.30924 21.851681-79.17934-0.019443s-21.8701-57.290821 0-79.160921L432.493713 513.065262 278.379707 358.950232c-21.8701-21.86089-21.8701-57.328683 0-79.18855 21.8701-21.87931 57.30924-21.87931 79.17934 0l154.114007 154.104797 154.095587-154.104797c21.889543-21.87931 57.32766-21.87931 79.198783-0.010233 21.8701 21.8701 21.8701 57.348126 0 79.207993L590.89128 513.065262 744.967424 667.159826z' fill='%23666666'/%3E%3C/svg%3E");
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
min-width:unset;
|
||||
flex-shrink: 0;
|
||||
display: inline-flex;
|
||||
width: 0.6px;
|
||||
background-color: var(--background-modifier-border);
|
||||
height: 22px;
|
||||
opacity: 0.8;
|
||||
margin: 0;
|
||||
}
|
||||
.theme-dark :is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line
|
||||
{
|
||||
|
||||
background-color: #4f4f5188;
|
||||
|
||||
}
|
||||
:is(#cMenuToolbarModalBar,#cMenuToolbarPopoverBar) button.cMenuToolbarCommandItem.cMenuToolbar-Divider-Line svg
|
||||
{
|
||||
display: none;
|
||||
}
|
BIN
.obsidian/plugins/obsidian-editing-toolbar/cmenu-demo.gif
vendored
Normal file
BIN
.obsidian/plugins/obsidian-editing-toolbar/cmenu-demo.gif
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 770 KiB |
1
.obsidian/plugins/obsidian-editing-toolbar/manifest.json
vendored
Normal file
1
.obsidian/plugins/obsidian-editing-toolbar/manifest.json
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"id":"obsidian-editing-toolbar","name":"Obsidian Editing Toolbar","version":"2.1.1","minAppVersion":"0.9.12","description":"The Obsidian Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.","author":"Cuman","authorUrl":"https://github.com/cumany/obsidian-editing-toolbar","isDesktopOnly":true}
|
44
.obsidian/plugins/obsidian-editing-toolbar/package.json
vendored
Normal file
44
.obsidian/plugins/obsidian-editing-toolbar/package.json
vendored
Normal file
@ -0,0 +1,44 @@
|
||||
{
|
||||
"name": "Editing Toolbar",
|
||||
"version": "2.0.4",
|
||||
"description": "The Editing Toolbar is modified from cmenu, which provides more powerful customization settings and has many built-in editing commands to be a MS Word-like toolbar editing experience.",
|
||||
"main": "main.js",
|
||||
"repository": "https://github.com/cumany/obsidian-editing-toolbar",
|
||||
"scripts": {
|
||||
"dev": "rollup --config rollup.config.js -w",
|
||||
"build": "rollup --config rollup.config.js --environment BUILD:production"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Cuman",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^18.0.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.1",
|
||||
"@rollup/plugin-typescript": "^8.2.1",
|
||||
"@types/feather-icons": "^4.7.0",
|
||||
"@types/node": "^14.17.6",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"@types/sortablejs": "^1.10.7",
|
||||
"obsidian": "^0.15.0",
|
||||
"rollup": "^2.56.3",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-watch": "^4.3.1",
|
||||
"tslib": "^2.2.0",
|
||||
"typescript": "^4.4.2",
|
||||
"typings": "^2.1.1"
|
||||
},
|
||||
"moduleFileExtensions": [
|
||||
"js",
|
||||
"ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"feather-icons": "^4.28.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-dom-server": "0.0.5",
|
||||
"react-icons": "^4.2.0",
|
||||
"remixicon": "^2.5.0",
|
||||
"sortablejs": "^1.14.0",
|
||||
"terser": "^5.15.0"
|
||||
}
|
||||
}
|
33
.obsidian/plugins/obsidian-editing-toolbar/rollup.config.js
vendored
Normal file
33
.obsidian/plugins/obsidian-editing-toolbar/rollup.config.js
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
import typescript from "@rollup/plugin-typescript";
|
||||
import resolve from "@rollup/plugin-node-resolve";
|
||||
import commonjs from "@rollup/plugin-commonjs";
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
const isProd = process.env.BUILD === "production";
|
||||
|
||||
const banner = `/*
|
||||
THIS IS A GENERATED/BUNDLED FILE BY ROLLUP
|
||||
if you want to view the source visit the plugins github repository
|
||||
*/
|
||||
`;
|
||||
|
||||
export default {
|
||||
input: "src/plugin/main.ts",
|
||||
output: {
|
||||
dir: "./build",
|
||||
sourcemap: "inline",
|
||||
sourcemapExcludeSources: isProd,
|
||||
format: "cjs",
|
||||
exports: "default",
|
||||
banner,
|
||||
},
|
||||
external: ["obsidian"],
|
||||
plugins: [
|
||||
typescript(),
|
||||
resolve({
|
||||
browser: true,
|
||||
}),
|
||||
commonjs({ include: "node_modules/**" }),
|
||||
terser()
|
||||
],
|
||||
};
|
166
.obsidian/plugins/obsidian-editing-toolbar/src/icons/appIcons.ts
vendored
Normal file
166
.obsidian/plugins/obsidian-editing-toolbar/src/icons/appIcons.ts
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
export const appIcons: string[] = [
|
||||
// from obsidian app.js file
|
||||
"Custom",
|
||||
"add-note-glyph",
|
||||
"any-key",
|
||||
"audio-file",
|
||||
"blocks",
|
||||
"bold-glyph",
|
||||
"bot-glyph",
|
||||
"box-glyph",
|
||||
"bracket-glyph",
|
||||
"broken-link",
|
||||
"bullet-list-glyph",
|
||||
"bullet-list",
|
||||
"calendar-glyph",
|
||||
"calendar-with-checkmark",
|
||||
"check-in-circle",
|
||||
"check-small",
|
||||
"checkbox-glyph",
|
||||
"checkmark",
|
||||
"clock-glyph",
|
||||
"clock",
|
||||
"cloud",
|
||||
"codeblock-glyph",
|
||||
"code-glyph",
|
||||
"command-glyph",
|
||||
"compress-glyph",
|
||||
"create-new",
|
||||
"cross-in-box",
|
||||
"cross",
|
||||
"crossed-star",
|
||||
"csv",
|
||||
"deleteColumn",
|
||||
"deleteRow",
|
||||
"dice-glyph",
|
||||
"dice",
|
||||
"document",
|
||||
"documents",
|
||||
"dot-network",
|
||||
"double-down-arrow-glyph",
|
||||
"double-up-arrow-glyph",
|
||||
"down-arrow-with-tail",
|
||||
"down-chevron-glyph",
|
||||
"down-curly-arrow-glyph",
|
||||
"duplicate-glyph",
|
||||
"enlarge-glyph",
|
||||
"enter",
|
||||
"exit-fullscreen",
|
||||
"expand-vertically",
|
||||
"file-explorer-glyph",
|
||||
"filled-pin",
|
||||
"formula",
|
||||
"folder",
|
||||
"forward-arrow",
|
||||
"fullscreen",
|
||||
"gear",
|
||||
"go-to-file",
|
||||
"graph-glyph",
|
||||
"hashtag",
|
||||
"heading-glyph",
|
||||
"help",
|
||||
"highlight-glyph",
|
||||
"horizontal-split",
|
||||
"image-file",
|
||||
"image-glyph",
|
||||
"import-glyph",
|
||||
"indent-glyph",
|
||||
"info",
|
||||
"insertColumn",
|
||||
"insertRow",
|
||||
"install",
|
||||
"italic-glyph",
|
||||
"keyboard-glyph",
|
||||
"languages",
|
||||
"left-arrow-with-tail",
|
||||
"left-arrow",
|
||||
"left-chevron-glyph",
|
||||
"lines-of-text",
|
||||
"link-glyph",
|
||||
"link",
|
||||
"links-coming-in",
|
||||
"links-going-out",
|
||||
"logo-crystal",
|
||||
"magnifying-glass",
|
||||
"merge-files-glyph",
|
||||
"merge-files",
|
||||
"microphone-filled",
|
||||
"microphone",
|
||||
"minus-with-circle",
|
||||
"moveColumnLeft",
|
||||
"moveColumnRight",
|
||||
"moveRowDown",
|
||||
"moveRowUp",
|
||||
"navigate-glyph",
|
||||
"note-glyph",
|
||||
"number-list-glyph",
|
||||
"open-elsewhere-glyph",
|
||||
"open-vault",
|
||||
"pane-layout",
|
||||
"paper-plane-glyph",
|
||||
"paper-plane",
|
||||
"paste-text",
|
||||
"paste",
|
||||
"paused",
|
||||
"pdf-file",
|
||||
"pencil",
|
||||
"percent-sign-glyph",
|
||||
"pin",
|
||||
"play-audio-glyph",
|
||||
"plus-minus-glyph",
|
||||
"plus-with-circle",
|
||||
"popup-open",
|
||||
"presentation-glyph",
|
||||
"presentation",
|
||||
"price-tag-glyph",
|
||||
"question-mark-glyph",
|
||||
"quote-glyph",
|
||||
"redo-glyph",
|
||||
"reset",
|
||||
"restore-file-glyph",
|
||||
"right-arrow-with-tail",
|
||||
"right-arrow",
|
||||
"right-chevron-glyph",
|
||||
"right-triangle",
|
||||
"run-command",
|
||||
"scissors-glyph",
|
||||
"scissors",
|
||||
"search-glyph",
|
||||
"search",
|
||||
"select-all-text",
|
||||
"sheets-in-box",
|
||||
"sortAsc",
|
||||
"sortDesc",
|
||||
"spreadsheet",
|
||||
"split",
|
||||
"stacked-levels",
|
||||
"star-glyph",
|
||||
"star-list",
|
||||
"star",
|
||||
"stop-audio-glyph",
|
||||
"strikethrough-glyph",
|
||||
"subscript-glyph",
|
||||
"superscript-glyph",
|
||||
"switch",
|
||||
"sync-small",
|
||||
"sync",
|
||||
"tag-glyph",
|
||||
"three-horizontal-bars",
|
||||
"tomorrow-glyph",
|
||||
"trash",
|
||||
"two-blank-pages",
|
||||
"underline-glyph",
|
||||
"undo-glyph",
|
||||
"unindent-glyph",
|
||||
"up-and-down-arrows",
|
||||
"up-arrow-with-tail",
|
||||
"up-chevron-glyph",
|
||||
"up-curly-arrow-glyph",
|
||||
"uppercase-lowercase-a",
|
||||
"vault",
|
||||
"vertical-split",
|
||||
"vertical-three-dots",
|
||||
"workspace-glyph",
|
||||
"wrench-screwdriver-glyph",
|
||||
"yesterday-glyph",
|
||||
];
|
87
.obsidian/plugins/obsidian-editing-toolbar/src/icons/customIcons.ts
vendored
Normal file
87
.obsidian/plugins/obsidian-editing-toolbar/src/icons/customIcons.ts
vendored
Normal file
@ -0,0 +1,87 @@
|
||||
import * as featherIcons from "feather-icons";
|
||||
import * as remixicons from "react-icons/ri/";
|
||||
//import * as boxicons from "react-icons/bi/";
|
||||
import { renderToString } from "react-dom/server";
|
||||
import { addIcon } from "obsidian";
|
||||
|
||||
export interface Icon {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const icons: Record<string, string> = {
|
||||
cMenuToolbar: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="currentColor"/></svg>`,
|
||||
cMenuToolbarSub:`<svg t="1661526346488" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16880" ><path d="M597.333333 85.333333h-341.333333C187.733333 85.333333 128 140.8 128 213.333333v597.333334c0 72.533333 59.733333 128 128 128h426.666667c72.533333 0 128-55.466667 128-128V298.666667l-213.333334-213.333334z m170.666667 725.333334c0 46.933333-38.4 85.333333-85.333333 85.333333H256c-46.933333 0-85.333333-38.4-85.333333-85.333333V213.333333c0-46.933333 38.4-85.333333 85.333333-85.333333h298.666667v213.333333h213.333333v469.333334z m-320-234.666667h128c12.8 0 21.333333 8.533333 21.333333 21.333333s-8.533333 21.333333-21.333333 21.333334h-128v128c0 12.8-8.533333 21.333333-21.333333 21.333333s-21.333333-8.533333-21.333334-21.333333v-128h-128c-12.8 0-21.333333-8.533333-21.333333-21.333334s8.533333-21.333333 21.333333-21.333333h128v-128c0-12.8 8.533333-21.333333 21.333334-21.333333s21.333333 8.533333 21.333333 21.333333v128z" fill="#8a8a8a" p-id="16881"></path></svg>`,
|
||||
cMenuToolbarAdd: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4z" fill="white"/><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10s10-4.486 10-10S17.514 2 12 2zm0 18c-4.411 0-8-3.589-8-8s3.589-8 8-8s8 3.589 8 8s-3.589 8-8 8z" fill="white"/></svg>`,
|
||||
cMenuToolbarDelete: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M5 20a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8h2V6h-4V4a2 2 0 0 0-2-2H9a2 2 0 0 0-2 2v2H3v2h2zM9 4h6v2H9zM8 8h9v12H7V8z" fill="white"/><path d="M9 10h2v8H9zm4 0h2v8h-2z" fill="white"/></svg>`,
|
||||
cMenuToolbarReload: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke="white" stroke-width="0" stroke-linecap="round" stroke-linejoin="round"><path d="M19 10H5c-1.103 0-2 .897-2 2v8c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-8c0-1.103-.897-2-2-2zM5 20v-8h14l.002 8H5zM5 6h14v2H5zm2-4h10v2H7z" fill="white"/></svg>`,
|
||||
"codeblock-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M20 3H4c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h16c1.103 0 2-.897 2-2V5c0-1.103-.897-2-2-2zM4 19V7h16l.002 12H4z" fill="currentColor"/><path d="M9.293 9.293L5.586 13l3.707 3.707l1.414-1.414L8.414 13l2.293-2.293zm5.414 0l-1.414 1.414L15.586 13l-2.293 2.293l1.414 1.414L18.414 13z"/></svg>`,
|
||||
"underline-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 1024 1024"><path fill="currentColor" d="M824 804H200c-4.4 0-8 3.4-8 7.6v60.8c0 4.2 3.6 7.6 8 7.6h624c4.4 0 8-3.4 8-7.6v-60.8c0-4.2-3.6-7.6-8-7.6zm-312-76c69.4 0 134.6-27.1 183.8-76.2C745 602.7 772 537.4 772 468V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 97-79 176-176 176s-176-79-176-176V156c0-6.6-5.4-12-12-12h-60c-6.6 0-12 5.4-12 12v312c0 69.4 27.1 134.6 76.2 183.8C377.3 701 442.6 728 512 728z"/></svg>`,
|
||||
"superscript-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor"d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41M21.85 9h-4.88V8l.89-.82c.76-.64 1.32-1.18 1.7-1.63c.37-.44.56-.85.57-1.23a.884.884 0 0 0-.27-.7c-.18-.19-.47-.28-.86-.29c-.31.01-.58.07-.84.17l-.66.39l-.45-1.17c.27-.22.59-.39.98-.53S18.85 2 19.32 2c.78 0 1.38.2 1.78.61c.4.39.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.48-.76.93-1.27 1.36l-.64.52v.02h2.58V9z"/></svg>`,
|
||||
"subscript-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M16 7.41L11.41 12L16 16.59L14.59 18L10 13.41L5.41 18L4 16.59L8.59 12L4 7.41L5.41 6L10 10.59L14.59 6L16 7.41m5.85 13.62h-4.88v-1l.89-.8c.76-.65 1.32-1.19 1.7-1.63c.37-.44.56-.85.57-1.24a.898.898 0 0 0-.27-.7c-.18-.16-.47-.28-.86-.28c-.31 0-.58.06-.84.18l-.66.38l-.45-1.17c.27-.21.59-.39.98-.53s.82-.24 1.29-.24c.78.04 1.38.25 1.78.66c.4.41.62.93.62 1.57c-.01.56-.19 1.08-.54 1.55c-.34.47-.76.92-1.27 1.36l-.64.52v.02h2.58v1.35z"/></svg>`,
|
||||
"bot-glyph": `<svg xmlns="http://www.w3.org/2000/svg" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24"><path fill="currentColor" d="M21.928 11.607c-.202-.488-.635-.605-.928-.633V8c0-1.103-.897-2-2-2h-6V4.61c.305-.274.5-.668.5-1.11a1.5 1.5 0 0 0-3 0c0 .442.195.836.5 1.11V6H5c-1.103 0-2 .897-2 2v2.997l-.082.006A1 1 0 0 0 1.99 12v2a1 1 0 0 0 1 1H3v5c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5a1 1 0 0 0 1-1v-1.938a1.006 1.006 0 0 0-.072-.455zM5 20V8h14l.001 3.996L19 12v2l.001.005l.001 5.995H5z" fill="currentColor"/><ellipse cx="8.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><ellipse cx="15.5" cy="12" rx="1.5" ry="2" fill="currentColor"/><path d="M8 16h8v2H8z" fill="currentColor"/></svg>`,
|
||||
"header-1":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill="currentColor" d="M835.626667 349.397333A42.666667 42.666667 0 0 1 853.333333 384v426.666667a42.666667 42.666667 0 0 1-85.333333 0v-367.488l-71.850667 23.978666a42.666667 42.666667 0 0 1-26.965333-80.981333l128-42.666667a42.666667 42.666667 0 0 1 38.4 5.888zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1635"></path></svg>`,
|
||||
"header-2":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M768 426.666667a85.333333 85.333333 0 0 0-85.333333 85.333333v21.333333a42.666667 42.666667 0 1 1-85.333334 0V512a170.666667 170.666667 0 0 1 170.666667-170.666667h7.338667a163.328 163.328 0 0 1 115.498666 278.869334L742.997333 768H896a42.666667 42.666667 0 1 1 0 85.333333h-256a42.666667 42.666667 0 0 1-30.165333-72.832l220.672-220.672A77.994667 77.994667 0 0 0 775.338667 426.666667H768zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1791"></path></svg>`,
|
||||
"header-3":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M597.333333 384a42.666667 42.666667 0 0 1 42.666667-42.666667h256a42.666667 42.666667 0 0 1 30.165333 72.832l-105.941333 105.984A170.752 170.752 0 0 1 768 853.333333a170.666667 170.666667 0 0 1-160.938667-113.877333 42.666667 42.666667 0 0 1 80.469334-28.373333A85.333333 85.333333 0 1 0 768 597.333333h-42.666667a42.666667 42.666667 0 0 1-30.165333-72.832L793.002667 426.666667H640a42.666667 42.666667 0 0 1-42.666667-42.666667zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="1949"></path></svg>`,
|
||||
"header-4":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M780.714667 343.296a42.666667 42.666667 0 0 1 28.032 53.418667L719.36 682.666667H896a42.666667 42.666667 0 1 1 0 85.333333h-234.666667a42.666667 42.666667 0 0 1-40.704-55.381333l106.666667-341.333334a42.666667 42.666667 0 0 1 53.418667-27.989333z" p-id="2107"></path><path d="M853.333333 554.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v213.333334a42.666667 42.666667 0 1 1-85.333333 0v-213.333334a42.666667 42.666667 0 0 1 42.666666-42.666666zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2108"></path></svg>`,
|
||||
"header-5":`
|
||||
<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M683.946667 373.674667A42.666667 42.666667 0 0 1 725.333333 341.333333h170.666667a42.666667 42.666667 0 1 1 0 85.333334h-137.301333l-22.016 88.234666A170.666667 170.666667 0 1 1 640 795.562667a42.666667 42.666667 0 1 1 64-56.448 85.333333 85.333333 0 1 0 0-112.896 42.666667 42.666667 0 0 1-73.386667-38.528l53.333334-214.016zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2264"></path></svg>`,
|
||||
"header-6":`<svg class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path d="M831.274667 303.957333a42.666667 42.666667 0 0 1 16.725333 57.984l-83.498667 151.466667a170.453333 170.453333 0 0 1 88.746667 22.741333 169.557333 169.557333 0 0 1 62.506667 232.277334 171.093333 171.093333 0 0 1-232.96 62.165333 169.557333 169.557333 0 0 1-62.805334-231.850667l153.301334-278.016a42.666667 42.666667 0 0 1 57.984-16.768z m-20.48 306.176a85.76 85.76 0 0 0-116.736 31.018667 84.224 84.224 0 0 0 31.189333 115.456 85.76 85.76 0 0 0 116.736-31.018667 84.224 84.224 0 0 0-31.232-115.456zM128 170.666667a42.666667 42.666667 0 0 1 42.666667 42.666666v256h256V213.333333a42.666667 42.666667 0 1 1 85.333333 0v597.333334a42.666667 42.666667 0 1 1-85.333333 0v-256H170.666667v256a42.666667 42.666667 0 1 1-85.333334 0V213.333333a42.666667 42.666667 0 0 1 42.666667-42.666666z" p-id="2422"></path></svg>`,
|
||||
"header-n":`<svg viewBox="0 0 24 24" ><path d="M2 3a1 1 0 0 0-1 1v16a1 1 0 1 0 2 0v-7h9v7a1 1 0 1 0 2 0V4a1 1 0 1 0-2 0v7H3V4a1 1 0 0 0-1-1Zm14 9a1 1 0 0 1 1.984-.177 4.099 4.099 0 0 1 1.757-.576 3.447 3.447 0 0 1 3.759 3.432V20a1 1 0 1 1-2 0v-5.32c0-.851-.73-1.519-1.578-1.442A2.114 2.114 0 0 0 18 15.344V20a1 1 0 1 1-2 0v-8Z" fill="currentColor"></path></svg>`,
|
||||
};
|
||||
|
||||
export default function addIcons() {
|
||||
Object.keys(icons).forEach((key) => {
|
||||
addIcon(key, icons[key]);
|
||||
});
|
||||
}
|
||||
|
||||
export function addFeatherIcons(appIcons: string[]) {
|
||||
Object.values(featherIcons.icons).forEach((icon) => {
|
||||
const svg = icon.toSvg({
|
||||
viewBox: "0 0 24 24",
|
||||
width: "100",
|
||||
height: "100",
|
||||
"stroke-width": "2",
|
||||
});
|
||||
addIcon("feather-" + icon.name, svg);
|
||||
appIcons.push("feather-" + icon.name);
|
||||
});
|
||||
}
|
||||
|
||||
export function addRemixIcons(appIcons: string[]) {
|
||||
const iconKeys: Icon[] = [];
|
||||
for (const icon in remixicons) {
|
||||
iconKeys.push({
|
||||
id: icon,
|
||||
name: icon.substring(2),
|
||||
});
|
||||
const svg = renderToString(
|
||||
// @ts-ignore
|
||||
remixicons[icon]({
|
||||
size: "100",
|
||||
})
|
||||
);
|
||||
addIcon("remix-" + icon.substring(2), svg);
|
||||
appIcons.push("remix-" + icon.substring(2));
|
||||
}
|
||||
}
|
||||
|
||||
/* export function addBoxIcons(appIcons: string[]) {
|
||||
const iconKeys: Icon[] = [];
|
||||
for (const icon in boxicons) {
|
||||
iconKeys.push({
|
||||
id: icon,
|
||||
name: icon.substring(2),
|
||||
});
|
||||
const svg = renderToString(
|
||||
// @ts-ignore
|
||||
boxicons[icon]({
|
||||
size: "100",
|
||||
})
|
||||
);
|
||||
addIcon("bx-" + icon.substring(2), svg);
|
||||
appIcons.push("bx-" + icon.substring(2));
|
||||
}
|
||||
}
|
||||
*/
|
755
.obsidian/plugins/obsidian-editing-toolbar/src/modals/cMenuToolbarModal.ts
vendored
Normal file
755
.obsidian/plugins/obsidian-editing-toolbar/src/modals/cMenuToolbarModal.ts
vendored
Normal file
@ -0,0 +1,755 @@
|
||||
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { App, Notice, Command, requireApiVersion, MarkdownView, ButtonComponent, WorkspaceParent, WorkspaceWindow } from "obsidian";
|
||||
import { WorkspaceExt, WorkspaceItemExt, WorkspaceParentExt } from 'src/util/obsidian-ext';
|
||||
import { setBottomValue } from "src/util/statusBarConstants";
|
||||
import { backcolorpicker, colorpicker } from "src/util/util";
|
||||
import { t } from "src/translations/helper";
|
||||
import { cMenuToolbarSettings } from "src/settings/settingsData";
|
||||
|
||||
window.ISMORE = false;
|
||||
window.isBgC = false;
|
||||
window.isCTxt = false;
|
||||
window.isText = false;
|
||||
let activeDocument: Document;
|
||||
|
||||
export function getRootSplits(): WorkspaceParentExt[] {
|
||||
const rootSplits: WorkspaceParentExt[] = [];
|
||||
|
||||
// push the main window's root split to the list
|
||||
rootSplits.push(app.workspace.rootSplit as WorkspaceParent as WorkspaceParentExt)
|
||||
|
||||
// @ts-ignore floatingSplit is undocumented
|
||||
const floatingSplit = app.workspace.floatingSplit as WorkspaceParentExt;
|
||||
floatingSplit?.children.forEach((child: WorkspaceParentExt) => {
|
||||
// if this is a window, push it to the list
|
||||
if (child instanceof WorkspaceWindow) {
|
||||
rootSplits.push(child);
|
||||
}
|
||||
});
|
||||
|
||||
return rootSplits;
|
||||
}
|
||||
export function selfDestruct() {
|
||||
const rootSplits = getRootSplits();
|
||||
const clearToolbar = (leaf: HTMLElement) => {
|
||||
|
||||
let cMenuToolbarModalBar = leaf.querySelector(
|
||||
"#cMenuToolbarModalBar"
|
||||
);
|
||||
let cMenuToolbarPopoverBar = leaf.querySelector(
|
||||
"#cMenuToolbarPopoverBar"
|
||||
);
|
||||
|
||||
if (cMenuToolbarModalBar) {
|
||||
if (cMenuToolbarModalBar.firstChild) {
|
||||
cMenuToolbarModalBar.removeChild(cMenuToolbarModalBar.firstChild);
|
||||
}
|
||||
cMenuToolbarModalBar.remove();
|
||||
}
|
||||
if (cMenuToolbarPopoverBar) {
|
||||
if (cMenuToolbarPopoverBar.firstChild) {
|
||||
cMenuToolbarPopoverBar.removeChild(cMenuToolbarPopoverBar.firstChild);
|
||||
}
|
||||
cMenuToolbarPopoverBar.remove();
|
||||
}
|
||||
}
|
||||
if (rootSplits)
|
||||
rootSplits.forEach((rootSplit: WorkspaceParentExt) => {
|
||||
if (rootSplit?.containerEl)
|
||||
clearToolbar(rootSplit?.containerEl)
|
||||
});
|
||||
|
||||
}
|
||||
export const getcoords = (editor: any) => {
|
||||
const cursorFrom = editor.getCursor("head");
|
||||
|
||||
let coords;
|
||||
if (editor.cursorCoords) coords = editor.cursorCoords(true, "window");
|
||||
else if (editor.coordsAtPos) {
|
||||
const offset = editor.posToOffset(cursorFrom);
|
||||
coords = editor.cm.coordsAtPos?.(offset) ?? editor.coordsAtPos(offset);
|
||||
} else return;
|
||||
|
||||
return coords;
|
||||
};
|
||||
|
||||
export function getModestate(app: {
|
||||
workspace: { getActiveViewOfType: (arg0: typeof MarkdownView) => any };
|
||||
}) {
|
||||
const activePane = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activePane) {
|
||||
let currentmode = activePane?.getMode();
|
||||
|
||||
if (currentmode === "empty") {
|
||||
return false;
|
||||
}
|
||||
if (currentmode == "preview") {
|
||||
return false;
|
||||
}
|
||||
if (currentmode == "source") {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function checksvg(htmlStr: string) {
|
||||
let reg = /<[^>]+>/g;
|
||||
return reg.test(htmlStr);
|
||||
}
|
||||
|
||||
export function CreateDiv(selector: string) {
|
||||
let div = createEl("div");
|
||||
div.addClass(selector);
|
||||
return div;
|
||||
}
|
||||
|
||||
export function tabCell(app: App, plugin: cMenuToolbarPlugin, el: string) {
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
let tab = activeDocument.getElementById(el);
|
||||
// @ts-ignore
|
||||
let rows = tab.rows;
|
||||
let rlen = rows.length;
|
||||
for (let i = 1; i < rlen; i++) {
|
||||
//遍历所有行
|
||||
let cells = rows[i].cells; //得到这一行的所有单元格
|
||||
for (let j = 0; j < cells.length; j++) {
|
||||
//给每一个单元格添加click事件
|
||||
cells[j].onclick = function () {
|
||||
let backcolor = this.style.backgroundColor;
|
||||
if (backcolor != "") {
|
||||
backcolor = colorHex(backcolor);
|
||||
if (el == "x-color-picker-table") {
|
||||
plugin.settings.cMenuFontColor = backcolor;
|
||||
Setfontcolor(app, backcolor);
|
||||
activeDocument.getElementById("change-font-color-icon").style.fill =
|
||||
plugin.settings.cMenuFontColor;
|
||||
} else if (el == "x-backgroundcolor-picker-table") {
|
||||
plugin.settings.cMenuBackgroundColor = backcolor;
|
||||
Setbackgroundcolor(app, backcolor);
|
||||
activeDocument.getElementById(
|
||||
"change-background-color-icon"
|
||||
).style.fill = plugin.settings.cMenuBackgroundColor;
|
||||
}
|
||||
|
||||
plugin.saveSettings();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function Setfontcolor(app: App, color: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || "") {
|
||||
return;
|
||||
}
|
||||
|
||||
let _html0 = /\<font color=[0-9a-zA-Z#]+[^\<\>]*\>[^\<\>]+\<\/font\>/g;
|
||||
let _html1 = /^\<font color=[0-9a-zA-Z#]+[^\<\>]*\>([^\<\>]+)\<\/font\>$/;
|
||||
let _html2 = '<font color="' + color + '">$1</font>';
|
||||
let _html3 = /\<font color=[^\<]*$|^[^\>]*font\>/g; //是否只包含一侧的<>
|
||||
|
||||
if (_html3.test(selectText)) {
|
||||
return;
|
||||
} else if (_html0.test(selectText)) {
|
||||
if (_html1.test(selectText)) {
|
||||
|
||||
selectText = selectText.replace(_html1, _html2);
|
||||
} else {
|
||||
selectText = selectText.replace(
|
||||
/\<font color=[0-9a-zA-Z#]+[^\<\>]*?\>|\<\/font\>/g,
|
||||
""
|
||||
);
|
||||
}
|
||||
} else {
|
||||
selectText = selectText.replace(/^(.+)$/gm, _html2);
|
||||
}
|
||||
editor.replaceSelection(selectText);
|
||||
editor.exec("goRight");
|
||||
// @ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
}
|
||||
|
||||
export function Setbackgroundcolor(app: App, color: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || selectText == "") {
|
||||
return;
|
||||
}
|
||||
let _html0 =
|
||||
/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>[^\<\>]+\<\/span\>/g;
|
||||
let _html1 =
|
||||
/^\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>([^\<\>]+)\<\/span\>$/;
|
||||
let _html2 = '<span style="background:' + color + '">$1</span>';
|
||||
let _html3 = /\<span style=[^\<]*$|^[^\>]*span\>/g; //是否只包含一侧的<>
|
||||
if (_html3.test(selectText)) {
|
||||
return;
|
||||
} else if (_html0.test(selectText)) {
|
||||
if (_html1.test(selectText)) {
|
||||
selectText = selectText.replace(_html1, _html2);
|
||||
} else {
|
||||
selectText = selectText.replace(
|
||||
/\<span style=[\"'][^\<\>]+:[0-9a-zA-Z#]+[\"'][^\<\>]*\>|\<\/span\>/g,
|
||||
""
|
||||
);
|
||||
|
||||
}
|
||||
} else {
|
||||
selectText = selectText.replace(/^(.+)$/gm, _html2);
|
||||
}
|
||||
editor.replaceSelection(selectText);
|
||||
editor.exec("goRight");
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
}
|
||||
|
||||
export const colorHex = function (color: string) {
|
||||
let that = color;
|
||||
let reg = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;
|
||||
if (/^(rgb|RGB)/.test(that)) {
|
||||
let aColor = that.replace(/(?:\(|\)|rgb|RGB)*/g, "").split(",");
|
||||
let strHex = "#";
|
||||
for (let i = 0; i < aColor.length; i++) {
|
||||
let hex = Number(aColor[i]).toString(16);
|
||||
if (hex === "0") {
|
||||
hex += hex;
|
||||
}
|
||||
strHex += hex;
|
||||
}
|
||||
if (strHex.length !== 7) {
|
||||
strHex = that;
|
||||
}
|
||||
return strHex;
|
||||
} else if (reg.test(that)) {
|
||||
let aNum = that.replace(/#/, "").split("");
|
||||
if (aNum.length === 6) {
|
||||
return that;
|
||||
} else if (aNum.length === 3) {
|
||||
let numHex = "#";
|
||||
for (let i = 0; i < aNum.length; i += 1) {
|
||||
numHex += aNum[i] + aNum[i];
|
||||
}
|
||||
console.log(numHex);
|
||||
return numHex;
|
||||
}
|
||||
} else {
|
||||
return that;
|
||||
}
|
||||
};
|
||||
|
||||
export function CreateMoreMenu(selector: HTMLDivElement) {
|
||||
// let issubmenu= activeDocument.getElementById("cMenuToolbarModalBar").querySelector('.'+selector);
|
||||
// let barHeight = activeDocument.getElementById("cMenuToolbarModalBar").offsetHeight;
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (!window.ISMORE) return;
|
||||
let cMoreMenu = selector.createEl("span");
|
||||
cMoreMenu.addClass("more-menu");
|
||||
let morebutton = new ButtonComponent(cMoreMenu);
|
||||
morebutton
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setTooltip(t("More"))
|
||||
.onClick(() => {
|
||||
if (
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility ==
|
||||
"hidden"
|
||||
) {
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility =
|
||||
"visible";
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.height = "32px";
|
||||
} else {
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.visibility =
|
||||
"hidden";
|
||||
activeDocument.getElementById("cMenuToolbarPopoverBar").style.height = "0";
|
||||
}
|
||||
});
|
||||
morebutton.buttonEl.innerHTML = `<svg width="14" height="14" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" enable-background="new 0 0 1024 1024" xml:space="preserve"><path fill="#666" d="M510.29 14.13 q17.09 -15.07 40.2 -14.07 q23.12 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.1 q-23.62 2.01 -41.71 -13.07 q-18.08 -15.08 -20.09 -38.19 q-2.01 -23.12 13.06 -41.21 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.67 -386.92 q-15.07 -17.09 -13.56 -40.7 q1.51 -23.62 19.59 -38.7 ZM81.17 14.13 q17.08 -15.07 40.19 -14.07 q23.11 1 39.2 18.08 l334.66 385.92 q25.12 30.15 34.16 66.83 q9.04 36.68 0.5 73.87 q-8.54 37.19 -32.66 67.34 l-335.67 390.94 q-15.07 18.09 -38.69 20.6 q-23.61 2.51 -41.7 -12.57 q-18.09 -15.08 -20.1 -38.69 q-2.01 -23.62 13.06 -41.71 l334.66 -390.94 q11.06 -13.06 11.56 -29.65 q0.5 -16.58 -10.55 -29.64 l-334.66 -386.92 q-15.08 -17.09 -13.57 -40.7 q1.51 -23.62 19.6 -38.7 Z"/></svg>`;
|
||||
window.ISMORE = false;
|
||||
return cMoreMenu;
|
||||
}
|
||||
|
||||
export function QuiteFormatBrushes() {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
//关闭所有格式刷变量
|
||||
if (window.newNotice) window.newNotice.hide();
|
||||
window.isBgC = false; //多彩背景刷
|
||||
window.isCTxt = false; //多彩文字刷
|
||||
window.isText = false;
|
||||
}
|
||||
|
||||
export function SetHeader(_str: string) {
|
||||
//from https://github.com/obsidian-canzi/Enhanced-editing
|
||||
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
let linetext = editor.getLine(editor.getCursor().line);
|
||||
let newstr, linend = "";
|
||||
if (_str == "") { //若为标题,转为普通文本
|
||||
newstr = linetext.replace(/^(\>*(\[[!\w]+\])?\s*)#+\s/, "$1");
|
||||
} else { //列表、引用,先转为普通文本,再转为标题
|
||||
newstr = linetext.replace(/^\s*(#*|\>|\-|\d+\.)\s*/m, "");
|
||||
newstr = _str + " " + newstr;
|
||||
}
|
||||
if (newstr != "") {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: linetext.length });
|
||||
} else {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: 0 });
|
||||
};
|
||||
editor.setLine(editor.getCursor().line, newstr);
|
||||
editor.setCursor({ line: editor.getCursor().line, ch: Number(newstr.length - linend.length) });
|
||||
};
|
||||
}
|
||||
export function FormatEraser() {
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor
|
||||
let linend;
|
||||
let selstart = editor.getRange({ line: editor.getCursor().line, ch: 0 }, editor.getCursor());
|
||||
let linetext = editor.getLine(editor.getCursor().line);
|
||||
|
||||
if (linetext != "") {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: linetext.length });
|
||||
} else {
|
||||
linend = editor.getRange(editor.getCursor(), { line: editor.getCursor().line, ch: 0 });
|
||||
};
|
||||
let selectText = editor.getSelection();
|
||||
if (selectText == null || selectText == "") {
|
||||
QuiteFormatBrushes();
|
||||
window.isText = true;
|
||||
if (window.newNotice) {
|
||||
if (window.newNotice.noticeEl.innerText != t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"))
|
||||
window.newNotice = new Notice(t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"), 0);
|
||||
}
|
||||
else window.newNotice = new Notice(t("Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush"), 0);
|
||||
|
||||
//new obsidian.Notice("请先划选部分文本,再执行命令!");
|
||||
let reg1 = /(~~|%%|\*==|==|\*\*?|\<[^\<\>]*?\>|!?\[\[*|`|_|!?\[)([^!#=\[\]\<\>\`_\*~\(\)]*)$/;
|
||||
let reg2 = /^([^!=\[\]\<\>\`_\*~\(\)]*)(~~|%%|==\*|==|\*\*?|\<[^\<\>]*\>|\]\]|`|_|\]\([^\(\)\[\]]*\))/;
|
||||
if (selstart.match(reg1) != null && linend.match(reg2) != null) {
|
||||
selstart = selstart.replace(reg1, "$2");
|
||||
linend = linend.replace(reg2, "$1");
|
||||
//笔记全文.replaceRange(selstart+linend, {line:当前行号,ch:0},{line:当前行号,ch:当前行文本.length});
|
||||
editor.setLine(editor.getCursor().line, selstart + linend);
|
||||
editor.setCursor({ line: editor.getCursor().line, ch: Number(selstart.length) });
|
||||
}
|
||||
|
||||
} else {
|
||||
let mdText = /(^#+\s|(?<=^|\s*)#|^\>|^\- \[( |x)\]|^\+ |\<[^\<\>]+?\>|^1\. |^\s*\- |^\-+$|^\*+$|==\*|\*==|==\*\*|\*\*==|==\*\*\*|\*\*\*==)/mg;
|
||||
selectText = selectText.replace(mdText, "");
|
||||
selectText = selectText.replace(/^[ ]+|[ ]+$/mg, "");
|
||||
selectText = selectText.replace(/\!?\[\[([^\[\]\|]*\|)*([^\(\)\[\]]+)\]\]/g, "$2");
|
||||
selectText = selectText.replace(/\!?\[+([^\[\]\(\)]+)\]+\(([^\(\)]+)\)/g, "$1");
|
||||
selectText = selectText.replace(/`([^`]+)`/g, "$1");
|
||||
selectText = selectText.replace(/_([^_]+)_/g, "$1");
|
||||
selectText = selectText.replace(/==([^=]+)==/g, "$1");
|
||||
selectText = selectText.replace(/\*\*?([^\*]+)\*\*?/g, "$1");
|
||||
selectText = selectText.replace(/~~([^~]+)~~/g, "$1");
|
||||
selectText = selectText.replace(/(\r*\n)+/mg, "\r\n");
|
||||
editor.replaceSelection(selectText);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
export const followingbar = (settings: cMenuToolbarSettings) => {
|
||||
|
||||
let isource = getModestate(app);
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
//console.log(activeLeaf.getViewState().state.mode)
|
||||
if (isource) {
|
||||
const activeLeaf = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
|
||||
|
||||
if (cMenuToolbarModalBar) {
|
||||
|
||||
let selection = editor.somethingSelected();
|
||||
let cMenuToolbarRows = settings.cMenuNumRows;
|
||||
selection
|
||||
? (cMenuToolbarModalBar.style.visibility = "visible")
|
||||
: (cMenuToolbarModalBar.style.visibility = "hidden");
|
||||
|
||||
let ElementCount = cMenuToolbarModalBar.childElementCount;
|
||||
if (ElementCount) {
|
||||
ElementCount == cMenuToolbarRows
|
||||
? (cMenuToolbarModalBar.addClass("cMenuToolbarGrid"), cMenuToolbarModalBar.removeClass("cMenuToolbarFlex"))
|
||||
: (cMenuToolbarModalBar.addClass("cMenuToolbarFlex"), cMenuToolbarModalBar.removeClass("cMenuToolbarGrid"))
|
||||
} else {
|
||||
ElementCount = 0;
|
||||
}
|
||||
|
||||
let cmheight = Math.ceil(ElementCount / cMenuToolbarRows);
|
||||
|
||||
cMenuToolbarModalBar.style.height = 40 * cmheight + "px";
|
||||
if (settings.aestheticStyle == "tiny") {
|
||||
cMenuToolbarModalBar.style.height = 25 * cmheight + "px";
|
||||
}
|
||||
let rleftwidth =
|
||||
activeDocument.getElementsByClassName("side-dock-ribbon mod-left")[0]
|
||||
?.clientWidth ?? 0;
|
||||
|
||||
let leftwidth =
|
||||
activeDocument.getElementsByClassName("mod-left-split")[0]
|
||||
?.clientWidth ?? 0;
|
||||
|
||||
let barwidth = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
).offsetWidth;
|
||||
let barHeight = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
).offsetHeight;
|
||||
|
||||
let bodywidth = activeDocument.body.offsetWidth;
|
||||
let coords = getcoords(editor);
|
||||
let cursor_head = editor.getCursor("head").ch
|
||||
let cursor_from = editor.getCursor("from").ch
|
||||
|
||||
let toppx = 0;
|
||||
/*添加判断边界 */
|
||||
let leftpx = coords.left - leftwidth - rleftwidth + 20;
|
||||
if (coords.left + barwidth + 15 > bodywidth)
|
||||
leftpx = coords.left - leftwidth - rleftwidth - barwidth / 1.3 - 60;
|
||||
cursor_head == cursor_from ?
|
||||
toppx = coords.top - barHeight - 30 : (toppx = coords.top, leftpx = leftpx - 40);
|
||||
if (leftpx < 0) leftpx = 0;
|
||||
cMenuToolbarModalBar.style.visibility == "visible" ?
|
||||
(cMenuToolbarModalBar.style.left = leftpx + "px", cMenuToolbarModalBar.style.top = toppx + "px") : true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
} else
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
}
|
||||
export function cMenuToolbarPopover(
|
||||
app: App,
|
||||
plugin: cMenuToolbarPlugin
|
||||
): void {
|
||||
let settings = plugin.settings;
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
function createMenu() {
|
||||
const generateMenu = () => {
|
||||
let btnwidth = 0;
|
||||
let cMenuToolbar = createEl("div");
|
||||
if (cMenuToolbar) {
|
||||
if (settings.positionStyle == "top") {
|
||||
cMenuToolbar.setAttribute(
|
||||
"style",
|
||||
`position: relative; grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));`
|
||||
);
|
||||
} else {
|
||||
cMenuToolbar.setAttribute(
|
||||
"style",
|
||||
`left: calc(50% - calc(${cMenuToolbar.offsetWidth
|
||||
}px / 2)); bottom: ${settings.cMenuBottomValue
|
||||
}em; grid-template-columns: ${"1fr ".repeat(settings.cMenuNumRows)}`
|
||||
);
|
||||
}
|
||||
}
|
||||
cMenuToolbar.setAttribute("id", "cMenuToolbarModalBar");
|
||||
//二级弹出菜单
|
||||
|
||||
let PopoverMenu = createEl("div");
|
||||
PopoverMenu.addClass("cMenuToolbarpopover");
|
||||
PopoverMenu.addClass("cMenuToolbarTinyAesthetic");
|
||||
PopoverMenu.setAttribute("id", "cMenuToolbarPopoverBar");
|
||||
PopoverMenu.style.visibility = "hidden";
|
||||
PopoverMenu.style.height = "0";
|
||||
if (settings.aestheticStyle == "default") {
|
||||
cMenuToolbar.addClass("cMenuToolbarDefaultAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarGlassAesthetic");
|
||||
} else if (settings.aestheticStyle == "tiny") {
|
||||
cMenuToolbar.addClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarDefaultAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarGlassAesthetic");
|
||||
} else {
|
||||
cMenuToolbar.addClass("cMenuToolbarGlassAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarTinyAesthetic");
|
||||
cMenuToolbar.removeClass("cMenuToolbarDefaultAesthetic");
|
||||
}
|
||||
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
}
|
||||
|
||||
let leafwidth = 99999;
|
||||
if (settings.positionStyle == "top") {
|
||||
let currentleaf = activeDocument.body?.querySelector(
|
||||
".workspace-leaf.mod-active"
|
||||
);
|
||||
if (!activeDocument.getElementById("cMenuToolbarPopoverBar"))
|
||||
currentleaf
|
||||
?.querySelector(".markdown-source-view")
|
||||
.insertAdjacentElement("afterbegin", PopoverMenu);
|
||||
currentleaf
|
||||
?.querySelector(".markdown-source-view")
|
||||
.insertAdjacentElement("afterbegin", cMenuToolbar);
|
||||
leafwidth = currentleaf.querySelector<HTMLElement>(
|
||||
".markdown-source-view"
|
||||
).offsetWidth;
|
||||
} else if (settings.appendMethod == "body") {
|
||||
activeDocument.body.appendChild(cMenuToolbar);
|
||||
} else if (settings.appendMethod == "workspace") {
|
||||
activeDocument.body
|
||||
?.querySelector(".mod-vertical.mod-root")
|
||||
.insertAdjacentElement("afterbegin", cMenuToolbar);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
let cMenuToolbarPopoverBar = activeDocument.getElementById(
|
||||
"cMenuToolbarPopoverBar"
|
||||
);
|
||||
settings.menuCommands.forEach((item, index) => {
|
||||
if ("SubmenuCommands" in item) {
|
||||
let _btn: any;
|
||||
if (btnwidth >= leafwidth - 26 * 4 && leafwidth > 100) {
|
||||
//说明已经溢出
|
||||
window.ISMORE = true; //需要添加更多按钮
|
||||
_btn = new ButtonComponent(cMenuToolbarPopoverBar);
|
||||
} else _btn = new ButtonComponent(cMenuToolbar);
|
||||
|
||||
_btn.setClass("cMenuToolbarCommandsubItem" + index);
|
||||
|
||||
checksvg(item.icon)
|
||||
? (_btn.buttonEl.innerHTML = item.icon)
|
||||
: _btn.setIcon(item.icon);
|
||||
|
||||
let __btnwidth;
|
||||
if (_btn.buttonEl.offsetWidth > 100) __btnwidth = 26;
|
||||
else {
|
||||
if (_btn.buttonEl.offsetWidth < 26) __btnwidth = 26;
|
||||
else __btnwidth = _btn.buttonEl.offsetWidth;
|
||||
}
|
||||
btnwidth += __btnwidth + 2;
|
||||
let submenu = CreateDiv("subitem");
|
||||
if (submenu) {
|
||||
item.SubmenuCommands.forEach(
|
||||
(subitem: { name: string; id: any; icon: string }) => {
|
||||
let sub_btn = new ButtonComponent(submenu)
|
||||
.setTooltip(subitem.name)
|
||||
.setClass("menu-item")
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(subitem.id);
|
||||
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(subitem.icon)
|
||||
? (sub_btn.buttonEl.innerHTML = subitem.icon)
|
||||
: sub_btn.setIcon(subitem.icon);
|
||||
|
||||
_btn.buttonEl.insertAdjacentElement("afterbegin", submenu);
|
||||
}
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (item.id == "obsidian-editing-toolbar:change-font-color") {
|
||||
let button2 = new ButtonComponent(cMenuToolbar);
|
||||
button2
|
||||
.setClass("cMenuToolbarCommandsubItem-font-color")
|
||||
.setTooltip(t("Font Colors"))
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(item.icon)
|
||||
? (button2.buttonEl.innerHTML = item.icon)
|
||||
: button2.setIcon(item.icon);
|
||||
|
||||
btnwidth += 26;
|
||||
// let Selection = createDiv("triangle-icon");
|
||||
let submenu2 = createEl("div");
|
||||
submenu2.addClass("subitem");
|
||||
|
||||
if (submenu2) {
|
||||
submenu2.innerHTML = colorpicker;
|
||||
|
||||
button2.buttonEl.insertAdjacentElement("afterbegin", submenu2);
|
||||
if (settings.cMenuFontColor)
|
||||
activeDocument.getElementById(
|
||||
"change-font-color-icon"
|
||||
).style.fill = settings.cMenuFontColor;
|
||||
tabCell(app, plugin, "x-color-picker-table");
|
||||
let el = submenu2.querySelector(
|
||||
".x-color-picker-wrapper"
|
||||
) as HTMLElement;
|
||||
|
||||
let button3 = new ButtonComponent(el);
|
||||
button3
|
||||
.setIcon("remix-Brush2Line")
|
||||
.setTooltip(t("Format Brush"))
|
||||
.onClick(() => {
|
||||
QuiteFormatBrushes();
|
||||
window.isCTxt = true;
|
||||
window.newNotice = new Notice(
|
||||
t("Font-Color formatting brush ON!"),
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
} else if (item.id == "obsidian-editing-toolbar:change-background-color") {
|
||||
let button2 = new ButtonComponent(cMenuToolbar);
|
||||
button2
|
||||
.setClass("cMenuToolbarCommandsubItem-font-color")
|
||||
.setTooltip(t("Background color"))
|
||||
.onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
checksvg(item.icon)
|
||||
? (button2.buttonEl.innerHTML = item.icon)
|
||||
: button2.setIcon(item.icon);
|
||||
|
||||
btnwidth += 26;
|
||||
// let Selection = CreateDiv("triangle-icon");
|
||||
let submenu2 = createEl("div");
|
||||
submenu2.addClass("subitem");
|
||||
// console.log(btnwidth,item.name)
|
||||
if (submenu2) {
|
||||
submenu2.innerHTML = backcolorpicker;
|
||||
|
||||
button2.buttonEl.insertAdjacentElement("afterbegin", submenu2);
|
||||
if (plugin.settings.cMenuBackgroundColor)
|
||||
activeDocument.getElementById(
|
||||
"change-background-color-icon"
|
||||
).style.fill = plugin.settings.cMenuBackgroundColor;
|
||||
tabCell(app, plugin, "x-backgroundcolor-picker-table");
|
||||
let el = submenu2.querySelector(
|
||||
".x-color-picker-wrapper"
|
||||
) as HTMLElement;
|
||||
|
||||
let button3 = new ButtonComponent(el);
|
||||
button3
|
||||
.setIcon("remix-Brush2Line")
|
||||
.setTooltip(t("Format Brush"))
|
||||
.onClick(() => {
|
||||
QuiteFormatBrushes();
|
||||
window.isBgC = true;
|
||||
window.newNotice = new Notice(
|
||||
t("Background-color formatting brush ON!"),
|
||||
0
|
||||
);
|
||||
});
|
||||
}
|
||||
} else {
|
||||
let button;
|
||||
if (btnwidth >= leafwidth - 26 * 4 && leafwidth > 100) {
|
||||
//说明已经溢出
|
||||
window.ISMORE = true; //需要添加更多按钮
|
||||
button = new ButtonComponent(cMenuToolbarPopoverBar);
|
||||
} else button = new ButtonComponent(cMenuToolbar);
|
||||
button.setTooltip(item.name).onClick(() => {
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(item.id);
|
||||
if (settings.cMenuVisibility == false)
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
else {
|
||||
if (settings.positionStyle == "following") {
|
||||
cMenuToolbar.style.visibility = "hidden";
|
||||
} else cMenuToolbar.style.visibility = "visible";
|
||||
}
|
||||
});
|
||||
|
||||
button.setClass("cMenuToolbarCommandItem");
|
||||
if (item.id == "cMenuToolbar-Divider-Line")
|
||||
button.setClass("cMenuToolbar-Divider-Line");
|
||||
checksvg(item.icon)
|
||||
? (button.buttonEl.innerHTML = item.icon)
|
||||
: button.setIcon(item.icon);
|
||||
let __btnwidth2;
|
||||
if (button.buttonEl.offsetWidth > 100) __btnwidth2 = 26;
|
||||
else {
|
||||
if (button.buttonEl.offsetWidth < 26) __btnwidth2 = 26;
|
||||
else __btnwidth2 = button.buttonEl.offsetWidth;
|
||||
}
|
||||
|
||||
btnwidth += __btnwidth2;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
CreateMoreMenu(cMenuToolbar);
|
||||
if (Math.abs(plugin.settings.cMenuWidth - Number(btnwidth)) > 30) {
|
||||
plugin.settings.cMenuWidth = Number(btnwidth);
|
||||
setTimeout(() => {
|
||||
plugin.saveSettings();
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
let Markdown = app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (Markdown) {
|
||||
let currentnode = activeDocument.getElementById("cMenuToolbarModalBar");
|
||||
if (settings.positionStyle == "top") {
|
||||
if (!getModestate(app)) return;
|
||||
let activeleaf = activeDocument.body.querySelector(
|
||||
".workspace-leaf.mod-active"
|
||||
);
|
||||
if (activeleaf)
|
||||
if (currentnode) {
|
||||
if (!activeleaf.querySelector("#cMenuToolbarModalBar")) {
|
||||
selfDestruct();
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (currentnode) return;
|
||||
}
|
||||
generateMenu();
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
setBottomValue(settings);
|
||||
|
||||
settings.cMenuVisibility == false
|
||||
? (cMenuToolbarModalBar.style.visibility = "hidden")
|
||||
: settings.positionStyle == "following" ?
|
||||
(cMenuToolbarModalBar?.style.visibility = "hidden") : (cMenuToolbarModalBar?.style.visibility = "visible");
|
||||
} else {
|
||||
selfDestruct();
|
||||
}
|
||||
|
||||
}
|
||||
createMenu();
|
||||
}
|
256
.obsidian/plugins/obsidian-editing-toolbar/src/modals/suggesterModals.ts
vendored
Normal file
256
.obsidian/plugins/obsidian-editing-toolbar/src/modals/suggesterModals.ts
vendored
Normal file
@ -0,0 +1,256 @@
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { appIcons } from "src/icons/appIcons";
|
||||
import { Notice, Command, setIcon, FuzzyMatch, FuzzySuggestModal, Modal, SliderComponent, TextAreaComponent, TextComponent, debounce, App } from "obsidian";
|
||||
import { findmenuID } from "src/util/util";
|
||||
import { setBottomValue } from "src/util/statusBarConstants";
|
||||
import { t } from "src/translations/helper";
|
||||
|
||||
export class ChooseFromIconList extends FuzzySuggestModal<string> {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
command: Command;
|
||||
issub: boolean;
|
||||
|
||||
constructor(plugin: cMenuToolbarPlugin, command: Command, issub: boolean = false) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.command = command;
|
||||
this.issub = issub;
|
||||
this.setPlaceholder("Choose an icon");
|
||||
}
|
||||
|
||||
private capitalJoin(string: string): string {
|
||||
const icon = string.split(" ");
|
||||
|
||||
return icon
|
||||
.map((icon) => {
|
||||
return icon[0].toUpperCase() + icon.substring(1);
|
||||
})
|
||||
.join(" ");
|
||||
}
|
||||
|
||||
getItems(): string[] {
|
||||
return appIcons;
|
||||
}
|
||||
|
||||
getItemText(item: string): string {
|
||||
return this.capitalJoin(
|
||||
item
|
||||
.replace("feather-", "")
|
||||
.replace("remix-", "")
|
||||
.replace("bx-", "")
|
||||
.replace(/([A-Z])/g, " $1")
|
||||
.trim()
|
||||
.replace(/-/gi, " ")
|
||||
);
|
||||
}
|
||||
|
||||
renderSuggestion(icon: FuzzyMatch<string>, iconItem: HTMLElement): void {
|
||||
const span = createSpan({ cls: "cMenuToolbarIconPick" });
|
||||
iconItem.appendChild(span);
|
||||
setIcon(span, icon.item);
|
||||
super.renderSuggestion(icon, iconItem);
|
||||
}
|
||||
|
||||
async onChooseItem(item: string): Promise<void> {
|
||||
if (item === "Custom") {
|
||||
new CustomIcon(this.app, this.plugin, this.command, this.issub).open();
|
||||
} else {
|
||||
if (this.command.icon) //存在就修改不存在新增
|
||||
{
|
||||
let menuID = findmenuID(this.plugin, this.command, this.issub)
|
||||
// console.log(menuID);
|
||||
this.issub ? this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[menuID['subindex']].icon = item : this.plugin.settings.menuCommands[menuID['index']].icon = item;
|
||||
} else {
|
||||
this.command.icon = item;
|
||||
this.plugin.settings.menuCommands.push(this.command);
|
||||
}
|
||||
|
||||
await this.plugin.saveSettings();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(
|
||||
`%cCommand '${this.command.name}' was added to cMenuToolbar`,
|
||||
"color: Violet"
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CommandPicker extends FuzzySuggestModal<Command> {
|
||||
command: Command;
|
||||
|
||||
constructor(private plugin: cMenuToolbarPlugin) {
|
||||
super(plugin.app);
|
||||
this.app;
|
||||
this.setPlaceholder("Choose a command");
|
||||
}
|
||||
|
||||
getItems(): Command[] {
|
||||
//@ts-ignore
|
||||
return app.commands.listCommands();
|
||||
}
|
||||
|
||||
getItemText(item: Command): string {
|
||||
return item.name;
|
||||
}
|
||||
|
||||
async onChooseItem(item: Command): Promise<void> {
|
||||
let index = this.plugin.settings.menuCommands.findIndex((v) => v.id == item.id);
|
||||
// console.log(index)
|
||||
|
||||
if (index > -1) //存在
|
||||
{
|
||||
new Notice("The command" + item.name + "already exists", 3000);
|
||||
// console.log(`%cCommand '${item.name}' already exists `, "color: Violet");
|
||||
return;
|
||||
} else {
|
||||
if (item.icon) {
|
||||
this.plugin.settings.menuCommands.push(item);
|
||||
await this.plugin.saveSettings();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(
|
||||
`%cCommand '${item.name}' was added to cMenuToolbar`,
|
||||
"color: Violet"
|
||||
);
|
||||
} else {
|
||||
new ChooseFromIconList(this.plugin, item, false).open();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class CustomIcon extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
item: Command;
|
||||
issub: boolean;
|
||||
submitEnterCallback: (this: HTMLTextAreaElement, ev: KeyboardEvent) => any;
|
||||
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin, item: Command, issub: boolean) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.item = item;
|
||||
this.issub = issub;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
this.containerEl.addClass("customicon");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("b", { text: t("Enter the icon code, it looks like <svg>.... </svg> format") });
|
||||
const textComponent = new TextAreaComponent(contentEl);
|
||||
textComponent.inputEl.classList.add('wideInputPromptInputEl');
|
||||
textComponent.setPlaceholder("")
|
||||
.setValue(this.item.icon ?? '')
|
||||
.onChange(debounce(async (value: string) => {
|
||||
|
||||
this.item.icon = value;
|
||||
let menuID = findmenuID(this.plugin, this.item, this.issub)
|
||||
if (!this.issub) //不是子项
|
||||
{
|
||||
let index = menuID['index']
|
||||
index === -1 ? this.plugin.settings.menuCommands.push(this.item) :
|
||||
(this.plugin.settings.menuCommands[index].icon = this.item.icon);
|
||||
|
||||
} else {
|
||||
let subindex = menuID['subindex']
|
||||
subindex === -1 ? this.plugin.settings.menuCommands[menuID["index"]].SubmenuCommands.push(this.item) : this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[subindex].icon = value
|
||||
|
||||
}
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true)
|
||||
)
|
||||
.inputEl.addEventListener('keydown', this.submitEnterCallback);
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
export class ChangeCmdname extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
item: Command;
|
||||
issub: boolean;
|
||||
submitEnterCallback: (this: HTMLInputElement, ev: KeyboardEvent) => any;
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin, item: Command, issub: boolean) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.item = item;
|
||||
this.issub = issub;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
this.containerEl.addClass("changename");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("b", { text: t("Please enter a new name:") });
|
||||
|
||||
const textComponent = new TextComponent(contentEl);
|
||||
textComponent.inputEl.classList.add('InputPromptInputEl');
|
||||
textComponent.setPlaceholder("")
|
||||
.setValue(this.item.name ?? '')
|
||||
.onChange(debounce(async (value) => {
|
||||
|
||||
let menuID = findmenuID(this.plugin, this.item, this.issub)
|
||||
this.item.name = value;
|
||||
if (!this.issub) //不是子项
|
||||
{
|
||||
let index = menuID['index']
|
||||
// console.log(index,"index")
|
||||
index === -1 ? this.plugin.settings.menuCommands.push(this.item) :
|
||||
(this.plugin.settings.menuCommands[index].name = this.item.name);
|
||||
|
||||
} else {
|
||||
let subindex = menuID['subindex']
|
||||
subindex === -1 ? this.plugin.settings.menuCommands[menuID["index"]].SubmenuCommands.push(this.item) : this.plugin.settings.menuCommands[menuID['index']].SubmenuCommands[subindex].name = value
|
||||
|
||||
}
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true))
|
||||
.inputEl.addEventListener('keydown', this.submitEnterCallback);
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
export class openSlider extends Modal {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin) {
|
||||
super(plugin.app);
|
||||
this.plugin = plugin;
|
||||
this.containerEl.addClass("cMenuToolbar-Modal");
|
||||
}
|
||||
onOpen() {
|
||||
|
||||
const { contentEl } = this;
|
||||
contentEl.createEl("p", { text:t("Drag the slider to move the position") });
|
||||
|
||||
new SliderComponent(contentEl)
|
||||
.setLimits(2, 18, 0.25)
|
||||
.setValue(this.plugin.settings.cMenuBottomValue)
|
||||
.onChange(debounce(async (value) => {
|
||||
console.log(`%c${value}em`, "color: Violet");
|
||||
this.plugin.settings.cMenuBottomValue = value;
|
||||
setBottomValue(this.plugin.settings);
|
||||
await this.plugin.saveSettings();
|
||||
}, 100, true))
|
||||
.setDynamicTooltip();
|
||||
|
||||
}
|
||||
onClose() {
|
||||
const { contentEl } = this;
|
||||
contentEl.empty();
|
||||
}
|
||||
};
|
741
.obsidian/plugins/obsidian-editing-toolbar/src/plugin/main.ts
vendored
Normal file
741
.obsidian/plugins/obsidian-editing-toolbar/src/plugin/main.ts
vendored
Normal file
@ -0,0 +1,741 @@
|
||||
import {
|
||||
Menu,
|
||||
Plugin,
|
||||
Notice,
|
||||
Command,
|
||||
setIcon,
|
||||
debounce,
|
||||
Editor,
|
||||
MarkdownView,
|
||||
SliderComponent,
|
||||
ToggleComponent,
|
||||
ButtonComponent,
|
||||
requireApiVersion,
|
||||
App,
|
||||
} from "obsidian";
|
||||
import { wait } from "src/util/util";
|
||||
import { appIcons } from "src/icons/appIcons";
|
||||
import { CommandPicker, openSlider } from "src/modals/suggesterModals";
|
||||
import { cMenuToolbarSettingTab } from "src/settings/settingsTab";
|
||||
import { selfDestruct, cMenuToolbarPopover, getModestate, QuiteFormatBrushes, Setfontcolor, Setbackgroundcolor, SetHeader, followingbar, FormatEraser } from "src/modals/cMenuToolbarModal";
|
||||
import { cMenuToolbarSettings, DEFAULT_SETTINGS } from "src/settings/settingsData";
|
||||
import addIcons, {
|
||||
addFeatherIcons,
|
||||
addRemixIcons
|
||||
// addBoxIcons
|
||||
} from "src/icons/customIcons";
|
||||
|
||||
import { setMenuVisibility, setBottomValue } from "src/util/statusBarConstants";
|
||||
import { fullscreenMode, workplacefullscreenMode } from "src/util/fullscreen";
|
||||
import { t } from "src/translations/helper";
|
||||
|
||||
let activeDocument: Document;
|
||||
|
||||
export default class cMenuToolbarPlugin extends Plugin {
|
||||
app: App;
|
||||
settings: cMenuToolbarSettings;
|
||||
statusBarIcon: HTMLElement;
|
||||
cMenuToolbar: HTMLElement;
|
||||
modCommands: Command[] = [
|
||||
{
|
||||
id: "editor:insert-embed",
|
||||
name: "Add embed",
|
||||
icon: "note-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-link",
|
||||
name: "Insert markdown link",
|
||||
icon: "link-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-tag",
|
||||
name: "Add tag",
|
||||
icon: "price-tag-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:insert-wikilink",
|
||||
name: "Add internal link",
|
||||
icon: "bracket-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-bold",
|
||||
name: "Toggle bold",
|
||||
icon: "bold-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-italics",
|
||||
name: "Toggle italics",
|
||||
icon: "italic-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-strikethrough",
|
||||
name: "Toggle strikethrough",
|
||||
icon: "strikethrough-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-code",
|
||||
name: "Toggle code",
|
||||
icon: "code-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-blockquote",
|
||||
name: "Toggle blockquote",
|
||||
icon: "quote-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-bullet-list",
|
||||
name: "Toggle bullet",
|
||||
icon: "bullet-list-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-checklist-status",
|
||||
name: "Toggle checklist status",
|
||||
icon: "checkbox-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-comments",
|
||||
name: "Toggle comment",
|
||||
icon: "percent-sign-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-highlight",
|
||||
name: "Toggle highlight",
|
||||
icon: "highlight-glyph",
|
||||
},
|
||||
{
|
||||
id: "editor:toggle-numbered-list",
|
||||
name: "Toggle numbered list",
|
||||
icon: "number-list-glyph",
|
||||
},
|
||||
];
|
||||
|
||||
|
||||
async onload(): Promise<void> {
|
||||
console.log("cMenuToolbar v" + this.manifest.version + " loaded");
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
await this.loadSettings();
|
||||
addIcons();
|
||||
addFeatherIcons(appIcons);
|
||||
addRemixIcons(appIcons);
|
||||
//addBoxIcons(appIcons);
|
||||
this.generateCommands();
|
||||
this.app.workspace.onLayoutReady(() => {
|
||||
setTimeout(() => {
|
||||
this.setupStatusBar();
|
||||
});
|
||||
});
|
||||
this.registerDomEvent(activeDocument, "mouseup", async (e) => {
|
||||
if (e.button) {
|
||||
if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
}
|
||||
}
|
||||
let view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (!view) { return; };
|
||||
|
||||
//let cmEditor = view.sourceMode.cmEditor;
|
||||
let cmEditor = view.editor;
|
||||
if (cmEditor.hasFocus()) {
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
if (cmEditor.getSelection() == null || cmEditor.getSelection() == "") {
|
||||
this.settings.positionStyle == "following"?cMenuToolbarModalBar.style.visibility = "hidden":true;
|
||||
return
|
||||
} else {
|
||||
if (window.isCTxt) {
|
||||
Setfontcolor(app, this.settings.cMenuFontColor);
|
||||
} else if (window.isBgC) {
|
||||
Setbackgroundcolor(app, this.settings.cMenuBackgroundColor);
|
||||
} else if (window.isText) {
|
||||
FormatEraser();
|
||||
} else if (this.settings.positionStyle == "following") {
|
||||
this.registerDomEvent(activeDocument, "keydown", async (e) => {
|
||||
if (cMenuToolbarModalBar)
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
})
|
||||
|
||||
followingbar(this.settings)
|
||||
}
|
||||
}
|
||||
} else if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
|
||||
}
|
||||
});
|
||||
if (requireApiVersion("0.15.0")) {
|
||||
this.app.workspace.on('window-open', (leaf) => {
|
||||
this.registerDomEvent(leaf.doc, 'mouseup', (e) => {
|
||||
if (e.button) {
|
||||
if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
}
|
||||
}
|
||||
|
||||
let view = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (!view) { return; };
|
||||
//let cmEditor = view.sourceMode.cmEditor;
|
||||
let cmEditor = view.editor;
|
||||
if (cmEditor.hasFocus()) {
|
||||
if (this.settings.positionStyle == "following")
|
||||
followingbar(this.settings)
|
||||
else
|
||||
if (cmEditor.getSelection() == null || cmEditor.getSelection() == "") {
|
||||
return
|
||||
} else {
|
||||
if (window.isCTxt) {
|
||||
Setfontcolor(app, this.settings.cMenuFontColor);
|
||||
} else if (window.isBgC) {
|
||||
Setbackgroundcolor(app, this.settings.cMenuBackgroundColor);
|
||||
} else if (window.isText) {
|
||||
FormatEraser();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} else if (window.isCTxt || window.isBgC || window.isText) {
|
||||
QuiteFormatBrushes();
|
||||
window.newNotice = new Notice(t("Format Brush Off!"));
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
this.addSettingTab(new cMenuToolbarSettingTab(this.app, this));
|
||||
this.registerEvent(this.app.workspace.on("active-leaf-change", this.handlecMenuToolbar));
|
||||
this.registerEvent(this.app.workspace.on("window-open", this.handlecMenuToolbar_pop));
|
||||
this.registerEvent(this.app.workspace.on("layout-change", this.handlecMenuToolbar_layout));
|
||||
this.registerEvent(this.app.workspace.on("resize", this.handlecMenuToolbar_resize));
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
|
||||
|
||||
}
|
||||
|
||||
generateCommands() {
|
||||
//Hide-show menu
|
||||
this.addCommand({
|
||||
id: "hide-show-menu",
|
||||
name: "Hide/show ",
|
||||
icon: "cMenuToolbar",
|
||||
callback: async () => {
|
||||
this.settings.cMenuVisibility = !this.settings.cMenuVisibility;
|
||||
this.settings.cMenuVisibility == true
|
||||
? setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
: setMenuVisibility(this.settings.cMenuVisibility);
|
||||
selfDestruct();
|
||||
await this.saveSettings();
|
||||
},
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'format-eraser',
|
||||
name: 'Format Eraser',
|
||||
callback: () => FormatEraser(),
|
||||
icon: `<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z\"></path></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'change-font-color',
|
||||
name: 'Change font color[html]',
|
||||
callback: () => Setfontcolor(app, this.settings.cMenuFontColor ?? "#2DC26B"),
|
||||
icon: `<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'change-background-color',
|
||||
name: 'Change Backgroundcolor[html]',
|
||||
callback: () => Setbackgroundcolor(app, this.settings.cMenuBackgroundColor ?? "#FA541C"),
|
||||
icon: `<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>`
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'indent-list',
|
||||
name: 'indent list',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
//@ts-ignore
|
||||
return editor.indentList();
|
||||
},
|
||||
icon: "indent-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'undent-list',
|
||||
name: 'unindent-list',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
//@ts-ignore
|
||||
return editor.unindentList();
|
||||
},
|
||||
icon: "unindent-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'editor-undo',
|
||||
name: 'undo editor',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
return editor.undo();
|
||||
},
|
||||
icon: "undo-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'editor-redo',
|
||||
name: 'redo editor',
|
||||
callback: () => {
|
||||
const activeLeaf = this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
return editor.redo();
|
||||
},
|
||||
icon: "redo-glyph"
|
||||
|
||||
});
|
||||
this.addCommand({
|
||||
id: "fullscreen-focus",
|
||||
name: "Fullscreen focus mode",
|
||||
hotkeys: [{ modifiers: ["Mod", "Shift"], key: "F11" }],
|
||||
callback: () => {
|
||||
return fullscreenMode(app)
|
||||
},
|
||||
icon: "fullscreen"
|
||||
});
|
||||
this.addCommand({
|
||||
id: "workplace-fullscreen-focus",
|
||||
name: "workplace-Fullscreen ",
|
||||
callback: () => {
|
||||
return workplacefullscreenMode(app)
|
||||
},
|
||||
hotkeys: [{ modifiers: ['Mod'], key: "F11" }],
|
||||
icon: "remix-SplitCellsHorizontal"
|
||||
});
|
||||
|
||||
this.addCommand({
|
||||
id: 'header0-text',
|
||||
name: 'Remove header level',
|
||||
callback: () => SetHeader(""),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "`" }],
|
||||
icon: "feather-file-text"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header1-text',
|
||||
name: 'Header 1',
|
||||
callback: () => SetHeader("#"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "1" }],
|
||||
icon: "header-1"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header2-text',
|
||||
name: 'Header 2',
|
||||
callback: () => SetHeader("##"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "2" }],
|
||||
icon: "header-2"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header3-text',
|
||||
name: 'Header 3',
|
||||
callback: () => SetHeader("###"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "3" }],
|
||||
icon: "header-3"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header4-text',
|
||||
name: 'Header 4',
|
||||
callback: () => SetHeader("####"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "4" }],
|
||||
icon: "header-4"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header5-text',
|
||||
name: 'Header 5',
|
||||
callback: () => SetHeader("#####"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "5" }],
|
||||
icon: "header-5"
|
||||
});
|
||||
this.addCommand({
|
||||
id: 'header6-text',
|
||||
name: 'Header 6',
|
||||
callback: () => SetHeader("######"),
|
||||
hotkeys: [{ modifiers: ["Mod"], key: "6" }],
|
||||
icon: "header-6"
|
||||
});
|
||||
|
||||
|
||||
const applyCommand = (command: commandPlot, editor: Editor) => {
|
||||
const selectedText = editor.getSelection();
|
||||
const curserStart = editor.getCursor("from");
|
||||
const curserEnd = editor.getCursor("to");
|
||||
let prefix = command.prefix;
|
||||
if (command.islinehead && curserStart.ch > 0) // cursor position is not line head
|
||||
prefix = '\n' + prefix
|
||||
const suffix = command.suffix || prefix;
|
||||
const setCursor = (mode: number) => {
|
||||
editor.setCursor(
|
||||
curserStart.line + command.line * mode,
|
||||
curserEnd.ch + command.char * mode
|
||||
);
|
||||
};
|
||||
const preStart = {
|
||||
line: curserStart.line - command.line,
|
||||
ch: curserStart.ch - prefix.length,
|
||||
};
|
||||
const pre = editor.getRange(preStart, curserStart);
|
||||
|
||||
if (pre == prefix.trimStart()) {
|
||||
const sufEnd = {
|
||||
line: curserStart.line + command.line,
|
||||
ch: curserEnd.ch + suffix.length,
|
||||
};
|
||||
const suf = editor.getRange(curserEnd, sufEnd);
|
||||
if (suf == suffix.trimEnd()) {
|
||||
editor.replaceRange(selectedText, preStart, sufEnd); // codeblock leave blank lines
|
||||
return setCursor(-1);
|
||||
}
|
||||
}
|
||||
editor.replaceSelection(`${prefix}${selectedText}${suffix}`);
|
||||
return setCursor(1);
|
||||
};
|
||||
|
||||
type commandPlot = {
|
||||
char: number;
|
||||
line: number;
|
||||
prefix: string;
|
||||
suffix: string;
|
||||
islinehead: boolean;
|
||||
};
|
||||
|
||||
type commandsPlot = {
|
||||
[key: string]: commandPlot;
|
||||
};
|
||||
|
||||
const commandsMap: commandsPlot = {
|
||||
hrline: {
|
||||
char: 5,
|
||||
line: 1,
|
||||
prefix: "\n---",
|
||||
suffix: "\n",
|
||||
islinehead: true
|
||||
},
|
||||
justify: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"justify\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
left: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"left\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
right: {
|
||||
char: 17,
|
||||
line: 0,
|
||||
prefix: "<p align=\"right\">",
|
||||
suffix: "</p>",
|
||||
islinehead: false,
|
||||
},
|
||||
center: {
|
||||
char: 8,
|
||||
line: 0,
|
||||
prefix: "<center>",
|
||||
suffix: "</center>",
|
||||
islinehead: false,
|
||||
},
|
||||
underline: {
|
||||
char: 3,
|
||||
line: 0,
|
||||
prefix: "<u>",
|
||||
suffix: "</u>",
|
||||
islinehead: false,
|
||||
},
|
||||
superscript: {
|
||||
char: 5,
|
||||
line: 0,
|
||||
prefix: "<sup>",
|
||||
suffix: "</sup>",
|
||||
islinehead: false,
|
||||
},
|
||||
subscript: {
|
||||
char: 5,
|
||||
line: 0,
|
||||
prefix: "<sub>",
|
||||
suffix: "</sub>",
|
||||
islinehead: false,
|
||||
},
|
||||
codeblock: {
|
||||
char: 5,
|
||||
line: 1,
|
||||
prefix: "\n```\n",
|
||||
suffix: "\n```\n",
|
||||
islinehead: false,
|
||||
},
|
||||
};
|
||||
// Add new commands
|
||||
Object.keys(commandsMap).forEach((type) => {
|
||||
this.addCommand({
|
||||
id: `${type}`,
|
||||
name: `Toggle ${type}`,
|
||||
icon: `${type}-glyph`,
|
||||
callback: async () => {
|
||||
const activeLeaf =
|
||||
this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
if (activeLeaf) {
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
applyCommand(commandsMap[type], editor);
|
||||
await wait(10);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
// Enhance editor commands
|
||||
this.modCommands.forEach((type) => {
|
||||
this.addCommand({
|
||||
id: `${type["id"]}`,
|
||||
name: `${type["name"]}`,
|
||||
icon: `${type["icon"]}`,
|
||||
callback: async () => {
|
||||
const activeLeaf =
|
||||
this.app.workspace.getActiveViewOfType(MarkdownView);
|
||||
const view = activeLeaf;
|
||||
const editor = view.editor;
|
||||
editor.getCursor("from");
|
||||
const curserEnd = editor.getCursor("to");
|
||||
let char;
|
||||
`${type["id"]}` == "editor:insert-embed"
|
||||
? (char = 3)
|
||||
: `${type["id"]}` == "editor:insert-link"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:insert-tag"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:insert-wikilink"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-bold"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-italics"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:toggle-strikethrough"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-code"
|
||||
? (char = 1)
|
||||
: `${type["id"]}` == "editor:toggle-blockquote"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-bullet-list"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-checklist-status"
|
||||
? (char = 4)
|
||||
: `${type["id"]}` == "editor:toggle-comments"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-highlight"
|
||||
? (char = 2)
|
||||
: `${type["id"]}` == "editor:toggle-numbered-list"
|
||||
? (char = 3)
|
||||
: (char = 2);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById(`${type["id"]}`);
|
||||
editor.setCursor(curserEnd.line, curserEnd.ch + char);
|
||||
await wait(10);
|
||||
//@ts-ignore
|
||||
app.commands.executeCommandById("editor:focus");
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
setupStatusBar() {
|
||||
addIcons();
|
||||
this.statusBarIcon = this.addStatusBarItem();
|
||||
this.statusBarIcon.addClass("cMenuToolbar-statusbar-button");
|
||||
setIcon(this.statusBarIcon, "cMenuToolbar");
|
||||
|
||||
this.registerDomEvent(this.statusBarIcon, "click", () => {
|
||||
const statusBarRect =
|
||||
this.statusBarIcon.parentElement.getBoundingClientRect();
|
||||
const statusBarIconRect = this.statusBarIcon.getBoundingClientRect();
|
||||
|
||||
const menu = new Menu().addItem((item) => {
|
||||
item.setTitle(t("Hide & Show"));
|
||||
requireApiVersion("0.15.0")?item.setSection("settings"):true;
|
||||
const itemDom = (item as any).dom as HTMLElement;
|
||||
const toggleComponent = new ToggleComponent(itemDom)
|
||||
.setValue(this.settings.cMenuVisibility)
|
||||
.setDisabled(true);
|
||||
|
||||
const toggle = async () => {
|
||||
this.settings.cMenuVisibility = !this.settings.cMenuVisibility;
|
||||
toggleComponent.setValue(this.settings.cMenuVisibility);
|
||||
this.settings.cMenuVisibility == true
|
||||
? setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
: setMenuVisibility(this.settings.cMenuVisibility);
|
||||
selfDestruct();
|
||||
await this.saveSettings();
|
||||
};
|
||||
|
||||
item.onClick((e) => {
|
||||
e.preventDefault();
|
||||
e.stopImmediatePropagation();
|
||||
toggle();
|
||||
});
|
||||
});
|
||||
|
||||
const menuDom = (menu as any).dom as HTMLElement;
|
||||
menuDom.addClass("cMenuToolbar-statusbar-menu");
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("cMenuToolbarAdd");
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
item.onClick(() => {
|
||||
new CommandPicker(this).open();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("cMenuToolbarReload");
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
|
||||
item.onClick(() => {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%ccMenuToolbar refreshed`, "color: Violet");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
menu.addItem((item) => {
|
||||
|
||||
item.setIcon("sliders")
|
||||
requireApiVersion("0.15.0")?item.setSection("ButtonAdd"):true;
|
||||
item.onClick(() => {
|
||||
|
||||
new openSlider(this.app, this).open();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
menu.showAtPosition({
|
||||
x: statusBarIconRect.right + 5,
|
||||
y: statusBarRect.top - 5,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
onunload(): void {
|
||||
selfDestruct();
|
||||
console.log("cMenuToolbar unloaded");
|
||||
this.app.workspace.off("active-leaf-change", this.handlecMenuToolbar);
|
||||
this.app.workspace.off("window-open", this.handlecMenuToolbar_pop);
|
||||
this.app.workspace.off("layout-change", this.handlecMenuToolbar_layout);
|
||||
this.app.workspace.off("resize", this.handlecMenuToolbar_resize);
|
||||
}
|
||||
|
||||
|
||||
handlecMenuToolbar = () => {
|
||||
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
|
||||
cMenuToolbarPopover(this.app, this)
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
handlecMenuToolbar_pop = () => {
|
||||
|
||||
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
setTimeout(() => {
|
||||
selfDestruct();
|
||||
cMenuToolbarPopover(this.app, this)
|
||||
}, 400);
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
handlecMenuToolbar_layout = () => {
|
||||
let isource = getModestate(app);
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
let cMenuToolbarModalBar = activeDocument.getElementById(
|
||||
"cMenuToolbarModalBar"
|
||||
);
|
||||
if (!getModestate(app)) //no source mode
|
||||
{
|
||||
if (cMenuToolbarModalBar) {
|
||||
cMenuToolbarModalBar.style.visibility = "hidden"
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (cMenuToolbarModalBar) {
|
||||
cMenuToolbarModalBar.style.visibility = "visibility"
|
||||
} else {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
handlecMenuToolbar_resize = () => {
|
||||
requireApiVersion("0.15.0") ? activeDocument = activeWindow.document : activeDocument = window.document;
|
||||
if (this.settings.cMenuVisibility == true) {
|
||||
if (getModestate(app)) {
|
||||
let currentleaf = activeDocument.body
|
||||
?.querySelector(".workspace-leaf.mod-active");
|
||||
|
||||
let leafwidth = currentleaf?.querySelector<HTMLElement>(".markdown-source-view").offsetWidth ?? 0
|
||||
|
||||
if (this.settings.cMenuWidth && leafwidth) {
|
||||
if ((leafwidth - this.settings.cMenuWidth) < 78 && (leafwidth > this.settings.cMenuWidth))
|
||||
return;
|
||||
else {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
async loadSettings() {
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, await this.loadData());
|
||||
}
|
||||
|
||||
async saveSettings() {
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
}
|
219
.obsidian/plugins/obsidian-editing-toolbar/src/settings/settingsData.ts
vendored
Normal file
219
.obsidian/plugins/obsidian-editing-toolbar/src/settings/settingsData.ts
vendored
Normal file
@ -0,0 +1,219 @@
|
||||
import type { Command } from "obsidian";
|
||||
export const APPEND_METHODS = ["body", "workspace"];
|
||||
export const AESTHETIC_STYLES = ["glass", "default", "tiny"];
|
||||
export const POSITION_STYLES = ["fixed", "following", "top"];
|
||||
|
||||
|
||||
|
||||
declare module 'obsidian' {
|
||||
export interface Command {
|
||||
SubmenuCommands?: Command[];
|
||||
}
|
||||
}
|
||||
export interface cMenuToolbarSettings {
|
||||
cMenuWidth: number;
|
||||
cMenuFontColor: string;
|
||||
cMenuBackgroundColor: string;
|
||||
aestheticStyle: string;
|
||||
positionStyle: string;
|
||||
menuCommands: Command[];
|
||||
appendMethod: string;
|
||||
shouldShowMenuOnSelect: boolean;
|
||||
cMenuVisibility: boolean;
|
||||
cMenuBottomValue: number;
|
||||
cMenuNumRows: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: cMenuToolbarSettings = {
|
||||
aestheticStyle: "default",
|
||||
positionStyle: "top",
|
||||
menuCommands: [
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:editor-undo',
|
||||
name: 'undo editor',
|
||||
icon: "undo-glyph"
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:editor-redo',
|
||||
name: 'redo editor',
|
||||
icon: "redo-glyph"
|
||||
},
|
||||
{
|
||||
"id": "obsidian-editing-toolbar:format-eraser",
|
||||
"name": "Clear text formatting",
|
||||
"icon": "<svg width=\"18\" height=\"18\" focusable=\"false\" fill=\"currentColor\" viewBox=\"0 0 1024 1024\"><g transform=\"scale(1, -1) translate(0, -896) scale(0.9, 0.9) \"><path class=\"path\" d=\"M889 512 l-211 211 q-26 27 -61 36 q-35 9 -70 0 q-35 -9 -61 -36 l-351 -350 q-26 -27 -35.5 -62 q-9.5 -35 0 -70 q9.5 -35 35.5 -61 l170 -170 q12 -12 29 -12 l215 0 q17 0 29 12 l311 310 q26 26 35.5 61 q9.5 35 0 70 q-9.5 35 -35.5 61 ZM831 453 q15 -15 15.5 -36.5 q0.5 -21.5 -14.5 -37.5 l-300 -298 l-181 0 l-158 158 q-15 15 -15 37 q0 22 15 38 l351 351 q16 16 38 16 q22 0 37 -16 l212 -212 ZM686 217 l-59 -59 l-317 315 l58 59 l318 -315 ZM883 81 q18 0 30.5 -12 q12.5 -12 12.5 -29 q0 -17 -12.5 -29 q-12.5 -12 -29.5 -13 l-456 0 q-17 0 -29.5 12 q-12.5 12 -12.5 29 q0 17 12 29 q12 12 29 13 l456 0 Z\"></path></g></svg>"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header2-text",
|
||||
name: "Header 2",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "2"
|
||||
}
|
||||
],
|
||||
icon: "header-2"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header3-text",
|
||||
name: "Header 3",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "3"
|
||||
}
|
||||
],
|
||||
icon: "header-3"
|
||||
},
|
||||
{
|
||||
id: "SubmenuCommands-header",
|
||||
name: "submenu",
|
||||
icon: "header-n",
|
||||
SubmenuCommands: [
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header1-text",
|
||||
name: "Header 1",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "1"
|
||||
}
|
||||
],
|
||||
icon: "header-1"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header4-text",
|
||||
name: "Header 4",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "4"
|
||||
}
|
||||
],
|
||||
icon: "header-4"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header5-text",
|
||||
name: "Header 5",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "5"
|
||||
}
|
||||
],
|
||||
icon: "header-5"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:header6-text",
|
||||
name: "Header 6",
|
||||
hotkeys: [
|
||||
{
|
||||
"modifiers": [
|
||||
"Mod"
|
||||
],
|
||||
"key": "6"
|
||||
}
|
||||
],
|
||||
icon: "header-6"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-bold",
|
||||
name: "Toggle bold",
|
||||
icon: "bold-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-italics",
|
||||
name: "Toggle italics",
|
||||
icon: "italic-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-strikethrough",
|
||||
name: "Toggle strikethrough",
|
||||
icon: "strikethrough-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:underline",
|
||||
name: "Toggle underline",
|
||||
icon: "underline-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:superscript",
|
||||
name: "Toggle superscript",
|
||||
icon: "superscript-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:subscript",
|
||||
name: "Toggle subscript",
|
||||
icon: "subscript-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-code",
|
||||
name: "Toggle code",
|
||||
icon: "code-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:codeblock",
|
||||
name: "Toggle codeblock",
|
||||
icon: "codeblock-glyph",
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:editor:toggle-blockquote",
|
||||
name: "Toggle blockquote",
|
||||
icon: "quote-glyph",
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:indent-list',
|
||||
name: 'indent list',
|
||||
icon: "indent-glyph"
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:undent-list',
|
||||
name: 'unindent-list',
|
||||
icon: "unindent-glyph"
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:change-font-color',
|
||||
name: 'Change font color[html]',
|
||||
icon: `<svg width="24" height="24" focusable="false" fill="currentColor"><g fill-rule="evenodd"><path id="change-font-color-icon" d="M3 18h18v3H3z" style="fill:#2DC26B"></path><path d="M8.7 16h-.8a.5.5 0 01-.5-.6l2.7-9c.1-.3.3-.4.5-.4h2.8c.2 0 .4.1.5.4l2.7 9a.5.5 0 01-.5.6h-.8a.5.5 0 01-.4-.4l-.7-2.2c0-.3-.3-.4-.5-.4h-3.4c-.2 0-.4.1-.5.4l-.7 2.2c0 .3-.2.4-.4.4zm2.6-7.6l-.6 2a.5.5 0 00.5.6h1.6a.5.5 0 00.5-.6l-.6-2c0-.3-.3-.4-.5-.4h-.4c-.2 0-.4.1-.5.4z"></path></g></svg>`
|
||||
|
||||
},
|
||||
{
|
||||
id: 'obsidian-editing-toolbar:change-background-color',
|
||||
name: 'Change Backgroundcolor[html]',
|
||||
icon: `<svg width="18" height="24" viewBox="0 0 256 256" version="1.1" xmlns="http://www.w3.org/2000/svg"><g stroke="none" stroke-width="1" fill="currentColor" fill-rule="evenodd"><g ><g fill="currentColor"><g transform="translate(119.502295, 137.878331) rotate(-135.000000) translate(-119.502295, -137.878331) translate(48.002295, 31.757731)" ><path d="M100.946943,60.8084699 L43.7469427,60.8084699 C37.2852111,60.8084699 32.0469427,66.0467383 32.0469427,72.5084699 L32.0469427,118.70847 C32.0469427,125.170201 37.2852111,130.40847 43.7469427,130.40847 L100.946943,130.40847 C107.408674,130.40847 112.646943,125.170201 112.646943,118.70847 L112.646943,72.5084699 C112.646943,66.0467383 107.408674,60.8084699 100.946943,60.8084699 Z M93.646,79.808 L93.646,111.408 L51.046,111.408 L51.046,79.808 L93.646,79.808 Z" fill-rule="nonzero"></path><path d="M87.9366521,16.90916 L87.9194966,68.2000001 C87.9183543,69.4147389 86.9334998,70.399264 85.7187607,70.4 L56.9423078,70.4 C55.7272813,70.4 54.7423078,69.4150264 54.7423078,68.2 L54.7423078,39.4621057 C54.7423078,37.2523513 55.5736632,35.1234748 57.0711706,33.4985176 L76.4832996,12.4342613 C78.9534987,9.75382857 83.1289108,9.5834005 85.8093436,12.0535996 C87.1658473,13.303709 87.9372691,15.0644715 87.9366521,16.90916 Z" fill-rule="evenodd"></path><path d="M131.3,111.241199 L11.7,111.241199 C5.23826843,111.241199 0,116.479467 0,122.941199 L0,200.541199 C0,207.002931 5.23826843,212.241199 11.7,212.241199 L131.3,212.241199 C137.761732,212.241199 143,207.002931 143,200.541199 L143,122.941199 C143,116.479467 137.761732,111.241199 131.3,111.241199 Z M124,130.241 L124,193.241 L19,193.241 L19,130.241 L124,130.241 Z" fill-rule="nonzero"></path></g></g><path d="M51,218 L205,218 C211.075132,218 216,222.924868 216,229 C216,235.075132 211.075132,240 205,240 L51,240 C44.9248678,240 40,235.075132 40,229 C40,222.924868 44.9248678,218 51,218 Z" id="change-background-color-icon" style="fill:#FA541C"></path></g></g></svg>`
|
||||
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:fullscreen-focus",
|
||||
name: "Fullscreen focus mode",
|
||||
icon: "fullscreen"
|
||||
},
|
||||
{
|
||||
id: "obsidian-editing-toolbar:workplace-fullscreen-focus",
|
||||
name: "workplace-Fullscreen ",
|
||||
icon: "remix-SplitCellsHorizontal"
|
||||
},
|
||||
],
|
||||
appendMethod: "workspace",
|
||||
shouldShowMenuOnSelect: false,
|
||||
cMenuVisibility: true,
|
||||
cMenuBottomValue: 4.25,
|
||||
cMenuNumRows: 12,
|
||||
cMenuWidth: 300,
|
||||
cMenuFontColor: "#2DC26B",
|
||||
cMenuBackgroundColor: "#d3f8b6"
|
||||
};
|
466
.obsidian/plugins/obsidian-editing-toolbar/src/settings/settingsTab.ts
vendored
Normal file
466
.obsidian/plugins/obsidian-editing-toolbar/src/settings/settingsTab.ts
vendored
Normal file
@ -0,0 +1,466 @@
|
||||
import type cMenuToolbarPlugin from "src/plugin/main";
|
||||
import { CommandPicker,ChooseFromIconList, ChangeCmdname } from "src/modals/suggesterModals";
|
||||
import { App, Setting, PluginSettingTab, Command } from "obsidian";
|
||||
import { APPEND_METHODS, AESTHETIC_STYLES, POSITION_STYLES } from "src/settings/settingsData";
|
||||
import { selfDestruct, cMenuToolbarPopover, checksvg } from "src/modals/cMenuToolbarModal";
|
||||
import Sortable from "sortablejs";
|
||||
import { debounce } from "obsidian";
|
||||
import { GenNonDuplicateID } from "src/util/util";
|
||||
import { t } from 'src/translations/helper';
|
||||
|
||||
export function getComandindex(item: any,arr: any[]):number
|
||||
{
|
||||
let idx;
|
||||
arr.forEach((el,index) => {
|
||||
if (el.id === item) {
|
||||
idx =index;
|
||||
}
|
||||
});
|
||||
return idx;
|
||||
}
|
||||
|
||||
export class cMenuToolbarSettingTab extends PluginSettingTab {
|
||||
plugin: cMenuToolbarPlugin;
|
||||
appendMethod: string;
|
||||
|
||||
constructor(app: App, plugin: cMenuToolbarPlugin) {
|
||||
super(app, plugin);
|
||||
this.plugin = plugin;
|
||||
addEventListener("cMenuToolbar-NewCommand", () => {
|
||||
selfDestruct();
|
||||
cMenuToolbarPopover(app, this.plugin);
|
||||
this.display();
|
||||
});
|
||||
}
|
||||
|
||||
display(): void {
|
||||
const { containerEl } = this;
|
||||
containerEl.empty();
|
||||
containerEl.createEl("h1", { text: "Obsidian Editing Toolbar" });
|
||||
containerEl.createEl("span", { text: " 原创: " }).createEl("a", {
|
||||
text: "Chetachi 👩🏽💻",
|
||||
href: "https://github.com/chetachiezikeuzor",
|
||||
});
|
||||
containerEl.createEl("span", { text: " 修改者: " }).createEl("a", {
|
||||
text: "Cuman ✨",
|
||||
href: "https://github.com/cumany",
|
||||
});
|
||||
containerEl.createEl("h2", { text: t("Plugin Settings") });
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar append method'))
|
||||
.setDesc(
|
||||
t('Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let methods: Record<string, string> = {};
|
||||
APPEND_METHODS.map((method) => (methods[method] = method));
|
||||
dropdown.addOptions(methods);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.appendMethod)
|
||||
.onChange((appendMethod) => {
|
||||
this.plugin.settings.appendMethod = appendMethod;
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar aesthetic')
|
||||
)
|
||||
.setDesc(
|
||||
t('Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let aesthetics: Record<string, string> = {};
|
||||
AESTHETIC_STYLES.map(
|
||||
(aesthetic) => (aesthetics[aesthetic] = aesthetic)
|
||||
);
|
||||
dropdown.addOptions(aesthetics);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.aestheticStyle)
|
||||
.onChange((aestheticStyle: string) => {
|
||||
this.plugin.settings.aestheticStyle = aestheticStyle;
|
||||
this.plugin.saveSettings();
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar position')
|
||||
)
|
||||
.setDesc(t('Choose between fixed position or cursor following mode.')
|
||||
)
|
||||
.addDropdown((dropdown) => {
|
||||
let posotions: Record<string, string> = {};
|
||||
POSITION_STYLES.map((posotion: string) => (posotions[posotion] = posotion));
|
||||
dropdown.addOptions(posotions);
|
||||
dropdown
|
||||
.setValue(this.plugin.settings.positionStyle)
|
||||
.onChange((positionStyle: string) => {
|
||||
this.plugin.settings.positionStyle = positionStyle;
|
||||
this.plugin.saveSettings();
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar columns')
|
||||
)
|
||||
.setDesc(
|
||||
t('Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.')
|
||||
)
|
||||
.addSlider((slider) => {
|
||||
slider
|
||||
.setLimits(1, 32, 1)
|
||||
.setValue(this.plugin.settings.cMenuNumRows)
|
||||
.onChange(
|
||||
debounce(
|
||||
async (value: number) => {
|
||||
this.plugin.settings.cMenuNumRows = value;
|
||||
await this.plugin.saveSettings();
|
||||
},
|
||||
100,
|
||||
true
|
||||
)
|
||||
)
|
||||
.setDynamicTooltip();
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar refresh')
|
||||
)
|
||||
.setDesc(
|
||||
t("Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.")
|
||||
)
|
||||
.addButton((reloadButton) => {
|
||||
reloadButton
|
||||
.setIcon("cMenuToolbarReload")
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonRefresh")
|
||||
.setTooltip(t("Refresh"))
|
||||
.onClick(() => {
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%ccMenuToolbar refreshed`, "color: Violet");
|
||||
});
|
||||
});
|
||||
new Setting(containerEl)
|
||||
.setName(t('Editing Toolbar commands')
|
||||
)
|
||||
.setDesc(
|
||||
t("Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.")
|
||||
)
|
||||
.addButton((addButton) => {
|
||||
addButton
|
||||
.setIcon("cMenuToolbarAdd")
|
||||
.setTooltip(t("Add"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonAdd")
|
||||
.onClick(() => {
|
||||
new CommandPicker(this.plugin).open();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
});
|
||||
});
|
||||
const cMenuToolbarCommandsContainer = containerEl.createEl("div", {
|
||||
cls: "cMenuToolbarSettingsTabsContainer",
|
||||
});
|
||||
let dragele = "";
|
||||
Sortable.create(cMenuToolbarCommandsContainer, {
|
||||
group: "item",
|
||||
animation: 500,
|
||||
draggable: ".setting-item",
|
||||
ghostClass: "sortable-ghost",
|
||||
chosenClass: "sortable-chosen",
|
||||
dragClass: "sortable-drag",
|
||||
dragoverBubble: false,
|
||||
forceFallback: true,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.7,
|
||||
fallbackClass: "sortable-fallback",
|
||||
easing: "cubic-bezier(1, 0, 0, 1)",
|
||||
onSort: (command) => {
|
||||
if (command.from.className === command.to.className) {
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
const [removed] = arrayResult.splice(command.oldIndex, 1)
|
||||
arrayResult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 300);
|
||||
},
|
||||
onStart: function (evt) {
|
||||
dragele = evt.item.className;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.plugin.settings.menuCommands.forEach((newCommand, index) => {
|
||||
const setting = new Setting(cMenuToolbarCommandsContainer)
|
||||
|
||||
if ("SubmenuCommands" in newCommand) {
|
||||
|
||||
setting.settingEl.setAttribute("data-id", newCommand.id)
|
||||
setting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setClass("cMenuToolbarCommandsubItem")
|
||||
.setName(newCommand.name)
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async() => {
|
||||
new ChooseFromIconList(this.plugin, newCommand, false).open();
|
||||
});
|
||||
checksvg(newCommand.icon) ? addicon.buttonEl.innerHTML = newCommand.icon : addicon.setIcon(newCommand.icon)
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async() => {
|
||||
this.plugin.settings.menuCommands.remove(newCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
if (newCommand.id == "cMenuToolbar-plugin:change-font-color") return; //修改字体颜色指令单独处理
|
||||
if (newCommand.id == "cMenuToolbar-plugin:change-background-color") return; //修改字体颜色指令单独处理
|
||||
|
||||
const cMenuToolbarCommandsContainer_sub = setting.settingEl.createEl("div", {
|
||||
cls: "cMenuToolbarSettingsTabsContainer_sub",
|
||||
});
|
||||
Sortable.create(cMenuToolbarCommandsContainer_sub, {
|
||||
group: {
|
||||
name: "item",
|
||||
pull: true,
|
||||
put: function () {
|
||||
if (dragele.includes("cMenuToolbarCommandsubItem"))
|
||||
return false;
|
||||
else return true;
|
||||
}
|
||||
|
||||
},
|
||||
draggable: ".setting-item",
|
||||
animation: 150,
|
||||
ghostClass: "sortable-ghost",
|
||||
chosenClass: "sortable-chosen",
|
||||
dragClass: "sortable-drag",
|
||||
dragoverBubble: false,
|
||||
fallbackOnBody: true,
|
||||
swapThreshold: 0.7,
|
||||
forceFallback: true,
|
||||
fallbackClass: "sortable-fallback",
|
||||
easing: "cubic-bezier(1, 0, 0, 1)",
|
||||
onStart: function (evt) {
|
||||
// console.log(evt);
|
||||
},
|
||||
onSort: (command) => {
|
||||
|
||||
|
||||
if (command.from.className === command.to.className) {
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
const subresult = arrayResult[index]?.SubmenuCommands;
|
||||
|
||||
|
||||
if (subresult) {
|
||||
|
||||
const [removed] = subresult.splice(command.oldIndex, 1);
|
||||
subresult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
} else
|
||||
if (command.to.className === "cMenuToolbarSettingsTabsContainer") {
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
let cmdindex = getComandindex(command.path[1].dataset["id"], arrayResult);
|
||||
|
||||
const subresult = arrayResult[cmdindex]?.SubmenuCommands;
|
||||
|
||||
|
||||
const [removed] = subresult.splice(command.oldIndex, 1);
|
||||
arrayResult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
} else
|
||||
if (command.from.className === "cMenuToolbarSettingsTabsContainer") {
|
||||
|
||||
|
||||
const arrayResult = this.plugin.settings.menuCommands;
|
||||
|
||||
let cmdindex = getComandindex(command.path[1].dataset["id"], arrayResult);
|
||||
|
||||
const subresult = arrayResult[cmdindex]?.SubmenuCommands;
|
||||
const [removed] = arrayResult.splice(command.oldIndex, 1);
|
||||
subresult.splice(command.newIndex, 0, removed);
|
||||
this.plugin.saveSettings();
|
||||
}
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 300);
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
newCommand.SubmenuCommands.forEach((subCommand: Command) => {
|
||||
const subsetting = new Setting(cMenuToolbarCommandsContainer_sub)
|
||||
|
||||
subsetting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async()=> {
|
||||
new ChooseFromIconList(this.plugin, subCommand, true).open();
|
||||
});
|
||||
|
||||
checksvg(subCommand?.icon) ? addicon.buttonEl.innerHTML = subCommand.icon : addicon.setIcon(subCommand.icon)
|
||||
})
|
||||
.setName(subCommand.name)
|
||||
.addButton((changename) => {
|
||||
changename
|
||||
.setIcon("pencil")
|
||||
.setTooltip(t("Change Command name"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.onClick(async()=> {
|
||||
new ChangeCmdname(this.app, this.plugin, subCommand, true).open();
|
||||
});
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async()=> {
|
||||
newCommand.SubmenuCommands.remove(subCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
subsetting.nameEl;
|
||||
});
|
||||
} else {
|
||||
setting
|
||||
.addButton((addicon) => {
|
||||
addicon
|
||||
// .setIcon(newCommand.icon)
|
||||
.setClass("cMenuToolbarSettingsIcon")
|
||||
.onClick(async()=> {
|
||||
new ChooseFromIconList(this.plugin, newCommand, false).open();
|
||||
});
|
||||
checksvg(newCommand.icon) ? addicon.buttonEl.innerHTML = newCommand.icon : addicon.setIcon(newCommand.icon)
|
||||
})
|
||||
|
||||
if (newCommand.id == "cMenuToolbar-Divider-Line") setting.setClass("cMenuToolbar-Divider-Line")
|
||||
setting
|
||||
.setClass("cMenuToolbarCommandItem")
|
||||
.setName(newCommand.name)
|
||||
.addButton((changename) => {
|
||||
changename
|
||||
.setIcon("pencil")
|
||||
.setTooltip(t("Change Command name"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.onClick(async()=> {
|
||||
new ChangeCmdname(this.app, this.plugin, newCommand, false).open();
|
||||
});
|
||||
})
|
||||
.addButton((addsubButton) => {
|
||||
addsubButton
|
||||
.setIcon("cMenuToolbarSub")
|
||||
.setTooltip(t("Add submenu"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonaddsub")
|
||||
.onClick(async()=> {
|
||||
const submenu =
|
||||
{ id: "SubmenuCommands-" + GenNonDuplicateID(1), name: "submenu", icon: "remix-Filter3Line", SubmenuCommands: [] };
|
||||
this.plugin.settings.menuCommands.splice(index + 1, 0, submenu);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${submenu.id}' add `, "color: #989cab");
|
||||
});
|
||||
})
|
||||
.addButton((addsubButton) => {
|
||||
addsubButton
|
||||
.setIcon("vertical-split")
|
||||
.setTooltip(t("add hr"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonaddsub")
|
||||
.onClick(async()=> {
|
||||
const dividermenu =
|
||||
{ id: "cMenuToolbar-Divider-Line", name: "HR", icon: "vertical-split" };
|
||||
this.plugin.settings.menuCommands.splice(index + 1, 0, dividermenu);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
|
||||
});
|
||||
})
|
||||
.addButton((deleteButton) => {
|
||||
deleteButton
|
||||
.setIcon("cMenuToolbarDelete")
|
||||
.setTooltip(t("Delete"))
|
||||
.setClass("cMenuToolbarSettingsButton")
|
||||
.setClass("cMenuToolbarSettingsButtonDelete")
|
||||
.onClick(async()=> {
|
||||
this.plugin.settings.menuCommands.remove(newCommand);
|
||||
await this.plugin.saveSettings();
|
||||
this.display();
|
||||
setTimeout(() => {
|
||||
dispatchEvent(new Event("cMenuToolbar-NewCommand"));
|
||||
}, 100);
|
||||
console.log(`%cCommand '${newCommand.name}' was removed from cMenuToolbar`, "color: #989cab");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
// setting.nameEl;
|
||||
});
|
||||
|
||||
const cDonationDiv = containerEl.createEl("div", {
|
||||
cls: "cDonationSection",
|
||||
});
|
||||
|
||||
const credit = createEl("p");
|
||||
const donateText = createEl("p");
|
||||
donateText.appendText(
|
||||
"If you like this Plugin and are considering donating to support continued development, use the button below!"
|
||||
);
|
||||
credit.setAttribute("style", "color: var(--text-muted)");
|
||||
cDonationDiv.appendChild(donateText);
|
||||
cDonationDiv.appendChild(credit);
|
||||
|
||||
cDonationDiv.appendChild(
|
||||
createDonateButton("https://www.buymeacoffee.com/cuman")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const createDonateButton = (link: string): HTMLElement => {
|
||||
const a = createEl("a");
|
||||
a.setAttribute("href", link);
|
||||
a.addClass("buymeacoffee-img");
|
||||
a.innerHTML = `<img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee &emoji=&slug=Cuman&button_colour=BD5FFF&font_colour=ffffff&font_family=Poppins&outline_colour=000000&coffee_colour=FFDD00" />`;
|
||||
return a;
|
||||
};
|
||||
|
||||
|
||||
|
59
.obsidian/plugins/obsidian-editing-toolbar/src/translations/helper.ts
vendored
Normal file
59
.obsidian/plugins/obsidian-editing-toolbar/src/translations/helper.ts
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
// Code from https://github.com/valentine195/obsidian-admonition/blob/master/src/lang/helpers.ts
|
||||
|
||||
import { moment } from 'obsidian';
|
||||
|
||||
import ar from './locale/ar';
|
||||
import cz from './locale/cz';
|
||||
import da from './locale/da';
|
||||
import de from './locale/de';
|
||||
import en from './locale/en';
|
||||
import enGB from './locale/en-gb';
|
||||
import es from './locale/es';
|
||||
import fr from './locale/fr';
|
||||
import hi from './locale/hi';
|
||||
import id from './locale/id';
|
||||
import it from './locale/it';
|
||||
import ja from './locale/ja';
|
||||
import ko from './locale/ko';
|
||||
import nl from './locale/nl';
|
||||
import no from './locale/no';
|
||||
import pl from './locale/pl';
|
||||
import pt from './locale/pt';
|
||||
import ptBR from './locale/pt-br';
|
||||
import ro from './locale/ro';
|
||||
import ru from './locale/ru';
|
||||
import tr from './locale/tr';
|
||||
import zhCN from './locale/zh-cn';
|
||||
import zhTW from './locale/zh-tw';
|
||||
|
||||
const localeMap: { [k: string]: Partial<typeof en> } = {
|
||||
ar,
|
||||
cs: cz,
|
||||
da,
|
||||
de,
|
||||
en,
|
||||
'en-gb': enGB,
|
||||
es,
|
||||
fr,
|
||||
hi,
|
||||
id,
|
||||
it,
|
||||
ja,
|
||||
ko,
|
||||
nl,
|
||||
nn: no,
|
||||
pl,
|
||||
pt,
|
||||
'pt-br': ptBR,
|
||||
ro,
|
||||
ru,
|
||||
tr,
|
||||
'zh-cn': zhCN,
|
||||
'zh-tw': zhTW,
|
||||
};
|
||||
|
||||
const locale = localeMap[moment.locale()];
|
||||
|
||||
export function t(str: keyof typeof en): string {
|
||||
return (locale && locale[str]) || en[str];
|
||||
}
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ar.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ar.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// العربية
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/cz.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/cz.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// čeština
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/da.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/da.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Dansk
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/de.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/de.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Deutsch
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/en-gb.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/en-gb.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// British English
|
||||
|
||||
export default {};
|
35
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/en.ts
vendored
Normal file
35
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/en.ts
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
export default {
|
||||
'Editing Toolbar append method':'Editing Toolbar append method',
|
||||
'Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.':'Choose where Editing Toolbar will append upon regeneration. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar aesthetic':'Editing Toolbar aesthetic',
|
||||
'Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.':'Choose between a glass morphism ,tiny and default style for Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar position':'Editing Toolbar position',
|
||||
'Choose between fixed position or cursor following mode.':'Choose between fixed position or cursor following mode.',
|
||||
'Editing Toolbar columns':'Editing Toolbar columns',
|
||||
'Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.':'Choose the number of columns per row to display on Editing Toolbar. To see the change, hit the refresh button below, or in the status bar menu.',
|
||||
'Editing Toolbar refresh':'Editing Toolbar refresh',
|
||||
'Editing Toolbar commands':'Editing Toolbar commands',
|
||||
"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.":"Add a command onto Editing Toolbar from Obsidian's commands library. To reorder the commands, drag and drop the command items. To delete them, use the delete buttom to the right of the command item. Editing Toolbar will not automaticaly refresh after reordering commands. Use the refresh button above.",
|
||||
'Format Brush Off!':'Format Brush Off!',
|
||||
'Hide & Show':'Hide & Show',
|
||||
'Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.':'Editing Toolbar will only refresh automatically after you have either added or deleted a command from it. To see UI changes to cMenuToolbar (above settings changes) use the refresh button. If you forget to refresh in settings, no worries. There is also a refresh button in the cMenuToolbar status bar menu.',
|
||||
'Font-Color formatting brush ON!':'Font-Color formatting brush ON!',
|
||||
'More':'More',
|
||||
'Font Colors':'Font Colors',
|
||||
'Format Brush':'Format Brush',
|
||||
'Background color':'Background color',
|
||||
'Refresh':'Refresh',
|
||||
'Add':'Add',
|
||||
'Delete':'Delete',
|
||||
'Change Command name':'Change Command name',
|
||||
'Add submenu':'Add submenu',
|
||||
'add hr':'add hr',
|
||||
'Enter the icon code, it looks like <svg>.... </svg> format':'Enter the icon code, it looks like <svg>.... </svg> format',
|
||||
'Please enter a new name:':'Please enter a new name:',
|
||||
'Drag the slider to move the position':'Drag the slider to move the position',
|
||||
'Plugin Settings':'Plugin Settings',
|
||||
'Background-color formatting brush ON!':'Background-color formatting brush ON!',
|
||||
'Clear formatting brush ON!':'Clear formatting brush ON!',
|
||||
'Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush':'Clear formatting brush ON!\nClick the mouse middle or right key to close the formatting-brush',
|
||||
|
||||
};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/es.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/es.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Español
|
||||
|
||||
export default {};
|
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/fr.ts
vendored
Normal file
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/fr.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/hi.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/hi.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// हिन्दी
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/id.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/id.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Bahasa Indonesia
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/it.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/it.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Italiano
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ja.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ja.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// 日本語
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ko.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ko.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// 한국어
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/nl.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/nl.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Nederlands
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/no.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/no.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Norsk
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pl.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pl.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// język polski
|
||||
|
||||
export default {};
|
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pt-br.ts
vendored
Normal file
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pt-br.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export default {};
|
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pt.ts
vendored
Normal file
1
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/pt.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ro.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ro.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// Română
|
||||
|
||||
export default {};
|
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ru.ts
vendored
Normal file
3
.obsidian/plugins/obsidian-editing-toolbar/src/translations/locale/ru.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
// русский
|
||||
|
||||
export default {};
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user