From 25275fc89597c13cc5f4096a8452bdf3f83a6b8c Mon Sep 17 00:00:00 2001 From: viviSoltus Date: Fri, 9 Dec 2022 20:04:11 +0800 Subject: [PATCH] no message --- .../Publish_Helper/renderPublishHelper.js | 126 ++++++++++-------- script/lili_sprite.js | 2 - theme.json | 2 +- 3 files changed, 69 insertions(+), 61 deletions(-) diff --git a/extension/Publish_Helper/renderPublishHelper.js b/extension/Publish_Helper/renderPublishHelper.js index 4f3f3ea..4b7cc9b 100644 --- a/extension/Publish_Helper/renderPublishHelper.js +++ b/extension/Publish_Helper/renderPublishHelper.js @@ -38,64 +38,74 @@ export const renderPublishHelper = (id) => { window.siyuan.config.system.kernelVersion }"/>`; } - const html = ` - - - - - - 多平台文章发布-思源笔记发布辅助工具 - - - - - - - + // + // + //
+ // + // + // + // `; + new Promise(function(html) { + fs.readFile(`${window.siyuan.config.system.dataDir}/widgets/sy-post-publisher/index.html`,function(err,data){ + if(err){ + console.log(err) } - - - -
- - - - `; - const mainWindow = getCurrentWindow(); - window.siyuan.printWin = new BrowserWindow({ - parent: mainWindow, - modal: true, - show: true, - width: 900, - height: 680, - resizable: true, - frame: true, - icon: path.join( - window.siyuan.config.system.appDir, - "stage", - "icon-large.png" - ), - titleBarStyle: "default", - titleBarOverlay: { - color: "#cccccca5", - symbolColor: "black", - }, - webPreferences: { - contextIsolation: false, - nodeIntegration: true, - webviewTag: true, - webSecurity: false, + var txt = data.toString().replace(//gs,""); + html(txt); + }) + }).then(function(html){ + const mainWindow = getCurrentWindow(); + window.siyuan.printWin = new BrowserWindow({ + parent: mainWindow, + modal: true, + show: true, + width: 900, + height: 680, + resizable: true, + frame: true, + icon: path.join( + window.siyuan.config.system.appDir, + "stage", + "icon-large.png" + ), + titleBarStyle: "default", + titleBarOverlay: { + color: "#cccccca5", + symbolColor: "black", }, - }); - window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`; - window.siyuan.printWin.once("ready-to-show", () => { - window.siyuan.printWin.webContents.setZoomFactor(1); - }); - fetchPost("/api/export/exportTempContent", { content: html }, (response) => { - window.siyuan.printWin.loadURL(response.data.url); - }); + webPreferences: { + contextIsolation: false, + nodeIntegration: true, + webviewTag: true, + webSecurity: false, + }, + }); + window.siyuan.printWin.webContents.userAgent = `SiYuan/${app.getVersion()} https://b3log.org/siyuan Electron`; + window.siyuan.printWin.once("ready-to-show", () => { + window.siyuan.printWin.webContents.setZoomFactor(1); + }); + fetchPost("/api/export/exportTempContent", { content: html }, (response) => { + window.siyuan.printWin.loadURL(response.data.url); + }); + }) }; diff --git a/script/lili_sprite.js b/script/lili_sprite.js index 41b6b4a..afb6a36 100644 --- a/script/lili_sprite.js +++ b/script/lili_sprite.js @@ -309,7 +309,6 @@ sprite_menu.addEventListener("click", (e) => { ).attributes["data-node-id"].value; renderPublishHelper(id); console.log("ok"); - resolve(true); } else { new Notification("挂件未安装", { body: "请先在集市下载 sy-post-publisher 挂件", @@ -326,7 +325,6 @@ sprite_menu.addEventListener("click", (e) => { ).attributes["data-node-id"].value; renderGraphHelper(id); console.log("ok"); - resolve(true); } else { new Notification("挂件未安装", { body: "请先在集市下载 Graph 挂件", diff --git a/theme.json b/theme.json index 3fad586..9ab6633 100644 --- a/theme.json +++ b/theme.json @@ -2,7 +2,7 @@ "name": "Sofill=", "author": "Soltus", "url": "https://github.com/Hi-Windom/lili", - "version": "1.0d1", + "version": "1.0d2", "modes": [ "light" ]