Selaa lähdekoodia

support listing availlable scripts in pixl.

Lucas Stadler 12 vuotta sitten
vanhempi
commit
92d252e65c
1 muutettua tiedostoa jossa 14 lisäystä ja 0 poistoa
  1. 14 0
      js/pixl/public/index.html

+ 14 - 0
js/pixl/public/index.html

@ -255,6 +255,20 @@
255 255
            }
256 256
            xhr.send();
257 257
        };
258
259
        pixl.scripts.list = function() {
260
            var xhr = new XMLHttpRequest();
261
            xhr.open('GET', '/scripts');
262
            xhr.onreadystatechange = function() {
263
                if (xhr.readyState == 4) {
264
                    var scripts = xhr.responseText.split("\n");
265
                    for (var i = 0; i < scripts.length; i++) {
266
                        console.log(scripts[i]);
267
                    }
268
                }
269
            };
270
            xhr.send();
271
        }
258 272
    </script>
259 273
</body>
260 274
</html>