diff --git a/public/index.html b/public/index.html index b80a5de..b1cbdf3 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@
Current Prompt
- + diff --git a/public/js/admin.js b/public/js/admin.js index d6c9d29..40a3875 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -8,6 +8,12 @@ socket.on('prompt completed', function (data) { document.querySelector('#current-complete').innerHTML = data; }); +socket.on('prompt sent', function (prompt) { + if(prompt !== "Nothing Yet"){ + document.querySelector('[type="text"]').value = prompt; + } +}); + socket.on('username list', function (usernames) { document.querySelector('#num-users').innerHTML = usernames.length; const roster = document.querySelector('ul'); diff --git a/public/js/index.js b/public/js/index.js index b3c2f2c..d48a131 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -11,7 +11,9 @@ document.querySelector('h1').innerHTML = "Welcome, "+username; socket.on('prompt sent', function (prompt) { if(prompt !== document.querySelector('dd').innerHTML){ - button.removeAttribute("disabled"); + if(prompt !== "Nothing Yet"){ + button.removeAttribute("disabled"); + } document.querySelector('dd').innerHTML = prompt; } });