Xen-HTML icon indicating copy to clipboard operation
Xen-HTML copied to clipboard

Cannot get emulation.js to work even with the example widgets

Open enaloha opened this issue 4 years ago • 6 comments

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:

  1. Place Weather | Card folder on desktop
  2. Copy emulation.js into Weather | Card folder
  3. Edit emulation.js by including into section
  4. 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.

enaloha avatar Jun 02 '20 21:06 enaloha

Right now, emulation only support callback-based sytnax - inline support is not available just yet

Matchstic avatar Jun 03 '20 12:06 Matchstic

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?

enaloha avatar Jun 03 '20 22:06 enaloha

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.

Matchstic avatar Jun 03 '20 22:06 Matchstic

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:

image I tried to paste the code, but it would not render correctly.

enaloha avatar Jun 04 '20 00:06 enaloha

That should work; make sure to check it in desktop Safari

Matchstic avatar Jun 04 '20 01:06 Matchstic

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

enaloha avatar Jun 04 '20 01:06 enaloha