This commit is contained in:
Vanessa 2023-10-24 10:42:04 +08:00
parent ae35acbb35
commit 621babd29d
9 changed files with 11 additions and 12 deletions

View file

@ -178,12 +178,12 @@ const saveUI = () => {
onlyData: false,
errorExit: false
});
}
};
export const unbindSaveUI = () => {
window.removeEventListener("beforeunload", saveUI);
window.removeEventListener("pagehide", saveUI);
}
};
export const initWindow = async (app: App) => {
/// #if !BROWSER

View file

@ -209,7 +209,7 @@ export const bindCardEvent = (options: {
fullscreen(options.element.querySelector(".card__main"),
options.element.querySelector('[data-type="fullscreen"]'));
resize(editor.protyle);
window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen = !window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen
window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen = !window.siyuan.storage[Constants.LOCAL_FLASHCARD].fullscreen;
setStorageVal(Constants.LOCAL_FLASHCARD, window.siyuan.storage[Constants.LOCAL_FLASHCARD]);
event.stopPropagation();
event.preventDefault();

View file

@ -932,7 +932,7 @@ export const bazaar = {
event.preventDefault();
return;
}
})
});
});
bazaar.element.querySelectorAll(".b3-select").forEach((selectElement: HTMLSelectElement) => {

View file

@ -380,7 +380,7 @@ export const keymap = {
if (keys[1] === "heading") {
keys[1] = "headings";
}
let hasConflict = false
let hasConflict = false;
if (["⌘", "⇧", "⌥", "⌃"].includes(keymapStr.substr(keymapStr.length - 1, 1)) ||
["⌘A", "⌘X", "⌘C", "⌘V", "⌘-", "⌘=", "⌘0", "⇧⌘V", "⌘/", "⇧↑", "⇧↓", "⇧→", "⇧←", "⇧⇥", "⇧⌘⇥", "⌃⇥", "⌘⇥", "⌃⌘⇥", "⇧⌘→", "⇧⌘←", "⌘Home", "⌘End", "⇧↩", "↩", "PageUp", "PageDown", "⌫", "⌦"].includes(keymapStr)) {
showMessage(`${window.siyuan.languages.invalid} [${adoptKeymapStr}]`);

View file

@ -29,7 +29,7 @@ export const loadPlugins = async (app: App) => {
loadPluginJS(app, item);
css += item.css || "" + "\n";
});
const pluginsStyle = document.getElementById("pluginsStyle")
const pluginsStyle = document.getElementById("pluginsStyle");
if (pluginsStyle) {
pluginsStyle.innerHTML = css;
} else {

View file

@ -55,7 +55,7 @@ export class Gutter {
this.element.setAttribute("data-position", "right");
this.element.addEventListener("dragstart", (event: DragEvent & { target: HTMLElement }) => {
hideTooltip();
const buttonElement = event.target.parentElement
const buttonElement = event.target.parentElement;
let selectIds: string[] = [buttonElement.getAttribute("data-node-id")];
const selectElements = protyle.wysiwyg.element.querySelectorAll(".protyle-wysiwyg--select");
if (selectElements.length > 0) {
@ -1846,7 +1846,7 @@ export class Gutter {
const buttonHTML = `<button data-type="${type}" data-subtype="${nodeElement.getAttribute("data-subtype")}" data-node-id="${nodeElement.getAttribute("data-node-id")}">
<svg><use xlink:href="#${getIconByType(type, nodeElement.getAttribute("data-subtype"))}"></use></svg>
<span ${protyle.disabled ? "" : 'draggable="true"'}></span>
</button>`
</button>`;
if (isShow) {
html = buttonHTML + html;
}

View file

@ -68,7 +68,6 @@ import {getSavePath} from "../../util/newFile";
import {escapeHtml} from "../../util/escape";
import {insertHTML} from "../util/insertHTML";
import {removeSearchMark} from "../toolbar/util";
import {copyPNG} from "../../menus/util";
import {avKeydown} from "../render/av/keydown";
import {resizeAV} from "../util/resize";

View file

@ -3,7 +3,7 @@ import {getAllModels} from "../layout/getAll";
import * as path from "path";
/// #endif
import {Constants} from "../constants";
import {escapeAriaLabel, escapeAttr, escapeGreat, escapeHtml} from "../util/escape";
import {escapeAriaLabel, escapeGreat, escapeHtml} from "../util/escape";
import {fetchPost} from "../util/fetch";
import {openFile, openFileById} from "../editor/util";
import {showMessage} from "../dialog/message";
@ -1353,7 +1353,7 @@ const getAttr =(block:IBlock) => {
attrHTML += `<span class="b3-list-item__meta fn__flex" style="max-width: 30%"><svg class="b3-list-item__hinticon"><use xlink:href="#iconM"></use></svg><span class="b3-list-item__hinttext">${block.memo}</span></span>`;
}
return attrHTML;
}
};
const onSearch = (data: IBlock[], edit: Protyle, element: Element, config: ISearchOption) => {
let resultHTML = "";

View file

@ -225,7 +225,7 @@ export const setInlineStyle = (set = true) => {
style += "\n.b3-menu .b3-menu__action {opacity: 0.68;}";
}
if (set) {
const siyuanStyle = document.getElementById("siyuanStyle")
const siyuanStyle = document.getElementById("siyuanStyle");
if (siyuanStyle) {
siyuanStyle.innerHTML = style;
} else {