2020-09-14 17:36:54 +00:00
|
|
|
const { shell, ipcRenderer } = require('electron')
|
2020-08-27 14:31:51 +00:00
|
|
|
|
|
|
|
const manageWindowBtn = document.getElementById('manage-window')
|
|
|
|
|
|
|
|
const links = document.querySelectorAll('a[href]')
|
|
|
|
|
2020-09-14 17:36:54 +00:00
|
|
|
ipcRenderer.on('bounds-changed', (event, bounds) => {
|
|
|
|
const manageWindowReply = document.getElementById('manage-window-reply')
|
|
|
|
const message = `Size: ${bounds.size} Position: ${bounds.position}`
|
|
|
|
manageWindowReply.textContent = message
|
|
|
|
})
|
2020-08-27 14:31:51 +00:00
|
|
|
|
|
|
|
manageWindowBtn.addEventListener('click', (event) => {
|
2020-09-14 17:36:54 +00:00
|
|
|
ipcRenderer.send('create-demo-window')
|
2020-08-27 14:31:51 +00:00
|
|
|
})
|
|
|
|
|
2023-07-13 08:10:37 +00:00
|
|
|
for (const link of links) {
|
2020-08-27 14:31:51 +00:00
|
|
|
const url = link.getAttribute('href')
|
|
|
|
if (url.indexOf('http') === 0) {
|
|
|
|
link.addEventListener('click', (e) => {
|
|
|
|
e.preventDefault()
|
|
|
|
shell.openExternal(url)
|
|
|
|
})
|
|
|
|
}
|
2023-07-13 08:10:37 +00:00
|
|
|
}
|