config.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. let labels = ["Default font","Cursive","Fantasy","Fixed","Sans-Serif","Serif"];
  2. let names = ["font","cursive","fantasy","fixed","sansserif","serif"];
  3. let text;
  4. let d=document;
  5. if(d.body)
  6. text = d.body.innerHTML;
  7. else
  8. text = "\n".repeat(labels.length-1);
  9. let sa = [`<style>input{height:40px;width:100%;border-radius:50px;}</style>
  10. <datalist id="family">
  11. <option value="sans-serif">
  12. <option value="sans-serif-condensed">
  13. <option value="sans-serif-smallcaps">
  14. <option value="serif">
  15. <option value="serif-monospace">
  16. <option value="monospace">
  17. <option value="cursive">
  18. </datalist>
  19. <form onsubmit="let d=document;let f=d.forms[0];d.location.href='i:0i/data/data/info.torinfo.uweb/files/config.html:'+f.font.value+
  20. '&'+ f.cursive.value +
  21. '&'+ f.fantasy.value +
  22. '&'+ f.fixed.value +
  23. '&'+ f.sansserif.value +
  24. '&'+ f.serif.value +
  25. ':https://fastly.jsdelivr.net/gh/torappinfo/uwebzh/searchurl/template/config.html';return false;" accept-charset=utf-8 >`];
  26. let strs = text.split('\n');
  27. let i=0;
  28. for (i = 0; i < labels.length; i++){
  29. sa.push("<label>"+labels[i]+"<input list='family' type='text' name='"+names[i]+"' value='"+strs[i]+"'/></label>");
  30. }
  31. sa.push('<input type="submit" value="Save"></form>');
  32. let r = sa.join('<br>');
  33. d.documentElement.innerHTML = r;