This commit is contained in:
Vanessa 2022-11-21 10:05:47 +08:00
parent b61ebcefe5
commit 450a8be783
6 changed files with 1 additions and 55 deletions

View file

@ -117,8 +117,6 @@
"custom": "Custom",
"feedback": "Feedback",
"inbox": "Inbox",
"turnToStaticRef": "Static anchor text ref",
"turnToDynamicRef": "Dynamic anchor text ref",
"turnToStatic": "Static anchor text",
"turnToDynamic": "Dynamic anchor text",
"sizeLimit": "Limit",

View file

@ -117,8 +117,6 @@
"custom": "Personalizado",
"feedback": "Comentarios",
"inbox": "Bandeja de entrada",
"turnToStaticRef": "Texto de anclaje estático ref",
"turnToDynamicRef": "Texto de anclaje dinámico ref",
"turnToStatic": "Texto de anclaje estático",
"turnToDynamic": "Texto de anclaje dinámico",
"sizeLimit": "Límite",

View file

@ -117,8 +117,6 @@
"custom": "Personnalisé",
"feedback": "Commentaires",
"inbox": "Boîte de réception",
"turnToStaticRef": "Référence de texte d'ancre statique",
"turnToDynamicRef": "Référence de texte d'ancre dynamique",
"turnToStatic": "Texte d'ancrage statique",
"turnToDynamic": "Texte d'ancrage dynamique",
"sizeLimit": "Limite",

View file

@ -117,8 +117,6 @@
"custom": "自定義",
"feedback": "反饋",
"inbox": "收件箱",
"turnToStaticRef": "靜態錨文本引用",
"turnToDynamicRef": "動態錨文本引用",
"turnToStatic": "靜態錨文本",
"turnToDynamic": "動態錨文本",
"sizeLimit": "上限",

View file

@ -117,8 +117,6 @@
"custom": "自定义",
"feedback": "反馈",
"inbox": "收集箱",
"turnToStaticRef": "静态锚文本引用",
"turnToDynamicRef": "动态锚文本引用",
"turnToStatic": "静态锚文本",
"turnToDynamic": "动态锚文本",
"sizeLimit": "上限",

View file

@ -53,28 +53,7 @@ export class MobileBacklinks {
element: this.element.querySelector(".backlinkMList") as HTMLElement,
data: null,
click: (element, event) => {
const actionElement = hasClosestByClassName(event.target as HTMLElement, "b3-list-item__action");
if (actionElement) {
if (actionElement.firstElementChild.classList.contains("fn__rotate")) {
return;
}
window.siyuan.menus.menu.remove();
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.turnInto + " " + window.siyuan.languages.turnToStaticRef,
click: () => {
this.turnToRef(element, false);
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
label: window.siyuan.languages.turnInto + " " + window.siyuan.languages.turnToDynamicRef,
click: () => {
this.turnToRef(element, true);
}
}).element);
window.siyuan.menus.menu.popup({x: event.clientX, y: event.clientY});
} else {
openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
}
openMobileFileById(element.getAttribute("data-node-id"), [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
},
blockExtHTML: '<span class="b3-list-item__action"><svg><use xlink:href="#iconMore"></use></svg></span>'
});
@ -129,29 +108,6 @@ export class MobileBacklinks {
this.update();
}
private turnToRef(element: HTMLElement, isDynamic:boolean) {
element.querySelector(".b3-list-item__action").innerHTML = '<svg class="fn__rotate"><use xlink:href="#iconRefresh"></use></svg>';
fetchPost("/api/ref/createBacklink", {
refID: element.getAttribute("data-node-id"),
refText: decodeURIComponent(element.getAttribute("data-ref-text")),
defID: window.siyuan.mobileEditor.protyle.block.id,
pushMode: 0,
isDynamic
}, response => {
if (response.data.defID === window.siyuan.mobileEditor.protyle.block.id) {
this.update();
}
if (response.data.refRootID === window.siyuan.mobileEditor.protyle.block.rootID) {
fetchPost("/api/filetree/getDoc", {
id: window.siyuan.mobileEditor.protyle.block.id,
size: window.siyuan.config.editor.dynamicLoadBlocks,
}, getResponse => {
onGet(getResponse, window.siyuan.mobileEditor.protyle);
});
}
});
}
public update() {
fetchPost("/api/ref/getBacklink", {
id: window.siyuan.mobileEditor.protyle.block.id,