mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
🚨
This commit is contained in:
parent
1f391d7f50
commit
b542a80f56
8 changed files with 13 additions and 14 deletions
|
|
@ -6,7 +6,6 @@ import {Constants} from "../constants";
|
||||||
import {exportLayout, resetLayout} from "../layout/util";
|
import {exportLayout, resetLayout} from "../layout/util";
|
||||||
import {isBrowser} from "../util/functions";
|
import {isBrowser} from "../util/functions";
|
||||||
import {fetchPost} from "../util/fetch";
|
import {fetchPost} from "../util/fetch";
|
||||||
import {loadAssets} from "../util/assets";
|
|
||||||
import {genOptions} from "../util/genOptions";
|
import {genOptions} from "../util/genOptions";
|
||||||
import {openSnippets} from "./util/snippets";
|
import {openSnippets} from "./util/snippets";
|
||||||
import {openColorPicker} from "./util/colorPicker";
|
import {openColorPicker} from "./util/colorPicker";
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ const getUnInitTab = (options: IOpenFileOptions) => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
||||||
const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModels) => {
|
const switchEditor = (editor: Editor, options: IOpenFileOptions, allModels: IModels) => {
|
||||||
allModels.editor.forEach((item) => {
|
allModels.editor.forEach((item) => {
|
||||||
|
|
|
||||||
|
|
@ -428,7 +428,7 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
|
||||||
export const resizeDrag = () => {
|
export const resizeDrag = () => {
|
||||||
const dragElement = document.getElementById("drag");
|
const dragElement = document.getElementById("drag");
|
||||||
const width = dragElement.clientWidth;
|
const width = dragElement.clientWidth;
|
||||||
const dragRect = dragElement.getBoundingClientRect()
|
const dragRect = dragElement.getBoundingClientRect();
|
||||||
const left = dragRect.left;
|
const left = dragRect.left;
|
||||||
const right = window.innerWidth - dragRect.right;
|
const right = window.innerWidth - dragRect.right;
|
||||||
if (left > right && left - right < width) {
|
if (left > right && left - right < width) {
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ export const exportImage = (id: string) => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
previewElement.querySelectorAll(".li > .protyle-action > svg").forEach(item => {
|
previewElement.querySelectorAll(".li > .protyle-action > svg").forEach(item => {
|
||||||
const id = item.firstElementChild.getAttribute("xlink:href")
|
const id = item.firstElementChild.getAttribute("xlink:href");
|
||||||
const symbolElements = document.querySelectorAll(id)
|
const symbolElements = document.querySelectorAll(id);
|
||||||
let viewBox = "0 0 32 32";
|
let viewBox = "0 0 32 32";
|
||||||
if (id === "#iconDot") {
|
if (id === "#iconDot") {
|
||||||
viewBox = "0 0 20 20";
|
viewBox = "0 0 20 20";
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ import {getIconByType} from "../../editor/getIcon";
|
||||||
import {iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
import {iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
||||||
import {MenuItem} from "../../menus/Menu";
|
import {MenuItem} from "../../menus/Menu";
|
||||||
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
||||||
import {isCtrl, updateHotkeyTip, writeText} from "../util/compatibility";
|
import {updateHotkeyTip, writeText} from "../util/compatibility";
|
||||||
import {
|
import {
|
||||||
transaction,
|
transaction,
|
||||||
turnsIntoOneTransaction, turnsIntoTransaction,
|
turnsIntoOneTransaction, turnsIntoTransaction,
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export const reloadProtyle = (protyle: IProtyle) => {
|
||||||
addLoading(protyle);
|
addLoading(protyle);
|
||||||
if (protyle.options.backlinkData) {
|
if (protyle.options.backlinkData) {
|
||||||
const isMention = protyle.element.getAttribute("data-ismention") === "true";
|
const isMention = protyle.element.getAttribute("data-ismention") === "true";
|
||||||
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink")
|
const tabElement = hasClosestByClassName(protyle.element, "sy__backlink");
|
||||||
if (tabElement) {
|
if (tabElement) {
|
||||||
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>
|
const inputsElement = tabElement.querySelectorAll(".b3-form__icon-input") as NodeListOf<HTMLInputElement>;
|
||||||
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
fetchPost(isMention ? "/api/ref/getBackmentionDoc" : "/api/ref/getBacklinkDoc", {
|
||||||
defID: protyle.element.getAttribute("data-defid"),
|
defID: protyle.element.getAttribute("data-defid"),
|
||||||
refTreeID: protyle.block.rootID,
|
refTreeID: protyle.block.rootID,
|
||||||
|
|
|
||||||
|
|
@ -361,8 +361,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
if (previousElement) {
|
if (previousElement) {
|
||||||
previousElement.setAttribute("select-end", "true");
|
previousElement.setAttribute("select-end", "true");
|
||||||
if (previousElement.getBoundingClientRect().top <= protyle.contentElement.getBoundingClientRect().top) {
|
if (previousElement.getBoundingClientRect().top <= protyle.contentElement.getBoundingClientRect().top) {
|
||||||
preventScroll(protyle)
|
preventScroll(protyle);
|
||||||
previousElement.scrollIntoView(true)
|
previousElement.scrollIntoView(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -398,8 +398,8 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
||||||
if (nextElement) {
|
if (nextElement) {
|
||||||
nextElement.setAttribute("select-end", "true");
|
nextElement.setAttribute("select-end", "true");
|
||||||
if (nextElement.getBoundingClientRect().bottom >= protyle.contentElement.getBoundingClientRect().bottom) {
|
if (nextElement.getBoundingClientRect().bottom >= protyle.contentElement.getBoundingClientRect().bottom) {
|
||||||
preventScroll(protyle)
|
preventScroll(protyle);
|
||||||
nextElement.scrollIntoView(false)
|
nextElement.scrollIntoView(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,7 +251,7 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
|
||||||
if ((window.siyuan.config.system.container === "ios" && window.webkit?.messageHandlers) ||
|
if ((window.siyuan.config.system.container === "ios" && window.webkit?.messageHandlers) ||
|
||||||
(window.siyuan.config.system.container === "android" && window.JSAndroid)) {
|
(window.siyuan.config.system.container === "android" && window.JSAndroid)) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background")
|
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background");
|
||||||
let mode = window.siyuan.config.appearance.mode;
|
let mode = window.siyuan.config.appearance.mode;
|
||||||
if (window.siyuan.config.appearance.modeOS) {
|
if (window.siyuan.config.appearance.modeOS) {
|
||||||
if (data.OSTheme === "dark") {
|
if (data.OSTheme === "dark") {
|
||||||
|
|
@ -304,4 +304,4 @@ const watchTheme = (data: { init: boolean, OSTheme: string }) => {
|
||||||
window.siyuan.config.appearance = response.data.appearance;
|
window.siyuan.config.appearance = response.data.appearance;
|
||||||
loadAssets(response.data.appearance);
|
loadAssets(response.data.appearance);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue