mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
make config.js robust
This commit is contained in:
parent
a894ae8777
commit
68fa9617be
1 changed files with 13 additions and 10 deletions
|
@ -13,16 +13,19 @@ let sa = [`<head><meta charset="utf-8"><meta name="viewport" content="width=devi
|
||||||
<option value="monospace">
|
<option value="monospace">
|
||||||
<option value="cursive">
|
<option value="cursive">
|
||||||
</datalist>
|
</datalist>
|
||||||
<form onsubmit="let d=document;let f=d.forms[0];d.location.href='i:b1Save config.html%0A%0Ai:8lconfig.html%0Ai:0i/data/data/info.torapp.uweb/files/config.html:'
|
<script>
|
||||||
+f.redirecturl.value+
|
function save(){
|
||||||
'&'+ f.downloadpath.value+
|
let d=document;let f=d.forms[0];
|
||||||
'&'+ f.font.value+
|
let inputs = Array.from(f.querySelectorAll('input')).map(input => input.value);
|
||||||
'&'+ f.cursive.value +
|
inputs.pop();
|
||||||
'&'+ f.fantasy.value +
|
inputs.push('<script charset="utf-8" src="https://jamesfengcao.codeberg.page/en/searchurl/config.js"><\\/script>');
|
||||||
'&'+ f.fixed.value +
|
let str = inputs.join('\\n');
|
||||||
'&'+ f.sansserif.value +
|
let url = 'i:b1Save config.html%0A%0Ai:8lconfig.html%0Ai:0lconfig.html:'+btoa(str);
|
||||||
'&'+ f.serif.value +
|
d.location.href=url;
|
||||||
':https://jamesfengcao.codeberg.page/en/searchurl/template/config.html';return false;" accept-charset=utf-8 >`];
|
return false;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<form onsubmit="return save()" accept-charset=utf-8 >`];
|
||||||
|
|
||||||
function gen(text) {
|
function gen(text) {
|
||||||
let strs = text.split('\n');
|
let strs = text.split('\n');
|
||||||
|
|
Loading…
Reference in a new issue