2023-04-12 21:05:23 +00:00
|
|
|
class ImgViewer{
|
|
|
|
appId = "img-viewer"
|
|
|
|
/**
|
|
|
|
* @param {string} path
|
|
|
|
*/
|
|
|
|
NewWindow(path){
|
2023-04-13 01:09:07 +00:00
|
|
|
fetch(`${window.location.origin}/application/${this.appId}/render?`+ new URLSearchParams({
|
|
|
|
isMobile: WebDesktopEnvironment.isMobile,
|
|
|
|
}))
|
2023-04-12 21:05:23 +00:00
|
|
|
.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{
|
|
|
|
|
|
|
|
}
|