diff --git a/public/app.js b/public/app.js index a2a1870..0c427a0 100644 --- a/public/app.js +++ b/public/app.js @@ -44,7 +44,7 @@ exportAbortController: null, // Active Settings - config: Object.assign({}, window.VIZ_PRESETS.trap_nation) + config: Object.assign({}, (typeof window !== 'undefined' && window.VIZ_PRESETS && window.VIZ_PRESETS.trap_nation) || (typeof VIZ_PRESETS !== 'undefined' && VIZ_PRESETS.trap_nation) || {}) }; // DOM Elements @@ -1106,7 +1106,8 @@ } function applyPreset(presetKeyOrObj) { - let p = typeof presetKeyOrObj === 'string' ? window.VIZ_PRESETS[presetKeyOrObj] : presetKeyOrObj; + const presetsObj = (typeof window !== 'undefined' && window.VIZ_PRESETS) || (typeof VIZ_PRESETS !== 'undefined' ? VIZ_PRESETS : {}); + let p = typeof presetKeyOrObj === 'string' ? presetsObj[presetKeyOrObj] : presetKeyOrObj; if (!p) return; Object.assign(state.config, p); diff --git a/public/presets.js b/public/presets.js index 7ced463..7f8d258 100644 --- a/public/presets.js +++ b/public/presets.js @@ -507,3 +507,13 @@ const VIZ_PRESETS = { showProgressBar: false } }; + +if (typeof window !== 'undefined') { + window.VIZ_PRESETS = VIZ_PRESETS; +} +if (typeof globalThis !== 'undefined') { + globalThis.VIZ_PRESETS = VIZ_PRESETS; +} +if (typeof module !== 'undefined' && module.exports) { + module.exports = VIZ_PRESETS; +}