slm-lang/slm

View on GitHub
__tests__/browser/index.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<table width="100%">
  <tr>
    <td width="50%">
      <textarea id="input" placeholder="write slm here" style="width: 100%; min-height: 400px;"></textarea>
    </td>
    <td valign="top">
       <code id="output"></code>
       <code id="js"></code>
    </td>
  </tr>
</table>
<script src="../../dist/slm-browser.js"></script>
<script>
var input = document.getElementById('input');
var output = document.getElementById('output');
var options = {filename: 'textarea.slm'};
var oldContent = '';
setInterval(function () {
    if (input.value == oldContent) {
      return;
    }
    oldContent = input.value;
    output.textContent = Slm.eval(input.value, {name: 'yury'}, options);
}, 500);
</script>
</body>
</html>