Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/14812

Vanessa8a8f9f9dd426
diff --git a/app/src/menus/util.ts b/app/src/menus/util.ts
index bd212cf8ef..d5c9ebd5dc 100644
--- a/app/src/menus/util.ts
+++ b/app/src/menus/util.ts
@@ -11,6 +11,7 @@ import {MenuItem} from "./Menu";
import {App} from "../index";
import {exportByMobile, isInAndroid, updateHotkeyTip} from "../protyle/util/compatibility";
import {checkFold} from "../util/noRelyPCFunction";
+import {showMessage} from "../dialog/message";
export const exportAsset = (src: string) => {
return {
@@ -174,6 +175,7 @@ export const openEditorTab = (app: App, ids: string[], notebookId?: string, path
export const copyPNGByLink = (link: string) => {
if (isInAndroid()) {
+ showMessage(link);
window.JSAndroid.writeImageClipboard(link);
} else {
const canvas = document.createElement("canvas");
diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.ts
index d09b52ea8d..4062485139 100644
--- a/app/src/protyle/toolbar/index.ts
+++ b/app/src/protyle/toolbar/index.ts
@@ -1530,7 +1530,7 @@ ${item.name}
let html = "";
const hasCopy = range.toString() !== "" || (range.cloneContents().childNodes[0] as HTMLElement)?.classList?.contains("emoji");
if (hasCopy) {
- html += "<button class=\"keyboard__action\" data-action=\"copy\"><svg><use xlink:href=\"#iconCopy\"></use></svg></button>";
+ html += '<button class="keyboard__action" data-action="copy"><svg><use xlink:href="#iconCopy"></use></svg></button>';
if (!protyle.disabled) {
html += `<button class="keyboard__action" data-action="cut"><svg><use xlink:href="#iconCut"></use></svg></button>
<button class="keyboard__action" data-action="delete"><svg><use xlink:href="#iconTrashcan"></use></svg></button>`;
@@ -1570,9 +1570,13 @@ ${item.name}
} else if (action === "paste") {
if (document.queryCommandSupported("paste")) {
document.execCommand("paste");
+ showMessage("document paste");
} else {
try {
const text = await readClipboard();
+ showMessage("clipboard textHTML" + text.textHTML);
+ showMessage("clipboard textPlain" + text.textPlain);
+ showMessage("clipboard files" + text.files.length);
paste(protyle, Object.assign(text, {target: nodeElement as HTMLElement}));
} catch (e) {
console.log(e);