Fixed links when running on another host

This commit is contained in:
Magnus Åhall 2025-08-14 12:28:16 +02:00
parent a8c64767e3
commit e7063c221f

View file

@ -46,7 +46,7 @@ func HandleIndex(w http.ResponseWriter, r *http.Request) {
<script type="text/javascript">
window.goto = (event, fname, search) => {
const instance = document.getElementById('instance').value
fetch(`+"`http://localhost:13700/jumpto?instance=${instance}&file=${fname}&search=${search}&split=${event.shiftKey ? 'yes' : 'no'}`"+`)
fetch(`+"`${location.protocol}//${location.host}/jumpto?instance=${instance}&file=${fname}&search=${search}&split=${event.shiftKey ? 'yes' : 'no'}`"+`)
}
</script>
</head>