From 8be60d34b2fa713b9f4e4b2482b05b6e5ef7db85 Mon Sep 17 00:00:00 2001 From: HeNine <> Date: Thu, 21 Oct 2021 14:16:54 +0200 Subject: [PATCH] Saving indicator --- professor/professor.html | 2 +- professor/script.js | 11 ++++++++++- professor/style.less | 7 +++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/professor/professor.html b/professor/professor.html index d66e00c..f5ba3ff 100644 --- a/professor/professor.html +++ b/professor/professor.html @@ -44,7 +44,7 @@ - + diff --git a/professor/script.js b/professor/script.js index 256ade2..98fce30 100644 --- a/professor/script.js +++ b/professor/script.js @@ -35,6 +35,9 @@ function fillLineInfo(line_json) { } async function submit() { + document.getElementById("update_indicator").innerText = "⭯" + + const new_transcription = document.getElementById("new_transcription").value; const new_speakers = await Promise.all(document.getElementById("speaker_input").value .trim() @@ -68,7 +71,13 @@ async function submit() { 'Content-Type': 'application/json' }, body: JSON.stringify({transcription: new_transcription, speakers: new_speakers}) - }) + }).then(response => { + if (response.ok) { + document.getElementById("update_indicator").innerText = "\u2714\ufe0f" + } else { + document.getElementById("update_indicator").innerText = "\u2716\ufe0f️" + } + }) } $(function () { diff --git a/professor/style.less b/professor/style.less index d18f72c..b6a5093 100644 --- a/professor/style.less +++ b/professor/style.less @@ -49,4 +49,11 @@ label { button { margin-top: 5px; margin-bottom: 5px; +} + +#update_indicator { + width: 1.3em; + height: 1.3em; + margin-left: 1em; + vertical-align: middle; } \ No newline at end of file