change url to right var

This commit is contained in:
cyber-dream 2023-03-21 15:38:36 +03:00
parent c05f542e71
commit c5f55c807a
3 changed files with 10 additions and 27 deletions

View File

@ -11,7 +11,7 @@ class Finder{
Init(){
console.log("Init")
fetch(`http://localhost:8080/application/${this.appId}/render`) //TODO Move to wde func
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)

View File

@ -12,28 +12,18 @@ class PersonalProperties{
Init(){
console.log("Init")
fetch("http://localhost:8080/application/personal-properties/render") //TODO Move to wde func
fetch(`${window.location.origin}/application/personal-properties/render`) //TODO Move to wde func. Or Not?
.then((response) => response.text())
.then((html) => {
//TODO Get ~70% of user screen height
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 300, 500)
// console.log(document.body)
// let heigth = Math.max(document.body.clientHeight*0.8, scrollDiv.children[0].scrollHeight) //TODO
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 360, document.body.clientHeight*0.8 )
newWindow.innerHTML = html
let closeButton = newWindow.children[0].children[0]
let scrollDiv = newWindow.children[1]
// console.log(scrollDiv)
let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0])
console.log(scrollBar)
// scrollBar.BindHandler(scrollDiv.children[1].children[0])
// scrollBar.BindHandler(scrollDiv.children[1].children[0])
// SimpleScrollbar.initEl(scrollDiv)
// console.log("SimpleBar" + SimpleScrollbar)
// SimpleScrollbar.initAll();
let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0], scrollDiv.children[0])
closeButton.addEventListener('click', function (params) {
WebDesktopEnvironment.CloseWindow(newWindow)
@ -43,13 +33,4 @@ class PersonalProperties{
WebDesktopEnvironment.Alert(error);
});
}
CloseWindow(id){
console.log(id+"Close")
}
}
function reply_click(){
console.log("QQQQQQQQQQQQQQQQQQQ")
}

View File

@ -4,10 +4,11 @@ document.addEventListener('DOMContentLoaded', function() {
class WebDesktopEnvironment{
constructor(){
// console.log(window)
this.wc = new WindowsCompositor
//Get basic window ready frame
fetch("http://localhost:8080/system/wde/getbasicwindow") //TODO Move to wde func
fetch(`${window.location.origin}/system/wde/getbasicwindow`) //TODO Move to wde func
.then((response) => response.text())
.then((html) => {
WebDesktopEnvironment.SetBasicWindow(html)
@ -31,7 +32,7 @@ class WebDesktopEnvironment{
let script = document.createElement("script")
script.setAttribute("src", `http://localhost:8080/system/applications/${appId}/app.js`)
script.setAttribute("src", `${window.location.origin}/system/applications/${appId}/app.js`)
script.setAttribute("async", "false")
appElem.appendChild(script)
script.addEventListener("load", function () {
@ -92,6 +93,7 @@ class WebDesktopEnvironment{
static Alert(alertText){
console.log(alertText)
}
}
var getJSON = function(url, callback) {