rebuilding site Fri May 13 03:12:27 PM CST 2022
[uweb.git] / searchurl / config.js
blob1362c0493eb152794a61413891b957d2c9f84121
1 let labels = ["网页默认字体族","cursive字体族","Fantasy字体族","Fixed字体族","Sans-Serif字体族","Serif字体族"];
2 let names = ["font","cursive","fantasy","fixed","sansserif","serif"];
4 let text;
5 let d=document;
6 if(d.body)
7   text = d.body.innerHTML;
8 else
9   text = "\n".repeat(labels.length-1);
11 let sa = [`<style>input{height:40px;width:100%;border-radius:50px;}</style>
12 <datalist id="family">
13 <option value="sans-serif">
14 <option value="sans-serif-condensed">
15 <option value="sans-serif-smallcaps">
16 <option value="serif">
17 <option value="serif-monospace">
18 <option value="monospace">
19 <option value="cursive">
20 </datalist>
21 <form onsubmit="let d=document;let f=d.forms[0];d.location.href='i:0i/sdcard/uweb/config.html:'+f.font.value+
22 '&'+ f.cursive.value +
23 '&'+ f.fantasy.value +
24 '&'+ f.fixed.value +
25 '&'+ f.sansserif.value +
26 '&'+ f.serif.value +
27 ':https://cdn.jsdelivr.net/gh/torappinfo/uwebzh/searchurl/template/config.html';return false;" accept-charset=utf-8 >`];
30 let strs = text.split('\n');
31 let i=0;
32 for (i = 0; i < labels.length; i++){
33   sa.push("<label>"+labels[i]+"<input list='family' type='text' name='"+names[i]+"' value='"+strs[i]+"'/></label>");
36 sa.push('<input type="submit" value="Save"></form>');
37 let r = sa.join('<br>');
38 d.documentElement.innerHTML = r;