From dc56e5b1a4221a905f4b20f3dc6220d74a838c7f Mon Sep 17 00:00:00 2001 From: Cesar Carvalho Date: Fri, 14 Jun 2019 10:07:18 -0300 Subject: [PATCH] =?UTF-8?q?HOT-FIX:=20Corrige=20formata=C3=A7=C3=A3o=20dos?= =?UTF-8?q?=20cron=C3=B4metros=20no=20painel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sapl/templates/painel/index.html | 44 ++++++++++++++++++++++++++++--- sapl/templates/sessao/painel.html | 44 ++++++++++++++++++++++++++++--- 2 files changed, 80 insertions(+), 8 deletions(-) diff --git a/sapl/templates/painel/index.html b/sapl/templates/painel/index.html index f5772315d..689168e57 100644 --- a/sapl/templates/painel/index.html +++ b/sapl/templates/painel/index.html @@ -149,7 +149,16 @@ countdown: true, startAt: {{ 'discurso'|cronometro_to_seconds }} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ audioAlertFinish.play(); }); @@ -159,7 +168,16 @@ countdown: true, startAt: {{ 'aparte'|cronometro_to_seconds }} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ audioAlertFinish.play(); }); @@ -169,7 +187,16 @@ countdown: true, startAt: {{ 'ordem'|cronometro_to_seconds }} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ audioAlertFinish.play(); }); @@ -179,7 +206,16 @@ countdown: true, startAt: {{ 'consideracoes'|cronometro_to_seconds }} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ audioAlertFinish.play(); }); diff --git a/sapl/templates/sessao/painel.html b/sapl/templates/sessao/painel.html index 7d8a4a104..44f345a75 100644 --- a/sapl/templates/sessao/painel.html +++ b/sapl/templates/sessao/painel.html @@ -127,7 +127,16 @@ $(function() { countdown: true, startAt: {{cronometro_discurso}} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ $.get('/painel/cronometro', { tipo: 'discurso', action: 'stop' } ); audioAlertFinish.play(); @@ -170,7 +179,16 @@ $(function() { countdown: true, startAt: {{cronometro_aparte}} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ $.get('/painel/cronometro', { tipo: 'aparte', action: 'stop' } ); audioAlertFinish.play(); @@ -213,7 +231,16 @@ $(function() { countdown: true, startAt: {{cronometro_ordem}} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ $.get('/painel/cronometro', { tipo: 'ordem', action: 'stop' } ); audioAlertFinish.play(); @@ -257,7 +284,16 @@ $(function() { countdown: true, startAt: {{cronometro_consideracoes}} * 1000, stopAt: 0, - milliseconds: false + milliseconds: false, + format: function(value) { + let h = Math.floor((value/1000) / 3600); + h = checkTime(h); + let m = Math.floor((value/1000) % 3600 / 60); + m = checkTime(m); + let s = Math.floor((value/1000) % 3600 % 60); + s = checkTime(s); + return h.toString() + ":" + m.toString() + ":" + s.toString(); + } }).on('runnerFinish', function(eventObject, info){ $.get('/painel/cronometro', { tipo: 'consideracoes', action: 'stop' } ); audioAlertFinish.play();