loadLibs.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //Load all required JS libs
  2. loadjs([
  3. '/lib/async/async.min.js',
  4. '/lib/fun/ramda.min.js',
  5. '/lib/fun/infestines.js',
  6. '/lib/fun/partial.lenses.min.js',
  7. '/lib/socket.io/socket.io.js',
  8. '/lib/cell.js',
  9. '/lib/he.js',
  10. '/lib/noty/noty.js',
  11. '/lib/screenfull/screenfull.min.js',
  12. '/lib/polyglot/polyglot.min.js',
  13. '/lib/mdc/dist/material-components-web.min.js',
  14. '/lib/ace/ace.js',
  15. //'/lib/yamljs/dist/yaml.js',
  16. '/lib/wt/drag-drop.js',
  17. '/lib/wt/buffer5.6.0.min.js',
  18. '/lib/hashids/hashids.min.js',
  19. '/lib/treeview/treeview.min.js',
  20. ],'forall', {
  21. async: false
  22. });
  23. loadjs(['/lib/gundb/gun.min.js',
  24. '/lib/gundb/sea.js',
  25. '/lib/gundb/lib/then.js',
  26. '/lib/gundb/lib/path.js',
  27. '/lib/gundb/lib/not.js',
  28. '/lib/gundb/lib/open.js',
  29. '/lib/gundb/lib/load.js',
  30. '/lib/gundb/lib/promise.js',
  31. '/lib/gundb/lib/time.js',
  32. '/lib/gundb/lib/bye.js',
  33. '/lib/gundb/lib/webrtc.js',
  34. '/lib/gundb/nts.js',
  35. '/lib/gundb/lib/radix.js',
  36. '/lib/gundb/lib/radisk.js',
  37. '/lib/gundb/lib/store.js',
  38. '/lib/gundb/lib/rindexed.js'
  39. ], 'gundb', {
  40. async: false
  41. }
  42. );
  43. loadjs.ready('forall', function() {
  44. //int mdc
  45. mdc.autoInit();
  46. }).ready('gundb', function() {
  47. //load gundb
  48. import('/app.js')
  49. .then((module) => {
  50. let oldGunStorage = localStorage.getItem('gun/');
  51. if(oldGunStorage){
  52. localStorage.removeItem('gun/');
  53. };
  54. new module.App
  55. });
  56. })