From 6cfed55d6caaf69189b5bde3aa16f6e021b2d7e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Balzarotti?= Date: Tue, 21 Feb 2023 14:02:42 +0100 Subject: [PATCH] confirm stop recipe --- dist/server.js | 33 ++++++++++++++++++++++++++++++++- templates/base.html | 1 + 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/dist/server.js b/dist/server.js index 1835e53..848ecee 100644 --- a/dist/server.js +++ b/dist/server.js @@ -276,6 +276,12 @@ function stop_recipe() { socket.emit('stop recipe'); } +function maybe_stop_recipe() { + question_modal({required: true, dismissed: false, label: "Stoppiamo?", options: [ + {action: "stop_recipe();", tag:"Sicuro"}, + {action: "alert('non interrompiamo')", tag:"No"}]}); +} + function next_phase() { socket.emit('next phase'); } @@ -375,7 +381,7 @@ On Exit: {{current_phase.onexit}} Next Phase - Stop `; @@ -407,6 +413,31 @@ function manual_modal(data) { } +function question_modal(data) { + let modal = document.getElementById("question-modal"); + let template = ``; + modal.innerHTML = Mustache.render(template, data); +} + + let items = document.querySelectorAll('#items-list > li') diff --git a/templates/base.html b/templates/base.html index ada1612..f7d6013 100644 --- a/templates/base.html +++ b/templates/base.html @@ -43,6 +43,7 @@ {% raw %} {% endraw %}
+