31 lines
859 B
JavaScript
31 lines
859 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
|
|
|
|
if (!WebDesktopEnvironment.isMobile){
|
|
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
|
|
WebDesktopEnvironment.CloseWindow(newWindow)
|
|
})
|
|
}
|
|
})
|
|
.catch((error) => {
|
|
WebDesktopEnvironment.Alert(error);
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
class test{
|
|
|
|
}
|