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

40 lines
1.1 KiB
JavaScript
Raw Normal View History

2023-03-20 11:20:37 +00:00
class Finder{
appId = "finder"
2023-03-17 01:16:51 +00:00
/**
* @param {HTMLElement} appElem
*/
constructor(appElem){
2023-03-22 18:00:04 +00:00
this.appElem = appElem
2023-03-17 01:16:51 +00:00
}
2023-03-22 21:53:06 +00:00
/**
* @param {string} path
*/
NewWindow(path){
2023-03-18 00:34:56 +00:00
console.log("Init")
2023-03-22 18:00:04 +00:00
fetch(`${window.location.origin}/application/${this.appId}/render`) //TODO Move to wde func. Or Not?
2023-03-17 01:16:51 +00:00
.then((response) => response.text())
.then((html) => {
2023-03-22 18:00:04 +00:00
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 500, 400 )
2023-03-18 00:34:56 +00:00
2023-03-22 21:53:06 +00:00
2023-03-22 18:00:04 +00:00
2023-03-22 21:53:06 +00:00
newWindow.innerHTML = html
console.log(newWindow.children[1].children[0])
let fileView = new FileView("/kek", newWindow.children[1].children[0])
let scrollBar = new WdeScrollBar(newWindow.children[1].children[1], newWindow.children[1].children[0])
2023-03-20 11:20:37 +00:00
2023-03-22 18:00:04 +00:00
let closeButton = newWindow.children[0].children[0]
2023-03-18 00:34:56 +00:00
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
})
2023-03-17 01:16:51 +00:00
})
.catch((error) => {
WebDesktopEnvironment.Alert(error);
2023-03-22 21:53:06 +00:00
})
2023-03-17 01:16:51 +00:00
}
}