Mercurial > hg > forks > multipaint-js
view docompile.html @ 215:280d95196265
Update notes.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 03 Sep 2018 14:33:14 +0300 |
parents | 13dda1c3ae88 |
children | 6db5defacbb3 |
line wrap: on
line source
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Multipaint</title> <script src="processing.min.js"></script> <script src="mpui.js"></script> </head> <body> <canvas id="mpCanvas"></canvas> <div id="mpUI"></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("mpUI").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>