瀏覽代碼

support listing availlable scripts in pixl.

Lucas Stadler 12 年之前
父節點
當前提交
92d252e65c
共有 1 個文件被更改,包括 14 次插入0 次删除
  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>