personal-website/resources/sys/img-viewer/img-viewer.js
2023-04-13 04:09:07 +03:00

32 lines
827 B
JavaScript

class ImgViewer{
appId = "img-viewer"
/**
* @param {string} path
*/
NewWindow(path){
fetch(`${window.location.origin}/application/${this.appId}/render?`+ new URLSearchParams({
isMobile: WebDesktopEnvironment.isMobile,
}))
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, 450,400 )
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
});
}
}
class test{
}