Skip to content

Commit

Permalink
Merge pull request #30 from Hi-Windom/dev2212
Browse files Browse the repository at this point in the history
no message
  • Loading branch information
Soltus authored Dec 15, 2022
2 parents e73dde7 + 5b73f8c commit 8f26987
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 6 deletions.
20 changes: 19 additions & 1 deletion extension/Graph_Helper/renderGraphHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const renderGraphHelper = (id) => {
"stage",
"icon-large.png"
),
titleBarStyle: "default",
titleBarStyle: "hidden",
titleBarOverlay: {
color: "#cccccca5",
symbolColor: "black",
Expand All @@ -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"));
})
};
27 changes: 23 additions & 4 deletions extension/Publish_Helper/renderPublishHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"));
})
})
};
2 changes: 1 addition & 1 deletion theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "Sofill=",
"author": "Soltus",
"url": "https://github.com/Hi-Windom/lili",
"version": "1.0d3",
"version": "1.0d4",
"modes": [
"light"
]
Expand Down

0 comments on commit 8f26987

Please sign in to comment.