mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-02 04:12:15 +08:00
This commit is contained in:
parent
bc6843417a
commit
22923d3eac
@ -37,6 +37,7 @@ import {setLocalShorthandCount} from "./util/noRelyPCFunction";
|
||||
/// #endif
|
||||
import {getDockByType} from "./layout/tabUtil";
|
||||
import {Tag} from "./layout/dock/Tag";
|
||||
import {updateControlAlt} from "./protyle/util/hotKey";
|
||||
|
||||
export class App {
|
||||
public plugins: import("./plugin").Plugin[] = [];
|
||||
@ -101,6 +102,7 @@ export class App {
|
||||
break;
|
||||
case "setConf":
|
||||
window.siyuan.config = data.data;
|
||||
updateControlAlt();
|
||||
break;
|
||||
case "progress":
|
||||
progressLoading(data);
|
||||
@ -182,6 +184,7 @@ export class App {
|
||||
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");
|
||||
window.siyuan.config = response.data.conf;
|
||||
updateControlAlt();
|
||||
window.siyuan.isPublish = response.data.isPublish;
|
||||
await loadPlugins(this);
|
||||
getLocalStorage(() => {
|
||||
|
@ -29,6 +29,7 @@ import {updateCardHV} from "../card/util";
|
||||
import {mobileKeydown} from "./util/keydown";
|
||||
import {correctHotkey} from "../boot/globalEvent/commonHotkey";
|
||||
import {processIOSPurchaseResponse} from "../util/iOSPurchase";
|
||||
import {updateControlAlt} from "../protyle/util/hotKey";
|
||||
|
||||
class App {
|
||||
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");
|
||||
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
||||
window.siyuan.config = confResponse.data.conf;
|
||||
updateControlAlt();
|
||||
window.siyuan.isPublish = confResponse.data.isPublish;
|
||||
correctHotkey(siyuanApp);
|
||||
await loadPlugins(this);
|
||||
|
@ -10,6 +10,7 @@ import {App} from "../../index";
|
||||
import {reloadPlugin} from "../../plugin/loader";
|
||||
import {reloadEmoji} from "../../emoji";
|
||||
import {setLocalShorthandCount} from "../../util/noRelyPCFunction";
|
||||
import {updateControlAlt} from "../../protyle/util/hotKey";
|
||||
|
||||
export const onMessage = (app: App, data: IWebSocketData) => {
|
||||
if (data) {
|
||||
@ -37,6 +38,7 @@ export const onMessage = (app: App, data: IWebSocketData) => {
|
||||
break;
|
||||
case "setConf":
|
||||
window.siyuan.config = data.data;
|
||||
updateControlAlt();
|
||||
break;
|
||||
case "reloaddoc":
|
||||
reloadSync(this, {upsertRootIDs: [data.data], removeRootIDs: []}, false, false, true);
|
||||
|
@ -217,3 +217,21 @@ export const isIncludesHotKey = (hotKey: string) => {
|
||||
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 {hideAllElements} from "../protyle/ui/hideElements";
|
||||
import {reloadEmoji} from "../emoji";
|
||||
import {updateControlAlt} from "../protyle/util/hotKey";
|
||||
|
||||
class App {
|
||||
public plugins: import("../plugin").Plugin[] = [];
|
||||
@ -78,6 +79,7 @@ class App {
|
||||
break;
|
||||
case "setConf":
|
||||
window.siyuan.config = data.data;
|
||||
updateControlAlt();
|
||||
break;
|
||||
case "progress":
|
||||
progressLoading(data);
|
||||
@ -155,6 +157,7 @@ class App {
|
||||
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");
|
||||
window.siyuan.config = response.data.conf;
|
||||
updateControlAlt();
|
||||
window.siyuan.isPublish = response.data.isPublish;
|
||||
await loadPlugins(this);
|
||||
getLocalStorage(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user