(country)
| 7188 | event.preventDefault(); |
| 7189 | } |
| 7190 | }, { passive: false }); |
| 7191 | target.addEventListener('touchend', function() { pinchStart = null; }, { passive: true }); |
| 7192 | target.addEventListener('touchcancel', function() { pinchStart = null; }, { passive: true }); |
| 7193 | } |
| 7194 | |
| 7195 | function showToast(message, isError) { |
| 7196 | var toast = document.getElementById('toast'); |
| 7197 | toast.textContent = message; |
| 7198 | toast.style.borderColor = isError ? 'rgba(255,111,145,0.35)' : 'rgba(87,214,255,0.35)'; |
| 7199 | toast.classList.add('show'); |
| 7200 | window.clearTimeout(showToast._timer); |
| 7201 | showToast._timer = window.setTimeout(function(){ toast.classList.remove('show'); }, 2600); |
| 7202 | } |
| 7203 | |
| 7204 | async function apiGet(url) { |
| 7205 | var res = await fetch(url, { cache: 'no-store' }); |
| 7206 | var data = await res.json(); |
| 7207 | if (!res.ok || data.ok === false) throw new Error(data.error || ('Request failed: ' + res.status)); |
| 7208 | return data; |
| 7209 | } |
| 7210 | |
| 7211 | async function apiPost(url, body) { |
no test coverage detected