packages feed

blunt-0.0.2: data/index.html

<!doctype html>

<html>
  <head>
    <meta name="viewport" content="initial-scale = 1, width = device-width">

    <title>Blunt</title>
  </head>

  <body>
    <h1>Blunt</h1>

    <dl>
      <dt>Input</dt>
      <dd>
        <input
          id="input"
          placeholder="sum xs = foldr (+) 0 xs"
          autofocus>
      </dd>

      <dt>Output</dt>
      <dd>
        <input
          id="output"
          placeholder="sum = foldr (+) 0"
          readonly>
      </dd>
    </dl>

    <script>
      'use strict';

      (function () {
        var input = document.getElementById('input');
        var output = document.getElementById('output');

        input.oninput = function (_event) {
          var request = new XMLHttpRequest();

          request.onreadystatechange = function () {
            if (request.readyState === 4 && request.status === 200) {
              output.value = request.response;
            }
          };
          request.open('GET',
            '/pointfree?input=' + encodeURIComponent(input.value));
          request.send();
        };
      }());
    </script>
  </body>
</html>