diff --git a/resources/sys/apps/finder/app.js b/resources/sys/apps/finder/app.js index 5c5e973..a07ccfa 100644 --- a/resources/sys/apps/finder/app.js +++ b/resources/sys/apps/finder/app.js @@ -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) diff --git a/resources/sys/personal-properties/personal-properties.js b/resources/sys/personal-properties/personal-properties.js index 83e69f3..346b4e7 100644 --- a/resources/sys/personal-properties/personal-properties.js +++ b/resources/sys/personal-properties/personal-properties.js @@ -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") } \ No newline at end of file diff --git a/resources/wde.js b/resources/wde.js index b870637..415ef0b 100644 --- a/resources/wde.js +++ b/resources/wde.js @@ -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) {