personal-website/resources/sys/apps/finder/app.js
2023-03-20 14:20:37 +03:00

40 lines
966 B
JavaScript

class Finder{
appId = "finder"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
Init(){
console.log("Init")
fetch(`http://localhost:8080/application/${this.appId}/render`) //TODO Move to wde func
.then((response) => response.text())
.then((html) => {
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Finder", 600, 500)
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
});
}
CloseWindow(id){
console.log(id+"Close")
}
}
function reply_click(){
console.log("QQQQQQQQQQQQQQQQQQQ")
}