Source for esphome.io documentation files.
Go to file
Andrew Zaborowski 7be6c6536a
Add webserver-v1.js click handlers for Cover buttons (#521)
Add js click handlers for the web UI buttons added in
b1f9c9a6e0a3dce73507e6b60782987ee2459f48 in the esphome repository.
Since this change doesn't make the .js file incompatible with esphome
versions before the referenced commit I guess there's no need to
rename the file to -v2.

There are probably better ways to write those click handlers, for
example we could have a common function to launch the POST request to a
URL that it reads from the button object like this:

var button_onclick = function(evt) {
    const xhr = new XMLHttpRequest();
    xhr.open("POST", evt.target.onlick_post_url, true);
    xhr.send();
};

row.children[2].children[0].addEventListener('click', button_onlick);
row.children[2].children[0].onclick_post_url = '/light/' + id.substr(6) + '/toggle';

The only problem with this is that iirc ``evt.target`` is
browser-specific.
2020-04-09 11:12:21 -03:00
.github Add stale probot 2019-11-01 11:51:51 +01:00
.vscode SX1509 device documentation (#315) 2019-10-20 19:30:12 +02:00
_static Add webserver-v1.js click handlers for Cover buttons (#521) 2020-04-09 11:12:21 -03:00
_templates Remove disqus 2019-03-24 14:54:58 +01:00
changelog Fix climate link 2019-12-30 09:37:22 -03:00
components Add docs HM3301 (#529) 2020-04-06 14:12:02 -03:00
cookbook add Topersun smart plug (#413) 2019-11-17 23:18:19 +01:00
custom Document CustomAPIDevice 2019-11-02 20:49:48 +01:00
devices Spelling and grammar fixes (#372) 2019-10-21 20:35:56 +02:00
guides Add docs for RF Bridge (#433) 2019-12-10 11:09:47 +01:00
images Add docs HM3301 (#529) 2020-04-06 14:12:02 -03:00
misc Privacy Policy 2018-12-31 13:17:43 +01:00
svg2png Run svg2png 2019-11-02 15:57:41 +01:00
web-api Add more lints 2019-02-27 18:32:47 +01:00
.dockerignore Add dockerfile 2018-06-09 09:59:22 +02:00
.gitattributes Add travis script and gitattributes 2019-02-11 14:32:36 +01:00
.gitignore Add TM1651 docs (#429) 2019-12-04 13:11:49 +01:00
.gitpod.yml Create .gitpod.yml (#226) 2019-04-22 16:22:46 +02:00
.travis.yml Remote + Dev docs update 2019-05-13 21:51:04 +02:00
CODE_OF_CONDUCT.md Add Code of Conduct (Contributor Covenant) (#44) 2018-10-12 11:27:44 +02:00
Dockerfile Fix docker image 2019-03-05 19:49:12 +01:00
Doxygen Bump version to v1.14.2 2019-11-03 00:20:38 +01:00
LICENSE.md Create LICENSE.md 2018-10-12 11:13:52 +02:00
Makefile Bump version to v1.14.2 2019-11-03 00:20:38 +01:00
README.md Update README.md 2019-02-14 16:21:32 +01:00
conf.py Bump version to v1.14.2 2019-11-03 00:20:38 +01:00
github.py 1.14 Changelog (#393) 2019-11-01 18:28:26 +01:00
index.rst Add docs HM3301 (#529) 2020-04-06 14:12:02 -03:00
netlify.toml Add production var 2019-02-17 10:32:40 +01:00
requirements.txt Netlify (#153) 2019-02-07 13:54:45 +01:00
runtime.txt Netlify (#153) 2019-02-07 13:54:45 +01:00
seo.py Custom stuff 2019-05-15 10:54:51 +02:00
sitemap.py Updates 2019-07-28 12:41:15 +02:00
svg2png.py Netlify (#153) 2019-02-07 13:54:45 +01:00
travis.py Remove whitespace at end of line and max line length check 2019-05-29 09:31:28 +02:00

README.md

ESPHome-Docs Netlify Status Discord Chat GitHub release

ESPHome-Docs Logo

Documentation: https://esphome.io/

For issues, please go to the issue tracker.

For feature requests, please see feature requests.