personal-website/resources/sys/apps/finder/app.js

40 lines
970 B
JavaScript

class Finder{
appId = "finder"
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
this.appElem = appElem
}
Init(){
console.log("Init")
fetch(`${window.location.origin}/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")
}