mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
🚨
This commit is contained in:
parent
6e02c3e930
commit
7fb533fa9d
5 changed files with 11 additions and 11 deletions
|
|
@ -219,7 +219,7 @@ ${window.siyuan.languages.account8}`;
|
||||||
});
|
});
|
||||||
const activationCodeElement = account.element.querySelector("#activationCode");
|
const activationCodeElement = account.element.querySelector("#activationCode");
|
||||||
activationCodeElement.addEventListener("click", () => {
|
activationCodeElement.addEventListener("click", () => {
|
||||||
const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement)
|
const activationCodeInput = (activationCodeElement.previousElementSibling as HTMLInputElement);
|
||||||
fetchPost("/api/account/checkActivationcode", {data: activationCodeInput.value}, (response) => {
|
fetchPost("/api/account/checkActivationcode", {data: activationCodeInput.value}, (response) => {
|
||||||
if (0 !== response.code) {
|
if (0 !== response.code) {
|
||||||
activationCodeInput.value = "";
|
activationCodeInput.value = "";
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ export const bazaar = {
|
||||||
url = "/api/bazaar/installBazaarWidget";
|
url = "/api/bazaar/installBazaarWidget";
|
||||||
}
|
}
|
||||||
target.parentElement.insertAdjacentHTML("afterend", "<img data-type=\"img-loading\" style=\"position: absolute;top: 0;left: 0;height: 100%;width: 100%;padding: 48px;box-sizing: border-box;\" src=\"/stage/loading-pure.svg\">");
|
target.parentElement.insertAdjacentHTML("afterend", "<img data-type=\"img-loading\" style=\"position: absolute;top: 0;left: 0;height: 100%;width: 100%;padding: 48px;box-sizing: border-box;\" src=\"/stage/loading-pure.svg\">");
|
||||||
const name = target.parentElement.getAttribute("data-name")
|
const name = target.parentElement.getAttribute("data-name");
|
||||||
fetchPost(url, {
|
fetchPost(url, {
|
||||||
repoURL: target.parentElement.getAttribute("data-url"),
|
repoURL: target.parentElement.getAttribute("data-url"),
|
||||||
packageName: name,
|
packageName: name,
|
||||||
|
|
|
||||||
|
|
@ -279,32 +279,32 @@ export const JSONToLayout = () => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.outline.forEach(item => {
|
allModels.outline.forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.search.forEach(item => {
|
allModels.search.forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.asset.forEach(item => {
|
allModels.asset.forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.graph.forEach(item => {
|
allModels.graph.forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
allModels.backlinks.forEach(item => {
|
allModels.backlinks.forEach(item => {
|
||||||
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
if (item.parent.headElement && !item.parent.headElement.classList.contains("item--pin")) {
|
||||||
item.parent.parent.removeTab(item.parent.id);
|
item.parent.parent.removeTab(item.parent.id);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,7 @@ const listEnter = (protyle: IProtyle, blockElement: HTMLElement, range: Range) =
|
||||||
};
|
};
|
||||||
|
|
||||||
export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle) => {
|
export const enter = (blockElement: HTMLElement, range: Range, protyle: IProtyle) => {
|
||||||
const disableElement = isNotEditBlock(blockElement)
|
const disableElement = isNotEditBlock(blockElement);
|
||||||
if ((!disableElement || blockElement.classList.contains("hr")) && blockElement.classList.contains("protyle-wysiwyg--select")) {
|
if ((!disableElement || blockElement.classList.contains("hr")) && blockElement.classList.contains("protyle-wysiwyg--select")) {
|
||||||
setLastNodeRange(getContenteditableElement(blockElement), range, false);
|
setLastNodeRange(getContenteditableElement(blockElement), range, false);
|
||||||
range.collapse(false);
|
range.collapse(false);
|
||||||
|
|
|
||||||
|
|
@ -338,7 +338,7 @@ export const globalShortcut = () => {
|
||||||
let icon = `<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>`;
|
let icon = `<svg class="b3-list-item__graphic"><use xlink:href="#${item.icon}"></use></svg>`;
|
||||||
let rootId = "";
|
let rootId = "";
|
||||||
if (item.model instanceof Editor) {
|
if (item.model instanceof Editor) {
|
||||||
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`
|
rootId = ` data-node-id="${item.model.editor.protyle.block.rootID}"`;
|
||||||
icon = `<span class="b3-list-item__graphic">${unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE)}</span>`;
|
icon = `<span class="b3-list-item__graphic">${unicode2Emoji(item.docIcon || Constants.SIYUAN_IMAGE_FILE)}</span>`;
|
||||||
}
|
}
|
||||||
tabHtml += `<li data-id="${item.id}"${rootId} class="b3-list-item${currentId === item.id ? " b3-list-item--focus" : ""}"${currentId === item.id ? ' data-original="true"' : ""}>${icon}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;
|
tabHtml += `<li data-id="${item.id}"${rootId} class="b3-list-item${currentId === item.id ? " b3-list-item--focus" : ""}"${currentId === item.id ? ' data-original="true"' : ""}>${icon}<span class="b3-list-item__text">${escapeHtml(item.title)}</span></li>`;
|
||||||
|
|
@ -575,7 +575,7 @@ export const globalShortcut = () => {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
let activeTabElement = document.querySelector(".block__icons--active");
|
let activeTabElement = document.querySelector(".block__icons--active");
|
||||||
if (activeTabElement && activeTabElement.getBoundingClientRect().width > 0) {
|
if (activeTabElement && activeTabElement.getBoundingClientRect().width > 0) {
|
||||||
let type: TDockType
|
let type: TDockType;
|
||||||
Array.from(activeTabElement.parentElement.classList).find(item => {
|
Array.from(activeTabElement.parentElement.classList).find(item => {
|
||||||
if (item.startsWith("sy__")) {
|
if (item.startsWith("sy__")) {
|
||||||
type = item.replace("sy__", "") as TDockType;
|
type = item.replace("sy__", "") as TDockType;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue