mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 16:40:13 +01:00
This commit is contained in:
parent
5d4e497a58
commit
b09a276a7d
9 changed files with 25 additions and 4 deletions
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"mainMenu": "Main Menu",
|
||||
"searchRemoveName": "Do you want to delete ${x} and assign its query condition to ${y}?",
|
||||
"searchUpdateName": "Update name ${x} to ${y}?",
|
||||
"searchAssetContent": "Search asset file content",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"mainMenu": "Menú principal",
|
||||
"searchRemoveName": "¿Desea eliminar ${x} y asignar su condición de consulta a ${y}?",
|
||||
"searchUpdateName": "¿Actualizar nombre ${x} a ${y}?",
|
||||
"searchAssetContent": "Buscar contenido del archivo de activos",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"mainMenu": "Menu principal",
|
||||
"searchRemoveName": "Voulez-vous supprimer ${x} et affecter sa condition de requête à ${y} ?",
|
||||
"searchUpdateName": "Mettre à jour le nom ${x} en ${y} ?",
|
||||
"searchAssetContent": "Rechercher le contenu du fichier d'actif",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"mainMenu": "主菜單",
|
||||
"searchRemoveName": "是否刪 ${x} 並將其查詢條件賦值給 ${y}?",
|
||||
"searchUpdateName": "是否將查詢名稱 ${x} 更新為 ${y}?",
|
||||
"searchAssetContent": "搜索資源文件內容",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"mainMenu": "主菜单",
|
||||
"searchRemoveName": "是否删 ${x} 并将其查询条件赋值给 ${y}?",
|
||||
"searchUpdateName": "是否将查询名称 ${x} 更新为 ${y}?",
|
||||
"searchAssetContent": "搜索资源文件内容",
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ import {openRecentDocs} from "../business/openRecentDocs";
|
|||
import {App} from "../index";
|
||||
import {commandPanel} from "../plugin/commandPanel";
|
||||
import {toggleDockBar} from "../layout/dock/util";
|
||||
import {workspaceMenu} from "../menus/workspace";
|
||||
|
||||
const getRightBlock = (element: HTMLElement, x: number, y: number) => {
|
||||
let index = 1;
|
||||
|
|
@ -579,6 +580,11 @@ export const globalShortcut = (app: App) => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (bindMenuKeydown(event)) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
||||
const viewCardsDialog = window.siyuan.dialogs.find(item => {
|
||||
if (item.element.getAttribute("data-key") === "viewCards") {
|
||||
|
|
@ -763,6 +769,12 @@ export const globalShortcut = (app: App) => {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!isTabWindow && matchHotKey(window.siyuan.config.keymap.general.mainMenu.custom, event)) {
|
||||
workspaceMenu(app, document.querySelector("#barWorkspace").getBoundingClientRect());
|
||||
event.preventDefault();
|
||||
return;
|
||||
}
|
||||
|
||||
if (matchHotKey(window.siyuan.config.keymap.general.goForward.custom, event)) {
|
||||
goForward(app);
|
||||
event.preventDefault();
|
||||
|
|
@ -1308,7 +1320,9 @@ const fileTreeKeydown = (app: App, event: KeyboardEvent) => {
|
|||
hasClosestByClassName(target, "protyle", true)) {
|
||||
return false;
|
||||
}
|
||||
if (bindMenuKeydown(event)) {
|
||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||
(event.code.startsWith("Arrow") || event.code === "Enter") &&
|
||||
!event.altKey && !event.shiftKey && !isCtrl(event)) {
|
||||
event.preventDefault();
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,6 +212,7 @@ export abstract class Constants {
|
|||
// "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦" 不可自定义
|
||||
public static readonly SIYUAN_KEYMAP: IKeymap = {
|
||||
general: {
|
||||
mainMenu: {default: "⌥\\", custom: "⌥\\"},
|
||||
commandPanel: {default: "⌥⇧P", custom: "⌥⇧P"},
|
||||
editMode: {default: "⇧⌘G", custom: "⇧⌘G"},
|
||||
syncNow: {default: "F9", custom: "F9"},
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ export const updateEditModeElement = () => {
|
|||
export const initBar = (app: App) => {
|
||||
const toolbarElement = document.getElementById("toolbar");
|
||||
toolbarElement.innerHTML = `
|
||||
<div id="barWorkspace" class="toolbar__item toolbar__item--active">
|
||||
<div id="barWorkspace" aria-label="${window.siyuan.languages.mainMenu} ${updateHotkeyTip(window.siyuan.config.keymap.general.mainMenu.custom)}" class="b3-tooltips b3-tooltips__e toolbar__item toolbar__item--active">
|
||||
<span class="toolbar__text">${getWorkspaceName()}</span>
|
||||
<svg class="toolbar__svg"><use xlink:href="#iconDown"></use></svg>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -151,8 +151,9 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
range = cloneRange;
|
||||
}
|
||||
|
||||
if (bindMenuKeydown(event)) {
|
||||
event.stopPropagation();
|
||||
if (!window.siyuan.menus.menu.element.classList.contains("fn__none") &&
|
||||
(event.code.startsWith("Arrow") || event.code === "Enter") &&
|
||||
!event.altKey && !event.shiftKey && !isCtrl(event)) {
|
||||
event.preventDefault();
|
||||
return;
|
||||
} else if (event.key !== "Escape") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue