2020-07-06 01:00:06 +00:00
|
|
|
// Send window minimize/maximize/close commands to main
|
2020-07-09 03:23:17 +00:00
|
|
|
// See windowName variable in mainRender.js, logRender.js, and settingsRender.js
|
2020-07-06 01:00:06 +00:00
|
|
|
const minButton = document.getElementById('minimize-button')
|
|
|
|
if (minButton) {
|
|
|
|
minButton.onclick = function () {
|
|
|
|
window.postMessage({ type: "minimizeApplication", payload: {wName: windowName}}, "*")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const minMaxButton = document.getElementById('min-max-button')
|
|
|
|
if (minMaxButton) {
|
|
|
|
minMaxButton.onclick = function () {
|
|
|
|
window.postMessage({ type: "maximizeApplication", payload: {wName: windowName}}, "*")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const closeButton = document.getElementById('close-button')
|
|
|
|
if (closeButton) {
|
|
|
|
closeButton.onclick = function () {
|
|
|
|
window.postMessage({ type: "closeApplication", payload: {wName: windowName}}, "*")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const logButton = document.getElementById('openLogButton')
|
|
|
|
if (logButton) {
|
|
|
|
logButton.onclick = function () {
|
|
|
|
window.postMessage({ type: "openLog" }, "*")
|
|
|
|
}
|
|
|
|
}
|
2020-07-09 03:23:17 +00:00
|
|
|
|
|
|
|
const settingsButton = document.getElementById('openSettingsButton')
|
|
|
|
if (settingsButton) {
|
|
|
|
settingsButton.onclick = function () {
|
|
|
|
window.postMessage({ type: "openSettings" }, "*")
|
|
|
|
}
|
|
|
|
}
|