mirror of
https://github.com/torappinfo/uweb.git
synced 2024-08-14 23:54:59 +00:00
rebuilding site Mon Nov 15 04:58:53 PM CST 2021
This commit is contained in:
parent
22e0084e70
commit
e31e31fdaf
6 changed files with 33 additions and 26 deletions
|
@ -20,15 +20,20 @@
|
|||
//return await resp.text();
|
||||
}
|
||||
}
|
||||
|
||||
function render(u8array){
|
||||
document.body.innerHTML = window.markdeep.format(new TextDecoder().decode(u8array),true);
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
|
||||
var file;
|
||||
var blocksize = 1024;
|
||||
function loadSlice(){
|
||||
function render(u8array){
|
||||
document.body.innerHTML = window.markdeep.format(new TextDecoder().decode(u8array),true);
|
||||
MathJax.typesetPromise();
|
||||
}
|
||||
function setPageUrl(pageurl){
|
||||
let a = document.createElement('a');
|
||||
a.href = "i:5c"+pageurl;
|
||||
a.click();
|
||||
}
|
||||
|
||||
var url;
|
||||
var page = 1;
|
||||
var extrasize = blocksize; //extrasize should <= blocksize
|
||||
|
@ -41,11 +46,8 @@
|
|||
{//update urlInc() url
|
||||
let href = location.href;
|
||||
let iHash = href.indexOf('#');
|
||||
href="i:5c"+href.substring(0,iHash)+"#page="+Math.floor((offset+len)/blocksize);
|
||||
let d=document;
|
||||
let a = d.createElement('a');
|
||||
a.href = href;
|
||||
a.click();
|
||||
href=href.substring(0,iHash)+"#page="+Math.floor((offset+len)/blocksize);
|
||||
setPageUrl(href);
|
||||
}
|
||||
file.slice(offset,len).then((buffer)=>{
|
||||
let u8 = new Uint8Array(buffer);
|
||||
|
@ -55,7 +57,8 @@
|
|||
}
|
||||
//#page=
|
||||
page = parseInt(lhash.substring(6));
|
||||
}
|
||||
}else
|
||||
setPageUrl(location.href+"#page=1");
|
||||
file.slice(blocksize*(page-1),blocksize+extrasize).then((buffer)=>{
|
||||
let u8 = new Uint8Array(buffer);
|
||||
let u8len = u8.length;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue