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/14159

Vanessaf5a72edcfde2
diff --git a/app/src/index.ts b/app/src/index.ts
index 4bb8a25191..45affd8fdb 100644
--- a/app/src/index.ts
+++ b/app/src/index.ts
@@ -31,6 +31,7 @@ import {hideAllElements} from "./protyle/ui/hideElements";
import {loadPlugins, reloadPlugin} from "./plugin/loader";
import "./assets/scss/base.scss";
import {reloadEmoji} from "./emoji";
+import {IOSPurchase} from "./util/iOSPurchase";
export class App {
public plugins: import("./plugin").Plugin[] = [];
@@ -208,4 +209,5 @@ window.openFileByURL = (openURL) => {
window.showKeyboardToolbar = () => {
// 防止 Pad 端报错
};
+window.IOSPurchase = IOSPurchase;
/// #endif
diff --git a/app/src/mobile/index.ts b/app/src/mobile/index.ts
index d9205b869b..8cf0ad0f42 100644
--- a/app/src/mobile/index.ts
+++ b/app/src/mobile/index.ts
@@ -28,6 +28,7 @@ import {isNotEditBlock} from "../protyle/wysiwyg/getBlock";
import {updateCardHV} from "../card/util";
import {mobileKeydown} from "./util/keydown";
import {correctHotkey} from "../boot/globalEvent/commonHotkey";
+import {IOSPurchase} from "../util/iOSPurchase";
class App {
public plugins: import("../plugin").Plugin[] = [];
@@ -162,6 +163,7 @@ window.reconnectWebSocket = () => {
window.siyuan.mobile.popEditor.protyle.ws.send("ping", {});
};
window.goBack = goBack;
+window.IOSPurchase = IOSPurchase;
window.showKeyboardToolbar = (height) => {
document.getElementById("keyboardToolbar").setAttribute("data-keyboardheight", (height ? height : window.outerHeight / 2 - 42).toString());
showKeyboardToolbar();
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index ef72c81616..43c2608c7d 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -224,6 +224,8 @@ interface Window {
showKeyboardToolbar(height: number): void
+ IOSPurchase(data: string): void
+
hideKeyboardToolbar(): void
openFileByURL(URL: string): boolean
diff --git a/app/src/util/iOSPurchase.ts b/app/src/util/iOSPurchase.ts
new file mode 100644
index 0000000000..52179996f6
--- /dev/null
+++ b/app/src/util/iOSPurchase.ts
@@ -0,0 +1,9 @@
+export const IOSPurchase = (data:string) => {
+ /// #if MOBILE
+ document.querySelector("#modelMain").dispatchEvent(new CustomEvent("click", {
+ detail: document.querySelector("#modelMain #refresh")
+ }));
+ /// #else
+ document.querySelector('.config__tab-container[data-name="account"] #refresh').dispatchEvent(new Event("click"));
+ /// #endif
+}