mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-26 11:28:49 +01:00
This commit is contained in:
parent
bfcdf3c352
commit
9a834d0464
3 changed files with 14 additions and 5 deletions
|
|
@ -17,6 +17,8 @@ import {initMessage} from "../dialog/message";
|
|||
import {goBack} from "./util/MobileBackFoward";
|
||||
import {hideKeyboardToolbar, showKeyboardToolbar} from "./util/showKeyboardToolbar";
|
||||
import {getLocalStorage} from "../protyle/util/compatibility";
|
||||
import {openMobileFileById} from "./editor";
|
||||
import {getSearch} from "../util/functions";
|
||||
|
||||
class App {
|
||||
constructor() {
|
||||
|
|
@ -82,3 +84,11 @@ new App();
|
|||
window.goBack = goBack;
|
||||
window.showKeyboardToolbar = showKeyboardToolbar;
|
||||
window.hideKeyboardToolbar = hideKeyboardToolbar;
|
||||
window.openFileByURL = (openURL) => {
|
||||
if (openURL && !/^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(openURL)) {
|
||||
openMobileFileById(openURL.substr(16, 22),
|
||||
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,11 +138,8 @@ export const initFramework = () => {
|
|||
});
|
||||
if (getOpenNotebookCount() > 0) {
|
||||
if (window.JSAndroid) {
|
||||
const openURL = window.JSAndroid.getBlockURL();
|
||||
if (openURL && !/^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(openURL)) {
|
||||
openMobileFileById(openURL.substr(16, 22),
|
||||
getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]);
|
||||
return;
|
||||
if (window.openFileByURL(window.JSAndroid.getBlockURL())) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
const openId = getSearch("id");
|
||||
|
|
|
|||
2
app/src/types/index.d.ts
vendored
2
app/src/types/index.d.ts
vendored
|
|
@ -50,6 +50,8 @@ interface Window {
|
|||
showKeyboardToolbar(bottom?: number): void
|
||||
|
||||
hideKeyboardToolbar(): void
|
||||
|
||||
openFileByURL(URL: string): boolean
|
||||
}
|
||||
|
||||
interface IWorkspace {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue