change url to right var
This commit is contained in:
parent
c05f542e71
commit
c5f55c807a
@ -11,7 +11,7 @@ class Finder{
|
|||||||
|
|
||||||
Init(){
|
Init(){
|
||||||
console.log("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((response) => response.text())
|
||||||
.then((html) => {
|
.then((html) => {
|
||||||
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Finder", 600, 500)
|
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Finder", 600, 500)
|
||||||
|
@ -12,28 +12,18 @@ class PersonalProperties{
|
|||||||
|
|
||||||
Init(){
|
Init(){
|
||||||
console.log("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((response) => response.text())
|
||||||
.then((html) => {
|
.then((html) => {
|
||||||
//TODO Get ~70% of user screen height
|
// console.log(document.body)
|
||||||
let newWindow = WebDesktopEnvironment.CreateNewWindow(this.appId, "Personal Properties", 300, 500)
|
// 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
|
newWindow.innerHTML = html
|
||||||
|
|
||||||
let closeButton = newWindow.children[0].children[0]
|
let closeButton = newWindow.children[0].children[0]
|
||||||
let scrollDiv = newWindow.children[1]
|
let scrollDiv = newWindow.children[1]
|
||||||
// console.log(scrollDiv)
|
let scrollBar = new WdeScrollBar(scrollDiv.children[1].children[0], scrollDiv.children[0])
|
||||||
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();
|
|
||||||
|
|
||||||
closeButton.addEventListener('click', function (params) {
|
closeButton.addEventListener('click', function (params) {
|
||||||
WebDesktopEnvironment.CloseWindow(newWindow)
|
WebDesktopEnvironment.CloseWindow(newWindow)
|
||||||
@ -43,13 +33,4 @@ class PersonalProperties{
|
|||||||
WebDesktopEnvironment.Alert(error);
|
WebDesktopEnvironment.Alert(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
CloseWindow(id){
|
|
||||||
console.log(id+"Close")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function reply_click(){
|
|
||||||
console.log("QQQQQQQQQQQQQQQQQQQ")
|
|
||||||
}
|
}
|
@ -4,10 +4,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||||||
|
|
||||||
class WebDesktopEnvironment{
|
class WebDesktopEnvironment{
|
||||||
constructor(){
|
constructor(){
|
||||||
|
// console.log(window)
|
||||||
this.wc = new WindowsCompositor
|
this.wc = new WindowsCompositor
|
||||||
|
|
||||||
//Get basic window ready frame
|
//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((response) => response.text())
|
||||||
.then((html) => {
|
.then((html) => {
|
||||||
WebDesktopEnvironment.SetBasicWindow(html)
|
WebDesktopEnvironment.SetBasicWindow(html)
|
||||||
@ -31,7 +32,7 @@ class WebDesktopEnvironment{
|
|||||||
|
|
||||||
|
|
||||||
let script = document.createElement("script")
|
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")
|
script.setAttribute("async", "false")
|
||||||
appElem.appendChild(script)
|
appElem.appendChild(script)
|
||||||
script.addEventListener("load", function () {
|
script.addEventListener("load", function () {
|
||||||
@ -92,6 +93,7 @@ class WebDesktopEnvironment{
|
|||||||
static Alert(alertText){
|
static Alert(alertText){
|
||||||
console.log(alertText)
|
console.log(alertText)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var getJSON = function(url, callback) {
|
var getJSON = function(url, callback) {
|
||||||
|
Loading…
Reference in New Issue
Block a user