mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-20 00:20:12 +01:00
This commit is contained in:
parent
8bf263a871
commit
f5a72edcfd
4 changed files with 15 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -224,6 +224,8 @@ interface Window {
|
|||
|
||||
showKeyboardToolbar(height: number): void
|
||||
|
||||
IOSPurchase(data: string): void
|
||||
|
||||
hideKeyboardToolbar(): void
|
||||
|
||||
openFileByURL(URL: string): boolean
|
||||
|
|
|
|||
9
app/src/util/iOSPurchase.ts
Normal file
9
app/src/util/iOSPurchase.ts
Normal file
|
|
@ -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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue