gismo141 / homebridge-server

Server plugin for homebridge
https://gismo141.github.io/configure-your-homebridge-2/
152 stars 20 forks source link

missing jquery dep #19

Closed johnypony3 closed 7 years ago

johnypony3 commented 7 years ago

as observed by another contributor, there is a persistent error for a missing jquery library. this fixes that issue

gismo141 commented 7 years ago

Somehow I have a problem when adding JQuery to the website. This is very strange and I haven't been able to solve it yet.

This occurs, when you try to add an accessory or a platform, then you're unable to hit either the Save nor the Cancel-button.

When I comment out the JQuery-dependency, it works... Any idea?

johnypony3 commented 7 years ago

ha, never as easy as this pr 😄 indeed i can reproduce this, i tried a bunch of different configuations and always see this issue coming up.

im not very well versed with bootstrap, but i believe the way the form element is declared could be the culprit ie when i look at the html built at the link below, it looks very different

http://bootsnipp.com/forms

my time box for this issue is out, you are welcome to bounce things off of me or let me know how i can help

gismo141 commented 7 years ago

Thank you very much for your effort! I'll try later this day with the provided link to the form-builder.

Fonta commented 7 years ago

Submitting the form works if you add onclick='submit()' to line 256: res.write("<input type='submit' class='btn btn-default center-block' value='Save' onclick='submit()' style='width:135px' />");

Fonta commented 7 years ago

After that, I would remove line 419: res.write("<code>" + ex + "</code>"); Because it generates a double error if you submit an faulty entry: http://i.imgur.com/Xgb8XtS.png

gismo141 commented 7 years ago

@f0nt4: Thank you very much, this solved a long researched problem. I wasn't aware that I have to add the onClick-function additionally to the button-type...

Now it should finally be usable on mobile-displays as well!

Fonta commented 7 years ago

Didn't know it either. But because the whole page is bulld in js, it's possible that some other jquery event blocks the submission of the form. Please check if plugin installation isn't broken now.