Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help needed wrt ESP IR Remote #5

Open
heinerolli opened this issue Jun 8, 2019 · 2 comments
Open

Help needed wrt ESP IR Remote #5

heinerolli opened this issue Jun 8, 2019 · 2 comments

Comments

@heinerolli
Copy link

heinerolli commented Jun 8, 2019

Hi; thanks for posting this code! I use it to control my Stereo, CD Player and Logitech Squeezebox (Power Off only) and it works great!
My Problem: I am trying to add the following action to a button-press:
Upon pressing this button, another webpage (Web page of my local Logitech Media Server) should open - in another window / Tab .
Can you give me any hints how I could do that?
The Webpage & parameters to be opened would be:
http://172.16.1.105:9000/material

I thought it must be something like: window.open("http://172.16.1.103:9000/material\")\n
But, I am new to coding and don't understand the syntax fully.... so far, I failed to get it to work ..... :-(
Your help is greatly appreciated!
All the best - Heiner

@witnessmenow
Copy link
Owner

should be something similar to that ok

Not tested, but maybe try something like this

Add a new method:

String generateLinkButton(String colSize, String id, String text, String link) {

  return  "<div class=\"" + colSize + "\" style=\"text-align: center\">\n" +
          "    <button id=\"" + id + "\" type=\"button\" class=\"btn btn-default\" style=\"width: 100%\" onclick='window.open(\"" + link + "\",\"_blank\");'>" + text + "</button>\n" +
          "</div>\n";
}

And just call it instead of "generateButton" for your media center button. The link parameter would be where you pass in "http://172.16.1.105:9000/material"

@heinerolli
Copy link
Author

Perfect!
Works great.
Thanks for your fast reply and help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants