From 5b73f8c82329dcac0b34de4501c3643a14570d9d Mon Sep 17 00:00:00 2001 From: Soltus Date: Thu, 15 Dec 2022 11:35:30 +0800 Subject: [PATCH] no message --- extension/Graph_Helper/renderGraphHelper.js | 20 +++++++++++++- .../Publish_Helper/renderPublishHelper.js | 27 ++++++++++++++++--- theme.json | 2 +- 3 files changed, 43 insertions(+), 6 deletions(-) diff --git a/extension/Graph_Helper/renderGraphHelper.js b/extension/Graph_Helper/renderGraphHelper.js index a5eaead..b482618 100644 --- a/extension/Graph_Helper/renderGraphHelper.js +++ b/extension/Graph_Helper/renderGraphHelper.js @@ -130,7 +130,7 @@ export const renderGraphHelper = (id) => { "stage", "icon-large.png" ), - titleBarStyle: "default", + titleBarStyle: "hidden", titleBarOverlay: { color: "#cccccca5", symbolColor: "black", @@ -150,4 +150,22 @@ export const renderGraphHelper = (id) => { fetchPost("/api/export/exportTempContent", { content: html }, (response) => { window.siyuan.printWin.loadURL(response.data.url); }); + window.siyuan.printWin.webContents.on('dom-ready', ()=>{ + window.siyuan.printWin.webContents.executeJavaScript(` + const waitForExternal = setInterval(()=>{ + if(document.getElementById("mountNode")) { + clearInterval(waitForExternal); + var btn = document.createElement("button"); + btn.innerHTML = " ${window.siyuan.languages.cancel} "; + btn.className = "b3-button b3-button--cancel"; + btn.id = "btn-cancel"; + document.getElementById("mountNode").insertAdjacentElement("afterbegin",btn); + document.querySelector('#btn-cancel').addEventListener('click', () => { + const {ipcRenderer} = require("electron"); + ipcRenderer.send("siyuan-export-close") + }); + } + }, 300); + `, false, (result)=>console.log("1")).then((result)=>console.log("2")); + }) }; diff --git a/extension/Publish_Helper/renderPublishHelper.js b/extension/Publish_Helper/renderPublishHelper.js index 4b7cc9b..e08c25f 100644 --- a/extension/Publish_Helper/renderPublishHelper.js +++ b/extension/Publish_Helper/renderPublishHelper.js @@ -84,11 +84,12 @@ export const renderPublishHelper = (id) => { resizable: true, frame: true, icon: path.join( - window.siyuan.config.system.appDir, - "stage", - "icon-large.png" + window.siyuan.config.system.dataDir, + "widgets", + "sy-post-publisher", + "favicon.ico" ), - titleBarStyle: "default", + titleBarStyle: "hidden", titleBarOverlay: { color: "#cccccca5", symbolColor: "black", @@ -107,5 +108,23 @@ export const renderPublishHelper = (id) => { fetchPost("/api/export/exportTempContent", { content: html }, (response) => { window.siyuan.printWin.loadURL(response.data.url); }); + window.siyuan.printWin.webContents.on('dom-ready', ()=>{ + window.siyuan.printWin.webContents.executeJavaScript(` + const waitForExternal = setInterval(()=>{ + if(document.getElementById("app")) { + clearInterval(waitForExternal); + var btn = document.createElement("button"); + btn.innerHTML = " ${window.siyuan.languages.cancel} "; + btn.className = "b3-button b3-button--cancel"; + btn.id = "btn-cancel"; + document.getElementById("app").insertAdjacentElement("afterbegin",btn); + document.querySelector('#btn-cancel').addEventListener('click', () => { + const {ipcRenderer} = require("electron"); + ipcRenderer.send("siyuan-export-close") + }); + } + }, 300); + `, false, (result)=>console.log("1")).then((result)=>console.log("2")); + }) }) }; diff --git a/theme.json b/theme.json index 1e0f7f0..532c6f6 100644 --- a/theme.json +++ b/theme.json @@ -2,7 +2,7 @@ "name": "Sofill=", "author": "Soltus", "url": "https://github.com/Hi-Windom/lili", - "version": "1.0d3", + "version": "1.0d4", "modes": [ "light" ]