Can you explain it to me with any example? I don’t understand JavaScript very well … Maybe you can give discord on priv?
This forum was moved to another machine and updated to a recent version. If you are unable to login please delete your browser cookies and cache and restart your browser.A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
C
Latest posts made by Ciastuus
-
RE: MMM-Remote-Control # More files *.html (pages)
-
RE: MMM-Remote-Control # More files *.html (pages)
So … After each wrapper.innerHTML I have to add
return wrapper;
e.g:
wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html"; return wrapper; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html"; return wrapper; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html";
Is that way?
wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html"; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html"; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html"; return wrapper;
-
MMM-Remote-Control # More files *.html (pages)
Hi,
I have a small problem because I can’t load more links in the form * .html to the MMM-Remote-Control module. When I try to do my own thing, only the same page loads, and by going manually to others, the same page still loads, and the name in the address bar changes.
This is what it looks like when trying to load the narzedzia.html page.
(narzedzia - tools)
It actually loads the lustro.html page
(lustro - mirror)I did this:
getDom: function() { var wrapper = document.createElement("div"); if (this.addresses.length === 0) { this.addresses = ["ip-of-your-mirror"]; } wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/index.html"; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/lustro.html"; wrapper.innerHTML = "http://" + this.addresses[0] + ":8080/narzedzia.html"; wrapper.className = "normal xsmall"; return wrapper; },
this.expressApp.get("/index.html", function(req, res) { if (self.template === "") { res.send(503); } else { res.contentType("text/html"); var transformedData = self.fillTemplates(self.template); res.send(transformedData); } }); this.expressApp.get("/lustro.html", function(req, res) { if (self.template === "") { res.send(503); } else { res.contentType("text/html"); var transformedData = self.fillTemplates(self.template); res.send(transformedData); } }); this.expressApp.get("/narzedzia.html", function(req, res) { if (self.template === "") { res.send(503); } else { res.contentType("text/html"); var transformedData = self.fillTemplates(self.template); res.send(transformedData); } });
fs.readFile(path.resolve(__dirname + "/index.html"), function(err, data) { self.template = data.toString(); }); fs.readFile(path.resolve(__dirname + "/lustro.html"), function(err, data) { self.template = data.toString(); }); fs.readFile(path.resolve(__dirname + "/narzedzia.html"), function(err, data) { self.template = data.toString(); });
Unfortunately, I would like it to work properly as I would like. If someone can solve my problem, I can send something to paypal $$$.
Thank you in advance for explaining how to do it correctly.