|
7 | 7 | <meta content="yes" name="apple-mobile-web-app-capable"> |
8 | 8 | <link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAGACGAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAE1JREFUOI1j/P//PwOxgNGeAUMxE9G6cQCKDWAhpADZ2f8PMjBS3QW08QK20KaZC2gfC9hCnqouoNgARgY7zMxAyNlUdQHlXiAlO2MDAD63EVqNHAe0AAAAAElFTkSuQmCC"/> |
9 | 9 | <title>WLED</title> |
10 | | - <script> |
11 | | - function feedback(){} |
12 | | - // instead of including [script src="iro.js"][/script] and [script src="rangetouch.js"][/script] |
13 | | - // (which would be inlined by nodeJS inliner during minimization and compression) we need to load them dynamically |
14 | | - // the following is needed to load iro.js and rangetouch.js as consecutive requests to allow ESP8266 |
15 | | - // to keep up with requests (if requests happent too fast some may not get processed) |
16 | | - // it will also call onLoad() after last is loaded (it was removed from [body onload="onLoad()"]). |
17 | | - var h = document.getElementsByTagName('head')[0]; |
18 | | - var l = document.createElement('script'); |
19 | | - l.type = 'application/javascript'; |
20 | | - l.src = 'iro.js'; |
21 | | - l.addEventListener('load', (e) => { |
22 | | - // after iro is loaded initialize global variable |
23 | | - cpick = new iro.ColorPicker("#picker", { |
24 | | - width: 260, |
25 | | - wheelLightness: false, |
26 | | - wheelAngle: 270, |
27 | | - wheelDirection: "clockwise", |
28 | | - layout: [{ |
29 | | - component: iro.ui.Wheel, |
30 | | - options: {} |
31 | | - }] |
32 | | - }); |
33 | | - cpick.on("input:end", () => {setColor(1);}); |
34 | | - cpick.on("color:change", () => {updatePSliders()}); |
35 | | - var l = document.createElement('script'); |
36 | | - l.type = 'application/javascript'; |
37 | | - l.src = 'rangetouch.js'; |
38 | | - l.addEventListener('load', (e) => { |
39 | | - // after rangetouch is loaded initialize global variable |
40 | | - ranges = RangeTouch.setup('input[type="range"]', {}); |
41 | | - let stateCheck = setInterval(() => { |
42 | | - if (document.readyState === 'complete') { |
43 | | - clearInterval(stateCheck); |
44 | | - // document ready, start processing UI |
45 | | - onLoad(); |
46 | | - } |
47 | | - }, 100); |
48 | | - }); |
49 | | - setTimeout(()=>{h.appendChild(l)},100); |
50 | | - }); |
51 | | - setTimeout(()=>{h.appendChild(l)},200); |
52 | | - </script> |
53 | 10 | <link rel="stylesheet" href="index.css"> |
54 | 11 | </head> |
55 | | -<body> |
| 12 | +<body onload="onLoad()"> |
56 | 13 |
|
57 | 14 | <div id="cv" class="overlay">Loading WLED UI...</div> |
58 | 15 | <noscript><div class="overlay" style="opacity:1;">Sorry, WLED UI needs JavaScript!</div></noscript> |
|
378 | 335 | </div> |
379 | 336 |
|
380 | 337 | <i id="roverstar" class="icons huge" onclick="setLor(0)"></i><br> |
| 338 | + |
| 339 | +<!-- |
| 340 | + If you want to load iro.js and rangetouch.js as consecutive requests, you can do it like it was done in 0.14.0: |
| 341 | + https://github.com/Aircoookie/WLED/blob/v0.14.0/wled00/data/index.htm |
| 342 | +--> |
| 343 | +<script src="iro.js"></script> |
| 344 | +<script src="rangetouch.js"></script> |
381 | 345 | <script src="index.js"></script> |
382 | 346 | </body> |
383 | 347 | </html> |
0 commit comments