mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
578953b083
commit
420ac3d9b5
10 changed files with 56 additions and 13 deletions
|
|
@ -249,7 +249,8 @@
|
||||||
"copyProtocol": "Copy block hyperlink",
|
"copyProtocol": "Copy block hyperlink",
|
||||||
"uploadAssets2CDN": "Upload asset files to cloud",
|
"uploadAssets2CDN": "Upload asset files to cloud",
|
||||||
"notSupport1": "Does not support drag and drop across notebooks",
|
"notSupport1": "Does not support drag and drop across notebooks",
|
||||||
"keymapTip": "After the shortcut keys are modified, they need to be restarted to take effect",
|
"keymapTip": "After some shortcut keys are modified, you need to click the refresh button to take effect",
|
||||||
|
"keymapTip2": "Use default shortcut keys",
|
||||||
"searchLimit": "The number of search results displayed",
|
"searchLimit": "The number of search results displayed",
|
||||||
"searchLimit1": "If the amount of data is large, do not configure the value too large, the default is <code>64</code>",
|
"searchLimit1": "If the amount of data is large, do not configure the value too large, the default is <code>64</code>",
|
||||||
"searchCaseSensitive": "Case Sensitive",
|
"searchCaseSensitive": "Case Sensitive",
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,8 @@
|
||||||
"copyProtocol": "Copier bloc d'hyperliens",
|
"copyProtocol": "Copier bloc d'hyperliens",
|
||||||
"uploadAssets2CDN": "Transférer les fichiers asset vers le Cloud",
|
"uploadAssets2CDN": "Transférer les fichiers asset vers le Cloud",
|
||||||
"notSupport1": "Le glisser-déposer entre carnets n'est pas pris en charge",
|
"notSupport1": "Le glisser-déposer entre carnets n'est pas pris en charge",
|
||||||
"keymapTip": "Après avoir modifié les touches de raccourci, il faut les relancer pour qu'elles prennent effet",
|
"keymapTip": "Après la modification de certaines touches de raccourci, vous devez cliquer sur le bouton d'actualisation pour prendre effet",
|
||||||
|
"keymapTip2": "Utiliser les touches de raccourci par défaut",
|
||||||
"searchLimit": "Le nombre de résultats de recherche affichés",
|
"searchLimit": "Le nombre de résultats de recherche affichés",
|
||||||
"searchLimit1": "Si la quantité de données est importante, ne configurez pas la valeur trop grande, la valeur par défaut est <code>64</code>",
|
"searchLimit1": "Si la quantité de données est importante, ne configurez pas la valeur trop grande, la valeur par défaut est <code>64</code>",
|
||||||
"searchCaseSensitive": "Sensible à la casse",
|
"searchCaseSensitive": "Sensible à la casse",
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,8 @@
|
||||||
"copyProtocol": "複製塊超連結",
|
"copyProtocol": "複製塊超連結",
|
||||||
"uploadAssets2CDN": "上傳資料檔到雲端",
|
"uploadAssets2CDN": "上傳資料檔到雲端",
|
||||||
"notSupport1": "不支援跨筆記本進行拖拽",
|
"notSupport1": "不支援跨筆記本進行拖拽",
|
||||||
"keymapTip": "快速鍵修改後需要重新開機後才能生效",
|
"keymapTip": "部分快捷鍵修改後需點擊刷新按鈕後才能生效",
|
||||||
|
"keymapTip2": "使用默認快捷鍵",
|
||||||
"searchLimit": "搜索結果顯示數",
|
"searchLimit": "搜索結果顯示數",
|
||||||
"searchLimit1": "如果資料量較大,該值請勿配置過大,預設為 <code>64</code>",
|
"searchLimit1": "如果資料量較大,該值請勿配置過大,預設為 <code>64</code>",
|
||||||
"searchCaseSensitive": "區分大小寫",
|
"searchCaseSensitive": "區分大小寫",
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,8 @@
|
||||||
"copyProtocol": "复制块超链接",
|
"copyProtocol": "复制块超链接",
|
||||||
"uploadAssets2CDN": "上传资源文件到云端",
|
"uploadAssets2CDN": "上传资源文件到云端",
|
||||||
"notSupport1": "不支持跨笔记本进行拖拽",
|
"notSupport1": "不支持跨笔记本进行拖拽",
|
||||||
"keymapTip": "快捷键修改后需要重新启动后才能生效",
|
"keymapTip": "部分快捷键修改后需点击刷新按钮后才能生效",
|
||||||
|
"keymapTip2": "使用默认快捷键",
|
||||||
"searchLimit": "搜索结果显示数",
|
"searchLimit": "搜索结果显示数",
|
||||||
"searchLimit1": "如果数据量较大,该值请勿配置过大,默认为 <code>64</code>",
|
"searchLimit1": "如果数据量较大,该值请勿配置过大,默认为 <code>64</code>",
|
||||||
"searchCaseSensitive": "区分大小写",
|
"searchCaseSensitive": "区分大小写",
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
&-icon {
|
&-icon {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
left: 9px;
|
left: 9px;
|
||||||
top: 7px;
|
top: 6px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
line-height: 32px;
|
line-height: 32px;
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
padding: 8px 8px 8px 48px !important;
|
padding: 8px 8px 8px 48px !important;
|
||||||
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.b3-form__icon-icon {
|
.b3-form__icon-icon {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,12 @@
|
||||||
.b3-text-field {
|
.b3-text-field {
|
||||||
border: 1px solid var(--b3-theme-on-surface);
|
border: 0;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
box-shadow: inset 0 0 0 1px var(--b3-theme-on-surface);
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
color: var(--b3-theme-on-background);
|
color: var(--b3-theme-on-background);
|
||||||
transition: border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1), box-shadow 120ms 0ms cubic-bezier(0, 0, 0.2, 1);
|
transition: box-shadow 120ms 0ms cubic-bezier(0, 0, 0.2, 1);
|
||||||
background-color: var(--b3-theme-background);
|
background-color: var(--b3-theme-background);
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|
@ -13,8 +14,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&:focus {
|
&:focus {
|
||||||
border-color: var(--b3-theme-primary);
|
box-shadow: inset 0 0 0 1px var(--b3-theme-primary), 0 0 0 3px var(--b3-theme-primary-lightest);
|
||||||
box-shadow: 0 0 0 3px var(--b3-theme-primary-lightest);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&[type="color"] {
|
&[type="color"] {
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ progressLoading: 400
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-keymap .b3-text-field {
|
&-keymap li .b3-text-field {
|
||||||
width: 124px;
|
width: 124px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import {Constants} from "../constants";
|
||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {fetchPost} from "../util/fetch";
|
import {fetchPost} from "../util/fetch";
|
||||||
import {ipcRenderer} from "electron";
|
import {ipcRenderer} from "electron";
|
||||||
|
import {exportLayout} from "../layout/util";
|
||||||
|
|
||||||
export const keymap = {
|
export const keymap = {
|
||||||
element: undefined as Element,
|
element: undefined as Element,
|
||||||
|
|
@ -31,12 +32,26 @@ export const keymap = {
|
||||||
return `<div class="fn__flex b3-label">
|
return `<div class="fn__flex b3-label">
|
||||||
<span class="fn__flex-center">${window.siyuan.languages.keymapTip}</span>
|
<span class="fn__flex-center">${window.siyuan.languages.keymapTip}</span>
|
||||||
<span class="fn__flex-1"></span>
|
<span class="fn__flex-1"></span>
|
||||||
|
<button id="keymapRefreshBtn" class="b3-button b3-button--outline fn__flex-center fn__size200">
|
||||||
|
<svg><use xlink:href="#iconRefresh"></use></svg>
|
||||||
|
${window.siyuan.languages.refresh}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="fn__flex b3-label">
|
||||||
|
<span class="fn__flex-center">${window.siyuan.languages.keymapTip2}</span>
|
||||||
|
<span class="fn__flex-1"></span>
|
||||||
|
<span class="fn__space"></span>
|
||||||
<button id="keymapResetBtn" class="b3-button b3-button--outline fn__flex-center fn__size200">
|
<button id="keymapResetBtn" class="b3-button b3-button--outline fn__flex-center fn__size200">
|
||||||
<svg><use xlink:href="#iconUndo"></use></svg>
|
<svg><use xlink:href="#iconUndo"></use></svg>
|
||||||
${window.siyuan.languages.reset}
|
${window.siyuan.languages.reset}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="b3-label file-tree config-keymap" id="keymapList">
|
<div class="b3-label file-tree config-keymap" id="keymapList">
|
||||||
|
<label class="b3-form__icon" style="display:block;">
|
||||||
|
<svg class="b3-form__icon-icon"><use xlink:href="#iconSearch"></use></svg>
|
||||||
|
<input id="keymapInput" class="b3-form__icon-input b3-text-field fn__block" placeholder="${window.siyuan.languages.search}">
|
||||||
|
</label>
|
||||||
|
<div class="fn__hr"></div>
|
||||||
<ul class="b3-list b3-list--background">
|
<ul class="b3-list b3-list--background">
|
||||||
<li class="b3-list-item toggle" style="padding-left: 0">
|
<li class="b3-list-item toggle" style="padding-left: 0">
|
||||||
<span class="b3-list-item__toggle" style="padding-left: 8px"><svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg></span>
|
<span class="b3-list-item__toggle" style="padding-left: 8px"><svg class="b3-list-item__arrow"><use xlink:href="#iconRight"></use></svg></span>
|
||||||
|
|
@ -110,7 +125,30 @@ export const keymap = {
|
||||||
/// #endif
|
/// #endif
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
_search(value: string) {
|
||||||
|
keymap.element.querySelectorAll("#keymapList .b3-list-item--hide-action > .b3-list-item__text").forEach(item => {
|
||||||
|
if (item.textContent.indexOf(value) > -1 || value === "") {
|
||||||
|
item.parentElement.classList.remove("fn__none")
|
||||||
|
item.parentElement.parentElement.classList.remove("fn__none")
|
||||||
|
} else {
|
||||||
|
item.parentElement.classList.add("fn__none")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
bindEvent() {
|
bindEvent() {
|
||||||
|
keymap.element.querySelector("#keymapRefreshBtn").addEventListener("click", () => {
|
||||||
|
exportLayout(true);
|
||||||
|
});
|
||||||
|
const searchElement = keymap.element.querySelector("#keymapInput") as HTMLInputElement
|
||||||
|
this.element.addEventListener("compositionend", () => {
|
||||||
|
keymap._search(searchElement.value)
|
||||||
|
});
|
||||||
|
searchElement.addEventListener("input", (event: InputEvent) => {
|
||||||
|
if (event.isComposing) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
keymap._search(searchElement.value)
|
||||||
|
});
|
||||||
keymap.element.querySelector("#keymapResetBtn").addEventListener("click", () => {
|
keymap.element.querySelector("#keymapResetBtn").addEventListener("click", () => {
|
||||||
window.siyuan.config.keymap = Constants.SIYUAN_KEYMAP;
|
window.siyuan.config.keymap = Constants.SIYUAN_KEYMAP;
|
||||||
fetchPost("/api/setting/setKeymap", {
|
fetchPost("/api/setting/setKeymap", {
|
||||||
|
|
@ -156,8 +194,8 @@ export const keymap = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let timeout: number;
|
let timeout: number;
|
||||||
keymapListElement.querySelectorAll("input").forEach(item => {
|
keymapListElement.querySelectorAll("ul input").forEach(item => {
|
||||||
item.addEventListener("keydown", function (event) {
|
item.addEventListener("keydown", function (event: KeyboardEvent) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
let keymapStr = "";
|
let keymapStr = "";
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ export const initConfigSearch = (element: HTMLElement) => {
|
||||||
"doc", "headings", "list1", "listItem", "code", "math", "table", "quote", "superBlock", "paragraph"]),
|
"doc", "headings", "list1", "listItem", "code", "math", "table", "quote", "superBlock", "paragraph"]),
|
||||||
|
|
||||||
// 快捷键
|
// 快捷键
|
||||||
getLang(["keymap"].concat(Object.keys(Constants.SIYUAN_KEYMAP.general))
|
getLang(["keymap", "keymapTip2"].concat(Object.keys(Constants.SIYUAN_KEYMAP.general))
|
||||||
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.general))
|
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.general))
|
||||||
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.heading))
|
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.heading))
|
||||||
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.insert))
|
.concat(Object.keys(Constants.SIYUAN_KEYMAP.editor.insert))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue