mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 19:09:49 +08:00
This commit is contained in:
parent
bc6843417a
commit
22923d3eac
@ -37,6 +37,7 @@ import {setLocalShorthandCount} from "./util/noRelyPCFunction";
|
|||||||
/// #endif
|
/// #endif
|
||||||
import {getDockByType} from "./layout/tabUtil";
|
import {getDockByType} from "./layout/tabUtil";
|
||||||
import {Tag} from "./layout/dock/Tag";
|
import {Tag} from "./layout/dock/Tag";
|
||||||
|
import {updateControlAlt} from "./protyle/util/hotKey";
|
||||||
|
|
||||||
export class App {
|
export class App {
|
||||||
public plugins: import("./plugin").Plugin[] = [];
|
public plugins: import("./plugin").Plugin[] = [];
|
||||||
@ -101,6 +102,7 @@ export class App {
|
|||||||
break;
|
break;
|
||||||
case "setConf":
|
case "setConf":
|
||||||
window.siyuan.config = data.data;
|
window.siyuan.config = data.data;
|
||||||
|
updateControlAlt();
|
||||||
break;
|
break;
|
||||||
case "progress":
|
case "progress":
|
||||||
progressLoading(data);
|
progressLoading(data);
|
||||||
@ -182,6 +184,7 @@ export class App {
|
|||||||
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
||||||
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
||||||
window.siyuan.config = response.data.conf;
|
window.siyuan.config = response.data.conf;
|
||||||
|
updateControlAlt();
|
||||||
window.siyuan.isPublish = response.data.isPublish;
|
window.siyuan.isPublish = response.data.isPublish;
|
||||||
await loadPlugins(this);
|
await loadPlugins(this);
|
||||||
getLocalStorage(() => {
|
getLocalStorage(() => {
|
||||||
|
@ -29,6 +29,7 @@ import {updateCardHV} from "../card/util";
|
|||||||
import {mobileKeydown} from "./util/keydown";
|
import {mobileKeydown} from "./util/keydown";
|
||||||
import {correctHotkey} from "../boot/globalEvent/commonHotkey";
|
import {correctHotkey} from "../boot/globalEvent/commonHotkey";
|
||||||
import {processIOSPurchaseResponse} from "../util/iOSPurchase";
|
import {processIOSPurchaseResponse} from "../util/iOSPurchase";
|
||||||
|
import {updateControlAlt} from "../protyle/util/hotKey";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
public plugins: import("../plugin").Plugin[] = [];
|
public plugins: import("../plugin").Plugin[] = [];
|
||||||
@ -96,6 +97,7 @@ class App {
|
|||||||
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
||||||
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
||||||
window.siyuan.config = confResponse.data.conf;
|
window.siyuan.config = confResponse.data.conf;
|
||||||
|
updateControlAlt();
|
||||||
window.siyuan.isPublish = confResponse.data.isPublish;
|
window.siyuan.isPublish = confResponse.data.isPublish;
|
||||||
correctHotkey(siyuanApp);
|
correctHotkey(siyuanApp);
|
||||||
await loadPlugins(this);
|
await loadPlugins(this);
|
||||||
|
@ -10,6 +10,7 @@ import {App} from "../../index";
|
|||||||
import {reloadPlugin} from "../../plugin/loader";
|
import {reloadPlugin} from "../../plugin/loader";
|
||||||
import {reloadEmoji} from "../../emoji";
|
import {reloadEmoji} from "../../emoji";
|
||||||
import {setLocalShorthandCount} from "../../util/noRelyPCFunction";
|
import {setLocalShorthandCount} from "../../util/noRelyPCFunction";
|
||||||
|
import {updateControlAlt} from "../../protyle/util/hotKey";
|
||||||
|
|
||||||
export const onMessage = (app: App, data: IWebSocketData) => {
|
export const onMessage = (app: App, data: IWebSocketData) => {
|
||||||
if (data) {
|
if (data) {
|
||||||
@ -37,6 +38,7 @@ export const onMessage = (app: App, data: IWebSocketData) => {
|
|||||||
break;
|
break;
|
||||||
case "setConf":
|
case "setConf":
|
||||||
window.siyuan.config = data.data;
|
window.siyuan.config = data.data;
|
||||||
|
updateControlAlt();
|
||||||
break;
|
break;
|
||||||
case "reloaddoc":
|
case "reloaddoc":
|
||||||
reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true);
|
reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true);
|
||||||
|
@ -217,3 +217,21 @@ export const isIncludesHotKey = (hotKey: string) => {
|
|||||||
return isInclude;
|
return isInclude;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const updateControlAlt = () => {
|
||||||
|
Object.keys(window.siyuan.config.keymap.general).forEach(key => {
|
||||||
|
if (["fileTree", "outline", "bookmark", "tag", "dailyNote", "inbox", "backlinks",
|
||||||
|
"graphView", "globalGraph", "riffCard"].includes(key)) {
|
||||||
|
if (navigator.platform.toUpperCase().indexOf("MAC") > -1) {
|
||||||
|
window.siyuan.config.keymap.general[key].default = window.siyuan.config.keymap.general[key].default.replace("⌥", "⌃")
|
||||||
|
if (window.siyuan.config.keymap.general[key].default === window.siyuan.config.keymap.general[key].custom) {
|
||||||
|
window.siyuan.config.keymap.general[key].custom = window.siyuan.config.keymap.general[key].default.replace("⌥", "⌃")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
window.siyuan.config.keymap.general[key].default = window.siyuan.config.keymap.general[key].default.replace("⌃", "⌥")
|
||||||
|
if (window.siyuan.config.keymap.general[key].default === window.siyuan.config.keymap.general[key].custom) {
|
||||||
|
window.siyuan.config.keymap.general[key].custom = window.siyuan.config.keymap.general[key].default.replace("⌃", "⌥")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
@ -26,6 +26,7 @@ import {init} from "../window/init";
|
|||||||
import {loadPlugins, reloadPlugin} from "../plugin/loader";
|
import {loadPlugins, reloadPlugin} from "../plugin/loader";
|
||||||
import {hideAllElements} from "../protyle/ui/hideElements";
|
import {hideAllElements} from "../protyle/ui/hideElements";
|
||||||
import {reloadEmoji} from "../emoji";
|
import {reloadEmoji} from "../emoji";
|
||||||
|
import {updateControlAlt} from "../protyle/util/hotKey";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
public plugins: import("../plugin").Plugin[] = [];
|
public plugins: import("../plugin").Plugin[] = [];
|
||||||
@ -78,6 +79,7 @@ class App {
|
|||||||
break;
|
break;
|
||||||
case "setConf":
|
case "setConf":
|
||||||
window.siyuan.config = data.data;
|
window.siyuan.config = data.data;
|
||||||
|
updateControlAlt();
|
||||||
break;
|
break;
|
||||||
case "progress":
|
case "progress":
|
||||||
progressLoading(data);
|
progressLoading(data);
|
||||||
@ -155,6 +157,7 @@ class App {
|
|||||||
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
||||||
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
||||||
window.siyuan.config = response.data.conf;
|
window.siyuan.config = response.data.conf;
|
||||||
|
updateControlAlt();
|
||||||
window.siyuan.isPublish = response.data.isPublish;
|
window.siyuan.isPublish = response.data.isPublish;
|
||||||
await loadPlugins(this);
|
await loadPlugins(this);
|
||||||
getLocalStorage(() => {
|
getLocalStorage(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user