This commit is contained in:
Vanessa 2023-03-07 15:06:50 +08:00
parent 2a214fe50e
commit e8ade79630
7 changed files with 12 additions and 16 deletions

View file

@ -192,7 +192,7 @@ const boot = () => {
webviewTag: true, webviewTag: true,
webSecurity: false, webSecurity: false,
contextIsolation: false, contextIsolation: false,
autoplayPolicy: 'user-gesture-required' // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587 autoplayPolicy: "user-gesture-required" // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587
}, },
frame: "darwin" === process.platform, frame: "darwin" === process.platform,
titleBarStyle: "hidden", titleBarStyle: "hidden",
@ -752,7 +752,7 @@ app.whenReady().then(() => {
nodeIntegration: true, nodeIntegration: true,
webviewTag: true, webviewTag: true,
webSecurity: false, webSecurity: false,
autoplayPolicy: 'user-gesture-required' // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587 autoplayPolicy: "user-gesture-required" // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587
}, },
}); });
win.loadURL(data.url); win.loadURL(data.url);

View file

@ -3,7 +3,6 @@ import {closePanel} from "./closePanel";
import {openMobileFileById} from "../editor"; import {openMobileFileById} from "../editor";
import {validateName} from "../../editor/rename"; import {validateName} from "../../editor/rename";
import {getEventName} from "../../protyle/util/compatibility"; import {getEventName} from "../../protyle/util/compatibility";
import {mountHelp} from "../../util/mount";
import {fetchPost} from "../../util/fetch"; import {fetchPost} from "../../util/fetch";
import {setInlineStyle} from "../../util/assets"; import {setInlineStyle} from "../../util/assets";
import {renderSnippet} from "../../config/util/snippets"; import {renderSnippet} from "../../config/util/snippets";

View file

@ -250,7 +250,7 @@ export const initKeyboardToolbar = () => {
preventRender = true; preventRender = true;
setTimeout(() => { setTimeout(() => {
preventRender = false; preventRender = false;
}, 1000) }, 1000);
return; return;
} else if (type === "goinline") { } else if (type === "goinline") {
const dynamicElements = document.querySelectorAll("#keyboardToolbar .keyboard__dynamic"); const dynamicElements = document.querySelectorAll("#keyboardToolbar .keyboard__dynamic");

View file

@ -468,7 +468,7 @@ const renderPDF = (id: string) => {
nodeIntegration: true, nodeIntegration: true,
webviewTag: true, webviewTag: true,
webSecurity: false, webSecurity: false,
autoplayPolicy: 'user-gesture-required' // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587 autoplayPolicy: "user-gesture-required" // 桌面端禁止自动播放多媒体 https://github.com/siyuan-note/siyuan/issues/7587
}, },
}); });
ipcRenderer.send(Constants.SIYUAN_EXPORT_PREVENT, window.siyuan.printWin.id); ipcRenderer.send(Constants.SIYUAN_EXPORT_PREVENT, window.siyuan.printWin.id);

View file

@ -16,24 +16,24 @@ export const previewTemplate = (pathString: string, element: Element, parentId:
const mergeElement = (a: Element, b: Element, after = true) => { const mergeElement = (a: Element, b: Element, after = true) => {
a.setAttribute("data-type", a.getAttribute("data-type").replace("search-mark", "").trim()); a.setAttribute("data-type", a.getAttribute("data-type").replace("search-mark", "").trim());
b.setAttribute("data-type", b.getAttribute("data-type").replace("search-mark", "").trim()); b.setAttribute("data-type", b.getAttribute("data-type").replace("search-mark", "").trim());
const attributes = a.attributes const attributes = a.attributes;
let isMatch = true let isMatch = true;
for (let i = 0; i < attributes.length; i++) { for (let i = 0; i < attributes.length; i++) {
if (b.getAttribute(attributes[i].name) !== attributes[i].value) { if (b.getAttribute(attributes[i].name) !== attributes[i].value) {
isMatch = false isMatch = false;
} }
} }
if (isMatch) { if (isMatch) {
if (after) { if (after) {
a.innerHTML = a.innerHTML + b.innerHTML a.innerHTML = a.innerHTML + b.innerHTML;
} else { } else {
a.innerHTML = b.innerHTML + a.innerHTML a.innerHTML = b.innerHTML + a.innerHTML;
} }
b.remove(); b.remove();
} }
return isMatch; return isMatch;
} };
export const removeSearchMark = (element: HTMLElement) => { export const removeSearchMark = (element: HTMLElement) => {
let previousElement = element.previousSibling as HTMLElement; let previousElement = element.previousSibling as HTMLElement;
@ -56,4 +56,4 @@ export const removeSearchMark = (element: HTMLElement) => {
if (element.getAttribute("data-type").includes("search-mark")) { if (element.getAttribute("data-type").includes("search-mark")) {
element.setAttribute("data-type", element.getAttribute("data-type").replace("search-mark", "").trim()); element.setAttribute("data-type", element.getAttribute("data-type").replace("search-mark", "").trim());
} }
} };

View file

@ -7,12 +7,10 @@ import {
getSelectionOffset, getSelectionOffset,
setFirstNodeRange, setFirstNodeRange,
} from "../util/selection"; } from "../util/selection";
import {fullscreen, netImg2LocalAssets} from "../breadcrumb/action"; import {netImg2LocalAssets} from "../breadcrumb/action";
import {setPadding} from "../ui/initUI";
/// #if !MOBILE /// #if !MOBILE
import {openBacklink, openGraph, openOutline} from "../../layout/dock/util"; import {openBacklink, openGraph, openOutline} from "../../layout/dock/util";
/// #endif /// #endif
import {reloadProtyle} from "../util/reload";
import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "./getBlock"; import {getContenteditableElement, hasNextSibling, hasPreviousSibling} from "./getBlock";
import {hasClosestByMatchTag} from "../util/hasClosest"; import {hasClosestByMatchTag} from "../util/hasClosest";
import {hideElements} from "../ui/hideElements"; import {hideElements} from "../ui/hideElements";

View file

@ -12,7 +12,6 @@ import {Constants} from "../constants";
import {appearance} from "../config/appearance"; import {appearance} from "../config/appearance";
import {globalShortcut} from "./globalShortcut"; import {globalShortcut} from "./globalShortcut";
import {fetchPost} from "./fetch"; import {fetchPost} from "./fetch";
import {mountHelp} from "./mount";
import {addGA, initAssets, setInlineStyle} from "./assets"; import {addGA, initAssets, setInlineStyle} from "./assets";
import {renderSnippet} from "../config/util/snippets"; import {renderSnippet} from "../config/util/snippets";
import {openFileById} from "../editor/util"; import {openFileById} from "../editor/util";