Xen-HTML
Xen-HTML copied to clipboard
Cannot get emulation.js to work even with the example widgets
Describe the bug So I am trying to convert the Classic LS widget into XenHTML 2 (maybe someone has already done this?). I cannot get the emulation.js to work on my Mac, not even in the samples provided (e.g. Weather | Card).
To Reproduce Steps to reproduce the behavior:
- Place Weather | Card folder on desktop
- Copy emulation.js into Weather | Card folder
- Edit emulation.js by including into section
- the html preview will still contain the variables and not the returned values
Expected behavior See the actual values returned by the emulation.js script.
Screenshots N/A
Smartphone (please complete the following information):
- Device: iPhone 11 pro max
- OS: iOS 13.5
Additional context I am not the most proficient html/js coder, so maybe this is a really trivial mistake I am making.
Right now, emulation only support callback-based sytnax - inline support is not available just yet
Thank you for the quick reply and clarification. May I ask whether there is any way to trigger events? I tried onclick, and it works on the desktop, but not in a lockscreen widget. Is touch input not supported or is there a trick to make it work?
onclick is the expected thing to be using. A working example for e.g. music buttons via onclick can be found in the default "Music | Player" widget. On 3 Jun 2020, 23:42 +0100, enaloha [email protected], wrote:
Thank you for the quick reply and clarification. May I ask whether there is any way to trigger events? I tried onclick, and it works on the desktop, but not in a lockscreen widget. Is touch input not supported or is there a trick to make it work? — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Interesting. Yes, the player does respond to onclick. For illustration purposes, here's a simple html code that does not seem to work for me on the device, but works fine on a browser:
I tried to paste the code, but it would not render correctly.
That should work; make sure to check it in desktop Safari
Yeah, it does. But if I put that into a widget, it won't when I tap on the text. Here's the file (rename to html): index.txt