Fix blog after refactoring
This commit is contained in:
parent
3702495714
commit
6dc162f3ff
@ -4,28 +4,26 @@ class BlogViewer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param {string[]} chroot //TODO
|
||||||
* @param {string[]} args
|
* @param {string[]} args
|
||||||
*/
|
*/
|
||||||
NewWindow(args){
|
async NewWindow(args){
|
||||||
fetch(`${window.location.origin}/application/${this.appId}/render?` + new URLSearchParams({
|
const response = await fetch(`app/${this.appId}/render?` + new URLSearchParams({
|
||||||
isMobile: WebDesktopEnvironment.isMobile,
|
isMobile: WebDesktopEnvironment.isMobile,
|
||||||
path: args[0],
|
path: args[0],
|
||||||
}))
|
}))
|
||||||
.then((response) => response.text())
|
if (response.status != 200){
|
||||||
.then((html) => {
|
WebDesktopEnvironment.Alert("Error render TODO") //TODO
|
||||||
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, 500, 350 )
|
return
|
||||||
newWindow.innerHTML = html
|
}
|
||||||
|
const html = await response.text()
|
||||||
|
|
||||||
// let fileView = new FileView("/kek", newWindow.querySelector(".FileTileView"), Finder.Click)
|
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, 500, 350 )
|
||||||
if (!WebDesktopEnvironment.isMobile){
|
newWindow.innerHTML = html
|
||||||
let scrollBar = new WdeScrollBar(newWindow.querySelector(".ScrollbarPlace"), newWindow.querySelector(".ScrollContent"))
|
|
||||||
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
|
let scrollBar = new WdeScrollBar(newWindow.querySelector(".ScrollbarPlace"), newWindow.querySelector(".ScrollContent"))
|
||||||
WebDesktopEnvironment.CloseWindow(newWindow)
|
newWindow.querySelector("#closeWindowButton").addEventListener('click', function (params) {
|
||||||
})
|
WebDesktopEnvironment.CloseWindow(newWindow)
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
WebDesktopEnvironment.Alert(error);
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -249,7 +249,7 @@ class FinderWindow{
|
|||||||
}
|
}
|
||||||
break
|
break
|
||||||
case "blog":
|
case "blog":
|
||||||
WebDesktopEnvironment.Open("blog-viewer", [`${this.CurPath}/${fileName}`])
|
WebDesktopEnvironment.Open("/Applications/BlogViewer.app", [`${this.CurPath}/${fileName}`])
|
||||||
break
|
break
|
||||||
case "personal-properties":
|
case "personal-properties":
|
||||||
WebDesktopEnvironment.Open("personal-properties", [`${this.CurPath}/${fileName}`])
|
WebDesktopEnvironment.Open("personal-properties", [`${this.CurPath}/${fileName}`])
|
||||||
|
Loading…
Reference in New Issue
Block a user