Start of a web UI config
This commit is contained in:
parent
c2d0d6e962
commit
a3c3276a48
@ -120,6 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script src="js/config.js"></script>
|
||||
<script src="js/utils.js"></script>
|
||||
<script src="js/message.js"></script>
|
||||
<script src="js/app.js"></script>
|
||||
|
@ -28,6 +28,8 @@ function setupApp() {
|
||||
window.VIDEOJS_NO_DYNAMIC_STYLE = true;
|
||||
var appMessagingMisc = new Messaging();
|
||||
appMessagingMisc.init();
|
||||
|
||||
const config = new Config();
|
||||
}
|
||||
|
||||
async function getStatus() {
|
||||
|
21
webroot/js/config.js
Normal file
21
webroot/js/config.js
Normal file
@ -0,0 +1,21 @@
|
||||
class Config {
|
||||
|
||||
constructor() {
|
||||
this.init();
|
||||
}
|
||||
|
||||
async init() {
|
||||
const configFileLocation = "js/config.json";
|
||||
|
||||
try {
|
||||
const response = await fetch(configFileLocation);
|
||||
const configData = await response.json();
|
||||
Object.assign(this, configData);
|
||||
console.log(this);
|
||||
|
||||
} catch(error) {
|
||||
console.log(error);
|
||||
// No config file present. That's ok. It's not required.
|
||||
}
|
||||
}
|
||||
}
|
5
webroot/js/config.json
Normal file
5
webroot/js/config.json
Normal file
@ -0,0 +1,5 @@
|
||||
{
|
||||
"title": "Title",
|
||||
"logo": "https://vignette.wikia.nocookie.net/animalcrossing/images/b/b3/NH-character-Blathers.png/revision/latest?cb=20200229053519",
|
||||
"color": "#276749"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user