mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
adjust mirror order in README
This commit is contained in:
parent
21600e4acf
commit
fbf6635c1a
10 changed files with 48 additions and 18 deletions
30
zh/searchurl/bml/content/codeviewer.js
Normal file
30
zh/searchurl/bml/content/codeviewer.js
Normal file
|
@ -0,0 +1,30 @@
|
|||
let pageH=`<!DOCTYPE html><html><head><style>pre{counter-reset: line;white-space:pre-wrap}
|
||||
pre>code{counter-increment: line;}
|
||||
pre>code:before {
|
||||
content: counter(line);
|
||||
width: 2em;
|
||||
margin-right: 0.5em;
|
||||
color: gray;
|
||||
}
|
||||
</style></head><body><pre>`;
|
||||
let pageT="</pre></body></html>";
|
||||
|
||||
function gen(text) {
|
||||
let d=window.open('').document;
|
||||
d.write(pageH);
|
||||
let t=text.replaceAll('<','<');
|
||||
t = t.replace(/^(.*)$/gm, '<code> $1 </code>');
|
||||
d.write(t);
|
||||
d.write(pageT);
|
||||
d.close();
|
||||
}
|
||||
|
||||
if(document.body){
|
||||
var r=new XMLHttpRequest;
|
||||
r.onload=function(){
|
||||
var t=r.responseText;
|
||||
gen(t);
|
||||
}
|
||||
r.open("GET",location.href,!0);
|
||||
r.send(null);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue