2021-05-03 21:41:09 +03:00
|
|
|
const WebviewWindow = window.__TAURI__.window.WebviewWindow
|
|
|
|
|
2021-05-03 20:42:40 +03:00
|
|
|
const routeSelect = document.querySelector('#route')
|
|
|
|
const link = document.querySelector('#link')
|
|
|
|
|
|
|
|
routeSelect.addEventListener('change', (event) => {
|
|
|
|
link.href = event.target.value
|
|
|
|
})
|
|
|
|
|
|
|
|
document.querySelector('#go').addEventListener('click', () => {
|
2021-07-04 01:48:04 +03:00
|
|
|
window.location.href = window.location.origin + '/' + routeSelect.value
|
2021-05-03 20:42:40 +03:00
|
|
|
})
|
2021-05-03 21:41:09 +03:00
|
|
|
|
|
|
|
document.querySelector('#open-window').addEventListener('click', () => {
|
2022-01-09 20:56:32 +03:00
|
|
|
new WebviewWindow(Math.random().toString().replace('.', ''), {
|
2021-05-03 21:41:09 +03:00
|
|
|
url: routeSelect.value
|
|
|
|
})
|
|
|
|
})
|