added translations
This commit is contained in:
@@ -0,0 +1 @@
|
||||
const t=window.BOOMCAST_I18N||{};document.querySelectorAll(".audio-preview").forEach(function(o){var n=o.querySelector(".audio-play"),e=o.querySelector("audio"),a=o.querySelector(".audio-play__label"),i=o.querySelector(".audio-status");n.addEventListener("click",function(){e.src||(e.src=n.dataset.audioUrl,n.classList.add("is-loading"),i.textContent=t.loadingRecording||"Loading recording…"),e.paused?e.play().catch(function(){n.classList.remove("is-loading"),i.textContent=t.couldNotPlay||"Could not play this recording."}):e.pause()}),e.addEventListener("playing",function(){n.classList.remove("is-loading"),a.textContent=t.pauseRecording||"Pause recording",i.textContent=t.playingNow||"Playing now"}),e.addEventListener("pause",function(){e.ended||(a.textContent=t.resumeRecording||"Resume recording",i.textContent=t.paused||"Paused")}),e.addEventListener("ended",function(){a.textContent=t.replayRecording||"Replay recording",i.textContent=t.finished||"Finished"}),e.addEventListener("waiting",function(){n.classList.add("is-loading"),i.textContent=t.buffering||"Buffering…"}),e.addEventListener("canplay",function(){n.classList.remove("is-loading")}),e.addEventListener("error",function(){n.classList.remove("is-loading"),i.textContent=t.couldNotLoad||"Could not load this recording."})});
|
||||
@@ -0,0 +1 @@
|
||||
/* empty css */import"./fireworks-home.js-CmXgGYKn.js";import"./map.js-3a1Gpit5.js";import"../../../theme-C3M4iSOd.js";import"../../../manual-report-CpWI_VWJ.js";
|
||||
@@ -0,0 +1 @@
|
||||
/* empty css */import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
/* empty css */import"../../../theme-C3M4iSOd.js";const s=window.BOOMCAST_I18N||{},r=document.querySelector(".upload-form"),n=document.querySelector("#drop-zone"),o=document.querySelector("#audio-file"),i=document.querySelector("#file-name"),a=document.querySelector("#upload-status"),d=e=>{i.textContent=e?e.name:s.noFile||"No file selected"};o.addEventListener("change",()=>d(o.files[0]));["dragenter","dragover"].forEach(e=>n.addEventListener(e,t=>{t.preventDefault(),n.classList.add("dragging")}));["dragleave","drop"].forEach(e=>n.addEventListener(e,t=>{t.preventDefault(),n.classList.remove("dragging")}));n.addEventListener("drop",e=>{const[t]=e.dataTransfer.files;t&&(o.files=e.dataTransfer.files,d(t))});r.addEventListener("htmx:beforeRequest",()=>{a.textContent=s.analysing||"Analysing your recording…",r.setAttribute("aria-busy","true")});r.addEventListener("htmx:afterRequest",()=>{a.textContent="",r.removeAttribute("aria-busy")});r.addEventListener("htmx:responseError",()=>{a.textContent=s.analysisFailed||"Analysis could not be completed."});document.body.addEventListener("htmx:beforeSwap",e=>{e.detail.xhr.status>=400&&(e.detail.shouldSwap=!0,e.detail.isError=!1)});window.addEventListener("pageshow",e=>{e.persisted&&(o.value="",d(),a.textContent="",document.querySelector("#classification-results").replaceChildren())});
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";import"../../../manual-report-CpWI_VWJ.js";
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";const r=document.querySelector(".upload-form"),n=document.querySelector("#drop-zone"),o=document.querySelector("#audio-file"),d=document.querySelector("#file-name"),a=document.querySelector("#upload-status"),s=e=>{d.textContent=e?e.name:"No file selected"};o.addEventListener("change",()=>s(o.files[0]));["dragenter","dragover"].forEach(e=>n.addEventListener(e,t=>{t.preventDefault(),n.classList.add("dragging")}));["dragleave","drop"].forEach(e=>n.addEventListener(e,t=>{t.preventDefault(),n.classList.remove("dragging")}));n.addEventListener("drop",e=>{const[t]=e.dataTransfer.files;t&&(o.files=e.dataTransfer.files,s(t))});r.addEventListener("htmx:beforeRequest",()=>{a.textContent="Analysing your recording…",r.setAttribute("aria-busy","true")});r.addEventListener("htmx:afterRequest",()=>{a.textContent="",r.removeAttribute("aria-busy")});r.addEventListener("htmx:responseError",()=>{a.textContent="Analysis could not be completed."});
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
/* empty css */import"../../../theme-C3M4iSOd.js";const e=window.BOOMCAST_I18N||{},u=document.getElementById("event-map"),f=u.dataset.h3Resolution,t=L.map(u,{zoomControl:!1,scrollWheelZoom:!1}).setView([52.1326,5.2913],7);L.control.zoom({position:"bottomleft"}).addTo(t);const m=L.control({position:"topright"});m.onAdd=()=>{const o=L.DomUtil.create("div","map-compass");return o.setAttribute("role","img"),o.setAttribute("aria-label",e.mapCompass||"Map compass: north is up"),o.innerHTML='<span class="compass-n">N</span><span class="compass-e">E</span><span class="compass-s">S</span><span class="compass-w">W</span><span class="compass-needle">↑</span>',L.DomEvent.disableClickPropagation(o),o};m.addTo(t);L.tileLayer("https://{s}.tile.openstreetmap.de/{z}/{x}/{y}.png",{maxZoom:18,attribution:"© OpenStreetMap contributors"}).addTo(t);const y=JSON.parse(document.getElementById("h3-cells-data").textContent),M=JSON.parse(document.getElementById("map-events-data").textContent),d=L.latLngBounds([]);y.forEach(o=>{L.polygon(o.boundary,{color:"#f59e0b",weight:2,fillColor:"#f59e0b",fillOpacity:.25}).addTo(t).bindPopup('<span class="popup-title">H3 '+o.cell+'</span><span class="popup-meta">'+o.reports+" "+(o.reports===1?e.report||"report":e.reports||"reports")+" · "+o.occurrences+" "+(o.occurrences===1?e.occurrence||"occurrence":e.occurrences||"occurrences")+" · "+(e.resolution||"resolution")+" "+f+"</span>"),d.extend(L.latLngBounds(o.boundary))});function b(o){return["N","NE","E","SE","S","SW","W","NW"][Math.floor((o+22.5)%360/45)]}function v(o,n,s){const c=n*Math.PI/180,i=o[0]*Math.PI/180,h=o[1]*Math.PI/180,r=s/6378137,l=Math.asin(Math.sin(i)*Math.cos(r)+Math.cos(i)*Math.sin(r)*Math.cos(c)),g=h+Math.atan2(Math.sin(c)*Math.sin(r)*Math.cos(i),Math.cos(r)-Math.sin(i)*Math.sin(l));return[l*180/Math.PI,g*180/Math.PI]}const E=L.divIcon({className:"",html:'<div class="report-icon">✦</div>',iconSize:[37,37],iconAnchor:[19,19]});M.forEach(o=>{const n=o.visually_confirmed?e.visuallyConfirmed||"Visually confirmed":e.notVisuallyConfirmed||"Not visually confirmed";let s=o.occurrences+" "+(o.occurrences===1?e.occurrence||"occurrence":e.occurrences||"occurrences")+" · "+n+"<br>"+(e.reported||"Reported")+" "+o.reported_on;if(o.direction_degrees!==null&&(s+="<br>"+(e.compassDirection||"Compass direction")+" "+Math.round(o.direction_degrees)+"° ("+b(o.direction_degrees)+")",o.direction_accuracy_degrees!==null&&(s+=" (±"+Math.round(o.direction_accuracy_degrees)+"°)")),L.marker(o.center,{icon:E}).addTo(t).bindPopup('<span class="popup-title">'+(e.manualReport||"Manual report")+" · H3 "+o.cell+'</span><span class="popup-meta">'+s+"</span>"),o.direction_degrees!==null){const a=v(o.center,o.direction_degrees,900);L.polyline([o.center,a],{color:"#fff7e6",weight:9,opacity:.8}).addTo(t),L.polyline([o.center,a],{color:"#6d45a0",weight:5,opacity:1}).addTo(t);const c=L.divIcon({className:"",html:'<div class="direction-marker"><span style="transform:rotate('+o.direction_degrees+'deg)">↑</span></div>',iconSize:[56,56],iconAnchor:[28,28]});L.marker(a,{icon:c,interactive:!1}).addTo(t)}});d.isValid()&&t.fitBounds(d.pad(.18));const p=document.getElementById("range");p&&document.querySelectorAll("#from-date, #to-date").forEach(o=>{o.addEventListener("change",()=>{p.value="custom"})});
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";
|
||||
@@ -0,0 +1 @@
|
||||
import"../../../theme-C3M4iSOd.js";document.querySelector("#ntfy-url").addEventListener("input",()=>{document.querySelector("#ntfy-test-result").replaceChildren()});
|
||||
@@ -0,0 +1 @@
|
||||
const t=window.BOOMCAST_I18N||{},r=document.querySelector("#manual-report-form"),p=document.querySelector("#manual-submit"),C=document.querySelector("#manual-submission"),b=document.querySelector("#manual-latitude"),w=document.querySelector("#manual-longitude"),y=document.querySelector("#manual-direction-degrees"),v=document.querySelector("#manual-direction-accuracy"),u=document.querySelector("#manual-capture-direction"),n=document.querySelector("#manual-direction-status"),f=document.querySelector("#manual-direction-panel"),S=/Android|iPhone|iPad|iPod|IEMobile|Opera Mini/.test(navigator.userAgent)||navigator.userAgent.includes("Macintosh")&&navigator.maxTouchPoints>1;S&&(f.hidden=!1);let i,s;const d=e=>Number.isFinite(e),x=e=>["N","NE","E","SE","S","SW","W","NW"][Math.floor((e+22.5)%360/45)],g=e=>Number(e.toFixed(1)).toString(),c=()=>{i&&window.removeEventListener("deviceorientation",i),window.clearTimeout(s),i=null,s=null},h=(e,a)=>{const o=a===null?t.accuracyUnavailable||"Accuracy unavailable":(t.accuracy||"Accuracy")+": ±"+g(a)+"°";n.innerHTML="<strong>"+g(e)+"° · "+x(e)+"</strong><br>"+o,u.textContent=t.stopCapture||"Stop direction capture"},q=()=>{c(),n.textContent=t.pointPhone||"Point the top of your phone toward the sound — direction will update live.",i=e=>{const a="webkitCompassHeading"in e,o=d(e.webkitCompassHeading)?e.webkitCompassHeading:!a&&e.absolute&&d(e.alpha)?(360-e.alpha)%360:null;if(o===null||o<0||o>=360)return;const l=d(e.webkitCompassAccuracy)&&e.webkitCompassAccuracy>=0?e.webkitCompassAccuracy:null;y.value=o,v.value=l===null?"":l,h(o,l),window.clearTimeout(s)},window.addEventListener("deviceorientation",i),s=window.setTimeout(()=>{c(),u.textContent=t.captureDirection||"Capture direction",n.textContent=t.compassUnavailable||"Compass unavailable on this device."},15e3)},A=async()=>{if(i){c(),u.textContent=t.captureAgain||"Capture again";return}if(!window.isSecureContext){n.textContent=t.secureCompass||"Compass capture requires a secure HTTPS connection.";return}if(typeof window.DeviceOrientationEvent>"u"){n.textContent=t.compassUnavailable||"Compass unavailable on this device.";return}if(typeof DeviceOrientationEvent.requestPermission=="function"){n.textContent=t.compassPermission||"Requesting compass permission…";try{if(await DeviceOrientationEvent.requestPermission(!0)!=="granted"){n.textContent=t.compassDenied||"Compass permission denied.";return}}catch{n.textContent=t.compassDenied||"Compass permission denied.";return}}q()},m=()=>{c(),p.disabled=!0,window.htmx?htmx.ajax("POST",r.action,{source:r,target:"#manual-submission",swap:"outerHTML"}):r.submit()};u.addEventListener("click",A);p.addEventListener("click",()=>{if(!navigator.geolocation){m();return}C.textContent=t.requestingLocation||"Requesting your optional location…",navigator.geolocation.getCurrentPosition(e=>{b.value=e.coords.latitude,w.value=e.coords.longitude,m()},()=>m(),{enableHighAccuracy:!1,maximumAge:3e5,timeout:1e4})});document.body.addEventListener("htmx:afterRequest",e=>{e.detail.elt===r&&(p.disabled=!1)});
|
||||
@@ -0,0 +1 @@
|
||||
const c="sound-signal-theme",r=new Set(["dark","light"]);function i(){try{const e=window.localStorage.getItem(c);return r.has(e)?e:"dark"}catch{return"dark"}}function o(e,t){if(document.documentElement.dataset.theme=e,!t)return;const a=e==="dark"?"light":"dark",n=window.BOOMCAST_I18N||{};t.textContent=a==="light"?"☀ "+(n.lightMode||"Light mode"):"☾ "+(n.darkMode||"Dark mode"),t.setAttribute("aria-label",a==="light"?n.switchToLight||"Switch to light mode":n.switchToDark||"Switch to dark mode"),t.setAttribute("aria-pressed",String(e==="light"))}function d(){const e=document.querySelector(".theme-toggle")??document.createElement("button");e.isConnected||(e.className="theme-toggle",e.type="button",document.body.append(e)),o(i(),e),e.addEventListener("click",()=>{const t=document.documentElement.dataset.theme==="dark"?"light":"dark";try{window.localStorage.setItem(c,t)}catch{}o(t,e)})}o(i());document.readyState==="loading"?document.addEventListener("DOMContentLoaded",d,{once:!0}):d();
|
||||
Reference in New Issue
Block a user