view docompile.html @ 244:c7748c19e1ff default tip

Update notes.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 23 Oct 2018 11:34:25 +0300
parents a73a43454483
children
line wrap: on
line source

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Multipaint</title>
  <script src="processing.js"></script>
  <script src="mpui.js"></script>
</head>
<body>
<canvas id="mpCanvas"></canvas>
<div id="mpUI2"></div>
<script>
var mpMachine = 0;
var mpCanvas = document.getElementById("mpCanvas");
new Processing.loadSketchFromSources(mpCanvas, mpSources);

function mpWaitUntilSketchIsReady()
{
  var inst = Processing.getInstanceById("mpCanvas");
  if (inst)
  {
    var code = "var multipaintJS =\n"+ inst.externals.sketch.sourceCode;
    var uriContent = "data:application/octet-stream,"+ encodeURIComponent(code);
    document.getElementById("mpUI2").innerHTML = "<a href="+ uriContent +" download=\"multipaint.js\">Here is the download link</a>";
  }
  else
    setTimeout(mpWaitUntilSketchIsReady, 250);
}

document.addEventListener('DOMContentLoaded', mpWaitUntilSketchIsReady, false);

</script>
</body>
</html>