mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-02 10:50:15 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
c39509d9d4
17 changed files with 39 additions and 29 deletions
|
|
@ -35,7 +35,7 @@ import {
|
|||
} from "../../search/toggleHistory";
|
||||
|
||||
const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAll: boolean) => {
|
||||
if (config.method === 1 || config.method === 2) {
|
||||
if (config.method === 2) {
|
||||
showMessage(window.siyuan.languages._kernel[132]);
|
||||
return;
|
||||
}
|
||||
|
|
@ -55,7 +55,7 @@ const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, isAl
|
|||
loadElement.nextElementSibling.classList.add("fn__none");
|
||||
const currentId = currentLiElement.getAttribute("data-node-id");
|
||||
fetchPost("/api/search/findReplace", {
|
||||
k: config.method === 0 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
|
||||
k: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentLiElement) : (document.querySelector("#toolbarSearch") as HTMLInputElement).value,
|
||||
r: replaceInputElement.value,
|
||||
ids: isAll ? [] : [currentId],
|
||||
types: config.types,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ import {listIndent, listOutdent} from "../../protyle/wysiwyg/list";
|
|||
import {
|
||||
hasClosestBlock,
|
||||
hasClosestByAttribute,
|
||||
hasClosestByClassName, hasClosestByTag,
|
||||
hasClosestByClassName,
|
||||
hasClosestByTag,
|
||||
} from "../../protyle/util/hasClosest";
|
||||
import {moveToDown, moveToUp} from "../../protyle/wysiwyg/move";
|
||||
import {Constants} from "../../constants";
|
||||
|
|
@ -11,7 +12,7 @@ import {getCurrentEditor} from "../editor";
|
|||
import {fontEvent, getFontNodeElements} from "../../protyle/toolbar/Font";
|
||||
import {hideElements} from "../../protyle/ui/hideElements";
|
||||
import {softEnter} from "../../protyle/wysiwyg/enter";
|
||||
import {isInAndroid} from "../../protyle/util/compatibility";
|
||||
import {isInAndroid, isInHarmony} from "../../protyle/util/compatibility";
|
||||
|
||||
let renderKeyboardToolbarTimeout: number;
|
||||
let showUtil = false;
|
||||
|
|
@ -519,7 +520,7 @@ export const initKeyboardToolbar = () => {
|
|||
<button class="keyboard__action" data-type="done"><svg style="width: 36px"><use xlink:href="#iconKeyboardHide"></use></svg></button>
|
||||
</div>
|
||||
<div class="keyboard__util"></div>`;
|
||||
toolbarElement.addEventListener(isInAndroid() ? "touchstart" : "click", (event) => {
|
||||
toolbarElement.addEventListener(isInAndroid() || isInHarmony() ? "touchstart" : "click", (event) => {
|
||||
const protyle = getCurrentEditor()?.protyle;
|
||||
const target = event.target as HTMLElement;
|
||||
const slashBtnElement = hasClosestByClassName(event.target as HTMLElement, "keyboard__slash-item");
|
||||
|
|
|
|||
|
|
@ -9,14 +9,7 @@ import {openFile, openFileById} from "../editor/util";
|
|||
import {showMessage} from "../dialog/message";
|
||||
import {reloadProtyle} from "../protyle/util/reload";
|
||||
import {MenuItem} from "../menus/Menu";
|
||||
import {
|
||||
getDisplayName,
|
||||
getNotebookIcon,
|
||||
getNotebookName,
|
||||
movePathTo,
|
||||
pathPosix,
|
||||
useShell
|
||||
} from "../util/pathName";
|
||||
import {getDisplayName, getNotebookIcon, getNotebookName, movePathTo, pathPosix, useShell} from "../util/pathName";
|
||||
import {Protyle} from "../protyle";
|
||||
import {onGet} from "../protyle/util/onGet";
|
||||
import {addLoading} from "../protyle/ui/initUI";
|
||||
|
|
@ -1161,7 +1154,7 @@ export const getArticle = (options: {
|
|||
};
|
||||
|
||||
export const replace = (element: Element, config: Config.IUILayoutTabSearchConfig, edit: Protyle, isAll: boolean) => {
|
||||
if (config.method === 1 || config.method === 2) {
|
||||
if (config.method === 2) {
|
||||
showMessage(window.siyuan.languages._kernel[132]);
|
||||
return;
|
||||
}
|
||||
|
|
@ -1181,7 +1174,7 @@ export const replace = (element: Element, config: Config.IUILayoutTabSearchConfi
|
|||
loadElement.classList.remove("fn__none");
|
||||
const currentId = currentList.getAttribute("data-node-id");
|
||||
fetchPost("/api/search/findReplace", {
|
||||
k: config.method === 0 ? getKeyByLiElement(currentList) : searchInputElement.value,
|
||||
k: config.method === 0 || config.method === 1 ? getKeyByLiElement(currentList) : searchInputElement.value,
|
||||
r: replaceInputElement.value,
|
||||
method: config.method,
|
||||
types: config.types,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue