mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
eba5808af2
commit
dbff939601
3 changed files with 16 additions and 4 deletions
|
|
@ -25,6 +25,7 @@ import {resizeDrag} from "./layout/util";
|
||||||
import {getAllTabs} from "./layout/getAll";
|
import {getAllTabs} from "./layout/getAll";
|
||||||
import {getLocalStorage} from "./protyle/util/compatibility";
|
import {getLocalStorage} from "./protyle/util/compatibility";
|
||||||
import {updateEditModeElement} from "./layout/topBar";
|
import {updateEditModeElement} from "./layout/topBar";
|
||||||
|
import {getSearch} from "./util/functions";
|
||||||
|
|
||||||
class App {
|
class App {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
|
@ -171,3 +172,13 @@ class App {
|
||||||
}
|
}
|
||||||
|
|
||||||
new App();
|
new App();
|
||||||
|
window.openFileByURL = (openURL) => {
|
||||||
|
if (openURL && /^siyuan:\/\/blocks\/\d{14}-\w{7}/.test(openURL)) {
|
||||||
|
openFileById({
|
||||||
|
id: openURL.substr(16, 22),
|
||||||
|
action:getSearch("focus", openURL) === "1" ? [Constants.CB_GET_ALL, Constants.CB_GET_FOCUS] : [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT]
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
|
||||||
|
|
@ -131,11 +131,9 @@ export const initFramework = () => {
|
||||||
});
|
});
|
||||||
initEditorName();
|
initEditorName();
|
||||||
if (getOpenNotebookCount() > 0) {
|
if (getOpenNotebookCount() > 0) {
|
||||||
if (window.JSAndroid) {
|
if (window.JSAndroid && window.openFileByURL(window.JSAndroid.getBlockURL())) {
|
||||||
if (window.openFileByURL(window.JSAndroid.getBlockURL())) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
const openId = getSearch("id");
|
const openId = getSearch("id");
|
||||||
if (openId) {
|
if (openId) {
|
||||||
openMobileFileById(openId,
|
openMobileFileById(openId,
|
||||||
|
|
|
||||||
|
|
@ -149,6 +149,9 @@ export const onGetConfig = (isStart: boolean) => {
|
||||||
window.siyuan.emojis = response.data as IEmoji[];
|
window.siyuan.emojis = response.data as IEmoji[];
|
||||||
try {
|
try {
|
||||||
JSONToLayout(isStart);
|
JSONToLayout(isStart);
|
||||||
|
if (window.JSAndroid) {
|
||||||
|
window.openFileByURL(window.JSAndroid.getBlockURL())
|
||||||
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
resetLayout();
|
resetLayout();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue