Mercurial > hg > forks > multipaint-js
comparison docompile.html @ 220:6db5defacbb3
Fix docompile.html.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 04 Sep 2018 15:44:13 +0300 |
parents | 13dda1c3ae88 |
children | a73a43454483 |
comparison
equal
deleted
inserted
replaced
219:ed594b3e3f45 | 220:6db5defacbb3 |
---|---|
6 <script src="processing.min.js"></script> | 6 <script src="processing.min.js"></script> |
7 <script src="mpui.js"></script> | 7 <script src="mpui.js"></script> |
8 </head> | 8 </head> |
9 <body> | 9 <body> |
10 <canvas id="mpCanvas"></canvas> | 10 <canvas id="mpCanvas"></canvas> |
11 <div id="mpUI"></div> | 11 <div id="mpUI2"></div> |
12 <script> | 12 <script> |
13 var mpMachine = 0; | 13 var mpMachine = 0; |
14 var mpCanvas = document.getElementById("mpCanvas"); | 14 var mpCanvas = document.getElementById("mpCanvas"); |
15 new Processing.loadSketchFromSources(mpCanvas, mpSources); | 15 new Processing.loadSketchFromSources(mpCanvas, mpSources); |
16 | 16 |
19 var inst = Processing.getInstanceById("mpCanvas"); | 19 var inst = Processing.getInstanceById("mpCanvas"); |
20 if (inst) | 20 if (inst) |
21 { | 21 { |
22 var code = "var multipaintJS =\n"+ inst.externals.sketch.sourceCode; | 22 var code = "var multipaintJS =\n"+ inst.externals.sketch.sourceCode; |
23 var uriContent = "data:application/octet-stream,"+ encodeURIComponent(code); | 23 var uriContent = "data:application/octet-stream,"+ encodeURIComponent(code); |
24 document.getElementById("mpUI").innerHTML = "<a href="+ uriContent +" download=\"multipaint.js\">Here is the download link</a>"; | 24 document.getElementById("mpUI2").innerHTML = "<a href="+ uriContent +" download=\"multipaint.js\">Here is the download link</a>"; |
25 } | 25 } |
26 else | 26 else |
27 setTimeout(mpWaitUntilSketchIsReady, 250); | 27 setTimeout(mpWaitUntilSketchIsReady, 250); |
28 } | 28 } |
29 | 29 |