mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-23 18:10:12 +01:00
This commit is contained in:
parent
9bbfd2a3e4
commit
8fe520f4af
8 changed files with 67 additions and 8 deletions
|
|
@ -21,8 +21,11 @@ import {getAllTabs} from "../layout/getAll";
|
|||
import {getLocalStorage} from "../protyle/util/compatibility";
|
||||
import {init} from "../window/init";
|
||||
import {positionPDF, switchTabById} from "./global/function";
|
||||
import {loadPlugins} from "../plugin/loader";
|
||||
|
||||
class App {
|
||||
public plugins: import("../plugin").Plugin[] = [];
|
||||
|
||||
constructor() {
|
||||
addScriptSync(`${Constants.PROTYLE_CDN}/js/lute/lute.min.js?v=${Constants.SIYUAN_VERSION}`, "protyleLuteScript");
|
||||
addScript(`${Constants.PROTYLE_CDN}/js/protyle-html.js?v=${Constants.SIYUAN_VERSION}`, "protyleWcHtmlScript");
|
||||
|
|
@ -40,6 +43,9 @@ class App {
|
|||
id: genUUID(),
|
||||
type: "main",
|
||||
msgCallback: (data) => {
|
||||
this.plugins.forEach((plugin) => {
|
||||
plugin.eventBus.emit("ws-main", data);
|
||||
});
|
||||
if (data) {
|
||||
switch (data.cmd) {
|
||||
case "syncMergeResult":
|
||||
|
|
@ -128,6 +134,7 @@ class App {
|
|||
window.siyuan.menus = new Menus();
|
||||
fetchPost("/api/setting/getCloudUser", {}, userResponse => {
|
||||
window.siyuan.user = userResponse.data;
|
||||
loadPlugins(siyuanApp);
|
||||
init();
|
||||
setTitle(window.siyuan.languages.siyuanNote);
|
||||
initMessage();
|
||||
|
|
@ -141,7 +148,7 @@ class App {
|
|||
}
|
||||
}
|
||||
|
||||
new App();
|
||||
const siyuanApp = new App();
|
||||
|
||||
// 再次点击新窗口已打开的 PDF 时,需进行定位
|
||||
window.newWindow = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue