Revert "turnero: fallback a puerto 8080 si SigWeb no responde en 47289"

This reverts commit 3d035d3699.
This commit is contained in:
Lizandro Guarnizo
2026-07-21 11:24:21 -05:00
parent 3d035d3699
commit 243003ab31
+9 -16
View File
@@ -2528,11 +2528,9 @@ document.querySelectorAll('.turnero-firma-item').forEach(function(widget) {
<script>
// ── Topaz SigWeb ────────────────────────────────────────────────────
const topaz = (() => {
const SIGWEB_URLS = [
'http://localhost:47289/SigWeb/SigWebTablet.js',
'http://localhost:8080/SigWeb/SigWebTablet.js',
];
const SIGWEB_URL = 'http://localhost:47289/SigWeb/SigWebTablet.js';
let _loaded = false, _ctx = null, _target = null, _poll = null;
// _target: { type: 'turnero'|'pro', canvas: CanvasElement, onAccept: fn }
function _call(fn, ...args) {
if (_ctx && typeof _ctx[fn] === 'function') return _ctx[fn](...args);
@@ -2541,20 +2539,15 @@ const topaz = (() => {
throw new Error('SigWeb: ' + fn + ' no encontrado');
}
function _tryLoad(urls) {
if (!urls.length) return Promise.resolve(false);
return new Promise(res => {
const s = document.createElement('script');
s.src = urls[0];
s.onload = () => { _loaded = true; res(true); };
s.onerror = () => _tryLoad(urls.slice(1)).then(res);
document.head.appendChild(s);
});
}
function _loadScript() {
if (_loaded) return Promise.resolve(true);
return _tryLoad(SIGWEB_URLS);
return new Promise(res => {
const s = document.createElement('script');
s.src = SIGWEB_URL;
s.onload = () => { _loaded = true; res(true); };
s.onerror = () => res(false);
document.head.appendChild(s);
});
}
// Detectar disponibilidad al cargar; ocultar botones si no hay pad