From e4d16f1f526652bf2915130f60d4ba2df54c0745 Mon Sep 17 00:00:00 2001 From: Himyu Date: Thu, 15 Sep 2022 23:22:17 +0200 Subject: [PATCH] update js for new structures --- frontend/frontend.js | 23 +++++++++++++---------- frontend/index.html | 4 ++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/frontend/frontend.js b/frontend/frontend.js index b82a211..99b01b1 100644 --- a/frontend/frontend.js +++ b/frontend/frontend.js @@ -1,10 +1,13 @@ -$('#pregame-embed').val( - `${location.href}/gfx/pregame/index.html${ - window.apiKey !== null ? '?apikey=' + window.apiKey : '' - }` -) -$('#loading-embed').val( - `${location.href}/gfx/loading/index.html${ - window.apiKey !== null ? '?apikey=' + window.apiKey : '' - }` -) +async function initUI () { + const port = await window.constants.getWebServerPort() + const location = `http://localhost:${port}/pages/op-module-valorant-pregame/gfx` + + const apiKey = await window.constants.getApiKey() + + document.querySelector('#loading-embed').value = `${location}/loading/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + document.querySelector('#loading-gfx').value = `${location}/loading/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + + document.querySelector('#pregame-embed').value = `${location}/pregame/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` + document.querySelector('#pregame-gfx').src = `${location}/pregame/index.html${apiKey !== null ? '?apikey=' + apiKey: ''}` +} +initUI() \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index 842d600..c113d4f 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -5,7 +5,7 @@

Valorant PreGame & Loading

PreGame