mode.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. ArozOS Office Suite - build mode flag
  3. =====================================
  4. The suite runs in one of two modes and this one-line file is the switch:
  5. arozos (this file, as it lives in src/web/Office/)
  6. the normal webapp - ArozOS storage, the AGI backends and
  7. the Go converters in mod/office are all available.
  8. standalone the file the web-viewer generator writes over this one in
  9. its output tree (see apps/arozos_office/generate.go)
  10. the suite is served by any dumb static file server, with
  11. no ArozOS behind it: documents are opened from and saved
  12. back to the visitor's own device, by the Office format
  13. code compiled to WebAssembly instead of the AGI backends.
  14. Everything downstream reads the mode through OfficePlatform
  15. (common/platform.js) rather than testing these flags directly.
  16. */
  17. window.OFFICE_STANDALONE = false;
  18. /*
  19. OFFICE_WASM says whether the Office format code (mod/office compiled to
  20. WebAssembly, src/wasm/office) was shipped alongside this copy of the
  21. suite. It only matters in standalone mode - in ArozOS the same code runs
  22. server side through the AGI gateway - so it stays false here, and the
  23. generator, which always builds the module, sets it: the documents are
  24. .docx / .xlsx / .pptx, and nothing opens or saves them without it.
  25. OfficePlatform.canConvert() is the question to ask; hasBackend() stays
  26. the separate question of whether there is a server at all.
  27. */
  28. window.OFFICE_WASM = false;