mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
533e11cc1e
6 changed files with 15 additions and 15 deletions
|
@ -246,9 +246,9 @@ const renderSlashMenu = (protyle: IProtyle, toolbarElement: Element) => {
|
|||
${getSlashItem("#### " + Lute.Caret, "iconH4", window.siyuan.languages.heading4, "true")}
|
||||
${getSlashItem("##### " + Lute.Caret, "iconH5", window.siyuan.languages.heading5, "true")}
|
||||
${getSlashItem("###### " + Lute.Caret, "iconH6", window.siyuan.languages.heading6, "true")}
|
||||
${getSlashItem("* " + Lute.Caret, "iconList", window.siyuan.languages.list, "true")}
|
||||
${getSlashItem("- " + Lute.Caret, "iconList", window.siyuan.languages.list, "true")}
|
||||
${getSlashItem("1. " + Lute.Caret, "iconOrderedList", window.siyuan.languages["ordered-list"], "true")}
|
||||
${getSlashItem("* [ ] " + Lute.Caret, "iconCheck", window.siyuan.languages.check, "true")}
|
||||
${getSlashItem("- [ ] " + Lute.Caret, "iconCheck", window.siyuan.languages.check, "true")}
|
||||
${getSlashItem("> " + Lute.Caret, "iconQuote", window.siyuan.languages.quote, "true")}
|
||||
${getSlashItem("```", "iconCode", window.siyuan.languages.code, "true")}
|
||||
${getSlashItem(`| ${Lute.Caret} | | |\n| --- | --- | --- |\n| | | |\n| | | |`, "iconTable", window.siyuan.languages.table, "true")}
|
||||
|
|
|
@ -113,8 +113,8 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
|
|||
}, {
|
||||
filter: [window.siyuan.languages.list, "unordered list", "无序列表", "wuxvliebiao", "wuxuliebiao", "wxlb"],
|
||||
id: "list",
|
||||
value: "* " + Lute.Caret,
|
||||
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconList"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.list}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.list.custom, "* ")}</div>`,
|
||||
value: "- " + Lute.Caret,
|
||||
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconList"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.list}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.list.custom, "- ")}</div>`,
|
||||
}, {
|
||||
filter: [window.siyuan.languages["ordered-list"], "order list", "ordered list", "有序列表", "youxvliebiao", "youxuliebiao", "yxlb"],
|
||||
id: "orderedList",
|
||||
|
@ -123,7 +123,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
|
|||
}, {
|
||||
filter: [window.siyuan.languages.check, "task list", "todo list", "任务列表", "renwuliebiao", "rwlb"],
|
||||
id: "check",
|
||||
value: "* [ ] " + Lute.Caret,
|
||||
value: "- [ ] " + Lute.Caret,
|
||||
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconCheck"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.check}</span>${getHotkeyOrMarker(window.siyuan.config.keymap.editor.insert.check.custom, "[]")}</div>`,
|
||||
}, {
|
||||
filter: [window.siyuan.languages.quote, "blockquote", "bq", "引述", "yinshu", "ys"],
|
||||
|
|
|
@ -394,7 +394,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
let text = "";
|
||||
rowElements.forEach((item, i) => {
|
||||
if (rowElements.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
text += item.querySelector('.av__cell[data-dtype="block"] .av__celltext').textContent.trim();
|
||||
if (ids.length > 1 && i !== ids.length - 1) {
|
||||
|
@ -421,7 +421,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
content = `((${id} '${cellElement.querySelector(".av__celltext").textContent.replace(/[\n]+/g, " ")}'))`;
|
||||
}
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
text += content;
|
||||
if (ids.length > 1 && i !== ids.length - 1) {
|
||||
|
@ -438,7 +438,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
let text = "";
|
||||
ids.forEach((id, index) => {
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
|
||||
if (cellElement.getAttribute("data-detached") === "true") {
|
||||
|
@ -460,7 +460,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
let text = "";
|
||||
ids.forEach((id, index) => {
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
|
||||
if (cellElement.getAttribute("data-detached") === "true") {
|
||||
|
@ -490,7 +490,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
content = `[${cellElement.querySelector(".av__celltext").textContent.replace(/[\n]+/g, " ")}](siyuan://blocks/${id})`;
|
||||
}
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
text += content;
|
||||
if (ids.length > 1 && i !== ids.length - 1) {
|
||||
|
@ -517,7 +517,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
}
|
||||
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
text += content;
|
||||
if (ids.length > 1 && i !== ids.length - 1) {
|
||||
|
@ -534,7 +534,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
|
|||
let text = "";
|
||||
ids.forEach((id, index) => {
|
||||
if (ids.length > 1) {
|
||||
text += "* ";
|
||||
text += "- ";
|
||||
}
|
||||
const cellElement = rowElements[index].querySelector(".av__cell[data-dtype='block']");
|
||||
if (cellElement.getAttribute("data-detached") === "true") {
|
||||
|
|
|
@ -417,7 +417,7 @@ ${html || genSelectItemHTML({type: "empty"})}`;
|
|||
const selectedElements = options.menuElement.querySelectorAll('.b3-menu__item[draggable="true"]');
|
||||
selectedElements.forEach((item: HTMLElement) => {
|
||||
if (selectedElements.length > 1) {
|
||||
copyText += "* ";
|
||||
copyText += "- ";
|
||||
}
|
||||
const textElement = item.querySelector(".b3-menu__label") as HTMLElement;
|
||||
if (!textElement.dataset.id || textElement.dataset.id === "undefined") {
|
||||
|
|
|
@ -1352,7 +1352,7 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
let html = "";
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
if (ids.length > 1) {
|
||||
html += "* ";
|
||||
html += "- ";
|
||||
}
|
||||
const response = await fetchSyncPost("/api/block/getRefText", {id: ids[i]});
|
||||
html += `((${ids[i]} '${response.data}'))`;
|
||||
|
|
|
@ -1585,7 +1585,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
} else {
|
||||
protyle.hint.splitChar = "/";
|
||||
protyle.hint.lastIndex = -1;
|
||||
protyle.hint.fill((isMatchCheck ? "* [ ] " : (isMatchList ? "* " : "1. ")) + Lute.Caret, protyle);
|
||||
protyle.hint.fill((isMatchCheck ? "- [ ] " : (isMatchList ? "- " : "1. ")) + Lute.Caret, protyle);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue