Reenable working Enum tests
[mono-project.git] / sdks / wasm / sample.html
blob1dbd91de56d75ed5a0fd1d2f77e94b1a3aae219e
1 <!doctype html>
2 <html lang="en-us">
3 <head>
4 <style>
5 body {
6 padding: 20px;
7 background-color:#ffffc9
10 p { margin : 0; }
11 </style>
12 </head>
13 <body>
14 C# output:
15 <br>
16 <textarea rows="10" cols="100" id="output"></textarea>
17 <br>
18 <button type="button" onclick="App.onClick()" id="button" disabled="true">Run</button>
19 <br>
21 <p><button onclick="App.geoFindMeCSharp()">Show my location</button></p>
22 <div id="out"></div>
24 <script type='text/javascript'>
25 var App = {
26 onClick: function () {
27 this.output.value = "...";
28 var res = this.int_add (1, 2);
29 this.output.value = res;
32 init: function () {
33 this.int_add = Module.mono_bind_static_method ("[sample] Math:IntAdd");
34 this.output = document.getElementById ("output");
35 this.button = document.getElementById ("button");
37 this.button.disabled = false;
39 // initialize geolocation sample
40 BINDING.call_static_method("[sample] GeoLocation.Program:Main", []);
42 geoFindMeCSharp: function () {
43 BINDING.call_static_method("[sample] GeoLocation.Program:GeoFindMe", [ document.getElementById("out") ]);
47 // Called from C# passing in the mime type of the image and the
48 // image data converted from byte array to base64
49 function showMyPosition (mimeType, imageData)
51 var output = document.getElementById("out");
53 var img = new Image();
54 img.src = "data:" + mimeType + ";base64," + imageData;
56 output.appendChild(img);
60 </script>
61 <script type="text/javascript" src="mono-config.js"></script>
62 <script type="text/javascript" src="runtime.js"></script>
63 <script async type="text/javascript" src="mono.js"></script>
64 </body>
65 </html>