rebuilding site Wed Nov 17 03:53:59 PM CST 2021

This commit is contained in:
James Feng Cao 2021-11-17 15:53:59 +08:00
parent ab181535c2
commit c9ab8009d4
5 changed files with 19 additions and 10 deletions

View file

@ -1,4 +1,5 @@
<head>
<base>
<script src="https://cdn.jsdelivr.net/npm/marked@3.0.7/marked.min.js"></script>
<script>
function absFile(url) {
@ -24,6 +25,7 @@
function loadSlice(){
function render(u8array){
document.body.innerHTML = marked(new TextDecoder().decode(u8array));
scroll(0,0);
}
function setPageUrl(pageurl){
let a = document.createElement('a');
@ -31,7 +33,6 @@
a.click();
}
var url;
var page = 1;
var extrasize = blocksize; //extrasize should <= blocksize
let lhash = location.hash;
@ -82,7 +83,11 @@
}
//?url=#offset=&[len]&page=
file = new absFile(location.search.substring(5));
{
let url = location.search.substring(5);
file = new absFile(url);
document.getElementsByTagName('base')[0].href=url;
}
window.addEventListener('hashchange',loadSlice);
</script>
</head>