turnero: notificación del sistema cuando vence el countdown de toma progresiva

Usa Web Notifications API via postMessage iframe→parent para alertar
incluso cuando el tab está en segundo plano o la pantalla ocupada.
Pide permiso al iniciar el protocolo (primer gesto del usuario).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-07-21 09:36:23 -05:00
co-authored by Claude Sonnet 4.6
parent 6ce2fc340b
commit 019d2f4fb0
2 changed files with 8 additions and 1 deletions
+1
View File
@@ -2196,6 +2196,7 @@ function _mpIniciarCountdown(targetMsOrMins, nextLabel, nextFirmaId) {
+ (nextLabel ? '<div style="font-size:.85rem;opacity:.9;margin-top:4px">' + nextLabel + '</div>' : '');
if (navigator.vibrate) navigator.vibrate([900,150,900,150,900,150,900,150,900]);
_mpPlayBeep();
try { window.parent.postMessage({ type: 'tomaProgresivaAlerta', label: nextLabel || '¡Siguiente muestra!' }, '*'); } catch(e) {}
// Desbloquear y mostrar siguiente canvas
var nw = nextFirmaId ? document.getElementById('fpw-' + nextFirmaId) : null;
if (!nw) nw = document.querySelector('.firma-pro-widget[style*="display:none"]');