mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🚨
This commit is contained in:
parent
62cbcf63e5
commit
25ddad5957
9 changed files with 14 additions and 15 deletions
|
|
@ -384,12 +384,12 @@ const getHightlightCoordsByRange = (pdf: any, color: string) => {
|
|||
}
|
||||
const endIndex = parseInt(endPageElement.getAttribute("data-page-number")) - 1;
|
||||
// https://github.com/siyuan-note/siyuan/issues/5213
|
||||
const rangeContents = range.cloneContents()
|
||||
const rangeContents = range.cloneContents();
|
||||
Array.from(rangeContents.children).forEach(item => {
|
||||
if (item.tagName === "BR") {
|
||||
const previousText = item.previousElementSibling.textContent
|
||||
const previousText = item.previousElementSibling.textContent;
|
||||
if (previousText.endsWith("-")) {
|
||||
item.previousElementSibling.textContent = previousText.substring(0, previousText.length - 1)
|
||||
item.previousElementSibling.textContent = previousText.substring(0, previousText.length - 1);
|
||||
} else {
|
||||
item.insertAdjacentText("afterend", " ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -563,4 +563,4 @@ export const deleteFile = (notebookId: string, pathString: string, name: string)
|
|||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -427,17 +427,17 @@ export class Wnd {
|
|||
this.removeTab(this.children[0].id);
|
||||
} else if (this.children.length > 5) { // TODO: 需从后台设置中获取
|
||||
let removeId: string;
|
||||
let openTime: string
|
||||
let openTime: string;
|
||||
this.children.forEach((item, index) => {
|
||||
if (item.headElement.classList.contains("item--pin") || item.headElement.classList.contains("item--focus") || index === oldFocusIndex) {
|
||||
return;
|
||||
}
|
||||
if (!openTime) {
|
||||
openTime = item.headElement.getAttribute("data-opentime")
|
||||
removeId = this.children[index].id
|
||||
openTime = item.headElement.getAttribute("data-opentime");
|
||||
removeId = this.children[index].id;
|
||||
} else if (item.headElement.getAttribute("data-opentime") < openTime) {
|
||||
openTime = item.headElement.getAttribute("data-opentime")
|
||||
removeId = this.children[index].id
|
||||
openTime = item.headElement.getAttribute("data-opentime");
|
||||
removeId = this.children[index].id;
|
||||
}
|
||||
});
|
||||
if (removeId) {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import {newFile} from "../util/newFile";
|
|||
import {getDockByType} from "../layout/util";
|
||||
import {confirmDialog} from "../dialog/confirmDialog";
|
||||
import {getSearch, isMobile} from "../util/functions";
|
||||
import {getDisplayName, isLocalPath, movePathTo} from "../util/pathName";
|
||||
import {isLocalPath, movePathTo} from "../util/pathName";
|
||||
import {MenuItem} from "./Menu";
|
||||
import {hasClosestByClassName} from "../protyle/util/hasClosest";
|
||||
import {saveExport} from "../protyle/export";
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
|||
// * _ [ ] ! \ ` < > & ~ { } ( ) = # $ ^ |
|
||||
let clipText = await navigator.clipboard.readText();
|
||||
clipText = clipText.replace(/\*/g, "\\*").replace(/\_/g, "\\_").replace(/\[/g, "\\[").replace(/\]/g, "\\]").replace(/\!/g, "\\!").replace(/\\/g, "\\").replace(/\`/g, "\\`").replace(/\</g, "\\<").replace(/\>/g, "\\>").
|
||||
replace(/\&/g, "\\&").replace(/\~/g, "\\~").replace(/\{/g, "\\{").replace(/\}/g, "\\}").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\=/g, "\\=").replace(/\#/g, "\\#").replace(/\$/g, "\\$").replace(/\^/g, "\\^").replace(/\|/g, "\\|")
|
||||
replace(/\&/g, "\\&").replace(/\~/g, "\\~").replace(/\{/g, "\\{").replace(/\}/g, "\\}").replace(/\(/g, "\\(").replace(/\)/g, "\\)").replace(/\=/g, "\\=").replace(/\#/g, "\\#").replace(/\$/g, "\\$").replace(/\^/g, "\\^").replace(/\|/g, "\\|");
|
||||
pasteText(protyle, clipText, nodeElement);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
|
|
|
|||
|
|
@ -261,7 +261,7 @@ export class Title {
|
|||
icon: "iconTrashcan",
|
||||
label: window.siyuan.languages.delete,
|
||||
click: () => {
|
||||
deleteFile(protyle.notebookId, protyle.path, escapeHtml(this.editElement.textContent))
|
||||
deleteFile(protyle.notebookId, protyle.path, escapeHtml(this.editElement.textContent));
|
||||
}
|
||||
}).element);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import {isCtrl} from "./compatibility";
|
||||
import {Constants} from "../../constants";
|
||||
|
||||
// 是否匹配 ⇧⌘[] / ⌘[] / ⌥[] / ⌥⌘[] / ⇧Tab / []
|
||||
export const matchHotKey = (hotKey: string, event: KeyboardEvent) => {
|
||||
|
|
|
|||
|
|
@ -1468,7 +1468,7 @@ export class WYSIWYG {
|
|||
|
||||
const embedItemElement = hasClosestByClassName(event.target, "protyle-wysiwyg__embed");
|
||||
if (embedItemElement) {
|
||||
const embedId = embedItemElement.getAttribute("data-id")
|
||||
const embedId = embedItemElement.getAttribute("data-id");
|
||||
if (isMobile()) {
|
||||
openMobileFileById(embedId, false, [Constants.CB_GET_ALL]);
|
||||
} else if (window.siyuan.shiftIsPressed) {
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ const initBar = () => {
|
|||
});
|
||||
resizeTabs();
|
||||
});
|
||||
document.getElementById("toolbarVIP").addEventListener("click", (event) => {
|
||||
document.getElementById("toolbarVIP").addEventListener("click", () => {
|
||||
const dialogSetting = openSetting();
|
||||
dialogSetting.element.querySelector('.b3-tab-bar [data-name="account"]').dispatchEvent(new CustomEvent("click"));
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue