Skip to content

Commit bee5a79

Browse files
committed
use yaml for initial configuration
1 parent 199d51c commit bee5a79

File tree

7 files changed

+131
-49
lines changed

7 files changed

+131
-49
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ dist
1616
/test_new_dev
1717
*.tar
1818
my_deploy.sh
19-
.parcel-cache
19+
.parcel-cache
20+
/newcaroline

caroline/html/index.html

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ <h1>About Roundtable</h1>
116116
<span class='me'>
117117
<b>Questions, ideas, feedback...? Contact me below</b>
118118
<a href='https://github.com/nikolasibalic' rel="noreferrer" target="_blank" title='Contact'>web
119-
application &copy; Nikola Šibalić, 2021</a>
119+
application &copy; Nikola Šibalić, 2025</a>
120120
</span>
121121
</div>
122122
</div>
@@ -181,8 +181,6 @@ <h2 id="confirmmessage"></h2>
181181
<span></span>
182182
</div>
183183

184-
185-
186184
<script>
187185
MathJax = {
188186
tex: {
@@ -207,29 +205,35 @@ <h2 id="confirmmessage"></h2>
207205
<script src='./js/nbv.js' defer></script>
208206
<script type="module">
209207
import { initRoundTable, initApp, enabaleProceed, disableProceed } from './js/caroline.js';
210-
211-
import init from './init_data.json' assert {type: 'json'};
212-
213-
window.roundTable = init.roundTable; //false;
214-
window.username = init.username;
215-
window.room = init.room; // roundtable room
216-
window.data = init.data;
217-
window.logoURL = init.logoURL;
218-
window.leftHanded = init.leftHanded;
219-
window.drawingHelp = init.drawingHelp;
220-
window.drawingHelpIntensity = init.drawingHelpIntensity;
221-
window.roundTableCallBack = init.roundTableCallBack;
222-
window.roundTableServer = init.roundTableServer;
223-
window.roundTableAuth = init.roundTableAuth;
224-
window.roundTableExit = init.roundTableExit;
225-
window.presentationServer = init.presentationServer;
226-
window.presenter = init.presenter;
227-
window.presentationSemaphore = init.presentationSemaphore;
228-
if (init.startPresentation)
229-
window.onload = initApp();
230-
else {
231-
window.onload = initRoundTable();
232-
}
208+
import YAML from 'yaml';
209+
210+
fetch('./init_data.yaml')
211+
.then(response => response.text())
212+
.then((data) => {
213+
const init = YAML.parse(data);
214+
215+
window.roundTable = init.roundTable; //false;
216+
window.username = init.username;
217+
window.room = init.room; // roundtable room
218+
window.data = init.data;
219+
window.logoURL = init.logoURL;
220+
window.leftHanded = init.leftHanded;
221+
window.drawingHelp = init.drawingHelp;
222+
window.drawingHelpIntensity = init.drawingHelpIntensity;
223+
window.roundTableCallBack = init.roundTableCallBack;
224+
window.roundTableServer = init.roundTableServer;
225+
window.roundTableAuth = init.roundTableAuth;
226+
window.roundTableExit = init.roundTableExit;
227+
window.presentationServer = init.presentationServer;
228+
window.presenter = init.presenter;
229+
window.presentationSemaphore = init.presentationSemaphore;
230+
if (init.startPresentation)
231+
window.onload = initApp();
232+
else {
233+
window.onload = initRoundTable();
234+
}
235+
})
236+
233237
</script>
234238
<!-- Global site tag (gtag.js) - Google Analytics -->
235239
<script async src="https://www.googletagmanager.com/gtag/js?id=G-V2G532WRLD"></script>

caroline/html/init_data.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

caroline/html/init_data.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
roundTable: false
3+
username: ''
4+
room:
5+
data:
6+
slides: []
7+
logoURL: ''
8+
leftHanded: false
9+
drawingHelp: dots
10+
drawingHelpIntensity: 0.06
11+
roundTableCallBack:
12+
roundTableServer: https://roundtable.researchx3d.com/
13+
roundTableAuth: ''
14+
roundTableExit:
15+
presentationServer: ''
16+
presenter: true
17+
presentationSemaphore: -1
18+
startPresentation: false

caroline/html/js/caroline.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4240,5 +4240,7 @@ function copyLinkToClipboard() {
42404240

42414241

42424242
module.exports = {
4243-
initRoundTable
4243+
initRoundTable,
4244+
enabaleProceed,
4245+
disableProceed
42444246
};

caroline/html/package-lock.json

Lines changed: 72 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

caroline/html/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@
66
"build": "parcel build"
77
},
88
"staticFiles": {
9-
"staticPath": "./init_data.json"
9+
"staticPath": "./init_data.yaml"
1010
},
1111
"devDependencies": {
12+
"@parcel/compressor-brotli": "^2.13.3",
13+
"@parcel/compressor-gzip": "^2.13.3",
1214
"@parcel/packager-raw-url": "^2.13.3",
1315
"@parcel/transformer-webmanifest": "^2.13.3",
16+
"@parcel/transformer-yaml": "^2.13.3",
1417
"assert": "^2.1.0",
1518
"browserify-zlib": "^0.2.0",
1619
"buffer": "^6.0.3",
@@ -37,7 +40,8 @@
3740
"markdown-it-mathjax": "^2.0.0",
3841
"mathjax": "^3.2.2",
3942
"pdfjs-dist": "^4.10.38",
40-
"socket.io-client": "^4.8.1"
43+
"socket.io-client": "^4.8.1",
44+
"yaml": "^2.7.0"
4145
},
4246
"targets": {
4347
"default": {

0 commit comments

Comments
 (0)