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" ]