mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 23:21:23 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
78ee4baefb
@ -358,13 +358,13 @@ const boot = () => {
|
|||||||
// 当前页面链接使用浏览器打开
|
// 当前页面链接使用浏览器打开
|
||||||
currentWindow.webContents.on("will-navigate", (event, url) => {
|
currentWindow.webContents.on("will-navigate", (event, url) => {
|
||||||
if (event.sender) {
|
if (event.sender) {
|
||||||
const currentURL = new URL(event.sender.getURL());
|
const currentURL = new URL(event.sender.getURL());
|
||||||
if (url.startsWith(getServer(currentURL.port))) {
|
if (url.startsWith(getServer(currentURL.port))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
shell.openExternal(url);
|
shell.openExternal(url);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -793,6 +793,9 @@ app.whenReady().then(() => {
|
|||||||
item.webContents.send("siyuan-send_windows", data);
|
item.webContents.send("siyuan-send_windows", data);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
ipcMain.on("siyuan-auto-launch", (event, data) => {
|
||||||
|
app.setLoginItemSettings({openAtLogin: data.openAtLogin});
|
||||||
|
});
|
||||||
|
|
||||||
if (firstOpen) {
|
if (firstOpen) {
|
||||||
const firstOpenWindow = new BrowserWindow({
|
const firstOpenWindow = new BrowserWindow({
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import {Constants} from "../constants";
|
import {Constants} from "../constants";
|
||||||
/// #if !BROWSER
|
/// #if !BROWSER
|
||||||
import {app, shell} from "electron";
|
import {ipcRenderer, shell} from "electron";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {isBrowser} from "../util/functions";
|
import {isBrowser} from "../util/functions";
|
||||||
import {fetchPost} from "../util/fetch";
|
import {fetchPost} from "../util/fetch";
|
||||||
@ -11,7 +11,7 @@ import {openByMobile, writeText} from "../protyle/util/compatibility";
|
|||||||
import {showMessage} from "../dialog/message";
|
import {showMessage} from "../dialog/message";
|
||||||
import {Dialog} from "../dialog";
|
import {Dialog} from "../dialog";
|
||||||
import {confirmDialog} from "../dialog/confirmDialog";
|
import {confirmDialog} from "../dialog/confirmDialog";
|
||||||
import { setProxy } from "./util/setProxy";
|
import {setProxy} from "./util/setProxy";
|
||||||
|
|
||||||
export const about = {
|
export const about = {
|
||||||
element: undefined as Element,
|
element: undefined as Element,
|
||||||
@ -338,7 +338,7 @@ export const about = {
|
|||||||
autoLaunchElement.addEventListener("change", () => {
|
autoLaunchElement.addEventListener("change", () => {
|
||||||
fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => {
|
fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => {
|
||||||
window.siyuan.config.system.autoLaunch = autoLaunchElement.checked;
|
window.siyuan.config.system.autoLaunch = autoLaunchElement.checked;
|
||||||
app.setLoginItemSettings({openAtLogin: autoLaunchElement.checked});
|
ipcRenderer.send(Constants.SIYUAN_AUTO_LAUNCH, {openAtLogin: autoLaunchElement.checked});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
/// #endif
|
/// #endif
|
||||||
|
@ -36,6 +36,7 @@ export abstract class Constants {
|
|||||||
public static readonly SIYUAN_EXPORT_PDF: string = "siyuan-export-pdf";
|
public static readonly SIYUAN_EXPORT_PDF: string = "siyuan-export-pdf";
|
||||||
public static readonly SIYUAN_EXPORT_CLOSE: string = "siyuan-export-close";
|
public static readonly SIYUAN_EXPORT_CLOSE: string = "siyuan-export-close";
|
||||||
public static readonly SIYUAN_EXPORT_PREVENT: string = "siyuan-export-prevent";
|
public static readonly SIYUAN_EXPORT_PREVENT: string = "siyuan-export-prevent";
|
||||||
|
public static readonly SIYUAN_AUTO_LAUNCH: string = "siyuan-auto-launch";
|
||||||
|
|
||||||
// size
|
// size
|
||||||
public static readonly SIZE_TOOLBAR_HEIGHT: number = isMobile() ? 0 : 32;
|
public static readonly SIZE_TOOLBAR_HEIGHT: number = isMobile() ? 0 : 32;
|
||||||
|
Loading…
Reference in New Issue
Block a user