mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-24 07:54:07 +01:00
🚨
This commit is contained in:
parent
dd19b9bc44
commit
2ae388d2bb
9 changed files with 18 additions and 23 deletions
|
|
@ -400,7 +400,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
} else if (window.siyuan.config.editor.displayNetImgMark) {
|
||||
assetElement.querySelector(".protyle-action__drag").insertAdjacentHTML("afterend", '<span class="img__net"><svg><use xlink:href="#iconLanguage"></use></svg></span>');
|
||||
}
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
html = nodeElement.outerHTML;
|
||||
});
|
||||
|
|
@ -419,7 +419,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
assetElement.style.maxWidth = (imgElement.clientWidth + 10) + "px";
|
||||
});
|
||||
inputElement.addEventListener("change", () => {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
html = nodeElement.outerHTML;
|
||||
});
|
||||
|
|
@ -432,7 +432,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
inputElement.value = imgElement.getAttribute("alt") || "";
|
||||
inputElement.addEventListener("change", (event) => {
|
||||
imgElement.setAttribute("alt", (event.target as HTMLInputElement).value);
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
html = nodeElement.outerHTML;
|
||||
});
|
||||
|
|
@ -476,7 +476,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
click() {
|
||||
writeText(protyle.lute.BlockDOM2Md(assetElement.outerHTML));
|
||||
(assetElement as HTMLElement).outerHTML = "<wbr>";
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
focusByWbr(protyle.wysiwyg.element, range);
|
||||
}
|
||||
|
|
@ -487,7 +487,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
label: window.siyuan.languages.delete,
|
||||
click: function () {
|
||||
(assetElement as HTMLElement).outerHTML = "<wbr>";
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
focusByWbr(protyle.wysiwyg.element, range);
|
||||
}
|
||||
|
|
@ -498,7 +498,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
label: window.siyuan.languages.alignCenter,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.alignCenter.custom,
|
||||
click() {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
assetElement.style.display = "block";
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
}
|
||||
|
|
@ -508,7 +508,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
label: window.siyuan.languages.alignLeft,
|
||||
accelerator: window.siyuan.config.keymap.editor.general.alignLeft.custom,
|
||||
click() {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
assetElement.style.display = "";
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
|
|||
rangeElement.parentElement.setAttribute("aria-label", `${rangeElement.value}%`);
|
||||
});
|
||||
rangeElement.addEventListener("change", () => {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
updateTransaction(protyle, id, nodeElement.outerHTML, html);
|
||||
window.siyuan.menus.menu.remove();
|
||||
focusBlock(nodeElement);
|
||||
|
|
@ -685,7 +685,7 @@ const genImageWidthMenu = (label: string, assetElement: HTMLElement, imgElement:
|
|||
return {
|
||||
label,
|
||||
click() {
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"))
|
||||
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
|
||||
assetElement.style.width = label === window.siyuan.languages.default ? "" : label;
|
||||
imgElement.style.width = label === window.siyuan.languages.default ? "" : "10000px";
|
||||
assetElement.style.maxWidth = label === window.siyuan.languages.default ? (imgElement.clientWidth + 10) + "px" : "";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue