mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 10:00:13 +01:00
This commit is contained in:
parent
a90402845b
commit
955d6b4610
7 changed files with 41 additions and 9 deletions
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "Percent checked",
|
"percentChecked": "Percent checked",
|
||||||
"percentUnchecked": "Percent unchecked",
|
"percentUnchecked": "Percent unchecked",
|
||||||
"checkbox": "Checkbox",
|
"checkbox": "Checkbox",
|
||||||
"copyInline": "Copy inline element",
|
|
||||||
"unsplit": "Unsplit",
|
"unsplit": "Unsplit",
|
||||||
"unsplitAll": "Unsplit All",
|
"unsplitAll": "Unsplit All",
|
||||||
"resetCardTip": "Are you sure reset ${x} flashcards?",
|
"resetCardTip": "Are you sure reset ${x} flashcards?",
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "Porcentaje comprobado",
|
"percentChecked": "Porcentaje comprobado",
|
||||||
"percentUnchecked": "Porcentaje no marcado",
|
"percentUnchecked": "Porcentaje no marcado",
|
||||||
"checkbox": "Casilla de verificación",
|
"checkbox": "Casilla de verificación",
|
||||||
"copyInline": "Copiar elemento en línea",
|
|
||||||
"unsplit": "Desdividir",
|
"unsplit": "Desdividir",
|
||||||
"unsplitAll": "Desdividir Todo",
|
"unsplitAll": "Desdividir Todo",
|
||||||
"resetCardTip": "¿Estás seguro de restablecer ${x} tarjetas?",
|
"resetCardTip": "¿Estás seguro de restablecer ${x} tarjetas?",
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "Pourcentage vérifié",
|
"percentChecked": "Pourcentage vérifié",
|
||||||
"percentUnchecked": "Pourcentage non coché",
|
"percentUnchecked": "Pourcentage non coché",
|
||||||
"checkbox": "case à cocher",
|
"checkbox": "case à cocher",
|
||||||
"copyInline": "Copier l'élément en ligne",
|
|
||||||
"unsplit": "Unsplit",
|
"unsplit": "Unsplit",
|
||||||
"unsplitAll": "Tout dédiviser",
|
"unsplitAll": "Tout dédiviser",
|
||||||
"resetCardTip": "Êtes-vous sûr de réinitialiser ${x} flashcards ?",
|
"resetCardTip": "Êtes-vous sûr de réinitialiser ${x} flashcards ?",
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "チェック済みの割合",
|
"percentChecked": "チェック済みの割合",
|
||||||
"percentUnchecked": "未チェックの割合",
|
"percentUnchecked": "未チェックの割合",
|
||||||
"checkbox": "チェックボックス",
|
"checkbox": "チェックボックス",
|
||||||
"copyInline": "インライン要素をコピー",
|
|
||||||
"unsplit": "分割解除",
|
"unsplit": "分割解除",
|
||||||
"unsplitAll": "すべての分割解除",
|
"unsplitAll": "すべての分割解除",
|
||||||
"resetCardTip": "${x} 枚のフラッシュカードをリセットしてもよろしいですか?",
|
"resetCardTip": "${x} 枚のフラッシュカードをリセットしてもよろしいですか?",
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "已完成佔比",
|
"percentChecked": "已完成佔比",
|
||||||
"percentUnchecked": "未完成佔比",
|
"percentUnchecked": "未完成佔比",
|
||||||
"checkbox": "勾選方塊",
|
"checkbox": "勾選方塊",
|
||||||
"copyInline": "複製行級元素",
|
|
||||||
"unsplit": "取消分割畫面",
|
"unsplit": "取消分割畫面",
|
||||||
"unsplitAll": "取消全部分螢幕",
|
"unsplitAll": "取消全部分螢幕",
|
||||||
"resetCardTip": "確定重設 ${x} 張閃卡?",
|
"resetCardTip": "確定重設 ${x} 張閃卡?",
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@
|
||||||
"percentChecked": "已完成占比",
|
"percentChecked": "已完成占比",
|
||||||
"percentUnchecked": "未完成占比",
|
"percentUnchecked": "未完成占比",
|
||||||
"checkbox": "勾选框",
|
"checkbox": "勾选框",
|
||||||
"copyInline": "复制行级元素",
|
|
||||||
"unsplit": "取消分屏",
|
"unsplit": "取消分屏",
|
||||||
"unsplitAll": "取消全部分屏",
|
"unsplitAll": "取消全部分屏",
|
||||||
"resetCardTip": "确定重置 ${x} 张闪卡?",
|
"resetCardTip": "确定重置 ${x} 张闪卡?",
|
||||||
|
|
|
||||||
|
|
@ -653,6 +653,8 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
||||||
/// #if MOBILE
|
/// #if MOBILE
|
||||||
protyle.toolbar.showContent(protyle, range, nodeElement);
|
protyle.toolbar.showContent(protyle, range, nodeElement);
|
||||||
/// #else
|
/// #else
|
||||||
|
const oldHTML = nodeElement.outerHTML;
|
||||||
|
const id = nodeElement.getAttribute("data-node-id")
|
||||||
if (range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList?.contains("emoji")) {
|
if (range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList?.contains("emoji")) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
icon: "iconCopy",
|
icon: "iconCopy",
|
||||||
|
|
@ -691,11 +693,10 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
||||||
click() {
|
click() {
|
||||||
const currentRange = getEditorRange(nodeElement);
|
const currentRange = getEditorRange(nodeElement);
|
||||||
currentRange.insertNode(document.createElement("wbr"));
|
currentRange.insertNode(document.createElement("wbr"));
|
||||||
const oldHTML = nodeElement.outerHTML;
|
|
||||||
currentRange.extractContents();
|
currentRange.extractContents();
|
||||||
focusByWbr(nodeElement, currentRange);
|
focusByWbr(nodeElement, currentRange);
|
||||||
focusByRange(currentRange);
|
focusByRange(currentRange);
|
||||||
updateTransaction(protyle, nodeElement.getAttribute("data-node-id"), nodeElement.outerHTML, oldHTML);
|
updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -705,11 +706,48 @@ export const contentMenu = (protyle: IProtyle, nodeElement: Element) => {
|
||||||
const inlineTypes = protyle.toolbar.getCurrentType(range);
|
const inlineTypes = protyle.toolbar.getCurrentType(range);
|
||||||
if (inlineTypes.includes("code") || inlineTypes.includes("kbd")) {
|
if (inlineTypes.includes("code") || inlineTypes.includes("kbd")) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
label: window.siyuan.languages.copyInline,
|
label: window.siyuan.languages.copy,
|
||||||
|
icon:"iconCopy",
|
||||||
|
click() {
|
||||||
|
writeText(protyle.lute.BlockDOM2StdMd(inlineElement.outerHTML));
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
label: window.siyuan.languages.copyPlainText,
|
||||||
click() {
|
click() {
|
||||||
copyPlainText(inlineElement.textContent);
|
copyPlainText(inlineElement.textContent);
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
if (!protyle.disabled) {
|
||||||
|
const id = nodeElement.getAttribute("data-node-id");
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
icon: "iconCut",
|
||||||
|
label: window.siyuan.languages.cut,
|
||||||
|
click() {
|
||||||
|
writeText(protyle.lute.BlockDOM2StdMd(inlineElement.outerHTML));
|
||||||
|
|
||||||
|
inlineElement.insertAdjacentHTML("afterend", "<wbr>");
|
||||||
|
inlineElement.remove();
|
||||||
|
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||||
|
updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML);
|
||||||
|
focusByWbr(nodeElement, protyle.toolbar.range);
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
icon: "iconTrashcan",
|
||||||
|
label: window.siyuan.languages.remove,
|
||||||
|
click() {
|
||||||
|
inlineElement.insertAdjacentHTML("afterend", "<wbr>");
|
||||||
|
inlineElement.remove();
|
||||||
|
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||||
|
updateTransaction(protyle, id, nodeElement.outerHTML, oldHTML);
|
||||||
|
focusByWbr(nodeElement, protyle.toolbar.range);
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
|
}
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
type: "separator",
|
||||||
|
}).element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue