diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-03-05 22:33:49 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-03-05 22:33:49 +0900 |
| commit | 6169405cdceca08dc0355bf066c7188498afefd5 (patch) | |
| tree | fe35dd5f071d8b9862964405c4880cf5dafb19ba /services/app/assets/loading.js | |
| parent | 1c5e25e307cc31016616a4970de834efc735ee31 (diff) | |
| download | phperkaigi-2024-albatross-6169405cdceca08dc0355bf066c7188498afefd5.tar.gz phperkaigi-2024-albatross-6169405cdceca08dc0355bf066c7188498afefd5.tar.zst phperkaigi-2024-albatross-6169405cdceca08dc0355bf066c7188498afefd5.zip | |
show phper token if answer size is smaller than birdie border
Diffstat (limited to 'services/app/assets/loading.js')
| -rw-r--r-- | services/app/assets/loading.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/services/app/assets/loading.js b/services/app/assets/loading.js index 4699303..986fa43 100644 --- a/services/app/assets/loading.js +++ b/services/app/assets/loading.js @@ -1,4 +1,6 @@ document.addEventListener('DOMContentLoaded', () => { + const phperTokenElem = document.getElementsByClassName('js-phper-token')[0]; + const aggregatedStatusElem = document.getElementsByClassName('js-aggregated-execution-status')[0]; const aggregatedStatusLoadingIndicatorElem = document.getElementsByClassName('js-aggregated-execution-status-loading-indicator')[0]; const answerId = aggregatedStatusElem.dataset.answerId; @@ -20,7 +22,11 @@ document.addEventListener('DOMContentLoaded', () => { timerId = setInterval(() => { fetch(apiUrl) .then(response => response.json()) - .then(({ aggregated_status, testcase_executions }) => { + .then(({ aggregated_status, testcase_executions, phper_token }) => { + if (phper_token) { + phperTokenElem.textContent = `バーディー! ${phper_token}`; + } + for (const ex of testcase_executions) { const statusElem = statusElemsMap.get(ex.id); const loadingIndicatorElem = statusLoadingIndicatorElemsMap.get(ex.id); |
