| | |
| | | if (element) element.value = ''; // clear browser cache |
| | | return function(text) { |
| | | text = Array.prototype.slice.call(arguments).join(' '); |
| | | // These replacements are necessary if you render to raw HTML |
| | | //text = text.replace(/&/g, "&"); |
| | | //text = text.replace(/</g, "<"); |
| | | //text = text.replace(/>/g, ">"); |
| | | //text = text.replace('\n', '<br>', 'g'); |
| | | // console.log(text); |
| | | if (element) { |
| | | element.value += text + "\n"; |
| | | element.scrollTop = element.scrollHeight; // focus on bottom |
| | |
| | | }); |
| | | Module['preRun'].push(function() { |
| | | var provider_name = '@TEST_CLOUD_PROVIDER@'; |
| | | addRunDependency('CLOUDFS_setup'); |
| | | |
| | | FS.createFolder('/', 'user_data', true, true); |
| | | |
| | |
| | | } else { // Cloud provider not available |
| | | FS.mount(IDBFS, {}, '/user_data'); |
| | | } |
| | | |
| | | FS.syncfs(true, function(err) { |
| | | if(err) console.log('ERROR!', err); |
| | | console.log('finished syncing.. YEAH!!!'); |
| | | removeRunDependency('CLOUDFS_setup'); |
| | | }); |
| | | }); |
| | | var test_functions = {}; |
| | | var test_function_args = { |
| | |
| | | function fetch_from_cloud() |
| | | { |
| | | FS.syncfs(true, function(e) { |
| | | Module.print('Sync from Remote', e); |
| | | console.log('Sync from Remote', e); |
| | | }); |
| | | } |
| | | function push_to_cloud() |
| | | { |
| | | FS.syncfs(function(e) { |
| | | Module.print('Sync to Remote', e); |
| | | console.log('Sync to Remote', e); |
| | | }); |
| | | } |
| | | function populate_user_data() |