mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 17:10:12 +01:00
🚨
This commit is contained in:
parent
28a790f7eb
commit
daf043bd0c
6 changed files with 23 additions and 23 deletions
|
|
@ -204,7 +204,7 @@ export const about = {
|
||||||
tokenElement.addEventListener("change", () => {
|
tokenElement.addEventListener("change", () => {
|
||||||
fetchPost("/api/system/setAPIToken", {token: tokenElement.value}, () => {
|
fetchPost("/api/system/setAPIToken", {token: tokenElement.value}, () => {
|
||||||
window.siyuan.config.api.token = tokenElement.value;
|
window.siyuan.config.api.token = tokenElement.value;
|
||||||
about.element.querySelector("#tokenTip").innerHTML = window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token)
|
about.element.querySelector("#tokenTip").innerHTML = window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
about.element.querySelector("#exportLog").addEventListener("click", () => {
|
about.element.querySelector("#exportLog").addEventListener("click", () => {
|
||||||
|
|
|
||||||
|
|
@ -279,10 +279,10 @@ export class Outline extends Model {
|
||||||
if (selectItem) {
|
if (selectItem) {
|
||||||
getAllModels().editor.find(editItem => {
|
getAllModels().editor.find(editItem => {
|
||||||
if (editItem.editor.protyle.block.rootID === this.blockId) {
|
if (editItem.editor.protyle.block.rootID === this.blockId) {
|
||||||
let previousID
|
let previousID;
|
||||||
let parentID
|
let parentID;
|
||||||
const undoPreviousID = item.previousElementSibling?.getAttribute("data-node-id")
|
const undoPreviousID = item.previousElementSibling?.getAttribute("data-node-id");
|
||||||
const undoParentID = item.parentElement.previousElementSibling?.getAttribute("data-node-id")
|
const undoParentID = item.parentElement.previousElementSibling?.getAttribute("data-node-id");
|
||||||
if (selectItem.classList.contains("dragover")) {
|
if (selectItem.classList.contains("dragover")) {
|
||||||
parentID = selectItem.getAttribute("data-node-id");
|
parentID = selectItem.getAttribute("data-node-id");
|
||||||
if (selectItem.nextElementSibling && selectItem.nextElementSibling.tagName === "UL") {
|
if (selectItem.nextElementSibling && selectItem.nextElementSibling.tagName === "UL") {
|
||||||
|
|
|
||||||
|
|
@ -836,7 +836,7 @@ export const zoomOut = (options: {
|
||||||
const focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${options.focusId}"]`);
|
const focusElement = options.protyle.wysiwyg.element.querySelector(`[data-node-id="${options.focusId}"]`);
|
||||||
if (focusElement) {
|
if (focusElement) {
|
||||||
// 退出聚焦后块在折叠中 https://github.com/siyuan-note/siyuan/issues/10746
|
// 退出聚焦后块在折叠中 https://github.com/siyuan-note/siyuan/issues/10746
|
||||||
let showElement = focusElement
|
let showElement = focusElement;
|
||||||
while (showElement.getBoundingClientRect().height === 0) {
|
while (showElement.getBoundingClientRect().height === 0) {
|
||||||
showElement = showElement.parentElement;
|
showElement = showElement.parentElement;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,7 @@ export const initAbout = () => {
|
||||||
tokenElement.addEventListener("change", () => {
|
tokenElement.addEventListener("change", () => {
|
||||||
fetchPost("/api/system/setAPIToken", {token: tokenElement.value}, () => {
|
fetchPost("/api/system/setAPIToken", {token: tokenElement.value}, () => {
|
||||||
window.siyuan.config.api.token = tokenElement.value;
|
window.siyuan.config.api.token = tokenElement.value;
|
||||||
modelMainElement.querySelector("#tokenTip").innerHTML = window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token)
|
modelMainElement.querySelector("#tokenTip").innerHTML = window.siyuan.languages.about14.replace("${token}", window.siyuan.config.api.token);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -251,11 +251,11 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
|
||||||
target: calcElement
|
target: calcElement
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
let rollupIsNumber = false
|
let rollupIsNumber = false;
|
||||||
if (type === "rollup") {
|
if (type === "rollup") {
|
||||||
let relationKeyID: string
|
let relationKeyID: string;
|
||||||
let keyID: string
|
let keyID: string;
|
||||||
let avData = panelData?.data
|
let avData = panelData?.data;
|
||||||
if (!avData) {
|
if (!avData) {
|
||||||
const avResponse = await fetchSyncPost("api/av/renderAttributeView", {id: avId});
|
const avResponse = await fetchSyncPost("api/av/renderAttributeView", {id: avId});
|
||||||
avData = avResponse.data;
|
avData = avResponse.data;
|
||||||
|
|
@ -264,25 +264,25 @@ export const openCalcMenu = async (protyle: IProtyle, calcElement: HTMLElement,
|
||||||
if (item.id === colId) {
|
if (item.id === colId) {
|
||||||
relationKeyID = item.rollup?.relationKeyID;
|
relationKeyID = item.rollup?.relationKeyID;
|
||||||
keyID = item.rollup?.keyID;
|
keyID = item.rollup?.keyID;
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
if (relationKeyID && keyID) {
|
if (relationKeyID && keyID) {
|
||||||
let relationAvId: string
|
let relationAvId: string;
|
||||||
avData.view.columns.find((item) => {
|
avData.view.columns.find((item) => {
|
||||||
if (item.id === relationKeyID) {
|
if (item.id === relationKeyID) {
|
||||||
relationAvId = item.relation?.avID;
|
relationAvId = item.relation?.avID;
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
if (relationAvId) {
|
if (relationAvId) {
|
||||||
const colResponse = await fetchSyncPost("api/av/getAttributeView", {id: relationAvId})
|
const colResponse = await fetchSyncPost("api/av/getAttributeView", {id: relationAvId});
|
||||||
colResponse.data.av.keyValues.find((item: { key: { id: string, name: string, type: TAVCol } }) => {
|
colResponse.data.av.keyValues.find((item: { key: { id: string, name: string, type: TAVCol } }) => {
|
||||||
if (item.key.id === keyID) {
|
if (item.key.id === keyID) {
|
||||||
rollupIsNumber = item.key.type === "number"
|
rollupIsNumber = item.key.type === "number";
|
||||||
return true
|
return true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,12 +168,12 @@ export const uploadLocalFiles = (files: string[], protyle: IProtyle, isUpload: b
|
||||||
id: protyle.block.rootID
|
id: protyle.block.rootID
|
||||||
}, (response) => {
|
}, (response) => {
|
||||||
hideMessage(msgId);
|
hideMessage(msgId);
|
||||||
let tip = ""
|
let tip = "";
|
||||||
Object.keys(response.data.succMap).forEach(name => {
|
Object.keys(response.data.succMap).forEach(name => {
|
||||||
if (response.data.succMap[name].startsWith("file:")) {
|
if (response.data.succMap[name].startsWith("file:")) {
|
||||||
tip += name + ", "
|
tip += name + ", ";
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
if (tip) {
|
if (tip) {
|
||||||
showMessage(window.siyuan.languages.dndFolderTip.replace("${x}", `<b>${tip.substring(0, tip.length - 2)}</b>`));
|
showMessage(window.siyuan.languages.dndFolderTip.replace("${x}", `<b>${tip.substring(0, tip.length - 2)}</b>`));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue