| | |
| | | <span><input type="button" value="Fetch from Cloud" onclick="fetch_from_cloud()"></span> |
| | | <span><input type="button" value="Push to Cloud" onclick="push_to_cloud()"></span> |
| | | <span><input type="button" value="Populate local data" onclick="populate_user_data()"></span> |
| | | <span><input type="button" value="Async Fetch" onclick="call_test_function('test_async_fetch', 'test_file.txt')"></span> |
| | | </span> |
| | | <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas> |
| | | </div> |
| | |
| | | }); |
| | | }); |
| | | var test_functions = {}; |
| | | var test_function_args = { |
| | | 'test_async_fetch': ['string'] |
| | | }; |
| | | function call_test_function(func) |
| | | { |
| | | if (!(func in test_functions)) |
| | | { |
| | | var f = Module.cwrap(func,'void', []); |
| | | var f = Module.cwrap(func, 'void', test_function_args[func] || []); |
| | | test_functions[func] = f; |
| | | } |
| | | test_functions[func](); |
| | | var args = Array.prototype.slice.call(arguments, 1) |
| | | test_functions[func].apply(test_functions, args); |
| | | } |
| | | function fetch_from_cloud() |
| | | { |