v2c qol: save to query string
All checks were successful
/ build (push) Successful in 35s

This commit is contained in:
Nycki 2025-07-09 13:01:59 -07:00
parent 11bdb1fe9f
commit fd6bee2c5b

View file

@ -128,8 +128,14 @@ for(
<script>
// set default value for input
f.value=(f.value
|| window.location.search.slice(1).replaceAll('%20', ' ').replaceAll('%0a','\n').replaceAll('%0A','\n').replaceAll('%23', '#')
f.value=(
window.location.search.slice(1)
.replaceAll('%20', ' ')
.replaceAll('%0a','\n')
.replaceAll('%0A','\n')
.replaceAll('%23', '#')
.replaceAll('%27', "'")
|| f.value
|| s.value
);
@ -139,7 +145,11 @@ document.querySelector('center p').setAttribute('hidden', 'true');
// add save button
document.querySelector('center p:last-child').innerHTML+=`
<button onclick='
window.location.search = "?"+f.value.replaceAll(" ","%20").replaceAll("\n","%0a").replaceAll("#","%23")
window.location.search = "?"+f.value
.replaceAll(" ","%20")
.replaceAll("\\n","%0a")
.replaceAll("#","%23")
.replaceAll("\\x27","%27")
'>#save</button>
`;
</script>