From f8e5620c0b8614a95c0d27ea29e2367df035f5b7 Mon Sep 17 00:00:00 2001 From: AlGouvea Date: Thu, 7 Oct 2021 09:15:28 -0300 Subject: [PATCH] =?UTF-8?q?Refatroa=C3=A7=C3=A3o=20dos=20cronometros=20par?= =?UTF-8?q?a=20o=20painel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/__apps/painel/main.js | 3 +- sapl/templates/painel/index.html | 8 --- sapl/templates/sessao/painel.html | 91 ++++++++++-------------------- 3 files changed, 31 insertions(+), 71 deletions(-) diff --git a/frontend/src/__apps/painel/main.js b/frontend/src/__apps/painel/main.js index 3a9fbe438..6f4bbb40f 100644 --- a/frontend/src/__apps/painel/main.js +++ b/frontend/src/__apps/painel/main.js @@ -241,7 +241,7 @@ const v = new Vue({ // eslint-disable-line } }, start: function startStopWatch (temp_crono) { - if (this.running !== 0) return + if (this.running === temp_crono) return crono = temp_crono if (time === null) { @@ -254,7 +254,6 @@ const v = new Vue({ // eslint-disable-line timeEnd.setMinutes(timeEnd.getMinutes() + time.getMinutes()) timeEnd.setSeconds(timeEnd.getSeconds() + time.getSeconds()) timeEnd.setMilliseconds(timeEnd.getMilliseconds() + time.getMilliseconds()) - clearInterval(this.timeStopped) } this.running = crono diff --git a/sapl/templates/painel/index.html b/sapl/templates/painel/index.html index 35f8f3430..96f5889a6 100644 --- a/sapl/templates/painel/index.html +++ b/sapl/templates/painel/index.html @@ -122,23 +122,15 @@

Cronômetros

Discurso:[[ cronometro_discurso ]] - -
Aparte:[[ cronometro_aparte ]] - -
Questão de Ordem: [[ cronometro_ordem ]] - -
Considerações Finais: [[ cronometro_consideracoes ]] - -
diff --git a/sapl/templates/sessao/painel.html b/sapl/templates/sessao/painel.html index d02dbcd2a..8718e4099 100644 --- a/sapl/templates/sessao/painel.html +++ b/sapl/templates/sessao/painel.html @@ -35,8 +35,8 @@
-
-
+
+
@@ -51,8 +51,9 @@
-
-
+
+
+


@@ -66,7 +67,8 @@
-
+
+
@@ -83,7 +85,8 @@
-
+
+


@@ -150,8 +153,7 @@ $(function() { $('#discursoStart').click(function() { $.get('/painel/cronometro', { tipo: 'discurso', action: 'start' } ); - - $('#discursoReset').hide(); + $('#discurso').runner('start'); }); @@ -160,7 +162,6 @@ $(function() { $.get('/painel/cronometro', { tipo: 'discurso', action: 'stop' } ); - $('#discursoReset').show(); $('#discurso').runner('stop'); }); @@ -197,24 +198,14 @@ $(function() { }); - $('#aparteStart').click(function(){ - if ($('#aparteStart').text() == 'Iniciar') { - - $.get('/painel/cronometro', { tipo: 'aparte', action: 'start' } ); - - $('#aparteReset').hide(); - $('#aparte').runner('start'); - $('#aparteStart').text('Parar'); - - } else { - - $.get('/painel/cronometro', { tipo: 'aparte', action: 'stop' } ); - - $('#aparteReset').show(); - $('#aparte').runner('stop'); - $('#aparteStart').text('Iniciar'); + $('#aparteStart').click(function(){ + $.get('/painel/cronometro', { tipo: 'aparte', action: 'start' } ); + $('#aparte').runner('start'); + }); - } + $('#aparteStop').click(function(){ + $.get('/painel/cronometro', { tipo: 'aparte', action: 'stop' } ); + $('#aparte').runner('stop'); }); $('#aparteReset').click(function() { @@ -248,26 +239,14 @@ $(function() { $('#ordemStart').text('Iniciar'); }); + $('#ordemStart').click(function(){ + $.get('/painel/cronometro', { tipo: 'ordem', action: 'start' } ); + $('#ordem').runner('start'); + }); - $('#ordemStart').click(function() { - if ($('#ordemStart').text() == 'Iniciar') { - - $.get('/painel/cronometro', { tipo: 'ordem', action: 'start' } ); - - $('#ordemReset').hide(); - $('#ordem').runner('start'); - $('#ordemStart').text('Parar'); - - - } else { - - $.get('/painel/cronometro', { tipo: 'ordem', action: 'stop' } ); - - $('#ordemReset').show(); - $('#ordem').runner('stop'); - $('#ordemStart').text('Iniciar'); - - } + $('#ordemStop').click(function(){ + $.get('/painel/cronometro', { tipo: 'ordem', action: 'stop' } ); + $('#ordem').runner('stop'); }); $('#ordemReset').click(function() { @@ -304,23 +283,13 @@ $(function() { }); $('#consideracoesStart').click(function(){ - if ($('#consideracoesStart').text() == 'Iniciar') { - - $.get('/painel/cronometro', { tipo: 'consideracoes', action: 'start' } ); - - $('#consideracoesReset').hide(); - $('#consideracoes').runner('start'); - $('#consideracoesStart').text('Parar'); - - } else { - - $.get('/painel/cronometro', { tipo: 'consideracoes', action: 'stop' } ); - - $('#consideracoesReset').show(); - $('#consideracoes').runner('stop'); - $('#consideracoesStart').text('Iniciar'); + $.get('/painel/cronometro', { tipo: 'consideracoes', action: 'start' } ); + $('#consideracoes').runner('start'); + }); - } + $('#consideracoesStop').click(function(){ + $.get('/painel/cronometro', { tipo: 'consideracoes', action: 'stop' } ); + $('#consideracoes').runner('stop'); }); $('#consideracoesReset').click(function() {