Swap global vars to app config as JSON

This commit is contained in:
2026-04-25 18:00:19 +02:00
parent dea14acd29
commit 40565849c5
3 changed files with 8 additions and 8 deletions

View File

@@ -19,11 +19,11 @@
<meta name="msapplication-TileColor" content="#00a300">
<meta name="msapplication-config" content="images/icons/browserconfig.xml?v=GvmqYyKwbb">
<meta name="theme-color" content="#ffffff">
<script type="text/javascript">window.params = [#]GLOBAL_VARS[#];</script>
<script id="app-config" type="application/json">[#]APP_CONFIG[#]</script>
<title>Spotty</title>
</head>
<body>
<div id="container"></div>
<script type="module" src="[#]filepath_js[#]"></script>
</body>
</html>
</html>

View File

@@ -9,7 +9,6 @@ window.setElem = common.setElem;
window.getDragPosition = common.getDragPosition;
window.copyTextToClipboard = common.copyTextToClipboard;
window.getOuterWidth = common.getOuterWidth;
import Css from './../styles/spot.scss';
//Masks
@@ -18,8 +17,6 @@ import Spot from './spot.js';
//import Upload from './page.upload.js';
//import Admin from './page.admin.js';
window.oSpot = new Spot(params);
//let oProject = new Project(oSpot);
//oSpot.addPage('project', oProject);
@@ -34,6 +31,10 @@ window.oSpot = new Spot(params);
import { createApp } from 'vue';
import SpotVue from '../Spot.vue';
const appConfigElement = document.getElementById('app-config');
const appConfig = appConfigElement ? JSON.parse(appConfigElement.textContent || '{}') : {};
const oSpot = new Spot(appConfig);
const oSpotVue = createApp(SpotVue);
oSpotVue.provide('spot', window.oSpot);
oSpotVue.mount('#container');
oSpotVue.provide('spot', oSpot);
oSpotVue.mount('#container');